Skip to content

Commit beef05c

Browse files
committed
(13.02) Sound update + Bosstiary + Health/Mana to uint32_t
1 parent b12cd0d commit beef05c

22 files changed

Lines changed: 3315 additions & 69 deletions

Apps/Extract/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ static FileStream InitializeMapFile(string filename, string outputPath)
849849
// otb major version
850850
WriteData(file, BitConverter.GetBytes((uint)3));
851851
// otb minor version
852-
WriteData(file, BitConverter.GetBytes((uint)56));
852+
WriteData(file, BitConverter.GetBytes((uint)62));
853853

854854
// node map data
855855
file.WriteByte(254);

ClientData/130212601/package.json

Lines changed: 2617 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
![.NET Core](https://github.com/jo3bingham/TibiaAPI/workflows/.NET%20Core/badge.svg)
22

33
# Disclaimer:
4-
The original version of this API included support for all protocols, but on my fork this support was removed. This version was updated to work on protocol v12.85 or higher, using it on older protocols may not work as intended and may not be useful for you.
4+
The original version of this API included support for all protocols, but on my fork this support was removed. This version was updated to work on protocol v13.02 or higher, using it on older protocols may not work as intended and may not be useful for you.
55

66
This TibiaAPI version is still a work in progress and may have bugs.
77

TibiaAPI/Appearances/ObjectInstance.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class ObjectInstance : AppearanceInstance
1616

1717
public byte Tier { get; set; }
1818
public byte PodiumDirection { get; set; }
19-
public byte UnknownDecayByte { get; set; }
19+
public byte IsBrandNew { get; set; }
2020

2121
public OutfitInstance PodiumOutfitInstance { get; set; }
2222
public OutfitInstance PodiumMountInstance { get; set; }

TibiaAPI/Constants/Enums.cs

Lines changed: 99 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,19 @@ public enum GraphicalEffectsType
122122
Effect = 3,
123123
MissileXY = 4,
124124
MissileYX = 5,
125+
SingleSound = 6,
126+
MultipleSound = 7,
125127
Unknown = 0x83
126128
}
127129

130+
public enum SoundSourceType
131+
{
132+
Global = 0,
133+
Own = 1,
134+
Others = 2,
135+
Creatures = 3
136+
}
137+
128138
public enum PreyDataState
129139
{
130140
Locked = 0,
@@ -469,6 +479,8 @@ public enum ClientPacketType
469479
InviteToChannel = 0xAB,
470480
ExcludeFromChannel = 0xAC,
471481
CyclopediaHouseAction = 0xAD,
482+
CyclopediaBosstiary = 0xAE, // 12.90
483+
CyclopediaBossSlots = 0xAF, // 12.90
472484
Highscores = 0xB1,
473485
PreyHuntingTaskAction = 0xBA,
474486
Cancel = 0xBE,
@@ -536,20 +548,44 @@ public enum ClientPacketType
536548
public enum ServerPacketType
537549
{
538550
Invalid = 0x00,
551+
// 0x01 - Do not exist
552+
// 0x02 - Do not exist
539553
CreatureData = 0x03,
540554
SessionDumpStart = 0x04,
555+
// 0x05 - Do not exist
556+
// 0x06 - Do not exist
557+
// 0x07 - Do not exist
558+
// 0x08 - Do not exist
559+
// 0x09 - Do not exist
541560
PendingStateEntered = 0x0A,
542561
ReadyForSecondaryConnection = 0x0B,
562+
// 0x0C - Do not exist
563+
// 0x0D - Do not exist
543564
WorldEntered = 0x0F,
565+
// 0x10 - Do not exist
566+
// 0x11 - Do not exist
567+
// 0x12 - Do not exist
568+
// 0x13 - Do not exist
544569
LoginError = 0x14,
545570
LoginAdvice = 0x15,
546571
LoginWait = 0x16,
547572
LoginSuccess = 0x17,
548573
LogoutSession = 0x18,
549574
StoreButtonIndicators = 0x19,
575+
// 0x1A - Do not exist
576+
// 0x1B - Do not exist
577+
// 0x1C - Do not exist
550578
Ping = 0x1D,
551579
PingBack = 0x1E,
552580
LoginChallenge = 0x1F,
581+
// 0x20 - Do not exist
582+
// 0x21 - Do not exist
583+
// 0x22 - Do not exist
584+
// 0x23 - Do not exist
585+
// 0x24 - Do not exist
586+
// 0x25 - Do not exist
587+
// 0x26 - Do not exist
588+
// 0x27 - Do not exist
553589
Dead = 0x28,
554590
Stash = 0x29,
555591
//DepotTileState = 0x2A,
@@ -558,6 +594,57 @@ public enum ServerPacketType
558594
//SpecialContainersAvailable = 0x2C,
559595
TeamFinderTeamLeader = 0x2C,
560596
TeamFinderTeamMember = 0x2D,
597+
// 0x2F - Do not exist
598+
// 0x30 - Do not exist
599+
// 0x31 - Do not exist
600+
// 0x32 - Do not exist
601+
// 0x33 - Do not exist
602+
// 0x34 - Do not exist
603+
// 0x35 - Do not exist
604+
// 0x36 - Do not exist
605+
// 0x37 - Do not exist
606+
// 0x38 - Do not exist
607+
// 0x39 - Do not exist
608+
// 0x3A - Do not exist
609+
// 0x3B - Do not exist
610+
// 0x3C - Do not exist
611+
// 0x3D - Do not exist
612+
// 0x3F - Do not exist
613+
// 0x40 - Do not exist
614+
// 0x41 - Do not exist
615+
// 0x42 - Do not exist
616+
// 0x43 - Do not exist
617+
// 0x44 - Do not exist
618+
// 0x45 - Do not exist
619+
// 0x46 - Do not exist
620+
// 0x47 - Do not exist
621+
// 0x48 - Do not exist
622+
// 0x49 - Do not exist
623+
// 0x4A - Do not exist
624+
// 0x4B - Do not exist
625+
// 0x4C - Do not exist
626+
// 0x4D - Do not exist
627+
// 0x4E - Do not exist
628+
// 0x4F - Do not exist
629+
// 0x50 - Do not exist
630+
// 0x51 - Do not exist
631+
// 0x52 - Do not exist
632+
// 0x53 - Do not exist
633+
// 0x54 - Do not exist
634+
// 0x55 - Do not exist
635+
// 0x56 - Do not exist
636+
// 0x57 - Do not exist
637+
// 0x58 - Do not exist
638+
// 0x59 - Do not exist
639+
// 0x5A - Do not exist
640+
// 0x5B - Do not exist
641+
// 0x5C - Do not exist
642+
// 0x5D - Do not exist
643+
// 0x5E - Do not exist
644+
// 0x5F - Do not exist
645+
// 0x60 - Do not exist
646+
BosstiaryData = 0x61,
647+
CyclopediaBossSlots = 0x62, // 12.90
561648
ClientCheck = 0x63,
562649
FullMap = 0x64,
563650
TopRow = 0x65,
@@ -574,6 +661,7 @@ public enum ServerPacketType
574661
CreateInContainer = 0x70,
575662
ChangeInContainer = 0x71,
576663
DeleteInContainer = 0x72,
664+
CyclopediaBosstiary = 0x73, // 12.90
577665
FriendSystemData = 0x74,
578666
ScreenshotEvent = 0x75,
579667
InspectionList = 0x76,
@@ -587,12 +675,16 @@ public enum ServerPacketType
587675
CounterOffer = 0x7E,
588676
CloseTrade = 0x7F,
589677
CharacterTradeConfiguration = 0x80,
678+
// 0x81 - Report text 1(U32) + 2(U16)
590679
Ambiente = 0x82,
591680
GraphicalEffects = 0x83,
592681
RemoveGraphicalEffect = 0x84,
593-
MissileEffect = 0x85,
682+
Anthem = 0x85,
594683
ForgingBasicData = 0x86,
595684
Trappers = 0x87,
685+
// 0x88 - 2(U16) + 1(U8)
686+
// 0x89 - No more bytes
687+
// 0x8A - Fusion result 2(U8) + 2(U16) + 1(U8)
596688
CreatureUpdate = 0x8B,
597689
CreatureHealth = 0x8C,
598690
CreatureLight = 0x8D,
@@ -631,6 +723,7 @@ public enum ServerPacketType
631723
PrivateChannel = 0xAD,
632724
EditGuildMessage = 0xAE,
633725
ExperienceTracker = 0xAF,
726+
// 0xB0 - Golden memorial 3(U32) + 12(U16)
634727
Highscores = 0xB1,
635728
OpenOwnChannel = 0xB2,
636729
CloseChannel = 0xB3,
@@ -642,10 +735,13 @@ public enum ServerPacketType
642735
BestiaryTracker = 0xB9,
643736
PreyHuntingTaskBaseData = 0xBA,
644737
PreyHuntingTaskData = 0xBB,
738+
// 0xBC - No more bytes
739+
BossCooldown = 0xBD,
645740
TopFloor = 0xBE,
646741
BottomFloor = 0xBF,
647742
UpdateLootContainers = 0xC0,
648743
PlayerDataTournament = 0xC1,
744+
BossPodium = 0xC2,
649745
CyclopediaHouseActionResult = 0xC3,
650746
TournamentInformation = 0xC4,
651747
TournamentLeaderboard = 0xC5,
@@ -706,6 +802,7 @@ public enum ServerPacketType
706802
StoreCategories = 0xFB,
707803
StoreOffers = 0xFC,
708804
TransactionHistory = 0xFD,
709-
StoreSuccess = 0xFE
805+
StoreSuccess = 0xFE,
806+
// 0xFF - Do not exist
710807
}
711808
}

TibiaAPI/Network/ClientPacket.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,10 @@ public static ClientPacket CreateInstance(Client client, ClientPacketType type)
304304
return new ClientPackets.OpenTransactionHistory(client);
305305
case ClientPacketType.GetTransactionHistory:
306306
return new ClientPackets.GetTransactionHistory(client);
307+
case ClientPacketType.CyclopediaBossSlots:
308+
return new ClientPackets.CyclopediaBossSlots(client);
309+
case ClientPacketType.CyclopediaBosstiary:
310+
return new ClientPackets.CyclopediaBosstiary(client);
307311
default:
308312
throw new Exception($"[ClientPacket.Create] Invalid packet type: {type}");
309313
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using OXGaming.TibiaAPI.Constants;
2+
3+
namespace OXGaming.TibiaAPI.Network.ClientPackets
4+
{
5+
public class CyclopediaBossSlots : ClientPacket
6+
{
7+
8+
public CyclopediaBossSlots(Client client)
9+
{
10+
Client = client;
11+
PacketType = ClientPacketType.CyclopediaBossSlots;
12+
}
13+
14+
public override void ParseFromNetworkMessage(NetworkMessage message)
15+
{
16+
}
17+
18+
public override void AppendToNetworkMessage(NetworkMessage message)
19+
{
20+
message.Write((byte)ClientPacketType.CyclopediaBossSlots);
21+
}
22+
}
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using OXGaming.TibiaAPI.Constants;
2+
3+
namespace OXGaming.TibiaAPI.Network.ClientPackets
4+
{
5+
public class CyclopediaBosstiary : ClientPacket
6+
{
7+
8+
public CyclopediaBosstiary(Client client)
9+
{
10+
Client = client;
11+
PacketType = ClientPacketType.CyclopediaBosstiary;
12+
}
13+
14+
public override void ParseFromNetworkMessage(NetworkMessage message)
15+
{
16+
}
17+
18+
public override void AppendToNetworkMessage(NetworkMessage message)
19+
{
20+
message.Write((byte)ClientPacketType.CyclopediaBosstiary);
21+
}
22+
}
23+
}

TibiaAPI/Network/ClientPackets/MarketBrowse.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
using OXGaming.TibiaAPI.Constants;
2+
using System;
23

34
namespace OXGaming.TibiaAPI.Network.ClientPackets
45
{
56
public class MarketBrowse : ClientPacket
67
{
8+
public byte Tier { get; set; }
79
public byte Type { get; set; }
810
public ushort ObjectId { get; set; }
911

@@ -21,6 +23,14 @@ public override void ParseFromNetworkMessage(NetworkMessage message)
2123
// Type '3' means 'item browse'
2224
if (Type == 3) {
2325
ObjectId = message.ReadUInt16();
26+
var objectInstance = Client.AppearanceStorage.CreateObjectInstance(ObjectId, 0);
27+
if (objectInstance == null || objectInstance.Type == null)
28+
throw new Exception($"[MarketBrowse.ParseFromNetworkMessage] Invalid object id: {ObjectId}");
29+
30+
31+
if (objectInstance.Type.Flags.Upgradeclassification != null && objectInstance.Type.Flags.Upgradeclassification.UpgradeClassification > 0) {
32+
Tier = message.ReadByte();
33+
}
2434
}
2535
}
2636

@@ -30,6 +40,13 @@ public override void AppendToNetworkMessage(NetworkMessage message)
3040
message.Write(Type);
3141
if (Type == 3) {
3242
message.Write(ObjectId);
43+
var objectInstance = Client.AppearanceStorage.CreateObjectInstance(ObjectId, 0);
44+
if (objectInstance == null || objectInstance.Type == null)
45+
throw new Exception($"[MarketBrowse.AppendToNetworkMessage] Invalid object id: {ObjectId}");
46+
47+
if (objectInstance.Type.Flags.Upgradeclassification != null && objectInstance.Type.Flags.Upgradeclassification.UpgradeClassification > 0) {
48+
message.Write(Tier);
49+
}
3350
}
3451
}
3552
}

0 commit comments

Comments
 (0)