Skip to content

Commit

Permalink
Extended protocol to solve some limitations
Browse files Browse the repository at this point in the history
Now we can transmit values of Health, Shield, Mana, AG, Damage, Experience above 65k. I widened all to 32 bit.
Additionally, I added a message to add more than one statpoint at a time.

These changes will be added to my MuMain sources soon as well.
  • Loading branch information
sven-n committed Sep 24, 2024
1 parent 9f35daf commit 50489a9
Show file tree
Hide file tree
Showing 36 changed files with 10,009 additions and 4,666 deletions.
38 changes: 38 additions & 0 deletions docs/Packets/C1-11-ObjectHitExtended_by-server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# C1 11 - ObjectHitExtended (by server)

## Is sent when

An object got hit in two cases: 1. When the own player is hit; 2. When the own player attacked some other object which got hit.

## Causes the following actions on the client side

The damage is shown at the object which received the hit.

## Structure

| Index | Length | Data Type | Value | Description |
|-------|--------|-----------|-------|-------------|
| 0 | 1 | Byte | 0xC1 | [Packet type](PacketTypes.md) |
| 1 | 1 | Byte | 16 | Packet header - length of the packet |
| 2 | 1 | Byte | 0x11 | Packet header - packet type identifier |
| 3 << 0 | 4 bit | DamageKind | | Kind |
| 3 << 6 | 1 bit | Boolean | | IsDoubleDamage |
| 3 << 7 | 1 bit | Boolean | | IsTripleDamage |
| 4 | 2 | ShortLittleEndian | | ObjectId |
| 8 | 4 | IntegerLittleEndian | | HealthDamage |
| 12 | 4 | IntegerLittleEndian | | ShieldDamage |

### DamageKind Enum

Defines the kind of the damage.

| Value | Name | Description |
|-------|------|-------------|
| 0 | NormalRed | Red color, used by normal damage. |
| 1 | IgnoreDefenseCyan | Cyan color, usually used by ignore defense damage. |
| 2 | ExcellentLightGreen | Light green color, usually used by excellent damage. |
| 3 | CriticalBlue | Blue color, usually used by critical damage. |
| 4 | LightPink | Light pink color. |
| 5 | PoisonDarkGreen | Dark green color, usually used by poison damage. |
| 6 | ReflectedDarkPink | Dark pink color, usually used by reflected damage. |
| 7 | White | White color. |
20 changes: 20 additions & 0 deletions docs/Packets/C1-26-FD-ItemConsumptionFailedExtended_by-server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# C1 26 FD - ItemConsumptionFailedExtended (by server)

## Is sent when

When the consumption of an item failed.

## Causes the following actions on the client side

The game client gets a feedback about a failed consumption, and allows for do further consumption requests.

## Structure

| Index | Length | Data Type | Value | Description |
|-------|--------|-----------|-------|-------------|
| 0 | 1 | Byte | 0xC1 | [Packet type](PacketTypes.md) |
| 1 | 1 | Byte | 12 | Packet header - length of the packet |
| 2 | 1 | Byte | 0x26 | Packet header - packet type identifier |
| 3 | 1 | Byte | 0xFD | Packet header - sub packet type identifier |
| 4 | 4 | IntegerLittleEndian | | Health |
| 8 | 4 | IntegerLittleEndian | | Shield |
20 changes: 20 additions & 0 deletions docs/Packets/C1-26-FE-MaximumHealthAndShieldExtended_by-server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# C1 26 FE - MaximumHealthAndShieldExtended (by server)

## Is sent when

When the maximum health changed, e.g. by adding stat points or changed items.

## Causes the following actions on the client side

The health and shield bar is updated on the game client user interface.

## Structure

| Index | Length | Data Type | Value | Description |
|-------|--------|-----------|-------|-------------|
| 0 | 1 | Byte | 0xC1 | [Packet type](PacketTypes.md) |
| 1 | 1 | Byte | 12 | Packet header - length of the packet |
| 2 | 1 | Byte | 0x26 | Packet header - packet type identifier |
| 3 | 1 | Byte | 0xFE | Packet header - sub packet type identifier |
| 4 | 4 | IntegerLittleEndian | | Health |
| 8 | 4 | IntegerLittleEndian | | Shield |
20 changes: 20 additions & 0 deletions docs/Packets/C1-26-FF-CurrentHealthAndShieldExtended_by-server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# C1 26 FF - CurrentHealthAndShieldExtended (by server)

## Is sent when

Periodically, or if the current health or shield changed on the server side, e.g. by hits.

## Causes the following actions on the client side

The health and shield bar is updated on the game client user interface.

## Structure

| Index | Length | Data Type | Value | Description |
|-------|--------|-----------|-------|-------------|
| 0 | 1 | Byte | 0xC1 | [Packet type](PacketTypes.md) |
| 1 | 1 | Byte | 12 | Packet header - length of the packet |
| 2 | 1 | Byte | 0x26 | Packet header - packet type identifier |
| 3 | 1 | Byte | 0xFF | Packet header - sub packet type identifier |
| 4 | 4 | IntegerLittleEndian | | Health |
| 8 | 4 | IntegerLittleEndian | | Shield |
20 changes: 20 additions & 0 deletions docs/Packets/C1-27-FE-MaximumManaAndAbilityExtended_by-server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# C1 27 FE - MaximumManaAndAbilityExtended (by server)

## Is sent when

The maximum available mana or ability has changed, e.g. by adding stat points.

## Causes the following actions on the client side

The mana and ability bar is updated on the game client user interface.

## Structure

| Index | Length | Data Type | Value | Description |
|-------|--------|-----------|-------|-------------|
| 0 | 1 | Byte | 0xC1 | [Packet type](PacketTypes.md) |
| 1 | 1 | Byte | 12 | Packet header - length of the packet |
| 2 | 1 | Byte | 0x27 | Packet header - packet type identifier |
| 3 | 1 | Byte | 0xFE | Packet header - sub packet type identifier |
| 4 | 4 | IntegerLittleEndian | | Mana |
| 8 | 4 | IntegerLittleEndian | | Ability |
20 changes: 20 additions & 0 deletions docs/Packets/C1-27-FF-CurrentManaAndAbilityExtended_by-server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# C1 27 FF - CurrentManaAndAbilityExtended (by server)

## Is sent when

The currently available mana or ability has changed, e.g. by using a skill.

## Causes the following actions on the client side

The mana and ability bar is updated on the game client user interface.

## Structure

| Index | Length | Data Type | Value | Description |
|-------|--------|-----------|-------|-------------|
| 0 | 1 | Byte | 0xC1 | [Packet type](PacketTypes.md) |
| 1 | 1 | Byte | 12 | Packet header - length of the packet |
| 2 | 1 | Byte | 0x27 | Packet header - packet type identifier |
| 3 | 1 | Byte | 0xFF | Packet header - sub packet type identifier |
| 4 | 4 | IntegerLittleEndian | | Mana |
| 8 | 4 | IntegerLittleEndian | | Ability |
28 changes: 28 additions & 0 deletions docs/Packets/C1-F3-05-CharacterLevelUpdateExtended_by-server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# C1 F3 05 - CharacterLevelUpdateExtended (by server)

## Is sent when

After a character leveled up.

## Causes the following actions on the client side

Updates the level (and other related stats) in the game client and shows an effect.

## Structure

| Index | Length | Data Type | Value | Description |
|-------|--------|-----------|-------|-------------|
| 0 | 1 | Byte | 0xC1 | [Packet type](PacketTypes.md) |
| 1 | 1 | Byte | 32 | Packet header - length of the packet |
| 2 | 1 | Byte | 0xF3 | Packet header - packet type identifier |
| 3 | 1 | Byte | 0x05 | Packet header - sub packet type identifier |
| 4 | 2 | ShortLittleEndian | | Level |
| 6 | 2 | ShortLittleEndian | | LevelUpPoints |
| 8 | 4 | IntegerLittleEndian | | MaximumHealth |
| 12 | 4 | IntegerLittleEndian | | MaximumMana |
| 16 | 4 | IntegerLittleEndian | | MaximumShield |
| 20 | 4 | IntegerLittleEndian | | MaximumAbility |
| 24 | 2 | ShortLittleEndian | | FruitPoints |
| 26 | 2 | ShortLittleEndian | | MaximumFruitPoints |
| 28 | 2 | ShortLittleEndian | | NegativeFruitPoints |
| 30 | 2 | ShortLittleEndian | | MaximumNegativeFruitPoints |
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# C1 F3 06 - CharacterStatIncreaseResponseExtended (by server)

## Is sent when

After the server processed a character stat increase request packet.

## Causes the following actions on the client side

If it was successful, adds a point to the requested stat type.

## Structure

| Index | Length | Data Type | Value | Description |
|-------|--------|-----------|-------|-------------|
| 0 | 1 | Byte | 0xC1 | [Packet type](PacketTypes.md) |
| 1 | 1 | Byte | 24 | Packet header - length of the packet |
| 2 | 1 | Byte | 0xF3 | Packet header - packet type identifier |
| 3 | 1 | Byte | 0x06 | Packet header - sub packet type identifier |
| 4 | 1 | CharacterStatAttribute | | Attribute |
| 6 | 2 | ShortLittleEndian | | AddedAmount |
| 8 | 4 | IntegerLittleEndian | | UpdatedMaximumHealth |
| 12 | 4 | IntegerLittleEndian | | UpdatedMaximumMana |
| 16 | 4 | IntegerLittleEndian | | UpdatedMaximumShield |
| 20 | 4 | IntegerLittleEndian | | UpdatedMaximumAbility |

### CharacterStatAttribute Enum

Defines the type of a character stat attribute.

| Value | Name | Description |
|-------|------|-------------|
| 0 | Strength | The strength attribute. |
| 1 | Agility | The agility attribute. |
| 2 | Vitality | The vitality attribute. |
| 3 | Energy | The energy attribute. |
| 4 | Leadership | The leadership attribute. |
26 changes: 26 additions & 0 deletions docs/Packets/C1-F3-50-MasterStatsUpdateExtended_by-server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# C1 F3 50 - MasterStatsUpdateExtended (by server)

## Is sent when

After entering the game with a master class character.

## Causes the following actions on the client side

The master related data is available.

## Structure

| Index | Length | Data Type | Value | Description |
|-------|--------|-----------|-------|-------------|
| 0 | 1 | Byte | 0xC1 | [Packet type](PacketTypes.md) |
| 1 | 1 | Byte | 40 | Packet header - length of the packet |
| 2 | 1 | Byte | 0xF3 | Packet header - packet type identifier |
| 3 | 1 | Byte | 0x50 | Packet header - sub packet type identifier |
| 4 | 2 | ShortLittleEndian | | MasterLevel |
| 6 | 8 | LongBigEndian | | MasterExperience |
| 14 | 8 | LongBigEndian | | MasterExperienceOfNextLevel |
| 22 | 2 | ShortLittleEndian | | MasterLevelUpPoints |
| 24 | 4 | IntegerLittleEndian | | MaximumHealth |
| 28 | 4 | IntegerLittleEndian | | MaximumMana |
| 32 | 4 | IntegerLittleEndian | | MaximumShield |
| 36 | 4 | IntegerLittleEndian | | MaximumAbility |
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# C1 F3 51 - MasterCharacterLevelUpdateExtended (by server)

## Is sent when

After a master character leveled up.

## Causes the following actions on the client side

Updates the master level (and other related stats) in the game client and shows an effect.

## Structure

| Index | Length | Data Type | Value | Description |
|-------|--------|-----------|-------|-------------|
| 0 | 1 | Byte | 0xC1 | [Packet type](PacketTypes.md) |
| 1 | 1 | Byte | 28 | Packet header - length of the packet |
| 2 | 1 | Byte | 0xF3 | Packet header - packet type identifier |
| 3 | 1 | Byte | 0x51 | Packet header - sub packet type identifier |
| 4 | 2 | ShortLittleEndian | | MasterLevel |
| 6 | 2 | ShortLittleEndian | | GainedMasterPoints |
| 8 | 2 | ShortLittleEndian | | CurrentMasterPoints |
| 10 | 2 | ShortLittleEndian | | MaximumMasterPoints |
| 12 | 4 | IntegerLittleEndian | | MaximumHealth |
| 16 | 4 | IntegerLittleEndian | | MaximumMana |
| 20 | 4 | IntegerLittleEndian | | MaximumShield |
| 24 | 4 | IntegerLittleEndian | | MaximumAbility |
34 changes: 34 additions & 0 deletions docs/Packets/C3-16-ExperienceGainedExtended_by-server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# C3 16 - ExperienceGainedExtended (by server)

## Is sent when

A player gained experience.

## Causes the following actions on the client side

The experience is added to the experience counter and bar.

## Structure

| Index | Length | Data Type | Value | Description |
|-------|--------|-----------|-------|-------------|
| 0 | 1 | Byte | 0xC3 | [Packet type](PacketTypes.md) |
| 1 | 1 | Byte | 16 | Packet header - length of the packet |
| 2 | 1 | Byte | 0x16 | Packet header - packet type identifier |
| 3 | 1 | AddResult | | Type |
| 4 | 4 | IntegerLittleEndian | | AddedExperience |
| 8 | 4 | IntegerLittleEndian | | DamageOfLastHit |
| 12 | 2 | ShortLittleEndian | | KilledObjectId |
| 14 | 2 | ShortLittleEndian | | KillerObjectId |

### AddResult Enum

Defines the result and type of experience which is added.

| Value | Name | Description |
|-------|------|-------------|
| 1 | Normal | The normal experience is added. |
| 2 | Master | The master experience is added. |
| 0x10 | MaxLevelReached | The maximum level has been reached, no experience is added. |
| 0x20 | MaxMasterLevelReached | The maximum master level has been reached, no master experience is added. |
| 0x21 | MonsterLevelTooLowForMasterExperience | The monster level is too low for master experience, no master experience is added. |
69 changes: 69 additions & 0 deletions docs/Packets/C3-F3-03-CharacterInformationExtended_by-server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# C3 F3 03 - CharacterInformationExtended (by server)

## Is sent when

After the character was selected by the player and entered the game.

## Causes the following actions on the client side

The characters enters the game world.

## Structure

| Index | Length | Data Type | Value | Description |
|-------|--------|-----------|-------|-------------|
| 0 | 1 | Byte | 0xC3 | [Packet type](PacketTypes.md) |
| 1 | 1 | Byte | 84 | Packet header - length of the packet |
| 2 | 1 | Byte | 0xF3 | Packet header - packet type identifier |
| 3 | 1 | Byte | 0x03 | Packet header - sub packet type identifier |
| 4 | 1 | Byte | | X |
| 5 | 1 | Byte | | Y |
| 6 | 2 | ShortLittleEndian | | MapId |
| 8 | 8 | LongBigEndian | | CurrentExperience |
| 16 | 8 | LongBigEndian | | ExperienceForNextLevel |
| 24 | 2 | ShortLittleEndian | | LevelUpPoints |
| 26 | 2 | ShortLittleEndian | | Strength |
| 28 | 2 | ShortLittleEndian | | Agility |
| 30 | 2 | ShortLittleEndian | | Vitality |
| 32 | 2 | ShortLittleEndian | | Energy |
| 34 | 2 | ShortLittleEndian | | Leadership |
| 36 | 4 | IntegerLittleEndian | | CurrentHealth |
| 40 | 4 | IntegerLittleEndian | | MaximumHealth |
| 44 | 4 | IntegerLittleEndian | | CurrentMana |
| 48 | 4 | IntegerLittleEndian | | MaximumMana |
| 52 | 4 | IntegerLittleEndian | | CurrentShield |
| 56 | 4 | IntegerLittleEndian | | MaximumShield |
| 60 | 4 | IntegerLittleEndian | | CurrentAbility |
| 64 | 4 | IntegerLittleEndian | | MaximumAbility |
| 68 | 4 | IntegerLittleEndian | | Money |
| 72 | 1 | CharacterHeroState | | HeroState |
| 73 | 1 | CharacterStatus | | Status |
| 74 | 2 | ShortLittleEndian | | UsedFruitPoints |
| 76 | 2 | ShortLittleEndian | | MaxFruitPoints |
| 78 | 2 | ShortLittleEndian | | UsedNegativeFruitPoints |
| 80 | 2 | ShortLittleEndian | | MaxNegativeFruitPoints |
| 81 | 1 | Byte | | InventoryExtensions |

### 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. |

### CharacterStatus Enum

The status of a character.

| Value | Name | Description |
|-------|------|-------------|
| 0 | Normal | The state of the character is normal. |
| 1 | Banned | The character is banned from the game. |
| 32 | GameMaster | The character is a game master. |
Loading

0 comments on commit 50489a9

Please sign in to comment.