From 3e88769398de10213dc9d85ff49669d608436b42 Mon Sep 17 00:00:00 2001 From: Matt Gomez Date: Thu, 13 Jun 2024 14:39:14 -0600 Subject: [PATCH] update : https://github.com/opentibiabr/canary/commit/f741bebc0bbd4fb04bdd5948b551f7f5ec91064a --- CMakePresets.json | 1 + .../monster/aquatics/quara_constrictor.lua | 2 +- .../monster/aquatics/quara_hydromancer.lua | 2 +- .../monster/aquatics/quara_mantassin.lua | 2 +- .../monster/aquatics/quara_pincher.lua | 2 +- .../monster/aquatics/quara_predator.lua | 2 +- data-otxserver/monster/bosses/splasher.lua | 2 +- .../monster/constructs/clay_guardian.lua | 2 +- .../monster/constructs/infected_weeper.lua | 2 +- .../monster/constructs/lava_golem.lua | 3 +- .../monster/constructs/magma_crawler.lua | 8 +- .../monster/constructs/orewalker.lua | 3 +- .../monster/constructs/stone_devourer.lua | 2 +- data-otxserver/monster/constructs/weeper.lua | 6 +- .../monster/demons/hellfire_fighter.lua | 2 +- .../monster/elementals/cliff_strider.lua | 6 +- .../monster/elementals/earth_elemental.lua | 4 +- .../elementals/high_voltage_elemental.lua | 2 +- .../monster/elementals/ironblight.lua | 2 +- .../elementals/massive_earth_elemental.lua | 4 +- .../monster/elementals/sulphur_spouter.lua | 2 +- .../monster/humanoids/lost_basher.lua | 6 +- .../monster/humanoids/lost_berserker.lua | 12 +- .../monster/humanoids/lost_husher.lua | 9 +- .../monster/humanoids/lost_thrower.lua | 6 +- data-otxserver/monster/magicals/armadile.lua | 13 +- .../monster/magicals/choking_fear.lua | 2 +- data-otxserver/monster/magicals/phantasm.lua | 2 +- .../monster/magicals/retching_horror.lua | 2 +- .../monster/mammals/mutated_bat.lua | 2 +- .../monster/plants/hideous_fungus.lua | 13 +- .../monster/plants/humongous_fungus.lua | 7 +- .../bigfoots_burden/bosses/abyssador.lua | 2 +- .../bigfoots_burden/bosses/gnomevil.lua | 2 +- .../bigfoots_burden/humorless_fungus.lua | 9 +- .../bosses/the_count_of_the_core.lua | 2 +- .../bosses/the_duke_of_the_depths.lua | 2 +- .../bosses/ferumbras_mortal_shell.lua | 2 +- .../ferumbras_ascendant/bosses/mazoran.lua | 2 +- .../ferumbras_ascendant/bosses/plagirath.lua | 2 +- .../ferumbras_ascendant/bosses/ragiaz.lua | 2 +- .../ferumbras_ascendant/bosses/razzagorn.lua | 2 +- .../ferumbras_ascendant/bosses/shulgrax.lua | 2 +- .../ferumbras_ascendant/bosses/tarbaz.lua | 2 +- .../ferumbras_ascendant/bosses/zamulosh.lua | 2 +- .../quests/in_service_of_yalahar/inky.lua | 2 +- .../in_service_of_yalahar/sharptooth.lua | 2 +- .../monster/reptiles/seacrest_serpent.lua | 2 +- .../monster/reptiles/young_sea_serpent.lua | 2 +- .../monster/undeads/betrayed_wraith.lua | 2 +- .../monster/undeads/blightwalker.lua | 7 +- .../monster/undeads/crypt_warrior.lua | 2 +- .../monster/undeads/falcon_knight.lua | 2 +- .../monster/undeads/falcon_paladin.lua | 2 +- .../monster/undeads/hand_of_cursed_fate.lua | 4 +- .../undeads/skeleton_elite_warrior.lua | 2 +- .../monster/undeads/undead_dragon.lua | 2 +- .../undeads/undead_elite_gladiator.lua | 2 +- .../monster/vermins/cave_devourer.lua | 4 +- .../monster/vermins/chasm_spawn.lua | 4 +- data-otxserver/monster/vermins/deepworm.lua | 2 +- data-otxserver/monster/vermins/diremaw.lua | 2 +- data-otxserver/monster/vermins/drillworm.lua | 2 +- .../monster/vermins/tunnel_tyrant.lua | 4 +- ...{create_monster.lua => manage_monster.lua} | 32 +++- data/scripts/talkactions/god/reload.lua | 3 + docker/Dockerfile.dev | 6 +- docker/data/start.sh | 2 +- docker/docker-compose.yml | 2 - src/creatures/appearance/mounts/mounts.cpp | 2 +- src/creatures/appearance/outfit/outfit.cpp | 37 +++-- src/creatures/appearance/outfit/outfit.hpp | 14 +- src/creatures/monsters/monster.cpp | 33 +++- src/creatures/monsters/monster.hpp | 20 ++- src/creatures/players/grouping/familiars.cpp | 7 +- src/creatures/players/grouping/familiars.hpp | 5 +- src/creatures/players/grouping/groups.cpp | 4 +- src/creatures/players/grouping/groups.hpp | 4 +- src/creatures/players/player.cpp | 42 +++-- src/creatures/players/player.hpp | 23 ++- src/game/functions/game_reload.cpp | 154 ++++++++++-------- src/game/functions/game_reload.hpp | 50 +++--- src/game/game.cpp | 8 +- src/game/game.hpp | 2 + src/io/functions/iologindata_load_player.cpp | 4 +- src/lib/thread/thread_pool.cpp | 5 +- .../creatures/monster/monster_functions.cpp | 20 ++- .../creatures/monster/monster_functions.hpp | 2 + .../creatures/player/group_functions.cpp | 16 +- src/server/network/protocol/protocolgame.cpp | 35 +++- src/server/network/protocol/protocolgame.hpp | 1 + start.sh | 8 +- 92 files changed, 454 insertions(+), 306 deletions(-) rename data/scripts/talkactions/god/{create_monster.lua => manage_monster.lua} (83%) diff --git a/CMakePresets.json b/CMakePresets.json index 92ef2d33c..49f631e19 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -54,6 +54,7 @@ "DEBUG_LOG": "ON", "ASAN_ENABLED": "OFF", "BUILD_STATIC_LIBRARY": "OFF", + "SPEED_UP_BUILD_UNITY": "OFF", "VCPKG_TARGET_TRIPLET": "x64-windows" } }, diff --git a/data-otxserver/monster/aquatics/quara_constrictor.lua b/data-otxserver/monster/aquatics/quara_constrictor.lua index 02b487762..c04460f1f 100644 --- a/data-otxserver/monster/aquatics/quara_constrictor.lua +++ b/data-otxserver/monster/aquatics/quara_constrictor.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Quara Constrictor") local monster = {} monster.description = "a quara constrictor" -monster.experience = 250 +monster.experience = 380 monster.outfit = { lookType = 46, lookHead = 0, diff --git a/data-otxserver/monster/aquatics/quara_hydromancer.lua b/data-otxserver/monster/aquatics/quara_hydromancer.lua index 4129dcfe8..07c3ffbfd 100644 --- a/data-otxserver/monster/aquatics/quara_hydromancer.lua +++ b/data-otxserver/monster/aquatics/quara_hydromancer.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Quara Hydromancer") local monster = {} monster.description = "a quara hydromancer" -monster.experience = 800 +monster.experience = 950 monster.outfit = { lookType = 47, lookHead = 0, diff --git a/data-otxserver/monster/aquatics/quara_mantassin.lua b/data-otxserver/monster/aquatics/quara_mantassin.lua index 53594881d..3e857cab7 100644 --- a/data-otxserver/monster/aquatics/quara_mantassin.lua +++ b/data-otxserver/monster/aquatics/quara_mantassin.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Quara Mantassin") local monster = {} monster.description = "a quara mantassin" -monster.experience = 400 +monster.experience = 600 monster.outfit = { lookType = 72, lookHead = 0, diff --git a/data-otxserver/monster/aquatics/quara_pincher.lua b/data-otxserver/monster/aquatics/quara_pincher.lua index 200aed876..09fea4363 100644 --- a/data-otxserver/monster/aquatics/quara_pincher.lua +++ b/data-otxserver/monster/aquatics/quara_pincher.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Quara Pincher") local monster = {} monster.description = "a quara pincher" -monster.experience = 1200 +monster.experience = 1500 monster.outfit = { lookType = 77, lookHead = 0, diff --git a/data-otxserver/monster/aquatics/quara_predator.lua b/data-otxserver/monster/aquatics/quara_predator.lua index e513aa571..b12719e26 100644 --- a/data-otxserver/monster/aquatics/quara_predator.lua +++ b/data-otxserver/monster/aquatics/quara_predator.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Quara Predator") local monster = {} monster.description = "a quara predator" -monster.experience = 1600 +monster.experience = 1850 monster.outfit = { lookType = 20, lookHead = 0, diff --git a/data-otxserver/monster/bosses/splasher.lua b/data-otxserver/monster/bosses/splasher.lua index 60b89710c..426d3be3c 100644 --- a/data-otxserver/monster/bosses/splasher.lua +++ b/data-otxserver/monster/bosses/splasher.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Splasher") local monster = {} monster.description = "Splasher" -monster.experience = 500 +monster.experience = 1500 monster.outfit = { lookType = 47, lookHead = 0, diff --git a/data-otxserver/monster/constructs/clay_guardian.lua b/data-otxserver/monster/constructs/clay_guardian.lua index 804d671bd..fb28abe50 100644 --- a/data-otxserver/monster/constructs/clay_guardian.lua +++ b/data-otxserver/monster/constructs/clay_guardian.lua @@ -107,7 +107,7 @@ monster.elements = { { type = COMBAT_LIFEDRAIN, percent = 0 }, { type = COMBAT_MANADRAIN, percent = 0 }, { type = COMBAT_DROWNDAMAGE, percent = 0 }, - { type = COMBAT_ICEDAMAGE, percent = 35 }, + { type = COMBAT_ICEDAMAGE, percent = 20 }, { type = COMBAT_HOLYDAMAGE, percent = 0 }, { type = COMBAT_DEATHDAMAGE, percent = 40 }, } diff --git a/data-otxserver/monster/constructs/infected_weeper.lua b/data-otxserver/monster/constructs/infected_weeper.lua index e302618f3..2b7d97f04 100644 --- a/data-otxserver/monster/constructs/infected_weeper.lua +++ b/data-otxserver/monster/constructs/infected_weeper.lua @@ -105,7 +105,7 @@ monster.elements = { { type = COMBAT_PHYSICALDAMAGE, percent = 50 }, { type = COMBAT_ENERGYDAMAGE, percent = 25 }, { type = COMBAT_EARTHDAMAGE, percent = 100 }, - { type = COMBAT_FIREDAMAGE, percent = 100 }, + { type = COMBAT_FIREDAMAGE, percent = -100 }, { type = COMBAT_LIFEDRAIN, percent = 0 }, { type = COMBAT_MANADRAIN, percent = 0 }, { type = COMBAT_DROWNDAMAGE, percent = 0 }, diff --git a/data-otxserver/monster/constructs/lava_golem.lua b/data-otxserver/monster/constructs/lava_golem.lua index aed9ad864..5c3f695cf 100644 --- a/data-otxserver/monster/constructs/lava_golem.lua +++ b/data-otxserver/monster/constructs/lava_golem.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Lava Golem") local monster = {} monster.description = "a lava golem" -monster.experience = 6200 +monster.experience = 7900 monster.outfit = { lookType = 491, lookHead = 0, @@ -109,7 +109,6 @@ monster.loot = { monster.attacks = { { name = "melee", interval = 2000, chance = 100, minDamage = 0, maxDamage = -400 }, { name = "combat", interval = 2000, chance = 15, type = COMBAT_FIREDAMAGE, minDamage = -350, maxDamage = -700, length = 8, spread = 0, effect = CONST_ME_FIREATTACK, target = false }, - { name = "combat", interval = 2000, chance = 10, type = COMBAT_MANADRAIN, minDamage = -600, maxDamage = -1300, length = 8, spread = 3, effect = CONST_ME_MORTAREA, target = false }, { name = "lava golem soulfire", interval = 2000, chance = 15, target = false }, { name = "combat", interval = 2000, chance = 15, type = COMBAT_FIREDAMAGE, minDamage = -220, maxDamage = -350, radius = 4, effect = CONST_ME_FIREAREA, target = true }, { name = "speed", interval = 2000, chance = 10, speedChange = -800, length = 5, spread = 3, effect = CONST_ME_BLOCKHIT, target = false, duration = 30000 }, diff --git a/data-otxserver/monster/constructs/magma_crawler.lua b/data-otxserver/monster/constructs/magma_crawler.lua index 39c58ab88..bf5f7ac4f 100644 --- a/data-otxserver/monster/constructs/magma_crawler.lua +++ b/data-otxserver/monster/constructs/magma_crawler.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Magma Crawler") local monster = {} monster.description = "a magma crawler" -monster.experience = 2700 +monster.experience = 3900 monster.outfit = { lookType = 492, lookHead = 0, @@ -35,7 +35,7 @@ monster.manaCost = 0 monster.changeTarget = { interval = 4000, - chance = 10, + chance = 5, } monster.strategiesTarget = { @@ -118,7 +118,7 @@ monster.defenses = { defense = 45, armor = 84, mitigation = 2.51, - { name = "invisible", interval = 2000, chance = 10, effect = CONST_ME_MAGIC_BLUE }, + { name = "invisible", interval = 2000, chance = 5, effect = CONST_ME_MAGIC_BLUE }, } monster.elements = { @@ -129,7 +129,7 @@ monster.elements = { { type = COMBAT_LIFEDRAIN, percent = 0 }, { type = COMBAT_MANADRAIN, percent = 0 }, { type = COMBAT_DROWNDAMAGE, percent = 0 }, - { type = COMBAT_ICEDAMAGE, percent = 10 }, + { type = COMBAT_ICEDAMAGE, percent = 0 }, { type = COMBAT_HOLYDAMAGE, percent = 0 }, { type = COMBAT_DEATHDAMAGE, percent = 25 }, } diff --git a/data-otxserver/monster/constructs/orewalker.lua b/data-otxserver/monster/constructs/orewalker.lua index 767b8a049..3e1dc4dee 100644 --- a/data-otxserver/monster/constructs/orewalker.lua +++ b/data-otxserver/monster/constructs/orewalker.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Orewalker") local monster = {} monster.description = "an orewalker" -monster.experience = 4800 +monster.experience = 5900 monster.outfit = { lookType = 490, lookHead = 0, @@ -112,7 +112,6 @@ monster.attacks = { { name = "combat", interval = 2000, chance = 10, type = COMBAT_PHYSICALDAMAGE, minDamage = 0, maxDamage = -1500, length = 6, spread = 3, effect = CONST_ME_GROUNDSHAKER, target = false }, -- poison { name = "condition", type = CONDITION_POISON, interval = 2000, chance = 10, minDamage = -800, maxDamage = -1080, radius = 3, shootEffect = CONST_ANI_SMALLEARTH, effect = CONST_ME_SMALLPLANTS, target = true }, - { name = "drunk", interval = 2000, chance = 15, radius = 4, effect = CONST_ME_SOUND_PURPLE, target = false, duration = 6000 }, { name = "speed", interval = 2000, chance = 15, speedChange = -800, radius = 2, effect = CONST_ME_MAGIC_RED, target = false, duration = 20000 }, } diff --git a/data-otxserver/monster/constructs/stone_devourer.lua b/data-otxserver/monster/constructs/stone_devourer.lua index 5a9174c31..39c854028 100644 --- a/data-otxserver/monster/constructs/stone_devourer.lua +++ b/data-otxserver/monster/constructs/stone_devourer.lua @@ -118,7 +118,7 @@ monster.elements = { { type = COMBAT_PHYSICALDAMAGE, percent = 10 }, { type = COMBAT_ENERGYDAMAGE, percent = 30 }, { type = COMBAT_EARTHDAMAGE, percent = 100 }, - { type = COMBAT_FIREDAMAGE, percent = 100 }, + { type = COMBAT_FIREDAMAGE, percent = -5 }, { type = COMBAT_LIFEDRAIN, percent = 0 }, { type = COMBAT_MANADRAIN, percent = 0 }, { type = COMBAT_DROWNDAMAGE, percent = 0 }, diff --git a/data-otxserver/monster/constructs/weeper.lua b/data-otxserver/monster/constructs/weeper.lua index 75a8d7ebb..cfc7c6b0d 100644 --- a/data-otxserver/monster/constructs/weeper.lua +++ b/data-otxserver/monster/constructs/weeper.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Weeper") local monster = {} monster.description = "a weeper" -monster.experience = 4800 +monster.experience = 5800 monster.outfit = { lookType = 489, lookHead = 0, @@ -55,7 +55,7 @@ monster.flags = { canPushCreatures = true, staticAttackChance = 70, targetDistance = 1, - runHealth = 570, + runHealth = 0, healthHidden = false, isBlockable = false, canWalkOnEnergy = false, @@ -101,7 +101,7 @@ monster.attacks = { { name = "melee", interval = 2000, chance = 100, minDamage = 0, maxDamage = -450 }, { name = "combat", interval = 2000, chance = 15, type = COMBAT_FIREDAMAGE, minDamage = -400, maxDamage = -1000, length = 8, spread = 0, effect = CONST_ME_FIREATTACK, target = false }, { name = "combat", interval = 3000, chance = 100, type = COMBAT_FIREDAMAGE, minDamage = -80, maxDamage = -250, radius = 3, effect = CONST_ME_HITBYFIRE, target = false }, - { name = "speed", interval = 2000, chance = 10, speedChange = -800, length = 5, spread = 0, effect = CONST_ME_BLOCKHIT, target = false, duration = 30000 }, + { name = "speed", interval = 2000, chance = 10, speedChange = -600, length = 5, spread = 0, effect = CONST_ME_BLOCKHIT, target = false, duration = 30000 }, } monster.defenses = { diff --git a/data-otxserver/monster/demons/hellfire_fighter.lua b/data-otxserver/monster/demons/hellfire_fighter.lua index 6a90b5af0..2ae5b0030 100644 --- a/data-otxserver/monster/demons/hellfire_fighter.lua +++ b/data-otxserver/monster/demons/hellfire_fighter.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Hellfire Fighter") local monster = {} monster.description = "a hellfire fighter" -monster.experience = 3400 +monster.experience = 3800 monster.outfit = { lookType = 243, lookHead = 0, diff --git a/data-otxserver/monster/elementals/cliff_strider.lua b/data-otxserver/monster/elementals/cliff_strider.lua index 2690f356f..2e143d427 100644 --- a/data-otxserver/monster/elementals/cliff_strider.lua +++ b/data-otxserver/monster/elementals/cliff_strider.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Cliff Strider") local monster = {} monster.description = "a cliff strider" -monster.experience = 5700 +monster.experience = 7100 monster.outfit = { lookType = 497, lookHead = 0, @@ -119,7 +119,7 @@ monster.attacks = { { name = "cliff strider skill reducer", interval = 2000, chance = 10, target = false }, { name = "cliff strider electrify", interval = 2000, chance = 15, range = 1, target = false }, { name = "combat", interval = 2000, chance = 10, type = COMBAT_PHYSICALDAMAGE, minDamage = 0, maxDamage = -1000, length = 6, spread = 0, effect = CONST_ME_GROUNDSHAKER, target = false }, - { name = "combat", interval = 2000, chance = 15, type = COMBAT_MANADRAIN, minDamage = -100, maxDamage = -300, radius = 4, effect = CONST_ME_YELLOWENERGY, target = false }, + { name = "combat", interval = 2000, chance = 10, type = COMBAT_MANADRAIN, minDamage = -100, maxDamage = -300, radius = 4, effect = CONST_ME_YELLOWENERGY, target = false }, } monster.defenses = { @@ -130,7 +130,7 @@ monster.defenses = { monster.elements = { { type = COMBAT_PHYSICALDAMAGE, percent = 10 }, - { type = COMBAT_ENERGYDAMAGE, percent = 100 }, + { type = COMBAT_ENERGYDAMAGE, percent = 5 }, { type = COMBAT_EARTHDAMAGE, percent = 100 }, { type = COMBAT_FIREDAMAGE, percent = 20 }, { type = COMBAT_LIFEDRAIN, percent = 0 }, diff --git a/data-otxserver/monster/elementals/earth_elemental.lua b/data-otxserver/monster/elementals/earth_elemental.lua index f71d6a796..4c3b3e11a 100644 --- a/data-otxserver/monster/elementals/earth_elemental.lua +++ b/data-otxserver/monster/elementals/earth_elemental.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Earth Elemental") local monster = {} monster.description = "an earth elemental" -monster.experience = 450 +monster.experience = 550 monster.outfit = { lookType = 301, lookHead = 0, @@ -117,7 +117,7 @@ monster.elements = { { type = COMBAT_LIFEDRAIN, percent = 0 }, { type = COMBAT_MANADRAIN, percent = 0 }, { type = COMBAT_DROWNDAMAGE, percent = 0 }, - { type = COMBAT_ICEDAMAGE, percent = 85 }, + { type = COMBAT_ICEDAMAGE, percent = 5 }, { type = COMBAT_HOLYDAMAGE, percent = 50 }, { type = COMBAT_DEATHDAMAGE, percent = 40 }, } diff --git a/data-otxserver/monster/elementals/high_voltage_elemental.lua b/data-otxserver/monster/elementals/high_voltage_elemental.lua index ca99e5752..3d6806a70 100644 --- a/data-otxserver/monster/elementals/high_voltage_elemental.lua +++ b/data-otxserver/monster/elementals/high_voltage_elemental.lua @@ -102,7 +102,7 @@ monster.elements = { { type = COMBAT_PHYSICALDAMAGE, percent = 35 }, { type = COMBAT_ENERGYDAMAGE, percent = 100 }, { type = COMBAT_EARTHDAMAGE, percent = -15 }, - { type = COMBAT_FIREDAMAGE, percent = 100 }, + { type = COMBAT_FIREDAMAGE, percent = -100 }, { type = COMBAT_LIFEDRAIN, percent = 0 }, { type = COMBAT_MANADRAIN, percent = 0 }, { type = COMBAT_DROWNDAMAGE, percent = 0 }, diff --git a/data-otxserver/monster/elementals/ironblight.lua b/data-otxserver/monster/elementals/ironblight.lua index 593069318..7cb7c7c58 100644 --- a/data-otxserver/monster/elementals/ironblight.lua +++ b/data-otxserver/monster/elementals/ironblight.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Ironblight") local monster = {} monster.description = "an ironblight" -monster.experience = 4400 +monster.experience = 5400 monster.outfit = { lookType = 498, lookHead = 0, diff --git a/data-otxserver/monster/elementals/massive_earth_elemental.lua b/data-otxserver/monster/elementals/massive_earth_elemental.lua index e894319b6..1b131e7c7 100644 --- a/data-otxserver/monster/elementals/massive_earth_elemental.lua +++ b/data-otxserver/monster/elementals/massive_earth_elemental.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Massive Earth Elemental") local monster = {} monster.description = "a massive earth elemental" -monster.experience = 950 +monster.experience = 1100 monster.outfit = { lookType = 285, lookHead = 0, @@ -119,7 +119,7 @@ monster.elements = { { type = COMBAT_LIFEDRAIN, percent = 0 }, { type = COMBAT_MANADRAIN, percent = 0 }, { type = COMBAT_DROWNDAMAGE, percent = 0 }, - { type = COMBAT_ICEDAMAGE, percent = 100 }, + { type = COMBAT_ICEDAMAGE, percent = 15 }, { type = COMBAT_HOLYDAMAGE, percent = 50 }, { type = COMBAT_DEATHDAMAGE, percent = 45 }, } diff --git a/data-otxserver/monster/elementals/sulphur_spouter.lua b/data-otxserver/monster/elementals/sulphur_spouter.lua index 6f574cc0a..79ebcf8db 100644 --- a/data-otxserver/monster/elementals/sulphur_spouter.lua +++ b/data-otxserver/monster/elementals/sulphur_spouter.lua @@ -105,7 +105,7 @@ monster.elements = { { type = COMBAT_PHYSICALDAMAGE, percent = 0 }, { type = COMBAT_ENERGYDAMAGE, percent = 0 }, { type = COMBAT_EARTHDAMAGE, percent = 0 }, - { type = COMBAT_FIREDAMAGE, percent = 100 }, + { type = COMBAT_FIREDAMAGE, percent = 25 }, { type = COMBAT_LIFEDRAIN, percent = 0 }, { type = COMBAT_MANADRAIN, percent = 0 }, { type = COMBAT_DROWNDAMAGE, percent = 0 }, diff --git a/data-otxserver/monster/humanoids/lost_basher.lua b/data-otxserver/monster/humanoids/lost_basher.lua index e19aef97f..f8866bdd1 100644 --- a/data-otxserver/monster/humanoids/lost_basher.lua +++ b/data-otxserver/monster/humanoids/lost_basher.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Lost Basher") local monster = {} monster.description = "a lost basher" -monster.experience = 1800 +monster.experience = 2300 monster.outfit = { lookType = 538, lookHead = 0, @@ -61,7 +61,7 @@ monster.flags = { healthHidden = false, isBlockable = false, canWalkOnEnergy = false, - canWalkOnFire = false, + canWalkOnFire = true, canWalkOnPoison = true, } @@ -126,7 +126,7 @@ monster.elements = { { type = COMBAT_LIFEDRAIN, percent = 0 }, { type = COMBAT_MANADRAIN, percent = 0 }, { type = COMBAT_DROWNDAMAGE, percent = 0 }, - { type = COMBAT_ICEDAMAGE, percent = 20 }, + { type = COMBAT_ICEDAMAGE, percent = 0 }, { type = COMBAT_HOLYDAMAGE, percent = 0 }, { type = COMBAT_DEATHDAMAGE, percent = 15 }, } diff --git a/data-otxserver/monster/humanoids/lost_berserker.lua b/data-otxserver/monster/humanoids/lost_berserker.lua index cd48787df..cbc7012ff 100644 --- a/data-otxserver/monster/humanoids/lost_berserker.lua +++ b/data-otxserver/monster/humanoids/lost_berserker.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Lost Berserker") local monster = {} monster.description = "a lost berserker" -monster.experience = 4400 +monster.experience = 4800 monster.outfit = { lookType = 496, lookHead = 0, @@ -111,27 +111,25 @@ monster.attacks = { { name = "melee", interval = 2000, chance = 100, minDamage = 0, maxDamage = -501 }, { name = "combat", interval = 2000, chance = 15, type = COMBAT_PHYSICALDAMAGE, minDamage = 0, maxDamage = -300, range = 7, shootEffect = CONST_ANI_WHIRLWINDAXE, target = false }, { name = "combat", interval = 2000, chance = 15, type = COMBAT_PHYSICALDAMAGE, minDamage = 0, maxDamage = -250, range = 7, radius = 3, shootEffect = CONST_ANI_EXPLOSION, effect = CONST_ME_EXPLOSIONAREA, target = true }, - { name = "combat", interval = 2000, chance = 10, type = COMBAT_MANADRAIN, minDamage = -150, maxDamage = -250, radius = 5, effect = CONST_ME_MAGIC_RED, target = false }, + { name = "combat", interval = 2000, chance = 10, type = COMBAT_MANADRAIN, minDamage = -50, maxDamage = -100, radius = 5, effect = CONST_ME_MAGIC_RED, target = false }, { name = "speed", interval = 2000, chance = 10, speedChange = -800, radius = 2, effect = CONST_ME_MAGIC_RED, target = false, duration = 20000 }, - { name = "drunk", interval = 2000, chance = 10, radius = 4, effect = CONST_ME_STUN, target = true, duration = 6000 }, } monster.defenses = { defense = 40, armor = 80, mitigation = 2.40, - { name = "invisible", interval = 2000, chance = 5, effect = CONST_ME_TELEPORT }, } monster.elements = { { type = COMBAT_PHYSICALDAMAGE, percent = 20 }, - { type = COMBAT_ENERGYDAMAGE, percent = 17 }, + { type = COMBAT_ENERGYDAMAGE, percent = 100 }, { type = COMBAT_EARTHDAMAGE, percent = 100 }, { type = COMBAT_FIREDAMAGE, percent = 10 }, { type = COMBAT_LIFEDRAIN, percent = 0 }, { type = COMBAT_MANADRAIN, percent = 0 }, { type = COMBAT_DROWNDAMAGE, percent = 0 }, - { type = COMBAT_ICEDAMAGE, percent = 40 }, + { type = COMBAT_ICEDAMAGE, percent = 10 }, { type = COMBAT_HOLYDAMAGE, percent = 0 }, { type = COMBAT_DEATHDAMAGE, percent = 15 }, } @@ -139,7 +137,7 @@ monster.elements = { monster.immunities = { { type = "paralyze", condition = true }, { type = "outfit", condition = false }, - { type = "invisible", condition = true }, + { type = "invisible", condition = false }, { type = "bleed", condition = false }, } diff --git a/data-otxserver/monster/humanoids/lost_husher.lua b/data-otxserver/monster/humanoids/lost_husher.lua index d8167f971..419bae1ab 100644 --- a/data-otxserver/monster/humanoids/lost_husher.lua +++ b/data-otxserver/monster/humanoids/lost_husher.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Lost Husher") local monster = {} monster.description = "a lost husher" -monster.experience = 1800 +monster.experience = 1100 monster.outfit = { lookType = 537, lookHead = 0, @@ -61,7 +61,7 @@ monster.flags = { healthHidden = false, isBlockable = false, canWalkOnEnergy = false, - canWalkOnFire = false, + canWalkOnFire = true, canWalkOnPoison = true, } @@ -103,7 +103,6 @@ monster.loot = { monster.attacks = { { name = "combat", interval = 2000, chance = 10, type = COMBAT_DEATHDAMAGE, minDamage = -150, maxDamage = -300, length = 6, spread = 0, effect = CONST_ME_BLACKSMOKE, target = false }, - { name = "combat", interval = 2000, chance = 10, type = COMBAT_MANADRAIN, minDamage = -150, maxDamage = -250, radius = 5, effect = CONST_ME_BLACKSMOKE, target = false }, { name = "combat", interval = 2000, chance = 10, type = COMBAT_DEATHDAMAGE, minDamage = -150, maxDamage = -200, range = 7, shootEffect = CONST_ANI_SUDDENDEATH, effect = CONST_ME_MORTAREA, target = false }, { name = "combat", interval = 2000, chance = 10, type = COMBAT_EARTHDAMAGE, minDamage = -150, maxDamage = -250, range = 7, radius = 2, shootEffect = CONST_ANI_SMALLEARTH, effect = CONST_ME_MAGIC_GREEN, target = true }, { name = "drunk", interval = 2000, chance = 10, radius = 4, effect = CONST_ME_SOUND_RED, target = false, duration = 6000 }, @@ -125,7 +124,7 @@ monster.elements = { { type = COMBAT_LIFEDRAIN, percent = 0 }, { type = COMBAT_MANADRAIN, percent = 0 }, { type = COMBAT_DROWNDAMAGE, percent = 0 }, - { type = COMBAT_ICEDAMAGE, percent = 15 }, + { type = COMBAT_ICEDAMAGE, percent = 0 }, { type = COMBAT_HOLYDAMAGE, percent = -10 }, { type = COMBAT_DEATHDAMAGE, percent = 20 }, } @@ -133,7 +132,7 @@ monster.elements = { monster.immunities = { { type = "paralyze", condition = true }, { type = "outfit", condition = false }, - { type = "invisible", condition = true }, + { type = "invisible", condition = false }, { type = "bleed", condition = false }, } diff --git a/data-otxserver/monster/humanoids/lost_thrower.lua b/data-otxserver/monster/humanoids/lost_thrower.lua index c2a87f0d5..21a14bce0 100644 --- a/data-otxserver/monster/humanoids/lost_thrower.lua +++ b/data-otxserver/monster/humanoids/lost_thrower.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Lost Thrower") local monster = {} monster.description = "a lost thrower" -monster.experience = 1200 +monster.experience = 1500 monster.outfit = { lookType = 539, lookHead = 0, @@ -61,7 +61,7 @@ monster.flags = { healthHidden = false, isBlockable = false, canWalkOnEnergy = false, - canWalkOnFire = false, + canWalkOnFire = true, canWalkOnPoison = true, } @@ -117,7 +117,7 @@ monster.elements = { { type = COMBAT_LIFEDRAIN, percent = 0 }, { type = COMBAT_MANADRAIN, percent = 0 }, { type = COMBAT_DROWNDAMAGE, percent = 0 }, - { type = COMBAT_ICEDAMAGE, percent = 15 }, + { type = COMBAT_ICEDAMAGE, percent = -5 }, { type = COMBAT_HOLYDAMAGE, percent = 0 }, { type = COMBAT_DEATHDAMAGE, percent = 10 }, } diff --git a/data-otxserver/monster/magicals/armadile.lua b/data-otxserver/monster/magicals/armadile.lua index beca89510..98665845d 100644 --- a/data-otxserver/monster/magicals/armadile.lua +++ b/data-otxserver/monster/magicals/armadile.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Armadile") local monster = {} monster.description = "an armadile" -monster.experience = 2900 +monster.experience = 3200 monster.outfit = { lookType = 487, lookHead = 0, @@ -56,8 +56,8 @@ monster.flags = { canPushItems = false, canPushCreatures = true, staticAttackChance = 90, - targetDistance = 4, - runHealth = 300, + targetDistance = 1, + runHealth = 0, healthHidden = false, isBlockable = false, canWalkOnEnergy = false, @@ -102,9 +102,7 @@ monster.loot = { monster.attacks = { { name = "melee", interval = 2000, chance = 100, minDamage = 0, maxDamage = -150 }, - { name = "drunk", interval = 2000, chance = 15, radius = 4, effect = CONST_ME_FIREAREA, target = true, duration = 5000 }, - { name = "combat", interval = 2000, chance = 15, type = COMBAT_MANADRAIN, minDamage = -430, maxDamage = -550, range = 7, effect = CONST_ME_MAGIC_BLUE, target = false }, - -- poison + { name = "drunk", interval = 2000, chance = 10, radius = 4, effect = CONST_ME_FIREAREA, target = true, duration = 5000 }, { name = "condition", type = CONDITION_POISON, interval = 2000, chance = 15, minDamage = -200, maxDamage = -400, radius = 4, effect = CONST_ME_POISONAREA, target = false }, } @@ -112,14 +110,13 @@ monster.defenses = { defense = 25, armor = 66, mitigation = 1.96, - { name = "invisible", interval = 2000, chance = 15, effect = CONST_ME_MAGIC_RED }, } monster.elements = { { type = COMBAT_PHYSICALDAMAGE, percent = 5 }, { type = COMBAT_ENERGYDAMAGE, percent = 15 }, { type = COMBAT_EARTHDAMAGE, percent = 100 }, - { type = COMBAT_FIREDAMAGE, percent = 20 }, + { type = COMBAT_FIREDAMAGE, percent = 0 }, { type = COMBAT_LIFEDRAIN, percent = 0 }, { type = COMBAT_MANADRAIN, percent = 0 }, { type = COMBAT_DROWNDAMAGE, percent = 0 }, diff --git a/data-otxserver/monster/magicals/choking_fear.lua b/data-otxserver/monster/magicals/choking_fear.lua index 16361bab0..604ca5cda 100644 --- a/data-otxserver/monster/magicals/choking_fear.lua +++ b/data-otxserver/monster/magicals/choking_fear.lua @@ -124,7 +124,7 @@ monster.defenses = { monster.elements = { { type = COMBAT_PHYSICALDAMAGE, percent = 10 }, - { type = COMBAT_ENERGYDAMAGE, percent = 15 }, + { type = COMBAT_ENERGYDAMAGE, percent = 2 }, { type = COMBAT_EARTHDAMAGE, percent = 100 }, { type = COMBAT_FIREDAMAGE, percent = 100 }, { type = COMBAT_LIFEDRAIN, percent = 0 }, diff --git a/data-otxserver/monster/magicals/phantasm.lua b/data-otxserver/monster/magicals/phantasm.lua index 9dc266f8b..36c0baed4 100644 --- a/data-otxserver/monster/magicals/phantasm.lua +++ b/data-otxserver/monster/magicals/phantasm.lua @@ -70,7 +70,7 @@ monster.light = { monster.summon = { maxSummons = 4, summons = { - { name = "Phantasm Summon", chance = 20, interval = 2000, count = 4 }, + { name = "Phantasm Summon", chance = 35, interval = 2000, count = 4 }, }, } diff --git a/data-otxserver/monster/magicals/retching_horror.lua b/data-otxserver/monster/magicals/retching_horror.lua index a6814343e..0479a7cb3 100644 --- a/data-otxserver/monster/magicals/retching_horror.lua +++ b/data-otxserver/monster/magicals/retching_horror.lua @@ -113,7 +113,7 @@ monster.defenses = { monster.elements = { { type = COMBAT_PHYSICALDAMAGE, percent = 5 }, - { type = COMBAT_ENERGYDAMAGE, percent = 10 }, + { type = COMBAT_ENERGYDAMAGE, percent = -3 }, { type = COMBAT_EARTHDAMAGE, percent = 100 }, { type = COMBAT_FIREDAMAGE, percent = 85 }, { type = COMBAT_LIFEDRAIN, percent = 0 }, diff --git a/data-otxserver/monster/mammals/mutated_bat.lua b/data-otxserver/monster/mammals/mutated_bat.lua index 211ca62d2..dfea48034 100644 --- a/data-otxserver/monster/mammals/mutated_bat.lua +++ b/data-otxserver/monster/mammals/mutated_bat.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Mutated Bat") local monster = {} monster.description = "a mutated bat" -monster.experience = 615 +monster.experience = 750 monster.outfit = { lookType = 307, lookHead = 0, diff --git a/data-otxserver/monster/plants/hideous_fungus.lua b/data-otxserver/monster/plants/hideous_fungus.lua index a80ba080f..275adb03b 100644 --- a/data-otxserver/monster/plants/hideous_fungus.lua +++ b/data-otxserver/monster/plants/hideous_fungus.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Hideous Fungus") local monster = {} monster.description = "a hideous fungus" -monster.experience = 2900 +monster.experience = 3700 monster.outfit = { lookType = 499, lookHead = 0, @@ -57,7 +57,7 @@ monster.flags = { canPushCreatures = true, staticAttackChance = 90, targetDistance = 4, - runHealth = 275, + runHealth = 0, healthHidden = false, isBlockable = false, canWalkOnEnergy = true, @@ -71,9 +71,9 @@ monster.light = { } monster.summon = { - maxSummons = 2, + maxSummons = 1, summons = { - { name = "humorless fungus", chance = 10, interval = 2000, count = 2 }, + { name = "humorless fungus", chance = 10, interval = 2000, count = 1 }, }, } @@ -110,7 +110,6 @@ monster.attacks = { { name = "melee", interval = 2000, chance = 100, minDamage = 0, maxDamage = -450 }, { name = "combat", interval = 2000, chance = 15, type = COMBAT_EARTHDAMAGE, minDamage = -250, maxDamage = -430, range = 7, shootEffect = CONST_ANI_SMALLEARTH, effect = CONST_ME_SMALLPLANTS, target = false }, { name = "combat", interval = 2000, chance = 15, type = COMBAT_ICEDAMAGE, minDamage = -250, maxDamage = -550, length = 8, spread = 0, shootEffect = CONST_ANI_SNOWBALL, effect = CONST_ME_ICEAREA, target = false }, - { name = "speed", interval = 2000, chance = 10, speedChange = -600, radius = 1, effect = CONST_ME_MAGIC_RED, target = true, duration = 60000 }, { name = "drunk", interval = 2000, chance = 10, range = 7, radius = 5, shootEffect = CONST_ANI_SMALLSTONE, effect = CONST_ME_STUN, target = true, duration = 4000 }, -- poison { name = "condition", type = CONDITION_POISON, interval = 2000, chance = 10, minDamage = -400, maxDamage = -640, range = 7, radius = 3, effect = CONST_ME_HITBYPOISON, target = false }, @@ -121,14 +120,14 @@ monster.defenses = { armor = 60, mitigation = 1.74, { name = "combat", interval = 2000, chance = 15, type = COMBAT_HEALING, minDamage = 275, maxDamage = 350, effect = CONST_ME_MAGIC_BLUE, target = false }, - { name = "invisible", interval = 2000, chance = 10, effect = CONST_ME_MAGIC_BLUE }, + { name = "invisible", interval = 2000, chance = 5, effect = CONST_ME_MAGIC_BLUE, duration = 2000 }, } monster.elements = { { type = COMBAT_PHYSICALDAMAGE, percent = 0 }, { type = COMBAT_ENERGYDAMAGE, percent = 15 }, { type = COMBAT_EARTHDAMAGE, percent = 100 }, - { type = COMBAT_FIREDAMAGE, percent = 5 }, + { type = COMBAT_FIREDAMAGE, percent = -5 }, { type = COMBAT_LIFEDRAIN, percent = 0 }, { type = COMBAT_MANADRAIN, percent = 0 }, { type = COMBAT_DROWNDAMAGE, percent = 0 }, diff --git a/data-otxserver/monster/plants/humongous_fungus.lua b/data-otxserver/monster/plants/humongous_fungus.lua index 942684e73..09f301a6a 100644 --- a/data-otxserver/monster/plants/humongous_fungus.lua +++ b/data-otxserver/monster/plants/humongous_fungus.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Humongous Fungus") local monster = {} monster.description = "a humongous fungus" -monster.experience = 2600 +monster.experience = 2900 monster.outfit = { lookType = 488, lookHead = 0, @@ -104,7 +104,7 @@ monster.loot = { monster.attacks = { { name = "melee", interval = 2000, chance = 100, minDamage = 0, maxDamage = -330 }, { name = "combat", interval = 2000, chance = 15, type = COMBAT_EARTHDAMAGE, minDamage = -180, maxDamage = -350, range = 7, shootEffect = CONST_ANI_SMALLEARTH, effect = CONST_ME_SMALLPLANTS, target = false }, - { name = "poisonfield", interval = 2000, chance = 20, radius = 4, target = false }, + { name = "poisonfield", interval = 2000, chance = 10, radius = 4, target = false }, -- poison { name = "condition", type = CONDITION_POISON, interval = 2000, chance = 10, minDamage = -500, maxDamage = -1000, length = 8, spread = 0, effect = CONST_ME_GREEN_RINGS, target = false }, { name = "combat", interval = 2000, chance = 10, type = COMBAT_LIFEDRAIN, minDamage = -130, maxDamage = -260, length = 5, spread = 0, effect = CONST_ME_MAGIC_RED, target = false }, @@ -117,14 +117,13 @@ monster.defenses = { armor = 70, mitigation = 2.02, { name = "combat", interval = 2000, chance = 10, type = COMBAT_HEALING, minDamage = 225, maxDamage = 380, effect = CONST_ME_MAGIC_BLUE, target = false }, - { name = "invisible", interval = 2000, chance = 15, effect = CONST_ME_MAGIC_BLUE }, } monster.elements = { { type = COMBAT_PHYSICALDAMAGE, percent = 0 }, { type = COMBAT_ENERGYDAMAGE, percent = 15 }, { type = COMBAT_EARTHDAMAGE, percent = 100 }, - { type = COMBAT_FIREDAMAGE, percent = 5 }, + { type = COMBAT_FIREDAMAGE, percent = -10 }, { type = COMBAT_LIFEDRAIN, percent = 0 }, { type = COMBAT_MANADRAIN, percent = 0 }, { type = COMBAT_DROWNDAMAGE, percent = 0 }, diff --git a/data-otxserver/monster/quests/bigfoots_burden/bosses/abyssador.lua b/data-otxserver/monster/quests/bigfoots_burden/bosses/abyssador.lua index 24c993fda..1ca0ff1ca 100644 --- a/data-otxserver/monster/quests/bigfoots_burden/bosses/abyssador.lua +++ b/data-otxserver/monster/quests/bigfoots_burden/bosses/abyssador.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Abyssador") local monster = {} monster.description = "Abyssador" -monster.experience = 50000 +monster.experience = 400000 monster.outfit = { lookType = 495, lookHead = 0, diff --git a/data-otxserver/monster/quests/bigfoots_burden/bosses/gnomevil.lua b/data-otxserver/monster/quests/bigfoots_burden/bosses/gnomevil.lua index cd287d837..8d410c85d 100644 --- a/data-otxserver/monster/quests/bigfoots_burden/bosses/gnomevil.lua +++ b/data-otxserver/monster/quests/bigfoots_burden/bosses/gnomevil.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Gnomevil") local monster = {} monster.description = "Gnomevil" -monster.experience = 45000 +monster.experience = 400000 monster.outfit = { lookType = 504, lookHead = 0, diff --git a/data-otxserver/monster/quests/bigfoots_burden/humorless_fungus.lua b/data-otxserver/monster/quests/bigfoots_burden/humorless_fungus.lua index 19ab32302..ead6b096f 100644 --- a/data-otxserver/monster/quests/bigfoots_burden/humorless_fungus.lua +++ b/data-otxserver/monster/quests/bigfoots_burden/humorless_fungus.lua @@ -13,8 +13,8 @@ monster.outfit = { lookMount = 0, } -monster.health = 2500 -monster.maxHealth = 2500 +monster.health = 1600 +monster.maxHealth = 1600 monster.race = "venom" monster.corpse = 16083 monster.speed = 115 @@ -70,17 +70,14 @@ monster.attacks = { { name = "melee", interval = 2000, chance = 100, minDamage = 0, maxDamage = -475 }, { name = "combat", interval = 2000, chance = 10, type = COMBAT_EARTHDAMAGE, minDamage = -40, maxDamage = -197, range = 7, shootEffect = CONST_ANI_SMALLEARTH, effect = CONST_ME_SMALLPLANTS, target = true }, { name = "combat", interval = 2000, chance = 10, type = COMBAT_ICEDAMAGE, minDamage = 0, maxDamage = -525, range = 7, shootEffect = CONST_ANI_SNOWBALL, effect = CONST_ME_ICEAREA, target = true }, - -- poison { name = "condition", type = CONDITION_POISON, interval = 2000, chance = 10, minDamage = -400, maxDamage = -640, range = 7, radius = 3, effect = CONST_ME_HITBYPOISON, target = false }, - { name = "drunk", interval = 2000, chance = 10, range = 7, radius = 4, effect = CONST_ME_STUN, target = true, duration = 4000 }, } monster.defenses = { defense = 0, armor = 0, - -- mitigation = ???, { name = "combat", interval = 2000, chance = 5, type = COMBAT_HEALING, minDamage = 0, maxDamage = 230, effect = CONST_ME_MAGIC_BLUE, target = false }, - { name = "invisible", interval = 2000, chance = 10, effect = CONST_ME_MAGIC_BLUE }, + { name = "invisible", interval = 2000, chance = 5, effect = CONST_ME_MAGIC_BLUE }, } monster.elements = { diff --git a/data-otxserver/monster/quests/dangerous_depth/bosses/the_count_of_the_core.lua b/data-otxserver/monster/quests/dangerous_depth/bosses/the_count_of_the_core.lua index d611e78d8..17cb6520d 100644 --- a/data-otxserver/monster/quests/dangerous_depth/bosses/the_count_of_the_core.lua +++ b/data-otxserver/monster/quests/dangerous_depth/bosses/the_count_of_the_core.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("The Count of the Core") local monster = {} monster.description = "The Count Of The Core" -monster.experience = 40000 +monster.experience = 300000 monster.outfit = { lookType = 1046, lookHead = 0, diff --git a/data-otxserver/monster/quests/dangerous_depth/bosses/the_duke_of_the_depths.lua b/data-otxserver/monster/quests/dangerous_depth/bosses/the_duke_of_the_depths.lua index d654288c4..99053b938 100644 --- a/data-otxserver/monster/quests/dangerous_depth/bosses/the_duke_of_the_depths.lua +++ b/data-otxserver/monster/quests/dangerous_depth/bosses/the_duke_of_the_depths.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("The Duke of the Depths") local monster = {} monster.description = "The Duke Of The Depths" -monster.experience = 40000 +monster.experience = 300000 monster.outfit = { lookType = 1047, lookHead = 0, diff --git a/data-otxserver/monster/quests/ferumbras_ascendant/bosses/ferumbras_mortal_shell.lua b/data-otxserver/monster/quests/ferumbras_ascendant/bosses/ferumbras_mortal_shell.lua index 90b312436..7ad855bc8 100644 --- a/data-otxserver/monster/quests/ferumbras_ascendant/bosses/ferumbras_mortal_shell.lua +++ b/data-otxserver/monster/quests/ferumbras_ascendant/bosses/ferumbras_mortal_shell.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Ferumbras Mortal Shell") local monster = {} monster.description = "Ferumbras Mortal Shell" -monster.experience = 500000 +monster.experience = 2000000 monster.outfit = { lookType = 229, lookHead = 0, diff --git a/data-otxserver/monster/quests/ferumbras_ascendant/bosses/mazoran.lua b/data-otxserver/monster/quests/ferumbras_ascendant/bosses/mazoran.lua index 0e0822e3d..3f32bac95 100644 --- a/data-otxserver/monster/quests/ferumbras_ascendant/bosses/mazoran.lua +++ b/data-otxserver/monster/quests/ferumbras_ascendant/bosses/mazoran.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Mazoran") local monster = {} monster.description = "Mazoran" -monster.experience = 250000 +monster.experience = 500000 monster.outfit = { lookType = 842, lookHead = 77, diff --git a/data-otxserver/monster/quests/ferumbras_ascendant/bosses/plagirath.lua b/data-otxserver/monster/quests/ferumbras_ascendant/bosses/plagirath.lua index 625f10cf7..364b4f864 100644 --- a/data-otxserver/monster/quests/ferumbras_ascendant/bosses/plagirath.lua +++ b/data-otxserver/monster/quests/ferumbras_ascendant/bosses/plagirath.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Plagirath") local monster = {} monster.description = "Plagirath" -monster.experience = 250000 +monster.experience = 500000 monster.outfit = { lookType = 862, lookHead = 84, diff --git a/data-otxserver/monster/quests/ferumbras_ascendant/bosses/ragiaz.lua b/data-otxserver/monster/quests/ferumbras_ascendant/bosses/ragiaz.lua index 9701dc7d0..df016edfd 100644 --- a/data-otxserver/monster/quests/ferumbras_ascendant/bosses/ragiaz.lua +++ b/data-otxserver/monster/quests/ferumbras_ascendant/bosses/ragiaz.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Ragiaz") local monster = {} monster.description = "Ragiaz" -monster.experience = 250000 +monster.experience = 500000 monster.outfit = { lookType = 862, lookHead = 76, diff --git a/data-otxserver/monster/quests/ferumbras_ascendant/bosses/razzagorn.lua b/data-otxserver/monster/quests/ferumbras_ascendant/bosses/razzagorn.lua index 67d218c5e..066e22237 100644 --- a/data-otxserver/monster/quests/ferumbras_ascendant/bosses/razzagorn.lua +++ b/data-otxserver/monster/quests/ferumbras_ascendant/bosses/razzagorn.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Razzagorn") local monster = {} monster.description = "Razzagorn" -monster.experience = 250000 +monster.experience = 500000 monster.outfit = { lookType = 842, lookHead = 78, diff --git a/data-otxserver/monster/quests/ferumbras_ascendant/bosses/shulgrax.lua b/data-otxserver/monster/quests/ferumbras_ascendant/bosses/shulgrax.lua index c0de2c0c3..72c908104 100644 --- a/data-otxserver/monster/quests/ferumbras_ascendant/bosses/shulgrax.lua +++ b/data-otxserver/monster/quests/ferumbras_ascendant/bosses/shulgrax.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Shulgrax") local monster = {} monster.description = "Shulgrax" -monster.experience = 250000 +monster.experience = 500000 monster.outfit = { lookType = 842, lookHead = 0, diff --git a/data-otxserver/monster/quests/ferumbras_ascendant/bosses/tarbaz.lua b/data-otxserver/monster/quests/ferumbras_ascendant/bosses/tarbaz.lua index 583167460..30b99353c 100644 --- a/data-otxserver/monster/quests/ferumbras_ascendant/bosses/tarbaz.lua +++ b/data-otxserver/monster/quests/ferumbras_ascendant/bosses/tarbaz.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Tarbaz") local monster = {} monster.description = "Tarbaz" -monster.experience = 250000 +monster.experience = 500000 monster.outfit = { lookType = 842, lookHead = 0, diff --git a/data-otxserver/monster/quests/ferumbras_ascendant/bosses/zamulosh.lua b/data-otxserver/monster/quests/ferumbras_ascendant/bosses/zamulosh.lua index 5a441ff10..03fa92d33 100644 --- a/data-otxserver/monster/quests/ferumbras_ascendant/bosses/zamulosh.lua +++ b/data-otxserver/monster/quests/ferumbras_ascendant/bosses/zamulosh.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Zamulosh") local monster = {} monster.description = "Zamulosh" -monster.experience = 250000 +monster.experience = 500000 monster.outfit = { lookType = 862, lookHead = 16, diff --git a/data-otxserver/monster/quests/in_service_of_yalahar/inky.lua b/data-otxserver/monster/quests/in_service_of_yalahar/inky.lua index 49025f4c6..bbc58881e 100644 --- a/data-otxserver/monster/quests/in_service_of_yalahar/inky.lua +++ b/data-otxserver/monster/quests/in_service_of_yalahar/inky.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Inky") local monster = {} monster.description = "Inky" -monster.experience = 250 +monster.experience = 700 monster.outfit = { lookType = 46, lookHead = 0, diff --git a/data-otxserver/monster/quests/in_service_of_yalahar/sharptooth.lua b/data-otxserver/monster/quests/in_service_of_yalahar/sharptooth.lua index 583df08b8..032564234 100644 --- a/data-otxserver/monster/quests/in_service_of_yalahar/sharptooth.lua +++ b/data-otxserver/monster/quests/in_service_of_yalahar/sharptooth.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Sharptooth") local monster = {} monster.description = "Sharptooth" -monster.experience = 1600 +monster.experience = 3000 monster.outfit = { lookType = 20, lookHead = 0, diff --git a/data-otxserver/monster/reptiles/seacrest_serpent.lua b/data-otxserver/monster/reptiles/seacrest_serpent.lua index 9be39aaa5..04b7dba74 100644 --- a/data-otxserver/monster/reptiles/seacrest_serpent.lua +++ b/data-otxserver/monster/reptiles/seacrest_serpent.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Seacrest Serpent") local monster = {} monster.description = "a seacrest serpent" -monster.experience = 2600 +monster.experience = 2900 monster.outfit = { lookType = 675, lookHead = 0, diff --git a/data-otxserver/monster/reptiles/young_sea_serpent.lua b/data-otxserver/monster/reptiles/young_sea_serpent.lua index 961ff8204..98e8744b7 100644 --- a/data-otxserver/monster/reptiles/young_sea_serpent.lua +++ b/data-otxserver/monster/reptiles/young_sea_serpent.lua @@ -108,7 +108,7 @@ monster.defenses = { monster.elements = { { type = COMBAT_PHYSICALDAMAGE, percent = -20 }, { type = COMBAT_ENERGYDAMAGE, percent = -10 }, - { type = COMBAT_EARTHDAMAGE, percent = 100 }, + { type = COMBAT_EARTHDAMAGE, percent = -5 }, { type = COMBAT_FIREDAMAGE, percent = 30 }, { type = COMBAT_LIFEDRAIN, percent = 0 }, { type = COMBAT_MANADRAIN, percent = 0 }, diff --git a/data-otxserver/monster/undeads/betrayed_wraith.lua b/data-otxserver/monster/undeads/betrayed_wraith.lua index 0c0648acd..201887a77 100644 --- a/data-otxserver/monster/undeads/betrayed_wraith.lua +++ b/data-otxserver/monster/undeads/betrayed_wraith.lua @@ -112,7 +112,7 @@ monster.defenses = { monster.elements = { { type = COMBAT_PHYSICALDAMAGE, percent = 0 }, - { type = COMBAT_ENERGYDAMAGE, percent = 100 }, + { type = COMBAT_ENERGYDAMAGE, percent = 10 }, { type = COMBAT_EARTHDAMAGE, percent = 100 }, { type = COMBAT_FIREDAMAGE, percent = 100 }, { type = COMBAT_LIFEDRAIN, percent = 100 }, diff --git a/data-otxserver/monster/undeads/blightwalker.lua b/data-otxserver/monster/undeads/blightwalker.lua index 28706adeb..d900484b1 100644 --- a/data-otxserver/monster/undeads/blightwalker.lua +++ b/data-otxserver/monster/undeads/blightwalker.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Blightwalker") local monster = {} monster.description = "a blightwalker" -monster.experience = 5850 +monster.experience = 6400 monster.outfit = { lookType = 246, lookHead = 0, @@ -108,9 +108,8 @@ monster.attacks = { { name = "melee", interval = 2000, chance = 100, minDamage = 0, maxDamage = -490 }, { name = "combat", interval = 2000, chance = 20, type = COMBAT_EARTHDAMAGE, minDamage = -220, maxDamage = -405, range = 7, radius = 1, shootEffect = CONST_ANI_POISON, target = true }, { name = "combat", interval = 2000, chance = 15, type = COMBAT_LIFEDRAIN, minDamage = -65, maxDamage = -135, radius = 4, effect = CONST_ME_MAGIC_GREEN, target = false }, - { name = "drunk", interval = 2000, chance = 10, radius = 3, effect = CONST_ME_HITBYPOISON, target = false, duration = 5000 }, { name = "blightwalker curse", interval = 2000, chance = 15, target = false }, - { name = "speed", interval = 2000, chance = 15, speedChange = -300, range = 7, shootEffect = CONST_ANI_POISON, target = true, duration = 30000 }, + { name = "speed", interval = 2000, chance = 10, speedChange = -300, range = 7, shootEffect = CONST_ANI_POISON, target = true, duration = 15000 }, } monster.defenses = { @@ -127,7 +126,7 @@ monster.elements = { { type = COMBAT_LIFEDRAIN, percent = 0 }, { type = COMBAT_MANADRAIN, percent = 0 }, { type = COMBAT_DROWNDAMAGE, percent = 0 }, - { type = COMBAT_ICEDAMAGE, percent = 50 }, + { type = COMBAT_ICEDAMAGE, percent = 15 }, { type = COMBAT_HOLYDAMAGE, percent = -30 }, { type = COMBAT_DEATHDAMAGE, percent = 100 }, } diff --git a/data-otxserver/monster/undeads/crypt_warrior.lua b/data-otxserver/monster/undeads/crypt_warrior.lua index 5de0ab637..dad0cbe75 100644 --- a/data-otxserver/monster/undeads/crypt_warrior.lua +++ b/data-otxserver/monster/undeads/crypt_warrior.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Crypt Warrior") local monster = {} monster.description = "a crypt warrior" -monster.experience = 4200 +monster.experience = 6050 monster.outfit = { lookType = 298, lookHead = 0, diff --git a/data-otxserver/monster/undeads/falcon_knight.lua b/data-otxserver/monster/undeads/falcon_knight.lua index 54a231307..2e2ac28a1 100644 --- a/data-otxserver/monster/undeads/falcon_knight.lua +++ b/data-otxserver/monster/undeads/falcon_knight.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Falcon Knight") local monster = {} monster.description = "a falcon knight" -monster.experience = 5985 +monster.experience = 6300 monster.outfit = { lookType = 1071, lookHead = 57, diff --git a/data-otxserver/monster/undeads/falcon_paladin.lua b/data-otxserver/monster/undeads/falcon_paladin.lua index 799143fe9..cc6a41571 100644 --- a/data-otxserver/monster/undeads/falcon_paladin.lua +++ b/data-otxserver/monster/undeads/falcon_paladin.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Falcon Paladin") local monster = {} monster.description = "a falcon paladin" -monster.experience = 6544 +monster.experience = 6900 monster.outfit = { lookType = 1071, lookHead = 57, diff --git a/data-otxserver/monster/undeads/hand_of_cursed_fate.lua b/data-otxserver/monster/undeads/hand_of_cursed_fate.lua index b1f76414d..527d07087 100644 --- a/data-otxserver/monster/undeads/hand_of_cursed_fate.lua +++ b/data-otxserver/monster/undeads/hand_of_cursed_fate.lua @@ -108,7 +108,7 @@ monster.loot = { monster.attacks = { { name = "melee", interval = 2000, chance = 100, minDamage = 0, maxDamage = -520, condition = { type = CONDITION_POISON, totalDamage = 380, interval = 4000 } }, - { name = "combat", interval = 2000, chance = 15, type = COMBAT_MANADRAIN, minDamage = 0, maxDamage = -920, range = 1, target = false }, + { name = "combat", interval = 2000, chance = 15, type = COMBAT_MANADRAIN, minDamage = 0, maxDamage = -620, range = 1, target = false }, { name = "drunk", interval = 2000, chance = 10, radius = 4, effect = CONST_ME_SMALLCLOUDS, target = false, duration = 3000 }, { name = "combat", interval = 2000, chance = 15, type = COMBAT_LIFEDRAIN, minDamage = -220, maxDamage = -880, range = 1, effect = CONST_ME_SMALLCLOUDS, target = false }, } @@ -124,7 +124,7 @@ monster.defenses = { monster.elements = { { type = COMBAT_PHYSICALDAMAGE, percent = 0 }, - { type = COMBAT_ENERGYDAMAGE, percent = 100 }, + { type = COMBAT_ENERGYDAMAGE, percent = 5 }, { type = COMBAT_EARTHDAMAGE, percent = 100 }, { type = COMBAT_FIREDAMAGE, percent = 100 }, { type = COMBAT_LIFEDRAIN, percent = 0 }, diff --git a/data-otxserver/monster/undeads/skeleton_elite_warrior.lua b/data-otxserver/monster/undeads/skeleton_elite_warrior.lua index a0cc7545b..25ebd9c1f 100644 --- a/data-otxserver/monster/undeads/skeleton_elite_warrior.lua +++ b/data-otxserver/monster/undeads/skeleton_elite_warrior.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Skeleton Elite Warrior") local monster = {} monster.description = "a skeleton elite warrior" -monster.experience = 4500 +monster.experience = 4800 monster.outfit = { lookType = 298, lookHead = 0, diff --git a/data-otxserver/monster/undeads/undead_dragon.lua b/data-otxserver/monster/undeads/undead_dragon.lua index 2ab63af8b..b9039c5d9 100644 --- a/data-otxserver/monster/undeads/undead_dragon.lua +++ b/data-otxserver/monster/undeads/undead_dragon.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Undead Dragon") local monster = {} monster.description = "an undead dragon" -monster.experience = 7200 +monster.experience = 7500 monster.outfit = { lookType = 231, lookHead = 0, diff --git a/data-otxserver/monster/undeads/undead_elite_gladiator.lua b/data-otxserver/monster/undeads/undead_elite_gladiator.lua index 0f66c87cb..10d1d5b08 100644 --- a/data-otxserver/monster/undeads/undead_elite_gladiator.lua +++ b/data-otxserver/monster/undeads/undead_elite_gladiator.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Undead Elite Gladiator") local monster = {} monster.description = "an undead elite gladiator" -monster.experience = 4740 +monster.experience = 5090 monster.outfit = { lookType = 306, lookHead = 0, diff --git a/data-otxserver/monster/vermins/cave_devourer.lua b/data-otxserver/monster/vermins/cave_devourer.lua index 1283ac20b..17d89dfb1 100644 --- a/data-otxserver/monster/vermins/cave_devourer.lua +++ b/data-otxserver/monster/vermins/cave_devourer.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Cave Devourer") local monster = {} monster.description = "a cave devourer" -monster.experience = 2380 +monster.experience = 3380 monster.outfit = { lookType = 1036, lookHead = 0, @@ -88,7 +88,7 @@ monster.loot = { { name = "slime heart", chance = 13770, maxCount = 4 }, { name = "cave devourer legs", chance = 17160 }, { id = 3049, chance = 2540 }, -- stealth ring - { name = "suspicious device", chance = 420 }, + { name = "suspicious device", chance = 850 }, } monster.attacks = { diff --git a/data-otxserver/monster/vermins/chasm_spawn.lua b/data-otxserver/monster/vermins/chasm_spawn.lua index 0764367a1..9f27f57b0 100644 --- a/data-otxserver/monster/vermins/chasm_spawn.lua +++ b/data-otxserver/monster/vermins/chasm_spawn.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Chasm Spawn") local monster = {} monster.description = "a chasm spawn" -monster.experience = 2700 +monster.experience = 3600 monster.outfit = { lookType = 1037, lookHead = 0, @@ -89,7 +89,7 @@ monster.loot = { { name = "green crystal shard", chance = 7850 }, { name = "violet crystal shard", chance = 4690 }, { name = "mushroom backpack", chance = 610 }, - { name = "suspicious device", chance = 520 }, + { name = "suspicious device", chance = 850 }, } monster.attacks = { diff --git a/data-otxserver/monster/vermins/deepworm.lua b/data-otxserver/monster/vermins/deepworm.lua index 91b2ded87..21775b2c6 100644 --- a/data-otxserver/monster/vermins/deepworm.lua +++ b/data-otxserver/monster/vermins/deepworm.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Deepworm") local monster = {} monster.description = "a deepworm" -monster.experience = 2300 +monster.experience = 2520 monster.outfit = { lookType = 1033, lookHead = 0, diff --git a/data-otxserver/monster/vermins/diremaw.lua b/data-otxserver/monster/vermins/diremaw.lua index b89c47c99..fd74c4e2b 100644 --- a/data-otxserver/monster/vermins/diremaw.lua +++ b/data-otxserver/monster/vermins/diremaw.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Diremaw") local monster = {} monster.description = "a diremaw" -monster.experience = 2500 +monster.experience = 2770 monster.outfit = { lookType = 1034, lookHead = 0, diff --git a/data-otxserver/monster/vermins/drillworm.lua b/data-otxserver/monster/vermins/drillworm.lua index 3cf92fce1..a435dc16c 100644 --- a/data-otxserver/monster/vermins/drillworm.lua +++ b/data-otxserver/monster/vermins/drillworm.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Drillworm") local monster = {} monster.description = "a drillworm" -monster.experience = 858 +monster.experience = 1200 monster.outfit = { lookType = 527, lookHead = 0, diff --git a/data-otxserver/monster/vermins/tunnel_tyrant.lua b/data-otxserver/monster/vermins/tunnel_tyrant.lua index f8e3b7bfb..c2b8eb2df 100644 --- a/data-otxserver/monster/vermins/tunnel_tyrant.lua +++ b/data-otxserver/monster/vermins/tunnel_tyrant.lua @@ -2,7 +2,7 @@ local mType = Game.createMonsterType("Tunnel Tyrant") local monster = {} monster.description = "a tunnel tyrant" -monster.experience = 3400 +monster.experience = 4420 monster.outfit = { lookType = 1035, lookHead = 0, @@ -87,7 +87,7 @@ monster.loot = { { name = "crystal mace", chance = 1580 }, { id = 23508, chance = 3010 }, -- energy vein { name = "crystalline armor", chance = 860 }, - { name = "suspicious device", chance = 1290 }, + { name = "suspicious device", chance = 1850 }, } monster.attacks = { diff --git a/data/scripts/talkactions/god/create_monster.lua b/data/scripts/talkactions/god/manage_monster.lua similarity index 83% rename from data/scripts/talkactions/god/create_monster.lua rename to data/scripts/talkactions/god/manage_monster.lua index ce5869a2e..da110d592 100644 --- a/data/scripts/talkactions/god/create_monster.lua +++ b/data/scripts/talkactions/god/manage_monster.lua @@ -56,7 +56,7 @@ local createMonster = TalkAction("/m") -- @param param: String containing the command parameters. -- Format: "/m monstername, monstercount, [fiendish/influenced level], spawnRadius, [forceCreate]" -- Example: "/m rat, 10, fiendish, 5, true" --- @param: the last param is by default "false", if add "," or any value i'ts set to true +-- @param: the last param is by default "false", if add "," or any value it's set to true -- @return true if the command is executed successfully, false otherwise. function createMonster.onSay(player, words, param) -- create log @@ -127,3 +127,33 @@ end createMonster:separator(" ") createMonster:groupType("god") createMonster:register() + +----------------- Rename monster name ----------------- +local setMonsterName = TalkAction("/setmonstername") + +-- @function setMonsterName.onSay +-- @desc TalkAction to rename nearby monsters within a radius of 4 sqm. +-- Format: "/setmonstername newName" +function setMonsterName.onSay(player, words, param) + if param == "" then + player:sendCancelMessage("Command param required.") + return true + end + + local split = param:split(",") + local monsterNewName = split[1] + + local spectators, spectator = Game.getSpectators(player:getPosition(), false, false, 4, 4, 4, 4) + for i = 1, #spectators do + spectator = spectators[i] + if spectator:isMonster() then + spectator:setName(monsterNewName) + end + end + + return true +end + +setMonsterName:separator(" ") +setMonsterName:groupType("god") +setMonsterName:register() diff --git a/data/scripts/talkactions/god/reload.lua b/data/scripts/talkactions/god/reload.lua index 20b9431db..d0c0cdd45 100644 --- a/data/scripts/talkactions/god/reload.lua +++ b/data/scripts/talkactions/god/reload.lua @@ -7,6 +7,7 @@ local reloadTypes = { ["configuration"] = RELOAD_TYPE_CONFIG, ["core"] = RELOAD_TYPE_CORE, ["events"] = RELOAD_TYPE_EVENTS, + ["familiar"] = RELOAD_TYPE_FAMILIARS, ["global"] = RELOAD_TYPE_CORE, ["group"] = RELOAD_TYPE_GROUPS, ["groups"] = RELOAD_TYPE_GROUPS, @@ -20,6 +21,8 @@ local reloadTypes = { ["monsters"] = RELOAD_TYPE_MONSTERS, ["mount"] = RELOAD_TYPE_MOUNTS, ["mounts"] = RELOAD_TYPE_MOUNTS, + ["outfit"] = RELOAD_TYPE_OUTFITS, + ["outfits"] = RELOAD_TYPE_OUTFITS, ["npc"] = RELOAD_TYPE_NPCS, ["npcs"] = RELOAD_TYPE_NPCS, ["raid"] = RELOAD_TYPE_RAIDS, diff --git a/docker/Dockerfile.dev b/docker/Dockerfile.dev index acbd6f52b..375c2ddb3 100644 --- a/docker/Dockerfile.dev +++ b/docker/Dockerfile.dev @@ -1,10 +1,10 @@ # Stage 1: Download all dependencies -FROM ubuntu:23.04 AS dependencies +FROM ubuntu:24.04 AS dependencies RUN --mount=type=cache,target=/var/cache/apt \ apt-get update && apt-get install -y --no-install-recommends cmake git \ unzip build-essential ca-certificates curl zip unzip tar \ - pkg-config ninja-build autoconf automake libtool \ + pkg-config ninja-build autoconf automake libtool glibc-tools \ python3 \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* @@ -32,7 +32,7 @@ COPY recompile.sh CMakeLists.txt CMakePresets.json vcpkg.json ./ RUN ./recompile.sh "/opt" # Stage 3: execute -FROM ubuntu:23.04 AS prod +FROM ubuntu:24.04 AS prod COPY --from=build /srv/build/build/linux-release/bin/otxserver /bin/otxserver WORKDIR /srv/otxserver ENTRYPOINT ["/srv/otxserver/start.sh", "otxserver"] diff --git a/docker/data/start.sh b/docker/data/start.sh index b18d36ad3..d81713c3a 100644 --- a/docker/data/start.sh +++ b/docker/data/start.sh @@ -11,7 +11,7 @@ OT_SERVER_GAME_PORT="${OT_SERVER_GAME_PORT:-7172}" OT_SERVER_STATUS_PORT="${OT_SERVER_STATUS_PORT:-7171}" OT_SERVER_TEST_ACCOUNTS="${OT_SERVER_TEST_ACCOUNTS:-false}" OT_SERVER_DATA="${OT_SERVER_DATA:-data-otxserver}" -OT_SERVER_MAP="${OT_SERVER_MAP:-https://github.com/opentibiabr/otservbr-global/releases/download/v1.5.0/otservbr.otbm}" +OT_SERVER_MAP="${OT_SERVER_MAP:-https://github.com/opentibiabr/canary/releases/download/v3.1.0/otservbr.otbm}" echo "" echo "===== Print Variables =====" diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 7c7f72296..220882435 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,5 +1,3 @@ ---- -version: '3.8' name: otbr services: database: diff --git a/src/creatures/appearance/mounts/mounts.cpp b/src/creatures/appearance/mounts/mounts.cpp index 7051d04dd..7014d0b02 100644 --- a/src/creatures/appearance/mounts/mounts.cpp +++ b/src/creatures/appearance/mounts/mounts.cpp @@ -29,7 +29,7 @@ bool Mounts::loadFromXml() { } for (auto mountNode : doc.child("mounts").children()) { - uint16_t lookType = pugi::cast(mountNode.attribute("clientid").value()); + auto lookType = pugi::cast(mountNode.attribute("clientid").value()); if (g_configManager().getBoolean(WARN_UNSAFE_SCRIPTS, __FUNCTION__) && lookType != 0 && !g_game().isLookTypeRegistered(lookType)) { g_logger().warn("{} - An unregistered creature mount with id '{}' was blocked to prevent client crash.", __FUNCTION__, lookType); continue; diff --git a/src/creatures/appearance/outfit/outfit.cpp b/src/creatures/appearance/outfit/outfit.cpp index 9e96c60e7..971206593 100644 --- a/src/creatures/appearance/outfit/outfit.cpp +++ b/src/creatures/appearance/outfit/outfit.cpp @@ -14,6 +14,10 @@ #include "utils/tools.hpp" #include "game/game.hpp" +Outfits &Outfits::getInstance() { + return inject(); +} + bool Outfits::reload() { for (auto &outfitsVector : outfits) { outfitsVector.clear(); @@ -41,7 +45,7 @@ bool Outfits::loadFromXml() { continue; } - uint16_t type = pugi::cast(attr.value()); + auto type = pugi::cast(attr.value()); if (type > PLAYERSEX_LAST) { g_logger().warn("[Outfits::loadFromXml] - Invalid outfit type {}", type); continue; @@ -53,7 +57,7 @@ bool Outfits::loadFromXml() { continue; } - if (uint16_t lookType = pugi::cast(lookTypeAttribute.value()); + if (auto lookType = pugi::cast(lookTypeAttribute.value()); g_configManager().getBoolean(WARN_UNSAFE_SCRIPTS, __FUNCTION__) && lookType != 0 && !g_game().isLookTypeRegistered(lookType)) { g_logger().warn("[Outfits::loadFromXml] An unregistered creature looktype type with id '{}' was ignored to prevent client crash.", lookType); @@ -74,7 +78,22 @@ bool Outfits::loadFromXml() { return true; } -std::shared_ptr Outfits::getOutfitByLookType(PlayerSex_t sex, uint16_t lookType) const { +std::shared_ptr Outfits::getOutfitByLookType(const std::shared_ptr &player, uint16_t lookType, bool isOppositeOutfit) const { + if (!player) { + g_logger().error("[{}] - Player not found", __FUNCTION__); + return nullptr; + } + + auto sex = player->getSex(); + if (sex != PLAYERSEX_FEMALE && sex != PLAYERSEX_MALE) { + g_logger().error("[{}] - Sex invalid or player: {}", __FUNCTION__, player->getName()); + return nullptr; + } + + if (isOppositeOutfit) { + sex = (sex == PLAYERSEX_MALE) ? PLAYERSEX_FEMALE : PLAYERSEX_MALE; + } + auto it = std::ranges::find_if(outfits[sex], [&lookType](const auto &outfit) { return outfit->lookType == lookType; }); @@ -84,15 +103,3 @@ std::shared_ptr Outfits::getOutfitByLookType(PlayerSex_t sex, uint16_t l } return nullptr; } - -/** - * Get the oposite sex equivalent outfit - * @param sex current sex - * @param lookType current looktype - * @return const pointer to the outfit or nullptr if it could not be found. - */ - -std::shared_ptr Outfits::getOpositeSexOutfitByLookType(PlayerSex_t sex, uint16_t lookType) const { - PlayerSex_t searchSex = (sex == PLAYERSEX_MALE) ? PLAYERSEX_FEMALE : PLAYERSEX_MALE; - return getOutfitByLookType(searchSex, lookType); -} diff --git a/src/creatures/appearance/outfit/outfit.hpp b/src/creatures/appearance/outfit/outfit.hpp index 30b84d1ac..0d89a2c93 100644 --- a/src/creatures/appearance/outfit/outfit.hpp +++ b/src/creatures/appearance/outfit/outfit.hpp @@ -12,8 +12,10 @@ #include "declarations.hpp" #include "lib/di/container.hpp" +class Player; + struct OutfitEntry { - constexpr OutfitEntry(uint16_t initLookType, uint8_t initAddons) : + constexpr explicit OutfitEntry(uint16_t initLookType, uint8_t initAddons) : lookType(initLookType), addons(initAddons) { } uint16_t lookType; @@ -42,16 +44,12 @@ struct ProtocolOutfit { class Outfits { public: - static Outfits &getInstance() { - return inject(); - } - - std::shared_ptr getOpositeSexOutfitByLookType(PlayerSex_t sex, uint16_t lookType) const; + static Outfits &getInstance(); - bool loadFromXml(); bool reload(); + bool loadFromXml(); - [[nodiscard]] std::shared_ptr getOutfitByLookType(PlayerSex_t sex, uint16_t lookType) const; + [[nodiscard]] std::shared_ptr getOutfitByLookType(const std::shared_ptr &player, uint16_t lookType, bool isOppositeOutfit = false) const; [[nodiscard]] const std::vector> &getOutfits(PlayerSex_t sex) const { return outfits[sex]; } diff --git a/src/creatures/monsters/monster.cpp b/src/creatures/monsters/monster.cpp index fccc19b05..5e0a7d16b 100644 --- a/src/creatures/monsters/monster.cpp +++ b/src/creatures/monsters/monster.cpp @@ -33,7 +33,7 @@ std::shared_ptr Monster::createMonster(const std::string &name) { Monster::Monster(const std::shared_ptr mType) : Creature(), - strDescription(asLowerCaseString(mType->nameDescription)), + nameDescription(asLowerCaseString(mType->nameDescription)), mType(mType) { defaultOutfit = mType->info.outfit; currentOutfit = mType->info.outfit; @@ -64,6 +64,37 @@ void Monster::removeList() { g_game().removeMonster(static_self_cast()); } +const std::string &Monster::getName() const { + if (name.empty()) { + return mType->name; + } + return name; +} + +void Monster::setName(const std::string &name) { + if (getName() == name) { + return; + } + + this->name = name; + + // NOTE: Due to how client caches known creatures, + // it is not feasible to send creature update to everyone that has ever met it + auto spectators = Spectators().find(position, true); + for (const auto &spectator : spectators) { + if (const auto &tmpPlayer = spectator->getPlayer()) { + tmpPlayer->sendUpdateTileCreature(static_self_cast()); + } + } +} + +const std::string &Monster::getNameDescription() const { + if (nameDescription.empty()) { + return mType->nameDescription; + } + return nameDescription; +} + bool Monster::canWalkOnFieldType(CombatType_t combatType) const { switch (combatType) { case COMBAT_ENERGYDAMAGE: diff --git a/src/creatures/monsters/monster.hpp b/src/creatures/monsters/monster.hpp index bf9a39e41..6c45fa3ea 100644 --- a/src/creatures/monsters/monster.hpp +++ b/src/creatures/monsters/monster.hpp @@ -41,21 +41,22 @@ class Monster final : public Creature { } } - void removeList() override; void addList() override; + void removeList() override; + + const std::string &getName() const override; + void setName(const std::string &name); - const std::string &getName() const override { - return mType->name; - } // Real monster name, set on monster creation "createMonsterType(typeName)" const std::string &getTypeName() const override { return mType->typeName; } - const std::string &getNameDescription() const override { - return mType->nameDescription; - } + const std::string &getNameDescription() const override; + void setNameDescription(const std::string &nameDescription) { + this->nameDescription = nameDescription; + }; std::string getDescription(int32_t) override { - return strDescription + '.'; + return nameDescription + '.'; } CreatureType_t getType() const override { @@ -363,7 +364,8 @@ class Monster final : public Creature { uint16_t forgeStack = 0; ForgeClassifications_t monsterForgeClassification = ForgeClassifications_t::FORGE_NORMAL_MONSTER; - std::string strDescription; + std::string name; + std::string nameDescription; std::shared_ptr mType; SpawnMonster* spawnMonster = nullptr; diff --git a/src/creatures/players/grouping/familiars.cpp b/src/creatures/players/grouping/familiars.cpp index a922013f1..6e923b823 100644 --- a/src/creatures/players/grouping/familiars.cpp +++ b/src/creatures/players/grouping/familiars.cpp @@ -10,10 +10,15 @@ #include "pch.hpp" #include "creatures/players/grouping/familiars.hpp" +#include "lib/di/container.hpp" #include "config/configmanager.hpp" #include "utils/pugicast.hpp" #include "utils/tools.hpp" +Familiars &Familiars::getInstance() { + return inject(); +} + bool Familiars::reload() { for (auto &familiarsVector : familiars) { familiarsVector.clear(); @@ -42,7 +47,7 @@ bool Familiars::loadFromXml() { continue; } - uint16_t vocation = pugi::cast(attr.value()); + auto vocation = pugi::cast(attr.value()); if (vocation > VOCATION_LAST) { g_logger().warn("[Familiars::loadFromXml] - Invalid familiar vocation {}", vocation); continue; diff --git a/src/creatures/players/grouping/familiars.hpp b/src/creatures/players/grouping/familiars.hpp index 8f553af9f..9eda7d95b 100644 --- a/src/creatures/players/grouping/familiars.hpp +++ b/src/creatures/players/grouping/familiars.hpp @@ -9,6 +9,7 @@ #pragma once +#include "declarations.hpp" #include "lib/di/container.hpp" struct FamiliarEntry { @@ -32,9 +33,7 @@ struct Familiar { class Familiars { public: - static Familiars &getInstance() { - return inject(); - } + static Familiars &getInstance(); bool loadFromXml(); bool reload(); diff --git a/src/creatures/players/grouping/groups.cpp b/src/creatures/players/grouping/groups.cpp index 27ae68d9f..937fa848f 100644 --- a/src/creatures/players/grouping/groups.cpp +++ b/src/creatures/players/grouping/groups.cpp @@ -43,7 +43,7 @@ PlayerFlags_t Groups::getFlagFromNumber(uint8_t value) { return magic_enum::enum_value(value); } -bool Groups::reload() const { +bool Groups::reload() { // Clear groups g_game().groups.getGroups().clear(); return g_game().groups.load(); @@ -99,7 +99,7 @@ bool Groups::load() { return true; } -std::shared_ptr Groups::getGroup(uint16_t id) { +std::shared_ptr Groups::getGroup(uint16_t id) const { if (auto it = std::find_if(groups_vector.begin(), groups_vector.end(), [id](auto group_it) { return group_it->id == id; }); diff --git a/src/creatures/players/grouping/groups.hpp b/src/creatures/players/grouping/groups.hpp index d76914e26..af319e957 100644 --- a/src/creatures/players/grouping/groups.hpp +++ b/src/creatures/players/grouping/groups.hpp @@ -24,9 +24,9 @@ class Groups { public: static uint8_t getFlagNumber(PlayerFlags_t playerFlags); static PlayerFlags_t getFlagFromNumber(uint8_t value); - bool reload() const; + static bool reload(); bool load(); - std::shared_ptr getGroup(uint16_t id); + [[nodiscard]] std::shared_ptr getGroup(uint16_t id) const; std::vector> &getGroups() { return groups_vector; } diff --git a/src/creatures/players/player.cpp b/src/creatures/players/player.cpp index 4109eb774..2c92f6941 100644 --- a/src/creatures/players/player.cpp +++ b/src/creatures/players/player.cpp @@ -1715,13 +1715,7 @@ void Player::onCreatureAppear(std::shared_ptr creature, bool isLogin) Creature::onCreatureAppear(creature, isLogin); if (isLogin && creature == getPlayer()) { - for (int32_t slot = CONST_SLOT_FIRST; slot <= CONST_SLOT_LAST; ++slot) { - std::shared_ptr item = inventory[slot]; - if (item) { - item->startDecaying(); - g_moveEvents().onPlayerEquip(getPlayer(), item, static_cast(slot), false); - } - } + onEquipInventory(); // Refresh bosstiary tracker onLogin refreshCyclopediaMonsterTracker(true); @@ -1862,14 +1856,9 @@ void Player::onRemoveCreature(std::shared_ptr creature, bool isLogout) Creature::onRemoveCreature(creature, isLogout); if (auto player = getPlayer(); player == creature) { - for (uint8_t slot = CONST_SLOT_FIRST; slot <= CONST_SLOT_LAST; ++slot) { - const auto item = inventory[slot]; - if (item) { - g_moveEvents().onPlayerDeEquip(getPlayer(), item, static_cast(slot)); - } - } - if (isLogout) { + onDeEquipInventory(); + if (m_party) { m_party->leaveParty(player); } @@ -2011,6 +2000,25 @@ void Player::onCreatureMove(const std::shared_ptr &creature, const std } } +void Player::onEquipInventory() { + for (int32_t slot = CONST_SLOT_FIRST; slot <= CONST_SLOT_LAST; ++slot) { + std::shared_ptr item = inventory[slot]; + if (item) { + item->startDecaying(); + g_moveEvents().onPlayerEquip(getPlayer(), item, static_cast(slot), false); + } + } +} + +void Player::onDeEquipInventory() { + for (int32_t slot = CONST_SLOT_FIRST; slot <= CONST_SLOT_LAST; ++slot) { + std::shared_ptr item = inventory[slot]; + if (item) { + g_moveEvents().onPlayerDeEquip(getPlayer(), item, static_cast(slot)); + } + } +} + // container void Player::onAddContainerItem(std::shared_ptr item) { checkTradeState(item); @@ -4914,7 +4922,7 @@ bool Player::canWear(uint16_t lookType, uint8_t addons) const { return true; } - const auto &outfit = Outfits::getInstance().getOutfitByLookType(sex, lookType); + const auto &outfit = Outfits::getInstance().getOutfitByLookType(getPlayer(), lookType); if (!outfit) { return false; } @@ -5001,7 +5009,7 @@ bool Player::removeOutfitAddon(uint16_t lookType, uint8_t addons) { return false; } -bool Player::getOutfitAddons(const std::shared_ptr outfit, uint8_t &addons) const { +bool Player::getOutfitAddons(const std::shared_ptr &outfit, uint8_t &addons) const { if (group->access) { addons = 3; return true; @@ -5826,7 +5834,7 @@ bool Player::toggleMount(bool mount) { return false; } - const auto &playerOutfit = Outfits::getInstance().getOutfitByLookType(getSex(), defaultOutfit.lookType); + const auto &playerOutfit = Outfits::getInstance().getOutfitByLookType(getPlayer(), defaultOutfit.lookType); if (!playerOutfit) { return false; } diff --git a/src/creatures/players/player.hpp b/src/creatures/players/player.hpp index c0761704d..d374bd599 100644 --- a/src/creatures/players/player.hpp +++ b/src/creatures/players/player.hpp @@ -153,8 +153,8 @@ class Player final : public Creature, public Cylinder, public Bankable { const std::string &getName() const override { return name; } - void setName(std::string newName) { - this->name = std::move(newName); + void setName(const std::string &name) { + this->name = name; } const std::string &getTypeName() const override { return name; @@ -476,7 +476,12 @@ class Player final : public Creature, public Cylinder, public Bankable { return blessings[index - 1] != 0; } uint8_t getBlessingCount(uint8_t index) const { - return blessings[index - 1]; + if (index > 0 && index <= blessings.size()) { + return blessings[index - 1]; + } else { + g_logger().error("[{}] - index outside range 0-10.", __FUNCTION__); + return 0; + } } std::string getBlessingsName() const; @@ -1031,7 +1036,7 @@ class Player final : public Creature, public Cylinder, public Bankable { void addOutfit(uint16_t lookType, uint8_t addons); bool removeOutfit(uint16_t lookType); bool removeOutfitAddon(uint16_t lookType, uint8_t addons); - bool getOutfitAddons(const std::shared_ptr outfit, uint8_t &addons) const; + bool getOutfitAddons(const std::shared_ptr &outfit, uint8_t &addons) const; bool canFamiliar(uint16_t lookType) const; void addFamiliar(uint16_t lookType); @@ -1070,6 +1075,11 @@ class Player final : public Creature, public Cylinder, public Bankable { client->sendRemoveTileThing(pos, stackpos); } } + void sendUpdateTileCreature(const std::shared_ptr creature) { + if (client) { + client->sendUpdateTileCreature(creature->getPosition(), creature->getTile()->getClientIndexOfCreature(static_self_cast(), creature), creature); + } + } void sendUpdateTile(std::shared_ptr updateTile, const Position &pos) { if (client) { client->sendUpdateTile(updateTile, pos); @@ -1305,6 +1315,9 @@ class Player final : public Creature, public Cylinder, public Bankable { void onRemoveCreature(std::shared_ptr creature, bool isLogout) override; void onCreatureMove(const std::shared_ptr &creature, const std::shared_ptr &newTile, const Position &newPos, const std::shared_ptr &oldTile, const Position &oldPos, bool teleport) override; + void onEquipInventory(); + void onDeEquipInventory(); + void onAttackedCreatureDisappear(bool isLogout) override; void onFollowCreatureDisappear(bool isLogout) override; @@ -2853,7 +2866,7 @@ class Player final : public Creature, public Cylinder, public Bankable { uint16_t lastStatsTrainingTime = 0; uint16_t staminaMinutes = 2520; - std::vector blessings = { 0, 0, 0, 0, 0, 0, 0, 0 }; + std::vector blessings = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; uint16_t maxWriteLen = 0; uint16_t baseXpGain = 100; uint16_t voucherXpBoost = 0; diff --git a/src/game/functions/game_reload.cpp b/src/game/functions/game_reload.cpp index 0fc74bcee..d9d9eb1f4 100644 --- a/src/game/functions/game_reload.cpp +++ b/src/game/functions/game_reload.cpp @@ -22,7 +22,7 @@ GameReload::GameReload() = default; GameReload::~GameReload() = default; -bool GameReload::init(Reload_t reloadTypes) const { +bool GameReload::init(Reload_t reloadTypes) { switch (reloadTypes) { case Reload_t::RELOAD_TYPE_ALL: return reloadAll(); @@ -32,34 +32,38 @@ bool GameReload::init(Reload_t reloadTypes) const { return reloadConfig(); case Reload_t::RELOAD_TYPE_EVENTS: return reloadEvents(); - case Reload_t::RELOAD_TYPE_CORE: - return reloadCore(); + case Reload_t::RELOAD_TYPE_MODULES: + return reloadModules(); + case Reload_t::RELOAD_TYPE_OUTFITS: + return reloadOutfits(); + case Reload_t::RELOAD_TYPE_MOUNTS: + return reloadMounts(); + case Reload_t::RELOAD_TYPE_FAMILIARS: + return reloadFamiliars(); case Reload_t::RELOAD_TYPE_IMBUEMENTS: return reloadImbuements(); + case Reload_t::RELOAD_TYPE_VOCATIONS: + return reloadVocations(); + case Reload_t::RELOAD_TYPE_CORE: + return reloadCore(); + case Reload_t::RELOAD_TYPE_GROUPS: + return reloadGroups(); + case Reload_t::RELOAD_TYPE_SCRIPTS: + return reloadScripts(); case Reload_t::RELOAD_TYPE_ITEMS: return reloadItems(); - case Reload_t::RELOAD_TYPE_MODULES: - return reloadModules(); case Reload_t::RELOAD_TYPE_MONSTERS: return reloadMonsters(); - case Reload_t::RELOAD_TYPE_MOUNTS: - return reloadMounts(); case Reload_t::RELOAD_TYPE_NPCS: return reloadNpcs(); case Reload_t::RELOAD_TYPE_RAIDS: return reloadRaids(); - case Reload_t::RELOAD_TYPE_SCRIPTS: - return reloadScripts(); - case Reload_t::RELOAD_TYPE_GROUPS: - return reloadGroups(); - case Reload_t::RELOAD_TYPE_VOCATIONS: - return reloadVocations(); default: return false; } } -uint8_t GameReload::getReloadNumber(Reload_t reloadTypes) const { +uint8_t GameReload::getReloadNumber(Reload_t reloadTypes) { return magic_enum::enum_integer(reloadTypes); } @@ -78,7 +82,7 @@ void logReloadStatus(const std::string &name, bool result) { * If it is necessary to call elsewhere, seriously think about creating a function that calls this * Changing this to public may cause some unexpected behavior or bug */ -bool GameReload::reloadAll() const { +bool GameReload::reloadAll() { std::vector reloadResults; reloadResults.reserve(magic_enum::enum_count()); @@ -93,25 +97,62 @@ bool GameReload::reloadAll() const { return std::ranges::any_of(reloadResults, [](bool result) { return result; }); } -bool GameReload::reloadChat() const { +bool GameReload::reloadChat() { const bool result = g_chat().load(); logReloadStatus("Chat", result); return result; } -bool GameReload::reloadConfig() const { +bool GameReload::reloadConfig() { const bool result = g_configManager().reload(); logReloadStatus("Config", result); return result; } -bool GameReload::reloadEvents() const { +bool GameReload::reloadEvents() { const bool result = g_events().loadFromXml(); logReloadStatus("Events", result); return result; } -bool GameReload::reloadCore() const { +bool GameReload::reloadModules() { + const bool result = g_modules().reload(); + logReloadStatus("Modules", result); + return result; +} + +bool GameReload::reloadOutfits() { + const bool result = g_game().outfits.reload(); + logReloadStatus("Outfits", result); + return result; +} + +bool GameReload::reloadMounts() { + const bool result = g_game().mounts.reload(); + logReloadStatus("Mounts", result); + return result; +} + +bool GameReload::reloadFamiliars() { + const bool result = g_game().familiars.reload(); + logReloadStatus("Familiars", result); + return result; +} + +bool GameReload::reloadImbuements() { + const bool result = g_imbuements().reload(); + logReloadStatus("Imbuements", result); + return result; +} + +bool GameReload::reloadVocations() { + const bool result = g_vocations().reload(); + reloadScripts(); + logReloadStatus("Vocations", result); + return result; +} + +bool GameReload::reloadCore() { const auto &coreFolder = g_configManager().getString(CORE_DIRECTORY, __FUNCTION__); const bool coreLoaded = g_luaEnvironment().loadFile(coreFolder + "/core.lua", "core.lua") == 0; @@ -126,25 +167,38 @@ bool GameReload::reloadCore() const { return false; } -bool GameReload::reloadImbuements() const { - const bool result = g_imbuements().reload(); - logReloadStatus("Imbuements", result); +bool GameReload::reloadGroups() { + const bool result = g_game().groups.reload(); + logReloadStatus("Groups", result); return result; } -bool GameReload::reloadItems() const { - const bool result = Item::items.reload(); - logReloadStatus("Items", result); - return result; +bool GameReload::reloadScripts() { + g_scripts().clearAllScripts(); + Zone::clearZones(); + + const auto &datapackFolder = g_configManager().getString(DATA_DIRECTORY, __FUNCTION__); + const auto &coreFolder = g_configManager().getString(CORE_DIRECTORY, __FUNCTION__); + + g_scripts().loadScripts(coreFolder + "/scripts/lib", true, false); + g_scripts().loadScripts(datapackFolder + "/scripts", false, true); + g_scripts().loadScripts(coreFolder + "/scripts", false, true); + + // It should come last, after everything else has been cleaned up. + reloadMonsters(); + reloadNpcs(); + reloadItems(); + logReloadStatus("Scripts", true); + return true; } -bool GameReload::reloadModules() const { - const bool result = g_modules().reload(); - logReloadStatus("Modules", result); +bool GameReload::reloadItems() { + const bool result = Item::items.reload(); + logReloadStatus("Items", result); return result; } -bool GameReload::reloadMonsters() const { +bool GameReload::reloadMonsters() { g_monsters().clear(); const auto &datapackFolder = g_configManager().getString(DATA_DIRECTORY, __FUNCTION__); const auto &coreFolder = g_configManager().getString(CORE_DIRECTORY, __FUNCTION__); @@ -161,50 +215,14 @@ bool GameReload::reloadMonsters() const { } } -bool GameReload::reloadMounts() const { - const bool result = g_game().mounts.reload(); - logReloadStatus("Mounts", result); - return result; -} - -bool GameReload::reloadNpcs() const { +bool GameReload::reloadNpcs() { const bool result = g_npcs().reload(); logReloadStatus("NPCs", result); return result; } -bool GameReload::reloadRaids() const { +bool GameReload::reloadRaids() { const bool result = g_game().raids.reload() && g_game().raids.startup(); logReloadStatus("Raids", result); return result; } - -bool GameReload::reloadScripts() const { - g_scripts().clearAllScripts(); - Zone::clearZones(); - - const auto &datapackFolder = g_configManager().getString(DATA_DIRECTORY, __FUNCTION__); - const auto &coreFolder = g_configManager().getString(CORE_DIRECTORY, __FUNCTION__); - - g_scripts().loadScripts(coreFolder + "/scripts/lib", true, false); - g_scripts().loadScripts(datapackFolder + "/scripts", false, true); - g_scripts().loadScripts(coreFolder + "/scripts", false, true); - - // It should come last, after everything else has been cleaned up. - reloadMonsters(); - reloadNpcs(); - logReloadStatus("Scripts", true); - return true; -} - -bool GameReload::reloadGroups() const { - const bool result = g_game().groups.reload(); - logReloadStatus("Groups", result); - return result; -} - -bool GameReload::reloadVocations() const { - const bool result = g_vocations().reload(); - logReloadStatus("Vocations", result); - return result; -} diff --git a/src/game/functions/game_reload.hpp b/src/game/functions/game_reload.hpp index 45ff35c01..0f59046a9 100644 --- a/src/game/functions/game_reload.hpp +++ b/src/game/functions/game_reload.hpp @@ -19,17 +19,19 @@ enum class Reload_t : uint8_t { RELOAD_TYPE_CHAT, RELOAD_TYPE_CONFIG, RELOAD_TYPE_EVENTS, - RELOAD_TYPE_CORE, + RELOAD_TYPE_MODULES, + RELOAD_TYPE_OUTFITS, + RELOAD_TYPE_MOUNTS, + RELOAD_TYPE_FAMILIARS, RELOAD_TYPE_IMBUEMENTS, + RELOAD_TYPE_VOCATIONS, + RELOAD_TYPE_CORE, + RELOAD_TYPE_GROUPS, + RELOAD_TYPE_SCRIPTS, RELOAD_TYPE_ITEMS, - RELOAD_TYPE_MODULES, RELOAD_TYPE_MONSTERS, - RELOAD_TYPE_MOUNTS, RELOAD_TYPE_NPCS, RELOAD_TYPE_RAIDS, - RELOAD_TYPE_SCRIPTS, - RELOAD_TYPE_GROUPS, - RELOAD_TYPE_VOCATIONS, // Every is last RELOAD_TYPE_LAST @@ -48,25 +50,27 @@ class GameReload : public Game { return inject(); } - bool init(Reload_t reloadType) const; - uint8_t getReloadNumber(Reload_t reloadTypes) const; + static bool init(Reload_t reloadType); + static uint8_t getReloadNumber(Reload_t reloadTypes); private: - bool reloadAll() const; - bool reloadChat() const; - bool reloadConfig() const; - bool reloadEvents() const; - bool reloadCore() const; - bool reloadImbuements() const; - bool reloadItems() const; - bool reloadModules() const; - bool reloadMonsters() const; - bool reloadMounts() const; - bool reloadNpcs() const; - bool reloadRaids() const; - bool reloadScripts() const; - bool reloadGroups() const; - bool reloadVocations() const; + static bool reloadAll(); + static bool reloadChat(); + static bool reloadConfig(); + static bool reloadEvents(); + static bool reloadModules(); + static bool reloadOutfits(); + static bool reloadMounts(); + static bool reloadFamiliars(); + static bool reloadImbuements(); + static bool reloadVocations(); + static bool reloadCore(); + static bool reloadGroups(); + static bool reloadScripts(); + static bool reloadItems(); + static bool reloadMonsters(); + static bool reloadNpcs(); + static bool reloadRaids(); }; constexpr auto g_gameReload = GameReload::getInstance; diff --git a/src/game/game.cpp b/src/game/game.cpp index 899a89549..57daddded 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -126,6 +126,10 @@ namespace InternalGame { if (isGuest && !isItemInGuestInventory && !item->isLadder() && !item->canBeUsedByGuests()) { return false; } + + if (isGuest && item->isDummy()) { + return false; + } } return true; @@ -4257,7 +4261,7 @@ void Game::playerSetShowOffSocket(uint32_t playerId, Outfit_t &outfit, const Pos name << item->getName() << " displaying the "; bool outfited = false; if (outfit.lookType != 0) { - const auto &outfitInfo = Outfits::getInstance().getOutfitByLookType(player->getSex(), outfit.lookType); + const auto &outfitInfo = Outfits::getInstance().getOutfitByLookType(player, outfit.lookType); if (!outfitInfo) { return; } @@ -5923,7 +5927,7 @@ void Game::playerChangeOutfit(uint32_t playerId, Outfit_t outfit, uint8_t isMoun outfit.lookMount = randomMount->clientId; } - const auto playerOutfit = Outfits::getInstance().getOutfitByLookType(player->getSex(), outfit.lookType); + const auto playerOutfit = Outfits::getInstance().getOutfitByLookType(player, outfit.lookType); if (!playerOutfit) { outfit.lookMount = 0; } diff --git a/src/game/game.hpp b/src/game/game.hpp index 3a1992542..b4be8facd 100644 --- a/src/game/game.hpp +++ b/src/game/game.hpp @@ -582,8 +582,10 @@ class Game { bool hasDistanceEffect(uint16_t effectId); Groups groups; + Familiars familiars; Map map; Mounts mounts; + Outfits outfits; Raids raids; std::unique_ptr m_appearancesPtr; diff --git a/src/io/functions/iologindata_load_player.cpp b/src/io/functions/iologindata_load_player.cpp index 6273f8fef..8f7cf461f 100644 --- a/src/io/functions/iologindata_load_player.cpp +++ b/src/io/functions/iologindata_load_player.cpp @@ -66,7 +66,7 @@ bool IOLoginDataLoad::preLoadPlayer(std::shared_ptr player, const std::s } player->setGUID(result->getNumber("id")); - std::shared_ptr group = g_game().groups.getGroup(result->getNumber("group_id")); + const auto &group = g_game().groups.getGroup(result->getNumber("group_id")); if (!group) { g_logger().error("Player {} has group id {} which doesn't exist", player->name, result->getNumber("group_id")); return false; @@ -118,7 +118,7 @@ bool IOLoginDataLoad::loadPlayerFirst(std::shared_ptr player, DBResult_p player->setAccount(result->getNumber("account_id")); } - std::shared_ptr group = g_game().groups.getGroup(result->getNumber("group_id")); + const auto &group = g_game().groups.getGroup(result->getNumber("group_id")); if (!group) { g_logger().error("Player {} has group id {} which doesn't exist", player->name, result->getNumber("group_id")); return false; diff --git a/src/lib/thread/thread_pool.cpp b/src/lib/thread/thread_pool.cpp index 702f0c055..b2f51ef8f 100644 --- a/src/lib/thread/thread_pool.cpp +++ b/src/lib/thread/thread_pool.cpp @@ -26,7 +26,7 @@ #endif ThreadPool::ThreadPool(Logger &logger) : - logger(logger), BS::thread_pool(std::max(getNumberOfCores(), DEFAULT_NUMBER_OF_THREADS)) { + BS::thread_pool(std::max(getNumberOfCores(), DEFAULT_NUMBER_OF_THREADS)), logger(logger) { start(); } @@ -35,6 +35,7 @@ void ThreadPool::start() { } void ThreadPool::shutdown() { - stopped = true; logger.info("Shutting down thread pool..."); + stopped = true; + wait(); } diff --git a/src/lua/functions/creatures/monster/monster_functions.cpp b/src/lua/functions/creatures/monster/monster_functions.cpp index 1591053c3..273f6af5c 100644 --- a/src/lua/functions/creatures/monster/monster_functions.cpp +++ b/src/lua/functions/creatures/monster/monster_functions.cpp @@ -77,7 +77,7 @@ int MonsterFunctions::luaMonsterSetType(lua_State* L) { } // Assign new MonsterType monster->mType = mType; - monster->strDescription = asLowerCaseString(mType->nameDescription); + monster->nameDescription = asLowerCaseString(mType->nameDescription); monster->defaultOutfit = mType->info.outfit; monster->currentOutfit = mType->info.outfit; monster->skull = mType->info.skull; @@ -529,6 +529,24 @@ int MonsterFunctions::luaMonsterGetName(lua_State* L) { return 1; } +int MonsterFunctions::luaMonsterSetName(lua_State* L) { + // monster:setName(name[, nameDescription]) + auto monster = getUserdataShared(L, 1); + if (!monster) { + reportErrorFunc(getErrorDesc(LUA_ERROR_MONSTER_NOT_FOUND)); + pushBoolean(L, false); + return 0; + } + + monster->setName(getString(L, 2)); + if (lua_gettop(L) >= 3) { + monster->setNameDescription(getString(L, 3)); + } + + pushBoolean(L, true); + return 1; +} + int MonsterFunctions::luaMonsterHazard(lua_State* L) { // get: monster:hazard() ; set: monster:hazard(hazard) std::shared_ptr monster = getUserdataShared(L, 1); diff --git a/src/lua/functions/creatures/monster/monster_functions.hpp b/src/lua/functions/creatures/monster/monster_functions.hpp index bf2785ae4..dd1c38273 100644 --- a/src/lua/functions/creatures/monster/monster_functions.hpp +++ b/src/lua/functions/creatures/monster/monster_functions.hpp @@ -56,6 +56,7 @@ class MonsterFunctions final : LuaScriptInterface { registerMethod(L, "Monster", "isForgeable", MonsterFunctions::luaMonsterIsForgeable); registerMethod(L, "Monster", "getName", MonsterFunctions::luaMonsterGetName); + registerMethod(L, "Monster", "setName", MonsterFunctions::luaMonsterSetName); registerMethod(L, "Monster", "hazard", MonsterFunctions::luaMonsterHazard); registerMethod(L, "Monster", "hazardCrit", MonsterFunctions::luaMonsterHazardCrit); @@ -116,6 +117,7 @@ class MonsterFunctions final : LuaScriptInterface { static int luaMonsterIsForgeable(lua_State* L); static int luaMonsterGetName(lua_State* L); + static int luaMonsterSetName(lua_State* L); static int luaMonsterHazard(lua_State* L); static int luaMonsterHazardCrit(lua_State* L); diff --git a/src/lua/functions/creatures/player/group_functions.cpp b/src/lua/functions/creatures/player/group_functions.cpp index 5acc16d72..f547eec15 100644 --- a/src/lua/functions/creatures/player/group_functions.cpp +++ b/src/lua/functions/creatures/player/group_functions.cpp @@ -17,7 +17,7 @@ int GroupFunctions::luaGroupCreate(lua_State* L) { // Group(id) uint32_t id = getNumber(L, 2); - std::shared_ptr group = g_game().groups.getGroup(id); + const auto &group = g_game().groups.getGroup(id); if (group) { pushUserdata(L, group); setMetatable(L, -1, "Group"); @@ -29,7 +29,7 @@ int GroupFunctions::luaGroupCreate(lua_State* L) { int GroupFunctions::luaGroupGetId(lua_State* L) { // group:getId() - std::shared_ptr group = getUserdataShared(L, 1); + const auto &group = getUserdataShared(L, 1); if (group) { lua_pushnumber(L, group->id); } else { @@ -40,7 +40,7 @@ int GroupFunctions::luaGroupGetId(lua_State* L) { int GroupFunctions::luaGroupGetName(lua_State* L) { // group:getName() - std::shared_ptr group = getUserdataShared(L, 1); + const auto &group = getUserdataShared(L, 1); if (group) { pushString(L, group->name); } else { @@ -51,7 +51,7 @@ int GroupFunctions::luaGroupGetName(lua_State* L) { int GroupFunctions::luaGroupGetFlags(lua_State* L) { // group:getFlags() - std::shared_ptr group = getUserdataShared(L, 1); + const auto &group = getUserdataShared(L, 1); if (group) { std::bitset flags; for (uint8_t i = 0; i < magic_enum::enum_integer(PlayerFlags_t::FlagLast); ++i) { @@ -68,7 +68,7 @@ int GroupFunctions::luaGroupGetFlags(lua_State* L) { int GroupFunctions::luaGroupGetAccess(lua_State* L) { // group:getAccess() - std::shared_ptr group = getUserdataShared(L, 1); + const auto &group = getUserdataShared(L, 1); if (group) { pushBoolean(L, group->access); } else { @@ -79,7 +79,7 @@ int GroupFunctions::luaGroupGetAccess(lua_State* L) { int GroupFunctions::luaGroupGetMaxDepotItems(lua_State* L) { // group:getMaxDepotItems() - std::shared_ptr group = getUserdataShared(L, 1); + const auto &group = getUserdataShared(L, 1); if (group) { lua_pushnumber(L, group->maxDepotItems); } else { @@ -90,7 +90,7 @@ int GroupFunctions::luaGroupGetMaxDepotItems(lua_State* L) { int GroupFunctions::luaGroupGetMaxVipEntries(lua_State* L) { // group:getMaxVipEntries() - std::shared_ptr group = getUserdataShared(L, 1); + const auto &group = getUserdataShared(L, 1); if (group) { lua_pushnumber(L, group->maxVipEntries); } else { @@ -101,7 +101,7 @@ int GroupFunctions::luaGroupGetMaxVipEntries(lua_State* L) { int GroupFunctions::luaGroupHasFlag(lua_State* L) { // group:hasFlag(flag) - std::shared_ptr group = getUserdataShared(L, 1); + const auto &group = getUserdataShared(L, 1); if (group) { auto flag = static_cast(getNumber(L, 2)); pushBoolean(L, group->flags[Groups::getFlagNumber(flag)]); diff --git a/src/server/network/protocol/protocolgame.cpp b/src/server/network/protocol/protocolgame.cpp index 751da5312..8cf0660a2 100644 --- a/src/server/network/protocol/protocolgame.cpp +++ b/src/server/network/protocol/protocolgame.cpp @@ -4055,7 +4055,7 @@ void ProtocolGame::sendCyclopediaCharacterInspection() { // Outfit description playerDescriptionSize++; msg.addString("Outfit", "ProtocolGame::sendCyclopediaCharacterInspection - Outfit"); - if (const auto outfit = Outfits::getInstance().getOutfitByLookType(player->getSex(), player->getDefaultOutfit().lookType)) { + if (const auto outfit = Outfits::getInstance().getOutfitByLookType(player, player->getDefaultOutfit().lookType)) { msg.addString(outfit->name, "ProtocolGame::sendCyclopediaCharacterInspection - outfit->name"); } else { msg.addString("unknown", "ProtocolGame::sendCyclopediaCharacterInspection - unknown"); @@ -5947,7 +5947,7 @@ void ProtocolGame::sendCreatureTurn(std::shared_ptr creature, uint32_t NetworkMessage msg; msg.addByte(0x6B); msg.addPosition(creature->getPosition()); - msg.addByte(stackPos); + msg.addByte(static_cast(stackPos)); msg.add(0x63); msg.add(creature->getID()); msg.addByte(creature->getDirection()); @@ -6385,7 +6385,7 @@ void ProtocolGame::sendAddTileItem(const Position &pos, uint32_t stackpos, std:: NetworkMessage msg; msg.addByte(0x6A); msg.addPosition(pos); - msg.addByte(stackpos); + msg.addByte(static_cast(stackpos)); AddItem(msg, item); writeToOutputBuffer(msg); } @@ -6398,7 +6398,7 @@ void ProtocolGame::sendUpdateTileItem(const Position &pos, uint32_t stackpos, st NetworkMessage msg; msg.addByte(0x6B); msg.addPosition(pos); - msg.addByte(stackpos); + msg.addByte(static_cast(stackpos)); AddItem(msg, item); writeToOutputBuffer(msg); } @@ -6413,6 +6413,23 @@ void ProtocolGame::sendRemoveTileThing(const Position &pos, uint32_t stackpos) { writeToOutputBuffer(msg); } +void ProtocolGame::sendUpdateTileCreature(const Position &pos, uint32_t stackpos, const std::shared_ptr creature) { + if (!canSee(pos)) { + return; + } + + NetworkMessage msg; + msg.addByte(0x6B); + msg.addPosition(pos); + msg.addByte(static_cast(stackpos)); + + bool known; + uint32_t removedKnown; + checkCreatureAsKnown(creature->getID(), known, removedKnown); + AddCreature(msg, creature, false, removedKnown); + writeToOutputBuffer(msg); +} + void ProtocolGame::sendUpdateTile(std::shared_ptr tile, const Position &pos) { if (!canSee(pos)) { return; @@ -6484,7 +6501,7 @@ void ProtocolGame::sendAddCreature(std::shared_ptr creature, const Pos NetworkMessage msg; msg.addByte(0x6A); msg.addPosition(pos); - msg.addByte(stackpos); + msg.addByte(static_cast(stackpos)); bool known; uint32_t removedKnown; @@ -6641,7 +6658,7 @@ void ProtocolGame::sendMoveCreature(std::shared_ptr creature, const Po } else { msg.addByte(0x6D); msg.addPosition(oldPos); - msg.addByte(oldStackPos); + msg.addByte(static_cast(oldStackPos)); msg.addPosition(newPos); } @@ -6676,7 +6693,7 @@ void ProtocolGame::sendMoveCreature(std::shared_ptr creature, const Po NetworkMessage msg; msg.addByte(0x6D); msg.addPosition(oldPos); - msg.addByte(oldStackPos); + msg.addByte(static_cast(oldStackPos)); msg.addPosition(newPos); writeToOutputBuffer(msg); } @@ -7836,7 +7853,7 @@ void ProtocolGame::RemoveTileThing(NetworkMessage &msg, const Position &pos, uin msg.addByte(0x6C); msg.addPosition(pos); - msg.addByte(stackpos); + msg.addByte(static_cast(stackpos)); } void ProtocolGame::sendKillTrackerUpdate(std::shared_ptr corpse, const std::string &name, const Outfit_t creatureOutfit) { @@ -8279,7 +8296,7 @@ void ProtocolGame::reloadCreature(std::shared_ptr creature) { if (knownCreatureSet.contains(creature->getID())) { msg.addByte(0x6B); msg.addPosition(creature->getPosition()); - msg.addByte(stackpos); + msg.addByte(static_cast(stackpos)); AddCreature(msg, creature, false, 0); } else { sendAddCreature(creature, creature->getPosition(), stackpos, false); diff --git a/src/server/network/protocol/protocolgame.hpp b/src/server/network/protocol/protocolgame.hpp index 0386093cf..100ca199b 100644 --- a/src/server/network/protocol/protocolgame.hpp +++ b/src/server/network/protocol/protocolgame.hpp @@ -393,6 +393,7 @@ class ProtocolGame final : public Protocol { void sendAddTileItem(const Position &pos, uint32_t stackpos, std::shared_ptr item); void sendUpdateTileItem(const Position &pos, uint32_t stackpos, std::shared_ptr item); void sendRemoveTileThing(const Position &pos, uint32_t stackpos); + void sendUpdateTileCreature(const Position &pos, uint32_t stackpos, const std::shared_ptr creature); void sendUpdateTile(std::shared_ptr tile, const Position &pos); void sendAddCreature(std::shared_ptr creature, const Position &pos, int32_t stackpos, bool isLogin); diff --git a/start.sh b/start.sh index 95cac51e1..12d48ac31 100644 --- a/start.sh +++ b/start.sh @@ -21,8 +21,8 @@ while true; do "$BIN_PATH" 2>&1 | awk '{ print strftime("%F %T - "), $0; fflush(); }' | tee "logs/$(date +"%F %H-%M-%S.log")" # Verificar se a tecla 'q' foi pressionada - read -t 1 -N 1 -r input - if [[ "$input" == "q" ]]; then - break - fi + read -t 1 -N 1 -r input + if [[ "$input" == "q" ]]; then + break + fi done