Skip to content

Commit

Permalink
Some adjustments and extensions for the network protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
sven-n committed Oct 5, 2024
1 parent e59c1a7 commit f704508
Show file tree
Hide file tree
Showing 56 changed files with 4,762 additions and 559 deletions.
2 changes: 2 additions & 0 deletions docs/Packets/C1-11-ObjectHitExtended_by-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ The damage is shown at the object which received the hit.
| 3 << 6 | 1 bit | Boolean | | IsDoubleDamage |
| 3 << 7 | 1 bit | Boolean | | IsTripleDamage |
| 4 | 2 | ShortLittleEndian | | ObjectId |
| 6 | 1 | Byte | | HealthStatus; Gets or sets the status of the remaining health in fractions of 1/250. |
| 7 | 1 | Byte | | ShieldStatus; Gets or sets the status of the remaining shield in fractions of 1/250. |
| 8 | 4 | IntegerLittleEndian | | HealthDamage |
| 12 | 4 | IntegerLittleEndian | | ShieldDamage |

Expand Down
18 changes: 9 additions & 9 deletions docs/Packets/C1-25-AppearanceChangedExtended_by-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ The appearance of the player is updated.
| Index | Length | Data Type | Value | Description |
|-------|--------|-----------|-------|-------------|
| 0 | 1 | Byte | 0xC1 | [Packet type](PacketTypes.md) |
| 1 | 1 | Byte | 10 | Packet header - length of the packet |
| 1 | 1 | Byte | 14 | Packet header - length of the packet |
| 2 | 1 | Byte | 0x25 | Packet header - packet type identifier |
| 3 | 2 | ShortLittleEndian | | ChangedPlayerId |
| 5 | 4 bit | Byte | | ItemSlot |
| 5 | 4 bit | Byte | | ItemGroup |
| 6 | 2 | ShortLittleEndian | | ItemNumber |
| 8 | 1 | Byte | | ItemLevel |
| 9 << 0 | 1 bit | Boolean | | IsExcellent |
| 9 << 1 | 1 bit | Boolean | | IsAncient |
| 9 << 2 | 1 bit | Boolean | | IsAncientSetComplete |
| 4 | 2 | ShortLittleEndian | | ChangedPlayerId |
| 6 | 1 | Byte | | ItemSlot |
| 7 | 1 | Byte | | ItemGroup |
| 8 | 2 | ShortLittleEndian | | ItemNumber |
| 10 | 1 | Byte | | ItemLevel |
| 11 | 1 | Byte | | ExcellentFlags |
| 12 | 1 | Byte | | AncientDiscriminator |
| 13 | 1 | Boolean | | IsAncientSetComplete |
39 changes: 39 additions & 0 deletions docs/Packets/C1-3F-06-PlayerShopBuyResultExtended_by-server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# C1 3F 06 - PlayerShopBuyResultExtended (by server)

## Is sent when

After the player requested to buy an item of a shop of another player.

## Causes the following actions on the client side

The result is shown to the player. If successful, the item is added to the inventory.

## Structure

| Index | Length | Data Type | Value | Description |
|-------|--------|-----------|-------|-------------|
| 0 | 1 | Byte | 0xC1 | [Packet type](PacketTypes.md) |
| 1 | 1 | Byte | | Packet header - length of the packet |
| 2 | 1 | Byte | 0x3F | Packet header - packet type identifier |
| 3 | 1 | Byte | 0x06 | Packet header - sub packet type identifier |
| 4 | 2 | ShortLittleEndian | | SellerId |
| 6 | 1 | ResultKind | | Result |
| 8 | 1 | Byte | | ItemSlot |
| 9 | | Binary | | ItemData |

### ResultKind Enum

The kind of result.

| Value | Name | Description |
|-------|------|-------------|
| 0 | Undefined | Undefined result. |
| 1 | Success | The item has been bought successfully. |
| 2 | NotAvailable | The seller is not available. |
| 3 | ShopNotOpened | The requested player has no open shop. |
| 4 | InTransaction | The requested player is already in a transaction with another player. |
| 5 | InvalidShopSlot | The requested item slot is invalid. |
| 6 | NameMismatchOrPriceMissing | The requested player with the specified id has a different name or price is missing. |
| 7 | LackOfMoney | The player has not enough money to buy the item from the seller. |
| 8 | MoneyOverflowOrNotEnoughSpace | The selling player cannot sell the item, because the sale would overflow his money amount in the inventory. Another possibility is that the inventory of the buyer cannot take the item. |
| 9 | ItemBlock | The requested player has item block active. |
39 changes: 39 additions & 0 deletions docs/Packets/C1-3F-06-PlayerShopBuyResult_by-server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# C1 3F 06 - PlayerShopBuyResult (by server)

## Is sent when

After the player requested to buy an item of a shop of another player.

## Causes the following actions on the client side

The result is shown to the player. If successful, the item is added to the inventory.

## Structure

| Index | Length | Data Type | Value | Description |
|-------|--------|-----------|-------|-------------|
| 0 | 1 | Byte | 0xC1 | [Packet type](PacketTypes.md) |
| 1 | 1 | Byte | 21 | Packet header - length of the packet |
| 2 | 1 | Byte | 0x3F | Packet header - packet type identifier |
| 3 | 1 | Byte | 0x06 | Packet header - sub packet type identifier |
| 4 | 1 | ResultKind | | Result |
| 5 | 2 | ShortBigEndian | | SellerId |
| 8 | 13 | Binary | | ItemData |
| 20 | 1 | Byte | | ItemSlot |

### ResultKind Enum

The kind of result.

| Value | Name | Description |
|-------|------|-------------|
| 0 | Undefined | Undefined result. |
| 1 | Success | The item has been bought successfully. |
| 2 | NotAvailable | The seller is not available. |
| 3 | ShopNotOpened | The requested player has no open shop. |
| 4 | InTransaction | The requested player is already in a transaction with another player. |
| 5 | InvalidShopSlot | The requested item slot is invalid. |
| 6 | NameMismatchOrPriceMissing | The requested player with the specified id has a different name or price is missing. |
| 7 | LackOfMoney | The player has not enough money to buy the item from the seller. |
| 8 | MoneyOverflowOrNotEnoughSpace | The selling player cannot sell the item, because the sale would overflow his money amount in the inventory. Another possibility is that the inventory of the buyer cannot take the item. |
| 9 | ItemBlock | The requested player has item block active. |
90 changes: 90 additions & 0 deletions docs/Packets/C1-F6-0C-QuestProgressExtended_by-server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# C1 F6 0C - QuestProgressExtended (by server)

## Is sent when

First, after the game client requested to initialize a quest and the quest is already active. Second, after the game client requested the next quest step.

## Causes the following actions on the client side

The client shows the quest progress accordingly.

## Structure

| Index | Length | Data Type | Value | Description |
|-------|--------|-----------|-------|-------------|
| 0 | 1 | Byte | 0xC1 | [Packet type](PacketTypes.md) |
| 1 | 1 | Byte | 272 | Packet header - length of the packet |
| 2 | 1 | Byte | 0xF6 | Packet header - packet type identifier |
| 3 | 1 | Byte | 0x0C | Packet header - sub packet type identifier |
| 5 | 1 | Byte | | ConditionCount |
| 6 | 1 | Byte | | RewardCount |
| 7 | 1 | Byte | | RandomRewardCount |
| 8 | 2 | ShortLittleEndian | | QuestNumber |
| 10 | 2 | ShortLittleEndian | | QuestGroup |
| 12 | QuestConditionExtended.Length * ConditionCount | Array of QuestConditionExtended | | Conditions |
| 152 | QuestRewardExtended.Length * RewardCount | Array of QuestRewardExtended | | Rewards |

### QuestConditionExtended Structure

Defines a condition which must be fulfilled to complete the quest.

Length: 28 Bytes

| Index | Length | Data Type | Value | Description |
|-------|--------|-----------|-------|-------------|
| 0 | 1 | ConditionType | | Type |
| 2 | 2 | ShortLittleEndian | | RequirementId; Depending on the condition type, this field contains the identifier of the required thing, e.g. Monster Number, Item Id, Level. |
| 4 | 4 | IntegerLittleEndian | | RequiredCount |
| 8 | 4 | IntegerLittleEndian | | CurrentCount |
| 12 | 15 | Binary | | RequiredItemData; If the condition type is 'Item', this field contains the item data, excluding the item id. The item id can be found in the RequirementId field. |

### ConditionType Enum

Defines the type of the condition.

| Value | Name | Description |
|-------|------|-------------|
| 0 | None | No condition is defined. |
| 1 | MonsterKills | The condition is to kill a specified amount of specified monsters. |
| 2 | Skill | The condition is to learn a specified skill. |
| 4 | Item | The condition is to find a specified item and to have it in the inventory. |
| 8 | Level | The condition is to reach the specified character level. |
| 16 | ClientAction | The condition is a client action. For example, this may be the completion of a tutorial. |
| 32 | RequestBuff | The condition is to request a buff from an NPC. |
| 64 | EventMapPlayerKills | The condition is to kill a specific amount of players in an event. |
| 65 | EventMapMonsterKills | The condition is to kill a specific amount of monsters in an event. |
| 66 | BloodCastleGate | The condition is to destroy the blood castle gate. |
| 256 | WinBloodCastle | The condition is to win the blood castle event. |
| 257 | WinChaosCastle | The condition is to win the chaos castle. |
| 258 | WinDevilSquare | The condition is to win the devil square event. |
| 259 | WinIllusionTemple | The condition is to win the illusion temple event. |
| 260 | DevilSquarePoints | The condition is to reach a specific amount of points in the devil square event. |
| 261 | Money | The condition is to give a specific amount of zen. |
| 262 | PvpPoints | The condition is to reach a specific amount of PVP points. |
| 263 | NpcTalk | The condition is to talk to a specific NPC. |

### QuestRewardExtended Structure

Defines a reward which is given when the quest is completed.

Length: 24 Bytes

| Index | Length | Data Type | Value | Description |
|-------|--------|-----------|-------|-------------|
| 0 | 1 | RewardType | | Type |
| 2 | 2 | ShortLittleEndian | | RewardId; Depending on the condition type, this field contains the identifier of the required thing, e.g. Monster Number, Item Id, Level. |
| 4 | 4 | IntegerLittleEndian | | RewardCount |
| 8 | 15 | Binary | | RewardedItemData; If the reward type is 'Item', this field contains its item data. |

### RewardType Enum

Defines the reward which is given when the quest is completed.

| Value | Name | Description |
|-------|------|-------------|
| 0 | None | No reward is defined. |
| 1 | Experience | The reward is added experience to the character. |
| 2 | Money | The reward is added money to the inventory. |
| 4 | Item | The reward is an item which is added to the inventory. |
| 16 | GensContribution | The reward is added gens contribution points. |
| 32 | Random | The reward is random?. |
14 changes: 13 additions & 1 deletion docs/Packets/C1-F6-0C-QuestProgress_by-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,17 @@ Defines the type of the condition.
| 8 | Level | The condition is to reach the specified character level. |
| 16 | ClientAction | The condition is a client action. For example, this may be the completion of a tutorial. |
| 32 | RequestBuff | The condition is to request a buff from an NPC. |
| 64 | EventMapPlayerKills | The condition is to kill a specific amount of players in an event. |
| 65 | EventMapMonsterKills | The condition is to kill a specific amount of monsters in an event. |
| 66 | BloodCastleGate | The condition is to destroy the blood castle gate. |
| 256 | WinBloodCastle | The condition is to win the blood castle event. |
| 257 | WinChaosCastle | The condition is to win the chaos castle. |
| 258 | WinDevilSquare | The condition is to win the devil square event. |
| 259 | WinIllusionTemple | The condition is to win the illusion temple event. |
| 260 | DevilSquarePoints | The condition is to reach a specific amount of points in the devil square event. |
| 261 | Money | The condition is to give a specific amount of zen. |
| 262 | PvpPoints | The condition is to reach a specific amount of PVP points. |
| 263 | NpcTalk | The condition is to talk to a specific NPC. |

### QuestReward Structure

Expand All @@ -74,4 +85,5 @@ Defines the reward which is given when the quest is completed.
| 1 | Experience | The reward is added experience to the character. |
| 2 | Money | The reward is added money to the inventory. |
| 4 | Item | The reward is an item which is added to the inventory. |
| 16 | GensContribution | The reward is added gens contribution points. |
| 16 | GensContribution | The reward is added gens contribution points. |
| 32 | Random | The reward is random?. |
14 changes: 13 additions & 1 deletion docs/Packets/C1-F6-1B-QuestState_by-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@ Defines the type of the condition.
| 8 | Level | The condition is to reach the specified character level. |
| 16 | ClientAction | The condition is a client action. For example, this may be the completion of a tutorial. |
| 32 | RequestBuff | The condition is to request a buff from an NPC. |
| 64 | EventMapPlayerKills | The condition is to kill a specific amount of players in an event. |
| 65 | EventMapMonsterKills | The condition is to kill a specific amount of monsters in an event. |
| 66 | BloodCastleGate | The condition is to destroy the blood castle gate. |
| 256 | WinBloodCastle | The condition is to win the blood castle event. |
| 257 | WinChaosCastle | The condition is to win the chaos castle. |
| 258 | WinDevilSquare | The condition is to win the devil square event. |
| 259 | WinIllusionTemple | The condition is to win the illusion temple event. |
| 260 | DevilSquarePoints | The condition is to reach a specific amount of points in the devil square event. |
| 261 | Money | The condition is to give a specific amount of zen. |
| 262 | PvpPoints | The condition is to reach a specific amount of PVP points. |
| 263 | NpcTalk | The condition is to talk to a specific NPC. |

### QuestReward Structure

Expand All @@ -75,4 +86,5 @@ Defines the reward which is given when the quest is completed.
| 1 | Experience | The reward is added experience to the character. |
| 2 | Money | The reward is added money to the inventory. |
| 4 | Item | The reward is an item which is added to the inventory. |
| 16 | GensContribution | The reward is added gens contribution points. |
| 16 | GensContribution | The reward is added gens contribution points. |
| 32 | Random | The reward is random?. |
42 changes: 42 additions & 0 deletions docs/Packets/C2-12-AddCharacterToScopeExtended_by-server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# C2 12 - AddCharacterToScopeExtended (by server)

## Is sent when

One or more character got into the observed scope of the player.

## Causes the following actions on the client side

The client adds the character to the shown map.

## Structure

| Index | Length | Data Type | Value | Description |
|-------|--------|-----------|-------|-------------|
| 0 | 1 | Byte | 0xC2 | [Packet type](PacketTypes.md) |
| 1 | 2 | Short | | Packet header - length of the packet |
| 3 | 1 | Byte | 0x12 | Packet header - packet type identifier |
| 4 | 2 | ShortLittleEndian | | Id |
| 6 | 1 | Byte | | CurrentPositionX |
| 7 | 1 | Byte | | CurrentPositionY |
| 8 | 1 | Byte | | TargetPositionX |
| 9 | 1 | Byte | | TargetPositionY |
| 10 | 4 bit | Byte | | Rotation |
| 10 << 0 | 4 bit | CharacterHeroState | | HeroState |
| 12 | 2 | ShortLittleEndian | | AttackSpeed |
| 14 | 2 | ShortLittleEndian | | MagicSpeed |
| 16 | 10 | String | | Name |
| 26 | | Binary | | AppearanceAndEffects |

### CharacterHeroState Enum

Defines the hero state of a character.

| Value | Name | Description |
|-------|------|-------------|
| 0 | New | The character is new and has the highest state. |
| 1 | Hero | The character is a hero. |
| 2 | LightHero | The character is a hero, but the state is almost gone. |
| 3 | Normal | The character is in a neutral state. |
| 4 | PlayerKillWarning | The character killed another character, and has a kill warning. |
| 5 | PlayerKiller1stStage | The character killed two characters, and has some restrictions. |
| 6 | PlayerKiller2ndStage | The character killed more than two characters, and has hard restrictions. |
22 changes: 22 additions & 0 deletions docs/Packets/C2-2F-MoneyDroppedExtended_by-server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# C2 2F - MoneyDroppedExtended (by server)

## Is sent when

Money dropped on the ground.

## Causes the following actions on the client side

The client adds the money to the ground.

## Structure

| Index | Length | Data Type | Value | Description |
|-------|--------|-----------|-------|-------------|
| 0 | 1 | Byte | 0xC2 | [Packet type](PacketTypes.md) |
| 1 | 2 | Short | 12 | Packet header - length of the packet |
| 3 | 1 | Byte | 0x2F | Packet header - packet type identifier |
| 3 | 1 | Boolean | | IsFreshDrop; If this flag is set, the money is added to the map with an animation and sound. Otherwise, it's just added like it was already on the ground before. |
| 4 | 2 | ShortLittleEndian | | Id |
| 6 | 1 | Byte | | PositionX |
| 7 | 1 | Byte | | PositionY |
| 8 | 4 | IntegerLittleEndian | | Amount |
10 changes: 5 additions & 5 deletions docs/Packets/C2-3F-05-PlayerShopItemListExtended_by-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ Data of an item in a player shop, which allows for dynamic item sizes and trades

| Index | Length | Data Type | Value | Description |
|-------|--------|-----------|-------|-------------|
| 0 | 1 | Byte | | ItemSlot |
| 4 | 4 | IntegerLittleEndian | | MoneyPrice |
| 8 | 2 | ShortLittleEndian | | PriceItemType; Contains the item group in the highest 4 bits, and the item number in the remaining ones. |
| 9 | 2 | ShortLittleEndian | | RequiredItemAmount |
| 11 | | Binary | | ItemData |
| 0 | 4 | IntegerLittleEndian | | MoneyPrice |
| 4 | 2 | ShortLittleEndian | | PriceItemType; Contains the item group in the highest 4 bits, and the item number in the remaining ones. |
| 6 | 2 | ShortLittleEndian | | RequiredItemAmount |
| 8 | 1 | Byte | | ItemSlot |
| 9 | | Binary | | ItemData |

### ActionKind Enum

Expand Down
Loading

0 comments on commit f704508

Please sign in to comment.