diff --git a/config/creatures.cfg b/config/creatures.cfg index 7a7ec9ee0..da58b310d 100644 --- a/config/creatures.cfg +++ b/config/creatures.cfg @@ -1096,6 +1096,8 @@ AttackRange 1.0 AtkRange/Level 0 AttackWarmupTime 1.3 + WeaponSpawnL RustyShield + WeaponSpawnR RustySword [/Stats] [XP] # 2-10 @@ -1240,6 +1242,8 @@ AttackRange 1.0 AtkRange/Level 0 AttackWarmupTime 1.5 + WeaponSpawnL RustyShield + WeaponSpawnR RustySword [/Stats] [XP] # 2-10 diff --git a/config/equipments.cfg b/config/equipments.cfg index 8928003db..b6fac6c3f 100644 --- a/config/equipments.cfg +++ b/config/equipments.cfg @@ -13,6 +13,17 @@ # MagicalDefense Magical defense [EquipmentDefinitions] +[Equipment] + Name RustySword + [Stats] + MeshName Longsword.mesh + PhysicalDamage 0.2 + MagicalDamage 0 + Range 1 + PhysicalDefense 0 + MagicalDefense 0 + [/Stats] +[/Equipment] [Equipment] Name Longsword [Stats] @@ -24,6 +35,17 @@ MagicalDefense 0 [/Stats] [/Equipment] +[Equipment] + Name RustyShield + [Stats] + MeshName Roundshield.mesh + PhysicalDamage 0 + MagicalDamage 0 + Range 1 + PhysicalDefense 0.1 + MagicalDefense 0 + [/Stats] +[/Equipment] [Equipment] Name Roundshield [Stats] diff --git a/gui/OpenDungeonsMenuConfigureSeats.layout b/gui/OpenDungeonsMenuConfigureSeats.layout index 28017d79f..76664030b 100644 --- a/gui/OpenDungeonsMenuConfigureSeats.layout +++ b/gui/OpenDungeonsMenuConfigureSeats.layout @@ -45,6 +45,12 @@ + + + + + + diff --git a/levels/multiplayer/TestMultiplayer.level b/levels/multiplayer/TestMultiplayer.level index 539e5f8da..b37e63b20 100644 --- a/levels/multiplayer/TestMultiplayer.level +++ b/levels/multiplayer/TestMultiplayer.level @@ -13,7 +13,7 @@ FightMusic The_Dark_Amulet.ogg 2 2 Choice Choice 252 211 2 1000 3 3 Choice Choice 167 104 3 1000 4 4 Choice Choice 266 92 4 1000 -5 5 none 200 200 5 1000 +5 5 Inactive Keeper 200 200 5 1000 [/Seats] [Goals] @@ -5876,102 +5876,102 @@ ProtectDungeonTemple NULL [Creatures] # SeatId ClassName Name Level CurrentXP CurrentHP CurrentAwakeness CurrentHunger GoldToDeposit PosX PosY PosZ LeftWeapon RightWeapon [Creature] -1 ConstructWorker ConstructWorker1 1 0 125 100 0 0 193 206 0 none none +1 ConstructWorker ConstructWorker1 1 0 max 100 0 0 193 206 0 none none [/Creature] [Creature] -2 Gnome Gnome2 1 0 125 100 0 0 194 311 0 Roundshield Longsword +2 Gnome Gnome2 1 0 max 100 0 0 194 311 0 Roundshield Longsword [/Creature] [Creature] -3 Goblin Goblin3 1 0 125 100 0 0 161 201 0 Roundshield Longsword +3 Goblin Goblin3 1 0 max 100 0 0 161 201 0 Roundshield Longsword [/Creature] [Creature] -5 PitDemon PitDemon5 1 0 125 100 0 0 159 202 0 none none +5 PitDemon PitDemon5 1 0 max 100 0 0 159 202 0 none none [/Creature] [Creature] -2 Wizard Wizard7 1 0 125 100 0 0 199 311 0 Staff none +2 Wizard Wizard7 1 0 max 100 0 0 199 311 0 Staff none [/Creature] [Creature] -3 Tentacle1 Tentacle18 1 0 125 100 0 0 162 198 0 none none +3 Tentacle1 Tentacle18 1 0 max 100 0 0 162 198 0 none none [/Creature] [Creature] -4 Tentacle2 Tentacle29 1 0 125 100 0 0 158 201 0 none none +4 Tentacle2 Tentacle29 1 0 max 100 0 0 158 201 0 none none [/Creature] [Creature] -5 Troll Troll10 1 0 125 100 0 0 186 235 0 none none +5 Troll Troll10 1 0 max 100 0 0 186 235 0 none none [/Creature] [Creature] -2 Knight Knight_c2 1 0 125 100 0 0 192 311 0 Roundshield Longsword +2 Knight Knight_c2 1 0 max 100 0 0 192 311 0 Roundshield Longsword [/Creature] [Creature] -3 Knight Knight_c3 1 0 125 100 0 0 192 314 0 Roundshield Longsword +3 Knight Knight_c3 1 0 max 100 0 0 192 314 0 Roundshield Longsword [/Creature] [Creature] -4 Knight Knight_c4 1 0 125 100 0 0 196 315 0 Roundshield Longsword +4 Knight Knight_c4 1 0 max 100 0 0 196 315 0 Roundshield Longsword [/Creature] [Creature] -5 Knight Knight_c5 1 0 125 100 0 0 194 315 0 Roundshield Longsword +5 Knight Knight_c5 1 0 max 100 0 0 194 315 0 Roundshield Longsword [/Creature] [Creature] -5 LizardMan LizardMan_001 1 0 125 100 0 0 185 233 0 Roundshield Longsword +5 LizardMan LizardMan_001 1 0 max 100 0 0 185 233 0 Roundshield Longsword [/Creature] [Creature] -1 Kobold Kobold 1 0 125 100 0 0 197 205 0 none none +1 Kobold Kobold 1 0 max 100 0 0 197 205 0 none none [/Creature] [Creature] -1 Kobold Kobold_012 1 0 125 100 0 0 193 205 0 Roundshield Longsword +1 Kobold Kobold_012 1 0 max 100 0 0 193 205 0 Roundshield Longsword [/Creature] [Creature] -1 Kobold Kobold_007 1 0 125 100 0 0 195 205 0 none none +1 Kobold Kobold_007 1 0 max 100 0 0 195 205 0 none none [/Creature] [Creature] -2 Dwarf1 Dwarf1_001 1 0 145 100 0 0 221 189 0 Roundshield Sabre +2 Dwarf1 Dwarf1_001 1 0 max 100 0 0 221 189 0 Roundshield Sabre [/Creature] [Creature] -2 Dwarf2 Dwarf1_002 1 0 145 100 0 0 226 165 0 none none +2 Dwarf2 Dwarf1_002 1 0 max 100 0 0 226 165 0 none none [/Creature] [Creature] -2 Dwarf3 Dwarf1_004 1 0 145 100 0 0 213 157 0 none none +2 Dwarf3 Dwarf1_004 1 0 max 100 0 0 213 157 0 none none [/Creature] [Creature] -2 Dwarf2 Dwarf1_006 1 0 145 100 0 0 214 141 0 none none +2 Dwarf2 Dwarf1_006 1 0 max 100 0 0 214 141 0 none none [/Creature] [Creature] -2 Dwarf3 Dwarf1_007 1 0 145 100 0 0 212 143 0 none none +2 Dwarf3 Dwarf1_007 1 0 max 100 0 0 212 143 0 none none [/Creature] [Creature] -2 Dwarf3 Dwarf2_001 1 0 145 100 0 0 264 221 0 none none +2 Dwarf3 Dwarf2_001 1 0 max 100 0 0 264 221 0 none none [/Creature] [Creature] -2 Dwarf2 Dwarf2_002 1 0 145 100 0 0 216 185 0 none Longsword +2 Dwarf2 Dwarf2_002 1 0 max 100 0 0 216 185 0 none Longsword [/Creature] [Creature] -2 Dwarf1 Dwarf3_001 1 0 145 100 0 0 217 187 0 Roundshield Longsword +2 Dwarf1 Dwarf3_001 1 0 max 100 0 0 217 187 0 Roundshield Longsword [/Creature] [Creature] -3 LizardMan LizardMan_002 1 0 180 100 0 0 229 168 0 none none +3 LizardMan LizardMan_002 1 0 max 100 0 0 229 168 0 none none [/Creature] [Creature] -2 Kreatur Kre 1 0 180 100 0 0 262 220 0 none none +2 Kreatur Kre 1 0 max 100 0 0 262 220 0 none none [/Creature] [Creature] -2 Orc Orc_0001 1 0 165 100 0 0 228 166 0 none Longsword +2 Orc Orc_0001 1 0 max 100 0 0 228 166 0 none Longsword [/Creature] [Creature] -2 Orc Orc_0002 1 0 165 100 0 0 262 222 0 none Longsword +2 Orc Orc_0002 1 0 max 100 0 0 262 222 0 none Longsword [/Creature] [Creature] -3 Kreatur Kreatur_001 1 0 180 100 0 0 161 113 0 none none +3 Kreatur Kreatur_001 1 0 max 100 0 0 161 113 0 none none [/Creature] [Creature] -3 Kreatur Kreatur_002 1 0 180 100 0 0 159 101 0 none none +3 Kreatur Kreatur_002 1 0 max 100 0 0 159 101 0 none none [/Creature] [Creature] -3 Kreatur Kreatur_003 1 0 180 100 0 0 176 98 0 none none +3 Kreatur Kreatur_003 1 0 max 100 0 0 176 98 0 none none [/Creature] [Creature] -3 Kreatur Kreatur_004 1 0 180 100 0 0 168 99 0 none none +3 Kreatur Kreatur_004 1 0 max 100 0 0 168 99 0 none none [/Creature] [Creature] -3 Kreatur Kreatur_006 1 0 180 100 0 0 162 100 0 none none +3 Kreatur Kreatur_006 1 0 max 100 0 0 162 100 0 none none [/Creature] [/Creatures] diff --git a/levels/multiplayer/TestMultiplayerSmall1v1.level b/levels/multiplayer/TestMultiplayerSmall1v1.level index b39a6a446..0f5f027b5 100644 --- a/levels/multiplayer/TestMultiplayerSmall1v1.level +++ b/levels/multiplayer/TestMultiplayerSmall1v1.level @@ -502,6 +502,6 @@ ProtectDungeonTemple NULL [Creatures] # SeatId ClassName Name Level CurrentXP CurrentHP CurrentAwakeness CurrentHunger GoldToDeposit PosX PosY PosZ LeftWeapon RightWeapon [Creature] -1 ConstructWorker ConstructWorker1 1 0 4 100 0 0 7 7 0 none none +1 ConstructWorker ConstructWorker1 1 0 max 100 0 0 7 7 0 none none [/Creature] [/Creatures] diff --git a/levels/multiplayer/TestMultiplayerSmallAlliance.level b/levels/multiplayer/TestMultiplayerSmallAlliance.level index 1cba05851..e8ea0bc2b 100644 --- a/levels/multiplayer/TestMultiplayerSmallAlliance.level +++ b/levels/multiplayer/TestMultiplayerSmallAlliance.level @@ -752,6 +752,6 @@ ProtectDungeonTemple NULL [Creatures] # SeatId ClassName Name Level CurrentXP CurrentHP CurrentAwakeness CurrentHunger GoldToDeposit PosX PosY PosZ LeftWeapon RightWeapon [Creature] -1 ConstructWorker ConstructWorker1 1 0 125 100 0 0 7 7 0 none none +1 ConstructWorker ConstructWorker1 1 0 max 100 0 0 7 7 0 none none [/Creature] [/Creatures] diff --git a/levels/multiplayer/TestMultiplayerSmallFreeForAll.level b/levels/multiplayer/TestMultiplayerSmallFreeForAll.level index 239ed03fc..4fa99c206 100644 --- a/levels/multiplayer/TestMultiplayerSmallFreeForAll.level +++ b/levels/multiplayer/TestMultiplayerSmallFreeForAll.level @@ -752,6 +752,6 @@ ProtectDungeonTemple NULL [Creatures] # SeatId ClassName Name Level CurrentXP CurrentHP CurrentAwakeness CurrentHunger GoldToDeposit PosX PosY PosZ LeftWeapon RightWeapon [Creature] -1 ConstructWorker ConstructWorker1 1 0 125 100 0 0 7 7 0 none none +1 ConstructWorker ConstructWorker1 1 0 max 100 0 0 7 7 0 none none [/Creature] [/Creatures] diff --git a/levels/skirmish/Scream in the Dark.level b/levels/skirmish/Scream in the Dark.level index 56dacf012..e97410b86 100644 --- a/levels/skirmish/Scream in the Dark.level +++ b/levels/skirmish/Scream in the Dark.level @@ -5249,15 +5249,15 @@ ProtectDungeonTemple NULL [Creatures] # SeatId ClassName Name Level CurrentXP CurrentHP CurrentAwakeness CurrentHunger GoldToDeposit PosX PosY PosZ LeftWeapon RightWeapon [Creature] -5 Dragon Dragon1 10 0 30 100 0 0 13 55 0 none none +5 Dragon Dragon1 10 0 max 100 0 0 13 55 0 none none [/Creature] [Creature] -5 Dragon Dragon2 10 0 30 100 0 0 13 54 0 none none +5 Dragon Dragon2 10 0 max 100 0 0 13 54 0 none none [/Creature] [Creature] -5 Dragon Dragon3 10 0 30 100 0 0 87 58 0 none none +5 Dragon Dragon3 10 0 max 100 0 0 87 58 0 none none [/Creature] [Creature] -5 Dragon Dragon4 10 0 30 100 0 0 87 57 0 none none +5 Dragon Dragon4 10 0 max 100 0 0 87 57 0 none none [/Creature] [/Creatures] diff --git a/levels/skirmish/Stonekeep siege.level b/levels/skirmish/Stonekeep siege.level index 0d7204f1d..c311e5da2 100644 --- a/levels/skirmish/Stonekeep siege.level +++ b/levels/skirmish/Stonekeep siege.level @@ -4015,129 +4015,129 @@ ProtectDungeonTemple NULL [Creatures] # SeatId ClassName Name Level CurrentXP CurrentHP CurrentAwakeness CurrentHunger GoldToDeposit PosX PosY PosZ LeftWeapon RightWeapon [Creature] -1 Kobold Kobold90 1 0 5 100 0 0 51 16 0 none none +1 Kobold Kobold90 1 0 max 100 0 0 51 16 0 none none [/Creature] [Creature] -1 Kobold Kobold91 1 0 5 100 0 0 51 16 0 none none +1 Kobold Kobold91 1 0 max 100 0 0 51 16 0 none none [/Creature] [Creature] -2 Kobold Kobold92 1 0 5 100 0 0 7 55 0 none none +2 Kobold Kobold92 1 0 max 100 0 0 7 55 0 none none [/Creature] [Creature] -2 Kobold Kobold93 1 0 5 100 0 0 7 55 0 none none +2 Kobold Kobold93 1 0 max 100 0 0 7 55 0 none none [/Creature] [Creature] -3 Kobold Kobold94 1 0 5 100 0 0 91 55 0 none none +3 Kobold Kobold94 1 0 max 100 0 0 91 55 0 none none [/Creature] [Creature] -3 Kobold Kobold95 1 0 5 100 0 0 91 55 0 none none +3 Kobold Kobold95 1 0 max 100 0 0 91 55 0 none none [/Creature] [Creature] -4 Kobold Kobold96 1 0 5 100 0 0 47 94 0 none none +4 Kobold Kobold96 1 0 max 100 0 0 47 94 0 none none [/Creature] [Creature] -4 Kobold Kobold97 1 0 5 100 0 0 47 94 0 none none +4 Kobold Kobold97 1 0 max 100 0 0 47 94 0 none none [/Creature] [Creature] -5 Dwarf3 Dwarf99 1 0 30 100 0 0 9 15 0 Roundshield Longsword +5 Dwarf3 Dwarf99 1 0 max 100 0 0 9 15 0 Roundshield Longsword [/Creature] [Creature] -5 Dwarf3 Dwarf98 1 0 30 100 0 0 9 16 0 Roundshield Longsword +5 Dwarf3 Dwarf98 1 0 max 100 0 0 9 16 0 Roundshield Longsword [/Creature] [Creature] -5 Dwarf3 Dwarf97 1 0 30 100 0 0 9 17 0 Roundshield Longsword +5 Dwarf3 Dwarf97 1 0 max 100 0 0 9 17 0 Roundshield Longsword [/Creature] [Creature] -5 Dwarf3 Dwarf96 1 0 30 100 0 0 9 18 0 Roundshield Longsword +5 Dwarf3 Dwarf96 1 0 max 100 0 0 9 18 0 Roundshield Longsword [/Creature] [Creature] -5 Dwarf3 Dwarf95 1 0 30 100 0 0 9 19 0 Roundshield Longsword +5 Dwarf3 Dwarf95 1 0 max 100 0 0 9 19 0 Roundshield Longsword [/Creature] [Creature] -5 Dwarf3 Dwarf94 1 0 30 100 0 0 9 20 0 Roundshield Longsword +5 Dwarf3 Dwarf94 1 0 max 100 0 0 9 20 0 Roundshield Longsword [/Creature] [Creature] -5 Dwarf3 Dwarf93 1 0 30 100 0 0 9 21 0 Roundshield Longsword +5 Dwarf3 Dwarf93 1 0 max 100 0 0 9 21 0 Roundshield Longsword [/Creature] [Creature] -5 Knight Knight90 1 0 40 100 0 0 46 42 0 Roundshield Longsword +5 Knight Knight90 1 0 max 100 0 0 46 42 0 Roundshield Longsword [/Creature] [Creature] -5 Knight Knight91 1 0 40 100 0 0 47 42 0 Roundshield Longsword +5 Knight Knight91 1 0 max 100 0 0 47 42 0 Roundshield Longsword [/Creature] [Creature] -5 Knight Knight92 1 0 40 100 0 0 48 42 0 Roundshield Sabre +5 Knight Knight92 1 0 max 100 0 0 48 42 0 Roundshield Sabre [/Creature] [Creature] -5 Knight Knight93 1 0 40 100 0 0 49 42 0 Roundshield Sabre +5 Knight Knight93 1 0 max 100 0 0 49 42 0 Roundshield Sabre [/Creature] [Creature] -5 Knight Knight94 1 0 40 100 0 0 50 42 0 Roundshield Sabre +5 Knight Knight94 1 0 max 100 0 0 50 42 0 Roundshield Sabre [/Creature] [Creature] -5 Knight Knight95 1 0 40 100 0 0 51 42 0 Roundshield Longsword +5 Knight Knight95 1 0 max 100 0 0 51 42 0 Roundshield Longsword [/Creature] [Creature] -5 Knight Knight96 1 0 40 100 0 0 52 42 0 Longsword Longsword +5 Knight Knight96 1 0 max 100 0 0 52 42 0 Longsword Longsword [/Creature] [Creature] -5 Knight Knight97 1 0 40 100 0 0 49 41 0 Longsword Longsword +5 Knight Knight97 1 0 max 100 0 0 49 41 0 Longsword Longsword [/Creature] [Creature] -5 Dragon Dragon90 1 0 100 100 0 0 86 20 0 none none +5 Dragon Dragon90 1 0 max 100 0 0 86 20 0 none none [/Creature] [Creature] -5 Dragon Dragon91 1 0 100 100 0 0 92 20 0 none none +5 Dragon Dragon91 1 0 max 100 0 0 92 20 0 none none [/Creature] [Creature] -5 Dragon Dragon92 1 0 100 100 0 0 89 25 0 none none +5 Dragon Dragon92 1 0 max 100 0 0 89 25 0 none none [/Creature] [Creature] -5 Dragon Dragon93 1 0 100 100 0 0 96 18 0 none none +5 Dragon Dragon93 1 0 max 100 0 0 96 18 0 none none [/Creature] [Creature] -5 Tentacle2 Tentacle90 1 0 20 100 0 0 73 23 0 none none +5 Tentacle2 Tentacle90 1 0 max 100 0 0 73 23 0 none none [/Creature] [Creature] -5 Tentacle2 Tentacle91 1 0 20 100 0 0 73 23 0 none none +5 Tentacle2 Tentacle91 1 0 max 100 0 0 73 23 0 none none [/Creature] [Creature] -5 Tentacle2 Tentacle92 1 0 20 100 0 0 73 23 0 none none +5 Tentacle2 Tentacle92 1 0 max 100 0 0 73 23 0 none none [/Creature] [Creature] -5 Tentacle2 Tentacle93 1 0 20 100 0 0 73 23 0 none none +5 Tentacle2 Tentacle93 1 0 max 100 0 0 73 23 0 none none [/Creature] [Creature] -5 Tentacle2 Tentacle94 1 0 20 100 0 0 75 12 0 none none +5 Tentacle2 Tentacle94 1 0 max 100 0 0 75 12 0 none none [/Creature] [Creature] -5 Tentacle2 Tentacle95 1 0 20 100 0 0 75 12 0 none none +5 Tentacle2 Tentacle95 1 0 max 100 0 0 75 12 0 none none [/Creature] [Creature] -5 Tentacle2 Tentacle96 1 0 20 100 0 0 75 12 0 none none +5 Tentacle2 Tentacle96 1 0 max 100 0 0 75 12 0 none none [/Creature] [Creature] -5 Tentacle2 Tentacle97 1 0 20 100 0 0 75 12 0 none none +5 Tentacle2 Tentacle97 1 0 max 100 0 0 75 12 0 none none [/Creature] [Creature] -5 Tentacle2 Tentacle98 1 0 20 100 0 0 72 5 0 none none +5 Tentacle2 Tentacle98 1 0 max 100 0 0 72 5 0 none none [/Creature] [Creature] -5 Tentacle2 Tentacle99 1 0 20 100 0 0 72 5 0 none none +5 Tentacle2 Tentacle99 1 0 max 100 0 0 72 5 0 none none [/Creature] [Creature] -5 Tentacle2 Tentacle100 1 0 20 100 0 0 69 37 0 none none +5 Tentacle2 Tentacle100 1 0 max 100 0 0 69 37 0 none none [/Creature] [Creature] -5 Tentacle2 Tentacle101 1 0 20 100 0 0 69 37 0 none none +5 Tentacle2 Tentacle101 1 0 max 100 0 0 69 37 0 none none [/Creature] [Creature] -5 Tentacle2 Tentacle102 1 0 20 100 0 0 69 37 0 none none +5 Tentacle2 Tentacle102 1 0 max 100 0 0 69 37 0 none none [/Creature] [Creature] -5 PitDemon PitDemon90 1 0 125 100 0 0 49 57 0 none none +5 PitDemon PitDemon90 1 0 max 100 0 0 49 57 0 none none [/Creature] [Creature] -5 PitDemon PitDemon91 10 0 125 100 0 0 49 57 0 none none +5 PitDemon PitDemon91 10 0 max 100 0 0 49 57 0 none none [/Creature] [/Creatures] diff --git a/levels/skirmish/TestSingleplayer.level b/levels/skirmish/TestSingleplayer.level index 6ee02e0bb..7419ce178 100644 --- a/levels/skirmish/TestSingleplayer.level +++ b/levels/skirmish/TestSingleplayer.level @@ -5876,102 +5876,102 @@ ProtectDungeonTemple NULL [Creatures] # SeatId ClassName Name Level CurrentXP CurrentHP CurrentAwakeness CurrentHunger GoldToDeposit PosX PosY PosZ LeftWeapon RightWeapon [Creature] -1 ConstructWorker ConstructWorker1 1 0 125 100 0 0 193 206 0 none none +1 ConstructWorker ConstructWorker1 1 0 max 100 0 0 193 206 0 none none [/Creature] [Creature] -2 Gnome Gnome2 1 0 125 100 0 0 194 311 0 Roundshield Longsword +2 Gnome Gnome2 1 0 max 100 0 0 194 311 0 Roundshield Longsword [/Creature] [Creature] -3 Goblin Goblin3 1 0 125 100 0 0 161 201 0 Roundshield Longsword +3 Goblin Goblin3 1 0 max 100 0 0 161 201 0 Roundshield Longsword [/Creature] [Creature] -5 PitDemon PitDemon5 1 0 125 100 0 0 159 202 0 none none +5 PitDemon PitDemon5 1 0 max 100 0 0 159 202 0 none none [/Creature] [Creature] -2 Wizard Wizard7 1 0 125 100 0 0 199 311 0 Staff none +2 Wizard Wizard7 1 0 max 100 0 0 199 311 0 Staff none [/Creature] [Creature] -3 Tentacle1 Tentacle18 1 0 125 100 0 0 162 198 0 none none +3 Tentacle1 Tentacle18 1 0 max 100 0 0 162 198 0 none none [/Creature] [Creature] -4 Tentacle2 Tentacle29 1 0 125 100 0 0 158 201 0 none none +4 Tentacle2 Tentacle29 1 0 max 100 0 0 158 201 0 none none [/Creature] [Creature] -5 Troll Troll10 1 0 125 100 0 0 186 235 0 none none +5 Troll Troll10 1 0 max 100 0 0 186 235 0 none none [/Creature] [Creature] -2 Knight Knight_c2 1 0 125 100 0 0 192 311 0 Roundshield Longsword +2 Knight Knight_c2 1 0 max 100 0 0 192 311 0 Roundshield Longsword [/Creature] [Creature] -3 Knight Knight_c3 1 0 125 100 0 0 192 314 0 Roundshield Longsword +3 Knight Knight_c3 1 0 max 100 0 0 192 314 0 Roundshield Longsword [/Creature] [Creature] -4 Knight Knight_c4 1 0 125 100 0 0 196 315 0 Roundshield Longsword +4 Knight Knight_c4 1 0 max 100 0 0 196 315 0 Roundshield Longsword [/Creature] [Creature] -5 Knight Knight_c5 1 0 125 100 0 0 194 315 0 Roundshield Longsword +5 Knight Knight_c5 1 0 max 100 0 0 194 315 0 Roundshield Longsword [/Creature] [Creature] -5 LizardMan LizardMan_001 1 0 125 100 0 0 185 233 0 Roundshield Longsword +5 LizardMan LizardMan_001 1 0 max 100 0 0 185 233 0 Roundshield Longsword [/Creature] [Creature] -1 Kobold Kobold 1 0 125 100 0 0 197 205 0 none none +1 Kobold Kobold 1 0 max 100 0 0 197 205 0 none none [/Creature] [Creature] -1 Kobold Kobold_012 1 0 125 100 0 0 193 205 0 Roundshield Longsword +1 Kobold Kobold_012 1 0 max 100 0 0 193 205 0 Roundshield Longsword [/Creature] [Creature] -1 Kobold Kobold_007 1 0 125 100 0 0 195 205 0 none none +1 Kobold Kobold_007 1 0 max 100 0 0 195 205 0 none none [/Creature] [Creature] -2 Dwarf1 Dwarf1_001 1 0 145 100 0 0 221 189 0 Roundshield Sabre +2 Dwarf1 Dwarf1_001 1 0 max 100 0 0 221 189 0 Roundshield Sabre [/Creature] [Creature] -2 Dwarf2 Dwarf1_002 1 0 145 100 0 0 226 165 0 none none +2 Dwarf2 Dwarf1_002 1 0 max 100 0 0 226 165 0 none none [/Creature] [Creature] -2 Dwarf3 Dwarf1_004 1 0 145 100 0 0 213 157 0 none none +2 Dwarf3 Dwarf1_004 1 0 max 100 0 0 213 157 0 none none [/Creature] [Creature] -2 Dwarf2 Dwarf1_006 1 0 145 100 0 0 214 141 0 none none +2 Dwarf2 Dwarf1_006 1 0 max 100 0 0 214 141 0 none none [/Creature] [Creature] -2 Dwarf3 Dwarf1_007 1 0 145 100 0 0 212 143 0 none none +2 Dwarf3 Dwarf1_007 1 0 max 100 0 0 212 143 0 none none [/Creature] [Creature] -2 Dwarf3 Dwarf2_001 1 0 145 100 0 0 264 221 0 none none +2 Dwarf3 Dwarf2_001 1 0 max 100 0 0 264 221 0 none none [/Creature] [Creature] -2 Dwarf2 Dwarf2_002 1 0 145 100 0 0 216 185 0 none Longsword +2 Dwarf2 Dwarf2_002 1 0 max 100 0 0 216 185 0 none Longsword [/Creature] [Creature] -2 Dwarf1 Dwarf3_001 1 0 145 100 0 0 217 187 0 Roundshield Longsword +2 Dwarf1 Dwarf3_001 1 0 max 100 0 0 217 187 0 Roundshield Longsword [/Creature] [Creature] -3 LizardMan LizardMan_002 1 0 180 100 0 0 229 168 0 none none +3 LizardMan LizardMan_002 1 0 max 100 0 0 229 168 0 none none [/Creature] [Creature] -2 Kreatur Kre 10 0 180 100 0 0 262 220 0 none none +2 Kreatur Kre 10 0 max 100 0 0 262 220 0 none none [/Creature] [Creature] -2 Orc Orc_0001 1 0 165 100 0 0 228 166 0 none none +2 Orc Orc_0001 1 0 max 100 0 0 228 166 0 none none [/Creature] [Creature] -2 Orc Orc_0002 1 0 165 100 0 0 262 222 0 none none +2 Orc Orc_0002 1 0 max 100 0 0 262 222 0 none none [/Creature] [Creature] -3 Kreatur Kreatur_001 1 0 180 100 0 0 161 113 0 none none +3 Kreatur Kreatur_001 1 0 max 100 0 0 161 113 0 none none [/Creature] [Creature] -3 Kreatur Kreatur_002 1 0 180 100 0 0 159 101 0 none none +3 Kreatur Kreatur_002 1 0 max 100 0 0 159 101 0 none none [/Creature] [Creature] -3 Kreatur Kreatur_003 1 0 180 100 0 0 176 98 0 none none +3 Kreatur Kreatur_003 1 0 max 100 0 0 176 98 0 none none [/Creature] [Creature] -3 Kreatur Kreatur_004 1 0 180 100 0 0 168 99 0 none none +3 Kreatur Kreatur_004 1 0 max 100 0 0 168 99 0 none none [/Creature] [Creature] -3 Kreatur Kreatur_006 1 0 180 100 0 0 162 100 0 none none +3 Kreatur Kreatur_006 1 0 max 100 0 0 162 100 0 none none [/Creature] [/Creatures] diff --git a/levels/skirmish/TestSingleplayerSmall.level b/levels/skirmish/TestSingleplayerSmall.level index c0160133c..fc089bd24 100644 --- a/levels/skirmish/TestSingleplayerSmall.level +++ b/levels/skirmish/TestSingleplayerSmall.level @@ -784,6 +784,18 @@ ProtectDungeonTemple NULL PhysicalAttack 4.1 [/Stats] [/Creature] +[Creature] + Name Adventurer + [Stats] + WeaponSpawnL RustyShield + [/Stats] +[/Creature] +[Creature] + Name Wizard + [Stats] + WeaponSpawnL RustyShield + [/Stats] +[/Creature] [Creature] Name BigDragon [Stats] @@ -822,6 +834,8 @@ ProtectDungeonTemple NULL AttackRange 1 AtkRange/Level 0 AttackWarmupTime 1.5 + WeaponSpawnL none + WeaponSpawnL none [/Stats] [/Creature] [/CreatureDefinitions] @@ -852,9 +866,9 @@ ProtectDungeonTemple NULL 1 BigKnight BigKnight1 1 0 4 100 0 0 7 7 0 Longsword none [/Creature] [Creature] -1 Adventurer Adventurer2 1 0 2 100 0 0 7 8 0 none SpecialStaff +1 Adventurer Adventurer2 1 0 max 100 0 0 7 8 0 none SpecialStaff [/Creature] [Creature] -3 BigDragon Dragon1 1 0 35 100 0 0 10 4 0 none none +3 BigDragon Dragon1 1 0 max 100 0 0 10 4 0 none none [/Creature] [/Creatures] diff --git a/levels/skirmish/TestSingleplayerSmallEmpty.level b/levels/skirmish/TestSingleplayerSmallEmpty.level index eeebedcaf..cb7f44a78 100644 --- a/levels/skirmish/TestSingleplayerSmallEmpty.level +++ b/levels/skirmish/TestSingleplayerSmallEmpty.level @@ -2592,9 +2592,9 @@ ProtectDungeonTemple NULL [Creatures] # SeatId ClassName Name Level CurrentXP CurrentHP CurrentAwakeness CurrentHunger GoldToDeposit PosX PosY PosZ LeftWeapon RightWeapon [Creature] -1 ConstructWorker ConstructWorker1 1 0 125 100 0 0 7 7 0 none none +1 ConstructWorker ConstructWorker1 1 0 max 100 0 0 7 7 0 none none [/Creature] [Creature] -2 Scarab Scarab1 1 0 125 100 0 0 37 42 0 none none +2 Scarab Scarab1 1 0 max 100 0 0 37 42 0 none none [/Creature] [/Creatures] diff --git a/levels/skirmish/TestSingleplayerSmallPassability.level b/levels/skirmish/TestSingleplayerSmallPassability.level index 27b5f4bbc..645ad1861 100644 --- a/levels/skirmish/TestSingleplayerSmallPassability.level +++ b/levels/skirmish/TestSingleplayerSmallPassability.level @@ -175,12 +175,12 @@ ProtectDungeonTemple NULL [Creatures] # SeatId ClassName Name Level CurrentXP CurrentHP CurrentAwakeness CurrentHunger GoldToDeposit PosX PosY PosZ LeftWeapon RightWeapon [Creature] -1 ConstructWorker ConstructWorker1 1 0 125 100 0 0 1 1 0 none none +1 ConstructWorker ConstructWorker1 1 0 max 100 0 0 1 1 0 none none [/Creature] [Creature] -1 PitDemon Lava 1 0 125 100 0 0 2 2 0 none none +1 PitDemon Lava 1 0 max 100 0 0 2 2 0 none none [/Creature] [Creature] -1 Slime Water 1 0 125 100 0 0 2 2 0 none none +1 Slime Water 1 0 max 100 0 0 2 2 0 none none [/Creature] [/Creatures] diff --git a/levels/skirmish/oldTest.level b/levels/skirmish/oldTest.level index 7fe7c1949..689cd4278 100644 --- a/levels/skirmish/oldTest.level +++ b/levels/skirmish/oldTest.level @@ -6638,165 +6638,165 @@ ProtectDungeonTemple NULL [Creatures] # SeatId ClassName Name Level CurrentXP CurrentHP CurrentAwakeness CurrentHunger GoldToDeposit PosX PosY PosZ LeftWeapon RightWeapon [Creature] -1 Adventurer Adventurer_001 1 0 150 100 0 0 196 200 0 none none +1 Adventurer Adventurer_001 1 0 max 100 0 0 196 200 0 none none [/Creature] [Creature] -1 ConstructWorker ConstructWorker1 1 0 150 100 0 0 196 230 0 none none +1 ConstructWorker ConstructWorker1 1 0 max 100 0 0 196 230 0 none none [/Creature] [Creature] -2 Gnome Gnome2 1 0 150 100 0 0 192 229 0 Roundshield Longsword +2 Gnome Gnome2 1 0 max 100 0 0 192 229 0 Roundshield Longsword [/Creature] [Creature] -1 Goblin Goblin3 1 0 150 100 0 0 183 229 0 Roundshield Longsword +1 Goblin Goblin3 1 0 max 100 0 0 183 229 0 Roundshield Longsword [/Creature] [Creature] -5 PitDemon PitDemon5 1 0 150 100 0 0 210 236 0 none none +5 PitDemon PitDemon5 1 0 max 100 0 0 210 236 0 none none [/Creature] [Creature] -1 Spider Spider6 1 0 150 100 0 0 198 231 0 none none +1 Spider Spider6 1 0 max 100 0 0 198 231 0 none none [/Creature] [Creature] -1 CaveHornet CaveHornet1 1 0 150 100 0 0 198 231 0 none none +1 CaveHornet CaveHornet1 1 0 max 100 0 0 198 231 0 none none [/Creature] [Creature] -2 Wizard Wizard7 1 0 150 100 0 0 190 229 0 Staff none +2 Wizard Wizard7 1 0 max 100 0 0 190 229 0 Staff none [/Creature] [Creature] -3 Tentacle1 Tentacle18 1 0 150 100 0 0 186 229 0 none none +3 Tentacle1 Tentacle18 1 0 max 100 0 0 186 229 0 none none [/Creature] [Creature] -4 Tentacle2 Tentacle29 1 0 150 100 0 0 203 230 0 none none +4 Tentacle2 Tentacle29 1 0 max 100 0 0 203 230 0 none none [/Creature] [Creature] -5 Troll Troll10 1 0 150 100 0 0 209 231 0 none none +5 Troll Troll10 1 0 max 100 0 0 209 231 0 none none [/Creature] [Creature] -1 Troll Troll11 1 0 150 100 0 0 193 214 0 Roundshield Longsword +1 Troll Troll11 1 0 max 100 0 0 193 214 0 Roundshield Longsword [/Creature] [Creature] -1 Knight Knight_c1 1 0 150 100 0 0 198 233 0 Roundshield Longsword +1 Knight Knight_c1 1 0 max 100 0 0 198 233 0 Roundshield Longsword [/Creature] [Creature] -2 Knight Knight_c2 1 0 150 100 0 0 192 233 0 Roundshield Longsword +2 Knight Knight_c2 1 0 max 100 0 0 192 233 0 Roundshield Longsword [/Creature] [Creature] -3 Knight Knight_c3 1 0 150 100 0 0 184 233 0 Roundshield Longsword +3 Knight Knight_c3 1 0 max 100 0 0 184 233 0 Roundshield Longsword [/Creature] [Creature] -4 Knight Knight_c4 1 0 150 100 0 0 204 233 0 Roundshield Longsword +4 Knight Knight_c4 1 0 max 100 0 0 204 233 0 Roundshield Longsword [/Creature] [Creature] -5 Knight Knight_c5 1 0 150 100 0 0 210 233 0 Roundshield Longsword +5 Knight Knight_c5 1 0 max 100 0 0 210 233 0 Roundshield Longsword [/Creature] [Creature] -5 LizardMan LizardMan_001 1 0 150 100 0 0 210 233 0 Roundshield Longsword +5 LizardMan LizardMan_001 1 0 max 100 0 0 210 233 0 Roundshield Longsword [/Creature] [Creature] -1 Kobold Kobold 1 0 150 100 0 0 195 202 0 none none +1 Kobold Kobold 1 0 max 100 0 0 195 202 0 none none [/Creature] [Creature] -1 Kobold Kobold_012 1 0 150 100 0 0 188 200 0 Roundshield Longsword +1 Kobold Kobold_012 1 0 max 100 0 0 188 200 0 Roundshield Longsword [/Creature] [Creature] -1 Kobold Kobold_007 1 0 150 100 0 0 193 218 0 none none +1 Kobold Kobold_007 1 0 max 100 0 0 193 218 0 none none [/Creature] [Creature] -1 Wizard Mage 1 0 150 100 0 0 193 213 0 Staff none +1 Wizard Mage 1 0 max 100 0 0 193 213 0 Staff none [/Creature] [Creature] -1 Wizard Wiz 1 0 150 100 0 0 193 213 0 Staff none +1 Wizard Wiz 1 0 max 100 0 0 193 213 0 Staff none [/Creature] [Creature] -1 BigKnight King 1 0 150 100 0 0 191 216 0 Roundshield Staff +1 BigKnight King 1 0 max 100 0 0 191 216 0 Roundshield Staff [/Creature] [Creature] -1 Knight Knight_005 1 0 150 100 0 0 229 138 0 Roundshield Longsword +1 Knight Knight_005 1 0 max 100 0 0 229 138 0 Roundshield Longsword [/Creature] [Creature] -1 Knight Knight_004 1 0 150 100 0 0 196 200 0 Longsword none +1 Knight Knight_004 1 0 max 100 0 0 196 200 0 Longsword none [/Creature] [Creature] -1 Knight Knight_006 1 0 150 100 0 0 199 204 0 Longsword Sabre +1 Knight Knight_006 1 0 max 100 0 0 199 204 0 Longsword Sabre [/Creature] [Creature] -1 Knight Knight 1 0 150 100 0 0 188 198 0 none Sabre +1 Knight Knight 1 0 max 100 0 0 188 198 0 none Sabre [/Creature] [Creature] -1 Knight Knight_007 1 0 150 100 0 0 191 207 0 none Sabre +1 Knight Knight_007 1 0 max 100 0 0 191 207 0 none Sabre [/Creature] [Creature] -1 Knight Knight_003 1 0 150 100 0 0 184 201 0 none Longsword +1 Knight Knight_003 1 0 max 100 0 0 184 201 0 none Longsword [/Creature] [Creature] -1 Dragon Dragon_001 1 0 150 100 0 0 159 108 0 none none +1 Dragon Dragon_001 1 0 max 100 0 0 159 108 0 none none [/Creature] [Creature] -1 Dragon Dragon_002 1 0 150 100 0 0 191 193 0 none none +1 Dragon Dragon_002 1 0 max 100 0 0 191 193 0 none none [/Creature] [Creature] -1 Dragon Dragon_003 1 0 150 100 0 0 193 204 0 none none +1 Dragon Dragon_003 1 0 max 100 0 0 193 204 0 none none [/Creature] [Creature] -1 Dragon Dragon_004 5 0 150 100 0 0 196 214 0 none none +1 Dragon Dragon_004 5 0 max 100 0 0 196 214 0 none none [/Creature] [Creature] -1 Wyvern Wyvern_001 1 0 150 100 0 0 177 90 0 none none +1 Wyvern Wyvern_001 1 0 max 100 0 0 177 90 0 none none [/Creature] [Creature] -1 Wyvern Wyvern_002 1 0 150 100 0 0 186 85 0 none none +1 Wyvern Wyvern_002 1 0 max 100 0 0 186 85 0 none none [/Creature] [Creature] -1 Wyvern Wyvern_003 1 0 150 100 0 0 183 105 0 none none +1 Wyvern Wyvern_003 1 0 max 100 0 0 183 105 0 none none [/Creature] [Creature] -2 Dwarf1 Dwarf1_001 1 0 150 100 0 0 201 192 0 Roundshield Sabre +2 Dwarf1 Dwarf1_001 1 0 max 100 0 0 201 192 0 Roundshield Sabre [/Creature] [Creature] -2 Dwarf2 Dwarf2_001 1 0 150 100 0 0 206 168 0 none none +2 Dwarf2 Dwarf2_001 1 0 max 100 0 0 206 168 0 none none [/Creature] [Creature] -2 Dwarf3 Dwarf3_001 1 0 150 100 0 0 213 157 0 none none +2 Dwarf3 Dwarf3_001 1 0 max 100 0 0 213 157 0 none none [/Creature] [Creature] -2 Dwarf2 Dwarf2_002 1 0 150 100 0 0 214 141 0 none none +2 Dwarf2 Dwarf2_002 1 0 max 100 0 0 214 141 0 none none [/Creature] [Creature] -2 Dwarf3 Dwarf3_002 1 0 150 100 0 0 212 143 0 none none +2 Dwarf3 Dwarf3_002 1 0 max 100 0 0 212 143 0 none none [/Creature] [Creature] -2 Dwarf3 Dwarf3_003 1 0 150 100 0 0 213 213 0 none none +2 Dwarf3 Dwarf3_003 1 0 max 100 0 0 213 213 0 none none [/Creature] [Creature] -2 Dwarf2 Dwarf2_003 1 0 150 100 0 0 202 191 0 none Longsword +2 Dwarf2 Dwarf2_003 1 0 max 100 0 0 202 191 0 none Longsword [/Creature] [Creature] -2 Dwarf1 Dwarf1_002 1 0 150 100 0 0 201 192 0 Roundshield Longsword +2 Dwarf1 Dwarf1_002 1 0 max 100 0 0 201 192 0 Roundshield Longsword [/Creature] [Creature] -3 LizardMan LizardMan_002 1 0 150 100 0 0 206 172 0 none none +3 LizardMan LizardMan_002 1 0 max 100 0 0 206 172 0 none none [/Creature] [Creature] -3 Kreatur Kre 1 0 150 100 0 0 215 216 0 none none +3 Kreatur Kre 1 0 max 100 0 0 215 216 0 none none [/Creature] [Creature] -2 Orc Orc_001 1 0 150 100 0 0 203 199 0 none Longsword +2 Orc Orc_001 1 0 max 100 0 0 203 199 0 none Longsword [/Creature] [Creature] -2 Orc Orc_002 1 0 150 100 0 0 207 212 0 none Longsword +2 Orc Orc_002 1 0 max 100 0 0 207 212 0 none Longsword [/Creature] [Creature] -3 Kreatur Kreatur_001 1 0 150 100 0 0 155 110 0 none none +3 Kreatur Kreatur_001 1 0 max 100 0 0 155 110 0 none none [/Creature] [Creature] -3 Kreatur Kreatur_002 1 0 150 100 0 0 159 112 0 none none +3 Kreatur Kreatur_002 1 0 max 100 0 0 159 112 0 none none [/Creature] [Creature] -3 Kreatur Kreatur_003 1 0 150 100 0 0 158 103 0 none none +3 Kreatur Kreatur_003 1 0 max 100 0 0 158 103 0 none none [/Creature] [Creature] -3 Kreatur Kreatur_004 1 0 150 100 0 0 156 106 0 none none +3 Kreatur Kreatur_004 1 0 max 100 0 0 156 106 0 none none [/Creature] [Creature] -3 Kreatur Kreatur_005 1 0 150 100 0 0 163 112 0 none none +3 Kreatur Kreatur_005 1 0 max 100 0 0 163 112 0 none none [/Creature] [/Creatures] diff --git a/source/entities/Creature.cpp b/source/entities/Creature.cpp index 241016641..f29741b13 100644 --- a/source/entities/Creature.cpp +++ b/source/entities/Creature.cpp @@ -149,6 +149,12 @@ Creature::Creature(GameMap* gameMap, const CreatureDefinition* definition) : mMagicalDefense = mDefinition->getMagicalDefense(); mWeaponlessAtkRange = mDefinition->getAttackRange(); mAttackWarmupTime = mDefinition->getAttackWarmupTime(); + + if(mDefinition->getWeaponSpawnL().compare("none") != 0) + mWeaponL = gameMap->getWeapon(mDefinition->getWeaponSpawnL()); + + if(mDefinition->getWeaponSpawnR().compare("none") != 0) + mWeaponR = gameMap->getWeapon(mDefinition->getWeaponSpawnR()); } Creature::Creature(GameMap* gameMap) : @@ -286,7 +292,11 @@ void Creature::exportToStream(std::ostream& os) int seatId = getSeat()->getId(); os << seatId; os << "\t" << mDefinition->getClassName() << "\t" << getName(); - os << "\t" << getLevel() << "\t" << mExp << "\t" << getHP(); + os << "\t" << getLevel() << "\t" << mExp << "\t"; + if(getHP() < mMaxHP) + os << getHP(); + else + os << "max"; os << "\t" << mAwakeness << "\t" << mHunger << "\t" << mGold; os << "\t" << getPosition().x; @@ -334,7 +344,12 @@ void Creature::importFromStream(std::istream& is) OD_ASSERT_TRUE(is >> tempDouble); mExp = tempDouble; - OD_ASSERT_TRUE(is >> tempDouble); + std::string strHp; + OD_ASSERT_TRUE(is >> strHp); + if(strHp.compare("max") == 0) + tempDouble = mMaxHP; + else + tempDouble = Helper::toDouble(strHp); setHP(tempDouble); OD_ASSERT_TRUE(is >> tempDouble); diff --git a/source/entities/CreatureDefinition.cpp b/source/entities/CreatureDefinition.cpp index 1f527a5a0..b53ac36d9 100644 --- a/source/entities/CreatureDefinition.cpp +++ b/source/entities/CreatureDefinition.cpp @@ -81,6 +81,8 @@ ODPacket& operator<<(ODPacket& os, CreatureDefinition* c) os << c->mMagicalDefense << c->mMagicalDefPerLevel; os << c->mAttackRange << c->mAtkRangePerLevel; os << c->mAttackWarmupTime; + os << c->mWeaponSpawnL; + os << c->mWeaponSpawnR; for (unsigned int i = 0; i < c->mXPTable.size(); ++i) os << c->mXPTable[i]; @@ -109,6 +111,8 @@ ODPacket& operator>>(ODPacket& is, CreatureDefinition* c) is >> c->mMagicalDefense >> c->mMagicalDefPerLevel; is >> c->mAttackRange >> c->mAtkRangePerLevel; is >> c->mAttackWarmupTime; + is >> c->mWeaponSpawnL; + is >> c->mWeaponSpawnR; for (unsigned int i = 0; i < c->mXPTable.size(); ++i) { @@ -414,6 +418,16 @@ bool CreatureDefinition::update(CreatureDefinition* creatureDef, std::stringstre creatureDef->mAttackWarmupTime = Helper::toDouble(nextParam); continue; } + else if (nextParam == "WeaponSpawnL") + { + defFile >> creatureDef->mWeaponSpawnL; + continue; + } + else if (nextParam == "WeaponSpawnR") + { + defFile >> creatureDef->mWeaponSpawnR; + continue; + } } } @@ -547,6 +561,12 @@ void CreatureDefinition::writeCreatureDefinitionDiff(const CreatureDefinition* d if(def1 == nullptr || (def1->mAttackWarmupTime != def2->mAttackWarmupTime)) file << " AttackWarmupTime\t" << def2->mAttackWarmupTime << std::endl; + if(def1 == nullptr || (def1->mWeaponSpawnL.compare(def2->mWeaponSpawnL) != 0)) + file << " WeaponSpawnL\t" << def2->mWeaponSpawnL << std::endl; + + if(def1 == nullptr || (def1->mWeaponSpawnR.compare(def2->mWeaponSpawnR) != 0)) + file << " WeaponSpawnL\t" << def2->mWeaponSpawnR << std::endl; + file << " [/Stats]" << std::endl; file << "[/Creature]" << std::endl; } diff --git a/source/entities/CreatureDefinition.h b/source/entities/CreatureDefinition.h index 7233ca551..49eb6e32e 100644 --- a/source/entities/CreatureDefinition.h +++ b/source/entities/CreatureDefinition.h @@ -112,7 +112,9 @@ class CreatureDefinition mMagicalDefPerLevel (magicalDefPerLevel), mAttackRange (attackRange), mAtkRangePerLevel (atkRangePerLevel), - mAttackWarmupTime (attackWarmupTime) + mAttackWarmupTime (attackWarmupTime), + mWeaponSpawnL ("none"), + mWeaponSpawnR ("none") { mXPTable.assign(MAX_LEVEL - 1, 100.0); } @@ -181,6 +183,9 @@ class CreatureDefinition inline double getAttackWarmupTime () const { return mAttackWarmupTime; } + const std::string& getWeaponSpawnL () const { return mWeaponSpawnL; } + const std::string& getWeaponSpawnR () const { return mWeaponSpawnR; } + double getXPNeededWhenLevel(unsigned int level) const; private: @@ -265,6 +270,10 @@ class CreatureDefinition //! \brief The time to wait before dealing a blow, in seconds. double mAttackWarmupTime; + //! \brief Weapons a creature should spawn with ("none" if no weapon) + std::string mWeaponSpawnL; + std::string mWeaponSpawnR; + //! \brief The XP table, used to know how XP is needed to reach the next level. //! \note The creature starting at level 1, it can only change its level MAX_LEVEL - 1 times. std::vector mXPTable; diff --git a/source/game/Seat.cpp b/source/game/Seat.cpp index e22d73fdc..a04875be2 100644 --- a/source/game/Seat.cpp +++ b/source/game/Seat.cpp @@ -285,10 +285,15 @@ void Seat::setPlayer(Player* player) void Seat::initSpawnPool() { - const std::vector& pool = ConfigManager::getSingleton().getFactionSpawnPool(mFaction); + const std::vector& pool = ConfigManager::getSingleton().getFactionSpawnPool(mFaction); OD_ASSERT_TRUE_MSG(!pool.empty(), "Empty spawn pool for faction=" + mFaction); - for(const CreatureDefinition* def : pool) + for(const std::string& defName : pool) { + const CreatureDefinition* def = mGameMap->getClassDescription(defName); + OD_ASSERT_TRUE_MSG(def != nullptr, "defName=" + defName); + if(def == nullptr) + continue; + mSpawnPool.push_back(std::pair(def, false)); } } diff --git a/source/gamemap/GameMap.cpp b/source/gamemap/GameMap.cpp index db40d67f8..2e4ee3ed4 100644 --- a/source/gamemap/GameMap.cpp +++ b/source/gamemap/GameMap.cpp @@ -324,7 +324,6 @@ void GameMap::clearPlayers() void GameMap::resetUniqueNumbers() { mUniqueNumberCreature = 0; - mUniqueNumberFloodFilling = 0; mUniqueNumberMissileObj = 0; mUniqueNumberRoom = 0; mUniqueNumberRenderedMovableEntity = 0; @@ -2309,9 +2308,8 @@ bool GameMap::doFloodFill(Tile* tile) bool hasChanged = false; // If a neigboor is colored with the same colors, we color the tile std::vector tiles = tile->getAllNeighbors(); - for(std::vector::iterator it = tiles.begin(); it != tiles.end(); ++it) + for(Tile* neigh : tiles) { - Tile* neigh = *it; switch(neigh->getType()) { case Tile::dirt: @@ -2345,11 +2343,6 @@ bool GameMap::doFloodFill(Tile* tile) tile->mFloodFillColor[Tile::FloodFillTypeGroundWaterLava] = neigh->mFloodFillColor[Tile::FloodFillTypeGroundWaterLava]; hasChanged = true; } - - // If the tile is fully filled, no need to continue - if(tile->isFloodFillFilled()) - return true; - break; } case Tile::water: @@ -2367,11 +2360,6 @@ bool GameMap::doFloodFill(Tile* tile) tile->mFloodFillColor[Tile::FloodFillTypeGroundWaterLava] = neigh->mFloodFillColor[Tile::FloodFillTypeGroundWaterLava]; hasChanged = true; } - - // If the tile is fully filled, no need to continue - if(tile->isFloodFillFilled()) - return true; - break; } case Tile::lava: @@ -2389,16 +2377,15 @@ bool GameMap::doFloodFill(Tile* tile) tile->mFloodFillColor[Tile::FloodFillTypeGroundWaterLava] = neigh->mFloodFillColor[Tile::FloodFillTypeGroundWaterLava]; hasChanged = true; } - - // If the tile is fully filled, no need to continue - if(tile->isFloodFillFilled()) - return true; - break; } default: - return false; + continue; } + + // If the tile is fully filled, no need to continue + if(tile->isFloodFillFilled()) + return true; } return hasChanged; @@ -2475,6 +2462,7 @@ void GameMap::enableFloodFill() // because they are walkable for most creatures. When we will have tagged all // thoses, we will deal with water/lava remaining (there can be some left if // surrounded by not passable tiles). + int floodFillValue = 0; while(true) { int yy = 0; @@ -2496,7 +2484,7 @@ void GameMap::enableFloodFill() for(int i = 0; i < Tile::FloodFillTypeMax; ++i) { if(tile->mFloodFillColor[i] == -1) - tile->mFloodFillColor[i] = nextUniqueNumberFloodFilling(); + tile->mFloodFillColor[i] = ++floodFillValue; } break; } @@ -2526,9 +2514,9 @@ void GameMap::enableFloodFill() // For optimization purposes, if a tile has changed, we go on the other side if(nbTiles > 0) { - for(int xx = getMapSizeX(); xx > 0; --xx) + for(int xx = getMapSizeX() - 1; xx >= 0; --xx) { - Tile* tile = getTile(xx - 1, yy); + Tile* tile = getTile(xx, yy); if(doFloodFill(tile)) ++nbTiles; } @@ -2758,11 +2746,6 @@ std::string GameMap::nextUniqueNameCreature(const std::string& className) return ret; } -int GameMap::nextUniqueNumberFloodFilling() -{ - return ++mUniqueNumberFloodFilling; -} - std::string GameMap::nextUniqueNameRoom(const std::string& meshName) { std::string ret; diff --git a/source/gamemap/GameMap.h b/source/gamemap/GameMap.h index cb43bdfd8..cd3aefd58 100644 --- a/source/gamemap/GameMap.h +++ b/source/gamemap/GameMap.h @@ -434,7 +434,6 @@ friend class ODServer; void logFloodFileTiles(); void consoleSetCreatureDestination(const std::string& creatureName, int x, int y); - int nextUniqueNumberFloodFilling(); //! \brief This functions create unique names. They check that there //! is no entity with the same name before returning std::string nextUniqueNameCreature(const std::string& className); @@ -480,7 +479,6 @@ friend class ODServer; //! \brief Unique numbers to ensure names are unique int mUniqueNumberCreature; - int mUniqueNumberFloodFilling; int mUniqueNumberMissileObj; int mUniqueNumberRoom; int mUniqueNumberRenderedMovableEntity; diff --git a/source/modes/MenuModeConfigureSeats.cpp b/source/modes/MenuModeConfigureSeats.cpp index 4c66d94b2..3ed7aa601 100644 --- a/source/modes/MenuModeConfigureSeats.cpp +++ b/source/modes/MenuModeConfigureSeats.cpp @@ -37,6 +37,7 @@ #include const std::string TEXT_SEAT_ID_PREFIX = "TextSeat"; +const std::string TEXT_TEAM_ID_PREFIX = "TextTeam"; const std::string COMBOBOX_PLAYER_FACTION_PREFIX = "ComboPlayerFactionSeat"; const std::string COMBOBOX_PLAYER_PREFIX = "ComboPlayerSeat"; @@ -57,6 +58,8 @@ MenuModeConfigureSeats::~MenuModeConfigureSeats() tmpWin->destroyChild(name); name = COMBOBOX_PLAYER_PREFIX + Ogre::StringConverter::toString(seat->getId()); tmpWin->destroyChild(name); + name = TEXT_TEAM_ID_PREFIX + Ogre::StringConverter::toString(seat->getId()); + tmpWin->destroyChild(name); } } @@ -81,6 +84,11 @@ void MenuModeConfigureSeats::activate() msgWin->setText("Loading..."); msgWin->setVisible(false); + if(ODServer::getSingleton().isConnected()) + tmpWin->setText("Please configure map : " + gameMap->getLevelName()); + else + tmpWin->setText("Host is configuring map : " + gameMap->getLevelName()); + const std::vector& factions = ConfigManager::getSingleton().getFactions(); const CEGUI::Image* selImg = &CEGUI::ImageManager::getSingleton().get("OpenDungeonsSkin/SelectionBrush"); const std::vector& seats = gameMap->getSeats(); @@ -204,6 +212,14 @@ void MenuModeConfigureSeats::activate() } combo->subscribeEvent(CEGUI::Combobox::EventListSelectionAccepted, CEGUI::SubscriberSlot(&MenuModeConfigureSeats::comboChanged, this)); + name = TEXT_TEAM_ID_PREFIX + Ogre::StringConverter::toString(seat->getId()); + CEGUI::DefaultWindow* textTeamId = static_cast(winMgr.createWindow("OD/StaticText", name)); + tmpWin->addChild(textTeamId); + textTeamId->setArea(CEGUI::UDim(1,-60), CEGUI::UDim(0,65 + offset), CEGUI::UDim(0,40), CEGUI::UDim(0,30)); + textTeamId->setText(Ogre::StringConverter::toString(seat->getTeamId())); + textTeamId->setProperty("FrameEnabled", "False"); + textTeamId->setProperty("BackgroundEnabled", "False"); + offset += 30; } diff --git a/source/network/ODClient.cpp b/source/network/ODClient.cpp index 4213098f8..671474d9a 100644 --- a/source/network/ODClient.cpp +++ b/source/network/ODClient.cpp @@ -96,8 +96,7 @@ bool ODClient::processOneClientSocketMessage() case ServerNotification::loadLevel: { std::string levelFilename; - ODServer::ServerMode serverMode; - OD_ASSERT_TRUE(packetReceived >> levelFilename >> serverMode); + OD_ASSERT_TRUE(packetReceived >> levelFilename); // Read in the map. The map loading should happen here and not in the server thread to // make sure it is valid before launching the server. RenderManager::getSingletonPtr()->processRenderRequests(); @@ -115,6 +114,17 @@ bool ODClient::processOneClientSocketMessage() ODPacket packSend; packSend << ClientNotification::levelOK; send(packSend); + break; + } + + case ServerNotification::pickNick: + { + ODServer::ServerMode serverMode; + OD_ASSERT_TRUE(packetReceived >> serverMode); + + ODPacket packSend; + packSend << ClientNotification::setNick << gameMap->getLocalPlayerNick(); + send(packSend); // We can proceed to configure seat level switch(serverMode) @@ -132,14 +142,6 @@ bool ODClient::processOneClientSocketMessage() break; } - case ServerNotification::pickNick: - { - ODPacket packSend; - packSend << ClientNotification::setNick << gameMap->getLocalPlayerNick(); - send(packSend); - break; - } - case ServerNotification::seatConfigurationRefresh: { if(frameListener->getModeManager()->getCurrentModeType() != ModeManager::ModeType::MENU_CONFIGURE_SEATS) diff --git a/source/network/ODServer.cpp b/source/network/ODServer.cpp index 4b0d83d5d..f47c2ec93 100644 --- a/source/network/ODServer.cpp +++ b/source/network/ODServer.cpp @@ -555,7 +555,7 @@ bool ODServer::processClientNotifications(ODSocketClient* clientSocket) LogManager::getSingleton().logMessage("Level relative path sent to client: " + mLevelFilename); setClientState(clientSocket, "loadLevel"); ODPacket packetSend; - packetSend << ServerNotification::loadLevel << mLevelFilename << mServerMode; + packetSend << ServerNotification::loadLevel << mLevelFilename; sendMsgToClient(clientSocket, packetSend); break; } @@ -568,7 +568,7 @@ bool ODServer::processClientNotifications(ODSocketClient* clientSocket) setClientState(clientSocket, "nick"); // Tell the client to give us their nickname ODPacket packetSend; - packetSend << ServerNotification::pickNick; + packetSend << ServerNotification::pickNick << mServerMode; sendMsgToClient(clientSocket, packetSend); break; } @@ -582,7 +582,7 @@ bool ODServer::processClientNotifications(ODSocketClient* clientSocket) std::string clientNick; OD_ASSERT_TRUE(packetReceived >> clientNick); - // NOTE : playerId 0 is reserved for inactive players and 1 is reserved for AI + // NOTE : playerId 0 is reserved for inactive players and 1 is reserved for AI int32_t playerId = mSockClients.size() + 10; Player* curPlayer = new Player(gameMap, playerId); curPlayer->setNick(clientNick); diff --git a/source/render/RenderManager.cpp b/source/render/RenderManager.cpp index 096cc3acd..386f2b9f1 100644 --- a/source/render/RenderManager.cpp +++ b/source/render/RenderManager.cpp @@ -448,6 +448,7 @@ void RenderManager::rrCreateRenderedMovableEntity(RenderedMovableEntity* curRend node->setScale(Ogre::Vector3(0.7, 0.7, 0.7)); node->roll(Ogre::Degree(curRenderedMovableEntity->getRotationAngle())); node->attachObject(ent); + curRenderedMovableEntity->pSN = (node->getParentSceneNode()); } void RenderManager::rrDestroyRenderedMovableEntity(RenderedMovableEntity* curRenderedMovableEntity) diff --git a/source/utils/ConfigManager.cpp b/source/utils/ConfigManager.cpp index a38086922..c8c9e8632 100644 --- a/source/utils/ConfigManager.cpp +++ b/source/utils/ConfigManager.cpp @@ -25,7 +25,7 @@ #include "utils/Helper.h" #include "utils/LogManager.h" -const std::vector EMPTY_SPAWNPOOL; +const std::vector EMPTY_SPAWNPOOL; template<> ConfigManager* Ogre::Singleton::msSingleton = 0; @@ -621,12 +621,13 @@ bool ConfigManager::loadFactions(const std::string& fileName) if (nextParam == "[/Factions]") break; + // We check if the creature definition exists const CreatureDefinition* creatureDefinition = getCreatureDefinition(nextParam); OD_ASSERT_TRUE_MSG(creatureDefinition != nullptr, "factionName=" + factionName + ", class=" + nextParam); if(creatureDefinition == nullptr) continue; - mFactionSpawnPool[factionName].push_back(creatureDefinition); + mFactionSpawnPool[factionName].push_back(nextParam); } } } @@ -826,7 +827,7 @@ const std::vector& ConfigManager::getCreatureSpawnConditi return mCreatureSpawnConditions.at(def); } -const std::vector& ConfigManager::getFactionSpawnPool(const std::string& faction) const +const std::vector& ConfigManager::getFactionSpawnPool(const std::string& faction) const { if(mFactionSpawnPool.count(faction) == 0) return EMPTY_SPAWNPOOL; diff --git a/source/utils/ConfigManager.h b/source/utils/ConfigManager.h index d99da2351..18c27e543 100644 --- a/source/utils/ConfigManager.h +++ b/source/utils/ConfigManager.h @@ -52,7 +52,7 @@ class ConfigManager : public Ogre::Singleton const std::vector& getCreatureSpawnConditions(const CreatureDefinition* def) const; - const std::vector& getFactionSpawnPool(const std::string& faction) const; + const std::vector& getFactionSpawnPool(const std::string& faction) const; const std::vector& getFactions() const { return mFactions; } @@ -95,7 +95,7 @@ class ConfigManager : public Ogre::Singleton uint32_t mNetworkPort; uint32_t mBaseSpawnPoint; std::map > mCreatureSpawnConditions; - std::map > mFactionSpawnPool; + std::map > mFactionSpawnPool; std::vector mFactions; std::map mRoomsConfig; std::map mTrapsConfig;