From 31e939e35f0264d7ae2eb35e414e8c2293568eae Mon Sep 17 00:00:00 2001 From: jamesbradleym Date: Sat, 9 Mar 2024 22:31:54 -0500 Subject: [PATCH] implement quest Nothing Matters --- scripts/actions/abilities/eagle_eye_shot.lua | 3 +- .../actions/abilities/elemental_siphon.lua | 8 +- .../actions/abilities/pets/aerial_armor.lua | 25 +- .../actions/abilities/pets/aerial_blast.lua | 18 +- scripts/actions/abilities/pets/aero_ii.lua | 10 +- scripts/actions/abilities/pets/aero_iv.lua | 10 +- .../actions/abilities/pets/burning_strike.lua | 10 +- scripts/actions/abilities/pets/claw.lua | 10 +- .../actions/abilities/pets/crimson_howl.lua | 22 +- .../actions/abilities/pets/double_punch.lua | 10 +- .../actions/abilities/pets/earthen_fury.lua | 18 +- .../actions/abilities/pets/earthen_ward.lua | 23 +- scripts/actions/abilities/pets/fire_ii.lua | 10 +- scripts/actions/abilities/pets/fire_iv.lua | 10 +- .../actions/abilities/pets/flaming_crush.lua | 10 +- scripts/actions/abilities/pets/geocrush.lua | 15 +- scripts/actions/abilities/pets/hastega.lua | 25 +- scripts/actions/abilities/pets/inferno.lua | 18 +- .../actions/abilities/pets/megalith_throw.lua | 10 +- .../actions/abilities/pets/meteor_strike.lua | 15 +- .../abilities/pets/mountain_buster.lua | 11 +- .../actions/abilities/pets/predator_claws.lua | 11 +- scripts/actions/abilities/pets/punch.lua | 10 +- .../actions/abilities/pets/rock_buster.lua | 10 +- scripts/actions/abilities/pets/rock_throw.lua | 10 +- scripts/actions/abilities/pets/stone_ii.lua | 10 +- scripts/actions/abilities/pets/stone_iv.lua | 10 +- .../abilities/pets/whispering_wind.lua | 13 +- scripts/actions/abilities/pets/wind_blade.lua | 11 +- .../actions/abilities/restoring_breath.lua | 2 + scripts/actions/abilities/smiting_breath.lua | 2 + scripts/actions/mobskills/meikyo_shisui.lua | 3 + scripts/actions/mobskills/smite_of_rage.lua | 9 +- .../actions/spells/songs/maidens_virelai.lua | 43 +- scripts/actions/spells/white/arise.lua | 2 +- scripts/actions/spells/white/cursna.lua | 13 +- scripts/actions/spells/white/raise.lua | 2 +- scripts/actions/spells/white/raise_ii.lua | 2 +- scripts/actions/spells/white/raise_iii.lua | 2 +- scripts/actions/spells/white/temper_ii.lua | 14 + .../actions/weaponskills/shijin_spiral.lua | 2 +- scripts/battlefields/Apollyon/sw_apollyon.lua | 2 +- scripts/commands/getlocalvars.lua | 33 ++ scripts/effects/innin.lua | 42 +- scripts/effects/multi_strikes.lua | 12 +- scripts/enum/animation_strings.lua | 103 +++++ scripts/enum/helm_type.lua | 9 + scripts/enum/item.lua | 4 + scripts/enum/merit.lua | 9 +- scripts/enum/mod.lua | 6 +- scripts/globals/abyssea/sturdypyxis/chest.lua | 2 +- scripts/globals/abyssea/sturdypyxis/spawn.lua | 2 +- scripts/globals/appraisal.lua | 4 +- scripts/globals/caskets.lua | 2 +- scripts/globals/combat/physical_utilities.lua | 82 ++-- scripts/globals/helm.lua | 18 +- scripts/globals/job_utils/corsair.lua | 2 +- scripts/globals/job_utils/geomancer.lua | 2 + scripts/globals/job_utils/summoner.lua | 33 ++ scripts/globals/mobskills.lua | 17 + scripts/globals/npc_util.lua | 4 +- scripts/globals/nyzul.lua | 8 +- scripts/globals/pets/wyvern.lua | 55 ++- scripts/globals/quests.lua | 2 +- scripts/globals/spells/damage_spell.lua | 85 ++-- scripts/globals/spells/enfeebling_spell.lua | 6 +- scripts/globals/spells/enhancing_spell.lua | 2 +- scripts/globals/weaponskills.lua | 15 +- scripts/missions/amk/helpers.lua | 6 +- .../soa/2_2_2_In_the_Presence_of_Royalty.lua | 2 +- scripts/missions/wotg/helpers.lua | 2 +- scripts/mixins/fomor_hate.lua | 6 + .../quests/adoulin/Flavors_of_Our_Lives.lua | 2 +- scripts/quests/windurst/Nothing_Matters.lua | 320 +++++++++++++ scripts/zones/Abyssea-Grauberg/Zone.lua | 2 +- scripts/zones/Attohwa_Chasm/Zone.lua | 2 +- .../Attohwa_Chasm/npcs/Excavation_Point.lua | 4 +- scripts/zones/Bhaflau_Thickets/Zone.lua | 2 +- .../npcs/Harvesting_Point.lua | 4 +- scripts/zones/Buburimu_Peninsula/Zone.lua | 2 +- .../Buburimu_Peninsula/npcs/Logging_Point.lua | 4 +- scripts/zones/Caedarva_Mire/Zone.lua | 2 +- .../Caedarva_Mire/npcs/Logging_Point.lua | 4 +- scripts/zones/Carpenters_Landing/Zone.lua | 2 +- .../Carpenters_Landing/npcs/Logging_Point.lua | 4 +- scripts/zones/East_Ronfaure/Zone.lua | 2 +- .../East_Ronfaure/npcs/Logging_Point.lua | 4 +- scripts/zones/East_Ronfaure_[S]/Zone.lua | 2 +- .../East_Ronfaure_[S]/npcs/Logging_Point.lua | 4 +- .../zones/Empyreal_Paradox/mobs/Selhteus.lua | 2 +- scripts/zones/Fort_Karugo-Narugo_[S]/Zone.lua | 2 +- .../npcs/Logging_Point.lua | 4 +- scripts/zones/Ghelsba_Outpost/Zone.lua | 2 +- .../Ghelsba_Outpost/npcs/Logging_Point.lua | 4 +- scripts/zones/Giddeus/Zone.lua | 2 +- .../zones/Giddeus/npcs/Harvesting_Point.lua | 4 +- scripts/zones/Grauberg_[S]/Zone.lua | 2 +- .../Grauberg_[S]/npcs/Harvesting_Point.lua | 2 +- scripts/zones/Gusgen_Mines/Zone.lua | 2 +- .../zones/Gusgen_Mines/npcs/Mining_Point.lua | 4 +- scripts/zones/Halvung/Zone.lua | 2 +- scripts/zones/Halvung/npcs/Mining_Point.lua | 4 +- scripts/zones/Ifrits_Cauldron/Zone.lua | 2 +- .../zones/Ifrits_Cauldron/mobs/Bomb_Queen.lua | 4 +- .../Ifrits_Cauldron/npcs/Mining_Point.lua | 4 +- scripts/zones/Inner_Horutoto_Ruins/Zone.lua | 12 +- scripts/zones/Jugner_Forest/Zone.lua | 2 +- .../Jugner_Forest/npcs/Logging_Point.lua | 4 +- scripts/zones/Jugner_Forest_[S]/Zone.lua | 2 +- .../Jugner_Forest_[S]/npcs/Logging_Point.lua | 4 +- scripts/zones/Korroloka_Tunnel/Zone.lua | 2 +- .../npcs/Excavation_Point.lua | 4 +- scripts/zones/Lower_Jeuno/npcs/Derrick.lua | 2 +- scripts/zones/Lufaise_Meadows/Zone.lua | 2 +- .../Lufaise_Meadows/mobs/Gigas_Braver.lua | 2 +- .../Lufaise_Meadows/mobs/Gigas_Catapulter.lua | 2 +- .../Lufaise_Meadows/mobs/Gigas_Fighter.lua | 2 +- .../Lufaise_Meadows/mobs/Gigas_Martialist.lua | 2 +- .../Lufaise_Meadows/mobs/Gigas_Slinger.lua | 2 +- .../Lufaise_Meadows/mobs/Gigas_Warwolf.lua | 2 +- .../Lufaise_Meadows/mobs/Gigas_Wrestler.lua | 2 +- .../mobs/Orcish_Beastrider.lua | 2 +- .../mobs/Orcish_Bowshooter.lua | 2 +- .../Lufaise_Meadows/mobs/Orcish_Brawler.lua | 2 +- .../mobs/Orcish_Footsoldier.lua | 2 +- .../Lufaise_Meadows/mobs/Orcish_Gladiator.lua | 2 +- .../Lufaise_Meadows/mobs/Orcish_Impaler.lua | 2 +- .../mobs/Orcish_Nightraider.lua | 2 +- .../mobs/Orcish_Stonelauncher.lua | 2 +- .../Lufaise_Meadows/mobs/Orcish_Trooper.lua | 2 +- .../Lufaise_Meadows/npcs/Logging_Point.lua | 4 +- scripts/zones/Mamook/Zone.lua | 2 +- scripts/zones/Mamook/npcs/Logging_Point.lua | 4 +- .../globals/zoneUtil.lua | 8 +- scripts/zones/Maze_of_Shakhrami/Zone.lua | 2 +- .../npcs/Excavation_Point.lua | 4 +- scripts/zones/Misareaux_Coast/Zone.lua | 2 +- .../Misareaux_Coast/mobs/Gigas_Braver.lua | 2 +- .../Misareaux_Coast/mobs/Gigas_Catapulter.lua | 2 +- .../Misareaux_Coast/mobs/Gigas_Martialist.lua | 2 +- .../Misareaux_Coast/mobs/Gigas_Warwolf.lua | 2 +- .../zones/Misareaux_Coast/mobs/Gration.lua | 2 +- .../mobs/Orcish_Bowshooter.lua | 2 +- .../mobs/Orcish_Footsoldier.lua | 2 +- .../Misareaux_Coast/mobs/Orcish_Gladiator.lua | 2 +- .../mobs/Orcish_Stonelauncher.lua | 2 +- .../Misareaux_Coast/mobs/Orcish_Trooper.lua | 2 +- .../Misareaux_Coast/npcs/Logging_Point.lua | 4 +- scripts/zones/Mount_Zhayolm/Zone.lua | 2 +- .../zones/Mount_Zhayolm/npcs/Mining_Point.lua | 4 +- scripts/zones/Newton_Movalpolos/Zone.lua | 2 +- .../Newton_Movalpolos/npcs/Mining_Point.lua | 4 +- scripts/zones/North_Gustaberg_[S]/Zone.lua | 2 +- .../North_Gustaberg_[S]/npcs/Mining_Point.lua | 4 +- scripts/zones/Oldton_Movalpolos/Zone.lua | 2 +- .../Oldton_Movalpolos/npcs/Mining_Point.lua | 4 +- scripts/zones/Palborough_Mines/Zone.lua | 2 +- .../Palborough_Mines/npcs/Mining_Point.lua | 4 +- .../zones/Phomiuna_Aqueducts/mobs/Mahisha.lua | 2 +- .../Phomiuna_Aqueducts/mobs/Minotaur.lua | 2 +- .../Phomiuna_Aqueducts/mobs/Stegotaur.lua | 2 +- .../Phomiuna_Aqueducts/mobs/Teratotaur.lua | 2 +- .../Southern_San_dOria/npcs/Moozo-Koozo.lua | 4 +- scripts/zones/Tahrongi_Canyon/Zone.lua | 2 +- .../Tahrongi_Canyon/npcs/Excavation_Point.lua | 4 +- .../mobs/Ashu_Talif_Captain.lua | 4 +- .../npcs/qm_ixaern_drk.lua | 4 +- scripts/zones/Wajaom_Woodlands/Zone.lua | 2 +- .../npcs/Harvesting_Point.lua | 4 +- scripts/zones/West_Sarutabaruta/Zone.lua | 2 +- .../npcs/Harvesting_Point.lua | 4 +- scripts/zones/West_Sarutabaruta_[S]/Zone.lua | 2 +- .../npcs/Harvesting_Point.lua | 4 +- .../zones/Windurst_Waters/DefaultActions.lua | 54 +-- scripts/zones/Windurst_Waters/IDs.lua | 5 + scripts/zones/Yhoator_Jungle/Zone.lua | 4 +- .../Yhoator_Jungle/npcs/Harvesting_Point.lua | 4 +- .../Yhoator_Jungle/npcs/Logging_Point.lua | 4 +- scripts/zones/Yughott_Grotto/Zone.lua | 2 +- .../Yughott_Grotto/npcs/Mining_Point.lua | 4 +- scripts/zones/Yuhtunga_Jungle/IDs.lua | 1 + scripts/zones/Yuhtunga_Jungle/Zone.lua | 6 +- .../mobs/Pyuu_the_Spatemaker.lua | 13 + .../Yuhtunga_Jungle/npcs/Harvesting_Point.lua | 4 +- .../Yuhtunga_Jungle/npcs/Logging_Point.lua | 4 +- scripts/zones/Zeruhn_Mines/Zone.lua | 2 +- .../zones/Zeruhn_Mines/npcs/Mining_Point.lua | 4 +- sql/abilities.sql | 82 ++-- sql/augments.sql | 2 +- sql/bcnm_battlefield.sql | 7 +- sql/item_basic.sql | 10 +- sql/mob_droplist.sql | 5 +- sql/mob_groups.sql | 38 +- sql/mob_pools.sql | 2 +- sql/mob_spell_lists.sql | 6 +- sql/nm_spawn_points.sql | 4 + sql/npc_list.sql | 2 +- sql/pet_skills.sql | 39 ++ sql/spell_list.sql | 2 +- sql/synth_recipes.sql | 4 +- sql/traits.sql | 28 ++ src/common/mutex_guarded.h | 16 +- src/common/tracy.h | 3 + src/login/data_session.cpp | 4 +- src/login/view_session.cpp | 2 +- src/map/ai/ai_container.cpp | 24 +- src/map/ai/ai_container.h | 2 + src/map/ai/controllers/mob_controller.cpp | 32 +- src/map/ai/controllers/pet_controller.cpp | 10 +- .../controllers/player_charm_controller.cpp | 15 +- src/map/ai/helpers/action_queue.cpp | 16 + src/map/ai/helpers/action_queue.h | 2 + src/map/ai/states/ability_state.cpp | 61 ++- src/map/ai/states/item_state.cpp | 2 +- src/map/ai/states/mobskill_state.cpp | 7 + src/map/ai/states/state.cpp | 4 +- src/map/ai/states/trigger_state.cpp | 2 +- src/map/attack.cpp | 32 +- src/map/attackround.cpp | 6 - src/map/attackround.h | 1 - src/map/battlefield.cpp | 4 +- src/map/entities/automatonentity.cpp | 8 +- src/map/entities/baseentity.cpp | 9 + src/map/entities/baseentity.h | 1 + src/map/entities/battleentity.cpp | 96 ++-- src/map/entities/battleentity.h | 20 +- src/map/entities/charentity.cpp | 31 +- src/map/entities/charentity.h | 2 +- src/map/entities/mobentity.cpp | 28 +- src/map/entities/npcentity.cpp | 6 +- src/map/entities/petentity.cpp | 23 +- src/map/entities/petentity.h | 1 + src/map/entities/trustentity.cpp | 9 +- src/map/entities/trustentity.h | 2 +- src/map/instance.cpp | 18 +- src/map/instance_loader.cpp | 4 +- src/map/los/zone_los.cpp | 1 + src/map/lua/lua_baseentity.cpp | 105 +++-- src/map/lua/lua_baseentity.h | 21 +- src/map/mobskill.cpp | 18 - src/map/modifier.h | 20 +- src/map/packet_system.cpp | 6 +- src/map/packets/basic.h | 7 +- src/map/utils/attackutils.cpp | 41 +- src/map/utils/attackutils.h | 2 +- src/map/utils/battleutils.cpp | 425 +++--------------- src/map/utils/battleutils.h | 3 +- src/map/utils/fishingutils.cpp | 4 +- src/map/utils/petutils.cpp | 19 + 249 files changed, 1981 insertions(+), 1187 deletions(-) create mode 100644 scripts/actions/spells/white/temper_ii.lua create mode 100644 scripts/commands/getlocalvars.lua create mode 100644 scripts/enum/animation_strings.lua create mode 100644 scripts/enum/helm_type.lua create mode 100644 scripts/quests/windurst/Nothing_Matters.lua diff --git a/scripts/actions/abilities/eagle_eye_shot.lua b/scripts/actions/abilities/eagle_eye_shot.lua index 622e2587726..3d20afebe3f 100644 --- a/scripts/actions/abilities/eagle_eye_shot.lua +++ b/scripts/actions/abilities/eagle_eye_shot.lua @@ -44,6 +44,7 @@ abilityObject.onUseAbility = function(player, target, ability, action) params.numHits = 1 -- TP params. + local tp = 1000 -- to ensure ftp multiplier is applied params.ftpMod = { 5.0, 5.0, 5.0 } params.critVaries = { 0.0, 0.0, 0.0 } @@ -62,7 +63,7 @@ abilityObject.onUseAbility = function(player, target, ability, action) local jpValue = player:getJobPointLevel(xi.jp.EAGLE_EYE_SHOT_EFFECT) player:addMod(xi.mod.ALL_WSDMG_ALL_HITS, jpValue * 3) - local damage, _, tpHits, extraHits = xi.weaponskills.doRangedWeaponskill(player, target, 0, params, 0, action, true) + local damage, _, tpHits, extraHits = xi.weaponskills.doRangedWeaponskill(player, target, 0, params, tp, action, true) -- Set the message id ourselves if tpHits + extraHits > 0 then diff --git a/scripts/actions/abilities/elemental_siphon.lua b/scripts/actions/abilities/elemental_siphon.lua index a361cd2509d..886e98e830c 100644 --- a/scripts/actions/abilities/elemental_siphon.lua +++ b/scripts/actions/abilities/elemental_siphon.lua @@ -13,10 +13,10 @@ abilityObject.onAbilityCheck = function(player, target, ability) if pet then petID = pet:getPetID() - end - if petID >= xi.petId.FIRE_SPIRIT and petID <= xi.petId.DARK_SPIRIT then -- spirits - return 0, 0 + if petID >= xi.petId.FIRE_SPIRIT and petID <= xi.petId.DARK_SPIRIT then -- spirits + return 0, 0 + end end return xi.msg.basic.UNABLE_TO_USE_JA, 0 @@ -30,6 +30,8 @@ abilityObject.onUseAbility = function(player, target, ability) -- element order: fire, ice, wind, earth, thunder, water, light, dark if spirit then spiritEle = spirit:getPetID() + 1 + else + return 0 end local pEquipMods = player:getMod(xi.mod.ENHANCES_ELEMENTAL_SIPHON) diff --git a/scripts/actions/abilities/pets/aerial_armor.lua b/scripts/actions/abilities/pets/aerial_armor.lua index b584644e335..f604713f9f3 100644 --- a/scripts/actions/abilities/pets/aerial_armor.lua +++ b/scripts/actions/abilities/pets/aerial_armor.lua @@ -4,14 +4,27 @@ local abilityObject = {} abilityObject.onAbilityCheck = function(player, target, ability) - return 0, 0 + return xi.job_utils.summoner.canUseBloodPact(player, player:getPet(), target, ability) end -abilityObject.onPetAbility = function(target, pet, skill) - target:delStatusEffect(xi.effect.BLINK) - target:addStatusEffect(xi.effect.BLINK, 3, 0, 900) - skill:setMsg(xi.msg.basic.SKILL_GAIN_EFFECT) - return xi.effect.BLINK +abilityObject.onPetAbility = function(target, pet, petskill, summoner, action) + xi.job_utils.summoner.onUseBloodPact(target, petskill, summoner, action) + + local typeEffect = xi.effect.BLINK + target:delStatusEffect(typeEffect) + + if target:addStatusEffect(typeEffect, 3, 0, 900) then + if target:getID() == action:getPrimaryTargetID() then + petskill:setMsg(xi.msg.basic.SKILL_GAIN_EFFECT_2) + else + petskill:setMsg(xi.msg.basic.JA_GAIN_EFFECT) + end + else + petskill:setMsg(xi.msg.basic.JA_NO_EFFECT_2) + return + end + + return typeEffect end return abilityObject diff --git a/scripts/actions/abilities/pets/aerial_blast.lua b/scripts/actions/abilities/pets/aerial_blast.lua index 494207b14a9..d435633b359 100644 --- a/scripts/actions/abilities/pets/aerial_blast.lua +++ b/scripts/actions/abilities/pets/aerial_blast.lua @@ -4,26 +4,22 @@ local abilityObject = {} abilityObject.onAbilityCheck = function(player, target, ability) - local level = player:getMainLvl() * 2 - - if player:getMP() < level then - return 87, 0 - end - - return 0, 0 + return xi.job_utils.summoner.canUseBloodPact(player, player:getPet(), target, ability) end -abilityObject.onPetAbility = function(target, pet, skill, master) +abilityObject.onPetAbility = function(target, pet, petskill, summoner, action) local dINT = math.floor(pet:getStat(xi.mod.INT) - target:getStat(xi.mod.INT)) + xi.job_utils.summoner.onUseBloodPact(target, petskill, summoner, action) + local level = pet:getMainLvl() local damage = 48 + (level * 8) damage = damage + (dINT * 1.5) - damage = xi.mobskills.mobMagicalMove(pet, target, skill, damage, xi.element.WIND, 1, xi.mobskills.magicalTpBonus.NO_EFFECT, 0) + damage = xi.mobskills.mobMagicalMove(pet, target, petskill, damage, xi.element.WIND, 1, xi.mobskills.magicalTpBonus.NO_EFFECT, 0) damage = xi.mobskills.mobAddBonuses(pet, target, damage.dmg, xi.element.WIND) - damage = xi.summon.avatarFinalAdjustments(damage, pet, skill, target, xi.attackType.MAGICAL, xi.damageType.WIND, 1) + damage = xi.summon.avatarFinalAdjustments(damage, pet, petskill, target, xi.attackType.MAGICAL, xi.damageType.WIND, 1) - master:setMP(0) + summoner:setMP(0) target:takeDamage(damage, pet, xi.attackType.MAGICAL, xi.damageType.WIND) target:updateEnmityFromDamage(pet, damage) diff --git a/scripts/actions/abilities/pets/aero_ii.lua b/scripts/actions/abilities/pets/aero_ii.lua index 4e92e39a264..fbc40fb0192 100644 --- a/scripts/actions/abilities/pets/aero_ii.lua +++ b/scripts/actions/abilities/pets/aero_ii.lua @@ -4,18 +4,20 @@ local abilityObject = {} abilityObject.onAbilityCheck = function(player, target, ability) - return 0, 0 + return xi.job_utils.summoner.canUseBloodPact(player, player:getPet(), target, ability) end -abilityObject.onPetAbility = function(target, pet, skill) +abilityObject.onPetAbility = function(target, pet, petskill, summoner, action) local dINT = math.floor(pet:getStat(xi.mod.INT) - target:getStat(xi.mod.INT)) local tp = pet:getTP() + xi.job_utils.summoner.onUseBloodPact(target, petskill, summoner, action) + local damage = math.floor(45 + 0.025 * tp) damage = damage + (dINT * 1.5) - damage = xi.mobskills.mobMagicalMove(pet, target, skill, damage, xi.element.WIND, 1, xi.mobskills.magicalTpBonus.NO_EFFECT, 0) + damage = xi.mobskills.mobMagicalMove(pet, target, petskill, damage, xi.element.WIND, 1, xi.mobskills.magicalTpBonus.NO_EFFECT, 0) damage = xi.mobskills.mobAddBonuses(pet, target, damage.dmg, xi.element.WIND) - damage = xi.summon.avatarFinalAdjustments(damage, pet, skill, target, xi.attackType.MAGICAL, xi.damageType.WIND, 1) + damage = xi.summon.avatarFinalAdjustments(damage, pet, petskill, target, xi.attackType.MAGICAL, xi.damageType.WIND, 1) target:takeDamage(damage, pet, xi.attackType.MAGICAL, xi.damageType.WIND) target:updateEnmityFromDamage(pet, damage) diff --git a/scripts/actions/abilities/pets/aero_iv.lua b/scripts/actions/abilities/pets/aero_iv.lua index de1a8f03815..e327f17f62d 100644 --- a/scripts/actions/abilities/pets/aero_iv.lua +++ b/scripts/actions/abilities/pets/aero_iv.lua @@ -4,18 +4,20 @@ local abilityObject = {} abilityObject.onAbilityCheck = function(player, target, ability) - return 0, 0 + return xi.job_utils.summoner.canUseBloodPact(player, player:getPet(), target, ability) end -abilityObject.onPetAbility = function(target, pet, skill) +abilityObject.onPetAbility = function(target, pet, petskill, summoner, action) local dINT = math.floor(pet:getStat(xi.mod.INT) - target:getStat(xi.mod.INT)) local tp = pet:getTP() + xi.job_utils.summoner.onUseBloodPact(target, petskill, summoner, action) + local damage = math.floor(325 + 0.025 * tp) damage = damage + (dINT * 1.5) - damage = xi.mobskills.mobMagicalMove(pet, target, skill, damage, xi.element.WIND, 1, xi.mobskills.magicalTpBonus.NO_EFFECT, 0) + damage = xi.mobskills.mobMagicalMove(pet, target, petskill, damage, xi.element.WIND, 1, xi.mobskills.magicalTpBonus.NO_EFFECT, 0) damage = xi.mobskills.mobAddBonuses(pet, target, damage.dmg, xi.element.WIND) - damage = xi.summon.avatarFinalAdjustments(damage, pet, skill, target, xi.attackType.MAGICAL, xi.damageType.WIND, 1) + damage = xi.summon.avatarFinalAdjustments(damage, pet, petskill, target, xi.attackType.MAGICAL, xi.damageType.WIND, 1) target:takeDamage(damage, pet, xi.attackType.MAGICAL, xi.damageType.WIND) target:updateEnmityFromDamage(pet, damage) diff --git a/scripts/actions/abilities/pets/burning_strike.lua b/scripts/actions/abilities/pets/burning_strike.lua index b8c8ca35f04..a830dcc3c67 100644 --- a/scripts/actions/abilities/pets/burning_strike.lua +++ b/scripts/actions/abilities/pets/burning_strike.lua @@ -4,22 +4,24 @@ local abilityObject = {} abilityObject.onAbilityCheck = function(player, target, ability) - return 0, 0 + return xi.job_utils.summoner.canUseBloodPact(player, player:getPet(), target, ability) end -abilityObject.onPetAbility = function(target, pet, skill) +abilityObject.onPetAbility = function(target, pet, petskill, summoner, action) local numhits = 1 local accmod = 1 local dmgmod = 6 - local damage = xi.summon.avatarPhysicalMove(pet, target, skill, numhits, accmod, dmgmod, 0, xi.mobskills.magicalTpBonus.NO_EFFECT, 1, 2, 3) + xi.job_utils.summoner.onUseBloodPact(target, petskill, summoner, action) + + local damage = xi.summon.avatarPhysicalMove(pet, target, petskill, numhits, accmod, dmgmod, 0, xi.mobskills.magicalTpBonus.NO_EFFECT, 1, 2, 3) --get resist multiplier (1x if no resist) local resist = xi.mobskills.applyPlayerResistance(pet, -1, target, pet:getStat(xi.mod.INT)-target:getStat(xi.mod.INT), xi.skill.ELEMENTAL_MAGIC, xi.element.FIRE) --get the resisted damage damage.dmg = damage.dmg * resist --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) damage.dmg = xi.mobskills.mobAddBonuses(pet, target, damage.dmg, 1) - local totaldamage = xi.summon.avatarFinalAdjustments(damage.dmg, pet, skill, target, xi.attackType.PHYSICAL, xi.damageType.BLUNT, numhits) + local totaldamage = xi.summon.avatarFinalAdjustments(damage.dmg, pet, petskill, target, xi.attackType.PHYSICAL, xi.damageType.BLUNT, numhits) target:takeDamage(totaldamage, pet, xi.attackType.PHYSICAL, xi.damageType.BLUNT) target:updateEnmityFromDamage(pet, totaldamage) diff --git a/scripts/actions/abilities/pets/claw.lua b/scripts/actions/abilities/pets/claw.lua index 50bbaff9e5f..2b294297e64 100644 --- a/scripts/actions/abilities/pets/claw.lua +++ b/scripts/actions/abilities/pets/claw.lua @@ -4,16 +4,18 @@ local abilityObject = {} abilityObject.onAbilityCheck = function(player, target, ability) - return 0, 0 + return xi.job_utils.summoner.canUseBloodPact(player, player:getPet(), target, ability) end -abilityObject.onPetAbility = function(target, pet, skill) +abilityObject.onPetAbility = function(target, pet, petskill, summoner, action) local numhits = 1 local accmod = 1 local dmgmod = 3.5 - local damage = xi.summon.avatarPhysicalMove(pet, target, skill, numhits, accmod, dmgmod, 0, xi.mobskills.magicalTpBonus.NO_EFFECT, 1, 2, 3) - local totaldamage = xi.summon.avatarFinalAdjustments(damage.dmg, pet, skill, target, xi.attackType.PHYSICAL, xi.damageType.PIERCING, numhits) + xi.job_utils.summoner.onUseBloodPact(target, petskill, summoner, action) + + local damage = xi.summon.avatarPhysicalMove(pet, target, petskill, numhits, accmod, dmgmod, 0, xi.mobskills.magicalTpBonus.NO_EFFECT, 1, 2, 3) + local totaldamage = xi.summon.avatarFinalAdjustments(damage.dmg, pet, petskill, target, xi.attackType.PHYSICAL, xi.damageType.PIERCING, numhits) target:takeDamage(totaldamage, pet, xi.attackType.PHYSICAL, xi.damageType.PIERCING) target:updateEnmityFromDamage(pet, totaldamage) diff --git a/scripts/actions/abilities/pets/crimson_howl.lua b/scripts/actions/abilities/pets/crimson_howl.lua index 3bc69946d94..d7d10ca8f08 100644 --- a/scripts/actions/abilities/pets/crimson_howl.lua +++ b/scripts/actions/abilities/pets/crimson_howl.lua @@ -4,16 +4,28 @@ local abilityObject = {} abilityObject.onAbilityCheck = function(player, target, ability) - return 0, 0 + return xi.job_utils.summoner.canUseBloodPact(player, player:getPet(), target, ability) end -abilityObject.onPetAbility = function(target, pet, skill, summoner) +abilityObject.onPetAbility = function(target, pet, petskill, summoner, action) local bonusTime = utils.clamp(summoner:getSkillLevel(xi.skill.SUMMONING_MAGIC) - 300, 0, 200) local duration = 60 + bonusTime - target:addStatusEffect(xi.effect.WARCRY, 9, 0, duration) - skill:setMsg(xi.msg.basic.SKILL_GAIN_EFFECT) - return xi.effect.WARCRY + xi.job_utils.summoner.onUseBloodPact(target, petskill, summoner, action) + + local typeEffect = xi.effect.WARCRY + if target:addStatusEffect(typeEffect, 9, 0, duration) then + if target:getID() == action:getPrimaryTargetID() then + petskill:setMsg(xi.msg.basic.SKILL_GAIN_EFFECT_2) + else + petskill:setMsg(xi.msg.basic.JA_GAIN_EFFECT) + end + else + petskill:setMsg(xi.msg.basic.JA_NO_EFFECT_2) + return + end + + return typeEffect end return abilityObject diff --git a/scripts/actions/abilities/pets/double_punch.lua b/scripts/actions/abilities/pets/double_punch.lua index 34b62853a78..128bacb4cad 100644 --- a/scripts/actions/abilities/pets/double_punch.lua +++ b/scripts/actions/abilities/pets/double_punch.lua @@ -4,17 +4,19 @@ local abilityObject = {} abilityObject.onAbilityCheck = function(player, target, ability) - return 0, 0 + return xi.job_utils.summoner.canUseBloodPact(player, player:getPet(), target, ability) end -abilityObject.onPetAbility = function(target, pet, skill) +abilityObject.onPetAbility = function(target, pet, petskill, summoner, action) local numhits = 2 local accmod = 1 local dmgmod = 6 local dmgmodsubsequent = 2 - local damage = xi.summon.avatarPhysicalMove(pet, target, skill, numhits, accmod, dmgmod, dmgmodsubsequent, xi.mobskills.magicalTpBonus.NO_EFFECT, 1, 2, 3) - local totaldamage = xi.summon.avatarFinalAdjustments(damage.dmg, pet, skill, target, xi.attackType.PHYSICAL, xi.damageType.BLUNT, numhits) + xi.job_utils.summoner.onUseBloodPact(target, petskill, summoner, action) + + local damage = xi.summon.avatarPhysicalMove(pet, target, petskill, numhits, accmod, dmgmod, dmgmodsubsequent, xi.mobskills.magicalTpBonus.NO_EFFECT, 1, 2, 3) + local totaldamage = xi.summon.avatarFinalAdjustments(damage.dmg, pet, petskill, target, xi.attackType.PHYSICAL, xi.damageType.BLUNT, numhits) target:takeDamage(totaldamage, pet, xi.attackType.PHYSICAL, xi.damageType.BLUNT) target:updateEnmityFromDamage(pet, totaldamage) diff --git a/scripts/actions/abilities/pets/earthen_fury.lua b/scripts/actions/abilities/pets/earthen_fury.lua index 27c66fdcd54..28602149adf 100644 --- a/scripts/actions/abilities/pets/earthen_fury.lua +++ b/scripts/actions/abilities/pets/earthen_fury.lua @@ -4,26 +4,22 @@ local abilityObject = {} abilityObject.onAbilityCheck = function(player, target, ability) - local level = player:getMainLvl() * 2 - - if player:getMP() < level then - return 87, 0 - end - - return 0, 0 + return xi.job_utils.summoner.canUseBloodPact(player, player:getPet(), target, ability) end -abilityObject.onPetAbility = function(target, pet, skill, master) +abilityObject.onPetAbility = function(target, pet, petskill, summoner, action) local dINT = math.floor(pet:getStat(xi.mod.INT) - target:getStat(xi.mod.INT)) + xi.job_utils.summoner.onUseBloodPact(target, petskill, summoner, action) + local level = pet:getMainLvl() local damage = 48 + (level * 8) damage = damage + (dINT * 1.5) - damage = xi.mobskills.mobMagicalMove(pet, target, skill, damage, xi.element.EARTH, 1, xi.mobskills.magicalTpBonus.NO_EFFECT, 0) + damage = xi.mobskills.mobMagicalMove(pet, target, petskill, damage, xi.element.EARTH, 1, xi.mobskills.magicalTpBonus.NO_EFFECT, 0) damage = xi.mobskills.mobAddBonuses(pet, target, damage.dmg, xi.element.EARTH) - damage = xi.summon.avatarFinalAdjustments(damage, pet, skill, target, xi.attackType.MAGICAL, xi.damageType.EARTH, 1) + damage = xi.summon.avatarFinalAdjustments(damage, pet, petskill, target, xi.attackType.MAGICAL, xi.damageType.EARTH, 1) - master:setMP(0) + summoner:setMP(0) target:takeDamage(damage, pet, xi.attackType.MAGICAL, xi.damageType.EARTH) target:updateEnmityFromDamage(pet, damage) diff --git a/scripts/actions/abilities/pets/earthen_ward.lua b/scripts/actions/abilities/pets/earthen_ward.lua index 06ea464de9d..068952aa263 100644 --- a/scripts/actions/abilities/pets/earthen_ward.lua +++ b/scripts/actions/abilities/pets/earthen_ward.lua @@ -4,15 +4,28 @@ local abilityObject = {} abilityObject.onAbilityCheck = function(player, target, ability) - return 0, 0 + return xi.job_utils.summoner.canUseBloodPact(player, player:getPet(), target, ability) end -abilityObject.onPetAbility = function(target, pet, skill) +abilityObject.onPetAbility = function(target, pet, petskill, summoner, action) target:delStatusEffect(xi.effect.STONESKIN) local amount = pet:getMainLvl() * 2 + 50 - target:addStatusEffect(xi.effect.STONESKIN, amount, 0, 900, 0, 0, 3) - skill:setMsg(xi.msg.basic.SKILL_GAIN_EFFECT) - return xi.effect.STONESKIN + + xi.job_utils.summoner.onUseBloodPact(target, petskill, summoner, action) + + local typeEffect = xi.effect.STONESKIN + if target:addStatusEffect(typeEffect, amount, 0, 900, 0, 0, 3) then + if target:getID() == action:getPrimaryTargetID() then + petskill:setMsg(xi.msg.basic.SKILL_GAIN_EFFECT_2) + else + petskill:setMsg(xi.msg.basic.JA_GAIN_EFFECT) + end + else + petskill:setMsg(xi.msg.basic.JA_NO_EFFECT_2) + return + end + + return typeEffect end return abilityObject diff --git a/scripts/actions/abilities/pets/fire_ii.lua b/scripts/actions/abilities/pets/fire_ii.lua index 8b46e704d6c..2ee2bb653d5 100644 --- a/scripts/actions/abilities/pets/fire_ii.lua +++ b/scripts/actions/abilities/pets/fire_ii.lua @@ -4,18 +4,20 @@ local abilityObject = {} abilityObject.onAbilityCheck = function(player, target, ability) - return 0, 0 + return xi.job_utils.summoner.canUseBloodPact(player, player:getPet(), target, ability) end -abilityObject.onPetAbility = function(target, pet, skill) +abilityObject.onPetAbility = function(target, pet, petskill, summoner, action) local dINT = math.floor(pet:getStat(xi.mod.INT) - target:getStat(xi.mod.INT)) local tp = pet:getTP() + xi.job_utils.summoner.onUseBloodPact(target, petskill, summoner, action) + local damage = math.floor(45 + 0.025 * tp) damage = damage + (dINT * 1.5) - damage = xi.mobskills.mobMagicalMove(pet, target, skill, damage, xi.element.FIRE, 1, xi.mobskills.magicalTpBonus.NO_EFFECT, 0) + damage = xi.mobskills.mobMagicalMove(pet, target, petskill, damage, xi.element.FIRE, 1, xi.mobskills.magicalTpBonus.NO_EFFECT, 0) damage = xi.mobskills.mobAddBonuses(pet, target, damage.dmg, xi.element.FIRE) - damage = xi.summon.avatarFinalAdjustments(damage, pet, skill, target, xi.attackType.MAGICAL, xi.damageType.FIRE, 1) + damage = xi.summon.avatarFinalAdjustments(damage, pet, petskill, target, xi.attackType.MAGICAL, xi.damageType.FIRE, 1) target:takeDamage(damage, pet, xi.attackType.MAGICAL, xi.damageType.FIRE) target:updateEnmityFromDamage(pet, damage) diff --git a/scripts/actions/abilities/pets/fire_iv.lua b/scripts/actions/abilities/pets/fire_iv.lua index 0057b043217..38cda8d1c32 100644 --- a/scripts/actions/abilities/pets/fire_iv.lua +++ b/scripts/actions/abilities/pets/fire_iv.lua @@ -4,18 +4,20 @@ local abilityObject = {} abilityObject.onAbilityCheck = function(player, target, ability) - return 0, 0 + return xi.job_utils.summoner.canUseBloodPact(player, player:getPet(), target, ability) end -abilityObject.onPetAbility = function(target, pet, skill) +abilityObject.onPetAbility = function(target, pet, petskill, summoner, action) local dINT = math.floor(pet:getStat(xi.mod.INT) - target:getStat(xi.mod.INT)) local tp = pet:getTP() + xi.job_utils.summoner.onUseBloodPact(target, petskill, summoner, action) + local damage = math.floor(325 + 0.025 * tp) damage = damage + (dINT * 1.5) - damage = xi.mobskills.mobMagicalMove(pet, target, skill, damage, xi.element.FIRE, 1, xi.mobskills.magicalTpBonus.NO_EFFECT, 0) + damage = xi.mobskills.mobMagicalMove(pet, target, petskill, damage, xi.element.FIRE, 1, xi.mobskills.magicalTpBonus.NO_EFFECT, 0) damage = xi.mobskills.mobAddBonuses(pet, target, damage.dmg, xi.element.FIRE) - damage = xi.summon.avatarFinalAdjustments(damage, pet, skill, target, xi.attackType.MAGICAL, xi.damageType.FIRE, 1) + damage = xi.summon.avatarFinalAdjustments(damage, pet, petskill, target, xi.attackType.MAGICAL, xi.damageType.FIRE, 1) target:takeDamage(damage, pet, xi.attackType.MAGICAL, xi.damageType.FIRE) target:updateEnmityFromDamage(pet, damage) diff --git a/scripts/actions/abilities/pets/flaming_crush.lua b/scripts/actions/abilities/pets/flaming_crush.lua index 007bf5069a6..eabfd3d2b3d 100644 --- a/scripts/actions/abilities/pets/flaming_crush.lua +++ b/scripts/actions/abilities/pets/flaming_crush.lua @@ -4,23 +4,25 @@ local abilityObject = {} abilityObject.onAbilityCheck = function(player, target, ability) - return 0, 0 + return xi.job_utils.summoner.canUseBloodPact(player, player:getPet(), target, ability) end -abilityObject.onPetAbility = function(target, pet, skill) +abilityObject.onPetAbility = function(target, pet, petskill, summoner, action) local numhits = 3 local accmod = 1 local dmgmod = 10 local dmgmodsubsequent = 1 - local damage = xi.summon.avatarPhysicalMove(pet, target, skill, numhits, accmod, dmgmod, dmgmodsubsequent, xi.mobskills.magicalTpBonus.NO_EFFECT, 1, 2, 3) + xi.job_utils.summoner.onUseBloodPact(target, petskill, summoner, action) + + local damage = xi.summon.avatarPhysicalMove(pet, target, petskill, numhits, accmod, dmgmod, dmgmodsubsequent, xi.mobskills.magicalTpBonus.NO_EFFECT, 1, 2, 3) --get resist multiplier (1x if no resist) local resist = xi.mobskills.applyPlayerResistance(pet, -1, target, pet:getStat(xi.mod.INT)-target:getStat(xi.mod.INT), xi.skill.ELEMENTAL_MAGIC, xi.element.FIRE) --get the resisted damage damage.dmg = damage.dmg * resist --add on bonuses (staff/day/weather/jas/mab/etc all go in this function) damage.dmg = xi.mobskills.mobAddBonuses(pet, target, damage.dmg, 1) - local totaldamage = xi.summon.avatarFinalAdjustments(damage.dmg, pet, skill, target, xi.attackType.PHYSICAL, xi.damageType.FIRE, numhits) + local totaldamage = xi.summon.avatarFinalAdjustments(damage.dmg, pet, petskill, target, xi.attackType.PHYSICAL, xi.damageType.FIRE, numhits) target:takeDamage(totaldamage, pet, xi.attackType.PHYSICAL, xi.damageType.FIRE) target:updateEnmityFromDamage(pet, totaldamage) diff --git a/scripts/actions/abilities/pets/geocrush.lua b/scripts/actions/abilities/pets/geocrush.lua index 0a9853a006c..40bd738057b 100644 --- a/scripts/actions/abilities/pets/geocrush.lua +++ b/scripts/actions/abilities/pets/geocrush.lua @@ -4,17 +4,18 @@ local abilityObject = {} abilityObject.onAbilityCheck = function(player, target, ability) - return 0, 0 + return xi.job_utils.summoner.canUseBloodPact(player, player:getPet(), target, ability) end -abilityObject.onPetAbility = function(target, pet, skill) +abilityObject.onPetAbility = function(target, pet, petskill, summoner, action) local dINT = math.floor(pet:getStat(xi.mod.INT) - target:getStat(xi.mod.INT)) local tp = pet:getTP() / 10 - local master = pet:getMaster() local merits = 0 - if master ~= nil and master:isPC() then - merits = master:getMerit(xi.merit.GEOCRUSH) + xi.job_utils.summoner.onUseBloodPact(target, petskill, summoner, action) + + if summoner ~= nil and summoner:isPC() then + merits = summoner:getMerit(xi.merit.GEOCRUSH) end tp = tp + (merits - 40) @@ -25,9 +26,9 @@ abilityObject.onPetAbility = function(target, pet, skill) --note: this formula is only accurate for level 75 - 76+ may have a different intercept and/or slope local damage = math.floor(512 + 1.72 * (tp + 1)) damage = damage + (dINT * 1.5) - damage = xi.mobskills.mobMagicalMove(pet, target, skill, damage, xi.element.EARTH, 1, xi.mobskills.magicalTpBonus.NO_EFFECT, 0) + damage = xi.mobskills.mobMagicalMove(pet, target, petskill, damage, xi.element.EARTH, 1, xi.mobskills.magicalTpBonus.NO_EFFECT, 0) damage = xi.mobskills.mobAddBonuses(pet, target, damage.dmg, xi.element.EARTH) - damage = xi.summon.avatarFinalAdjustments(damage, pet, skill, target, xi.attackType.MAGICAL, xi.damageType.EARTH, 1) + damage = xi.summon.avatarFinalAdjustments(damage, pet, petskill, target, xi.attackType.MAGICAL, xi.damageType.EARTH, 1) target:takeDamage(damage, pet, xi.attackType.MAGICAL, xi.damageType.EARTH) target:updateEnmityFromDamage(pet, damage) diff --git a/scripts/actions/abilities/pets/hastega.lua b/scripts/actions/abilities/pets/hastega.lua index a763c8d7a7e..82eb2a368a5 100644 --- a/scripts/actions/abilities/pets/hastega.lua +++ b/scripts/actions/abilities/pets/hastega.lua @@ -4,17 +4,30 @@ local abilityObject = {} abilityObject.onAbilityCheck = function(player, target, ability) - return 0, 0 + return xi.job_utils.summoner.canUseBloodPact(player, player:getPet(), target, ability) end -abilityObject.onPetAbility = function(target, pet, skill, summoner) +abilityObject.onPetAbility = function(target, pet, petskill, summoner, action) local bonusTime = utils.clamp(summoner:getSkillLevel(xi.skill.SUMMONING_MAGIC) - 300, 0, 200) local duration = 180 + bonusTime + + xi.job_utils.summoner.onUseBloodPact(target, petskill, summoner, action) + -- Garuda's Hastega is a weird exception and uses 153/1024 instead of 150/1024 like Haste spell - -- That's why it overwrites some things regular haste won't. - target:addStatusEffect(xi.effect.HASTE, 1494, 0, duration) -- 153/1024 ~14.94% - skill:setMsg(xi.msg.basic.SKILL_GAIN_EFFECT) - return xi.effect.HASTE + -- That's why it overwrites some things regular haste won't. 153/1024 ~14.94% + local typeEffect = xi.effect.HASTE + if target:addStatusEffect(typeEffect, 1494, 0, duration) then + if target:getID() == action:getPrimaryTargetID() then + petskill:setMsg(xi.msg.basic.SKILL_GAIN_EFFECT_2) + else + petskill:setMsg(xi.msg.basic.JA_GAIN_EFFECT) + end + else + petskill:setMsg(xi.msg.basic.JA_NO_EFFECT_2) + return + end + + return typeEffect end return abilityObject diff --git a/scripts/actions/abilities/pets/inferno.lua b/scripts/actions/abilities/pets/inferno.lua index 9596333b6ae..8482f264125 100644 --- a/scripts/actions/abilities/pets/inferno.lua +++ b/scripts/actions/abilities/pets/inferno.lua @@ -4,26 +4,22 @@ local abilityObject = {} abilityObject.onAbilityCheck = function(player, target, ability) - local level = player:getMainLvl() * 2 - - if player:getMP() < level then - return 87, 0 - end - - return 0, 0 + return xi.job_utils.summoner.canUseBloodPact(player, player:getPet(), target, ability) end -abilityObject.onPetAbility = function(target, pet, skill, master) +abilityObject.onPetAbility = function(target, pet, petskill, summoner, action) local dINT = math.floor(pet:getStat(xi.mod.INT) - target:getStat(xi.mod.INT)) + xi.job_utils.summoner.onUseBloodPact(target, petskill, summoner, action) + local level = pet:getMainLvl() local damage = 48 + (level * 8) damage = damage + (dINT * 1.5) - damage = xi.mobskills.mobMagicalMove(pet, target, skill, damage, xi.element.FIRE, 1, xi.mobskills.magicalTpBonus.NO_EFFECT, 0) + damage = xi.mobskills.mobMagicalMove(pet, target, petskill, damage, xi.element.FIRE, 1, xi.mobskills.magicalTpBonus.NO_EFFECT, 0) damage = xi.mobskills.mobAddBonuses(pet, target, damage.dmg, xi.element.FIRE) - damage = xi.summon.avatarFinalAdjustments(damage, pet, skill, target, xi.attackType.MAGICAL, xi.damageType.FIRE, 1) + damage = xi.summon.avatarFinalAdjustments(damage, pet, petskill, target, xi.attackType.MAGICAL, xi.damageType.FIRE, 1) - master:setMP(0) + summoner:setMP(0) target:takeDamage(damage, pet, xi.attackType.MAGICAL, xi.damageType.FIRE) target:updateEnmityFromDamage(pet, damage) diff --git a/scripts/actions/abilities/pets/megalith_throw.lua b/scripts/actions/abilities/pets/megalith_throw.lua index 7ec30d4dd96..a9baa7d5b73 100644 --- a/scripts/actions/abilities/pets/megalith_throw.lua +++ b/scripts/actions/abilities/pets/megalith_throw.lua @@ -4,16 +4,18 @@ local abilityObject = {} abilityObject.onAbilityCheck = function(player, target, ability) - return 0, 0 + return xi.job_utils.summoner.canUseBloodPact(player, player:getPet(), target, ability) end -abilityObject.onPetAbility = function(target, pet, skill) +abilityObject.onPetAbility = function(target, pet, petskill, summoner, action) local numhits = 1 local accmod = 1 local dmgmod = 5.5 - local damage = xi.summon.avatarPhysicalMove(pet, target, skill, numhits, accmod, dmgmod, 0, xi.mobskills.magicalTpBonus.NO_EFFECT, 1, 2, 3) - local totaldamage = xi.summon.avatarFinalAdjustments(damage.dmg, pet, skill, target, xi.attackType.PHYSICAL, xi.damageType.SLASHING, numhits) + xi.job_utils.summoner.onUseBloodPact(target, petskill, summoner, action) + + local damage = xi.summon.avatarPhysicalMove(pet, target, petskill, numhits, accmod, dmgmod, 0, xi.mobskills.magicalTpBonus.NO_EFFECT, 1, 2, 3) + local totaldamage = xi.summon.avatarFinalAdjustments(damage.dmg, pet, petskill, target, xi.attackType.PHYSICAL, xi.damageType.SLASHING, numhits) target:takeDamage(totaldamage, pet, xi.attackType.PHYSICAL, xi.damageType.SLASHING) target:updateEnmityFromDamage(pet, totaldamage) return totaldamage diff --git a/scripts/actions/abilities/pets/meteor_strike.lua b/scripts/actions/abilities/pets/meteor_strike.lua index 988880d373c..b769e567081 100644 --- a/scripts/actions/abilities/pets/meteor_strike.lua +++ b/scripts/actions/abilities/pets/meteor_strike.lua @@ -4,17 +4,18 @@ local abilityObject = {} abilityObject.onAbilityCheck = function(player, target, ability) - return 0, 0 + return xi.job_utils.summoner.canUseBloodPact(player, player:getPet(), target, ability) end -abilityObject.onPetAbility = function(target, pet, skill) +abilityObject.onPetAbility = function(target, pet, petskill, summoner, action) local dINT = math.floor(pet:getStat(xi.mod.INT) - target:getStat(xi.mod.INT)) local tp = pet:getTP() / 10 - local master = pet:getMaster() local merits = 0 - if master ~= nil and master:isPC() then - merits = master:getMerit(xi.merit.METEOR_STRIKE) + xi.job_utils.summoner.onUseBloodPact(target, petskill, summoner, action) + + if summoner ~= nil and summoner:isPC() then + merits = summoner:getMerit(xi.merit.METEOR_STRIKE) end tp = tp + (merits - 40) @@ -25,9 +26,9 @@ abilityObject.onPetAbility = function(target, pet, skill) --note: this formula is only accurate for level 75 - 76+ may have a different intercept and/or slope local damage = math.floor(512 + 1.72 * (tp + 1)) damage = damage + (dINT * 1.5) - damage = xi.mobskills.mobMagicalMove(pet, target, skill, damage, xi.element.FIRE, 1, xi.mobskills.magicalTpBonus.NO_EFFECT, 0) + damage = xi.mobskills.mobMagicalMove(pet, target, petskill, damage, xi.element.FIRE, 1, xi.mobskills.magicalTpBonus.NO_EFFECT, 0) damage = xi.mobskills.mobAddBonuses(pet, target, damage.dmg, xi.element.FIRE) - damage = xi.summon.avatarFinalAdjustments(damage, pet, skill, target, xi.attackType.MAGICAL, xi.damageType.FIRE, 1) + damage = xi.summon.avatarFinalAdjustments(damage, pet, petskill, target, xi.attackType.MAGICAL, xi.damageType.FIRE, 1) target:takeDamage(damage, pet, xi.attackType.MAGICAL, xi.damageType.FIRE) target:updateEnmityFromDamage(pet, damage) diff --git a/scripts/actions/abilities/pets/mountain_buster.lua b/scripts/actions/abilities/pets/mountain_buster.lua index c0e69bfa2c3..25edff0d72b 100644 --- a/scripts/actions/abilities/pets/mountain_buster.lua +++ b/scripts/actions/abilities/pets/mountain_buster.lua @@ -4,16 +4,19 @@ local abilityObject = {} abilityObject.onAbilityCheck = function(player, target, ability) - return 0, 0 + return xi.job_utils.summoner.canUseBloodPact(player, player:getPet(), target, ability) end -abilityObject.onPetAbility = function(target, pet, skill) +abilityObject.onPetAbility = function(target, pet, petskill, summoner, action) local numhits = 1 local accmod = 1 local dmgmod = 12 local dmgmodsubsequent = 0 - local damage = xi.summon.avatarPhysicalMove(pet, target, skill, numhits, accmod, dmgmod, dmgmodsubsequent, xi.mobskills.magicalTpBonus.NO_EFFECT, 1, 2, 3) - local totaldamage = xi.summon.avatarFinalAdjustments(damage.dmg, pet, skill, target, xi.attackType.PHYSICAL, xi.damageType.SLASHING, numhits) + + xi.job_utils.summoner.onUseBloodPact(target, petskill, summoner, action) + + local damage = xi.summon.avatarPhysicalMove(pet, target, petskill, numhits, accmod, dmgmod, dmgmodsubsequent, xi.mobskills.magicalTpBonus.NO_EFFECT, 1, 2, 3) + local totaldamage = xi.summon.avatarFinalAdjustments(damage.dmg, pet, petskill, target, xi.attackType.PHYSICAL, xi.damageType.SLASHING, numhits) target:takeDamage(totaldamage, pet, xi.attackType.PHYSICAL, xi.damageType.SLASHING) target:updateEnmityFromDamage(pet, totaldamage) diff --git a/scripts/actions/abilities/pets/predator_claws.lua b/scripts/actions/abilities/pets/predator_claws.lua index a238969248c..6e24fd5af74 100644 --- a/scripts/actions/abilities/pets/predator_claws.lua +++ b/scripts/actions/abilities/pets/predator_claws.lua @@ -4,16 +4,19 @@ local abilityObject = {} abilityObject.onAbilityCheck = function(player, target, ability) - return 0, 0 + return xi.job_utils.summoner.canUseBloodPact(player, player:getPet(), target, ability) end -abilityObject.onPetAbility = function(target, pet, skill) +abilityObject.onPetAbility = function(target, pet, petskill, summoner, action) local numhits = 3 local accmod = 1 local dmgmod = 10 local dmgmodsubsequent = 2 - local damage = xi.summon.avatarPhysicalMove(pet, target, skill, numhits, accmod, dmgmod, dmgmodsubsequent, xi.mobskills.magicalTpBonus.NO_EFFECT, 1, 2, 3) - local totaldamage = xi.summon.avatarFinalAdjustments(damage.dmg, pet, skill, target, xi.attackType.PHYSICAL, xi.damageType.SLASHING, numhits) + + xi.job_utils.summoner.onUseBloodPact(target, petskill, summoner, action) + + local damage = xi.summon.avatarPhysicalMove(pet, target, petskill, numhits, accmod, dmgmod, dmgmodsubsequent, xi.mobskills.magicalTpBonus.NO_EFFECT, 1, 2, 3) + local totaldamage = xi.summon.avatarFinalAdjustments(damage.dmg, pet, petskill, target, xi.attackType.PHYSICAL, xi.damageType.SLASHING, numhits) target:takeDamage(totaldamage, pet, xi.attackType.PHYSICAL, xi.damageType.SLASHING) target:updateEnmityFromDamage(pet, totaldamage) return totaldamage diff --git a/scripts/actions/abilities/pets/punch.lua b/scripts/actions/abilities/pets/punch.lua index 3d63f27c9ae..3c069997667 100644 --- a/scripts/actions/abilities/pets/punch.lua +++ b/scripts/actions/abilities/pets/punch.lua @@ -4,16 +4,18 @@ local abilityObject = {} abilityObject.onAbilityCheck = function(player, target, ability) - return 0, 0 + return xi.job_utils.summoner.canUseBloodPact(player, player:getPet(), target, ability) end -abilityObject.onPetAbility = function(target, pet, skill) +abilityObject.onPetAbility = function(target, pet, petskill, summoner, action) local numhits = 1 local accmod = 1 local dmgmod = 3.5 - local damage = xi.summon.avatarPhysicalMove(pet, target, skill, numhits, accmod, dmgmod, 0, xi.mobskills.magicalTpBonus.NO_EFFECT, 1, 2, 3) - local totaldamage = xi.summon.avatarFinalAdjustments(damage.dmg, pet, skill, target, xi.attackType.PHYSICAL, xi.damageType.BLUNT, numhits) + xi.job_utils.summoner.onUseBloodPact(target, petskill, summoner, action) + + local damage = xi.summon.avatarPhysicalMove(pet, target, petskill, numhits, accmod, dmgmod, 0, xi.mobskills.magicalTpBonus.NO_EFFECT, 1, 2, 3) + local totaldamage = xi.summon.avatarFinalAdjustments(damage.dmg, pet, petskill, target, xi.attackType.PHYSICAL, xi.damageType.BLUNT, numhits) target:takeDamage(totaldamage, pet, xi.attackType.PHYSICAL, xi.damageType.BLUNT) target:updateEnmityFromDamage(pet, totaldamage) diff --git a/scripts/actions/abilities/pets/rock_buster.lua b/scripts/actions/abilities/pets/rock_buster.lua index 62d9b68ae23..3b2492c0dcb 100644 --- a/scripts/actions/abilities/pets/rock_buster.lua +++ b/scripts/actions/abilities/pets/rock_buster.lua @@ -4,16 +4,18 @@ local abilityObject = {} abilityObject.onAbilityCheck = function(player, target, ability) - return 0, 0 + return xi.job_utils.summoner.canUseBloodPact(player, player:getPet(), target, ability) end -abilityObject.onPetAbility = function(target, pet, skill) +abilityObject.onPetAbility = function(target, pet, petskill, summoner, action) local numhits = 1 local accmod = 1 local dmgmod = 4 - local damage = xi.summon.avatarPhysicalMove(pet, target, skill, numhits, accmod, dmgmod, 0, xi.mobskills.magicalTpBonus.NO_EFFECT, 1, 2, 3) - local totaldamage = xi.summon.avatarFinalAdjustments(damage.dmg, pet, skill, target, xi.attackType.PHYSICAL, xi.damageType.SLASHING, numhits) + xi.job_utils.summoner.onUseBloodPact(target, petskill, summoner, action) + + local damage = xi.summon.avatarPhysicalMove(pet, target, petskill, numhits, accmod, dmgmod, 0, xi.mobskills.magicalTpBonus.NO_EFFECT, 1, 2, 3) + local totaldamage = xi.summon.avatarFinalAdjustments(damage.dmg, pet, petskill, target, xi.attackType.PHYSICAL, xi.damageType.SLASHING, numhits) target:takeDamage(totaldamage, pet, xi.attackType.PHYSICAL, xi.damageType.SLASHING) target:updateEnmityFromDamage(pet, totaldamage) diff --git a/scripts/actions/abilities/pets/rock_throw.lua b/scripts/actions/abilities/pets/rock_throw.lua index 6c02faa8003..10e6bed6ddb 100644 --- a/scripts/actions/abilities/pets/rock_throw.lua +++ b/scripts/actions/abilities/pets/rock_throw.lua @@ -4,16 +4,18 @@ local abilityObject = {} abilityObject.onAbilityCheck = function(player, target, ability) - return 0, 0 + return xi.job_utils.summoner.canUseBloodPact(player, player:getPet(), target, ability) end -abilityObject.onPetAbility = function(target, pet, skill) +abilityObject.onPetAbility = function(target, pet, petskill, summoner, action) local numhits = 1 local accmod = 1 local dmgmod = 3.5 - local damage = xi.summon.avatarPhysicalMove(pet, target, skill, numhits, accmod, dmgmod, 0, xi.mobskills.magicalTpBonus.NO_EFFECT, 1, 2, 3) - local totaldamage = xi.summon.avatarFinalAdjustments(damage.dmg, pet, skill, target, xi.attackType.PHYSICAL, xi.damageType.SLASHING, numhits) + xi.job_utils.summoner.onUseBloodPact(target, petskill, summoner, action) + + local damage = xi.summon.avatarPhysicalMove(pet, target, petskill, numhits, accmod, dmgmod, 0, xi.mobskills.magicalTpBonus.NO_EFFECT, 1, 2, 3) + local totaldamage = xi.summon.avatarFinalAdjustments(damage.dmg, pet, petskill, target, xi.attackType.PHYSICAL, xi.damageType.SLASHING, numhits) target:takeDamage(totaldamage, pet, xi.attackType.PHYSICAL, xi.damageType.SLASHING) target:updateEnmityFromDamage(pet, totaldamage) diff --git a/scripts/actions/abilities/pets/stone_ii.lua b/scripts/actions/abilities/pets/stone_ii.lua index 7aacb94eac4..6a0e491864d 100644 --- a/scripts/actions/abilities/pets/stone_ii.lua +++ b/scripts/actions/abilities/pets/stone_ii.lua @@ -4,18 +4,20 @@ local abilityObject = {} abilityObject.onAbilityCheck = function(player, target, ability) - return 0, 0 + return xi.job_utils.summoner.canUseBloodPact(player, player:getPet(), target, ability) end -abilityObject.onPetAbility = function(target, pet, skill) +abilityObject.onPetAbility = function(target, pet, petskill, summoner, action) local dINT = math.floor(pet:getStat(xi.mod.INT) - target:getStat(xi.mod.INT)) local tp = pet:getTP() + xi.job_utils.summoner.onUseBloodPact(target, petskill, summoner, action) + local damage = math.floor(45 + 0.025 * tp) damage = damage + (dINT * 1.5) - damage = xi.mobskills.mobMagicalMove(pet, target, skill, damage, xi.element.EARTH, 1, xi.mobskills.magicalTpBonus.NO_EFFECT, 0) + damage = xi.mobskills.mobMagicalMove(pet, target, petskill, damage, xi.element.EARTH, 1, xi.mobskills.magicalTpBonus.NO_EFFECT, 0) damage = xi.mobskills.mobAddBonuses(pet, target, damage.dmg, xi.element.EARTH) - damage = xi.summon.avatarFinalAdjustments(damage, pet, skill, target, xi.attackType.MAGICAL, xi.damageType.EARTH, 1) + damage = xi.summon.avatarFinalAdjustments(damage, pet, petskill, target, xi.attackType.MAGICAL, xi.damageType.EARTH, 1) target:takeDamage(damage, pet, xi.attackType.MAGICAL, xi.damageType.EARTH) target:updateEnmityFromDamage(pet, damage) diff --git a/scripts/actions/abilities/pets/stone_iv.lua b/scripts/actions/abilities/pets/stone_iv.lua index b971bb35798..d5674129d4d 100644 --- a/scripts/actions/abilities/pets/stone_iv.lua +++ b/scripts/actions/abilities/pets/stone_iv.lua @@ -4,18 +4,20 @@ local abilityObject = {} abilityObject.onAbilityCheck = function(player, target, ability) - return 0, 0 + return xi.job_utils.summoner.canUseBloodPact(player, player:getPet(), target, ability) end -abilityObject.onPetAbility = function(target, pet, skill) +abilityObject.onPetAbility = function(target, pet, petskill, summoner, action) local dINT = math.floor(pet:getStat(xi.mod.INT) - target:getStat(xi.mod.INT)) local tp = pet:getTP() local damage = math.floor(325 + 0.025 * tp) + xi.job_utils.summoner.onUseBloodPact(target, petskill, summoner, action) + damage = damage + (dINT * 1.5) - damage = xi.mobskills.mobMagicalMove(pet, target, skill, damage, xi.element.EARTH, 1, xi.mobskills.magicalTpBonus.NO_EFFECT, 0) + damage = xi.mobskills.mobMagicalMove(pet, target, petskill, damage, xi.element.EARTH, 1, xi.mobskills.magicalTpBonus.NO_EFFECT, 0) damage = xi.mobskills.mobAddBonuses(pet, target, damage.dmg, xi.element.EARTH) - damage = xi.summon.avatarFinalAdjustments(damage, pet, skill, target, xi.attackType.MAGICAL, xi.damageType.EARTH, 1) + damage = xi.summon.avatarFinalAdjustments(damage, pet, petskill, target, xi.attackType.MAGICAL, xi.damageType.EARTH, 1) target:takeDamage(damage, pet, xi.attackType.MAGICAL, xi.damageType.EARTH) target:updateEnmityFromDamage(pet, damage) diff --git a/scripts/actions/abilities/pets/whispering_wind.lua b/scripts/actions/abilities/pets/whispering_wind.lua index 87557543a19..0164daa3919 100644 --- a/scripts/actions/abilities/pets/whispering_wind.lua +++ b/scripts/actions/abilities/pets/whispering_wind.lua @@ -4,17 +4,24 @@ local abilityObject = {} abilityObject.onAbilityCheck = function(player, target, ability) - return 0, 0 + return xi.job_utils.summoner.canUseBloodPact(player, player:getPet(), target, ability) end -abilityObject.onPetAbility = function(target, pet, skill) +abilityObject.onPetAbility = function(target, pet, petskill, summoner, action) local base = 16 + pet:getMainLvl() * 2.5 + xi.job_utils.summoner.onUseBloodPact(target, petskill, summoner, action) + if target:getHP() + base > target:getMaxHP() then base = target:getMaxHP() - target:getHP() --cap it end - skill:setMsg(xi.msg.basic.SELF_HEAL) + if target:getID() == action:getPrimaryTargetID() then + petskill:setMsg(xi.msg.basic.JA_RECOVERS_HP_2) + else + petskill:setMsg(xi.msg.basic.SELF_HEAL_SECONDARY) + end + target:addHP(base) return base end diff --git a/scripts/actions/abilities/pets/wind_blade.lua b/scripts/actions/abilities/pets/wind_blade.lua index cb242553762..abcc277cd12 100644 --- a/scripts/actions/abilities/pets/wind_blade.lua +++ b/scripts/actions/abilities/pets/wind_blade.lua @@ -4,14 +4,17 @@ local abilityObject = {} abilityObject.onAbilityCheck = function(player, target, ability) - return 0, 0 + return xi.job_utils.summoner.canUseBloodPact(player, player:getPet(), target, ability) end -abilityObject.onPetAbility = function(target, pet, skill) +abilityObject.onPetAbility = function(target, pet, petskill, summoner, action) local dINT = math.floor(pet:getStat(xi.mod.INT) - target:getStat(xi.mod.INT)) local tp = pet:getTP() / 10 local master = pet:getMaster() local merits = 0 + + xi.job_utils.summoner.onUseBloodPact(target, petskill, summoner, action) + if master ~= nil and master:isPC() then merits = master:getMerit(xi.merit.WIND_BLADE) end @@ -24,9 +27,9 @@ abilityObject.onPetAbility = function(target, pet, skill) --note: this formula is only accurate for level 75 - 76+ may have a different intercept and/or slope local damage = math.floor(512 + 1.72 * (tp + 1)) damage = damage + (dINT * 1.5) - damage = xi.mobskills.mobMagicalMove(pet, target, skill, damage, xi.element.WIND, 1, xi.mobskills.magicalTpBonus.NO_EFFECT, 0) + damage = xi.mobskills.mobMagicalMove(pet, target, petskill, damage, xi.element.WIND, 1, xi.mobskills.magicalTpBonus.NO_EFFECT, 0) damage = xi.mobskills.mobAddBonuses(pet, target, damage.dmg, xi.element.WIND) - damage = xi.summon.avatarFinalAdjustments(damage, pet, skill, target, xi.attackType.MAGICAL, xi.damageType.WIND, 1) + damage = xi.summon.avatarFinalAdjustments(damage, pet, petskill, target, xi.attackType.MAGICAL, xi.damageType.WIND, 1) target:takeDamage(damage, pet, xi.attackType.MAGICAL, xi.damageType.WIND) target:updateEnmityFromDamage(pet, damage) diff --git a/scripts/actions/abilities/restoring_breath.lua b/scripts/actions/abilities/restoring_breath.lua index 25517c581cd..9707fd6b704 100644 --- a/scripts/actions/abilities/restoring_breath.lua +++ b/scripts/actions/abilities/restoring_breath.lua @@ -7,6 +7,8 @@ ----------------------------------- local abilityObject = {} +-- TODO: find out what checks can result in being unable to use ability on the pet -- +-- such as if the wyvern has amnesia, stun, etc abilityObject.onAbilityCheck = function(player, target, ability) -- You can't actually use Restoring Breath on retail unless your wyvern is up -- This is on the pet menu, but just in case... diff --git a/scripts/actions/abilities/smiting_breath.lua b/scripts/actions/abilities/smiting_breath.lua index 2206d345b3c..9752fe1a51a 100644 --- a/scripts/actions/abilities/smiting_breath.lua +++ b/scripts/actions/abilities/smiting_breath.lua @@ -7,6 +7,8 @@ ----------------------------------- local abilityObject = {} +-- TODO: find out what checks can result in being unable to use ability on the pet -- +-- such as if the wyvern has amnesia, stun, etc abilityObject.onAbilityCheck = function(player, target, ability) -- You can't actually use Restoring Breath on retail unless your wyvern is up -- This is on the pet menu, but just in case... diff --git a/scripts/actions/mobskills/meikyo_shisui.lua b/scripts/actions/mobskills/meikyo_shisui.lua index 702bc7f65a1..d3bcd79f054 100644 --- a/scripts/actions/mobskills/meikyo_shisui.lua +++ b/scripts/actions/mobskills/meikyo_shisui.lua @@ -14,6 +14,9 @@ mobskillObject.onMobWeaponSkill = function(target, mob, skill) mob:addTP(3000) + -- use local var counter to ensure only three mobskills count for Meikyo Shisui + mob:setLocalVar('[MeikyoShisui]MobSkillCount', 3) + return xi.effect.MEIKYO_SHISUI end diff --git a/scripts/actions/mobskills/smite_of_rage.lua b/scripts/actions/mobskills/smite_of_rage.lua index 4ebba324c3e..11838a66361 100644 --- a/scripts/actions/mobskills/smite_of_rage.lua +++ b/scripts/actions/mobskills/smite_of_rage.lua @@ -10,11 +10,14 @@ end mobskillObject.onMobWeaponSkill = function(target, mob, skill) local numhits = 1 - local accmod = 1 - local dmgmod = 2.7 + local accmod = 1 + local dmgmod = 3 + local info = xi.mobskills.mobPhysicalMove(mob, target, skill, numhits, accmod, dmgmod, xi.mobskills.magicalTpBonus.NO_EFFECT) - local dmg = xi.mobskills.mobFinalAdjustments(info.dmg, mob, skill, target, xi.attackType.PHYSICAL, xi.damageType.SLASHING, info.hitslanded * math.random(2, 3)) + local dmg = xi.mobskills.mobFinalAdjustments(info.dmg, mob, skill, target, xi.attackType.PHYSICAL, xi.damageType.SLASHING, info.hitslanded) + target:takeDamage(dmg, mob, xi.attackType.PHYSICAL, xi.damageType.SLASHING) + return dmg end diff --git a/scripts/actions/spells/songs/maidens_virelai.lua b/scripts/actions/spells/songs/maidens_virelai.lua index 56805befca6..704b3cd3871 100644 --- a/scripts/actions/spells/songs/maidens_virelai.lua +++ b/scripts/actions/spells/songs/maidens_virelai.lua @@ -14,32 +14,39 @@ spellObject.onMagicCastingCheck = function(caster, target, spell) -- Per wiki, Virelai wipes all shadows even if it resists or the target is immune to charm -- This can't be done in the onSpellCast function (that runs after it "hits") spell:setFlag(xi.magic.spellFlag.WIPE_SHADOWS) + -- TODO: + -- 1. move "spell:setFlag()" to a SpellFlags group of get/set/add/del functions + -- 2. move spell flags to the spell table, so we don't have to do hacky things inside the casting check! return 0 end spellObject.onSpellCast = function(caster, target, spell) - -- local dCHR = (caster:getStat(xi.mod.CHR) - target:getStat(xi.mod.CHR)) - local bonus = 0 -- No idea what value, but seems likely to need this edited later to get retail resist rates. - local params = {} - params.diff = nil - params.attribute = xi.mod.CHR - params.skillType = xi.skill.SINGING - params.bonus = bonus - params.effect = xi.effect.CHARM_I - local resist = applyResistanceEffect(caster, target, spell, params) + if target:hasStatusEffect(xi.effect.CHARM_I) then + spell:setMsg(xi.msg.basic.MAGIC_NO_EFFECT) + else + -- local dCHR = (caster:getStat(xi.mod.CHR) - target:getStat(xi.mod.CHR)) + local bonus = 0 -- No idea what value, but seems likely to need this edited later to get retail resist rates. + local params = {} + params.diff = nil + params.attribute = xi.mod.CHR + params.skillType = xi.skill.SINGING + params.bonus = bonus + params.effect = xi.effect.CHARM_I + local resist = applyResistanceEffect(caster, target, spell, params) - if resist >= 0.25 and caster:getCharmChance(target, false) > 0 then - spell:setMsg(xi.msg.basic.MAGIC_ENFEEB_IS) - if caster:isMob() then - target:addStatusEffect(xi.effect.CHARM_I, 0, 0, 30 * resist) - caster:charm(target) + if resist >= 0.25 and caster:getCharmChance(target, false) > 0 then + spell:setMsg(xi.msg.basic.MAGIC_ENFEEB_IS) + if caster:isMob() then + target:addStatusEffect(xi.effect.CHARM_I, 0, 0, 30 * resist) + caster:charm(target) + else + caster:charmPet(target) + end else - caster:charmPet(target) + -- Resist + spell:setMsg(xi.msg.basic.MAGIC_RESIST) end - else - -- Resist - spell:setMsg(xi.msg.basic.MAGIC_RESIST) end return xi.effect.CHARM_I diff --git a/scripts/actions/spells/white/arise.lua b/scripts/actions/spells/white/arise.lua index 3a673614f00..8d9c2ca436a 100644 --- a/scripts/actions/spells/white/arise.lua +++ b/scripts/actions/spells/white/arise.lua @@ -21,7 +21,7 @@ spellObject.onSpellCast = function(caster, target, spell) if target:getName() == 'Prishe' then -- CoP 8-4 Prishe target:setLocalVar('Raise', 1) - target:entityAnimationPacket('sp00') + target:entityAnimationPacket(xi.animationString.SPECIAL_00) target:addHP(target:getMaxHP()) target:addMP(target:getMaxMP()) end diff --git a/scripts/actions/spells/white/cursna.lua b/scripts/actions/spells/white/cursna.lua index a503449ea03..28e20ed1a21 100644 --- a/scripts/actions/spells/white/cursna.lua +++ b/scripts/actions/spells/white/cursna.lua @@ -9,12 +9,15 @@ spellObject.onMagicCastingCheck = function(caster, target, spell) end spellObject.onSpellCast = function(caster, target, spell) - local curse = target:getStatusEffect(xi.effect.CURSE_I) + local curse = target:getStatusEffect(xi.effect.CURSE_I) local curse2 = target:getStatusEffect(xi.effect.CURSE_II) - local bane = target:getStatusEffect(xi.effect.BANE) - local bonus = caster:getMod(xi.mod.ENHANCES_CURSNA) + target:getMod(xi.mod.ENHANCES_CURSNA_RCVD) - local power = 25 * ((100 + bonus) / 100) -- This 25 is temp until the skill calculation is in. - local final = nil + local bane = target:getStatusEffect(xi.effect.BANE) + local bonus = caster:getMod(xi.mod.ENHANCES_CURSNA) + target:getMod(xi.mod.ENHANCES_CURSNA_RCVD) + local skill = caster:getSkillLevel(xi.skill.HEALING_MAGIC) + local final = nil + + -- https://www.bg-wiki.com/ffxi/Cursna, https://wiki.ffo.jp/html/1962.html + local power = (10 + (skill / 30)) * (1 + (bonus / 100)) spell:setMsg(xi.msg.basic.MAGIC_NO_EFFECT) if target:hasStatusEffect(xi.effect.DOOM) and power > math.random(1, 100) then diff --git a/scripts/actions/spells/white/raise.lua b/scripts/actions/spells/white/raise.lua index c4cf9cc9cc4..fe1cc62efd9 100644 --- a/scripts/actions/spells/white/raise.lua +++ b/scripts/actions/spells/white/raise.lua @@ -21,7 +21,7 @@ spellObject.onSpellCast = function(caster, target, spell) if target:getName() == 'Prishe' then -- CoP 8-4 Prishe target:setLocalVar('Raise', 1) - target:entityAnimationPacket('sp00') + target:entityAnimationPacket(xi.animationString.SPECIAL_00) target:addHP(target:getMaxHP()) target:addMP(target:getMaxMP()) end diff --git a/scripts/actions/spells/white/raise_ii.lua b/scripts/actions/spells/white/raise_ii.lua index 32cf5ce7d65..c8f67459a90 100644 --- a/scripts/actions/spells/white/raise_ii.lua +++ b/scripts/actions/spells/white/raise_ii.lua @@ -21,7 +21,7 @@ spellObject.onSpellCast = function(caster, target, spell) if target:getName() == 'Prishe' then -- CoP 8-4 Prishe target:setLocalVar('Raise', 1) - target:entityAnimationPacket('sp00') + target:entityAnimationPacket(xi.animationString.SPECIAL_00) target:addHP(target:getMaxHP()) target:addMP(target:getMaxMP()) end diff --git a/scripts/actions/spells/white/raise_iii.lua b/scripts/actions/spells/white/raise_iii.lua index 879dcc909e8..f4f7296f421 100644 --- a/scripts/actions/spells/white/raise_iii.lua +++ b/scripts/actions/spells/white/raise_iii.lua @@ -21,7 +21,7 @@ spellObject.onSpellCast = function(caster, target, spell) if target:getName() == 'Prishe' then -- CoP 8-4 Prishe target:setLocalVar('Raise', 1) - target:entityAnimationPacket('sp00') + target:entityAnimationPacket(xi.animationString.SPECIAL_00) target:addHP(target:getMaxHP()) target:addMP(target:getMaxMP()) end diff --git a/scripts/actions/spells/white/temper_ii.lua b/scripts/actions/spells/white/temper_ii.lua new file mode 100644 index 00000000000..20d321d8c06 --- /dev/null +++ b/scripts/actions/spells/white/temper_ii.lua @@ -0,0 +1,14 @@ +----------------------------------- +-- Spell: Temper II +----------------------------------- +local spellObject = {} + +spellObject.onMagicCastingCheck = function(caster, target, spell) + return 0 +end + +spellObject.onSpellCast = function(caster, target, spell) + return xi.spells.enhancing.useEnhancingSpell(caster, target, spell) +end + +return spellObject diff --git a/scripts/actions/weaponskills/shijin_spiral.lua b/scripts/actions/weaponskills/shijin_spiral.lua index 94f88eae6b3..343ceb16367 100644 --- a/scripts/actions/weaponskills/shijin_spiral.lua +++ b/scripts/actions/weaponskills/shijin_spiral.lua @@ -29,7 +29,7 @@ weaponskillObject.onUseWeaponSkill = function(player, target, wsID, tp, primary, local damage, criticalHit, tpHits, extraHits = xi.weaponskills.doPhysicalWeaponskill(player, target, wsID, params, tp, action, primary, taChar) if damage > 0 then - local duration = (tp / 1000) + 4 + local duration = 3 * ((tp / 1000) + 5) -- Plague effect is -50TP/tick and lasts for 5-8 ticks. if not target:hasStatusEffect(xi.effect.PLAGUE) then target:addStatusEffect(xi.effect.PLAGUE, 5, 0, duration) end diff --git a/scripts/battlefields/Apollyon/sw_apollyon.lua b/scripts/battlefields/Apollyon/sw_apollyon.lua index 05e9e47edc1..4cb117058ef 100644 --- a/scripts/battlefields/Apollyon/sw_apollyon.lua +++ b/scripts/battlefields/Apollyon/sw_apollyon.lua @@ -368,7 +368,7 @@ content.groups = local swapWithCrate = function(crate) crate:setPos(mob:getXPos(), mob:getYPos(), mob:getZPos(), mob:getRotPos()) - crate:entityAnimationPacket('deru') + crate:entityAnimationPacket(xi.animationString.STATUS_VISIBLE) crate:setModelId(961) crate:setAnimationSub(8) npcUtil.showCrate(crate) diff --git a/scripts/commands/getlocalvars.lua b/scripts/commands/getlocalvars.lua new file mode 100644 index 00000000000..3a73f3a1d03 --- /dev/null +++ b/scripts/commands/getlocalvars.lua @@ -0,0 +1,33 @@ +----------------------------------- +-- Func: getlocalvars +-- Desc: Gets all local vars of a target +----------------------------------- +local commandObj = {} + +commandObj.cmdprops = +{ + permission = 1, + parameters = '' +} + +commandObj.onTrigger = function(player) + local targ = player:getCursorTarget() + if targ == nil then + return + end + + local vars = {} + vars = targ:getLocalVars() + + if #vars > 0 then + player:printToPlayer(string.format('Printing local vars for entity: %s', targ:getName()), xi.msg.channel.SYSTEM_3) + player:printToPlayer('----------------------------------', xi.msg.channel.SYSTEM_3) + for _, var in pairs(vars) do + player:printToPlayer(string.format('"%s" : %u', var['varname'], var['value']), xi.msg.channel.SYSTEM_3) + end + else + player:printToPlayer(string.format('No local vars for entity: %s', targ:getName()), xi.msg.channel.SYSTEM_3) + end +end + +return commandObj diff --git a/scripts/effects/innin.lua b/scripts/effects/innin.lua index 266303e6d0f..8b85dfca91d 100644 --- a/scripts/effects/innin.lua +++ b/scripts/effects/innin.lua @@ -3,30 +3,44 @@ ----------------------------------- local effectObject = {} -effectObject.onEffectGain = function(target, effect) --power=30 initially, subpower=20 for enmity - target:addMod(xi.mod.EVA, -effect:getPower()) - target:addMod(xi.mod.ENMITY, -effect:getSubPower()) - +effectObject.onEffectGain = function(target, effect) -- Power = 30 initially, subpower = 20 for enmity + local power = effect:getPower() local jpValue = target:getJobPointLevel(xi.jp.INNIN_EFFECT) + + target:addMod(xi.mod.NIN_NUKE_BONUS_INNIN, power) + target:addMod(xi.mod.EVA, -power) + target:addMod(xi.mod.ENMITY, -effect:getSubPower()) target:addMod(xi.mod.ACC, jpValue) end effectObject.onEffectTick = function(target, effect) - --tick down the effect and reduce the overall power - effect:setPower(effect:getPower()-1) - target:delMod(xi.mod.EVA, -1) - if effect:getPower() % 2 == 0 then -- enmity- decays from -20 to -10, so half as often as the rest. - effect:setSubPower(effect:getSubPower()-1) - target:delMod(xi.mod.ENMITY, -1) + -- Tick down the effect and reduce the overall power. + local power = effect:getPower() + + -- Handle decay. Minimum values are 10, at which point, decay stops. + if power > 10 then + power = power - 1 + effect:setPower(power) + + target:delMod(xi.mod.NIN_NUKE_BONUS_INNIN, 1) + target:delMod(xi.mod.EVA, -1) + + -- Emnity decay is twice as slow. Minimal value will be 10 at the end of the day. + if power % 2 == 0 then + effect:setSubPower(effect:getSubPower() - 1) + target:delMod(xi.mod.ENMITY, -1) + end end end effectObject.onEffectLose = function(target, effect) - --remove the remaining power - target:delMod(xi.mod.EVA, -effect:getPower()) - target:delMod(xi.mod.ENMITY, -effect:getSubPower()) - + local power = effect:getPower() local jpValue = target:getJobPointLevel(xi.jp.INNIN_EFFECT) + + -- Remove the remaining modifiers. + target:delMod(xi.mod.NIN_NUKE_BONUS_INNIN, power) + target:delMod(xi.mod.EVA, -power) + target:delMod(xi.mod.ENMITY, -effect:getSubPower()) target:delMod(xi.mod.ACC, jpValue) end diff --git a/scripts/effects/multi_strikes.lua b/scripts/effects/multi_strikes.lua index 20c751dc1c0..97c02f35f47 100644 --- a/scripts/effects/multi_strikes.lua +++ b/scripts/effects/multi_strikes.lua @@ -4,14 +4,22 @@ local effectObject = {} effectObject.onEffectGain = function(target, effect) - target:addMod(xi.mod.DOUBLE_ATTACK, effect:getPower()) + if effect:getTier() == 2 then + target:addMod(xi.mod.TRIPLE_ATTACK, effect:getPower()) + else + target:addMod(xi.mod.DOUBLE_ATTACK, effect:getPower()) + end end effectObject.onEffectTick = function(target, effect) end effectObject.onEffectLose = function(target, effect) - target:delMod(xi.mod.DOUBLE_ATTACK, effect:getPower()) + if effect:getTier() == 2 then + target:delMod(xi.mod.TRIPLE_ATTACK, effect:getPower()) + else + target:delMod(xi.mod.DOUBLE_ATTACK, effect:getPower()) + end end return effectObject diff --git a/scripts/enum/animation_strings.lua b/scripts/enum/animation_strings.lua new file mode 100644 index 00000000000..275e3857ed8 --- /dev/null +++ b/scripts/enum/animation_strings.lua @@ -0,0 +1,103 @@ +----------------------------------- +-- Animation strings +----------------------------------- +xi = xi or {} + +--[[ +----------------------------------- +mob:entityAnimationPacket(xi.animationString.STATUS_VISIBLE) +----------------------------------- +The base entity is a mob, and anyone in range to see the mob sees the animation. +We do accept a second argument in this one, for target. +An example of this is the afflictors in Beadeaux, which target the player. + +----------------------------------- +player:entityVisualPacket(xi.animationString.STATUS_VISIBLE) +----------------------------------- +In this, it's a part of the zone itself animating, so player is used as base entity and any player that zones in gets sent the packet to light up that part of the zone. +There is technically an "object" or "entity" but its not ID'd like an NPC, and technically speaking a zone dat is laid out like NPC's are part of it. + +----------------------------------- +SendEntityVisualPacket(ID.npc.GEYSER_OFFSET,xi.animationString.STATUS_VISIBLE) +----------------------------------- +This one is a luautils binding, sending a packet to the entire zone (of whoever is in visual range of the ID specified) on demand. + +These are FOURCC (4 character codes). They will always be 4, not 5+. +For most things you can get away with using the wrong one, and they still just work. +--]] + +xi.animationString = +{ + -- Physical + ATTACK_1 = 'ati0', + ATTACK_2 = 'ati1', + ATTACK_3 = 'ati2', + CRITICAL_HIT = 'chit', + + -- Ranged start + RANGED_SINGING_START = 'lc00', + RANGED_WIND_INSTR_START = 'lc01', + RANGED_STRING_INSTR_START = 'lc02', + RANGED_GUN_START = 'lc03', + RANGED_BOOMERANG_START = 'lc04', + RANGED_BOW_START = 'lc06', + + -- Ranged stop + RANGED_SINGING_STOP = 'ls00', + RANGED_WIND_INSTR_STOP = 'ls01', + RANGED_STRING_INSTR_STOP = 'ls02', + RANGED_GUN_STOP = 'ls03', + RANGED_BOOMERANG_STOP = 'ls04', + RANGED_BOW_STOP = 'ls06', + + -- Casting start + CAST_BLACK_MAGIC_START = 'cabk', + CAST_BLUE_MAGIC_START = 'cabl', + CAST_ITEM_START = 'cait', + CAST_NINJA_START = 'canj', + CAST_SUMMONER_START = 'casm', + CAST_SONG_START = 'caso', + CAST_WHITE_MAGIC_START = 'cawh', + + -- Casting finish + CAST_BLACK_MAGIC_STOP = 'shbk', + CAST_BLUE_MAGIC_STOP = 'shbl', + CAST_ITEM_STOP = 'shit', + CAST_NINJA_STOP = 'shnj', + CAST_SUMMONER_STOP = 'shsm', + CAST_SONG_STOP = 'shso', + CAST_WHITE_MAGIC_STOP = 'shwh', + + -- Actions + JUMP_0 = 'jmp0', + JUMP_1 = 'jmp1', + RESTING_START = 'res0', + RESTING_STOP = 'res2', + SITTING_START = 'sit0', + SITTING_STOP = 'sit2', + + -- Effects + EFFECT_DEATH = 'dead', + EFFECT_SWEATING = 'hitl', + EFFECT_SILENCE = 'sils', + EFFECT_RAISE_PLAYER = 'stnd', + + -- Status + STATUS_VISIBLE = 'deru', + STATUS_DISAPPEAR = 'kesu', + + -- Chests + OPEN_CRATE_GLOW = 'open', + OPEN_CRATE_SMOKE = 'ope1', + OPEN_CRATE = 'ope2', + + -- Doors + OPEN_DOOR = 'smin', + CLOSE_DOOR = 'kmin', + + -- Special animations + SPECIAL_00 = 'sp00', -- Prishe Raise, Selh'teus Lancet, Al'tieu Euvhi (Flowers) sticking to ground, Zdei vertical barriers on, etc... + SPECIAL_10 = 'sp10', -- Zdei vertical barriers off, etc... + SPECIAL_20 = 'sp20', -- Zdei horizontal barriers on, etc... + SPECIAL_30 = 'sp30', -- Zdei horizontal barriers off, etc... +} diff --git a/scripts/enum/helm_type.lua b/scripts/enum/helm_type.lua new file mode 100644 index 00000000000..7fe557d0909 --- /dev/null +++ b/scripts/enum/helm_type.lua @@ -0,0 +1,9 @@ +xi = xi or {} + +xi.helmType = +{ + HARVESTING = 1, + EXCAVATION = 2, + LOGGING = 3, + MINING = 4, +} diff --git a/scripts/enum/item.lua b/scripts/enum/item.lua index b53b20b6264..cee2a727c6f 100644 --- a/scripts/enum/item.lua +++ b/scripts/enum/item.lua @@ -396,6 +396,7 @@ xi.item = SET_OF_GIANT_FISH_BONES = 904, WYVERN_SKULL = 905, STARMITE_SHELL = 906, + COLD_BONE = 907, ADAMANTOISE_SHELL = 908, LUMBERING_HORN = 910, RAMPAGING_HORN = 911, @@ -1977,6 +1978,7 @@ xi.item = COPY_OF_REMS_TALE_CHAPTER_10 = 4073, BONANZA_PEARL = 4089, BOWL_OF_GOBLIN_STEW_880 = 4094, + BISMUTH_SHEET = 4095, FIRE_CRYSTAL = 4096, ICE_CRYSTAL = 4097, WIND_CRYSTAL = 4098, @@ -2224,6 +2226,7 @@ xi.item = WILD_PINEAPPLE = 4598, BLACKENED_TOAD = 4599, LUCKY_EGG = 4600, + WARM_EGG = 4602, SCROLL_OF_DIA_EX = 4606, SCROLL_OF_STONE_EX = 4607, SCROLL_OF_CURE_EX = 4608, @@ -5769,6 +5772,7 @@ xi.item = MITHRAN_FISHING_ROD = 17380, CARBON_FISHING_ROD = 17384, LU_SHANGS_FISHING_ROD = 17386, + TARUTARU_FISHING_ROD = 17387, BAMBOO_FISHING_ROD = 17389, YEW_FISHING_ROD = 17390, WILLOW_FISHING_ROD = 17391, diff --git a/scripts/enum/merit.lua b/scripts/enum/merit.lua index eafd216488a..5797e26a926 100644 --- a/scripts/enum/merit.lua +++ b/scripts/enum/merit.lua @@ -74,15 +74,16 @@ xi.merit = -- HP MAX_HP = meritCategory.HP_MP + 0x00, MAX_MP = meritCategory.HP_MP + 0x02, + MAX_MERIT = meritCategory.HP_MP + 0x04, -- ATTRIBUTES STR = meritCategory.ATTRIBUTES + 0x00, DEX = meritCategory.ATTRIBUTES + 0x02, VIT = meritCategory.ATTRIBUTES + 0x04, - AGI = meritCategory.ATTRIBUTES + 0x08, - INT = meritCategory.ATTRIBUTES + 0x0A, - MND = meritCategory.ATTRIBUTES + 0x0C, - CHR = meritCategory.ATTRIBUTES + 0x0E, + AGI = meritCategory.ATTRIBUTES + 0x06, + INT = meritCategory.ATTRIBUTES + 0x08, + MND = meritCategory.ATTRIBUTES + 0x0A, + CHR = meritCategory.ATTRIBUTES + 0x0C, -- COMBAT SKILLS H2H = meritCategory.COMBAT + 0x00, diff --git a/scripts/enum/mod.lua b/scripts/enum/mod.lua index 401df291650..4b6cf2b619d 100644 --- a/scripts/enum/mod.lua +++ b/scripts/enum/mod.lua @@ -732,7 +732,8 @@ xi.mod = ENH_DRAIN_ASPIR = 315, -- % damage boost to Drain and Aspir SNEAK_ATK_DEX = 830, -- % DEX boost to Sneak Attack (if gear mod, needs to be equipped on hit) TRICK_ATK_AGI = 520, -- % AGI boost to Trick Attack (if gear mod, needs to be equipped on hit) - NIN_NUKE_BONUS = 522, -- magic attack bonus for NIN nukes + NIN_NUKE_BONUS_INNIN = 223, -- Ninjutsu damage multiplier from Innin. + NIN_NUKE_BONUS_GEAR = 522, -- Ninjutsu damage multiplier from gear. Ex: Koga Hatsuburi. DAKEN = 911, -- Chance to throw shuriken on attack AMMO_SWING = 523, -- Extra swing rate w/ ammo (ie. Jailer weapons). Use gearsets, and does nothing for non-players. AMMO_SWING_TYPE = 826, -- For the handedness of the weapon - 1h (1) vs. 2h/h2h (2). h2h can safely use the same function as 2h. @@ -940,6 +941,9 @@ xi.mod = STEP_TP_CONSUMED = 1077, -- Modifies the amount of TP consumed by dancer steps + DAMAGE_LIMIT = 1080, -- Damage Limit increase, found on some traits. It's a flat value added to pDIF (maxpDIF + DL/100) https://www.bg-wiki.com/ffxi/Damage_Limit%2B + DAMAGE_LIMITP = 1081, -- Damage Limit +% increase, found on some gear. It's a multiplier added after flat Damage Limit ((maxpDIF + DL/100)*(100 + DLP/100)/100) https://www.ffxiah.com/forum/topic/56649/physical-damage-limit/ + -- IF YOU ADD ANY NEW MODIFIER HERE, ADD IT IN src/map/modifier.h ASWELL! -- The spares take care of finding the next ID to use so long as we don't forget to list IDs that have been freed up by refactoring. diff --git a/scripts/globals/abyssea/sturdypyxis/chest.lua b/scripts/globals/abyssea/sturdypyxis/chest.lua index 5a27434d6b5..b714a13bd5e 100644 --- a/scripts/globals/abyssea/sturdypyxis/chest.lua +++ b/scripts/globals/abyssea/sturdypyxis/chest.lua @@ -104,7 +104,7 @@ xi.pyxis.removeChest = function(player, npc, addcruor, delay) npcArg:setNpcFlags(3203) npcArg:setLocalVar('SPAWNSTATUS', 0) npcArg:setStatus(xi.status.DISAPPEAR) - npcArg:entityAnimationPacket('kesu') + npcArg:entityAnimationPacket(xi.animationString.STATUS_DISAPPEAR) npc:setUntargetable(false) end) end diff --git a/scripts/globals/abyssea/sturdypyxis/spawn.lua b/scripts/globals/abyssea/sturdypyxis/spawn.lua index b8f2e4a1bf7..9a7f5d163e9 100644 --- a/scripts/globals/abyssea/sturdypyxis/spawn.lua +++ b/scripts/globals/abyssea/sturdypyxis/spawn.lua @@ -537,7 +537,7 @@ local function SetPyxisData(npc, mob, player) npc:setLocalVar('CHESTID', npc:getID()) npc:setPos(mobPos.x, mobPos.y, mobPos.z, mobPos.rot) npc:setStatus(xi.status.NORMAL) - npc:entityAnimationPacket('deru') + npc:entityAnimationPacket(xi.animationString.STATUS_VISIBLE) npc:setAnimationSub(12) xi.pyxis.messageChest(player, ID.text.MONSTER_CONCEALED_CHEST, 0, 0, 0, 0) npc:setModelId(chestModel) diff --git a/scripts/globals/appraisal.lua b/scripts/globals/appraisal.lua index f8317722271..2eb6d8eefa0 100644 --- a/scripts/globals/appraisal.lua +++ b/scripts/globals/appraisal.lua @@ -1615,11 +1615,11 @@ xi.appraisal.assaultChestTrigger = function(player, npc, qItemTable, regItemTabl end end - npc:entityAnimationPacket('open') + npc:entityAnimationPacket(xi.animationString.OPEN_CRATE_GLOW) npc:setLocalVar('open', 1) npc:setUntargetable(true) npc:timer(15000, function(npcArg) - npcArg:entityAnimationPacket('kesu') + npcArg:entityAnimationPacket(xi.animationString.STATUS_DISAPPEAR) end) npc:timer(16000, function(npcArg) diff --git a/scripts/globals/caskets.lua b/scripts/globals/caskets.lua index c9061179e1a..4bf9a839f02 100644 --- a/scripts/globals/caskets.lua +++ b/scripts/globals/caskets.lua @@ -271,7 +271,7 @@ local function setCasketData(player, x, y, z, r, npc, partyID, mobLvl) npc:setLocalVar('[caskets]SPAWNTIME', os.time()) npc:setPos(x, y, z, r) npc:setStatus(xi.status.NORMAL) - npc:entityAnimationPacket('deru') + npc:entityAnimationPacket(xi.animationString.STATUS_VISIBLE) npc:setModelId(chestStyle) sendChestDropMessage(player) ----------------------------------- diff --git a/scripts/globals/combat/physical_utilities.lua b/scripts/globals/combat/physical_utilities.lua index f3b65eda0b2..87505021031 100644 --- a/scripts/globals/combat/physical_utilities.lua +++ b/scripts/globals/combat/physical_utilities.lua @@ -46,7 +46,7 @@ local wsElementalProperties = } -- Table with pDIF caps per weapon/skill type. -local pDifWeaponCapTable = +xi.combat.physical.pDifWeaponCapTable = { -- [Skill/weapon type used] = {pre-randomizer_pDIF_cap}, Values from: https://www.bg-wiki.com/ffxi/PDIF [xi.skill.NONE ] = { 3 }, -- We will use this for mobs. @@ -324,22 +324,26 @@ xi.combat.physical.calculateFTP = function(actor, tpFactor) return fTP end -xi.combat.physical.calculateMeleePDIF = function(actor, target, weaponType, wsAttackMod, isCritical, applyLevelCorrection, tpIgnoresDefense, tpFactor) +-- WARNING: This function is used in src/utils/battleutils.cpp "GetDamageRatio" function. +-- If you update this parameters, update them there aswell. +xi.combat.physical.calculateMeleePDIF = function(actor, target, weaponType, wsAttackMod, isCritical, applyLevelCorrection, tpIgnoresDefense, tpFactor, isWeaponskill) local pDif = 0 ---------------------------------------- -- Step 1: Attack / Defense Ratio ---------------------------------------- local baseRatio = 0 - local actorAttack = math.floor(actor:getStat(xi.mod.ATT) * wsAttackMod) - local targetDefense = target:getStat(xi.mod.DEF) + local actorAttack = math.max(1, math.floor(actor:getStat(xi.mod.ATT) * wsAttackMod)) + local targetDefense = math.max(1, target:getStat(xi.mod.DEF)) - -- Actor Attack modifiers. - if actor:hasStatusEffect(xi.effect.BUILDING_FLOURISH) then - local flourishEffect = actor:getStatusEffect(xi.effect.BUILDING_FLOURISH) + -- Actor Weaponskill Specific Attack modifiers. + if isWeaponskill then + if actor:hasStatusEffect(xi.effect.BUILDING_FLOURISH) then + local flourishEffect = actor:getStatusEffect(xi.effect.BUILDING_FLOURISH) - if flourishEffect:getPower() >= 2 then -- 2 or more Finishing Moves used. - actorAttack = actorAttack + 25 + flourishEffect:getSubPower() + if flourishEffect:getPower() >= 2 then -- 2 or more Finishing Moves used. + actorAttack = actorAttack + 25 + flourishEffect:getSubPower() + end end end @@ -347,11 +351,12 @@ xi.combat.physical.calculateMeleePDIF = function(actor, target, weaponType, wsAt local ignoreDefenseFactor = 1 if tpIgnoresDefense then - ignoreDefenseFactor = tpFactor + ignoreDefenseFactor = 1 - tpFactor end targetDefense = math.floor(targetDefense * ignoreDefenseFactor) + -- Actor Attack / Target Defense ratio baseRatio = actorAttack / targetDefense -- Apply cap to baseRatio. @@ -379,9 +384,12 @@ xi.combat.physical.calculateMeleePDIF = function(actor, target, weaponType, wsAt ---------------------------------------- -- Step 3: wRatio and pDif Caps (Melee) ---------------------------------------- - local wRatio = cRatio + isCritical - local pDifUpperCap = 0 - local pDifLowerCap = 0 + local wRatio = cRatio + (isCritical and 1 or 0) + local pDifUpperCap = 0 + local pDifLowerCap = 0 + local damageLimitPlus = actor:getMod(xi.mod.DAMAGE_LIMIT) / 100 + local damageLimitPercent = 1 + actor:getMod(xi.mod.DAMAGE_LIMITP) / 100 + local pDifFinalCap = (xi.combat.physical.pDifWeaponCapTable[weaponType][1] + damageLimitPlus) * damageLimitPercent + (isCritical and 1 or 0) -- pDIF upper cap. if wRatio < 0.5 then @@ -393,7 +401,7 @@ xi.combat.physical.calculateMeleePDIF = function(actor, target, weaponType, wsAt elseif wRatio < 1.5 then pDifUpperCap = wRatio + wRatio * 0.25 else - pDifUpperCap = utils.clamp(wRatio + 0.375, 1, 3) + pDifUpperCap = math.min(wRatio + 0.375, pDifFinalCap) end -- pDIF lower cap. @@ -414,8 +422,6 @@ xi.combat.physical.calculateMeleePDIF = function(actor, target, weaponType, wsAt ---------------------------------------- -- Step 4: Apply weapon type caps. ---------------------------------------- - local pDifFinalCap = pDifWeaponCapTable[weaponType][1] + isCritical -- TODO: Add 'Damage Limit +' Trait here. - pDif = utils.clamp(pDif, 0, pDifFinalCap) ---------------------------------------- @@ -425,25 +431,35 @@ xi.combat.physical.calculateMeleePDIF = function(actor, target, weaponType, wsAt pDif = pDif * meleeRandom + -- Crit damage bonus is a final modifier + if isCritical then + local critDamageBonus = utils.clamp(actor:getMod(xi.mod.CRIT_DMG_INCREASE) - target:getMod(xi.mod.CRIT_DEF_BONUS), 0, 100) + pDif = pDif * (100 + critDamageBonus) / 100 + end + return pDif end -xi.combat.physical.calculateRangedPDIF = function(actor, target, weaponType, wsAttackMod, isCritical, applyLevelCorrection, tpIgnoresDefense, tpFactor) +xi.combat.physical.calculateRangedPDIF = function(actor, target, weaponType, wsAttackMod, isCritical, applyLevelCorrection, tpIgnoresDefense, tpFactor, isWeaponskill) local pDif = 0 ---------------------------------------- -- Step 1: Attack / Defense Ratio ---------------------------------------- local baseRatio = 0 - local actorAttack = math.floor(actor:getStat(xi.mod.RATT) * wsAttackMod) - local targetDefense = target:getStat(xi.mod.DEF) - - -- Actor Ranged Attack modifiers. - if actor:hasStatusEffect(xi.effect.BUILDING_FLOURISH) then - local flourishEffect = actor:getStatusEffect(xi.effect.BUILDING_FLOURISH) - - if flourishEffect:getPower() >= 2 then -- 2 or more Finishing Moves used. - actorAttack = actorAttack + 25 + flourishEffect:getSubPower() + local actorAttack = math.max(1, math.floor(actor:getStat(xi.mod.RATT) * wsAttackMod)) + local targetDefense = math.max(1, target:getStat(xi.mod.DEF)) + + -- Actor Weaponskill Specific Ranged Attack modifiers. + if isWeaponskill then + -- TODO: verify this actually works on ranged WS. + -- This is a real concern now that RNG/DNC and COR/DNC can actually get level 50 subs through master levels. + if actor:hasStatusEffect(xi.effect.BUILDING_FLOURISH) then + local flourishEffect = actor:getStatusEffect(xi.effect.BUILDING_FLOURISH) + + if flourishEffect:getPower() >= 2 then -- 2 or more Finishing Moves used. + actorAttack = actorAttack + 25 + flourishEffect:getSubPower() + end end end @@ -451,7 +467,7 @@ xi.combat.physical.calculateRangedPDIF = function(actor, target, weaponType, wsA local ignoreDefenseFactor = 1 if tpIgnoresDefense then - ignoreDefenseFactor = tpFactor + ignoreDefenseFactor = 1.0 - tpFactor end targetDefense = math.floor(targetDefense * ignoreDefenseFactor) @@ -505,20 +521,28 @@ xi.combat.physical.calculateRangedPDIF = function(actor, target, weaponType, wsA ---------------------------------------- -- Step 4: Apply weapon type caps. ---------------------------------------- - local pDifFinalCap = pDifWeaponCapTable[weaponType][1] + isCritical -- TODO: Add 'Damage Limit +' Trait here. + local damageLimitPlus = actor:getMod(xi.mod.DAMAGE_LIMIT) / 100 + local damageLimitPercent = (100 + actor:getMod(xi.mod.DAMAGE_LIMITP)) / 100 + local pDifFinalCap = (xi.combat.physical.pDifWeaponCapTable[weaponType][1] + damageLimitPlus) * damageLimitPercent -- Added damage limit bonuses pDif = utils.clamp(pDif, 0, pDifFinalCap) ---------------------------------------- -- Step 5: Ranged critical factor. Bypasses caps. ---------------------------------------- - if isCritical == 1 then + if isCritical then pDif = pDif * 1.25 end -- Step 6: Distance correction and True Shot. -- TODO: Implement distance correction and True shot... + -- Crit damage bonus is a final modifier + if isCritical then + local critDamageBonus = utils.clamp(actor:getMod(xi.mod.CRIT_DMG_INCREASE) - target:getMod(xi.mod.CRIT_DEF_BONUS), 0, 100) + pDif = pDif * (100 + critDamageBonus) / 100 + end + return pDif end diff --git a/scripts/globals/helm.lua b/scripts/globals/helm.lua index 30b34559643..a9755bdc323 100644 --- a/scripts/globals/helm.lua +++ b/scripts/globals/helm.lua @@ -15,14 +15,6 @@ require('scripts/missions/wotg/helpers') xi = xi or {} xi.helm = xi.helm or {} -xi.helm.type = -{ - HARVESTING = 1, - EXCAVATION = 2, - LOGGING = 3, - MINING = 4, -} - ----------------------------------- -- drops are { weight, itemId } -- (R) for retail-verified coordinates @@ -30,7 +22,7 @@ xi.helm.type = local helmInfo = { - [xi.helm.type.HARVESTING] = + [xi.helmType.HARVESTING] = { id = 'HARVESTING', animation = xi.emote.HARVESTING, @@ -344,7 +336,7 @@ local helmInfo = ----------------------------------- - [xi.helm.type.EXCAVATION] = + [xi.helmType.EXCAVATION] = { id = 'EXCAVATION', animation = xi.emote.EXCAVATION, @@ -486,7 +478,7 @@ local helmInfo = ----------------------------------- - [xi.helm.type.LOGGING] = + [xi.helmType.LOGGING] = { id = 'LOGGING', animation = xi.emote.LOGGING, @@ -941,7 +933,7 @@ local helmInfo = ----------------------------------- - [xi.helm.type.MINING] = + [xi.helmType.MINING] = { id = 'MINING', animation = xi.emote.EXCAVATION, @@ -1501,7 +1493,7 @@ xi.helm.result = function(player, helmType, broke, itemID) -- Quest: Vanishing Act if - helmType == xi.helm.type.HARVESTING and + helmType == xi.helmType.HARVESTING and player:getQuestStatus(xi.quest.log_id.AHT_URHGAN, xi.quest.id.ahtUrhgan.VANISHING_ACT) == QUEST_ACCEPTED and not player:hasKeyItem(xi.ki.RAINBOW_BERRY) and broke ~= 1 and diff --git a/scripts/globals/job_utils/corsair.lua b/scripts/globals/job_utils/corsair.lua index 2d1f5fdf618..3bc8e490fcc 100644 --- a/scripts/globals/job_utils/corsair.lua +++ b/scripts/globals/job_utils/corsair.lua @@ -254,7 +254,7 @@ xi.job_utils.corsair.useDoubleUp = function(caster, target, ability, action) caster:setLocalVar('corsairActiveRoll', duEffect:getSubType()) local snakeEye = caster:getStatusEffect(xi.effect.SNAKE_EYE) if snakeEye then - if prevRoll:getPower() >= 5 and math.random(100) < snakeEye:getPower() then + if roll >= 5 and math.random(100) < snakeEye:getPower() then roll = 11 else roll = roll + 1 diff --git a/scripts/globals/job_utils/geomancer.lua b/scripts/globals/job_utils/geomancer.lua index dbf6cbed2b5..95288ea9e90 100644 --- a/scripts/globals/job_utils/geomancer.lua +++ b/scripts/globals/job_utils/geomancer.lua @@ -333,6 +333,8 @@ end xi.job_utils.geomancer.geoOnMagicCastingCheck = function(caster, target, spell) if hasLuopan(caster) then return xi.msg.basic.LUOPAN_ALREADY_PLACED + elseif caster:getPet() then + return xi.msg.basic.ALREADY_HAS_A_PET elseif not caster:canUseMisc(xi.zoneMisc.PET) then return xi.msg.basic.CANT_BE_USED_IN_AREA else diff --git a/scripts/globals/job_utils/summoner.lua b/scripts/globals/job_utils/summoner.lua index 6a325f70efd..089a1d7d984 100644 --- a/scripts/globals/job_utils/summoner.lua +++ b/scripts/globals/job_utils/summoner.lua @@ -35,6 +35,39 @@ local function getBaseMPCost(player, ability) [xi.jobAbility.TIDAL_ROAR] = 138, [xi.jobAbility.SPINNING_DIVE] = 164, [xi.jobAbility.GRAND_FALL] = 182, + -- Garuda + [xi.jobAbility.CLAW] = 7, + [xi.jobAbility.AERO_II] = 24, + [xi.jobAbility.AERIAL_ARMOR] = 92, + [xi.jobAbility.FLEET_WIND] = 114, + [xi.jobAbility.AERO_IV] = 118, + [xi.jobAbility.WHISPERING_WIND] = 119, + [xi.jobAbility.HASTEGA] = 129, + [xi.jobAbility.PREDATOR_CLAWS] = 164, + [xi.jobAbility.WIND_BLADE] = 182, + [xi.jobAbility.HASTEGA_II] = 248, + -- Titan + [xi.jobAbility.ROCK_THROW] = 10, + [xi.jobAbility.STONE_II] = 24, + [xi.jobAbility.ROCK_BUSTER] = 39, + [xi.jobAbility.MEGALITH_THROW] = 62, + [xi.jobAbility.EARTHEN_WARD] = 92, + [xi.jobAbility.STONE_IV] = 118, + [xi.jobAbility.CRAG_THROW] = 124, + [xi.jobAbility.EARTHEN_ARMOR] = 156, + [xi.jobAbility.MOUNTAIN_BUSTER] = 164, + [xi.jobAbility.GEOCRUSH] = 182, + -- Titan + [xi.jobAbility.PUNCH] = 9, + [xi.jobAbility.FIRE_II] = 24, + [xi.jobAbility.BURNING_STRIKE] = 48, + [xi.jobAbility.DOUBLE_PUNCH] = 56, + [xi.jobAbility.INFERNO_HOWL] = 72, + [xi.jobAbility.CRIMSON_HOWL] = 84, + [xi.jobAbility.FIRE_IV] = 118, + [xi.jobAbility.CONFLAG_STRIKE] = 141, + [xi.jobAbility.FLAMING_CRUSH] = 164, + [xi.jobAbility.METEOR_STRIKE] = 182, -- Siren [xi.jobAbility.WELT] = 9, [xi.jobAbility.ROUNDHOUSE] = 52, diff --git a/scripts/globals/mobskills.lua b/scripts/globals/mobskills.lua index e116e38a213..28351e67bea 100644 --- a/scripts/globals/mobskills.lua +++ b/scripts/globals/mobskills.lua @@ -230,6 +230,11 @@ xi.mobskills.mobPhysicalMove = function(mob, target, skill, numHits, accMod, dmg finaldmg = 0 hitslanded = 0 skill:setMsg(xi.msg.basic.SKILL_MISS) + -- calculate tp return of mob skill + else + local tpReturn = xi.combat.tp.getSingleMeleeHitTPReturn(mob, target) + tpReturn = tpReturn + 10 * (hitslanded - 1) -- extra hits give 10 TP each + mob:addTP(tpReturn) end returninfo.dmg = finaldmg @@ -297,6 +302,12 @@ xi.mobskills.mobMagicalMove = function(mob, target, skill, damage, element, dmgm finaldmg = finaldmg * resist * magicDefense returninfo.dmg = finaldmg + -- magical mob skills are single hit so provide single Melee hit TP return + if finaldmg > 0 then + local tpReturn = xi.combat.tp.getSingleMeleeHitTPReturn(mob, target) + mob:addTP(tpReturn) + end + return returninfo end @@ -441,6 +452,12 @@ xi.mobskills.mobBreathMove = function(mob, target, percent, base, element, cap) damage = utils.clamp(utils.stoneskin(target, damage), -99999, 99999) end + -- breath mob skills are single hit so provide single Melee hit TP return + if damage > 0 then + local tpReturn = xi.combat.tp.getSingleMeleeHitTPReturn(mob, target) + mob:addTP(tpReturn) + end + return damage end diff --git a/scripts/globals/npc_util.lua b/scripts/globals/npc_util.lua index 04e8d42a79a..eae660307e5 100644 --- a/scripts/globals/npc_util.lua +++ b/scripts/globals/npc_util.lua @@ -961,7 +961,7 @@ end function npcUtil.disappearCrate(crate) if crate:isNPC() then - crate:entityAnimationPacket('kesu') + crate:entityAnimationPacket(xi.animationString.STATUS_DISAPPEAR) crate:timer(3000, function(npc) npc:setUntargetable(true) npc:setStatus(xi.status.DISAPPEAR) @@ -979,7 +979,7 @@ function npcUtil.openCrate(crate, callback) if crate:getLocalVar('opened') == 0 then crate:setLocalVar('opened', 1) local shouldDisappear = not callback() - crate:entityAnimationPacket('openH') + crate:entityAnimationPacket(xi.animationString.OPEN_CRATE_GLOW) if shouldDisappear then crate:timer(7000, function(npc) diff --git a/scripts/globals/nyzul.lua b/scripts/globals/nyzul.lua index 2c89356dff2..679fd1fdfe0 100644 --- a/scripts/globals/nyzul.lua +++ b/scripts/globals/nyzul.lua @@ -278,11 +278,11 @@ xi.nyzul.handleAppraisalItem = function(player, npc) players:messageName(ID.text.PLAYER_OBTAINS_ITEM, player, itemID) end - npc:entityAnimationPacket('open') + npc:entityAnimationPacket(xi.animationString.OPEN_CRATE_GLOW) npc:setLocalVar('opened', 1) npc:setUntargetable(true) npc:queue(10000, function(npcvar) - npcvar:entityAnimationPacket('kesu') + npcvar:entityAnimationPacket(xi.animationString.STATUS_DISAPPEAR) end) npc:queue(12000, function(npcvar) @@ -299,7 +299,7 @@ end xi.nyzul.tempBoxTrigger = function(player, npc) if npc:getLocalVar('itemsPicked') == 0 then npc:setLocalVar('itemsPicked', 1) - npc:entityAnimationPacket('open') + npc:entityAnimationPacket(xi.animationString.OPEN_CRATE_GLOW) npc:setAnimationSub(13) xi.nyzul.tempBoxPickItems(npc) end @@ -420,7 +420,7 @@ xi.nyzul.tempBoxFinish = function(player, csid, option, npc) npc:getLocalVar('itemAmount_3') == 0 then npc:queue(10000, function(npcvar) - npcvar:entityAnimationPacket('kesu') + npcvar:entityAnimationPacket(xi.animationString.STATUS_DISAPPEAR) end) npc:queue(12000, function(npcvar) diff --git a/scripts/globals/pets/wyvern.lua b/scripts/globals/pets/wyvern.lua index 95d4c9d7716..45eecd0af28 100644 --- a/scripts/globals/pets/wyvern.lua +++ b/scripts/globals/pets/wyvern.lua @@ -17,34 +17,36 @@ local wyvernCapabilities = local wyvernTypes = { - [xi.job.WAR] = wyvernCapabilities.OFFENSIVE, - [xi.job.MNK] = wyvernCapabilities.OFFENSIVE, - [xi.job.WHM] = wyvernCapabilities.DEFENSIVE, - [xi.job.BLM] = wyvernCapabilities.DEFENSIVE, - [xi.job.RDM] = wyvernCapabilities.DEFENSIVE, - [xi.job.THF] = wyvernCapabilities.OFFENSIVE, - [xi.job.PLD] = wyvernCapabilities.MULTI, - [xi.job.DRK] = wyvernCapabilities.MULTI, - [xi.job.BST] = wyvernCapabilities.OFFENSIVE, - [xi.job.BRD] = wyvernCapabilities.MULTI, - [xi.job.RNG] = wyvernCapabilities.OFFENSIVE, - [xi.job.SAM] = wyvernCapabilities.OFFENSIVE, - [xi.job.NIN] = wyvernCapabilities.MULTI, - [xi.job.DRG] = wyvernCapabilities.OFFENSIVE, - [xi.job.SMN] = wyvernCapabilities.DEFENSIVE, - [xi.job.BLU] = wyvernCapabilities.DEFENSIVE, - [xi.job.COR] = wyvernCapabilities.OFFENSIVE, - [xi.job.PUP] = wyvernCapabilities.OFFENSIVE, - [xi.job.DNC] = wyvernCapabilities.OFFENSIVE, - [xi.job.SCH] = wyvernCapabilities.DEFENSIVE, - [xi.job.GEO] = wyvernCapabilities.DEFENSIVE, - [xi.job.RUN] = wyvernCapabilities.MULTI, + [xi.job.NONE] = wyvernCapabilities.OFFENSIVE, + [xi.job.WAR] = wyvernCapabilities.OFFENSIVE, + [xi.job.MNK] = wyvernCapabilities.OFFENSIVE, + [xi.job.WHM] = wyvernCapabilities.DEFENSIVE, + [xi.job.BLM] = wyvernCapabilities.DEFENSIVE, + [xi.job.RDM] = wyvernCapabilities.DEFENSIVE, + [xi.job.THF] = wyvernCapabilities.OFFENSIVE, + [xi.job.PLD] = wyvernCapabilities.MULTI, + [xi.job.DRK] = wyvernCapabilities.MULTI, + [xi.job.BST] = wyvernCapabilities.OFFENSIVE, + [xi.job.BRD] = wyvernCapabilities.MULTI, + [xi.job.RNG] = wyvernCapabilities.OFFENSIVE, + [xi.job.SAM] = wyvernCapabilities.OFFENSIVE, + [xi.job.NIN] = wyvernCapabilities.MULTI, + [xi.job.DRG] = wyvernCapabilities.OFFENSIVE, + [xi.job.SMN] = wyvernCapabilities.DEFENSIVE, + [xi.job.BLU] = wyvernCapabilities.DEFENSIVE, + [xi.job.COR] = wyvernCapabilities.OFFENSIVE, + [xi.job.PUP] = wyvernCapabilities.OFFENSIVE, + [xi.job.DNC] = wyvernCapabilities.OFFENSIVE, + [xi.job.SCH] = wyvernCapabilities.DEFENSIVE, + [xi.job.GEO] = wyvernCapabilities.DEFENSIVE, + [xi.job.RUN] = wyvernCapabilities.MULTI, } local function doHealingBreath(player, threshold) local breathHealRange = 14 local healingbreath = xi.jobAbility.HEALING_BREATH + local wyvernType = wyvernTypes[player:getSubJob()] if player:getMainLvl() >= 80 then healingbreath = xi.jobAbility.HEALING_BREATH_IV @@ -64,7 +66,7 @@ local function doHealingBreath(player, threshold) inBreathRange(player) then player:getPet():useJobAbility(healingbreath, player) - else + elseif wyvernType == wyvernCapabilities.DEFENSIVE then local party = player:getPartyWithTrusts() for _, member in pairs(party) do if @@ -92,6 +94,8 @@ local function doStatusBreath(target, player) { 1, xi.jobAbility.REMOVE_POISON , { xi.effect.POISON } }, } + local breathRange = 14 + for k, v in pairs(removeBreathTable) do local minLevel = v[1] local ability = v[2] @@ -99,7 +103,10 @@ local function doStatusBreath(target, player) if wyvern:getMainLvl() >= minLevel then for _, effect in pairs(statusEffects) do - if target:hasStatusEffect(effect) then + if + target:hasStatusEffect(effect) and + wyvern:checkDistance(target) <= breathRange + then wyvern:useJobAbility(ability, target) return true end diff --git a/scripts/globals/quests.lua b/scripts/globals/quests.lua index cbb004a997f..5a7b07010e5 100644 --- a/scripts/globals/quests.lua +++ b/scripts/globals/quests.lua @@ -337,7 +337,7 @@ xi.quest.id = CRYING_OVER_ONIONS = 76, -- + Converted WILD_CARD = 77, -- + Converted THE_PROMISE = 78, -- + Converted - NOTHING_MATTERS = 79, + NOTHING_MATTERS = 79, -- + Converted TORAIMARAI_TURMOIL = 80, -- + THE_PUPPET_MASTER = 81, -- + Converted CLASS_REUNION = 82, -- + diff --git a/scripts/globals/spells/damage_spell.lua b/scripts/globals/spells/damage_spell.lua index 89022748683..1062dc56006 100644 --- a/scripts/globals/spells/damage_spell.lua +++ b/scripts/globals/spells/damage_spell.lua @@ -159,27 +159,27 @@ local pTable = [xi.magic.spell.WATERA_III ] = { xi.mod.INT, 0, 660, 1.5, 660, 700, 4.7, 3.9, 2.95, 1.99, 1, 0, 0 }, -- No info found. Since Watera I and II N Values coincided with Waterga 1 and II, used Values of Waterga III. [xi.magic.spell.WATERJA ] = { xi.mod.INT, 0, 782, 2.3, 800, 900, 5.6, 4.75, 3.95, 3, 2, 1, 0 }, -- Some values not found. Used guesstimates for M200 and M300. --- Ninjutsu spells: +-- Ninjutsu spells: https://www.ffxiah.com/forum/topic/56749/updated-ninjutsu-damage-formulae/ -- 1 2 3 4 5 6 7 --- Structure: [spellId] = { Stat used, mAcc, vNPC, M, vPC, I, M0 }, -- Inflexion point unknown. Set to 50, 150 and 300, for now. - [xi.magic.spell.DOTON_ICHI ] = { xi.mod.INT, 0, 28, 0.5, 28, 50, 0 }, - [xi.magic.spell.DOTON_NI ] = { xi.mod.INT, 0, 68, 1, 68, 150, 0 }, - [xi.magic.spell.DOTON_SAN ] = { xi.mod.INT, 0, 134, 1.5, 134, 300, 0 }, - [xi.magic.spell.HUTON_ICHI ] = { xi.mod.INT, 0, 28, 0.5, 28, 50, 0 }, - [xi.magic.spell.HUTON_NI ] = { xi.mod.INT, 0, 68, 1, 68, 150, 0 }, - [xi.magic.spell.HUTON_SAN ] = { xi.mod.INT, 0, 134, 1.5, 134, 300, 0 }, - [xi.magic.spell.HYOTON_ICHI ] = { xi.mod.INT, 0, 28, 0.5, 28, 50, 0 }, - [xi.magic.spell.HYOTON_NI ] = { xi.mod.INT, 0, 68, 1, 68, 150, 0 }, - [xi.magic.spell.HYOTON_SAN ] = { xi.mod.INT, 0, 134, 1.5, 134, 300, 0 }, - [xi.magic.spell.KATON_ICHI ] = { xi.mod.INT, 0, 28, 0.5, 28, 50, 0 }, - [xi.magic.spell.KATON_NI ] = { xi.mod.INT, 0, 68, 1, 68, 150, 0 }, - [xi.magic.spell.KATON_SAN ] = { xi.mod.INT, 0, 134, 1.5, 134, 300, 0 }, - [xi.magic.spell.RAITON_ICHI ] = { xi.mod.INT, 0, 28, 0.5, 28, 50, 0 }, - [xi.magic.spell.RAITON_NI ] = { xi.mod.INT, 0, 68, 1, 68, 150, 0 }, - [xi.magic.spell.RAITON_SAN ] = { xi.mod.INT, 0, 134, 1.5, 134, 300, 0 }, - [xi.magic.spell.SUITON_ICHI ] = { xi.mod.INT, 0, 28, 0.5, 28, 50, 0 }, - [xi.magic.spell.SUITON_NI ] = { xi.mod.INT, 0, 68, 1, 68, 150, 0 }, - [xi.magic.spell.SUITON_SAN ] = { xi.mod.INT, 0, 134, 1.5, 134, 300, 0 }, +-- Structure: [spellId] = { Stat used, mAcc, vNPC, M, vPC, I, M0 }, + [xi.magic.spell.DOTON_ICHI ] = { xi.mod.INT, 0, 16, 1, 16, 25, 0 }, + [xi.magic.spell.DOTON_NI ] = { xi.mod.INT, 0, 69, 1, 69, 113, 0 }, + [xi.magic.spell.DOTON_SAN ] = { xi.mod.INT, 0, 134, 2, 134, 118, 0 }, + [xi.magic.spell.HUTON_ICHI ] = { xi.mod.INT, 0, 16, 1, 16, 25, 0 }, + [xi.magic.spell.HUTON_NI ] = { xi.mod.INT, 0, 69, 1, 69, 113, 0 }, + [xi.magic.spell.HUTON_SAN ] = { xi.mod.INT, 0, 134, 2, 134, 118, 0 }, + [xi.magic.spell.HYOTON_ICHI ] = { xi.mod.INT, 0, 16, 1, 16, 25, 0 }, + [xi.magic.spell.HYOTON_NI ] = { xi.mod.INT, 0, 69, 1, 69, 113, 0 }, + [xi.magic.spell.HYOTON_SAN ] = { xi.mod.INT, 0, 134, 2, 134, 118, 0 }, + [xi.magic.spell.KATON_ICHI ] = { xi.mod.INT, 0, 16, 1, 16, 25, 0 }, + [xi.magic.spell.KATON_NI ] = { xi.mod.INT, 0, 69, 1, 69, 113, 0 }, + [xi.magic.spell.KATON_SAN ] = { xi.mod.INT, 0, 134, 2, 134, 118, 0 }, + [xi.magic.spell.RAITON_ICHI ] = { xi.mod.INT, 0, 16, 1, 16, 25, 0 }, + [xi.magic.spell.RAITON_NI ] = { xi.mod.INT, 0, 69, 1, 69, 113, 0 }, + [xi.magic.spell.RAITON_SAN ] = { xi.mod.INT, 0, 134, 2, 134, 118, 0 }, + [xi.magic.spell.SUITON_ICHI ] = { xi.mod.INT, 0, 16, 1, 16, 25, 0 }, + [xi.magic.spell.SUITON_NI ] = { xi.mod.INT, 0, 69, 1, 69, 113, 0 }, + [xi.magic.spell.SUITON_SAN ] = { xi.mod.INT, 0, 134, 2, 134, 118, 0 }, -- Divine spells: https://nw6yx36onohv5j6wmzoba3nllq-ac4c6men2g7xr2a-wiki-ffo-jp.translate.goog/html/1963.html -- 1 2 3 4 5 6 7 @@ -486,7 +486,7 @@ xi.spells.damage.calculateIfMagicBurstBonus = function(caster, target, spellId, -- Obtain multiplier from gear, atma and job traits -- Job traits should be done separately modBurst = modBurst + (caster:getMod(xi.mod.MAG_BURST_BONUS) / 100) + ancientMagicBurstBonus - -- Apply Innin bonus + -- Apply Innin Magic Burst bonus if caster:isBehind(target) and caster:hasStatusEffect(xi.effect.INNIN) then modBurst = modBurst + (caster:getMerit(xi.merit.INNIN_EFFECT) / 100) end @@ -583,7 +583,7 @@ xi.spells.damage.calculateMagicBonusDiff = function(caster, target, spellId, ski if spellId >= xi.magic.spell.KATON_ICHI and spellId <= xi.magic.spell.KATON_SAN - then -- Katon series. + then mab = mab + caster:getMerit(xi.merit.KATON_EFFECT) elseif spellId >= xi.magic.spell.HYOTON_ICHI and @@ -611,6 +611,9 @@ xi.spells.damage.calculateMagicBonusDiff = function(caster, target, spellId, ski then mab = mab + caster:getMerit(xi.merit.SUITON_EFFECT) end + + -- "Enhances ninjutsu damage" ("Koga Hatsuburi" type gear) + mab = mab + caster:getMod(xi.mod.NIN_NUKE_BONUS_INNIN) end if math.random(1, 100) <= mabCrit then @@ -747,16 +750,27 @@ end xi.spells.damage.calculateNinSkillBonus = function(caster, spellId, skillType) local ninSkillBonus = 1 + local skillCaps = + { + -- Tier = { Min skill, Max skill} + [1] = { 50, 250 }, + [2] = { 125, 350 }, + [3] = { 275, 500 }, + } + if skillType == xi.skill.NINJUTSU and caster:getMainJob() == xi.job.NIN then + -- Get spell tier. + local spellTier = 3 + if spellId % 3 == 2 then -- Ichi nuke spell ids are 320, 323, 326, 329, 332, and 335 - ninSkillBonus = 100 + math.floor((caster:getSkillLevel(xi.skill.NINJUTSU) - 50) / 2) + spellTier = 1 elseif spellId % 3 == 0 then -- Ni nuke spell ids are 1 more than their corresponding Ichi spell - ninSkillBonus = 100 + math.floor((caster:getSkillLevel(xi.skill.NINJUTSU) - 125) / 2) - else -- San nuke spell, also has ids 1 more than their corresponding Ni spell - ninSkillBonus = 100 + math.floor((caster:getSkillLevel(xi.skill.NINJUTSU) - 275) / 2) + spellTier = 2 end - ninSkillBonus = utils.clamp(ninSkillBonus / 100, 1, 2) -- bonus caps at +100%, and does not go negative + -- Get skill bonus. + local skillLevel = utils.clamp(caster:getSkillLevel(xi.skill.NINJUTSU), skillCaps[spellTier][1], skillCaps[spellTier][2]) + ninSkillBonus = 1 + (skillLevel - skillCaps[spellTier][1]) / 200 end return ninSkillBonus @@ -776,6 +790,21 @@ xi.spells.damage.calculateNinFutaeBonus = function(caster, skillType) return ninFutaeBonus end +xi.spells.damage.calculateNinjutsuMultiplier = function(caster, target, skillType) + local ninjutsuMultiplier = 1 + + -- Ninjutsu damage multiplier from Innin. + if + skillType == xi.skill.NINJUTSU and + caster:hasStatusEffect(xi.effect.INNIN) and + caster:isBehind(target) + then + ninjutsuMultiplier = 1 + caster:getMod(xi.mod.NIN_NUKE_BONUS_INNIN) / 100 + end + + return ninjutsuMultiplier +end + xi.spells.damage.calculateUndeadDivinePenalty = function(target, skillType) local undeadDivinePenalty = 1 @@ -924,6 +953,7 @@ xi.spells.damage.useDamageSpell = function(caster, target, spell) local skillTypeMultiplier = xi.spells.damage.calculateSkillTypeMultiplier(skillType) local ninSkillBonus = xi.spells.damage.calculateNinSkillBonus(caster, spellId, skillType) local ninFutaeBonus = xi.spells.damage.calculateNinFutaeBonus(caster, skillType) + local ninjutsuMultiplier = xi.spells.damage.calculateNinjutsuMultiplier(caster, target, skillType) local undeadDivinePenalty = xi.spells.damage.calculateUndeadDivinePenalty(target, skillType) local scarletDeliriumMultiplier = xi.spells.damage.calculateScarletDeliriumMultiplier(caster) local helixMeritMultiplier = xi.spells.damage.calculateHelixMeritMultiplier(caster, spellId) @@ -947,6 +977,7 @@ xi.spells.damage.useDamageSpell = function(caster, target, spell) finalDamage = math.floor(finalDamage * skillTypeMultiplier) finalDamage = math.floor(finalDamage * ninSkillBonus) finalDamage = math.floor(finalDamage * ninFutaeBonus) + finalDamage = math.floor(finalDamage * ninjutsuMultiplier) finalDamage = math.floor(finalDamage * undeadDivinePenalty) finalDamage = math.floor(finalDamage * scarletDeliriumMultiplier) finalDamage = math.floor(finalDamage * helixMeritMultiplier) diff --git a/scripts/globals/spells/enfeebling_spell.lua b/scripts/globals/spells/enfeebling_spell.lua index 98e9abd8dc7..0dead8d8790 100644 --- a/scripts/globals/spells/enfeebling_spell.lua +++ b/scripts/globals/spells/enfeebling_spell.lua @@ -240,7 +240,7 @@ xi.spells.enfeebling.calculatePotency = function(caster, target, spellId, spellE potency = math.floor(potency) - -- Apply Saboteur Effect when aplicable. + -- Apply Saboteur Effect when applicable. local applySaboteur = pTable[spellId][11] if @@ -455,12 +455,12 @@ xi.spells.enfeebling.useEnfeeblingSpell = function(caster, target, spell) target:isMob() and immunobreakTable[spellEffect] and -- Only certain effects can be immunobroken. skillType == xi.skill.ENFEEBLING_MAGIC and -- Only Enfeebling magic can immunobreak. - resistRank > 4 -- Only mobs with a resistace rank of 5+ (50% EEM) can be immunobroken. + resistRank > 4 -- Only mobs with a resistance rank of 5+ (50% EEM) can be immunobroken. then local immunobreakRandom = math.random(1, 100) local immunobreakChance = magicHitRate / (1 + rankModifier) + caster:getMerit(xi.merit.IMMUNOBREAK_CHANCE) - -- We successfuly trigger Immunobreak. Change tagret modifier and set correct message. + -- We successfully trigger Immunobreak. Change target modifier and set correct message. if immunobreakRandom <= immunobreakChance then target:setMod(immunobreakTable[spellEffect][1], rankModifier + 1) -- TODO: Add equipment modifier (x2) here. diff --git a/scripts/globals/spells/enhancing_spell.lua b/scripts/globals/spells/enhancing_spell.lua index 0a8d39b07bd..7fc15c56ffc 100644 --- a/scripts/globals/spells/enhancing_spell.lua +++ b/scripts/globals/spells/enhancing_spell.lua @@ -175,7 +175,7 @@ local pTable = -- Temper [xi.magic.spell.TEMPER ] = { 1, xi.effect.MULTI_STRIKES, 95, 5, 180, true, false, 0 }, - -- [xi.magic.spell.TEMPER_II ] = { 2, 0 , 99, 5, 180, true, false, 0 }, + [xi.magic.spell.TEMPER_II ] = { 2, xi.effect.MULTI_STRIKES, 99, 5, 180, true, false, 0 }, } -- Enhancing Spell Base Potency function. diff --git a/scripts/globals/weaponskills.lua b/scripts/globals/weaponskills.lua index 234e4ff2893..50264f9fd15 100644 --- a/scripts/globals/weaponskills.lua +++ b/scripts/globals/weaponskills.lua @@ -217,6 +217,8 @@ local function cRangedRatio(attacker, defender, params, ignoredDef, tp) cratio = (cratio - levelCorrection) * atkMultiplier -- adding cap check base on weapon https://www.bg-wiki.com/ffxi/PDIF info + local damageLimitPlus = attacker:getMod(xi.mod.DAMAGE_LIMIT) / 100 + local damageLimitPercent = (100 + attacker:getMod(xi.mod.DAMAGE_LIMITP)) / 100 local weaponType = attacker:getWeaponSkillType(xi.slot.RANGED) local cRatioCap = 3.25 -- Archery @@ -224,6 +226,8 @@ local function cRangedRatio(attacker, defender, params, ignoredDef, tp) cRatioCap = 3.5 end + cRatioCap = (cRatioCap + damageLimitPlus) * damageLimitPercent -- Damage Limit calc + cratio = utils.clamp(cratio, 0, cRatioCap) -- max @@ -1153,6 +1157,7 @@ end -- Given the raw ratio value (atk/def) and levels, returns the cRatio (min then max) xi.weaponskills.cMeleeRatio = function(attacker, defender, params, ignoredDef, tp) + local weaponType = attacker:getWeaponSkillType(xi.slot.MAIN) local flourishEffect = attacker:getStatusEffect(xi.effect.BUILDING_FLOURISH) if flourishEffect ~= nil and flourishEffect:getPower() >= 2 then -- 2 or more Finishing Moves used. @@ -1162,8 +1167,7 @@ xi.weaponskills.cMeleeRatio = function(attacker, defender, params, ignoredDef, t local atkMultiplier = xi.weaponskills.fTP(tp, params.atkVaries) local cratio = attacker:getStat(xi.mod.ATT) * atkMultiplier / (defender:getStat(xi.mod.DEF) - ignoredDef) - cratio = utils.clamp(cratio, 0, 2.25) - + -- cratio = utils.clamp(cratio, 0, 2.25) if flourishEffect ~= nil and flourishEffect:getPower() >= 2 then -- 2 or more Finishing Moves used. attacker:delMod(xi.mod.ATTP, 25 + flourishEffect:getSubPower()) end @@ -1174,10 +1178,15 @@ xi.weaponskills.cMeleeRatio = function(attacker, defender, params, ignoredDef, t end cratio = math.max(0, cratio - levelCorrection) + local damageLimitPlus = attacker:getMod(xi.mod.DAMAGE_LIMIT) / 100 + local damageLimitPercent = (100 + attacker:getMod(xi.mod.DAMAGE_LIMITP)) / 100 + local cratioCap = (xi.combat.physical.pDifWeaponCapTable[weaponType][1] + damageLimitPlus) * damageLimitPercent -- Added damage limit bonuses + + cratio = utils.clamp(cratio, 0, cratioCap) local pdif = getMeleePDifRange(cratio) cratio = cratio + 1 - cratio = utils.clamp(cratio, 0, 3) + cratio = utils.clamp(cratio, 0, cratioCap) local unadjustedPDifCrit = getMeleePDifRange(cratio) local critbonus = utils.clamp(attacker:getMod(xi.mod.CRIT_DMG_INCREASE) - defender:getMod(xi.mod.CRIT_DEF_BONUS), 0, 100) diff --git a/scripts/missions/amk/helpers.lua b/scripts/missions/amk/helpers.lua index 5cfa5eb6d19..a185ed501c2 100644 --- a/scripts/missions/amk/helpers.lua +++ b/scripts/missions/amk/helpers.lua @@ -38,21 +38,21 @@ xi.amk.helpers.helmTrade = function(player, helmType, broke) broke ~= 1 then if - helmType == xi.helm.type.MINING and + helmType == xi.helmType.MINING and not player:hasKeyItem(xi.ki.STURDY_METAL_STRIP) and validRegions[regionId] and math.random(1, 100) <= amkChance then npcUtil.giveKeyItem(player, xi.ki.STURDY_METAL_STRIP) elseif - helmType == xi.helm.type.LOGGING and + helmType == xi.helmType.LOGGING and not player:hasKeyItem(xi.ki.PIECE_OF_RUGGED_TREE_BARK) and validRegions[regionId] and math.random(1, 100) <= amkChance then npcUtil.giveKeyItem(player, xi.ki.PIECE_OF_RUGGED_TREE_BARK) elseif - helmType == xi.helm.type.HARVESTING and + helmType == xi.helmType.HARVESTING and not player:hasKeyItem(xi.ki.SAVORY_LAMB_ROAST) and validRegions[regionId] and math.random(1, 100) <= amkChance diff --git a/scripts/missions/soa/2_2_2_In_the_Presence_of_Royalty.lua b/scripts/missions/soa/2_2_2_In_the_Presence_of_Royalty.lua index 9cc06df4731..be49e1443f7 100644 --- a/scripts/missions/soa/2_2_2_In_the_Presence_of_Royalty.lua +++ b/scripts/missions/soa/2_2_2_In_the_Presence_of_Royalty.lua @@ -31,7 +31,7 @@ mission.sections = -- { -- onTrade = function(player, npc, trade) -- -- TODO: CSID for YORCIA_WEALD - -- xi.helm.onTrade(player, npc, trade, xi.helm.type.HARVESTING, nil, nil) + -- xi.helm.onTrade(player, npc, trade, xi.helmType.HARVESTING, nil, nil) -- return mission:keyItem(xi.ki.YORCIAS_TEAR) -- end, -- }, diff --git a/scripts/missions/wotg/helpers.lua b/scripts/missions/wotg/helpers.lua index 44db1feb9d4..5b5d90e637b 100644 --- a/scripts/missions/wotg/helpers.lua +++ b/scripts/missions/wotg/helpers.lua @@ -83,7 +83,7 @@ xi.wotg.helpers.helmTrade = function(player, helmType, broke) local zoneId = player:getZoneID() if - helmType == xi.helm.type.LOGGING and + helmType == xi.helmType.LOGGING and broke ~= 1 and math.random(1, 100) < wotgChance then diff --git a/scripts/mixins/fomor_hate.lua b/scripts/mixins/fomor_hate.lua index 090e66e3193..ef828b90c02 100644 --- a/scripts/mixins/fomor_hate.lua +++ b/scripts/mixins/fomor_hate.lua @@ -15,6 +15,12 @@ g_mixins.fomor_hate = function(fomorMob) adj = 2 -- default: most fomor add 2 hate end + -- if not a fomor then decrease hate instead of increase + -- Note cannot use negatives in fomorHateAdj because local vars can only be positive + if mob:getFamily() ~= 115 and mob:getFamily() ~= 359 then + adj = -adj + end + member:setCharVar('FOMOR_HATE', utils.clamp(hate + adj, 0, 60)) end end diff --git a/scripts/quests/adoulin/Flavors_of_Our_Lives.lua b/scripts/quests/adoulin/Flavors_of_Our_Lives.lua index fb642997bf0..ea5dfed2bfa 100644 --- a/scripts/quests/adoulin/Flavors_of_Our_Lives.lua +++ b/scripts/quests/adoulin/Flavors_of_Our_Lives.lua @@ -174,7 +174,7 @@ quest.sections = { onTrade = function(player, npc, trade) -- TODO: CSID for YAHSE_HUNTING_GROUNDS - xi.helm.onTrade(player, npc, trade, xi.helm.type.HARVESTING, nil, nil) + xi.helm.onTrade(player, npc, trade, xi.helmType.HARVESTING, nil, nil) return quest:keyItem(xi.ki.BLIGHTBERRY) end, }, diff --git a/scripts/quests/windurst/Nothing_Matters.lua b/scripts/quests/windurst/Nothing_Matters.lua new file mode 100644 index 00000000000..cf54915251a --- /dev/null +++ b/scripts/quests/windurst/Nothing_Matters.lua @@ -0,0 +1,320 @@ +----------------------------------- +-- Nothing Matters +----------------------------------- +-- Log ID: 2, Quest ID: 79 +-- Koru-Moru : !pos -120 -6 124 239 +-- Bonchacha : !gotoid 17756196 +-- Maan-Pokuun : !gotoid 17756195 +-- Yoran-Oran : !pos -110 -14 203 239 +-- Shantotto : !pos 122 -2 112 239 +-- Fuepepe : !pos 161 -2 161 238 +-- Acolyte Hostel : !gotoid 17752275 +----------------------------------- +-- !addquest 2 79 +-- !additem 4602 +-- !additem 907 +----------------------------------- +local windurstWatersID = zones[xi.zone.WINDURST_WATERS] +----------------------------------- + +local quest = Quest:new(xi.quest.log_id.WINDURST, xi.quest.id.windurst.NOTHING_MATTERS) + +quest.reward = +{ + title = xi.title.SEEKER_OF_TRUTH, + gil = 10000 +} + +quest.sections = +{ + { + check = function(player, status, vars) + return status == QUEST_AVAILABLE and + player:hasCompletedQuest(xi.quest.log_id.WINDURST, xi.quest.id.windurst.BLAST_FROM_THE_PAST) and + not xi.quest.getMustZone(player, xi.quest.log_id.WINDURST, xi.quest.id.windurst.NOTHING_MATTERS) and + player:getFameLevel(xi.quest.fame_area.WINDURST) >= 8 + end, + + [xi.zone.WINDURST_WALLS] = + { + ['Koru-Moru'] = + { + onTrigger = function(player, npc) + return quest:event(227):importantOnce() -- start quest non-blocking + end, + }, + + onEventFinish = + { + [227] = function(player, csid, option, npc) + if option == 0 then + quest:begin(player) + end + end + }, + }, + }, + + { + check = function(player, status, vars) + return status == QUEST_ACCEPTED + end, + + [xi.zone.WINDURST_WALLS] = + { + ['Koru-Moru'] = + { + onTrigger = function(player, npc) + local prog = quest:getVar(player, 'Prog') + if prog <= 1 then + return quest:event(228):importantOnce() -- reminder to find an alchemist + elseif + prog == 2 and + player:hasKeyItem(xi.ki.THESIS_ON_ALCHEMY) + then + return quest:progressEvent(237) -- turn in paper, Koru-Moru asks adventurer to find lifeforce and power of death + elseif prog == 3 then + return quest:event(238):importantOnce() -- reminder to find lifeforce and power of death + elseif prog == 4 then + if os.time() > quest:getVar(player, 'Wait') then + return quest:progressEvent(242) -- complete quest + else + return quest:event(241):importantOnce() -- impatient adventurer check before time gate + end + end + end, + + onTrade = function(player, npc, trade) + if + npcUtil.tradeHas(trade, { xi.item.WARM_EGG, xi.item.COLD_BONE }) and + quest:getVar(player, 'Prog') == 3 + then + return quest:progressEvent(239, 0, xi.item.WARM_EGG, xi.item.COLD_BONE) + end + end, + }, + + ['Bonchacha'] = + { + onTrigger = function(player, npc) + if quest:getVar(player, 'Prog') <= 3 then + return quest:event(229):importantOnce() -- optional dialogue pre item turnin + end + end + }, + + ['Maan-Pokuun'] = + { + onTrigger = function(player, npc) + if quest:getVar(player, 'Prog') <= 3 then + return quest:event(230):importantOnce() -- optional dialogue pre item turnin + end + end + }, + + ['Shantotto'] = + { + onTrigger = function(player, npc) + return quest:event(231):importantOnce() -- optional dialogue School of Magic student hint until quest finish + end, + }, + + ['Yoran-Oran'] = + { + onTrigger = function(player, npc) + return quest:event(232):importantOnce() -- optional dialogue until quest finish + end + }, + + onEventFinish = + { + [237] = function(player, csid, option, npc) + player:delKeyItem(xi.ki.THESIS_ON_ALCHEMY) + quest:setVar(player, 'Prog', 3) + end, + + [239] = function(player, csid, option, npc) + quest:setVar(player, 'Prog', 4) + player:confirmTrade() + quest:setVar(player, 'Wait', getMidnight()) + end, + + [242] = function(player, csid, option, npc) + if quest:complete(player) then + xi.quest.setMustZone(player, xi.quest.log_id.WINDURST, xi.quest.id.windurst.NOTHING_MATTERS) + end + end, + }, + }, + + [xi.zone.WINDURST_WATERS] = + { + ['Fuepepe'] = + { + onTrigger = function(player, npc) + local prog = quest:getVar(player, 'Prog') + if prog == 0 then + return quest:progressEvent(545) -- tells player to find Katzun-Nattzun at the Acolyte Hostel + elseif prog == 1 then + return quest:event(546):importantOnce() -- reminds player to find Katzun-Nattzun at the Acolyte Hostel + end + end + }, + + ['Moreno-Toeno'] = + { + onTrigger = function(player, npc) + if quest:getVar(player, 'Prog') <= 3 then + return quest:event(544):importantOnce() -- optional dialogue pre item turnin + end + end + }, + + ['Pechiru-Mashiru'] = + { + onTrigger = function(player, npc) + if quest:getVar(player, 'Prog') <= 3 then + return quest:event(541):importantOnce() -- optional dialogue pre item turnin + end + end + }, + + ['Door_Acolyte_Hostel'] = + { + onTrigger = function(player, npc) + if quest:getVar(player, 'Prog') == 1 then + if npc:getID() == windurstWatersID.npc.ACOLYTE_HOSTEL_DOOR_OFFSET then + if not quest:isVarBitsSet(player, 'Doors', 1) then -- question set 1 + return quest:progressEvent(804, 0, xi.ki.AIRSHIP_PASS, 500000, 0, 0, 0, 0, xi.ki.THESIS_ON_ALCHEMY) -- airship cost based on Derrick.lua for airship + end + elseif npc:getID() == windurstWatersID.npc.ACOLYTE_HOSTEL_DOOR_OFFSET + 1 then + if not quest:isVarBitsSet(player, 'Doors', 2) then -- question set 2 + return quest:progressEvent(805, 0, 0, xi.item.TARUTARU_FISHING_ROD, xi.item.WILLOW_FISHING_ROD, xi.item.LU_SHANGS_FISHING_ROD, 0, 0, xi.ki.THESIS_ON_ALCHEMY) + end + elseif npc:getID() == windurstWatersID.npc.ACOLYTE_HOSTEL_DOOR_OFFSET + 2 then + if not quest:isVarBitsSet(player, 'Doors', 3) then -- question set 3 + return quest:progressEvent(806, 0, 0, 0, 0, 0, 0, 0, xi.ki.THESIS_ON_ALCHEMY) + end + elseif npc:getID() == windurstWatersID.npc.ACOLYTE_HOSTEL_DOOR_OFFSET + 7 then + if not quest:isVarBitsSet(player, 'Doors', 4) then -- question set 4 + return quest:progressEvent(811, 0, 0, 0, 0, 0, 0, 0, xi.ki.THESIS_ON_ALCHEMY) + end + elseif npc:getID() == windurstWatersID.npc.ACOLYTE_HOSTEL_DOOR_OFFSET + 8 then + if not quest:isVarBitsSet(player, 'Doors', 5) then -- question set 5 + return quest:progressEvent(812, 0, 0, 0, 0, xi.item.CRYSTAL_BASS, 0, 0, xi.ki.THESIS_ON_ALCHEMY) + end + elseif npc:getID() == windurstWatersID.npc.ACOLYTE_HOSTEL_DOOR_OFFSET + 9 then + if not quest:isVarBitsSet(player, 'Doors', 6) then -- question set 6 + return quest:progressEvent(813, 0, xi.item.BAG_OF_HERB_SEEDS, xi.item.CARNATION, xi.item.DEATHBALL, xi.item.MARGUERITE, xi.item.BISMUTH_SHEET, 0, xi.ki.THESIS_ON_ALCHEMY) + end + end + end + end + }, + + ['Door_Acolyte_Hostel_F'] = + { + onTrigger = function(player, npc) + if + quest:getVar(player, 'Prog') == 1 and + quest:isVarBitsSet(player, 'Doors', 1) and + quest:isVarBitsSet(player, 'Doors', 2) and + quest:isVarBitsSet(player, 'Doors', 3) and + quest:isVarBitsSet(player, 'Doors', 4) and + quest:isVarBitsSet(player, 'Doors', 5) and + quest:isVarBitsSet(player, 'Doors', 6) -- check all questions have been answered + then + if quest:getVar(player, 'correctProg') >= 4 then -- check at least 4 correct answers to progress + if quest:getVar(player, 'correctProg') == 6 then -- if player has 6 correct they get additional reward + return quest:progressCutscene(814, 0, 0, 1, 0, 0, 0, 0, xi.ki.THESIS_ON_ALCHEMY) -- additional reward + else -- regular cs for 6 > correctProg >= 4 + return quest:progressCutscene(814, 0, 0, 0, 0, 0, 0, 0, xi.ki.THESIS_ON_ALCHEMY) + end + else -- all questions have been answered but < 4 were correct + for i = 1, 6 do + quest:unsetVarBit(player, 'Doors', i) + end + + quest:setVar(player, 'correctProg', 0) + end + end + end + }, + + onEventFinish = + { + [545] = function(player, csid, option, npc) + quest:setVar(player, 'Prog', 1) + end, + + [804] = function(player, csid, option, npc) + quest:setVarBit(player, 'Doors', 1) + if option == 100 then + quest:setVar(player, 'correctProg', quest:getVar(player, 'correctProg') + 1) + end + end, + + [805] = function(player, csid, option, npc) + quest:setVarBit(player, 'Doors', 2) + if option == 100 then + quest:setVar(player, 'correctProg', quest:getVar(player, 'correctProg') + 1) + end + end, + + [806] = function(player, csid, option, npc) + quest:setVarBit(player, 'Doors', 3) + if option == 100 then + quest:setVar(player, 'correctProg', quest:getVar(player, 'correctProg') + 1) + end + end, + + [811] = function(player, csid, option, npc) + quest:setVarBit(player, 'Doors', 4) + if option == 100 then + quest:setVar(player, 'correctProg', quest:getVar(player, 'correctProg') + 1) + end + end, + + [812] = function(player, csid, option, npc) + quest:setVarBit(player, 'Doors', 5) + if option == 100 then + quest:setVar(player, 'correctProg', quest:getVar(player, 'correctProg') + 1) + end + end, + + [813] = function(player, csid, option, npc) + quest:setVarBit(player, 'Doors', 6) + if option == 100 then + quest:setVar(player, 'correctProg', quest:getVar(player, 'correctProg') + 1) + end + end, + + [814] = function(player, csid, option, npc) + if quest:getVar(player, 'correctProg') == 6 then -- if player answered 6 correctly reward with vile elixir + if npcUtil.giveItem(player, xi.item.VILE_ELIXIR) then + quest:setVar(player, 'Prog', 2) + npcUtil.giveKeyItem(player, xi.ki.THESIS_ON_ALCHEMY) + end + else + quest:setVar(player, 'Prog', 2) + npcUtil.giveKeyItem(player, xi.ki.THESIS_ON_ALCHEMY) + end + end, + }, + } + }, + + { + check = function(player, status, vars) + return status == QUEST_COMPLETED and + xi.quest.getMustZone(player, xi.quest.log_id.WINDURST, xi.quest.id.windurst.NOTHING_MATTERS) + end, + + [xi.zone.WINDURST_WALLS] = + { + ['Koru-Moru'] = quest:event(244):importantEvent(), + }, + }, +} + +return quest diff --git a/scripts/zones/Abyssea-Grauberg/Zone.lua b/scripts/zones/Abyssea-Grauberg/Zone.lua index a889f516a6b..3fe8d2f2587 100644 --- a/scripts/zones/Abyssea-Grauberg/Zone.lua +++ b/scripts/zones/Abyssea-Grauberg/Zone.lua @@ -5,7 +5,7 @@ local zoneObject = {} zoneObject.onInitialize = function(zone) zone:registerTriggerArea(1, -570, 20, -810, -487.3, 35, -740) - xi.helm.initZone(zone, xi.helm.type.HARVESTING) + xi.helm.initZone(zone, xi.helmType.HARVESTING) end zoneObject.onZoneIn = function(player, prevZone) diff --git a/scripts/zones/Attohwa_Chasm/Zone.lua b/scripts/zones/Attohwa_Chasm/Zone.lua index 75ae036bc9e..9c10d9e9a13 100644 --- a/scripts/zones/Attohwa_Chasm/Zone.lua +++ b/scripts/zones/Attohwa_Chasm/Zone.lua @@ -41,7 +41,7 @@ zoneObject.onInitialize = function(zone) UpdateNMSpawnPoint(ID.mob.TIAMAT) GetMobByID(ID.mob.TIAMAT):setRespawnTime(math.random(86400, 259200)) - xi.helm.initZone(zone, xi.helm.type.EXCAVATION) + xi.helm.initZone(zone, xi.helmType.EXCAVATION) end zoneObject.onZoneIn = function(player, prevZone) diff --git a/scripts/zones/Attohwa_Chasm/npcs/Excavation_Point.lua b/scripts/zones/Attohwa_Chasm/npcs/Excavation_Point.lua index f723a028094..159bf69faa5 100644 --- a/scripts/zones/Attohwa_Chasm/npcs/Excavation_Point.lua +++ b/scripts/zones/Attohwa_Chasm/npcs/Excavation_Point.lua @@ -5,11 +5,11 @@ local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.EXCAVATION, 10) + xi.helm.onTrade(player, npc, trade, xi.helmType.EXCAVATION, 10) end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.EXCAVATION) + xi.helm.onTrigger(player, xi.helmType.EXCAVATION) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/zones/Bhaflau_Thickets/Zone.lua b/scripts/zones/Bhaflau_Thickets/Zone.lua index 83f52f7f05b..2a97b62432c 100644 --- a/scripts/zones/Bhaflau_Thickets/Zone.lua +++ b/scripts/zones/Bhaflau_Thickets/Zone.lua @@ -13,7 +13,7 @@ zoneObject.onInitialize = function(zone) UpdateNMSpawnPoint(ID.mob.HARVESTMAN) GetMobByID(ID.mob.HARVESTMAN):setRespawnTime(math.random(900, 10800)) - xi.helm.initZone(zone, xi.helm.type.HARVESTING) + xi.helm.initZone(zone, xi.helmType.HARVESTING) end zoneObject.onZoneIn = function(player, prevZone) diff --git a/scripts/zones/Bhaflau_Thickets/npcs/Harvesting_Point.lua b/scripts/zones/Bhaflau_Thickets/npcs/Harvesting_Point.lua index 209ba0226a5..2d849185cc0 100644 --- a/scripts/zones/Bhaflau_Thickets/npcs/Harvesting_Point.lua +++ b/scripts/zones/Bhaflau_Thickets/npcs/Harvesting_Point.lua @@ -5,11 +5,11 @@ local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.HARVESTING, 503) + xi.helm.onTrade(player, npc, trade, xi.helmType.HARVESTING, 503) end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.HARVESTING) + xi.helm.onTrigger(player, xi.helmType.HARVESTING) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/zones/Buburimu_Peninsula/Zone.lua b/scripts/zones/Buburimu_Peninsula/Zone.lua index 6cf34fde131..dd5936926a2 100644 --- a/scripts/zones/Buburimu_Peninsula/Zone.lua +++ b/scripts/zones/Buburimu_Peninsula/Zone.lua @@ -20,7 +20,7 @@ zoneObject.onInitialize = function(zone) xi.conq.setRegionalConquestOverseers(zone:getRegionID()) - xi.helm.initZone(zone, xi.helm.type.LOGGING) + xi.helm.initZone(zone, xi.helmType.LOGGING) end zoneObject.onZoneIn = function(player, prevZone) diff --git a/scripts/zones/Buburimu_Peninsula/npcs/Logging_Point.lua b/scripts/zones/Buburimu_Peninsula/npcs/Logging_Point.lua index 1b6a3ad55f3..b36b2d51de7 100644 --- a/scripts/zones/Buburimu_Peninsula/npcs/Logging_Point.lua +++ b/scripts/zones/Buburimu_Peninsula/npcs/Logging_Point.lua @@ -5,11 +5,11 @@ local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.LOGGING, 901) + xi.helm.onTrade(player, npc, trade, xi.helmType.LOGGING, 901) end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.LOGGING) + xi.helm.onTrigger(player, xi.helmType.LOGGING) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/zones/Caedarva_Mire/Zone.lua b/scripts/zones/Caedarva_Mire/Zone.lua index d22633e6953..e3752f78c01 100644 --- a/scripts/zones/Caedarva_Mire/Zone.lua +++ b/scripts/zones/Caedarva_Mire/Zone.lua @@ -10,7 +10,7 @@ zoneObject.onInitialize = function(zone) GetMobByID(ID.mob.AYNU_KAYSEY):setRespawnTime(math.random(900, 10800)) GetMobByID(ID.mob.KHIMAIRA):setRespawnTime(math.random(12, 36) * 3600) -- 12 to 36 hours after maintenance, in 1-hour increments - xi.helm.initZone(zone, xi.helm.type.LOGGING) + xi.helm.initZone(zone, xi.helmType.LOGGING) end zoneObject.onZoneIn = function(player, prevZone) diff --git a/scripts/zones/Caedarva_Mire/npcs/Logging_Point.lua b/scripts/zones/Caedarva_Mire/npcs/Logging_Point.lua index 88645f5d91c..5e5acd397d7 100644 --- a/scripts/zones/Caedarva_Mire/npcs/Logging_Point.lua +++ b/scripts/zones/Caedarva_Mire/npcs/Logging_Point.lua @@ -5,11 +5,11 @@ local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.LOGGING, 139) + xi.helm.onTrade(player, npc, trade, xi.helmType.LOGGING, 139) end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.LOGGING) + xi.helm.onTrigger(player, xi.helmType.LOGGING) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/zones/Carpenters_Landing/Zone.lua b/scripts/zones/Carpenters_Landing/Zone.lua index ec9a1d709a2..a9b447e7231 100644 --- a/scripts/zones/Carpenters_Landing/Zone.lua +++ b/scripts/zones/Carpenters_Landing/Zone.lua @@ -14,7 +14,7 @@ zoneObject.onInitialize = function(zone) UpdateNMSpawnPoint(ID.mob.TEMPEST_TIGON) GetMobByID(ID.mob.TEMPEST_TIGON):setRespawnTime(math.random(900, 10800)) - xi.helm.initZone(zone, xi.helm.type.LOGGING) + xi.helm.initZone(zone, xi.helmType.LOGGING) func.herculesTreeOnGameHour() end diff --git a/scripts/zones/Carpenters_Landing/npcs/Logging_Point.lua b/scripts/zones/Carpenters_Landing/npcs/Logging_Point.lua index ec088790706..e6e612fc33e 100644 --- a/scripts/zones/Carpenters_Landing/npcs/Logging_Point.lua +++ b/scripts/zones/Carpenters_Landing/npcs/Logging_Point.lua @@ -5,11 +5,11 @@ local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.LOGGING, 30) + xi.helm.onTrade(player, npc, trade, xi.helmType.LOGGING, 30) end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.LOGGING) + xi.helm.onTrigger(player, xi.helmType.LOGGING) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/zones/East_Ronfaure/Zone.lua b/scripts/zones/East_Ronfaure/Zone.lua index fd3629ab6c1..69e7f82ae06 100644 --- a/scripts/zones/East_Ronfaure/Zone.lua +++ b/scripts/zones/East_Ronfaure/Zone.lua @@ -10,7 +10,7 @@ zoneObject.onChocoboDig = function(player, precheck) end zoneObject.onInitialize = function(zone) - xi.helm.initZone(zone, xi.helm.type.LOGGING) + xi.helm.initZone(zone, xi.helmType.LOGGING) end zoneObject.onZoneIn = function(player, prevZone) diff --git a/scripts/zones/East_Ronfaure/npcs/Logging_Point.lua b/scripts/zones/East_Ronfaure/npcs/Logging_Point.lua index 7ae4c74f7c4..e1cd2eb2227 100644 --- a/scripts/zones/East_Ronfaure/npcs/Logging_Point.lua +++ b/scripts/zones/East_Ronfaure/npcs/Logging_Point.lua @@ -5,11 +5,11 @@ local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.LOGGING, 901) + xi.helm.onTrade(player, npc, trade, xi.helmType.LOGGING, 901) end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.LOGGING) + xi.helm.onTrigger(player, xi.helmType.LOGGING) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/zones/East_Ronfaure_[S]/Zone.lua b/scripts/zones/East_Ronfaure_[S]/Zone.lua index 7098b7cba47..f365b78a992 100644 --- a/scripts/zones/East_Ronfaure_[S]/Zone.lua +++ b/scripts/zones/East_Ronfaure_[S]/Zone.lua @@ -11,7 +11,7 @@ zoneObject.onInitialize = function(zone) UpdateNMSpawnPoint(ID.mob.MYRADROSH) GetMobByID(ID.mob.MYRADROSH):setRespawnTime(math.random(5400, 7200)) - xi.helm.initZone(zone, xi.helm.type.LOGGING) + xi.helm.initZone(zone, xi.helmType.LOGGING) xi.voidwalker.zoneOnInit(zone) xi.darkixion.zoneOnInit(zone) end diff --git a/scripts/zones/East_Ronfaure_[S]/npcs/Logging_Point.lua b/scripts/zones/East_Ronfaure_[S]/npcs/Logging_Point.lua index d5417058285..9021f5631c4 100644 --- a/scripts/zones/East_Ronfaure_[S]/npcs/Logging_Point.lua +++ b/scripts/zones/East_Ronfaure_[S]/npcs/Logging_Point.lua @@ -5,11 +5,11 @@ local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.LOGGING, 901) + xi.helm.onTrade(player, npc, trade, xi.helmType.LOGGING, 901) end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.LOGGING) + xi.helm.onTrigger(player, xi.helmType.LOGGING) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/zones/Empyreal_Paradox/mobs/Selhteus.lua b/scripts/zones/Empyreal_Paradox/mobs/Selhteus.lua index 9b8a77b081b..076e7c9b6a5 100644 --- a/scripts/zones/Empyreal_Paradox/mobs/Selhteus.lua +++ b/scripts/zones/Empyreal_Paradox/mobs/Selhteus.lua @@ -28,7 +28,7 @@ entity.onMobFight = function(mob, target) mob:useMobAbility(1509) mob:setLocalVar('rejuv', 1) elseif lanceTime + 50 < mob:getBattleTime() and lanceOut == 0 then - mob:entityAnimationPacket('sp00') + mob:entityAnimationPacket(xi.animationString.SPECIAL_00) mob:setLocalVar('lanceOut', 1) end end diff --git a/scripts/zones/Fort_Karugo-Narugo_[S]/Zone.lua b/scripts/zones/Fort_Karugo-Narugo_[S]/Zone.lua index 90ebe721942..f612cfb3287 100644 --- a/scripts/zones/Fort_Karugo-Narugo_[S]/Zone.lua +++ b/scripts/zones/Fort_Karugo-Narugo_[S]/Zone.lua @@ -8,7 +8,7 @@ local ID = zones[xi.zone.FORT_KARUGO_NARUGO_S] local zoneObject = {} zoneObject.onInitialize = function(zone) - xi.helm.initZone(zone, xi.helm.type.LOGGING) + xi.helm.initZone(zone, xi.helmType.LOGGING) xi.darkixion.zoneOnInit(zone) end diff --git a/scripts/zones/Fort_Karugo-Narugo_[S]/npcs/Logging_Point.lua b/scripts/zones/Fort_Karugo-Narugo_[S]/npcs/Logging_Point.lua index a866b095e6e..b682b9b210d 100644 --- a/scripts/zones/Fort_Karugo-Narugo_[S]/npcs/Logging_Point.lua +++ b/scripts/zones/Fort_Karugo-Narugo_[S]/npcs/Logging_Point.lua @@ -5,11 +5,11 @@ local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.LOGGING, 901) + xi.helm.onTrade(player, npc, trade, xi.helmType.LOGGING, 901) end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.LOGGING) + xi.helm.onTrigger(player, xi.helmType.LOGGING) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/zones/Ghelsba_Outpost/Zone.lua b/scripts/zones/Ghelsba_Outpost/Zone.lua index 4f06fda3aa0..b7d95e45b62 100644 --- a/scripts/zones/Ghelsba_Outpost/Zone.lua +++ b/scripts/zones/Ghelsba_Outpost/Zone.lua @@ -4,7 +4,7 @@ local zoneObject = {} zoneObject.onInitialize = function(zone) - xi.helm.initZone(zone, xi.helm.type.LOGGING) + xi.helm.initZone(zone, xi.helmType.LOGGING) end zoneObject.onZoneIn = function(player, prevZone) diff --git a/scripts/zones/Ghelsba_Outpost/npcs/Logging_Point.lua b/scripts/zones/Ghelsba_Outpost/npcs/Logging_Point.lua index 3ea8133e6fd..ec082a69afc 100644 --- a/scripts/zones/Ghelsba_Outpost/npcs/Logging_Point.lua +++ b/scripts/zones/Ghelsba_Outpost/npcs/Logging_Point.lua @@ -5,11 +5,11 @@ local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.LOGGING, 100) + xi.helm.onTrade(player, npc, trade, xi.helmType.LOGGING, 100) end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.LOGGING) + xi.helm.onTrigger(player, xi.helmType.LOGGING) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/zones/Giddeus/Zone.lua b/scripts/zones/Giddeus/Zone.lua index 7f5ed10ed3e..5fbd682108b 100644 --- a/scripts/zones/Giddeus/Zone.lua +++ b/scripts/zones/Giddeus/Zone.lua @@ -5,7 +5,7 @@ local zoneObject = {} zoneObject.onInitialize = function(zone) xi.treasure.initZone(zone) - xi.helm.initZone(zone, xi.helm.type.HARVESTING) + xi.helm.initZone(zone, xi.helmType.HARVESTING) end zoneObject.onZoneIn = function(player, prevZone) diff --git a/scripts/zones/Giddeus/npcs/Harvesting_Point.lua b/scripts/zones/Giddeus/npcs/Harvesting_Point.lua index abc8666233d..6fb00d2d0bc 100644 --- a/scripts/zones/Giddeus/npcs/Harvesting_Point.lua +++ b/scripts/zones/Giddeus/npcs/Harvesting_Point.lua @@ -5,11 +5,11 @@ local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.HARVESTING, 70) + xi.helm.onTrade(player, npc, trade, xi.helmType.HARVESTING, 70) end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.HARVESTING) + xi.helm.onTrigger(player, xi.helmType.HARVESTING) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/zones/Grauberg_[S]/Zone.lua b/scripts/zones/Grauberg_[S]/Zone.lua index 510580ed01d..e9af65b4422 100644 --- a/scripts/zones/Grauberg_[S]/Zone.lua +++ b/scripts/zones/Grauberg_[S]/Zone.lua @@ -8,7 +8,7 @@ local ID = zones[xi.zone.GRAUBERG_S] local zoneObject = {} zoneObject.onInitialize = function(zone) - xi.helm.initZone(zone, xi.helm.type.HARVESTING) + xi.helm.initZone(zone, xi.helmType.HARVESTING) xi.darkixion.zoneOnInit(zone) end diff --git a/scripts/zones/Grauberg_[S]/npcs/Harvesting_Point.lua b/scripts/zones/Grauberg_[S]/npcs/Harvesting_Point.lua index ec5043c69da..c7a450e3e6f 100644 --- a/scripts/zones/Grauberg_[S]/npcs/Harvesting_Point.lua +++ b/scripts/zones/Grauberg_[S]/npcs/Harvesting_Point.lua @@ -7,7 +7,7 @@ local ID = zones[xi.zone.GRAUBERG_S] local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.HARVESTING, 901) + xi.helm.onTrade(player, npc, trade, xi.helmType.HARVESTING, 901) end entity.onTrigger = function(player, npc) diff --git a/scripts/zones/Gusgen_Mines/Zone.lua b/scripts/zones/Gusgen_Mines/Zone.lua index 412c171922e..1397efd8bf0 100644 --- a/scripts/zones/Gusgen_Mines/Zone.lua +++ b/scripts/zones/Gusgen_Mines/Zone.lua @@ -7,7 +7,7 @@ local zoneObject = {} zoneObject.onInitialize = function(zone) xi.treasure.initZone(zone) - xi.helm.initZone(zone, xi.helm.type.MINING) + xi.helm.initZone(zone, xi.helmType.MINING) end zoneObject.onZoneIn = function(player, prevZone) diff --git a/scripts/zones/Gusgen_Mines/npcs/Mining_Point.lua b/scripts/zones/Gusgen_Mines/npcs/Mining_Point.lua index 35c0ec258af..95c8881249c 100644 --- a/scripts/zones/Gusgen_Mines/npcs/Mining_Point.lua +++ b/scripts/zones/Gusgen_Mines/npcs/Mining_Point.lua @@ -5,11 +5,11 @@ local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.MINING, 11) + xi.helm.onTrade(player, npc, trade, xi.helmType.MINING, 11) end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.MINING) + xi.helm.onTrigger(player, xi.helmType.MINING) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/zones/Halvung/Zone.lua b/scripts/zones/Halvung/Zone.lua index b2b90473c22..551831c220e 100644 --- a/scripts/zones/Halvung/Zone.lua +++ b/scripts/zones/Halvung/Zone.lua @@ -4,7 +4,7 @@ local zoneObject = {} zoneObject.onInitialize = function(zone) - xi.helm.initZone(zone, xi.helm.type.MINING) + xi.helm.initZone(zone, xi.helmType.MINING) end zoneObject.onZoneIn = function(player, prevZone) diff --git a/scripts/zones/Halvung/npcs/Mining_Point.lua b/scripts/zones/Halvung/npcs/Mining_Point.lua index c537f25db1c..6d2ebf6a828 100644 --- a/scripts/zones/Halvung/npcs/Mining_Point.lua +++ b/scripts/zones/Halvung/npcs/Mining_Point.lua @@ -5,11 +5,11 @@ local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.MINING, 210) + xi.helm.onTrade(player, npc, trade, xi.helmType.MINING, 210) end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.MINING) + xi.helm.onTrigger(player, xi.helmType.MINING) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/zones/Ifrits_Cauldron/Zone.lua b/scripts/zones/Ifrits_Cauldron/Zone.lua index 98a6be25fe9..60d2d9675e6 100644 --- a/scripts/zones/Ifrits_Cauldron/Zone.lua +++ b/scripts/zones/Ifrits_Cauldron/Zone.lua @@ -10,7 +10,7 @@ zoneObject.onInitialize = function(zone) GetMobByID(ID.mob.ASH_DRAGON):setRespawnTime(math.random(900, 10800)) xi.treasure.initZone(zone) - xi.helm.initZone(zone, xi.helm.type.MINING) + xi.helm.initZone(zone, xi.helmType.MINING) end zoneObject.onConquestUpdate = function(zone, updatetype, influence, owner, ranking, isConquestAlliance) diff --git a/scripts/zones/Ifrits_Cauldron/mobs/Bomb_Queen.lua b/scripts/zones/Ifrits_Cauldron/mobs/Bomb_Queen.lua index b937d03b6fc..88dc1adbcf9 100644 --- a/scripts/zones/Ifrits_Cauldron/mobs/Bomb_Queen.lua +++ b/scripts/zones/Ifrits_Cauldron/mobs/Bomb_Queen.lua @@ -31,13 +31,13 @@ entity.onMobFight = function(mob, target) end if canSpawnPet then - mob:entityAnimationPacket('casm') + mob:entityAnimationPacket(xi.animationString.CAST_SUMMONER_START) mob:timer(5000, function(bombQueen) if bombQueen:isDead() then return end - bombQueen:entityAnimationPacket('shsm') + bombQueen:entityAnimationPacket(xi.animationString.CAST_SUMMONER_STOP) local bombQueenId = mob:getID() -- Pick a random Prince or Princess diff --git a/scripts/zones/Ifrits_Cauldron/npcs/Mining_Point.lua b/scripts/zones/Ifrits_Cauldron/npcs/Mining_Point.lua index 98ae99b324c..9bac9d662c1 100644 --- a/scripts/zones/Ifrits_Cauldron/npcs/Mining_Point.lua +++ b/scripts/zones/Ifrits_Cauldron/npcs/Mining_Point.lua @@ -5,11 +5,11 @@ local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.MINING, 20) + xi.helm.onTrade(player, npc, trade, xi.helmType.MINING, 20) end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.MINING) + xi.helm.onTrigger(player, xi.helmType.MINING) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/zones/Inner_Horutoto_Ruins/Zone.lua b/scripts/zones/Inner_Horutoto_Ruins/Zone.lua index d88e8b90523..52d53242a83 100644 --- a/scripts/zones/Inner_Horutoto_Ruins/Zone.lua +++ b/scripts/zones/Inner_Horutoto_Ruins/Zone.lua @@ -48,7 +48,7 @@ zoneObject.onTriggerAreaEnter = function(player, triggerArea) [1] = function() -- Red Circle if player:getMainJob() == xi.job.RDM and triggerArea:AddCount(1) == 1 then red:setAnimation(xi.anim.OPEN_DOOR) - red:entityAnimationPacket('smin') + red:entityAnimationPacket(xi.animationString.OPEN_DOOR) if white:getAnimation() == xi.anim.OPEN_DOOR and black:getAnimation() == xi.anim.OPEN_DOOR @@ -62,7 +62,7 @@ zoneObject.onTriggerAreaEnter = function(player, triggerArea) [2] = function() -- White Circle if player:getMainJob() == xi.job.WHM and triggerArea:AddCount(1) == 1 then white:setAnimation(xi.anim.OPEN_DOOR) - white:entityAnimationPacket('smin') + white:entityAnimationPacket(xi.animationString.OPEN_DOOR) if red:getAnimation() == xi.anim.OPEN_DOOR and black:getAnimation() == xi.anim.OPEN_DOOR @@ -76,7 +76,7 @@ zoneObject.onTriggerAreaEnter = function(player, triggerArea) [3] = function() -- Black Circle if player:getMainJob() == xi.job.BLM and triggerArea:AddCount(1) == 1 then black:setAnimation(xi.anim.OPEN_DOOR) - black:entityAnimationPacket('smin') + black:entityAnimationPacket(xi.animationString.OPEN_DOOR) if red:getAnimation() == xi.anim.OPEN_DOOR and white:getAnimation() == xi.anim.OPEN_DOOR @@ -104,21 +104,21 @@ zoneObject.onTriggerAreaLeave = function(player, triggerArea) [1] = function() -- Red Circle if player:getMainJob() == xi.job.RDM and triggerArea:DelCount(1) == 0 then red:setAnimation(xi.anim.CLOSE_DOOR) - red:entityAnimationPacket('kmin') + red:entityAnimationPacket(xi.animationString.CLOSE_DOOR) end end, [2] = function() -- White Circle if player:getMainJob() == xi.job.WHM and triggerArea:DelCount(1) == 0 then white:setAnimation(xi.anim.CLOSE_DOOR) - white:entityAnimationPacket('kmin') + white:entityAnimationPacket(xi.animationString.CLOSE_DOOR) end end, [3] = function() -- Black Circle if player:getMainJob() == xi.job.BLM and triggerArea:DelCount(1) == 0 then black:setAnimation(xi.anim.CLOSE_DOOR) - black:entityAnimationPacket('kmin') + black:entityAnimationPacket(xi.animationString.CLOSE_DOOR) end end, } diff --git a/scripts/zones/Jugner_Forest/Zone.lua b/scripts/zones/Jugner_Forest/Zone.lua index aba6f17d3f8..efa82b81dea 100644 --- a/scripts/zones/Jugner_Forest/Zone.lua +++ b/scripts/zones/Jugner_Forest/Zone.lua @@ -19,7 +19,7 @@ zoneObject.onInitialize = function(zone) xi.conq.setRegionalConquestOverseers(zone:getRegionID()) - xi.helm.initZone(zone, xi.helm.type.LOGGING) + xi.helm.initZone(zone, xi.helmType.LOGGING) local respawnTime = 900 + math.random(0, 6) * 1800 -- 0:15 to 3:15 spawn timer in 30 minute intervals for offset = 1, 10 do diff --git a/scripts/zones/Jugner_Forest/npcs/Logging_Point.lua b/scripts/zones/Jugner_Forest/npcs/Logging_Point.lua index fe15c9faf74..db00c410a1a 100644 --- a/scripts/zones/Jugner_Forest/npcs/Logging_Point.lua +++ b/scripts/zones/Jugner_Forest/npcs/Logging_Point.lua @@ -5,11 +5,11 @@ local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.LOGGING, 20) + xi.helm.onTrade(player, npc, trade, xi.helmType.LOGGING, 20) end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.LOGGING) + xi.helm.onTrigger(player, xi.helmType.LOGGING) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/zones/Jugner_Forest_[S]/Zone.lua b/scripts/zones/Jugner_Forest_[S]/Zone.lua index bb201985633..6da03410af5 100644 --- a/scripts/zones/Jugner_Forest_[S]/Zone.lua +++ b/scripts/zones/Jugner_Forest_[S]/Zone.lua @@ -6,7 +6,7 @@ require('scripts/globals/dark_ixion') local zoneObject = {} zoneObject.onInitialize = function(zone) - xi.helm.initZone(zone, xi.helm.type.LOGGING) + xi.helm.initZone(zone, xi.helmType.LOGGING) xi.chocobo.initZone(zone) xi.voidwalker.zoneOnInit(zone) xi.darkixion.zoneOnInit(zone) diff --git a/scripts/zones/Jugner_Forest_[S]/npcs/Logging_Point.lua b/scripts/zones/Jugner_Forest_[S]/npcs/Logging_Point.lua index 32ecdff346a..1c0bf9df877 100644 --- a/scripts/zones/Jugner_Forest_[S]/npcs/Logging_Point.lua +++ b/scripts/zones/Jugner_Forest_[S]/npcs/Logging_Point.lua @@ -5,11 +5,11 @@ local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.LOGGING, 901) + xi.helm.onTrade(player, npc, trade, xi.helmType.LOGGING, 901) end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.LOGGING) + xi.helm.onTrigger(player, xi.helmType.LOGGING) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/zones/Korroloka_Tunnel/Zone.lua b/scripts/zones/Korroloka_Tunnel/Zone.lua index 077cb508a56..94ef43bfd8b 100644 --- a/scripts/zones/Korroloka_Tunnel/Zone.lua +++ b/scripts/zones/Korroloka_Tunnel/Zone.lua @@ -11,7 +11,7 @@ zoneObject.onInitialize = function(zone) zone:registerTriggerArea(2, -101, 7, -114, 0, 0, 0) -- Center Pool zone:registerTriggerArea(3, -112, 3, -103, 0, 0, 0) -- Right Pool - xi.helm.initZone(zone, xi.helm.type.EXCAVATION) + xi.helm.initZone(zone, xi.helmType.EXCAVATION) end zoneObject.onZoneIn = function(player, prevZone) diff --git a/scripts/zones/Korroloka_Tunnel/npcs/Excavation_Point.lua b/scripts/zones/Korroloka_Tunnel/npcs/Excavation_Point.lua index 38643c4c463..f0381f99458 100644 --- a/scripts/zones/Korroloka_Tunnel/npcs/Excavation_Point.lua +++ b/scripts/zones/Korroloka_Tunnel/npcs/Excavation_Point.lua @@ -5,11 +5,11 @@ local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.EXCAVATION, 0) + xi.helm.onTrade(player, npc, trade, xi.helmType.EXCAVATION, 0) end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.EXCAVATION) + xi.helm.onTrigger(player, xi.helmType.EXCAVATION) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/zones/Lower_Jeuno/npcs/Derrick.lua b/scripts/zones/Lower_Jeuno/npcs/Derrick.lua index bad7b9456a5..341d56c58c5 100644 --- a/scripts/zones/Lower_Jeuno/npcs/Derrick.lua +++ b/scripts/zones/Lower_Jeuno/npcs/Derrick.lua @@ -21,7 +21,7 @@ end entity.onEventUpdate = function(player, csid, option, npc) if csid == 230 and option == 10 then - if player:delGil(500000) then + if player:delGil(500000) then -- this value is tied to a question in Nothing_Matters.lua player:addKeyItem(xi.ki.AIRSHIP_PASS) player:updateEvent(0, 1) else diff --git a/scripts/zones/Lufaise_Meadows/Zone.lua b/scripts/zones/Lufaise_Meadows/Zone.lua index 8473a973366..a83689c4a78 100644 --- a/scripts/zones/Lufaise_Meadows/Zone.lua +++ b/scripts/zones/Lufaise_Meadows/Zone.lua @@ -17,7 +17,7 @@ zoneObject.onInitialize = function(zone) GetMobByID(ID.mob.FLOCKBOCK):setRespawnTime(math.random(3600, 7200)) - xi.helm.initZone(zone, xi.helm.type.LOGGING) + xi.helm.initZone(zone, xi.helmType.LOGGING) end zoneObject.onConquestUpdate = function(zone, updatetype, influence, owner, ranking, isConquestAlliance) diff --git a/scripts/zones/Lufaise_Meadows/mobs/Gigas_Braver.lua b/scripts/zones/Lufaise_Meadows/mobs/Gigas_Braver.lua index a2406f1030a..825ecb76360 100644 --- a/scripts/zones/Lufaise_Meadows/mobs/Gigas_Braver.lua +++ b/scripts/zones/Lufaise_Meadows/mobs/Gigas_Braver.lua @@ -7,7 +7,7 @@ mixins = { require('scripts/mixins/fomor_hate') } local entity = {} entity.onMobSpawn = function(mob) - mob:setLocalVar('fomorHateAdj', -1) + mob:setLocalVar('fomorHateAdj', 1) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Lufaise_Meadows/mobs/Gigas_Catapulter.lua b/scripts/zones/Lufaise_Meadows/mobs/Gigas_Catapulter.lua index dfa6e6d2b9c..47c4d373459 100644 --- a/scripts/zones/Lufaise_Meadows/mobs/Gigas_Catapulter.lua +++ b/scripts/zones/Lufaise_Meadows/mobs/Gigas_Catapulter.lua @@ -7,7 +7,7 @@ mixins = { require('scripts/mixins/fomor_hate') } local entity = {} entity.onMobSpawn = function(mob) - mob:setLocalVar('fomorHateAdj', -1) + mob:setLocalVar('fomorHateAdj', 1) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Lufaise_Meadows/mobs/Gigas_Fighter.lua b/scripts/zones/Lufaise_Meadows/mobs/Gigas_Fighter.lua index d0c3a3c56ce..136ef38a44a 100644 --- a/scripts/zones/Lufaise_Meadows/mobs/Gigas_Fighter.lua +++ b/scripts/zones/Lufaise_Meadows/mobs/Gigas_Fighter.lua @@ -7,7 +7,7 @@ mixins = { require('scripts/mixins/fomor_hate') } local entity = {} entity.onMobSpawn = function(mob) - mob:setLocalVar('fomorHateAdj', -1) + mob:setLocalVar('fomorHateAdj', 1) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Lufaise_Meadows/mobs/Gigas_Martialist.lua b/scripts/zones/Lufaise_Meadows/mobs/Gigas_Martialist.lua index 4ae7015514c..857ef0c9be5 100644 --- a/scripts/zones/Lufaise_Meadows/mobs/Gigas_Martialist.lua +++ b/scripts/zones/Lufaise_Meadows/mobs/Gigas_Martialist.lua @@ -7,7 +7,7 @@ mixins = { require('scripts/mixins/fomor_hate') } local entity = {} entity.onMobSpawn = function(mob) - mob:setLocalVar('fomorHateAdj', -1) + mob:setLocalVar('fomorHateAdj', 1) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Lufaise_Meadows/mobs/Gigas_Slinger.lua b/scripts/zones/Lufaise_Meadows/mobs/Gigas_Slinger.lua index 9389c0b3965..2c2e7fa1f6c 100644 --- a/scripts/zones/Lufaise_Meadows/mobs/Gigas_Slinger.lua +++ b/scripts/zones/Lufaise_Meadows/mobs/Gigas_Slinger.lua @@ -7,7 +7,7 @@ mixins = { require('scripts/mixins/fomor_hate') } local entity = {} entity.onMobSpawn = function(mob) - mob:setLocalVar('fomorHateAdj', -1) + mob:setLocalVar('fomorHateAdj', 1) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Lufaise_Meadows/mobs/Gigas_Warwolf.lua b/scripts/zones/Lufaise_Meadows/mobs/Gigas_Warwolf.lua index c7b73929cd4..a86cc603bec 100644 --- a/scripts/zones/Lufaise_Meadows/mobs/Gigas_Warwolf.lua +++ b/scripts/zones/Lufaise_Meadows/mobs/Gigas_Warwolf.lua @@ -7,7 +7,7 @@ mixins = { require('scripts/mixins/fomor_hate') } local entity = {} entity.onMobSpawn = function(mob) - mob:setLocalVar('fomorHateAdj', -1) + mob:setLocalVar('fomorHateAdj', 1) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Lufaise_Meadows/mobs/Gigas_Wrestler.lua b/scripts/zones/Lufaise_Meadows/mobs/Gigas_Wrestler.lua index 991f5eacec1..70911e0f6c8 100644 --- a/scripts/zones/Lufaise_Meadows/mobs/Gigas_Wrestler.lua +++ b/scripts/zones/Lufaise_Meadows/mobs/Gigas_Wrestler.lua @@ -7,7 +7,7 @@ mixins = { require('scripts/mixins/fomor_hate') } local entity = {} entity.onMobSpawn = function(mob) - mob:setLocalVar('fomorHateAdj', -1) + mob:setLocalVar('fomorHateAdj', 1) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Lufaise_Meadows/mobs/Orcish_Beastrider.lua b/scripts/zones/Lufaise_Meadows/mobs/Orcish_Beastrider.lua index 5ca491f3736..a0aeb92a264 100644 --- a/scripts/zones/Lufaise_Meadows/mobs/Orcish_Beastrider.lua +++ b/scripts/zones/Lufaise_Meadows/mobs/Orcish_Beastrider.lua @@ -7,7 +7,7 @@ mixins = { require('scripts/mixins/fomor_hate') } local entity = {} entity.onMobSpawn = function(mob) - mob:setLocalVar('fomorHateAdj', -1) + mob:setLocalVar('fomorHateAdj', 1) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Lufaise_Meadows/mobs/Orcish_Bowshooter.lua b/scripts/zones/Lufaise_Meadows/mobs/Orcish_Bowshooter.lua index 8f14ae49e41..4c27ed72866 100644 --- a/scripts/zones/Lufaise_Meadows/mobs/Orcish_Bowshooter.lua +++ b/scripts/zones/Lufaise_Meadows/mobs/Orcish_Bowshooter.lua @@ -7,7 +7,7 @@ mixins = { require('scripts/mixins/fomor_hate') } local entity = {} entity.onMobSpawn = function(mob) - mob:setLocalVar('fomorHateAdj', -1) + mob:setLocalVar('fomorHateAdj', 1) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Lufaise_Meadows/mobs/Orcish_Brawler.lua b/scripts/zones/Lufaise_Meadows/mobs/Orcish_Brawler.lua index 64869968221..b36745b19bc 100644 --- a/scripts/zones/Lufaise_Meadows/mobs/Orcish_Brawler.lua +++ b/scripts/zones/Lufaise_Meadows/mobs/Orcish_Brawler.lua @@ -7,7 +7,7 @@ mixins = { require('scripts/mixins/fomor_hate') } local entity = {} entity.onMobSpawn = function(mob) - mob:setLocalVar('fomorHateAdj', -1) + mob:setLocalVar('fomorHateAdj', 1) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Lufaise_Meadows/mobs/Orcish_Footsoldier.lua b/scripts/zones/Lufaise_Meadows/mobs/Orcish_Footsoldier.lua index fd52d6a76ee..4eac733bc01 100644 --- a/scripts/zones/Lufaise_Meadows/mobs/Orcish_Footsoldier.lua +++ b/scripts/zones/Lufaise_Meadows/mobs/Orcish_Footsoldier.lua @@ -7,7 +7,7 @@ mixins = { require('scripts/mixins/fomor_hate') } local entity = {} entity.onMobSpawn = function(mob) - mob:setLocalVar('fomorHateAdj', -1) + mob:setLocalVar('fomorHateAdj', 1) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Lufaise_Meadows/mobs/Orcish_Gladiator.lua b/scripts/zones/Lufaise_Meadows/mobs/Orcish_Gladiator.lua index 480b40dc92e..8bb6933cf38 100644 --- a/scripts/zones/Lufaise_Meadows/mobs/Orcish_Gladiator.lua +++ b/scripts/zones/Lufaise_Meadows/mobs/Orcish_Gladiator.lua @@ -7,7 +7,7 @@ mixins = { require('scripts/mixins/fomor_hate') } local entity = {} entity.onMobSpawn = function(mob) - mob:setLocalVar('fomorHateAdj', -1) + mob:setLocalVar('fomorHateAdj', 1) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Lufaise_Meadows/mobs/Orcish_Impaler.lua b/scripts/zones/Lufaise_Meadows/mobs/Orcish_Impaler.lua index 314441b65d4..a634a68e5dd 100644 --- a/scripts/zones/Lufaise_Meadows/mobs/Orcish_Impaler.lua +++ b/scripts/zones/Lufaise_Meadows/mobs/Orcish_Impaler.lua @@ -7,7 +7,7 @@ mixins = { require('scripts/mixins/fomor_hate') } local entity = {} entity.onMobSpawn = function(mob) - mob:setLocalVar('fomorHateAdj', -1) + mob:setLocalVar('fomorHateAdj', 1) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Lufaise_Meadows/mobs/Orcish_Nightraider.lua b/scripts/zones/Lufaise_Meadows/mobs/Orcish_Nightraider.lua index 03b3d7c4b0a..96b292cf78c 100644 --- a/scripts/zones/Lufaise_Meadows/mobs/Orcish_Nightraider.lua +++ b/scripts/zones/Lufaise_Meadows/mobs/Orcish_Nightraider.lua @@ -7,7 +7,7 @@ mixins = { require('scripts/mixins/fomor_hate') } local entity = {} entity.onMobSpawn = function(mob) - mob:setLocalVar('fomorHateAdj', -1) + mob:setLocalVar('fomorHateAdj', 1) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Lufaise_Meadows/mobs/Orcish_Stonelauncher.lua b/scripts/zones/Lufaise_Meadows/mobs/Orcish_Stonelauncher.lua index 8038810b855..42edc756071 100644 --- a/scripts/zones/Lufaise_Meadows/mobs/Orcish_Stonelauncher.lua +++ b/scripts/zones/Lufaise_Meadows/mobs/Orcish_Stonelauncher.lua @@ -7,7 +7,7 @@ mixins = { require('scripts/mixins/fomor_hate') } local entity = {} entity.onMobSpawn = function(mob) - mob:setLocalVar('fomorHateAdj', -1) + mob:setLocalVar('fomorHateAdj', 1) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Lufaise_Meadows/mobs/Orcish_Trooper.lua b/scripts/zones/Lufaise_Meadows/mobs/Orcish_Trooper.lua index 0eabf89c38a..0242f4c6763 100644 --- a/scripts/zones/Lufaise_Meadows/mobs/Orcish_Trooper.lua +++ b/scripts/zones/Lufaise_Meadows/mobs/Orcish_Trooper.lua @@ -7,7 +7,7 @@ mixins = { require('scripts/mixins/fomor_hate') } local entity = {} entity.onMobSpawn = function(mob) - mob:setLocalVar('fomorHateAdj', -1) + mob:setLocalVar('fomorHateAdj', 1) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Lufaise_Meadows/npcs/Logging_Point.lua b/scripts/zones/Lufaise_Meadows/npcs/Logging_Point.lua index 4548085fced..19f245a9811 100644 --- a/scripts/zones/Lufaise_Meadows/npcs/Logging_Point.lua +++ b/scripts/zones/Lufaise_Meadows/npcs/Logging_Point.lua @@ -5,11 +5,11 @@ local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.LOGGING, 112) + xi.helm.onTrade(player, npc, trade, xi.helmType.LOGGING, 112) end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.LOGGING) + xi.helm.onTrigger(player, xi.helmType.LOGGING) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/zones/Mamook/Zone.lua b/scripts/zones/Mamook/Zone.lua index cd5ef194587..6900131521a 100644 --- a/scripts/zones/Mamook/Zone.lua +++ b/scripts/zones/Mamook/Zone.lua @@ -4,7 +4,7 @@ local zoneObject = {} zoneObject.onInitialize = function(zone) - xi.helm.initZone(zone, xi.helm.type.LOGGING) + xi.helm.initZone(zone, xi.helmType.LOGGING) end zoneObject.onZoneIn = function(player, prevZone) diff --git a/scripts/zones/Mamook/npcs/Logging_Point.lua b/scripts/zones/Mamook/npcs/Logging_Point.lua index 6536207c6fa..b1d272d80f8 100644 --- a/scripts/zones/Mamook/npcs/Logging_Point.lua +++ b/scripts/zones/Mamook/npcs/Logging_Point.lua @@ -5,11 +5,11 @@ local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.LOGGING, 215) + xi.helm.onTrade(player, npc, trade, xi.helmType.LOGGING, 215) end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.LOGGING) + xi.helm.onTrigger(player, xi.helmType.LOGGING) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/zones/Mamool_Ja_Training_Grounds/globals/zoneUtil.lua b/scripts/zones/Mamool_Ja_Training_Grounds/globals/zoneUtil.lua index ca96a15324a..40fc8cab199 100644 --- a/scripts/zones/Mamool_Ja_Training_Grounds/globals/zoneUtil.lua +++ b/scripts/zones/Mamool_Ja_Training_Grounds/globals/zoneUtil.lua @@ -20,7 +20,7 @@ xi.zoneUtil.ImperialAgent_PotHatch = function(player, npc, posX, posZ, posR) npc:timer(2000, function(npcArg) ally:setPos(posX, -1, posZ, posR) ally:setStatus(xi.status.NORMAL) - ally:entityAnimationPacket('deru') + ally:entityAnimationPacket(xi.animationString.STATUS_VISIBLE) end) npc:timer(4000, function(npcArg) @@ -52,15 +52,15 @@ xi.zoneUtil.ImperialAgent_PotHatch = function(player, npc, posX, posZ, posR) end) npc:timer(20000, function(npcArg) - ally:entityAnimationPacket('cabk') + ally:entityAnimationPacket(xi.animationString.CAST_BLACK_MAGIC_START) end) npc:timer(22000, function(npcArg) - ally:entityAnimationPacket('shbk') + ally:entityAnimationPacket(xi.animationString.CAST_BLACK_MAGIC_STOP) end) npc:timer(23000, function(npcArg) - ally:entityAnimationPacket('kesu') + ally:entityAnimationPacket(xi.animationString.STATUS_DISAPPEAR) end) npc:timer(24500, function(npcArg) diff --git a/scripts/zones/Maze_of_Shakhrami/Zone.lua b/scripts/zones/Maze_of_Shakhrami/Zone.lua index 590b93119f8..c96be9f7cd3 100644 --- a/scripts/zones/Maze_of_Shakhrami/Zone.lua +++ b/scripts/zones/Maze_of_Shakhrami/Zone.lua @@ -19,7 +19,7 @@ zoneObject.onInitialize = function(zone) end xi.treasure.initZone(zone) - xi.helm.initZone(zone, xi.helm.type.EXCAVATION) + xi.helm.initZone(zone, xi.helmType.EXCAVATION) end zoneObject.onZoneIn = function(player, prevZone) diff --git a/scripts/zones/Maze_of_Shakhrami/npcs/Excavation_Point.lua b/scripts/zones/Maze_of_Shakhrami/npcs/Excavation_Point.lua index 36c9f6a4775..015702fab8b 100644 --- a/scripts/zones/Maze_of_Shakhrami/npcs/Excavation_Point.lua +++ b/scripts/zones/Maze_of_Shakhrami/npcs/Excavation_Point.lua @@ -16,12 +16,12 @@ entity.onTrade = function(player, npc, trade) player:confirmTrade() end else - xi.helm.onTrade(player, npc, trade, xi.helm.type.EXCAVATION, 60) + xi.helm.onTrade(player, npc, trade, xi.helmType.EXCAVATION, 60) end end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.EXCAVATION) + xi.helm.onTrigger(player, xi.helmType.EXCAVATION) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/zones/Misareaux_Coast/Zone.lua b/scripts/zones/Misareaux_Coast/Zone.lua index c7d9484bafb..48732edd58f 100644 --- a/scripts/zones/Misareaux_Coast/Zone.lua +++ b/scripts/zones/Misareaux_Coast/Zone.lua @@ -6,7 +6,7 @@ local misareauxGlobal = require('scripts/zones/Misareaux_Coast/globals') local zoneObject = {} zoneObject.onInitialize = function(zone) - xi.helm.initZone(zone, xi.helm.type.LOGGING) + xi.helm.initZone(zone, xi.helmType.LOGGING) misareauxGlobal.ziphiusHandleQM() end diff --git a/scripts/zones/Misareaux_Coast/mobs/Gigas_Braver.lua b/scripts/zones/Misareaux_Coast/mobs/Gigas_Braver.lua index 96049492771..ae9cee64e9d 100644 --- a/scripts/zones/Misareaux_Coast/mobs/Gigas_Braver.lua +++ b/scripts/zones/Misareaux_Coast/mobs/Gigas_Braver.lua @@ -7,7 +7,7 @@ mixins = { require('scripts/mixins/fomor_hate') } local entity = {} entity.onMobSpawn = function(mob) - mob:setLocalVar('fomorHateAdj', -1) + mob:setLocalVar('fomorHateAdj', 1) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Misareaux_Coast/mobs/Gigas_Catapulter.lua b/scripts/zones/Misareaux_Coast/mobs/Gigas_Catapulter.lua index 33b376d5556..51eb8ef3df3 100644 --- a/scripts/zones/Misareaux_Coast/mobs/Gigas_Catapulter.lua +++ b/scripts/zones/Misareaux_Coast/mobs/Gigas_Catapulter.lua @@ -7,7 +7,7 @@ mixins = { require('scripts/mixins/fomor_hate') } local entity = {} entity.onMobSpawn = function(mob) - mob:setLocalVar('fomorHateAdj', -1) + mob:setLocalVar('fomorHateAdj', 1) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Misareaux_Coast/mobs/Gigas_Martialist.lua b/scripts/zones/Misareaux_Coast/mobs/Gigas_Martialist.lua index 36cb3d9e60f..b511eda8ff0 100644 --- a/scripts/zones/Misareaux_Coast/mobs/Gigas_Martialist.lua +++ b/scripts/zones/Misareaux_Coast/mobs/Gigas_Martialist.lua @@ -7,7 +7,7 @@ mixins = { require('scripts/mixins/fomor_hate') } local entity = {} entity.onMobSpawn = function(mob) - mob:setLocalVar('fomorHateAdj', -1) + mob:setLocalVar('fomorHateAdj', 1) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Misareaux_Coast/mobs/Gigas_Warwolf.lua b/scripts/zones/Misareaux_Coast/mobs/Gigas_Warwolf.lua index 07a497737ab..98411978b1c 100644 --- a/scripts/zones/Misareaux_Coast/mobs/Gigas_Warwolf.lua +++ b/scripts/zones/Misareaux_Coast/mobs/Gigas_Warwolf.lua @@ -7,7 +7,7 @@ mixins = { require('scripts/mixins/fomor_hate') } local entity = {} entity.onMobSpawn = function(mob) - mob:setLocalVar('fomorHateAdj', -1) + mob:setLocalVar('fomorHateAdj', 1) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Misareaux_Coast/mobs/Gration.lua b/scripts/zones/Misareaux_Coast/mobs/Gration.lua index 2ef9f398f3e..32f3adbdb0c 100644 --- a/scripts/zones/Misareaux_Coast/mobs/Gration.lua +++ b/scripts/zones/Misareaux_Coast/mobs/Gration.lua @@ -8,7 +8,7 @@ local entity = {} entity.onMobSpawn = function(mob) mob:addStatusEffect(xi.effect.KILLER_INSTINCT, 40, 0, 0) - mob:setLocalVar('fomorHateAdj', -2) + mob:setLocalVar('fomorHateAdj', 2) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Misareaux_Coast/mobs/Orcish_Bowshooter.lua b/scripts/zones/Misareaux_Coast/mobs/Orcish_Bowshooter.lua index a1905cc330e..2478991f1ea 100644 --- a/scripts/zones/Misareaux_Coast/mobs/Orcish_Bowshooter.lua +++ b/scripts/zones/Misareaux_Coast/mobs/Orcish_Bowshooter.lua @@ -7,7 +7,7 @@ mixins = { require('scripts/mixins/fomor_hate') } local entity = {} entity.onMobSpawn = function(mob) - mob:setLocalVar('fomorHateAdj', -1) + mob:setLocalVar('fomorHateAdj', 1) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Misareaux_Coast/mobs/Orcish_Footsoldier.lua b/scripts/zones/Misareaux_Coast/mobs/Orcish_Footsoldier.lua index 9fddc3d23c4..744ec9ed477 100644 --- a/scripts/zones/Misareaux_Coast/mobs/Orcish_Footsoldier.lua +++ b/scripts/zones/Misareaux_Coast/mobs/Orcish_Footsoldier.lua @@ -7,7 +7,7 @@ mixins = { require('scripts/mixins/fomor_hate') } local entity = {} entity.onMobSpawn = function(mob) - mob:setLocalVar('fomorHateAdj', -1) + mob:setLocalVar('fomorHateAdj', 1) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Misareaux_Coast/mobs/Orcish_Gladiator.lua b/scripts/zones/Misareaux_Coast/mobs/Orcish_Gladiator.lua index 5b977cdeb10..ec013708f30 100644 --- a/scripts/zones/Misareaux_Coast/mobs/Orcish_Gladiator.lua +++ b/scripts/zones/Misareaux_Coast/mobs/Orcish_Gladiator.lua @@ -7,7 +7,7 @@ mixins = { require('scripts/mixins/fomor_hate') } local entity = {} entity.onMobSpawn = function(mob) - mob:setLocalVar('fomorHateAdj', -1) + mob:setLocalVar('fomorHateAdj', 1) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Misareaux_Coast/mobs/Orcish_Stonelauncher.lua b/scripts/zones/Misareaux_Coast/mobs/Orcish_Stonelauncher.lua index 9c91e811e3d..ba9a904c9ac 100644 --- a/scripts/zones/Misareaux_Coast/mobs/Orcish_Stonelauncher.lua +++ b/scripts/zones/Misareaux_Coast/mobs/Orcish_Stonelauncher.lua @@ -7,7 +7,7 @@ mixins = { require('scripts/mixins/fomor_hate') } local entity = {} entity.onMobSpawn = function(mob) - mob:setLocalVar('fomorHateAdj', -1) + mob:setLocalVar('fomorHateAdj', 1) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Misareaux_Coast/mobs/Orcish_Trooper.lua b/scripts/zones/Misareaux_Coast/mobs/Orcish_Trooper.lua index 51c9f3d7b01..b65ac54c228 100644 --- a/scripts/zones/Misareaux_Coast/mobs/Orcish_Trooper.lua +++ b/scripts/zones/Misareaux_Coast/mobs/Orcish_Trooper.lua @@ -7,7 +7,7 @@ mixins = { require('scripts/mixins/fomor_hate') } local entity = {} entity.onMobSpawn = function(mob) - mob:setLocalVar('fomorHateAdj', -1) + mob:setLocalVar('fomorHateAdj', 1) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Misareaux_Coast/npcs/Logging_Point.lua b/scripts/zones/Misareaux_Coast/npcs/Logging_Point.lua index d0bf06acab9..9a78f60ca86 100644 --- a/scripts/zones/Misareaux_Coast/npcs/Logging_Point.lua +++ b/scripts/zones/Misareaux_Coast/npcs/Logging_Point.lua @@ -5,11 +5,11 @@ local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.LOGGING, 555) + xi.helm.onTrade(player, npc, trade, xi.helmType.LOGGING, 555) end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.LOGGING) + xi.helm.onTrigger(player, xi.helmType.LOGGING) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/zones/Mount_Zhayolm/Zone.lua b/scripts/zones/Mount_Zhayolm/Zone.lua index d11a3ebd26a..7def806f61f 100644 --- a/scripts/zones/Mount_Zhayolm/Zone.lua +++ b/scripts/zones/Mount_Zhayolm/Zone.lua @@ -8,7 +8,7 @@ local zoneObject = {} zoneObject.onInitialize = function(zone) GetMobByID(ID.mob.CERBERUS):setRespawnTime(math.random(12, 36) * 3600) - xi.helm.initZone(zone, xi.helm.type.MINING) + xi.helm.initZone(zone, xi.helmType.MINING) end zoneObject.onZoneIn = function(player, prevZone) diff --git a/scripts/zones/Mount_Zhayolm/npcs/Mining_Point.lua b/scripts/zones/Mount_Zhayolm/npcs/Mining_Point.lua index 9f0f1b30cb9..bab76ccd854 100644 --- a/scripts/zones/Mount_Zhayolm/npcs/Mining_Point.lua +++ b/scripts/zones/Mount_Zhayolm/npcs/Mining_Point.lua @@ -5,11 +5,11 @@ local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.MINING, 153) + xi.helm.onTrade(player, npc, trade, xi.helmType.MINING, 153) end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.MINING) + xi.helm.onTrigger(player, xi.helmType.MINING) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/zones/Newton_Movalpolos/Zone.lua b/scripts/zones/Newton_Movalpolos/Zone.lua index 8978959b758..0615cc42c58 100644 --- a/scripts/zones/Newton_Movalpolos/Zone.lua +++ b/scripts/zones/Newton_Movalpolos/Zone.lua @@ -5,7 +5,7 @@ local zoneObject = {} zoneObject.onInitialize = function(zone) xi.treasure.initZone(zone) - xi.helm.initZone(zone, xi.helm.type.MINING) + xi.helm.initZone(zone, xi.helmType.MINING) end zoneObject.onZoneIn = function(player, prevZone) diff --git a/scripts/zones/Newton_Movalpolos/npcs/Mining_Point.lua b/scripts/zones/Newton_Movalpolos/npcs/Mining_Point.lua index 406dd5dd841..e0f0eec330b 100644 --- a/scripts/zones/Newton_Movalpolos/npcs/Mining_Point.lua +++ b/scripts/zones/Newton_Movalpolos/npcs/Mining_Point.lua @@ -5,11 +5,11 @@ local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.MINING, 10) + xi.helm.onTrade(player, npc, trade, xi.helmType.MINING, 10) end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.MINING) + xi.helm.onTrigger(player, xi.helmType.MINING) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/zones/North_Gustaberg_[S]/Zone.lua b/scripts/zones/North_Gustaberg_[S]/Zone.lua index 50b0f8ce03f..59d190f5fdc 100644 --- a/scripts/zones/North_Gustaberg_[S]/Zone.lua +++ b/scripts/zones/North_Gustaberg_[S]/Zone.lua @@ -10,7 +10,7 @@ zoneObject.onInitialize = function(zone) -- UpdatSpawnPoint(OLGOI_KHORKHOI:getID()) TODO: need rows in nm_spawn_points.sql olgoikhorkhoi:setRespawnTime(math.random(3600, 5400)) - xi.helm.initZone(zone, xi.helm.type.MINING) + xi.helm.initZone(zone, xi.helmType.MINING) xi.voidwalker.zoneOnInit(zone) end diff --git a/scripts/zones/North_Gustaberg_[S]/npcs/Mining_Point.lua b/scripts/zones/North_Gustaberg_[S]/npcs/Mining_Point.lua index 4880b261d7c..ca7b56563c2 100644 --- a/scripts/zones/North_Gustaberg_[S]/npcs/Mining_Point.lua +++ b/scripts/zones/North_Gustaberg_[S]/npcs/Mining_Point.lua @@ -5,11 +5,11 @@ local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.MINING, 211) + xi.helm.onTrade(player, npc, trade, xi.helmType.MINING, 211) end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.MINING) + xi.helm.onTrigger(player, xi.helmType.MINING) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/zones/Oldton_Movalpolos/Zone.lua b/scripts/zones/Oldton_Movalpolos/Zone.lua index c34e835cf10..de1db8db04f 100644 --- a/scripts/zones/Oldton_Movalpolos/Zone.lua +++ b/scripts/zones/Oldton_Movalpolos/Zone.lua @@ -6,7 +6,7 @@ local zoneObject = {} zoneObject.onInitialize = function(zone) xi.conq.setRegionalConquestOverseers(zone:getRegionID()) xi.treasure.initZone(zone) - xi.helm.initZone(zone, xi.helm.type.MINING) + xi.helm.initZone(zone, xi.helmType.MINING) end zoneObject.onConquestUpdate = function(zone, updatetype, influence, owner, ranking, isConquestAlliance) diff --git a/scripts/zones/Oldton_Movalpolos/npcs/Mining_Point.lua b/scripts/zones/Oldton_Movalpolos/npcs/Mining_Point.lua index b514a64449d..88858013f08 100644 --- a/scripts/zones/Oldton_Movalpolos/npcs/Mining_Point.lua +++ b/scripts/zones/Oldton_Movalpolos/npcs/Mining_Point.lua @@ -5,11 +5,11 @@ local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.MINING, 11) + xi.helm.onTrade(player, npc, trade, xi.helmType.MINING, 11) end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.MINING) + xi.helm.onTrigger(player, xi.helmType.MINING) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/zones/Palborough_Mines/Zone.lua b/scripts/zones/Palborough_Mines/Zone.lua index acd4a814109..adfc3917e69 100644 --- a/scripts/zones/Palborough_Mines/Zone.lua +++ b/scripts/zones/Palborough_Mines/Zone.lua @@ -5,7 +5,7 @@ local zoneObject = {} zoneObject.onInitialize = function(zone) xi.treasure.initZone(zone) - xi.helm.initZone(zone, xi.helm.type.MINING) + xi.helm.initZone(zone, xi.helmType.MINING) end zoneObject.onZoneIn = function(player, prevZone) diff --git a/scripts/zones/Palborough_Mines/npcs/Mining_Point.lua b/scripts/zones/Palborough_Mines/npcs/Mining_Point.lua index c328e589c1d..d2ba65ab260 100644 --- a/scripts/zones/Palborough_Mines/npcs/Mining_Point.lua +++ b/scripts/zones/Palborough_Mines/npcs/Mining_Point.lua @@ -5,11 +5,11 @@ local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.MINING, 120) + xi.helm.onTrade(player, npc, trade, xi.helmType.MINING, 120) end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.MINING) + xi.helm.onTrigger(player, xi.helmType.MINING) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/zones/Phomiuna_Aqueducts/mobs/Mahisha.lua b/scripts/zones/Phomiuna_Aqueducts/mobs/Mahisha.lua index 1cf811f166f..0d8077cb921 100644 --- a/scripts/zones/Phomiuna_Aqueducts/mobs/Mahisha.lua +++ b/scripts/zones/Phomiuna_Aqueducts/mobs/Mahisha.lua @@ -7,7 +7,7 @@ mixins = { require('scripts/mixins/fomor_hate') } local entity = {} entity.onMobSpawn = function(mob) - mob:setLocalVar('fomorHateAdj', -1) + mob:setLocalVar('fomorHateAdj', 1) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Phomiuna_Aqueducts/mobs/Minotaur.lua b/scripts/zones/Phomiuna_Aqueducts/mobs/Minotaur.lua index c219de16c4a..ca27acc0c94 100644 --- a/scripts/zones/Phomiuna_Aqueducts/mobs/Minotaur.lua +++ b/scripts/zones/Phomiuna_Aqueducts/mobs/Minotaur.lua @@ -7,7 +7,7 @@ mixins = { require('scripts/mixins/fomor_hate') } local entity = {} entity.onMobSpawn = function(mob) - mob:setLocalVar('fomorHateAdj', -2) + mob:setLocalVar('fomorHateAdj', 2) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Phomiuna_Aqueducts/mobs/Stegotaur.lua b/scripts/zones/Phomiuna_Aqueducts/mobs/Stegotaur.lua index 38b17519bec..653b0224e9b 100644 --- a/scripts/zones/Phomiuna_Aqueducts/mobs/Stegotaur.lua +++ b/scripts/zones/Phomiuna_Aqueducts/mobs/Stegotaur.lua @@ -7,7 +7,7 @@ mixins = { require('scripts/mixins/fomor_hate') } local entity = {} entity.onMobSpawn = function(mob) - mob:setLocalVar('fomorHateAdj', -1) + mob:setLocalVar('fomorHateAdj', 1) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Phomiuna_Aqueducts/mobs/Teratotaur.lua b/scripts/zones/Phomiuna_Aqueducts/mobs/Teratotaur.lua index cdf6cf9adb9..127b29fdde1 100644 --- a/scripts/zones/Phomiuna_Aqueducts/mobs/Teratotaur.lua +++ b/scripts/zones/Phomiuna_Aqueducts/mobs/Teratotaur.lua @@ -7,7 +7,7 @@ mixins = { require('scripts/mixins/fomor_hate') } local entity = {} entity.onMobSpawn = function(mob) - mob:setLocalVar('fomorHateAdj', -1) + mob:setLocalVar('fomorHateAdj', 1) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Southern_San_dOria/npcs/Moozo-Koozo.lua b/scripts/zones/Southern_San_dOria/npcs/Moozo-Koozo.lua index ee2e41b8491..03c3d703f57 100644 --- a/scripts/zones/Southern_San_dOria/npcs/Moozo-Koozo.lua +++ b/scripts/zones/Southern_San_dOria/npcs/Moozo-Koozo.lua @@ -161,14 +161,14 @@ entity.onTrade = function(player, npc, trade) end entity.onTrigger = function(player, npc) - xi.title.changerOnTrigger(player, eventId, titleInfo) + xi.titleChanger.onTrigger(player, eventId, titleInfo) end entity.onEventUpdate = function(player, csid, option, npc) end entity.onEventFinish = function(player, csid, option, npc) - xi.title.changerOnEventFinish(player, csid, option, eventId, titleInfo) + xi.titleChanger.onEventFinish(player, csid, option, eventId, titleInfo) end return entity diff --git a/scripts/zones/Tahrongi_Canyon/Zone.lua b/scripts/zones/Tahrongi_Canyon/Zone.lua index 169f4d15577..f01addb2813 100644 --- a/scripts/zones/Tahrongi_Canyon/Zone.lua +++ b/scripts/zones/Tahrongi_Canyon/Zone.lua @@ -12,7 +12,7 @@ zoneObject.onChocoboDig = function(player, precheck) end zoneObject.onInitialize = function(zone) - xi.helm.initZone(zone, xi.helm.type.EXCAVATION) + xi.helm.initZone(zone, xi.helmType.EXCAVATION) xi.chocobo.initZone(zone) xi.voidwalker.zoneOnInit(zone) end diff --git a/scripts/zones/Tahrongi_Canyon/npcs/Excavation_Point.lua b/scripts/zones/Tahrongi_Canyon/npcs/Excavation_Point.lua index 6e0642238ac..081a19332da 100644 --- a/scripts/zones/Tahrongi_Canyon/npcs/Excavation_Point.lua +++ b/scripts/zones/Tahrongi_Canyon/npcs/Excavation_Point.lua @@ -5,11 +5,11 @@ local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.EXCAVATION, 901) + xi.helm.onTrade(player, npc, trade, xi.helmType.EXCAVATION, 901) end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.EXCAVATION) + xi.helm.onTrigger(player, xi.helmType.EXCAVATION) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/zones/The_Ashu_Talif/mobs/Ashu_Talif_Captain.lua b/scripts/zones/The_Ashu_Talif/mobs/Ashu_Talif_Captain.lua index ca915ff9856..ea8785d27e5 100644 --- a/scripts/zones/The_Ashu_Talif/mobs/Ashu_Talif_Captain.lua +++ b/scripts/zones/The_Ashu_Talif/mobs/Ashu_Talif_Captain.lua @@ -15,10 +15,10 @@ local captainEngageSequence = function(mob) mob:setLocalVar('jump', 1) mob:showText(mob, ID.text.OVERPOWERED_CREW) mob:hideName(true) - mob:entityAnimationPacket('jmp0') + mob:entityAnimationPacket(xi.animationString.JUMP_0) mob:timer(2000, function(m) m:setPos(0, -22, 13, 192) - m:entityAnimationPacket('jmp1') + m:entityAnimationPacket(xi.animationString.JUMP_1) m:showText(mob, ID.text.TEST_YOUR_BLADES) m:timer(2000, function(mAnimation) mAnimation:hideName(false) diff --git a/scripts/zones/The_Garden_of_RuHmet/npcs/qm_ixaern_drk.lua b/scripts/zones/The_Garden_of_RuHmet/npcs/qm_ixaern_drk.lua index 74d1c1c79fe..d5471650af0 100644 --- a/scripts/zones/The_Garden_of_RuHmet/npcs/qm_ixaern_drk.lua +++ b/scripts/zones/The_Garden_of_RuHmet/npcs/qm_ixaern_drk.lua @@ -37,7 +37,9 @@ entity.onTrigger = function(player, npc) -- this player has animosity -- spawn Ix'Aern DRK and its two minions near the QM player:messageSpecial(ID.text.MENACING_CREATURES) - npcUtil.popFromQM(player, npc, { ID.mob.IXAERN_DRK, ID.mob.IXAERN_DRK + 1, ID.mob.IXAERN_DRK + 2 }, { radius = 3 }) + + -- spawn Ix'DRK last so it retains claim + npcUtil.popFromQM(player, npc, { ID.mob.IXAERN_DRK + 1, ID.mob.IXAERN_DRK + 2, ID.mob.IXAERN_DRK }, { radius = 3, claim = true }) -- move QM to random location, and reset animosity local pos = math.random(1, 4) diff --git a/scripts/zones/Wajaom_Woodlands/Zone.lua b/scripts/zones/Wajaom_Woodlands/Zone.lua index 2d0cb009f03..9d0fe247b07 100644 --- a/scripts/zones/Wajaom_Woodlands/Zone.lua +++ b/scripts/zones/Wajaom_Woodlands/Zone.lua @@ -8,7 +8,7 @@ zoneObject.onChocoboDig = function(player, precheck) end zoneObject.onInitialize = function(zone) - xi.helm.initZone(zone, xi.helm.type.HARVESTING) + xi.helm.initZone(zone, xi.helmType.HARVESTING) xi.chocobo.initZone(zone) end diff --git a/scripts/zones/Wajaom_Woodlands/npcs/Harvesting_Point.lua b/scripts/zones/Wajaom_Woodlands/npcs/Harvesting_Point.lua index e0010e87151..66f27df3e3e 100644 --- a/scripts/zones/Wajaom_Woodlands/npcs/Harvesting_Point.lua +++ b/scripts/zones/Wajaom_Woodlands/npcs/Harvesting_Point.lua @@ -5,11 +5,11 @@ local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.HARVESTING, 507) + xi.helm.onTrade(player, npc, trade, xi.helmType.HARVESTING, 507) end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.HARVESTING) + xi.helm.onTrigger(player, xi.helmType.HARVESTING) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/zones/West_Sarutabaruta/Zone.lua b/scripts/zones/West_Sarutabaruta/Zone.lua index 0a49c1ca3ec..08cc8eab65b 100644 --- a/scripts/zones/West_Sarutabaruta/Zone.lua +++ b/scripts/zones/West_Sarutabaruta/Zone.lua @@ -12,7 +12,7 @@ end zoneObject.onInitialize = function(zone) xi.conq.setRegionalConquestOverseers(zone:getRegionID()) - xi.helm.initZone(zone, xi.helm.type.HARVESTING) + xi.helm.initZone(zone, xi.helmType.HARVESTING) xi.voidwalker.zoneOnInit(zone) end diff --git a/scripts/zones/West_Sarutabaruta/npcs/Harvesting_Point.lua b/scripts/zones/West_Sarutabaruta/npcs/Harvesting_Point.lua index ee00c8a9186..48a764de852 100644 --- a/scripts/zones/West_Sarutabaruta/npcs/Harvesting_Point.lua +++ b/scripts/zones/West_Sarutabaruta/npcs/Harvesting_Point.lua @@ -5,11 +5,11 @@ local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.HARVESTING, 901) + xi.helm.onTrade(player, npc, trade, xi.helmType.HARVESTING, 901) end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.HARVESTING) + xi.helm.onTrigger(player, xi.helmType.HARVESTING) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/zones/West_Sarutabaruta_[S]/Zone.lua b/scripts/zones/West_Sarutabaruta_[S]/Zone.lua index f2d18fb84d1..20047ce6139 100644 --- a/scripts/zones/West_Sarutabaruta_[S]/Zone.lua +++ b/scripts/zones/West_Sarutabaruta_[S]/Zone.lua @@ -6,7 +6,7 @@ require('scripts/globals/dark_ixion') local zoneObject = {} zoneObject.onInitialize = function(zone) - xi.helm.initZone(zone, xi.helm.type.HARVESTING) + xi.helm.initZone(zone, xi.helmType.HARVESTING) xi.voidwalker.zoneOnInit(zone) xi.darkixion.zoneOnInit(zone) end diff --git a/scripts/zones/West_Sarutabaruta_[S]/npcs/Harvesting_Point.lua b/scripts/zones/West_Sarutabaruta_[S]/npcs/Harvesting_Point.lua index 3b2f0e1cd8a..f92708c871e 100644 --- a/scripts/zones/West_Sarutabaruta_[S]/npcs/Harvesting_Point.lua +++ b/scripts/zones/West_Sarutabaruta_[S]/npcs/Harvesting_Point.lua @@ -5,11 +5,11 @@ local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.HARVESTING, 901) + xi.helm.onTrade(player, npc, trade, xi.helmType.HARVESTING, 901) end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.HARVESTING) + xi.helm.onTrigger(player, xi.helmType.HARVESTING) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/zones/Windurst_Waters/DefaultActions.lua b/scripts/zones/Windurst_Waters/DefaultActions.lua index 5698f9d81f9..78d802838c2 100644 --- a/scripts/zones/Windurst_Waters/DefaultActions.lua +++ b/scripts/zones/Windurst_Waters/DefaultActions.lua @@ -1,29 +1,31 @@ --- local ID = zones[xi.zone.WINDURST_WATERS] +local ID = zones[xi.zone.WINDURST_WATERS] return { - ['Akkeke'] = { event = 427 }, - ['Chomoro-Kyotoro'] = { event = 432 }, - ['Cochal-Monchal'] = { event = 696 }, - ['Foi-Mui'] = { event = 430 }, - ['Fuepepe'] = { event = 423 }, - ['Furakku-Norakku'] = { event = 371 }, - ['Gantineux'] = { event = 10018 }, - ['Hariga-Origa'] = { event = 372 }, - ['Kerutoto'] = { event = 306 }, - ['Kirarara'] = { event = 425 }, - ['Koko_Lihzeh'] = { event = 428 }, - ['Leepe-Hoppe'] = { event = 345 }, - ['Library_book1'] = { event = 367 }, - ['Library_book2'] = { event = 368 }, - ['Mashuu-Ajuu'] = { event = 429 }, - ['Mimomo'] = { event = 436 }, - ['Ohbiru-Dohbiru'] = { event = 344 }, - ['Orn'] = { event = 652 }, - ['Paku-Nakku'] = { event = 431 }, - ['Pechiru-Mashiru'] = { event = 421 }, - ['Rukuku'] = { event = 426 }, - ['Sahgi_Konchumih'] = { event = 596 }, - ['Serukoko'] = { event = 373 }, - ['Sohdede'] = { event = 374 }, - ['Tauwawa'] = { event = 424 }, + ['Akkeke'] = { event = 427 }, + ['Chomoro-Kyotoro'] = { event = 432 }, + ['Cochal-Monchal'] = { event = 696 }, + ['Foi-Mui'] = { event = 430 }, + ['Fuepepe'] = { event = 423 }, + ['Furakku-Norakku'] = { event = 371 }, + ['Gantineux'] = { event = 10018 }, + ['Hariga-Origa'] = { event = 372 }, + ['Kerutoto'] = { event = 306 }, + ['Kirarara'] = { event = 425 }, + ['Koko_Lihzeh'] = { event = 428 }, + ['Leepe-Hoppe'] = { event = 345 }, + ['Library_book1'] = { event = 367 }, + ['Library_book2'] = { event = 368 }, + ['Mashuu-Ajuu'] = { event = 429 }, + ['Mimomo'] = { event = 436 }, + ['Ohbiru-Dohbiru'] = { event = 344 }, + ['Orn'] = { event = 652 }, + ['Paku-Nakku'] = { event = 431 }, + ['Pechiru-Mashiru'] = { event = 421 }, + ['Rukuku'] = { event = 426 }, + ['Sahgi_Konchumih'] = { event = 596 }, + ['Serukoko'] = { event = 373 }, + ['Sohdede'] = { event = 374 }, + ['Tauwawa'] = { event = 424 }, + ['Door_Acolyte_Hostel'] = { messageSpecial = ID.text.FIRMLY_SHUT }, + ['Door_Acolyte_Hostel_F'] = { messageSpecial = ID.text.KNOCKING }, } diff --git a/scripts/zones/Windurst_Waters/IDs.lua b/scripts/zones/Windurst_Waters/IDs.lua index 6b61140ae83..bf56f2c85d2 100644 --- a/scripts/zones/Windurst_Waters/IDs.lua +++ b/scripts/zones/Windurst_Waters/IDs.lua @@ -53,6 +53,10 @@ zones[xi.zone.WINDURST_WATERS] = JOURILLE_CLOSED_DIALOG = 8962, -- Greetings! I am Jourille, your friendly neighborhood traveling merchant. I would most like to sell you something from Ronfaure right now, but I regret that I am waiting on my next shipment. Please call by later! YOU_SHOW_OFF_THE = 9138, -- You show off the . CONQUEST = 9248, -- You've earned conquest points! + FIRMLY_SHUT = 9601, -- The door is firmly shut... + KNOCKING = 10024, -- ...You try knocking, but there is no response. + HOSTEL_CHEAT = 10029, -- But that was a wong, wong time ago... Wait a minute. You anshered all the queshtions in QUIZ DE VANA'DIEW correctwy. + HOSTEL_PRIZE = 10030, -- You weren't cheat-sheetin' now, were you? Well, no matter. Here's your prize. You earned it. TRICK_OR_TREAT = 10197, -- Trick or treat... THANK_YOU_TREAT = 10198, -- Thank you... And now for your treat... HERE_TAKE_THIS = 10199, -- Here, take this... @@ -80,6 +84,7 @@ zones[xi.zone.WINDURST_WATERS] = [17752103] = 62, -- Ahyeekih }, + ACOLYTE_HOSTEL_DOOR_OFFSET = GetFirstID('Door_Acolyte_Hostel'), LELEROON_GREEN_DOOR = 17752333, }, } diff --git a/scripts/zones/Yhoator_Jungle/Zone.lua b/scripts/zones/Yhoator_Jungle/Zone.lua index 93367e52a42..96c173c65e3 100644 --- a/scripts/zones/Yhoator_Jungle/Zone.lua +++ b/scripts/zones/Yhoator_Jungle/Zone.lua @@ -26,8 +26,8 @@ zoneObject.onInitialize = function(zone) xi.conq.setRegionalConquestOverseers(zone:getRegionID()) - xi.helm.initZone(zone, xi.helm.type.HARVESTING) - xi.helm.initZone(zone, xi.helm.type.LOGGING) + xi.helm.initZone(zone, xi.helmType.HARVESTING) + xi.helm.initZone(zone, xi.helmType.LOGGING) xi.chocobo.initZone(zone) xi.bmt.updatePeddlestox(xi.zone.YUHTUNGA_JUNGLE, ID.npc.PEDDLESTOX) diff --git a/scripts/zones/Yhoator_Jungle/npcs/Harvesting_Point.lua b/scripts/zones/Yhoator_Jungle/npcs/Harvesting_Point.lua index 48422a18b21..d911a187cae 100644 --- a/scripts/zones/Yhoator_Jungle/npcs/Harvesting_Point.lua +++ b/scripts/zones/Yhoator_Jungle/npcs/Harvesting_Point.lua @@ -5,11 +5,11 @@ local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.HARVESTING, 11) + xi.helm.onTrade(player, npc, trade, xi.helmType.HARVESTING, 11) end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.HARVESTING) + xi.helm.onTrigger(player, xi.helmType.HARVESTING) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/zones/Yhoator_Jungle/npcs/Logging_Point.lua b/scripts/zones/Yhoator_Jungle/npcs/Logging_Point.lua index 21e95bf7dfc..9711bf9eeb5 100644 --- a/scripts/zones/Yhoator_Jungle/npcs/Logging_Point.lua +++ b/scripts/zones/Yhoator_Jungle/npcs/Logging_Point.lua @@ -5,11 +5,11 @@ local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.LOGGING, 10) + xi.helm.onTrade(player, npc, trade, xi.helmType.LOGGING, 10) end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.LOGGING) + xi.helm.onTrigger(player, xi.helmType.LOGGING) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/zones/Yughott_Grotto/Zone.lua b/scripts/zones/Yughott_Grotto/Zone.lua index 7eb8438f08e..3f14a6263a0 100644 --- a/scripts/zones/Yughott_Grotto/Zone.lua +++ b/scripts/zones/Yughott_Grotto/Zone.lua @@ -5,7 +5,7 @@ local zoneObject = {} zoneObject.onInitialize = function(zone) xi.treasure.initZone(zone) - xi.helm.initZone(zone, xi.helm.type.MINING) + xi.helm.initZone(zone, xi.helmType.MINING) end zoneObject.onZoneIn = function(player, prevZone) diff --git a/scripts/zones/Yughott_Grotto/npcs/Mining_Point.lua b/scripts/zones/Yughott_Grotto/npcs/Mining_Point.lua index 7aa0fd2d44e..4ce0b31d913 100644 --- a/scripts/zones/Yughott_Grotto/npcs/Mining_Point.lua +++ b/scripts/zones/Yughott_Grotto/npcs/Mining_Point.lua @@ -5,11 +5,11 @@ local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.MINING, 100) + xi.helm.onTrade(player, npc, trade, xi.helmType.MINING, 100) end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.MINING) + xi.helm.onTrigger(player, xi.helmType.MINING) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/zones/Yuhtunga_Jungle/IDs.lua b/scripts/zones/Yuhtunga_Jungle/IDs.lua index 5183c4c8a2d..65a0915e42d 100644 --- a/scripts/zones/Yuhtunga_Jungle/IDs.lua +++ b/scripts/zones/Yuhtunga_Jungle/IDs.lua @@ -61,6 +61,7 @@ zones[xi.zone.YUHTUNGA_JUNGLE] = }, TIPHA = 17281030, CARTHI = 17281031, + PYUU_THE_SPATEMAKER = GetFirstID('Pyuu_the_Spatemaker'), ROSE_GARDEN_PH = 17281356, ROSE_GARDEN = 17281357, VOLUPTUOUS_VILMA = 17281358, diff --git a/scripts/zones/Yuhtunga_Jungle/Zone.lua b/scripts/zones/Yuhtunga_Jungle/Zone.lua index 8678a3f8748..fadabae31a3 100644 --- a/scripts/zones/Yuhtunga_Jungle/Zone.lua +++ b/scripts/zones/Yuhtunga_Jungle/Zone.lua @@ -14,10 +14,12 @@ end zoneObject.onInitialize = function(zone) xi.conq.setRegionalConquestOverseers(zone:getRegionID()) - xi.helm.initZone(zone, xi.helm.type.HARVESTING) - xi.helm.initZone(zone, xi.helm.type.LOGGING) + xi.helm.initZone(zone, xi.helmType.HARVESTING) + xi.helm.initZone(zone, xi.helmType.LOGGING) xi.bmt.updatePeddlestox(xi.zone.YUHTUNGA_JUNGLE, ID.npc.PEDDLESTOX) + + GetMobByID(ID.mob.PYUU_THE_SPATEMAKER):setRespawnTime(math.random(5400, 7200)) end zoneObject.onGameDay = function() diff --git a/scripts/zones/Yuhtunga_Jungle/mobs/Pyuu_the_Spatemaker.lua b/scripts/zones/Yuhtunga_Jungle/mobs/Pyuu_the_Spatemaker.lua index 7f7c39eb2f1..159270a8df3 100644 --- a/scripts/zones/Yuhtunga_Jungle/mobs/Pyuu_the_Spatemaker.lua +++ b/scripts/zones/Yuhtunga_Jungle/mobs/Pyuu_the_Spatemaker.lua @@ -4,9 +4,22 @@ ----------------------------------- local entity = {} +entity.onMobInitialize = function(mob) + mob:setMobMod(xi.mobMod.ADD_EFFECT, 1) +end + +entity.onAdditionalEffect = function(mob, target, damage) + return xi.mob.onAddEffect(mob, target, damage, xi.mob.ae.ENWATER) +end + entity.onMobDeath = function(mob, player, optParams) xi.hunts.checkHunt(mob, player, 364) xi.regime.checkRegime(player, mob, 127, 1, xi.regime.type.FIELDS) end +entity.onMobDespawn = function(mob) + UpdateNMSpawnPoint(mob:getID()) + mob:setRespawnTime(math.random(5400, 7200)) -- 1.5 to 2 hours +end + return entity diff --git a/scripts/zones/Yuhtunga_Jungle/npcs/Harvesting_Point.lua b/scripts/zones/Yuhtunga_Jungle/npcs/Harvesting_Point.lua index 32a714edb3a..c697cdc97a8 100644 --- a/scripts/zones/Yuhtunga_Jungle/npcs/Harvesting_Point.lua +++ b/scripts/zones/Yuhtunga_Jungle/npcs/Harvesting_Point.lua @@ -5,11 +5,11 @@ local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.HARVESTING, 206) + xi.helm.onTrade(player, npc, trade, xi.helmType.HARVESTING, 206) end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.HARVESTING) + xi.helm.onTrigger(player, xi.helmType.HARVESTING) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/zones/Yuhtunga_Jungle/npcs/Logging_Point.lua b/scripts/zones/Yuhtunga_Jungle/npcs/Logging_Point.lua index 557c438d2b9..a63be8511c7 100644 --- a/scripts/zones/Yuhtunga_Jungle/npcs/Logging_Point.lua +++ b/scripts/zones/Yuhtunga_Jungle/npcs/Logging_Point.lua @@ -5,11 +5,11 @@ local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.LOGGING, 205) + xi.helm.onTrade(player, npc, trade, xi.helmType.LOGGING, 205) end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.LOGGING) + xi.helm.onTrigger(player, xi.helmType.LOGGING) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/zones/Zeruhn_Mines/Zone.lua b/scripts/zones/Zeruhn_Mines/Zone.lua index fda061738de..c742741311c 100644 --- a/scripts/zones/Zeruhn_Mines/Zone.lua +++ b/scripts/zones/Zeruhn_Mines/Zone.lua @@ -4,7 +4,7 @@ local zoneObject = {} zoneObject.onInitialize = function(zone) - xi.helm.initZone(zone, xi.helm.type.MINING) + xi.helm.initZone(zone, xi.helmType.MINING) end zoneObject.onZoneIn = function(player, prevZone) diff --git a/scripts/zones/Zeruhn_Mines/npcs/Mining_Point.lua b/scripts/zones/Zeruhn_Mines/npcs/Mining_Point.lua index 2ec4924043c..3a12a7c3884 100644 --- a/scripts/zones/Zeruhn_Mines/npcs/Mining_Point.lua +++ b/scripts/zones/Zeruhn_Mines/npcs/Mining_Point.lua @@ -5,11 +5,11 @@ local entity = {} entity.onTrade = function(player, npc, trade) - xi.helm.onTrade(player, npc, trade, xi.helm.type.MINING, 165) + xi.helm.onTrade(player, npc, trade, xi.helmType.MINING, 165) end entity.onTrigger = function(player, npc) - xi.helm.onTrigger(player, xi.helm.type.MINING) + xi.helm.onTrigger(player, xi.helmType.MINING) end entity.onEventUpdate = function(player, csid, option, npc) diff --git a/sql/abilities.sql b/sql/abilities.sql index 3a5b42b514a..631e5917cdd 100644 --- a/sql/abilities.sql +++ b/sql/abilities.sql @@ -320,8 +320,8 @@ INSERT INTO `abilities` VALUES (311,'curing_waltz_v',19,87,27,14,189,102,0,35,20 INSERT INTO `abilities` VALUES (312,'feather_step',19,83,4,5,220,591,0,17,2000,0,14,4.5,0,1,0,0,0,NULL); INSERT INTO `abilities` VALUES (313,'striking_flourish',19,89,1,30,226,0,0,222,2000,0,14,20.0,0,1,80,0,0,NULL); -- check animation/message1 INSERT INTO `abilities` VALUES (314,'ternary_flourish',19,93,1,30,226,0,0,222,2000,0,14,20.0,0,1,80,0,0,NULL); -- check animation/message1 -INSERT INTO `abilities` VALUES (316,'perpetuance',20,87,1,1,231,100,0,224,2000,0,6,0.0,0,1,80,0,16,'ABYSSEA'); -INSERT INTO `abilities` VALUES (317,'immanence',20,87,1,1,231,100,0,245,2000,0,6,0.0,0,1,80,0,0,NULL); +INSERT INTO `abilities` VALUES (316,'perpetuance',20,87,1,1,231,100,0,244,2000,0,6,0.0,0,1,80,0,16,'ABYSSEA'); +INSERT INTO `abilities` VALUES (317,'immanence',20,87,1,1,231,100,0,245,2000,0,6,0.0,0,1,80,0,32,'ABYSSEA'); INSERT INTO `abilities` VALUES (318,'smiting_breath',14,90,4,60,238,100,0,94,2000,0,6,8.0,0,1,80,0,0,NULL); INSERT INTO `abilities` VALUES (319,'restoring_breath',14,90,1,60,239,100,0,94,2000,0,6,0.0,0,1,80,0,0,NULL); INSERT INTO `abilities` VALUES (320,'konzen-ittai',12,65,4,180,132,529,0,39,2000,0,14,4.0,0,1,300,0,0,'ABYSSEA'); @@ -426,28 +426,28 @@ INSERT INTO `abilities` VALUES (536,'howling_moon',15,1,4,60,173,0,0,0,2000,0,6, -- INSERT INTO `abilities` VALUES (537,'lunar_bay',22,1,1,0,300,0,0,???,2000,0,6,20.0,0,450,900,0,0,NULL); -- INSERT INTO `abilities` VALUES (538,'heavenward_howl',22,1,1,0,300,0,0,???,2000,0,6,20.0,0,450,900,0,0,NULL); -- INSERT INTO `abilities` VALUES (539,'impact',22,1,1,0,300,0,0,???,2000,0,6,20.0,0,450,900,0,0,NULL); -INSERT INTO `abilities` VALUES (544,'punch',15,1,4,60,173,0,0,9,2000,0,6,18.0,0,1,60,0,0,NULL); -INSERT INTO `abilities` VALUES (545,'fire_ii',15,10,4,60,173,0,0,24,2000,0,6,18.0,0,1,60,0,0,NULL); -INSERT INTO `abilities` VALUES (546,'burning_strike',15,23,4,60,173,0,0,48,2000,0,6,18.0,0,1,60,0,0,NULL); -INSERT INTO `abilities` VALUES (547,'double_punch',15,30,4,60,173,0,0,56,2000,0,6,18.0,0,1,60,0,0,NULL); -INSERT INTO `abilities` VALUES (548,'crimson_howl',15,38,1,60,174,0,0,84,2000,0,6,18.0,0,1,60,0,0,NULL); -INSERT INTO `abilities` VALUES (549,'fire_iv',15,60,4,60,173,0,0,118,2000,0,6,18.0,0,1,60,0,0,NULL); -INSERT INTO `abilities` VALUES (550,'flaming_crush',15,70,4,60,173,0,0,164,2000,0,6,18.0,0,1,60,0,0,NULL); -INSERT INTO `abilities` VALUES (551,'meteor_strike',15,75,4,60,173,0,0,182,2000,0,6,18.0,0,1,60,2944,1,'TOAU'); -INSERT INTO `abilities` VALUES (552,'inferno',15,1,4,60,173,0,0,0,2000,0,6,18.0,1,1,60,0,2,NULL); --- INSERT INTO `abilities` VALUES (553,'inferno_howl',22,1,1,0,300,0,0,???,2000,0,6,20.0,0,450,900,0,0,NULL); --- INSERT INTO `abilities` VALUES (554,'conflag_strike',22,1,1,0,300,0,0,???,2000,0,6,20.0,0,450,900,0,0,NULL); -INSERT INTO `abilities` VALUES (560,'rock_throw',15,1,4,60,173,0,0,10,2000,0,6,18.0,0,1,60,0,0,NULL); -INSERT INTO `abilities` VALUES (561,'stone_ii',15,10,4,60,173,0,0,24,2000,0,6,18.0,0,1,60,0,0,NULL); -INSERT INTO `abilities` VALUES (562,'rock_buster',15,21,4,60,173,0,0,39,2000,0,6,18.0,0,1,60,0,0,NULL); -INSERT INTO `abilities` VALUES (563,'megalith_throw',15,35,4,60,173,0,0,62,2000,0,6,18.0,0,1,60,0,0,NULL); -INSERT INTO `abilities` VALUES (564,'earthen_ward',15,46,1,60,174,0,0,92,2000,0,6,18.0,0,1,60,0,0,NULL); -INSERT INTO `abilities` VALUES (565,'stone_iv',15,60,4,60,173,0,0,118,2000,0,6,18.0,0,1,60,0,0,NULL); -INSERT INTO `abilities` VALUES (566,'mountain_buster',15,70,4,60,173,0,0,164,2000,0,6,18.0,0,1,60,0,0,NULL); -INSERT INTO `abilities` VALUES (567,'geocrush',15,75,4,60,173,0,0,182,2000,0,6,18.0,0,1,60,2950,1,'TOAU'); -INSERT INTO `abilities` VALUES (568,'earthen_fury',15,1,4,60,173,0,0,0,2000,0,6,18.0,1,1,60,0,2,NULL); --- INSERT INTO `abilities` VALUES (569,'earthen_armor',22,1,1,0,300,0,0,???,2000,0,6,20.0,0,450,900,0,0,NULL); --- INSERT INTO `abilities` VALUES (570,'crag_throw',22,1,1,0,300,0,0,???,2000,0,6,20.0,0,450,900,0,0,NULL); +INSERT INTO `abilities` VALUES (544,'punch',15,1,4,60,173,0,0,94,2000,0,6,18.0,0,1,60,0,0,NULL); +INSERT INTO `abilities` VALUES (545,'fire_ii',15,10,4,60,173,0,0,94,2000,0,6,18.0,0,1,60,0,0,NULL); +INSERT INTO `abilities` VALUES (546,'burning_strike',15,23,4,60,173,0,0,94,2000,0,6,18.0,0,1,60,0,0,NULL); +INSERT INTO `abilities` VALUES (547,'double_punch',15,30,4,60,173,0,0,94,2000,0,6,18.0,0,1,60,0,0,NULL); +INSERT INTO `abilities` VALUES (548,'crimson_howl',15,38,1,60,174,0,0,94,2000,0,6,18.0,0,1,60,0,0,NULL); +INSERT INTO `abilities` VALUES (549,'fire_iv',15,60,4,60,173,0,0,94,2000,0,6,18.0,0,1,60,0,0,NULL); +INSERT INTO `abilities` VALUES (550,'flaming_crush',15,70,4,60,173,0,0,94,2000,0,6,18.0,0,1,60,0,0,NULL); +INSERT INTO `abilities` VALUES (551,'meteor_strike',15,75,4,60,173,0,0,94,2000,0,6,18.0,0,1,60,2944,1,'TOAU'); +INSERT INTO `abilities` VALUES (552,'inferno',15,1,4,60,173,0,0,94,2000,0,6,18.0,1,1,60,0,2,NULL); +INSERT INTO `abilities` VALUES (553,'inferno_howl',15,88,1,60,174,0,0,94,2000,0,6,18.0,0,1,60,0,0,NULL); +INSERT INTO `abilities` VALUES (554,'conflag_strike',15,99,4,60,173,0,0,94,2000,0,6,18.0,0,1,60,0,0,NULL); +INSERT INTO `abilities` VALUES (560,'rock_throw',15,1,4,60,173,0,0,94,2000,0,6,18.0,0,1,60,0,0,NULL); +INSERT INTO `abilities` VALUES (561,'stone_ii',15,10,4,60,173,0,0,94,2000,0,6,18.0,0,1,60,0,0,NULL); +INSERT INTO `abilities` VALUES (562,'rock_buster',15,21,4,60,173,0,0,94,2000,0,6,18.0,0,1,60,0,0,NULL); +INSERT INTO `abilities` VALUES (563,'megalith_throw',15,35,4,60,173,0,0,94,2000,0,6,18.0,0,1,60,0,0,NULL); +INSERT INTO `abilities` VALUES (564,'earthen_ward',15,46,1,60,174,0,0,94,2000,0,6,18.0,0,1,60,0,0,NULL); +INSERT INTO `abilities` VALUES (565,'stone_iv',15,60,4,60,173,0,0,94,2000,0,6,18.0,0,1,60,0,0,NULL); +INSERT INTO `abilities` VALUES (566,'mountain_buster',15,70,4,60,173,0,0,94,2000,0,6,18.0,0,1,60,0,0,NULL); +INSERT INTO `abilities` VALUES (567,'geocrush',15,75,4,60,173,0,0,94,2000,0,6,18.0,0,1,60,2950,1,'TOAU'); +INSERT INTO `abilities` VALUES (568,'earthen_fury',15,1,4,60,173,0,0,94,2000,0,6,18.0,1,1,60,0,2,NULL); +INSERT INTO `abilities` VALUES (569,'earthen_armor',15,82,1,60,174,0,0,94,2000,0,6,18.0,0,1,60,0,0,NULL); +INSERT INTO `abilities` VALUES (570,'crag_throw',15,99,4,60,173,0,0,94,2000,0,6,18.0,0,1,60,0,0,NULL); INSERT INTO `abilities` VALUES (576,'barracuda_dive',15,1,4,60,173,0,0,94,2000,0,6,18.0,0,1,60,0,0,NULL); INSERT INTO `abilities` VALUES (577,'water_ii',15,10,4,60,173,0,0,94,2000,0,6,18.0,0,1,60,0,0,NULL); INSERT INTO `abilities` VALUES (578,'tail_whip',15,26,4,60,173,0,0,94,2000,0,6,18.0,0,1,60,0,0,NULL); @@ -459,17 +459,17 @@ INSERT INTO `abilities` VALUES (583,'grand_fall',15,75,4,60,173,0,0,94,2000,0,6, INSERT INTO `abilities` VALUES (584,'tidal_wave',15,1,4,60,173,0,0,94,2000,0,6,18.0,1,1,60,0,2,NULL); INSERT INTO `abilities` VALUES (585,'tidal_roar',15,84,4,60,174,0,0,94,2000,0,6,18.0,1,1,60,0,0,NULL); INSERT INTO `abilities` VALUES (586,'soothing_current',15,99,3,60,174,0,0,94,2000,0,6,18.0,0,1,60,0,0,NULL); -INSERT INTO `abilities` VALUES (592,'claw',15,1,4,60,173,0,0,7,2000,0,6,18.0,0,1,60,0,0,NULL); -INSERT INTO `abilities` VALUES (593,'aero_ii',15,10,4,60,173,0,0,24,2000,0,6,18.0,0,1,60,0,0,NULL); -INSERT INTO `abilities` VALUES (594,'whispering_wind',15,36,1,60,174,0,0,119,2000,0,6,18.0,0,1,60,0,0,NULL); -INSERT INTO `abilities` VALUES (595,'hastega',15,48,1,60,174,0,0,112,2000,0,6,18.0,0,1,60,0,0,NULL); -INSERT INTO `abilities` VALUES (596,'aerial_armor',15,25,1,60,174,0,0,92,2000,0,6,18.0,0,1,60,0,0,NULL); -INSERT INTO `abilities` VALUES (597,'aero_iv',15,60,4,60,173,0,0,118,2000,0,6,18.0,0,1,60,0,0,NULL); -INSERT INTO `abilities` VALUES (598,'predator_claws',15,70,4,60,173,0,0,164,2000,0,6,18.0,0,1,60,0,0,NULL); -INSERT INTO `abilities` VALUES (599,'wind_blade',15,75,4,60,173,0,0,182,2000,0,6,18.0,0,1,60,2948,1,'TOAU'); -INSERT INTO `abilities` VALUES (600,'aerial_blast',15,1,4,60,173,0,0,0,2000,0,6,18.0,1,1,60,0,2,NULL); --- INSERT INTO `abilities` VALUES (601,'fleet_wind',22,1,1,0,300,0,0,???,2000,0,6,20.0,0,450,900,0,0,NULL); --- INSERT INTO `abilities` VALUES (602,'hastega_ii',22,1,1,0,300,0,0,???,2000,0,6,20.0,0,450,900,0,0,NULL); +INSERT INTO `abilities` VALUES (592,'claw',15,1,4,60,173,0,0,94,2000,0,6,18.0,0,1,60,0,0,NULL); +INSERT INTO `abilities` VALUES (593,'aero_ii',15,10,4,60,173,0,0,94,2000,0,6,18.0,0,1,60,0,0,NULL); +INSERT INTO `abilities` VALUES (594,'whispering_wind',15,36,1,60,174,0,0,94,2000,0,6,18.0,0,1,60,0,0,NULL); +INSERT INTO `abilities` VALUES (595,'hastega',15,48,1,60,174,0,0,94,2000,0,6,18.0,0,1,60,0,0,NULL); +INSERT INTO `abilities` VALUES (596,'aerial_armor',15,25,1,60,174,0,0,94,2000,0,6,18.0,0,1,60,0,0,NULL); +INSERT INTO `abilities` VALUES (597,'aero_iv',15,60,4,60,173,0,0,94,2000,0,6,18.0,0,1,60,0,0,NULL); +INSERT INTO `abilities` VALUES (598,'predator_claws',15,70,4,60,173,0,0,94,2000,0,6,18.0,0,1,60,0,0,NULL); +INSERT INTO `abilities` VALUES (599,'wind_blade',15,75,4,60,173,0,0,94,2000,0,6,18.0,0,1,60,2948,1,'TOAU'); +INSERT INTO `abilities` VALUES (600,'aerial_blast',15,1,4,60,173,0,0,94,2000,0,6,18.0,1,1,60,0,2,NULL); +INSERT INTO `abilities` VALUES (601,'fleet_wind',15,86,1,60,174,0,0,94,2000,0,6,18.0,0,1,60,0,0,NULL); +INSERT INTO `abilities` VALUES (602,'hastega_ii',15,99,1,60,174,0,0,94,2000,0,6,18.0,0,1,60,0,0,NULL); INSERT INTO `abilities` VALUES (608,'axe_kick',15,1,4,60,173,0,0,10,2000,0,6,18.0,0,1,60,0,0,NULL); INSERT INTO `abilities` VALUES (609,'blizzard_ii',15,10,4,60,173,0,0,24,2000,0,6,18.0,0,1,60,0,0,NULL); INSERT INTO `abilities` VALUES (610,'frost_armor',15,28,1,60,174,0,0,63,2000,0,6,18.0,0,1,60,0,0,NULL); @@ -624,12 +624,12 @@ INSERT INTO `abilities` VALUES (770,'nectarous_deluge',9,25,257,2,102,0,0,0,2000 INSERT INTO `abilities` VALUES (771,'nepenthic_plunge',9,25,257,3,102,0,0,0,2000,0,7,18.0,0,1,60,0,0,NULL); INSERT INTO `abilities` VALUES (772,'somersault',9,25,257,1,102,0,0,0,2000,0,6,19.0,0,1,60,0,0,NULL); INSERT INTO `abilities` VALUES (773,'pacifying_ruby',15,99,3,60,174,0,0,94,2000,0,6,18.0,0,1,60,0,0,NULL); -INSERT INTO `abilities` VALUES (774,'foul_waters',9,25,257,255,102,0,0,0,2000,0,6,19.0,0,1,60,0,0,NULL); -INSERT INTO `abilities` VALUES (775,'pestilent_plume',9,25,257,255,102,0,0,0,2000,0,6,19.0,0,1,60,0,0,NULL); -INSERT INTO `abilities` VALUES (776,'pecking_flurry',9,25,257,255,102,0,0,0,2000,0,6,18.1,0,1,60,0,0,NULL); -INSERT INTO `abilities` VALUES (777,'sickle_slash',9,25,257,255,102,0,0,0,2000,0,6,18.0,1,1,60,0,0,NULL); -INSERT INTO `abilities` VALUES (778,'acid_spray',9,25,257,255,102,0,0,0,2000,0,6,18.0,0,2,60,0,0,NULL); -INSERT INTO `abilities` VALUES (779,'spider_web',9,25,257,255,102,0,0,0,2000,0,6,18.0,0,2,60,0,0,NULL); +INSERT INTO `abilities` VALUES (774,'foul_waters',9,25,257,2,102,0,0,0,2000,0,6,19.0,0,1,60,0,0,NULL); +INSERT INTO `abilities` VALUES (775,'pestilent_plume',9,25,257,2,102,0,0,0,2000,0,6,19.0,0,1,60,0,0,NULL); +INSERT INTO `abilities` VALUES (776,'pecking_flurry',9,25,257,1,102,0,0,0,2000,0,6,18.1,0,1,60,0,0,NULL); +INSERT INTO `abilities` VALUES (777,'sickle_slash',9,25,257,1,102,0,0,0,2000,0,6,18.0,1,1,60,0,0,NULL); +INSERT INTO `abilities` VALUES (778,'acid_spray',9,25,257,1,102,0,0,0,2000,0,6,18.0,0,2,60,0,0,NULL); +INSERT INTO `abilities` VALUES (779,'spider_web',9,25,257,2,102,0,0,0,2000,0,6,18.0,0,2,60,0,0,NULL); -- INSERT INTO `abilities` VALUES (780,'regal_gash',22,1,1,0,300,0,0,???,2000,0,6,20.0,0,450,900,0,0,NULL); -- INSERT INTO `abilities` VALUES (781,'infected_leech',9,25,257,rec,102,0,0,0,2000,0,6,18.0,1,1,60,0,0,NULL); -- ROTZ -- INSERT INTO `abilities` VALUES (782,'gloom_spray',9,25,257,rec,102,0,0,0,2000,0,6,18.0,0,2,60,0,0,NULL); -- ROTZ diff --git a/sql/augments.sql b/sql/augments.sql index 0c8ab4464cc..166c5e9a136 100644 --- a/sql/augments.sql +++ b/sql/augments.sql @@ -469,7 +469,7 @@ INSERT INTO `augments` VALUES (376,0,0,0,0,0); INSERT INTO `augments` VALUES (377,0,0,0,0,0); INSERT INTO `augments` VALUES (378,0,0,0,0,0); INSERT INTO `augments` VALUES (379,0,0,0,0,0); -- Enmity +1 for each Utsusemi -INSERT INTO `augments` VALUES (380,0,0,0,0,0); -- Physical Damage Limit +1% +INSERT INTO `augments` VALUES (380,0,1081,1,0,0); -- Physical Damage Limit +1% -- 381 to 511 currently unused. Leave at zero. Edit+move or remove this note as new augments get discovered. INSERT INTO `augments` VALUES (381,0,0,0,0,0); diff --git a/sql/bcnm_battlefield.sql b/sql/bcnm_battlefield.sql index 8c219af1c34..dccd64e0848 100644 --- a/sql/bcnm_battlefield.sql +++ b/sql/bcnm_battlefield.sql @@ -443,16 +443,19 @@ INSERT INTO `bcnm_battlefield` VALUES (99,1,17375240,3); INSERT INTO `bcnm_battlefield` VALUES (99,1,17375241,3); INSERT INTO `bcnm_battlefield` VALUES (99,1,17375242,3); INSERT INTO `bcnm_battlefield` VALUES (99,1,17375243,0); +INSERT INTO `bcnm_battlefield` VALUES (99,1,17375244,0); INSERT INTO `bcnm_battlefield` VALUES (99,2,17375245,3); INSERT INTO `bcnm_battlefield` VALUES (99,2,17375246,3); INSERT INTO `bcnm_battlefield` VALUES (99,2,17375247,3); INSERT INTO `bcnm_battlefield` VALUES (99,2,17375248,3); -INSERT INTO `bcnm_battlefield` VALUES (99,2,17375249,3); +INSERT INTO `bcnm_battlefield` VALUES (99,2,17375249,0); +INSERT INTO `bcnm_battlefield` VALUES (99,2,17375250,0); INSERT INTO `bcnm_battlefield` VALUES (99,3,17375251,3); INSERT INTO `bcnm_battlefield` VALUES (99,3,17375252,3); INSERT INTO `bcnm_battlefield` VALUES (99,3,17375253,3); INSERT INTO `bcnm_battlefield` VALUES (99,3,17375254,3); -INSERT INTO `bcnm_battlefield` VALUES (99,3,17375255,3); +INSERT INTO `bcnm_battlefield` VALUES (99,3,17375255,0); +INSERT INTO `bcnm_battlefield` VALUES (99,3,17375256,0); INSERT INTO `bcnm_battlefield` VALUES (100,1,17375353,3); -- treasures_and_tribulations INSERT INTO `bcnm_battlefield` VALUES (100,1,17375354,3); INSERT INTO `bcnm_battlefield` VALUES (100,1,17375355,3); diff --git a/sql/item_basic.sql b/sql/item_basic.sql index ddcb04cbaaf..7511d052fb6 100644 --- a/sql/item_basic.sql +++ b/sql/item_basic.sql @@ -10599,7 +10599,7 @@ INSERT INTO `item_basic` VALUES (13192,0,'leather_belt','leather_belt',1,2084,@W INSERT INTO `item_basic` VALUES (13193,0,'lizard_belt','lizard_belt',1,2084,@WAIST,0,439); INSERT INTO `item_basic` VALUES (13194,0,'warriors_belt','warriors_belt',1,2084,@WAIST,0,336); INSERT INTO `item_basic` VALUES (13195,0,'magic_belt','magic_belt',1,2084,@WAIST,0,506); -INSERT INTO `item_basic` VALUES (13196,0,'silver_belt','silver_belt',1,2084,@WAIST,0,2074); +INSERT INTO `item_basic` VALUES (13196,0,'silver_belt','silver_belt',1,2084,@WAIST,0,357); INSERT INTO `item_basic` VALUES (13197,0,'koenigs_belt','koenigs_belt',1,2084,@WAIST,0,4344); INSERT INTO `item_basic` VALUES (13198,0,'swordbelt','swordbelt',1,2084,@WAIST,0,2178); INSERT INTO `item_basic` VALUES (13199,0,'blood_stone','blood_stone',1,2084,@WAIST,0,25); @@ -10626,7 +10626,7 @@ INSERT INTO `item_basic` VALUES (13219,0,'magic_belt_+1','magic_belt_+1',1,2080, INSERT INTO `item_basic` VALUES (13220,0,'royal_knights_belt','ryl.kgt._belt',1,2052,@WAIST,0,3655); INSERT INTO `item_basic` VALUES (13221,0,'mercenary_captains_belt','mrc.cpt._belt',1,2052,@WAIST,0,1634); INSERT INTO `item_basic` VALUES (13222,0,'force_belt','force_belt',1,2052,@WAIST,0,1376); -INSERT INTO `item_basic` VALUES (13223,0,'silver_belt_+1','silver_belt_+1',1,2080,@WAIST,0,2592); +INSERT INTO `item_basic` VALUES (13223,0,'silver_belt_+1','silver_belt_+1',1,2080,@WAIST,0,441); INSERT INTO `item_basic` VALUES (13224,0,'silver_obi_+1','silver_obi_+1',1,2080,@WAIST,0,844); INSERT INTO `item_basic` VALUES (13225,0,'brave_belt','brave_belt',1,2080,@WAIST,0,660); INSERT INTO `item_basic` VALUES (13226,0,'blood_stone_+1','blood_stone_+1',1,2080,@WAIST,0,31); @@ -11263,7 +11263,7 @@ INSERT INTO `item_basic` VALUES (13856,0,'wizards_petasos','wizards_petasos',1,6 INSERT INTO `item_basic` VALUES (13857,0,'choral_roundlet','choral_roundlet',1,63552,@NONE,1,0); INSERT INTO `item_basic` VALUES (13858,0,'prism_headband','prism_headband',1,2080,@HEAD,0,3910); INSERT INTO `item_basic` VALUES (13859,0,'coral_visor_+1','coral_visor_+1',1,2080,@HEAD,0,4596); -INSERT INTO `item_basic` VALUES (13860,0,'dragon_mask_+1','dragon_mask_+1',1,2080,@HEAD,0,8000); +INSERT INTO `item_basic` VALUES (13860,0,'dragon_mask_+1','dragon_mask_+1',1,2080,@HEAD,0,8120); INSERT INTO `item_basic` VALUES (13861,0,'feral_helm','feral_helm',1,2080,@HEAD,0,3794); INSERT INTO `item_basic` VALUES (13862,0,'torama_mask','torama_mask',1,2080,@HEAD,0,4284); INSERT INTO `item_basic` VALUES (13863,0,'darksteel_cap_+1','darksteel_cap_+1',1,2080,@HEAD,0,8971); @@ -11634,7 +11634,7 @@ INSERT INTO `item_basic` VALUES (14227,0,'drachen_brais','drachen_brais',1,63552 INSERT INTO `item_basic` VALUES (14228,0,'evokers_spats','evokers_spats',1,63552,@NONE,1,0); INSERT INTO `item_basic` VALUES (14229,0,'darksteel_cuisses_+1','dst._cuisses_+1',1,2080,@LEGS,0,8125); INSERT INTO `item_basic` VALUES (14230,0,'coral_cuisses_+1','coral_cuisses_+1',1,2080,@LEGS,0,7810); -INSERT INTO `item_basic` VALUES (14231,0,'dragon_cuisses_+1','dragon_cuisses_+1',1,2080,@LEGS,0,9900); +INSERT INTO `item_basic` VALUES (14231,0,'dragon_cuisses_+1','dragon_cuisses_+1',1,2080,@LEGS,0,9762); INSERT INTO `item_basic` VALUES (14232,0,'feral_trousers','feral_trousers',1,2080,@LEGS,0,6150); INSERT INTO `item_basic` VALUES (14233,0,'torama_trousers','torama_trousers',1,2080,@LEGS,0,6833); INSERT INTO `item_basic` VALUES (14234,0,'darksteel_subligar_+1','dst._subligar_+1',1,2080,@LEGS,0,7931); @@ -20309,7 +20309,7 @@ INSERT INTO `item_basic` VALUES (26220,0,'crepuscular_ring','crepuscular_ring',1 INSERT INTO `item_basic` VALUES (26221,0,'sroda_ring','sroda_ring',1,63572,@NONE,1,0); INSERT INTO `item_basic` VALUES (26222,0,'seabirds_ring','seabirds_ring',1,34820,@RINGS,0,2); INSERT INTO `item_basic` VALUES (26223,0,'patissieres_ring','patissieres_ring',1,34820,@RINGS,0,2); -INSERT INTO `item_basic` VALUES (26224,0,'confectioners_ring','confectioners_ring',1,34820,@RINGS,0,2); +INSERT INTO `item_basic` VALUES (26224,0,'confectioners_ring','confectioners_ring',1,34820,@RINGS,0,519); INSERT INTO `item_basic` VALUES (26225,0,'medadas_ring','medadas_ring',1,63552,@NONE,1,0); INSERT INTO `item_basic` VALUES (26226,0,'gurebu-ogurebus_ring','gurebus_ring',1,63552,@NONE,1,0); INSERT INTO `item_basic` VALUES (26227,0,'cornelias_ring','cornelias_ring',1,63552,@NONE,1,0); diff --git a/sql/mob_droplist.sql b/sql/mob_droplist.sql index 2a3b4102e0b..519307156a1 100644 --- a/sql/mob_droplist.sql +++ b/sql/mob_droplist.sql @@ -26795,9 +26795,12 @@ INSERT INTO `mob_droplist` VALUES (3294,0,0,1000,647,@ALWAYS); -- Chunk of mo INSERT INTO `mob_droplist` VALUES (3294,0,0,1000,19236,@VCOMMON); -- Hightail bullet (Very common, 24%) -- ZoneID 126 - Atkorkamuy -INSERT INTO `mob_droplist` VALUES (3295,0,0,1000,2813,@COMMON); -- Aptant: Durus +INSERT INTO `mob_droplist` VALUES (3295,0,0,1000,2813,@COMMON); -- Aptant: Durus INSERT INTO `mob_droplist` VALUES (3295,0,0,1000,2816,@COMMON); -- Aptant: Tachus +-- ZoneID 123 - Pyuu the Spatemaker +INSERT INTO `mob_droplist` VALUES (3296,0,0,1000,2850,@UNCOMMON); -- Ingot of Sahagin gold (Uncommon, 10%) + /*!40000 ALTER TABLE `mob_droplist` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; diff --git a/sql/mob_groups.sql b/sql/mob_groups.sql index e44140d31b3..da932148125 100644 --- a/sql/mob_groups.sql +++ b/sql/mob_groups.sql @@ -1138,8 +1138,8 @@ INSERT INTO `mob_groups` VALUES (19,3916,29,'Tiamat',0,128,0,0,0,75,75,0); INSERT INTO `mob_groups` VALUES (20,2156,29,'Jormungand',0,128,0,0,0,75,75,0); INSERT INTO `mob_groups` VALUES (21,4261,29,'Vrtra',0,128,0,0,0,75,75,0); INSERT INTO `mob_groups` VALUES (22,4507,29,'Ziryu',0,128,2804,0,0,75,75,0); -INSERT INTO `mob_groups` VALUES (23,4309,29,'Water_Elemental',0,128,0,0,0,75,75,0); -INSERT INTO `mob_groups` VALUES (24,1160,29,'Earth_Elemental',0,128,0,0,0,75,75,0); +INSERT INTO `mob_groups` VALUES (23,4309,29,'Water_Elemental',0,128,2629,0,0,75,75,0); +INSERT INTO `mob_groups` VALUES (24,1160,29,'Earth_Elemental',0,128,733,0,0,75,75,0); INSERT INTO `mob_groups` VALUES (25,3124,29,'Pey',0,128,0,0,0,75,75,0); INSERT INTO `mob_groups` VALUES (26,2105,29,'Iruci',0,128,0,0,0,75,75,0); INSERT INTO `mob_groups` VALUES (27,70,29,'Airi',0,128,0,0,0,15,17,0); @@ -1162,8 +1162,8 @@ INSERT INTO `mob_groups` VALUES (11,1355,30,'Flamedrake',330,0,841,0,0,47,49,0); INSERT INTO `mob_groups` VALUES (12,641,30,'Carmine_Dobsonfly',86400,0,418,1550,0,44,45,0); INSERT INTO `mob_groups` VALUES (13,4532,30,'Darner',330,0,142,0,0,84,85,0); INSERT INTO `mob_groups` VALUES (14,68,30,'Aiatar',0,32,35,6500,0,44,45,0); -INSERT INTO `mob_groups` VALUES (15,4309,30,'Water_Elemental',0,128,0,0,0,75,75,0); -INSERT INTO `mob_groups` VALUES (16,1160,30,'Earth_Elemental',0,128,0,0,0,75,75,0); +INSERT INTO `mob_groups` VALUES (15,4309,30,'Water_Elemental',0,128,2629,0,0,75,75,0); +INSERT INTO `mob_groups` VALUES (16,1160,30,'Earth_Elemental',0,128,733,0,0,75,75,0); INSERT INTO `mob_groups` VALUES (17,3070,30,'Ouryu',0,128,1962,50000,0,85,85,0); INSERT INTO `mob_groups` VALUES (18,4507,30,'Ziryu',0,128,2804,0,0,75,75,0); INSERT INTO `mob_groups` VALUES (19,215,30,'Arcane_Phantasm',0,128,0,0,0,44,45,0); @@ -1188,7 +1188,7 @@ INSERT INTO `mob_groups` VALUES (12,6951,31,'Gullin_Gefyrst',0,128,0,0,0,0,0,0); INSERT INTO `mob_groups` VALUES (13,6952,31,'Gullin_Ungeweder',0,128,0,0,0,0,0,0); INSERT INTO `mob_groups` VALUES (14,6953,31,'Gullin_Byrgen',0,128,0,0,0,0,0,0); INSERT INTO `mob_groups` VALUES (15,3070,31,'Ouryu_htbf',0,128,0,0,0,99,99,0); -INSERT INTO `mob_groups` VALUES (16,1160,31,'Earth_Elemental',0,128,0,0,0,99,99,0); +INSERT INTO `mob_groups` VALUES (16,1160,31,'Earth_Elemental',0,128,733,0,0,99,99,0); -- ------------------------------------------------------------ -- Sealions_Den (Zone 32) @@ -3041,7 +3041,7 @@ INSERT INTO `mob_groups` VALUES (10,4015,62,'Troll_Engraver',960,0,2477,0,0,71,7 INSERT INTO `mob_groups` VALUES (11,4035,62,'Trolls_Automaton',0,128,0,0,0,69,78,0); INSERT INTO `mob_groups` VALUES (12,4010,62,'Troll_Cameist',960,0,2474,0,0,71,75,0); INSERT INTO `mob_groups` VALUES (13,4021,62,'Troll_Ironworker',960,0,2480,0,0,71,75,0); -INSERT INTO `mob_groups` VALUES (14,1160,62,'Earth_Elemental',960,4,0,0,0,74,75,0); +INSERT INTO `mob_groups` VALUES (14,1160,62,'Earth_Elemental',960,4,733,0,0,74,75,0); INSERT INTO `mob_groups` VALUES (15,437,62,'Black_Pudding',960,0,0,0,0,72,74,0); INSERT INTO `mob_groups` VALUES (16,4281,62,'Wamouracampa',960,0,2609,0,0,72,76,0); INSERT INTO `mob_groups` VALUES (17,2485,62,'Magmatic_Eruca',960,0,419,0,0,71,75,0); @@ -8764,7 +8764,7 @@ INSERT INTO `mob_groups` VALUES (21,833,123,'Creek_Sahagin',330,0,532,0,0,34,38, INSERT INTO `mob_groups` VALUES (22,3373,123,'River_Sahagin',330,0,2105,0,0,34,38,0); INSERT INTO `mob_groups` VALUES (23,3788,123,'Stream_Sahagin',330,0,2344,0,0,34,38,0); INSERT INTO `mob_groups` VALUES (24,2647,123,'Meww_the_Turtlerider',75600,0,1666,4500,10000,47,47,0); -INSERT INTO `mob_groups` VALUES (25,6845,123,'Pyuu_the_Spatemaker',0,128,0,0,0,73,73,0); +INSERT INTO `mob_groups` VALUES (25,6845,123,'Pyuu_the_Spatemaker',0,128,3296,8700,10000,73,73,0); INSERT INTO `mob_groups` VALUES (26,2491,123,'Makara',330,0,1229,0,0,35,38,0); INSERT INTO `mob_groups` VALUES (27,3393,123,'Rose_Garden',0,128,2123,5000,0,50,50,0); INSERT INTO `mob_groups` VALUES (28,4252,123,'Voluptuous_Vilma',0,128,2589,6000,0,52,53,0); @@ -9020,7 +9020,7 @@ INSERT INTO `mob_groups` VALUES (19,6855,127,'Sovereign_Behemoth',0,128,0,0,0,99 INSERT INTO `mob_groups` VALUES (1,4218,128,'Velociraptor',330,0,2573,0,0,66,69,0); INSERT INTO `mob_groups` VALUES (2,3120,128,'Peryton',330,0,1991,0,0,69,72,0); INSERT INTO `mob_groups` VALUES (3,1341,128,'Fire_Elemental',330,4,6860,0,0,66,68,0); -INSERT INTO `mob_groups` VALUES (4,71,128,'Air_Elemental',330,4,0,0,0,66,68,0); +INSERT INTO `mob_groups` VALUES (4,71,128,'Air_Elemental',330,4,38,0,0,66,68,0); INSERT INTO `mob_groups` VALUES (5,4125,128,'Valley_Manticore',330,0,2537,0,0,71,74,0); INSERT INTO `mob_groups` VALUES (6,44,128,'Adamantoise',0,128,21,7000,0,70,70,0); INSERT INTO `mob_groups` VALUES (7,268,128,'Aspidochelone',0,128,183,15000,0,85,85,0); @@ -10666,8 +10666,8 @@ INSERT INTO `mob_groups` VALUES (40,1172,155,'Eclipse_Demon',960,0,0,0,0,82,83,0 INSERT INTO `mob_groups` VALUES (41,2078,155,'Inferno_Demon',960,0,0,0,0,82,83,0); INSERT INTO `mob_groups` VALUES (42,51,155,'Adjudicator_Demon',960,0,0,0,0,82,83,0); INSERT INTO `mob_groups` VALUES (43,6639,155,'Titanotaur',960,0,0,0,0,83,83,0); -INSERT INTO `mob_groups` VALUES (44,913,155,'Dark_Elemental',960,4,0,0,0,81,81,0); -INSERT INTO `mob_groups` VALUES (45,2043,155,'Ice_Elemental',960,4,0,0,0,81,83,0); +INSERT INTO `mob_groups` VALUES (44,913,155,'Dark_Elemental',960,4,568,0,0,81,81,0); +INSERT INTO `mob_groups` VALUES (45,2043,155,'Ice_Elemental',960,4,1347,0,0,81,83,0); INSERT INTO `mob_groups` VALUES (46,6712,155,'Zvahl_Fortalice',0,128,0,0,0,82,82,0); INSERT INTO `mob_groups` VALUES (47,260,155,'Ashmea_B_Greinner',0,128,0,0,0,0,0,0); INSERT INTO `mob_groups` VALUES (48,3495,155,'Scarlet_Boar_Esquire',0,128,0,0,0,0,0,0); @@ -12564,7 +12564,7 @@ INSERT INTO `mob_groups` VALUES (28,6670,191,'Goblin_Conjurer',330,0,3187,0,0,86 INSERT INTO `mob_groups` VALUES (29,6660,191,'Goblin_Bladesmith',330,0,3150,0,0,86,91,0); INSERT INTO `mob_groups` VALUES (30,6665,191,'Goblin_Bushwhacker',330,0,3167,0,0,90,91,0); INSERT INTO `mob_groups` VALUES (31,724,191,'Chocoboleech',0,128,470,1100,0,24,25,0); -INSERT INTO `mob_groups` VALUES (32,5528,191,'Fire_Elemental',0,128,0,0,0,75,75,0); +INSERT INTO `mob_groups` VALUES (32,5528,191,'Fire_Elemental',0,128,831,0,0,75,75,0); INSERT INTO `mob_groups` VALUES (33,4273,191,'Wadi_Leech',0,128,2599,0,0,11,14,0); INSERT INTO `mob_groups` VALUES (34,6890,191,'Celaeno',0,128,0,0,0,100,100,0); @@ -12656,7 +12656,7 @@ INSERT INTO `mob_groups` VALUES (46,1501,193,'Gerwitzs_Axe',0,128,947,0,0,50,50, INSERT INTO `mob_groups` VALUES (47,1504,193,'Gerwitzs_Sword',0,128,948,0,0,52,52,0); INSERT INTO `mob_groups` VALUES (48,1503,193,'Gerwitzs_Soul',0,128,0,0,0,54,54,0); INSERT INTO `mob_groups` VALUES (49,2817,193,'Necroplasm',0,128,0,0,0,37,37,0); -INSERT INTO `mob_groups` VALUES (50,5534,193,'Air_Elemental',0,128,0,0,0,75,75,0); +INSERT INTO `mob_groups` VALUES (50,5534,193,'Air_Elemental',0,128,39,0,0,75,75,0); INSERT INTO `mob_groups` VALUES (51,2633,193,'Metallic_Slime',0,128,0,0,0,34,38,0); INSERT INTO `mob_groups` VALUES (52,5168,193,'Krabimanjaro',0,128,0,0,9999,95,96,0); INSERT INTO `mob_groups` VALUES (53,252,193,'Aroma_Leech',0,128,0,0,0,44,48,0); @@ -12732,7 +12732,7 @@ INSERT INTO `mob_groups` VALUES (62,2121,194,'Jack_of_Swords',0,128,1387,0,0,62, INSERT INTO `mob_groups` VALUES (63,2119,194,'Jack_of_Coins',0,128,1385,0,0,62,62,0); INSERT INTO `mob_groups` VALUES (64,3286,194,'Queen_of_Swords',0,128,2065,0,0,72,72,0); INSERT INTO `mob_groups` VALUES (65,3284,194,'Queen_of_Coins',0,128,2063,0,0,72,72,0); -INSERT INTO `mob_groups` VALUES (66,5529,194,'Thunder_Elemental',300,4,0,0,0,75,75,0); +INSERT INTO `mob_groups` VALUES (66,5529,194,'Thunder_Elemental',300,4,2410,0,0,75,75,0); INSERT INTO `mob_groups` VALUES (67,870,194,'Custom_Cardian',0,128,0,0,0,1,1,0); INSERT INTO `mob_groups` VALUES (68,1518,194,'Ghoul_blm',660,0,961,0,0,23,26,0); INSERT INTO `mob_groups` VALUES (69,6724,194,'Voidwrought',0,128,0,0,0,0,0,0); -- TODO: capture level from retail @@ -12795,7 +12795,7 @@ INSERT INTO `mob_groups` VALUES (51,3799,195,'Sturm',0,128,0,12500,0,62,62,0); INSERT INTO `mob_groups` VALUES (52,3834,195,'Taifun',0,128,0,3000,0,58,58,0); INSERT INTO `mob_groups` VALUES (53,4038,195,'Trombe',0,128,0,3000,0,58,58,0); INSERT INTO `mob_groups` VALUES (54,2664,195,'Mimic',0,128,1688,0,0,64,66,0); -INSERT INTO `mob_groups` VALUES (55,5535,195,'Ice_Elemental',0,128,0,0,0,75,75,0); +INSERT INTO `mob_groups` VALUES (55,5535,195,'Ice_Elemental',0,128,1347,0,0,75,75,0); INSERT INTO `mob_groups` VALUES (56,2802,195,'Namorodo',0,128,0,0,0,61,65,0); INSERT INTO `mob_groups` VALUES (57,5179,195,'Gasha-1stform',0,128,0,0,0,94,95,0); INSERT INTO `mob_groups` VALUES (58,6561,195,'Lost_Soul_war',960,0,1542,0,0,42,46,0); @@ -12846,7 +12846,7 @@ INSERT INTO `mob_groups` VALUES (37,6550,196,'Ghast_blm',300,0,955,0,0,33,36,0); INSERT INTO `mob_groups` VALUES (38,1412,196,'Foul_Meat',64800,0,899,0,0,43,45,0); INSERT INTO `mob_groups` VALUES (39,4284,196,'Wandering_Ghost',0,128,2615,0,0,45,45,0); INSERT INTO `mob_groups` VALUES (40,3218,196,'Pudding',0,128,0,0,0,34,34,0); -INSERT INTO `mob_groups` VALUES (41,5530,196,'Earth_Elemental',0,128,0,0,0,75,75,0); +INSERT INTO `mob_groups` VALUES (41,5530,196,'Earth_Elemental',0,128,733,0,0,75,75,0); INSERT INTO `mob_groups` VALUES (42,251,196,'Aroma_Fly',0,128,0,0,0,44,48,0); INSERT INTO `mob_groups` VALUES (43,5311,196,'Lorbulcrud',0,128,0,0,99999,90,92,0); INSERT INTO `mob_groups` VALUES (44,6552,196,'Ghoul_blm',300,0,962,0,0,20,27,0); @@ -12895,7 +12895,7 @@ INSERT INTO `mob_groups` VALUES (35,832,197,'Crawler_Hunter',300,0,531,0,0,60,62 INSERT INTO `mob_groups` VALUES (36,4705,197,'Aqrabuamelu',7200,0,2947,7500,0,72,75,0); INSERT INTO `mob_groups` VALUES (37,1113,197,'Dreadbug',0,128,703,5000,0,52,52,0); INSERT INTO `mob_groups` VALUES (38,2664,197,'Mimic',0,128,1689,0,0,60,63,0); -INSERT INTO `mob_groups` VALUES (39,5532,197,'Water_Elemental',0,128,0,0,0,75,75,0); +INSERT INTO `mob_groups` VALUES (39,5532,197,'Water_Elemental',0,128,2629,0,0,75,75,0); INSERT INTO `mob_groups` VALUES (40,4704,197,'Mellonia',0,128,0,0,0,94,95,0); -- ------------------------------------------------------------ @@ -12942,7 +12942,7 @@ INSERT INTO `mob_groups` VALUES (37,1710,198,'Goblin_Shaman',300,0,1154,0,0,30,3 INSERT INTO `mob_groups` VALUES (38,228,198,'Argus',0,128,165,3500,0,36,37,0); INSERT INTO `mob_groups` VALUES (39,2386,198,'Leech_King',0,128,1505,3200,0,35,36,0); INSERT INTO `mob_groups` VALUES (40,4386,198,'Wyrmfly',0,128,0,0,0,30,30,0); -INSERT INTO `mob_groups` VALUES (41,5533,198,'Dark_Elemental',0,128,0,0,0,75,75,0); +INSERT INTO `mob_groups` VALUES (41,5533,198,'Dark_Elemental',0,128,568,0,0,75,75,0); INSERT INTO `mob_groups` VALUES (42,4675,198,'Lost_Soul_NM',0,128,0,3500,0,50,50,0); INSERT INTO `mob_groups` VALUES (43,5161,198,'Ogbunabali',0,128,0,0,0,94,95,0); INSERT INTO `mob_groups` VALUES (44,250,198,'Aroma_Crawler',0,128,0,0,0,44,48,0); @@ -12994,7 +12994,7 @@ INSERT INTO `mob_groups` VALUES (39,5888,200,'Frogamander',7200,0,3087,7000,0,71 INSERT INTO `mob_groups` VALUES (40,6463,200,'Donjon_Bat',300,0,0,0,0,91,96,0); INSERT INTO `mob_groups` VALUES (41,3549,200,'Serket',0,128,2203,50000,0,70,70,0); INSERT INTO `mob_groups` VALUES (42,2664,200,'Mimic',0,128,1690,0,0,63,65,0); -INSERT INTO `mob_groups` VALUES (43,5531,200,'Light_Elemental',0,128,0,0,0,75,75,0); +INSERT INTO `mob_groups` VALUES (43,5531,200,'Light_Elemental',0,128,1521,0,0,75,75,0); INSERT INTO `mob_groups` VALUES (44,5147,200,'Roly-Poly',0,128,0,0,9999,91,93,0); INSERT INTO `mob_groups` VALUES (45,6544,200,'Fallen_Evacuee_war',300,0,809,0,0,42,43,0); INSERT INTO `mob_groups` VALUES (46,6547,200,'Fallen_Officer_war',300,0,814,0,0,52,55,0); @@ -13698,7 +13698,7 @@ INSERT INTO `mob_groups` VALUES (6,3520,220,'Sea_Crab',300,0,2184,0,0,10,20,0); INSERT INTO `mob_groups` VALUES (7,3524,220,'Sea_Pugil',300,0,463,0,0,10,20,0); INSERT INTO `mob_groups` VALUES (8,3523,220,'Sea_Monk',300,0,2188,0,0,21,29,0); INSERT INTO `mob_groups` VALUES (9,3127,220,'Phantom',300,1,1993,0,0,22,25,0); -INSERT INTO `mob_groups` VALUES (10,3912,220,'Thunder_Elemental',300,4,0,0,0,0,0,0); +INSERT INTO `mob_groups` VALUES (10,3912,220,'Thunder_Elemental',300,4,2410,0,0,0,0,0); INSERT INTO `mob_groups` VALUES (11,4309,220,'Water_Elemental',300,4,2629,0,0,27,29,0); INSERT INTO `mob_groups` VALUES (12,3522,220,'Sea_Horror',900,0,2186,0,0,60,62,0); INSERT INTO `mob_groups` VALUES (13,1213,220,'Enagakure',0,128,1993,0,0,55,55,0); diff --git a/sql/mob_pools.sql b/sql/mob_pools.sql index 376ab482f94..2ea28be6a8b 100644 --- a/sql/mob_pools.sql +++ b/sql/mob_pools.sql @@ -6885,7 +6885,7 @@ INSERT INTO `mob_pools` VALUES (6841,'Bastet','Bastet',71,0x00006F01000000000000 INSERT INTO `mob_pools` VALUES (6842,'Skeleton_Scuffler','Skeleton_Scuffler',227,0x00003C0200000000000000000000000000000000,1,1,5,240,100,0,1,0,1,2,0,0,0,131,0,0,0,0,0,227,227); INSERT INTO `mob_pools` VALUES (6843,'Douma_Weapon','Douma_Weapon',110,0x0000DE0100000000000000000000000000000000,5,5,3,240,100,0,1,1,1,2,0,0,0,133,0,0,3,0,0,110,110); INSERT INTO `mob_pools` VALUES (6844,'Katashiro_Weapon','Katashiro_Weapon',110,0x0000C30100000000000000000000000000000000,5,5,3,240,100,0,1,1,1,2,0,0,0,133,0,0,3,0,0,110,110); -INSERT INTO `mob_pools` VALUES (6845,'Pyuu_the_Spatemaker','Pyuu_the_Spatemaker',213,0x00001E0500000000000000000000000000000000,4,14,8,240,100,0,1,1,1,2,0,32,0,155,0,0,2,0,0,712,213); +INSERT INTO `mob_pools` VALUES (6845,'Pyuu_the_Spatemaker','Pyuu_the_Spatemaker',213,0x00001E0500000000000000000000000000000000,4,14,8,240,100,0,1,1,1,2,23,32,0,155,0,0,502,0,0,712,213); INSERT INTO `mob_pools` VALUES (6846,'Bayawak','Bayawak',174,0x0000490100000000000000000000000000000000,1,1,11,240,100,0,1,0,1,2,0,0,0,131,0,0,0,0,0,174,174); INSERT INTO `mob_pools` VALUES (6847,'Holy_Moly','Holy_Moly',207,0x0000EA0700000000000000000000000000000000,1,1,7,240,100,0,1,0,1,2,0,32,0,647,0,0,0,0,0,207,207); INSERT INTO `mob_pools` VALUES (6848,'Moly','Moly',207,0x0000E80700000000000000000000000000000000,1,1,7,240,100,0,1,0,1,2,0,0,0,641,0,0,0,0,0,207,207); diff --git a/sql/mob_spell_lists.sql b/sql/mob_spell_lists.sql index a15b2f0c8f4..7b086d43273 100644 --- a/sql/mob_spell_lists.sql +++ b/sql/mob_spell_lists.sql @@ -5031,7 +5031,11 @@ INSERT INTO `mob_spell_lists` VALUES ('Toxic_Tamlyn',500,231,1,255); -- bio_ii -- Zirnitra INSERT INTO `mob_spell_lists` VALUES ('Zirnitra',501,359,75,255); -- silencega (75~255) --- Next Available: 502 +-- Pyuu the Spatemaker +INSERT INTO `mob_spell_lists` VALUES ('Pyuu_the_Spatemaker',502,171,1,255); -- water_iii (1~255) +INSERT INTO `mob_spell_lists` VALUES ('Pyuu_the_Spatemaker',502,201,1,255); -- waterga_iii (1~255) + +-- Next Available: 503 /*!40000 ALTER TABLE `mob_spell_lists` ENABLE KEYS */; UNLOCK TABLES; diff --git a/sql/nm_spawn_points.sql b/sql/nm_spawn_points.sql index da87fe645f5..89473f93961 100644 --- a/sql/nm_spawn_points.sql +++ b/sql/nm_spawn_points.sql @@ -3044,6 +3044,10 @@ INSERT INTO `nm_spawn_points` VALUES (17281061,1,-299.000,0.000,192.000); INSERT INTO `nm_spawn_points` VALUES (17281061,2,-334.000,3.000,182.000); INSERT INTO `nm_spawn_points` VALUES (17281061,3,-301.000,0.000,166.000); INSERT INTO `nm_spawn_points` VALUES (17281149,0,-279.575,3.317,16.011); -- Mischievous Micholas +INSERT INTO `nm_spawn_points` VALUES (17281296,0,-20.295,8.400,-113.263); -- Pyuu the Spatemaker (H-9) +INSERT INTO `nm_spawn_points` VALUES (17281296,1,-632.089,0.317,35.521); -- Pyuu the Spatemaker (E-8) +INSERT INTO `nm_spawn_points` VALUES (17281296,2,-356.919,16.282,-500.287); -- Pyuu the Spatemaker (F-12) +INSERT INTO `nm_spawn_points` VALUES (17281296,3,154.125,8.027,500.785); -- Pyuu the Spatemaker (I-5) INSERT INTO `nm_spawn_points` VALUES (17285220,0,190.942,0.345,94.828); INSERT INTO `nm_spawn_points` VALUES (17285220,1,219.102,0.430,45.071); INSERT INTO `nm_spawn_points` VALUES (17285220,2,230.358,0.043,48.605); diff --git a/sql/npc_list.sql b/sql/npc_list.sql index 8cc4bcccb2b..70db5cfe52b 100644 --- a/sql/npc_list.sql +++ b/sql/npc_list.sql @@ -28570,7 +28570,7 @@ INSERT INTO `npc_list` VALUES (17752281,'Door_Acolyte_Hostel','Door:Acolyte Host INSERT INTO `npc_list` VALUES (17752282,'Door_Acolyte_Hostel','Door:Acolyte Hostel',0,174.987,-2.601,238.860,32769,40,40,0,0,0,0,3,0x0000320000000000000000000000000000000000,0,NULL,0); INSERT INTO `npc_list` VALUES (17752283,'Door_Acolyte_Hostel','Door:Acolyte Hostel',0,174.987,-2.601,230.860,32769,40,40,0,0,0,0,3,0x0000320000000000000000000000000000000000,0,NULL,0); INSERT INTO `npc_list` VALUES (17752284,'Door_Acolyte_Hostel','Door:Acolyte Hostel',0,174.987,-2.601,222.860,32769,40,40,0,0,0,0,3,0x0000320000000000000000000000000000000000,0,NULL,0); -INSERT INTO `npc_list` VALUES (17752285,'Door_Acolyte_Hostel','Door:Acolyte Hostel',0,124.000,-3.000,222.215,32769,40,40,0,0,0,0,3,0x0000320000000000000000000000000000000000,0,NULL,0); +INSERT INTO `npc_list` VALUES (17752285,'Door_Acolyte_Hostel_F','Door:Acolyte Hostel',0,124.000,-3.000,222.215,32769,40,40,0,0,0,0,3,0x0000320000000000000000000000000000000000,0,NULL,0); INSERT INTO `npc_list` VALUES (17752286,'Katzun-Nattzun','Katzun-Nattzun',64,124.000,-2.500,221.215,0,40,40,0,1,0,6,27,0x0100010500100820083008400850006000700000,32,NULL,1); INSERT INTO `npc_list` VALUES (17752287,'Talking_Doll','Talking Doll',253,152.888,-2.500,222.860,0,40,40,0,1,0,6,27,0x0000CA0300000000000000000000000000000000,32,NULL,1); INSERT INTO `npc_list` VALUES (17752288,'Dienger','Dienger',201,-46.448,-5.312,212.384,21,40,40,34,0,0,0,27,0x0000CE0300000000000000000000000000000000,32,NULL,1); diff --git a/sql/pet_skills.sql b/sql/pet_skills.sql index 79027a24960..f9ff3f428c0 100644 --- a/sql/pet_skills.sql +++ b/sql/pet_skills.sql @@ -54,6 +54,32 @@ INSERT INTO `pet_skills` VALUES (519,7,'holy_mist',0,7.0,2000,1000,4,317,@SKILLF INSERT INTO `pet_skills` VALUES (520,8,'soothing_ruby',1,18.0,2000,1000,3,323,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_WARD,0,13,0,0,0,0); INSERT INTO `pet_skills` VALUES (773,9,'pacifying_ruby',0,18.0,2000,1000,3,323,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_WARD,0,13,0,0,0,0); +-- Ifrit +INSERT INTO `pet_skills` VALUES (544,32,'punch',0,7.0,2000,1000,4,317,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_RAGE,0,13,0,3,0,0); -- Liquefaction (3) +INSERT INTO `pet_skills` VALUES (545,33,'fire_ii',0,14.0,2000,1000,4,317,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_RAGE,0,13,0,0,0,0); +INSERT INTO `pet_skills` VALUES (546,34,'burning_strike',0,7.0,2000,1000,4,317,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_RAGE,0,13,0,8,0,0); -- Impaction (8) +INSERT INTO `pet_skills` VALUES (547,35,'double_punch',0,7.0,2000,1000,4,317,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_RAGE,0,13,0,2,0,0); -- Compression (2) +INSERT INTO `pet_skills` VALUES (548,36,'crimson_howl',1,14.0,2000,1000,3,319,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_WARD,0,13,0,0,0,0); +INSERT INTO `pet_skills` VALUES (549,37,'fire_iv',0,14.0,2000,1000,4,317,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_RAGE,0,13,0,0,0,0); +INSERT INTO `pet_skills` VALUES (550,38,'flaming_crush',0,7.0,2000,1000,4,317,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_RAGE,0,13,0,11,5,0); -- Fusion (11), Reverberation (5) +INSERT INTO `pet_skills` VALUES (551,39,'meteor_strike',0,14.0,2000,1000,4,317,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_RAGE,0,13,0,0,0,0); +INSERT INTO `pet_skills` VALUES (552,40,'inferno',1,18.0,2000,1000,4,317,@SKILLFLAG_ASTRAL_FLOW | @SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_RAGE,0,13,0,0,0,0); +INSERT INTO `pet_skills` VALUES (553,41,'inferno_howl',1,14.0,2000,1000,3,319,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_WARD,0,13,0,0,0,0); +INSERT INTO `pet_skills` VALUES (554,42,'conflag_strike',0,18.0,2000,1000,4,317,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_RAGE,0,13,0,0,0,0); + +-- Titan +INSERT INTO `pet_skills` VALUES (560,48,'rock_throw',0,18.0,2000,1000,4,317,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_RAGE,0,13,0,4,0,0); -- Scission (4) +INSERT INTO `pet_skills` VALUES (561,49,'stone_ii',0,14.0,2000,1000,4,317,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_RAGE,0,13,0,0,0,0); +INSERT INTO `pet_skills` VALUES (562,50,'rock_buster',0,8.0,2000,1000,4,317,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_RAGE,0,13,0,5,0,0); -- Reverberation (5) +INSERT INTO `pet_skills` VALUES (563,51,'megalith_throw',0,18.0,2000,1000,4,317,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_RAGE,0,13,0,7,0,0); -- Induration (7) +INSERT INTO `pet_skills` VALUES (564,52,'earthen_ward',1,14.0,2000,1000,3,319,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_WARD,0,13,0,0,0,0); +INSERT INTO `pet_skills` VALUES (565,53,'stone_iv',0,14.0,2000,1000,4,317,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_RAGE,0,13,0,0,0,0); +INSERT INTO `pet_skills` VALUES (566,54,'mountain_buster',0,8.0,2000,1000,4,317,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_RAGE,0,13,0,9,7,0); -- Gravitation (9), Induration (7) +INSERT INTO `pet_skills` VALUES (567,55,'geocrush',0,14.0,2000,1000,4,317,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_RAGE,0,13,0,0,0,0); +INSERT INTO `pet_skills` VALUES (568,56,'earthen_fury',1,18.0,2000,1000,4,317,@SKILLFLAG_ASTRAL_FLOW | @SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_RAGE,0,13,0,0,0,0); +INSERT INTO `pet_skills` VALUES (569,57,'earthen_armor',1,14.0,2000,1000,3,319,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_WARD,0,13,0,0,0,0); +INSERT INTO `pet_skills` VALUES (570,58,'crag_throw',0,18.0,2000,1000,4,317,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_RAGE,0,13,0,9,4,0); -- Gravitation (9), Scission (4) + -- Leviathan INSERT INTO `pet_skills` VALUES (576,64,'barracuda_dive',0,14.0,2000,1000,4,317,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_RAGE,0,13,0,5,0,0); -- Reverberation (5) INSERT INTO `pet_skills` VALUES (577,65,'water_ii',0,14.0,2000,1000,4,317,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_RAGE,0,13,0,0,0,0); @@ -67,6 +93,19 @@ INSERT INTO `pet_skills` VALUES (584,72,'tidal_wave',1,18.0,2000,1000,4,317,@SKI INSERT INTO `pet_skills` VALUES (585,73,'tidal_roar',1,18.0,2000,1000,4,320,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_WARD,0,13,0,0,0,0); INSERT INTO `pet_skills` VALUES (586,74,'soothing_current',1,18.0,2000,1000,3,319,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_WARD,0,13,0,0,0,0); +-- Garuda +INSERT INTO `pet_skills` VALUES (592,80,'claw',0,14.0,2000,1000,4,317,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_RAGE,0,13,0,6,0,0); -- Detonation (6) +INSERT INTO `pet_skills` VALUES (593,81,'aero_ii',0,14.0,2000,1000,4,317,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_RAGE,0,13,0,0,0,0); +INSERT INTO `pet_skills` VALUES (594,82,'whispering_wind',1,18.0,2000,1000,3,318,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_WARD,0,13,0,0,0,0); +INSERT INTO `pet_skills` VALUES (595,83,'hastega',1,18.0,2000,1000,3,319,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_WARD,0,13,0,0,0,0); +INSERT INTO `pet_skills` VALUES (596,84,'aerial_armor',1,18.0,2000,1000,3,319,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_WARD,0,13,0,0,0,0); +INSERT INTO `pet_skills` VALUES (597,85,'aero_iv',0,14.0,2000,1000,4,317,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_RAGE,0,13,0,0,0,0); +INSERT INTO `pet_skills` VALUES (598,86,'predator_claws',0,8.0,2000,1000,4,317,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_RAGE,0,13,0,12,4,0); -- Fragmentation (12), Scission (4) +INSERT INTO `pet_skills` VALUES (599,87,'wind_blade',0,14.0,2000,1000,4,317,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_RAGE,0,13,0,0,0,0); +INSERT INTO `pet_skills` VALUES (600,88,'aerial_blast',1,18.0,2000,1000,4,317,@SKILLFLAG_ASTRAL_FLOW | @SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_RAGE,0,13,0,0,0,0); +INSERT INTO `pet_skills` VALUES (601,89,'fleet_wind',1,18.0,2000,1000,3,319,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_WARD,0,13,0,0,0,0); +INSERT INTO `pet_skills` VALUES (602,90,'hastega_ii',1,18.0,2000,1000,3,319,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_WARD,0,13,0,0,0,0); + -- Cait Sith INSERT INTO `pet_skills` VALUES (521,161,'regal_scratch',0,18.0,2000,1000,4,317,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_RAGE,0,13,0,4,0,0); -- Scission (4) INSERT INTO `pet_skills` VALUES (522,162,'mewing_lullaby',1,12.0,2000,1000,4,317,@SKILLFLAG_SPECIAL | @SKILLFLAG_BLOODPACT_WARD,0,13,0,0,0,0); diff --git a/sql/spell_list.sql b/sql/spell_list.sql index e2e836147ce..485a3808443 100644 --- a/sql/spell_list.sql +++ b/sql/spell_list.sql @@ -860,7 +860,7 @@ INSERT INTO `spell_list` VALUES (880,'drain_iii',0x00000000000000630000000000000 -- INSERT INTO `spell_list` VALUES (892,'luminohelix_ii',0x00000000000000000000000000000000000000000000,8,7,0,1,0,0,2000,48000,0,0,288,1000,0,0,1.00,0,0,0,0,NULL); -- INSERT INTO `spell_list` VALUES (893,'full_cure',0x00000000000000000000000000000000000000000000,8,7,0,1,0,0,2000,48000,0,0,288,1000,0,0,1.00,0,0,0,0,NULL); -- INSERT INTO `spell_list` VALUES (894,'refresh_iii',0x00000000000000000000000000000000000000000000,8,7,0,1,0,0,2000,48000,0,0,288,1012,0,0,1.00,0,0,0,0,NULL); --- INSERT INTO `spell_list` VALUES (895,'temper_ii',0x00000000000000000000000000000000000000000000,8,7,0,1,0,0,2000,48000,0,0,288,1000,0,0,1.00,0,0,0,0,NULL); +INSERT INTO `spell_list` VALUES (895,'temper_ii',0x00000000630000000000000000000000000000000000,6,142,7,0,1,34,72,7000,36000,0,0,1011,2000,0,0,1.00,1,300,0,0,'SOA'); -- Trust spawn animation : 921 -- Trust dismiss animation : 922 INSERT INTO `spell_list` VALUES (896,'shantotto',0x01010101010101010101010101010101010101010101,8,0,7,0,1,0,0,3000,24000,0,0,939,2000,0,0,1.00,0,0,0,0,NULL); diff --git a/sql/synth_recipes.sql b/sql/synth_recipes.sql index a4c03b49af0..430609ead90 100644 --- a/sql/synth_recipes.sql +++ b/sql/synth_recipes.sql @@ -2236,7 +2236,7 @@ INSERT INTO `synth_recipes` VALUES (31504,0,0,0,0,0,32,0,0,0,0,4099,4241,819,826 INSERT INTO `synth_recipes` VALUES (31505,0,0,0,0,0,32,0,0,0,0,4099,4241,819,826,834,2838,0,0,0,0,15053,15058,15058,15058,1,1,1,1,'Combat Mittens'); INSERT INTO `synth_recipes` VALUES (31506,0,0,7,0,0,32,0,0,0,0,4099,4241,706,817,826,826,0,0,0,0,12714,12781,12781,12781,1,1,1,1,'Soil Tekko'); INSERT INTO `synth_recipes` VALUES (31507,0,0,0,0,0,33,0,0,0,0,4099,4241,819,825,825,825,826,826,0,0,12610,12670,12670,12670,1,1,1,1,'Cloak'); -INSERT INTO `synth_recipes` VALUES (31508,1,0,0,0,0,33,0,0,0,0,4098,4240,499,0,0,0,0,0,0,0,820,820,820,820,4,4,4,4,'Gigas Necklace (desynth)'); +INSERT INTO `synth_recipes` VALUES (31508,1,0,0,0,0,33,0,0,0,0,4098,4240,499,0,0,0,0,0,0,0,820,820,820,820,1,2,3,4,'Gigas Necklace (desynth)'); INSERT INTO `synth_recipes` VALUES (31509,0,0,0,0,0,33,0,14,0,0,4098,4240,937,2150,2150,2171,0,0,0,0,18681,18681,18681,18681,8,16,20,24,'Aht Urhgan Dart'); INSERT INTO `synth_recipes` VALUES (31510,0,0,0,0,0,34,0,0,0,0,4099,4241,817,825,825,834,0,0,0,0,1194,1194,1194,1194,33,66,99,99,'Shinobi-Tabi'); -- INSERT INTO `synth_recipes` VALUES (31511,0,0,0,0,0,34,255,0,0,0,4099,4241,825,834,850,1699,1700,0,0,0,14857,14861,14861,14861,1,1,1,1,'Garish Mitts'); @@ -2808,7 +2808,7 @@ INSERT INTO `synth_recipes` VALUES (41505,0,0,0,0,0,0,32,0,0,0,4099,4241,680,848 INSERT INTO `synth_recipes` VALUES (41506,0,0,0,0,0,0,33,0,0,0,4099,4241,825,848,851,0,0,0,0,0,14817,14818,14818,14818,1,1,1,1,'Field Gloves'); INSERT INTO `synth_recipes` VALUES (41507,0,0,0,0,0,0,33,0,0,0,4099,4241,850,13004,0,0,0,0,0,0,14145,14146,14146,14146,1,1,1,1,'San d\'Orian Boots'); INSERT INTO `synth_recipes` VALUES (41508,0,0,0,0,0,0,33,0,0,0,4097,4239,820,858,0,0,0,0,0,0,13571,13609,13609,13609,1,1,1,1,'Wolf Mantle'); -INSERT INTO `synth_recipes` VALUES (41509,1,0,0,0,0,0,33,0,0,0,4098,4240,1631,0,0,0,0,0,0,0,850,851,851,851,1,1,1,1,'Moblin Armor (desynth)'); +INSERT INTO `synth_recipes` VALUES (41509,1,0,0,0,0,0,33,0,0,0,4098,4240,1631,0,0,0,0,0,0,0,850,850,851,851,1,1,1,1,'Moblin Armor (desynth)'); INSERT INTO `synth_recipes` VALUES (41510,0,0,0,0,0,8,34,0,0,0,4099,4241,825,848,848,0,0,0,0,0,12994,13040,13040,13040,1,1,1,1,'Shoes'); INSERT INTO `synth_recipes` VALUES (41511,0,0,0,0,0,0,35,0,0,0,4099,4241,1977,12570,0,0,0,0,0,0,14493,14493,14493,14493,1,1,1,1,'Healing Vest'); INSERT INTO `synth_recipes` VALUES (41512,0,2016,0,0,0,0,35,0,0,0,4103,4245,635,859,1642,1645,1647,4509,0,0,873,873,873,873,1,1,1,1,'Light Ram Leather'); diff --git a/sql/traits.sql b/sql/traits.sql index 6303a9321a3..d3f18cd473d 100644 --- a/sql/traits.sql +++ b/sql/traits.sql @@ -707,6 +707,34 @@ INSERT INTO `traits` VALUES (127,'smite',14,40,1,898,25,'SOA',0); INSERT INTO `traits` VALUES (127,'smite',14,80,2,898,38,'SOA',0); INSERT INTO `traits` VALUES (127,'smite',18,60,1,898,25,'SOA',0); +INSERT INTO `traits` VALUES (129,'damage limit+',1,40,1,1080,10,NULL,0); +INSERT INTO `traits` VALUES (129,'damage limit+',1,80,2,1080,20,NULL,0); +INSERT INTO `traits` VALUES (129,'damage limit+',2,30,1,1080,10,NULL,0); +INSERT INTO `traits` VALUES (129,'damage limit+',2,60,2,1080,20,NULL,0); +INSERT INTO `traits` VALUES (129,'damage limit+',2,90,3,1080,30,NULL,0); +INSERT INTO `traits` VALUES (129,'damage limit+',5,60,1,1080,10,NULL,0); +INSERT INTO `traits` VALUES (129,'damage limit+',6,50,1,1080,10,NULL,0); +INSERT INTO `traits` VALUES (129,'damage limit+',8,20,1,1080,10,NULL,0); +INSERT INTO `traits` VALUES (129,'damage limit+',8,40,2,1080,20,NULL,0); +INSERT INTO `traits` VALUES (129,'damage limit+',8,55,3,1080,30,NULL,0); +INSERT INTO `traits` VALUES (129,'damage limit+',8,70,4,1080,40,NULL,0); +INSERT INTO `traits` VALUES (129,'damage limit+',8,80,5,1080,50,NULL,0); +INSERT INTO `traits` VALUES (129,'damage limit+',9,45,1,1080,10,NULL,0); +INSERT INTO `traits` VALUES (129,'damage limit+',9,90,2,1080,20,NULL,0); +INSERT INTO `traits` VALUES (129,'damage limit+',11,30,1,1080,10,NULL,0); +INSERT INTO `traits` VALUES (129,'damage limit+',11,60,2,1080,20,NULL,0); +INSERT INTO `traits` VALUES (129,'damage limit+',11,90,3,1080,30,NULL,0); +INSERT INTO `traits` VALUES (129,'damage limit+',12,40,1,1080,10,NULL,0); +INSERT INTO `traits` VALUES (129,'damage limit+',12,80,2,1080,20,NULL,0); +INSERT INTO `traits` VALUES (129,'damage limit+',13,50,1,1080,10,NULL,0); +INSERT INTO `traits` VALUES (129,'damage limit+',14,30,1,1080,10,NULL,0); +INSERT INTO `traits` VALUES (129,'damage limit+',14,60,2,1080,20,NULL,0); +INSERT INTO `traits` VALUES (129,'damage limit+',14,90,3,1080,30,NULL,0); +INSERT INTO `traits` VALUES (129,'damage limit+',18,45,1,1080,10,NULL,0); +INSERT INTO `traits` VALUES (129,'damage limit+',18,90,2,1080,20,NULL,0); +INSERT INTO `traits` VALUES (129,'damage limit+',19,45,1,1080,10,NULL,0); +INSERT INTO `traits` VALUES (129,'damage limit+',19,90,2,1080,20,NULL,0); + INSERT INTO `traits` VALUES (134,'ws damage boost',14,45,1,840,7,'ROV',0); INSERT INTO `traits` VALUES (134,'ws damage boost',14,55,2,840,10,'ROV',0); INSERT INTO `traits` VALUES (134,'ws damage boost',14,65,3,840,13,'ROV',0); diff --git a/src/common/mutex_guarded.h b/src/common/mutex_guarded.h index e30add0d96d..385a20c7d72 100644 --- a/src/common/mutex_guarded.h +++ b/src/common/mutex_guarded.h @@ -3,6 +3,9 @@ #include #include +#include "cbasetypes.h" +#include "tracy.h" + // https://www.reddit.com/r/cpp/comments/p132c7/comment/h8b8nml/?share_id=-NRyj9iRw5TqSi4Mm381j template < class T, @@ -19,30 +22,35 @@ struct mutex_guarded { } + DISALLOW_COPY_AND_MOVE(mutex_guarded); + auto read(auto f) const { auto l = lock(); + LockMark(mutex); return f(target); } auto write(auto f) { auto l = lock(); + LockMark(mutex); return f(target); } private: - mutable M mutex; - T target; + mutable TracyLockable(M, mutex); + + T target; auto lock() const { - return RL(mutex); + return RL(mutex); } auto lock() { - return WL(mutex); + return WL(mutex); } }; diff --git a/src/common/tracy.h b/src/common/tracy.h index ac9d64a978e..421e5bb480f 100644 --- a/src/common/tracy.h +++ b/src/common/tracy.h @@ -89,6 +89,9 @@ inline std::string Hex16ToString(std::uint16_t hex) #define TracyReportLuaMemory(L) std::ignore = L #define TracyMessageStr(str) std::ignore = str #define TracySetThreadName(str) std::ignore = str +#define TracyLockable(m, n) m n +#define LockableBase(type) type +#define LockMark(m) std::ignore = m #endif // clang-format on diff --git a/src/login/data_session.cpp b/src/login/data_session.cpp index 30dbb93fd78..50b67a83007 100644 --- a/src/login/data_session.cpp +++ b/src/login/data_session.cpp @@ -326,7 +326,7 @@ void data_session::read_func() if (sql->Query("SELECT * \ FROM accounts_sessions \ - WHERE accid = %u and client_port != '0';", + WHERE accid = %u AND client_port != '0';", session.accountID) != SQL_ERROR && sql->NumRows() != 0) { @@ -381,7 +381,7 @@ void data_session::read_func() characterSelectionResponse.cache_port = searchPort; // If the session was not processed by the game server, then it must be deleted. - sql->Query("DELETE FROM accounts_sessions WHERE accid = %u and client_port = 0", session.accountID); + sql->Query("DELETE FROM accounts_sessions WHERE accid = %u AND client_port = 0", session.accountID); char session_key[sizeof(key3) * 2 + 1]; bin2hex(session_key, key3, sizeof(key3)); diff --git a/src/login/view_session.cpp b/src/login/view_session.cpp index 1ea53b9ac53..7ae37e13c05 100644 --- a/src/login/view_session.cpp +++ b/src/login/view_session.cpp @@ -58,7 +58,7 @@ void view_session::read_func() auto sql = std::make_unique(); uint32 accountID = 0; - int32 ret = sql->Query("SELECT accid FROM chars WHERE charid = %u and charname = '%s' LIMIT 1;", + int32 ret = sql->Query("SELECT accid FROM chars WHERE charid = %u AND charname = '%s' LIMIT 1;", requestedCharacterID, requestedCharacter); if (ret != SQL_ERROR && sql->NumRows() != 0 && sql->NextRow() == SQL_SUCCESS) { diff --git a/src/map/ai/ai_container.cpp b/src/map/ai/ai_container.cpp index 27760cf189c..4d3ec211900 100644 --- a/src/map/ai/ai_container.cpp +++ b/src/map/ai/ai_container.cpp @@ -185,7 +185,7 @@ bool CAIContainer::Untargetable(duration _duration, bool canChangeState) bool CAIContainer::Internal_Engage(uint16 targetid) { - //#TODO: pet engage/disengage + // #TODO: pet engage/disengage auto* entity = dynamic_cast(PEntity); if (entity && entity->PAI->IsEngaged()) @@ -197,12 +197,12 @@ bool CAIContainer::Internal_Engage(uint16 targetid) } return false; } - //#TODO: use valid target stuff from spell + // #TODO: use valid target stuff from spell if (entity) { - //#TODO: remove m_battleTarget if possible (need to check disengage) - // Check if an entity can change to the attack state - // Allow entity with prevent action effect to very briefly switch to the attack state to be properly engaged + // #TODO: remove m_battleTarget if possible (need to check disengage) + // Check if an entity can change to the attack state + // Allow entity with prevent action effect to very briefly switch to the attack state to be properly engaged if (CanChangeState() || (GetCurrentState() && GetCurrentState()->IsCompleted()) || entity->StatusEffectContainer->HasPreventActionEffect(true)) { if (ForceChangeState(entity, targetid)) @@ -417,11 +417,11 @@ void CAIContainer::Tick(time_point _tick) m_PrevTick = m_Tick; m_Tick = _tick; - //#TODO: timestamp in the event? + // #TODO: timestamp in the event? EventHandler.triggerListener("TICK", CLuaBaseEntity(PEntity)); PEntity->Tick(_tick); - //#TODO: check this in the controller instead maybe? (might not want to check every tick) + // #TODO: check this in the controller instead maybe? (might not want to check every tick) ActionQueue.checkAction(_tick); // check pathfinding only if there is no controller to do it @@ -529,6 +529,16 @@ bool CAIContainer::QueueEmpty() return ActionQueue.isEmpty(); } +void CAIContainer::ClearActionQueue() +{ + ActionQueue.clearActionQueue(); +} + +void CAIContainer::ClearTimerQueue() +{ + ActionQueue.clearTimerQueue(); +} + void CAIContainer::checkQueueImmediately() { ActionQueue.checkAction(server_clock::now()); diff --git a/src/map/ai/ai_container.h b/src/map/ai/ai_container.h index f64bdf84208..4f523e72dba 100644 --- a/src/map/ai/ai_container.h +++ b/src/map/ai/ai_container.h @@ -122,6 +122,8 @@ class CAIContainer void QueueAction(queueAction_t&&); bool QueueEmpty(); + void ClearActionQueue(); + void ClearTimerQueue(); void checkQueueImmediately(); // stores all events and their associated lua callbacks diff --git a/src/map/ai/controllers/mob_controller.cpp b/src/map/ai/controllers/mob_controller.cpp index 91aa063902b..cda388cf651 100644 --- a/src/map/ai/controllers/mob_controller.cpp +++ b/src/map/ai/controllers/mob_controller.cpp @@ -108,7 +108,7 @@ bool CMobController::CanPursueTarget(CBattleEntity* PTarget) if (!PMob->PAI->PathFind->InWater() && PTarget && !PTarget->StatusEffectContainer->HasStatusEffect(EFFECT_DEODORIZE)) { // certain weather / deodorize will turn on time deaggro - return PMob->m_disableScent; + return !PMob->m_disableScent; } } return false; @@ -119,7 +119,7 @@ bool CMobController::CheckHide(CBattleEntity* PTarget) TracyZoneScoped; if (PTarget && PTarget->GetMJob() == JOB_THF && PTarget->StatusEffectContainer->HasStatusEffect(EFFECT_HIDE)) { - return !CanPursueTarget(PTarget) && !PMob->m_TrueDetection; + return !CanPursueTarget(PTarget) && !PMob->m_TrueDetection && !(PMob->getMobMod(MOBMOD_DETECTION) & DETECT_HEARING); } return false; } @@ -183,7 +183,18 @@ void CMobController::TryLink() { if (PTarget->PPet->objtype == TYPE_PET && ((CPetEntity*)PTarget->PPet)->getPetType() == PET_TYPE::AVATAR) { - petutils::AttackTarget(PTarget, PMob); + if (PTarget->objtype == TYPE_PC) + { + std::unique_ptr errMsg; + if (PTarget->PPet->CanAttack(PMob, errMsg)) + { + petutils::AttackTarget(PTarget, PMob); + } + } + else + { + petutils::AttackTarget(PTarget, PMob); + } } } @@ -199,7 +210,9 @@ void CMobController::TryLink() for (auto& member : PMob->PParty->members) { CMobEntity* PPartyMember = dynamic_cast(member); - if (!PPartyMember) + // Note if the mob to link with this one is a pet then do not link + // Pets only link with their masters + if (!PPartyMember || (PPartyMember && PPartyMember->PMaster)) { continue; } @@ -1153,6 +1166,17 @@ bool CMobController::CanAggroTarget(CBattleEntity* PTarget) return false; } + // Do not aggro if a normal CoP Fomor and the player has low enough fomor hate + if (PMob->m_Family == 115 && !(PMob->m_Type & MOBTYPE_NOTORIOUS) && + (PMob->getZone() >= ZONE_LUFAISE_MEADOWS && PMob->getZone() <= ZONE_SACRARIUM) && + PTarget->objtype == TYPE_PC) + { + if (static_cast(PTarget)->getCharVar("FOMOR_HATE") < 8) + { + return false; + } + } + // Don't aggro I'm an underground worm if ((PMob->m_roamFlags & ROAMFLAG_WORM) && PMob->IsNameHidden()) { diff --git a/src/map/ai/controllers/pet_controller.cpp b/src/map/ai/controllers/pet_controller.cpp index 8e66dc24c7a..cbd9c729d6d 100644 --- a/src/map/ai/controllers/pet_controller.cpp +++ b/src/map/ai/controllers/pet_controller.cpp @@ -87,8 +87,16 @@ void CPetController::DoRoamTick(time_point tick) if (currentDistance > PetRoamDistance) { - if (currentDistance < 35.0f && PPet->PAI->PathFind->PathAround(PPet->PMaster->loc.p, 2.0f, PATHFLAG_RUN | PATHFLAG_WALLHACK)) + if (currentDistance < 35.0f) { + if (!PPet->PAI->PathFind->IsFollowingPath() || + distance(PPet->PAI->PathFind->GetDestination(), PPet->PMaster->loc.p) > 2.0f) // recalculate path only if owner moves more than X yalms + { + if (!PPet->PAI->PathFind->PathAround(PPet->PMaster->loc.p, 2.0f, PATHFLAG_RUN | PATHFLAG_WALLHACK)) + { + PPet->PAI->PathFind->PathInRange(PPet->PMaster->loc.p, 2.0f, PATHFLAG_RUN | PATHFLAG_WALLHACK); + } + } PPet->PAI->PathFind->FollowPath(m_Tick); } else if (PPet->GetSpeed() > 0) diff --git a/src/map/ai/controllers/player_charm_controller.cpp b/src/map/ai/controllers/player_charm_controller.cpp index 29e8c1b4034..0820e893955 100644 --- a/src/map/ai/controllers/player_charm_controller.cpp +++ b/src/map/ai/controllers/player_charm_controller.cpp @@ -102,13 +102,16 @@ void CPlayerCharmController::DoRoamTick(time_point tick) if (currentDistance > RoamDistance) { - if (currentDistance < 35.0f && POwner->PAI->PathFind->PathAround(POwner->PMaster->loc.p, 2.0f, PATHFLAG_RUN | PATHFLAG_WALLHACK)) + if (POwner->PAI->PathFind) { - POwner->PAI->PathFind->FollowPath(m_Tick); - } - else if (POwner->GetSpeed() > 0) - { - POwner->PAI->PathFind->WarpTo(POwner->PMaster->loc.p, RoamDistance); + if (currentDistance < 35.0f && POwner->PAI->PathFind->PathAround(POwner->PMaster->loc.p, 2.0f, PATHFLAG_RUN | PATHFLAG_WALLHACK)) + { + POwner->PAI->PathFind->FollowPath(m_Tick); + } + else if (POwner->GetSpeed() > 0) + { + POwner->PAI->PathFind->WarpTo(POwner->PMaster->loc.p, RoamDistance); + } } } } diff --git a/src/map/ai/helpers/action_queue.cpp b/src/map/ai/helpers/action_queue.cpp index 65171eba03d..006305bfa81 100644 --- a/src/map/ai/helpers/action_queue.cpp +++ b/src/map/ai/helpers/action_queue.cpp @@ -96,3 +96,19 @@ bool CAIActionQueue::isEmpty() { return actionQueue.empty() && timerQueue.empty(); } + +void CAIActionQueue::clearActionQueue() +{ + while (!actionQueue.empty()) + { + actionQueue.pop(); + } +} + +void CAIActionQueue::clearTimerQueue() +{ + while (!timerQueue.empty()) + { + timerQueue.pop(); + } +} diff --git a/src/map/ai/helpers/action_queue.h b/src/map/ai/helpers/action_queue.h index fdaabe47989..6c753c6c61c 100644 --- a/src/map/ai/helpers/action_queue.h +++ b/src/map/ai/helpers/action_queue.h @@ -84,6 +84,8 @@ class CAIActionQueue void handleAction(queueAction_t& action); + void clearActionQueue(); + void clearTimerQueue(); bool isEmpty(); private: diff --git a/src/map/ai/states/ability_state.cpp b/src/map/ai/states/ability_state.cpp index 9f2af6e1639..8e30ee58d35 100644 --- a/src/map/ai/states/ability_state.cpp +++ b/src/map/ai/states/ability_state.cpp @@ -52,7 +52,8 @@ CAbilityState::CAbilityState(CBattleEntity* PEntity, uint16 targid, uint16 abili SetTarget(PTarget->targid); m_PAbility = std::make_unique(*PAbility); m_castTime = PAbility->getCastTime(); - if (m_castTime > 0s) + + if (m_castTime > 0s && CanUseAbility()) { action_t action; action.id = PEntity->id; @@ -65,8 +66,12 @@ CAbilityState::CAbilityState(CBattleEntity* PEntity, uint16 targid, uint16 abili actionTarget.messageID = 326; actionTarget.param = PAbility->getID(); PEntity->loc.zone->PushPacket(PEntity, CHAR_INRANGE_SELF, new CActionPacket(action)); + m_PEntity->PAI->EventHandler.triggerListener("ABILITY_START", CLuaBaseEntity(m_PEntity), CLuaAbility(PAbility)); + } + else + { + m_PEntity->PAI->EventHandler.triggerListener("ABILITY_START", CLuaBaseEntity(m_PEntity), CLuaAbility(PAbility)); } - m_PEntity->PAI->EventHandler.triggerListener("ABILITY_START", CLuaBaseEntity(m_PEntity), CLuaAbility(PAbility)); } CAbility* CAbilityState::GetAbility() @@ -77,18 +82,21 @@ CAbility* CAbilityState::GetAbility() void CAbilityState::ApplyEnmity() { auto* PTarget = GetTarget(); - if (m_PAbility->getValidTarget() & TARGET_ENEMY && PTarget->allegiance != m_PEntity->allegiance) + if (PTarget) { - if (PTarget->objtype == TYPE_MOB && !(m_PAbility->getCE() == 0 && m_PAbility->getVE() == 0)) + if (m_PAbility->getValidTarget() & TARGET_ENEMY && PTarget->allegiance != m_PEntity->allegiance) { - CMobEntity* mob = (CMobEntity*)PTarget; - mob->PEnmityContainer->UpdateEnmity(m_PEntity, m_PAbility->getCE(), m_PAbility->getVE(), false, m_PAbility->getID() == ABILITY_CHARM); - battleutils::ClaimMob(mob, m_PEntity); + if (PTarget->objtype == TYPE_MOB && !(m_PAbility->getCE() == 0 && m_PAbility->getVE() == 0)) + { + CMobEntity* mob = (CMobEntity*)PTarget; + mob->PEnmityContainer->UpdateEnmity(m_PEntity, m_PAbility->getCE(), m_PAbility->getVE(), false, m_PAbility->getID() == ABILITY_CHARM); + battleutils::ClaimMob(mob, m_PEntity); + } + } + else if (PTarget->allegiance == m_PEntity->allegiance) + { + battleutils::GenerateInRangeEnmity(m_PEntity, m_PAbility->getCE(), m_PAbility->getVE()); } - } - else if (PTarget->allegiance == m_PEntity->allegiance) - { - battleutils::GenerateInRangeEnmity(m_PEntity, m_PAbility->getCE(), m_PAbility->getVE()); } } @@ -174,7 +182,7 @@ bool CAbilityState::CanUseAbility() return false; } - if (PChar->IsValidTarget(PTarget->targid, PAbility->getValidTarget(), errMsg)) + if (PTarget && PChar->IsValidTarget(PTarget->targid, PAbility->getValidTarget(), errMsg)) { if (PChar != PTarget && distance(PChar->loc.p, PTarget->loc.p) > PAbility->getRange()) { @@ -188,7 +196,8 @@ bool CAbilityState::CanUseAbility() return false; } - if (PAbility->getID() >= ABILITY_HEALING_RUBY) + // TODO: Remove this when all pet abilities are moved to PetSkill system. + if (PAbility->getID() >= ABILITY_HEALING_RUBY && !battleutils::GetPetSkill(PAbility->getID())) { // Blood pact MP costs are stored under animation ID if (PChar->health.mp < PAbility->getAnimationID()) @@ -211,19 +220,36 @@ bool CAbilityState::CanUseAbility() } else { + bool tooFarAway = false; + bool cancelAbility = false; bool hasAmnesia = m_PEntity->StatusEffectContainer->HasStatusEffect(EFFECT_AMNESIA); bool hasImpairment = m_PEntity->StatusEffectContainer->HasStatusEffect(EFFECT_IMPAIRMENT); uint16 impairmentPower = hasImpairment ? m_PEntity->StatusEffectContainer->GetStatusEffect(EFFECT_IMPAIRMENT)->GetPower() : 0; + if (!PTarget) + { + cancelAbility = true; + } + if (hasAmnesia || (hasImpairment && (impairmentPower == 0x01 || impairmentPower == 0x03))) { - return false; + cancelAbility = true; } - if (m_PEntity->IsValidTarget(PTarget->targid, PAbility->getValidTarget(), errMsg)) + if (PTarget && m_PEntity->IsValidTarget(PTarget->targid, PAbility->getValidTarget(), errMsg)) { if (m_PEntity != PTarget && distance(m_PEntity->loc.p, PTarget->loc.p) > PAbility->getRange()) + { + cancelAbility = true; + tooFarAway = true; + } + } + + if (cancelAbility) + { + // Only create a packet if the ability isn't instant + if (m_castTime > 0s) { // Create this action packet that also sort of looks like an animation cancel packet to emit a red "Target is too far away" message. // Captured from a red " is too far away" message from healing breath IV @@ -241,12 +267,11 @@ bool CAbilityState::CanUseAbility() actionTarget.reaction = REACTION::MISS; actionTarget.speceffect = static_cast(0x24); actionTarget.param = 0; // Observed as 639 on retail, but I'm not sure that it actually does anything. - actionTarget.messageID = MSGBASIC_TOO_FAR_AWAY_RED; + actionTarget.messageID = tooFarAway ? MSGBASIC_TOO_FAR_AWAY_RED : 0; m_PEntity->loc.zone->PushPacket(m_PEntity, CHAR_INRANGE_SELF, new CActionPacket(action)); - - return false; } + return false; } // TODO: should luautils::OnAbilityCheck go here too? diff --git a/src/map/ai/states/item_state.cpp b/src/map/ai/states/item_state.cpp index 5174be08735..a12ccbe99a3 100644 --- a/src/map/ai/states/item_state.cpp +++ b/src/map/ai/states/item_state.cpp @@ -283,7 +283,7 @@ void CItemState::InterruptItem(action_t& action) action.actiontype = ACTION_ITEM_INTERRUPT; actionList_t& actionList = action.getNewActionList(); - actionList.ActionTargetID = (m_PEntity->IsValidTarget(m_targid, m_PItem->getValidTarget(), m_errorMsg) ? GetTarget()->id : 0); + actionList.ActionTargetID = (m_PEntity->IsValidTarget(m_targid, m_PItem->getValidTarget(), m_errorMsg) ? GetTarget() && GetTarget()->id : 0); actionTarget_t& actionTarget = actionList.getNewActionTarget(); diff --git a/src/map/ai/states/mobskill_state.cpp b/src/map/ai/states/mobskill_state.cpp index 9f7d5c50a56..a7fa93676e8 100644 --- a/src/map/ai/states/mobskill_state.cpp +++ b/src/map/ai/states/mobskill_state.cpp @@ -92,6 +92,13 @@ void CMobSkillState::SpendCost() m_spentTP = m_PEntity->addTP(-1000); m_PEntity->StatusEffectContainer->DelStatusEffect(EFFECT_SEKKANOKI); } + else if (m_PEntity->StatusEffectContainer->HasStatusEffect(EFFECT_MEIKYO_SHISUI) && + m_PEntity->GetLocalVar("[MeikyoShisui]MobSkillCount") > 0) + { + auto currentCount = m_PEntity->GetLocalVar("[MeikyoShisui]MobSkillCount"); + m_PEntity->SetLocalVar("[MeikyoShisui]MobSkillCount", currentCount - 1); + m_spentTP = m_PEntity->addTP(-1000); + } else { m_spentTP = m_PEntity->health.tp; diff --git a/src/map/ai/states/state.cpp b/src/map/ai/states/state.cpp index 56df2a212b6..e955105f492 100644 --- a/src/map/ai/states/state.cpp +++ b/src/map/ai/states/state.cpp @@ -26,6 +26,8 @@ CState::CState(CBaseEntity* PEntity, uint16 _targid) : m_PEntity(PEntity) , m_targid(_targid) { + // TODO: determine if this should go here; + // m_PTarget = m_PEntity->GetEntity(_targid); } void CState::UpdateTarget(uint16 targid) @@ -65,7 +67,7 @@ void CState::ResetEntryTime() void CState::SetTarget(uint16 _targid) { - if (_targid != m_targid) + if (!m_PTarget || _targid != m_targid || (m_PTarget && m_PTarget->targid != _targid)) { m_targid = _targid; UpdateTarget(_targid); diff --git a/src/map/ai/states/trigger_state.cpp b/src/map/ai/states/trigger_state.cpp index 1096e767c9f..0bf86cdfa0f 100644 --- a/src/map/ai/states/trigger_state.cpp +++ b/src/map/ai/states/trigger_state.cpp @@ -36,7 +36,7 @@ bool CTriggerState::Update(time_point tick) { if (!IsCompleted()) { - auto* PChar = static_cast(GetTarget()); + auto* PChar = dynamic_cast(GetTarget()); if (PChar && door && m_PEntity->animation == ANIMATION_CLOSE_DOOR) { close = true; diff --git a/src/map/attack.cpp b/src/map/attack.cpp index 6ff74b250dc..d394c4c66cf 100644 --- a/src/map/attack.cpp +++ b/src/map/attack.cpp @@ -99,16 +99,40 @@ void CAttack::SetCritical(bool value) } else { - float attBonus = 0.f; + float attBonus = 1.0f; if (m_attackType == PHYSICAL_ATTACK_TYPE::KICK) { if (CStatusEffect* footworkEffect = m_attacker->StatusEffectContainer->GetStatusEffect(EFFECT_FOOTWORK)) { - attBonus = footworkEffect->GetSubPower() / 256.f; // Mod is out of 256 + attBonus = 1 + (footworkEffect->GetSubPower() / 256.f); // Mod is out of 256 } } - m_damageRatio = battleutils::GetDamageRatio(m_attacker, m_victim, m_isCritical, attBonus); + SKILLTYPE skilltype = SKILLTYPE::SKILL_NONE; + + if (m_attacker->objtype == TYPE_PC) + { + SLOTTYPE slot = SLOT_MAIN; + + if (m_attackDirection == PHYSICAL_ATTACK_DIRECTION::RIGHTATTACK) + { + slot = SLOT_SUB; + } + + if (m_attacker->objtype == TYPE_PC) + { + if (auto* weapon = dynamic_cast(m_attacker->m_Weapons[slot])) + { + skilltype = static_cast(weapon->getSkillType()); + } + else + { + skilltype = SKILLTYPE::SKILL_HAND_TO_HAND; + } + } + } + + m_damageRatio = battleutils::GetDamageRatio(m_attacker, m_victim, m_isCritical, attBonus, skilltype); } } @@ -547,7 +571,7 @@ void CAttack::ProcessDamage() // Get damage multipliers. m_damage = - attackutils::CheckForDamageMultiplier((CCharEntity*)m_attacker, dynamic_cast(m_attacker->m_Weapons[slot]), m_damage, m_attackType, slot); + attackutils::CheckForDamageMultiplier((CCharEntity*)m_attacker, dynamic_cast(m_attacker->m_Weapons[slot]), m_damage, m_attackType, slot, m_isFirstSwing); // Apply Sneak Attack Augment Mod if (m_attacker->getMod(Mod::AUGMENTS_SA) > 0 && m_trickAttackDamage > 0 && m_attacker->StatusEffectContainer->HasStatusEffect(EFFECT_SNEAK_ATTACK)) diff --git a/src/map/attackround.cpp b/src/map/attackround.cpp index 225c744e4e5..b7ff7a4016d 100644 --- a/src/map/attackround.cpp +++ b/src/map/attackround.cpp @@ -32,18 +32,12 @@ * * ************************************************************************/ CAttackRound::CAttackRound(CBattleEntity* attacker, CBattleEntity* defender) -: m_subWeaponType(DAMAGE_TYPE::NONE) { m_attacker = attacker; m_defender = defender; m_kickAttackOccured = false; m_sataOccured = false; - if (auto* weapon = dynamic_cast(attacker->m_Weapons[SLOT_SUB])) - { - m_subWeaponType = weapon->getDmgType(); - } - // Grab a trick attack assistant. m_taEntity = battleutils::getAvailableTrickAttackChar(attacker, attacker->GetBattleTarget()); diff --git a/src/map/attackround.h b/src/map/attackround.h index 3993ee43561..0b8d3743391 100644 --- a/src/map/attackround.h +++ b/src/map/attackround.h @@ -67,7 +67,6 @@ class CAttackRound std::vector m_attackSwings; // The list of attacks for this round. bool m_sataOccured; // Flag: Did SATA occur during the round? bool m_kickAttackOccured; // Flag: Did a kick attack occur during the round? - DAMAGE_TYPE m_subWeaponType; // The sub weapon type. }; #endif diff --git a/src/map/battlefield.cpp b/src/map/battlefield.cpp index 835738f8b84..e80216e3073 100644 --- a/src/map/battlefield.cpp +++ b/src/map/battlefield.cpp @@ -628,7 +628,9 @@ bool CBattlefield::RemoveEntity(CBaseEntity* PEntity, uint8 leavecode) { if (std::find(m_AllyList.begin(), m_AllyList.end(), PMobEntity) != m_AllyList.end()) { - if (PMobEntity->isAlive() && PMobEntity->PAI->IsSpawned()) + // We should not put an isAlive check here because some ally can be dead at cleanup + // but not despawned (for example Prishe in Dawn fight) + if (PMobEntity->PAI->IsSpawned()) { PEntity->status = STATUS_TYPE::DISAPPEAR; PEntity->loc.zone->UpdateEntityPacket(PEntity, ENTITY_DESPAWN, UPDATE_NONE); diff --git a/src/map/entities/automatonentity.cpp b/src/map/entities/automatonentity.cpp index 80dff56cbe9..82593014c80 100644 --- a/src/map/entities/automatonentity.cpp +++ b/src/map/entities/automatonentity.cpp @@ -20,10 +20,12 @@ */ #include "automatonentity.h" + #include "ai/ai_container.h" #include "ai/controllers/automaton_controller.h" #include "ai/states/magic_state.h" #include "ai/states/mobskill_state.h" +#include "common/tracy.h" #include "common/utils.h" #include "mob_modifier.h" #include "packets/action.h" @@ -38,10 +40,14 @@ CAutomatonEntity::CAutomatonEntity() : CPetEntity(PET_TYPE::AUTOMATON) { + TracyZoneScoped; PAI->SetController(nullptr); } -CAutomatonEntity::~CAutomatonEntity() = default; +CAutomatonEntity::~CAutomatonEntity() +{ + TracyZoneScoped; +} void CAutomatonEntity::setFrame(AUTOFRAMETYPE frame) { diff --git a/src/map/entities/baseentity.cpp b/src/map/entities/baseentity.cpp index 240339258e2..6799ce30929 100644 --- a/src/map/entities/baseentity.cpp +++ b/src/map/entities/baseentity.cpp @@ -21,6 +21,8 @@ #include "baseentity.h" +#include "common/tracy.h" + #include "ai/ai_container.h" #include "battlefield.h" #include "instance.h" @@ -50,10 +52,12 @@ CBaseEntity::CBaseEntity() , PInstance(nullptr) , m_nextUpdateTimer(std::chrono::steady_clock::now()) { + TracyZoneScoped; } CBaseEntity::~CBaseEntity() { + TracyZoneScoped; if (PBattlefield) { PBattlefield->RemoveEntity(this, BATTLEFIELD_LEAVE_CODE_WARPDC); @@ -202,6 +206,11 @@ uint32 CBaseEntity::GetLocalVar(std::string var) return m_localVars[var]; } +std::map& CBaseEntity::GetLocalVars() +{ + return m_localVars; +} + void CBaseEntity::SetLocalVar(std::string var, uint32 val) { m_localVars[var] = val; diff --git a/src/map/entities/baseentity.h b/src/map/entities/baseentity.h index 6a421968ae7..f4f77a29753 100644 --- a/src/map/entities/baseentity.h +++ b/src/map/entities/baseentity.h @@ -283,6 +283,7 @@ class CBaseEntity void ResetLocalVars(); uint32 GetLocalVar(std::string var); void SetLocalVar(std::string var, uint32 val); + auto GetLocalVars() -> std::map&; // pre-tick update virtual void Tick(time_point) = 0; diff --git a/src/map/entities/battleentity.cpp b/src/map/entities/battleentity.cpp index 7790f6ec16b..d753d48b62e 100644 --- a/src/map/entities/battleentity.cpp +++ b/src/map/entities/battleentity.cpp @@ -94,7 +94,10 @@ CBattleEntity::CBattleEntity() BattleHistory.lastHitTaken_atkType = ATTACK_TYPE::NONE; } -CBattleEntity::~CBattleEntity() = default; +CBattleEntity::~CBattleEntity() +{ + TracyZoneScoped; +} bool CBattleEntity::isDead() { @@ -379,7 +382,7 @@ float CBattleEntity::GetMeleeRange() const return m_ModelRadius + 3.0f; } -int16 CBattleEntity::GetRangedWeaponDelay(bool tp) +int16 CBattleEntity::GetRangedWeaponDelay(bool forTPCalc) { CItemWeapon* PRange = dynamic_cast(m_Weapons[SLOT_RANGED]); CItemWeapon* PAmmo = dynamic_cast(m_Weapons[SLOT_AMMO]); @@ -387,21 +390,28 @@ int16 CBattleEntity::GetRangedWeaponDelay(bool tp) // base delay int16 delay = 0; - if (PRange != nullptr && PRange->getDamage() != 0) + if (PRange && PRange->getDamage() != 0) + { + delay = PRange->getBaseDelay(); + + if (PAmmo && forTPCalc) + { + delay += PAmmo->getBaseDelay(); + } + } + else if (PAmmo && PAmmo->getDamage() != 0) { - delay = ((PRange->getDelay() * 60) / 1000); + delay = PAmmo->getBaseDelay(); } - delay = (((delay - getMod(Mod::RANGED_DELAY)) * 1000) / 120); + // multiple the base delays by 1000 so final delays are in ms + // divide by 120 to convert the delays to actual times + delay = (delay - getMod(Mod::RANGED_DELAY)) * 1000 / 120; // apply haste and delay reductions that don't affect tp - if (!tp) + if (!forTPCalc) { - delay = (int16)(delay * ((100.0f + getMod(Mod::RANGED_DELAYP)) / 100.0f)); - } - else if (PAmmo) - { - delay += PAmmo->getDelay() / 2; + delay = delay * ((100.0f + getMod(Mod::RANGED_DELAYP)) / 100.0f); } return delay; } @@ -502,11 +512,19 @@ uint16 CBattleEntity::GetRangedWeaponDmg() uint16 CBattleEntity::GetMainWeaponRank() { + uint16 wDamage = 0; if (auto* weapon = dynamic_cast(m_Weapons[SLOT_MAIN])) { - return (weapon->getDamage() + getMod(Mod::MAIN_DMG_RANK)) / 9; + wDamage = weapon->getDamage() + getMod(Mod::MAIN_DMG_RANK); + + // apply the H2H formula adjustment only to players + // as mobs use H2H for dual wield and thus further research is needed + if (objtype == TYPE_PC && weapon->getSkillType() == SKILL_HAND_TO_HAND) + { + wDamage += 3; + } } - return 0; + return wDamage / 9; } uint16 CBattleEntity::GetSubWeaponRank() @@ -663,8 +681,10 @@ int32 CBattleEntity::takeDamage(int32 amount, CBattleEntity* attacker /* = nullp uint16 CBattleEntity::STR() { + auto* weapon = dynamic_cast(m_Weapons[SLOT_MAIN]); + // Hasso gives STR only if main weapon is two handed - if (auto* weapon = dynamic_cast(m_Weapons[SLOT_MAIN]); weapon->isTwoHanded()) + if (weapon && weapon->isTwoHanded()) { return std::clamp(stats.STR + m_modStat[Mod::STR] + m_modStat[Mod::TWOHAND_STR], 0, 999); } @@ -792,14 +812,16 @@ uint16 CBattleEntity::ACC(uint8 attackNumber, uint8 offsetAccuracy) if (this->objtype & TYPE_PC) { - uint8 skill = 0; - uint16 iLvlSkill = 0; + uint8 skill = 0; + uint16 iLvlSkill = 0; + auto PMainWeapon = dynamic_cast(m_Weapons[SLOT_MAIN]); + if (attackNumber == 0) { - if (auto* weapon = dynamic_cast(m_Weapons[SLOT_MAIN])) + if (PMainWeapon) { - skill = weapon->getSkillType(); - iLvlSkill = weapon->getILvlSkill(); + skill = PMainWeapon->getSkillType(); + iLvlSkill = PMainWeapon->getILvlSkill(); if (skill == SKILL_NONE && GetSkill(SKILL_HAND_TO_HAND) > 0) { skill = SKILL_HAND_TO_HAND; @@ -821,6 +843,11 @@ uint16 CBattleEntity::ACC(uint8 attackNumber, uint8 offsetAccuracy) } } } + else if (PMainWeapon && PMainWeapon->isHandToHand()) + { + iLvlSkill = PMainWeapon->getILvlSkill(); + skill = SKILL_HAND_TO_HAND; + } } else if (attackNumber == 2) { @@ -933,6 +960,10 @@ uint8 CBattleEntity::GetMLevel() const JOBTYPE CBattleEntity::GetSJob() { + if (StatusEffectContainer->HasStatusEffect({ EFFECT_OBLIVISCENCE, EFFECT_SJ_RESTRICTION })) + { + return JOB_NON; + } return m_sjob; } @@ -2178,10 +2209,23 @@ bool CBattleEntity::OnAttack(CAttackState& state, action_t& action) } else { - int16 naturalh2hDMG = 0; - if (auto* targ_weapon = dynamic_cast(PTarget->m_Weapons[SLOT_MAIN]); - (targ_weapon && targ_weapon->getSkillType() == SKILL_HAND_TO_HAND) || - (PTarget->objtype == TYPE_MOB && PTarget->GetMJob() == JOB_MNK)) + int16 naturalh2hDMG = 0; + auto* targ_weapon = dynamic_cast(PTarget->m_Weapons[SLOT_MAIN]); + SKILLTYPE skilltype = SKILLTYPE::SKILL_NONE; + + if (PTarget->objtype == TYPE_PC) + { + if (targ_weapon) + { + skilltype = static_cast(targ_weapon->getSkillType()); + } + else + { + skilltype = SKILLTYPE::SKILL_HAND_TO_HAND; + } + } + + if (skilltype == SKILLTYPE::SKILL_HAND_TO_HAND || (PTarget->objtype == TYPE_MOB && PTarget->GetMJob() == JOB_MNK)) { naturalh2hDMG = (int16)((PTarget->GetSkill(SKILL_HAND_TO_HAND) * 0.11f) + 3); } @@ -2199,7 +2243,7 @@ bool CBattleEntity::OnAttack(CAttackState& state, action_t& action) csJpAtkBonus = 1 + ((static_cast(targetDex) / 100) * csJpModifier); } - float DamageRatio = battleutils::GetDamageRatio(PTarget, this, attack.IsCritical(), csJpAtkBonus); + float DamageRatio = battleutils::GetDamageRatio(PTarget, this, attack.IsCritical(), csJpAtkBonus, skilltype); auto damage = (int32)((PTarget->GetMainWeaponDmg() + naturalh2hDMG + battleutils::GetFSTR(PTarget, this, SLOT_MAIN)) * DamageRatio); actionTarget.spikesParam = @@ -2207,9 +2251,7 @@ bool CBattleEntity::OnAttack(CAttackState& state, action_t& action) actionTarget.spikesMessage = 33; if (PTarget->objtype == TYPE_PC) { - auto* targ_weapon = dynamic_cast(PTarget->m_Weapons[SLOT_MAIN]); - uint8 skilltype = (targ_weapon == nullptr ? (uint8)SKILL_HAND_TO_HAND : targ_weapon->getSkillType()); - charutils::TrySkillUP((CCharEntity*)PTarget, (SKILLTYPE)skilltype, GetMLevel()); + charutils::TrySkillUP((CCharEntity*)PTarget, skilltype, GetMLevel()); } // In case the Automaton can counter else if (PTarget->objtype == TYPE_PET && PTarget->PMaster && PTarget->PMaster->objtype == TYPE_PC && static_cast(PTarget)->getPetType() == PET_TYPE::AUTOMATON) diff --git a/src/map/entities/battleentity.h b/src/map/entities/battleentity.h index 5e7f3801e7e..c19830b9672 100644 --- a/src/map/entities/battleentity.h +++ b/src/map/entities/battleentity.h @@ -591,16 +591,16 @@ class CBattleEntity : public CBaseEntity int32 GetMaxMP() const; void UpdateHealth(); // recalculation of the maximum amount of hp and mp, as well as adjusting their current values - int16 GetWeaponDelay(bool tp); // returns delay of combined weapons - float GetMeleeRange() const; // returns the distance considered to be within melee range of the entity - int16 GetRangedWeaponDelay(bool tp); // returns delay of ranged weapon + ammo where applicable - int16 GetAmmoDelay(); // returns delay of ammo (for cooldown between shots) - uint16 GetMainWeaponDmg(); // returns total main hand DMG - uint16 GetSubWeaponDmg(); // returns total sub weapon DMG - uint16 GetRangedWeaponDmg(); // returns total ranged weapon DMG - uint16 GetMainWeaponRank(); // returns total main hand DMG Rank - uint16 GetSubWeaponRank(); // returns total sub weapon DMG Rank - uint16 GetRangedWeaponRank(); // returns total ranged weapon DMG Rank + int16 GetWeaponDelay(bool tp); // returns delay of combined weapons + float GetMeleeRange() const; // returns the distance considered to be within melee range of the entity + int16 GetRangedWeaponDelay(bool forTPCalc); // returns delay of ranged weapon + ammo where applicable + int16 GetAmmoDelay(); // returns delay of ammo (for cooldown between shots) + uint16 GetMainWeaponDmg(); // returns total main hand DMG + uint16 GetSubWeaponDmg(); // returns total sub weapon DMG + uint16 GetRangedWeaponDmg(); // returns total ranged weapon DMG + uint16 GetMainWeaponRank(); // returns total main hand DMG Rank + uint16 GetSubWeaponRank(); // returns total sub weapon DMG Rank + uint16 GetRangedWeaponRank(); // returns total ranged weapon DMG Rank uint16 GetSkill(uint16 SkillID); // the current value of the skill (not the maximum, but limited by the level) diff --git a/src/map/entities/charentity.cpp b/src/map/entities/charentity.cpp index b5300dc1bb1..1f396ac5c47 100644 --- a/src/map/entities/charentity.cpp +++ b/src/map/entities/charentity.cpp @@ -1430,10 +1430,12 @@ void CCharEntity::OnAbility(CAbilityState& state, action_t& action) { if (this != PTarget && distance(this->loc.p, PTarget->loc.p) > PAbility->getRange()) { - pushPacket(new CMessageBasicPacket(this, PTarget, 0, 0, MSGBASIC_TOO_FAR_AWAY)); + setActionInterrupted(action, PTarget, MSGBASIC_TOO_FAR_AWAY, 0); return; } - if (PAbility->getID() >= ABILITY_HEALING_RUBY && PAbility->getID() <= ABILITY_PERFECT_DEFENSE) + + // TODO: Remove me when all pet abilities are ported to PetSkill + if (PAbility->getID() >= ABILITY_HEALING_RUBY && PAbility->getID() <= ABILITY_PERFECT_DEFENSE && !battleutils::GetPetSkill(PAbility->getID())) { // Blood pact MP costs are stored under animation ID float mpCost = PAbility->getAnimationID(); @@ -1444,7 +1446,7 @@ void CCharEntity::OnAbility(CAbilityState& state, action_t& action) if (this->health.mp < mpCost) { - pushPacket(new CMessageBasicPacket(this, PTarget, 0, 0, MSGBASIC_UNABLE_TO_USE_JA)); + setActionInterrupted(action, PTarget, MSGBASIC_UNABLE_TO_USE_JA, 0); return; } } @@ -1880,15 +1882,6 @@ void CCharEntity::OnRangedAttack(CRangeState& state, action_t& action) if (slot == SLOT_RANGED) { - if (state.IsRapidShot()) - { - damage = attackutils::CheckForDamageMultiplier(this, PItem, damage, PHYSICAL_ATTACK_TYPE::RAPID_SHOT, SLOT_RANGED); - } - else - { - damage = attackutils::CheckForDamageMultiplier(this, PItem, damage, PHYSICAL_ATTACK_TYPE::RANGED, SLOT_RANGED); - } - if (PItem != nullptr) { charutils::TrySkillUP(this, (SKILLTYPE)PItem->getSkillType(), PTarget->GetMLevel()); @@ -1952,6 +1945,11 @@ void CCharEntity::OnRangedAttack(CRangeState& state, action_t& action) actionTarget.speceffect = SPECEFFECT::CRITICAL_HIT; } + if (slot == SLOT_RANGED) + { + auto attackType = (state.IsRapidShot()) ? PHYSICAL_ATTACK_TYPE::RAPID_SHOT : PHYSICAL_ATTACK_TYPE::RANGED; + totalDamage = attackutils::CheckForDamageMultiplier(this, PItem, totalDamage, attackType, true); + } actionTarget.param = battleutils::TakePhysicalDamage(this, PTarget, PHYSICAL_ATTACK_TYPE::RANGED, totalDamage, false, slot, realHits, nullptr, true, true); @@ -2804,6 +2802,15 @@ void CCharEntity::endCurrentEvent() void CCharEntity::queueEvent(EventInfo* eventToQueue) { + for (auto& eventElement : eventQueue) + { + if (eventElement->eventId == eventToQueue->eventId) + { + ShowError("CCharEntity::queueEvent: Character attempted to start multiple of the same event."); + return; + } + } + eventQueue.emplace_back(eventToQueue); tryStartNextEvent(); } diff --git a/src/map/entities/charentity.h b/src/map/entities/charentity.h index 7f1f6386ca8..59e55069301 100644 --- a/src/map/entities/charentity.h +++ b/src/map/entities/charentity.h @@ -541,6 +541,7 @@ class CCharEntity : public CBattleEntity virtual bool ValidTarget(CBattleEntity* PInitiator, uint16 targetFlags) override; virtual bool CanUseSpell(CSpell*) override; + bool IsMobOwner(CBattleEntity* PTarget); virtual void Die() override; void Die(duration _duration); @@ -600,7 +601,6 @@ class CCharEntity : public CBattleEntity protected: void changeMoghancement(uint16 moghancementID, bool isAdding); - bool IsMobOwner(CBattleEntity* PTarget); void TrackArrowUsageForScavenge(CItemWeapon* PAmmo); private: diff --git a/src/map/entities/mobentity.cpp b/src/map/entities/mobentity.cpp index 509b9dcdc6f..b16bbb88b4a 100644 --- a/src/map/entities/mobentity.cpp +++ b/src/map/entities/mobentity.cpp @@ -129,18 +129,9 @@ CMobEntity::CMobEntity() PAI = std::make_unique(this, std::make_unique(this), std::make_unique(this), std::make_unique(this)); } -uint32 CMobEntity::getEntityFlags() const -{ - return m_flags; -} - -void CMobEntity::setEntityFlags(uint32 EntityFlags) -{ - m_flags = EntityFlags; -} - CMobEntity::~CMobEntity() { + TracyZoneScoped; destroy(m_Weapons[SLOT_MAIN]); destroy(m_Weapons[SLOT_SUB]); destroy(m_Weapons[SLOT_RANGED]); @@ -161,6 +152,16 @@ CMobEntity::~CMobEntity() } } +uint32 CMobEntity::getEntityFlags() const +{ + return m_flags; +} + +void CMobEntity::setEntityFlags(uint32 EntityFlags) +{ + m_flags = EntityFlags; +} + /************************************************************************ * * * Monster disappear time (in seconds) * @@ -382,6 +383,12 @@ uint16 CMobEntity::TPUseChance() return 10000; } + // mobs use three mob skills in a row under Meikyo Shisui + if (StatusEffectContainer->HasStatusEffect(EFFECT_MEIKYO_SHISUI) && GetLocalVar("[MeikyoShisui]MobSkillCount") > 0) + { + return 10000; + } + return (uint16)getMobMod(MOBMOD_TP_USE_CHANCE); } @@ -485,6 +492,7 @@ bool CMobEntity::GetUntargetable() const void CMobEntity::PostTick() { + TracyZoneScoped; CBattleEntity::PostTick(); std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now(); if (loc.zone && updatemask && now > m_nextUpdateTimer) diff --git a/src/map/entities/npcentity.cpp b/src/map/entities/npcentity.cpp index 81e55f18e9e..d5e4c99fbd9 100644 --- a/src/map/entities/npcentity.cpp +++ b/src/map/entities/npcentity.cpp @@ -38,6 +38,7 @@ CNpcEntity::CNpcEntity() , name_prefix(0) , widescan(1) { + TracyZoneScoped; objtype = TYPE_NPC; look.face = 0x32; allegiance = ALLEGIANCE_TYPE::MOB; @@ -45,7 +46,10 @@ CNpcEntity::CNpcEntity() PAI = std::make_unique(this); } -CNpcEntity::~CNpcEntity() = default; +CNpcEntity::~CNpcEntity() +{ + TracyZoneScoped; +} uint32 CNpcEntity::getEntityFlags() const { diff --git a/src/map/entities/petentity.cpp b/src/map/entities/petentity.cpp index 7b5dc881a99..8193acc8426 100644 --- a/src/map/entities/petentity.cpp +++ b/src/map/entities/petentity.cpp @@ -48,6 +48,7 @@ CPetEntity::CPetEntity(PET_TYPE petType) , m_jugSpawnTime(time_point::min()) , m_jugDuration(duration::min()) { + TracyZoneScoped; objtype = TYPE_PET; m_EcoSystem = ECOSYSTEM::UNCLASSIFIED; allegiance = ALLEGIANCE_TYPE::PLAYER; @@ -59,7 +60,10 @@ CPetEntity::CPetEntity(PET_TYPE petType) PAI = std::make_unique(this, std::make_unique(this), std::make_unique(this), std::make_unique(this)); } -CPetEntity::~CPetEntity() = default; +CPetEntity::~CPetEntity() +{ + TracyZoneScoped; +} PET_TYPE CPetEntity::getPetType() { @@ -384,6 +388,23 @@ bool CPetEntity::ValidTarget(CBattleEntity* PInitiator, uint16 targetFlags) return CMobEntity::ValidTarget(PInitiator, targetFlags); } +bool CPetEntity::CanAttack(CBattleEntity* PTarget, std::unique_ptr& errMsg) +{ + // prevent pets from attacking mobs that the PC master does not own + if (this->PMaster) + { + auto* PChar = dynamic_cast(this->PMaster); + if (PChar && !PChar->IsMobOwner(PTarget)) + { + errMsg = std::make_unique(this, PTarget, 0, 0, MSGBASIC_ALREADY_CLAIMED); + PAI->Disengage(); + return false; + } + } + + return CBattleEntity::CanAttack(PTarget, errMsg); +} + void CPetEntity::OnPetSkillFinished(CPetSkillState& state, action_t& action) { TracyZoneScoped; diff --git a/src/map/entities/petentity.h b/src/map/entities/petentity.h index e1254a473e6..a20f0498b7f 100644 --- a/src/map/entities/petentity.h +++ b/src/map/entities/petentity.h @@ -72,6 +72,7 @@ class CPetEntity : public CMobEntity virtual void OnAbility(CAbilityState&, action_t&) override; virtual bool ValidTarget(CBattleEntity* PInitiator, uint16 targetFlags) override; void OnPetSkillFinished(CPetSkillState& state, action_t& action); + virtual bool CanAttack(CBattleEntity* PTarget, std::unique_ptr& errMsg) override; private: PET_TYPE m_PetType; // the type of pet e.g. avatar/wyvern/jugpet etc diff --git a/src/map/entities/trustentity.cpp b/src/map/entities/trustentity.cpp index fe5dd6d345a..89b6375c25d 100644 --- a/src/map/entities/trustentity.cpp +++ b/src/map/entities/trustentity.cpp @@ -54,10 +54,17 @@ CTrustEntity::CTrustEntity(CCharEntity* PChar) m_bReleaseTargIDOnDisappear = true; spawnAnimation = SPAWN_ANIMATION::SPECIAL; // Initial spawn has the special spawn-in animation - PAI = std::make_unique(this, std::make_unique(this), std::make_unique(PChar, this), + PAI = std::make_unique(this, + std::make_unique(this), + std::make_unique(PChar, this), std::make_unique(this)); } +CTrustEntity::~CTrustEntity() +{ + TracyZoneScoped; +} + void CTrustEntity::PostTick() { // NOTE: This is purposefully calling CBattleEntity's impl. diff --git a/src/map/entities/trustentity.h b/src/map/entities/trustentity.h index 11c7f9e42af..7c84511aaf5 100644 --- a/src/map/entities/trustentity.h +++ b/src/map/entities/trustentity.h @@ -36,7 +36,7 @@ class CTrustEntity : public CMobEntity { public: explicit CTrustEntity(CCharEntity*); - ~CTrustEntity() override = default; + ~CTrustEntity() override; void PostTick() override; void FadeOut() override; diff --git a/src/map/instance.cpp b/src/map/instance.cpp index b70b3df0099..cf3d1fe8f02 100644 --- a/src/map/instance.cpp +++ b/src/map/instance.cpp @@ -35,6 +35,7 @@ CInstance::CInstance(CZone* zone, uint16 instanceid) , m_instanceid(instanceid) , m_zone(zone) { + TracyZoneScoped; LoadInstance(); m_startTime = server_clock::now(); @@ -43,22 +44,7 @@ CInstance::CInstance(CZone* zone, uint16 instanceid) CInstance::~CInstance() { - for (auto entity : m_mobList) - { - destroy(entity.second); - } - for (auto entity : m_npcList) - { - destroy(entity.second); - } - for (auto entity : m_petList) - { - destroy(entity.second); - } - for (auto entity : m_trustList) - { - destroy(entity.second); - } + TracyZoneScoped; } uint16 CInstance::GetID() const diff --git a/src/map/instance_loader.cpp b/src/map/instance_loader.cpp index 52fe4ba7114..9915c61f020 100644 --- a/src/map/instance_loader.cpp +++ b/src/map/instance_loader.cpp @@ -80,7 +80,7 @@ CInstance* CInstanceLoader::LoadInstance() allegiance, namevis, aggro, mob_pools.skill_list_id, mob_pools.true_detection, detects, \ mob_family_system.charmable \ FROM instance_entities INNER JOIN mob_spawn_points ON instance_entities.id = mob_spawn_points.mobid \ - INNER JOIN mob_groups ON mob_groups.groupid = mob_spawn_points.groupid and mob_groups.zoneid=((mob_spawn_points.mobid>>12)&0xFFF) \ + INNER JOIN mob_groups ON mob_groups.groupid = mob_spawn_points.groupid AND mob_groups.zoneid=((mob_spawn_points.mobid>>12)&0xFFF) \ INNER JOIN mob_pools ON mob_groups.poolid = mob_pools.poolid \ INNER JOIN mob_resistances ON mob_resistances.resist_id = mob_pools.resist_id \ INNER JOIN mob_family_system ON mob_pools.familyid = mob_family_system.familyID \ @@ -232,7 +232,7 @@ CInstance* CInstanceLoader::LoadInstance() status, entityFlags, look, name_prefix, widescan \ FROM instance_entities INNER JOIN npc_list ON \ (instance_entities.id = npc_list.npcid) \ - WHERE instanceid = %u AND npcid >= %u and npcid < %u;"; + WHERE instanceid = %u AND npcid >= %u AND npcid < %u;"; uint32 zoneMin = (zone->GetID() << 12) + 0x1000000; uint32 zoneMax = zoneMin + 1024; diff --git a/src/map/los/zone_los.cpp b/src/map/los/zone_los.cpp index bbe0e39519c..7ac1902cad1 100644 --- a/src/map/los/zone_los.cpp +++ b/src/map/los/zone_los.cpp @@ -26,6 +26,7 @@ #include #endif +#include "common/tracy.h" #include "common/zlib.h" #include "entities/baseentity.h" diff --git a/src/map/lua/lua_baseentity.cpp b/src/map/lua/lua_baseentity.cpp index 9aca1b42548..9df6c8719ba 100644 --- a/src/map/lua/lua_baseentity.cpp +++ b/src/map/lua/lua_baseentity.cpp @@ -664,6 +664,28 @@ void CLuaBaseEntity::setVolatileCharVar(std::string const& varName, int32 value, } } +/************************************************************************ + * Function: getLocalVars() + * Purpose : Returns all variables assigned locally to an entity + * Example : local localVars = KingArthro:getLocalVars() + * Notes : + ************************************************************************/ + +auto CLuaBaseEntity::getLocalVars() -> sol::table +{ + auto table = lua.create_table(); + auto& localVars = m_PBaseEntity->GetLocalVars(); + + for (auto const& [varName, value] : localVars) + { + auto subtable = lua.create_table(); + subtable["varname"] = varName; + subtable["value"] = value; + table.add(subtable); + } + return table; +} + /************************************************************************ * Function: getLocalVar() * Purpose : Returns a variable assigned locally to an entity @@ -891,6 +913,11 @@ void CLuaBaseEntity::StartEventHelper(int32 EventID, sol::variadic_args va, EVEN return; } + if (PChar->currentEvent->eventId == EventID) + { + ShowError("CLuaBaseEntity::StartEventHelper: Could not start event, Character Entity already triggered."); + return; + } PChar->StatusEffectContainer->DelStatusEffect(EFFECT_BOOST); PChar->queueEvent(ParseEvent(EventID, va, PChar->eventPreparation, eventType)); @@ -3719,14 +3746,11 @@ bool CLuaBaseEntity::addItem(sol::variadic_args va) CCharEntity* PChar = (CCharEntity*)m_PBaseEntity; /* FORMAT 1: - player:addItem({id=itemID, quantity=quantity}) -- add quantity of itemID - - player:addItem({id=itemID, silent=true}) -- silently add 1 of itemID - - player:addItem({id=itemID, signature="Char"}) -- add 1 signed of itemID - player:addItem({id=itemID, augments={[4]=5,[10]=10}}) -- add 1 of itemID with augment id 4 and 10, - with values of 5 and 10, respectively - player:addItem({ id = itemID, exdata = { [10] = 10 } }) -- add 1 item of itemID, with the exdata at index 10 (0-indexed!) set to 10 + player:addItem({ id = itemID, quantity = quantity }) -- add quantity of itemID + player:addItem({ id = itemID, silent = true }) -- silently add 1 of itemID + player:addItem({ id = itemID, signature = "Char" }) -- add 1 signed of itemID + player:addItem({ id = itemID, augments = { [4] = 5, [10] = 10 } }) -- add 1 of itemID with augment id 4 and 10, with values of 5 and 10, respectively + player:addItem({ id = itemID, exdata = { [10] = 10 } }) -- add 1 item of itemID, with the exdata at index 10 (0-indexed!) set to 10 */ if (va.get_type(0) == sol::type::table) @@ -13331,8 +13355,8 @@ uint16 CLuaBaseEntity::getEVA() * Function: getRACC() * Purpose : Calculates and returns the Ranged Accuracy of a Weapon euipped in the Ranged slot * Example : player:getRACC() - * Notes : To Do: The calculation is already a public member of battleentity, shouldn't have two calculations, just call (CBattleEntity*)m_PBaseEntity)->RACC - *and return result + * Notes : TODO: The calculation is already a public member of battleentity, shouldn't have two calculations, just call (CBattleEntity*)m_PBaseEntity)->RACC + * and return result ************************************************************************/ int CLuaBaseEntity::getRACC() @@ -13565,39 +13589,6 @@ bool CLuaBaseEntity::isWeaponTwoHanded() return weapon->isTwoHanded(); } -/************************************************************************ - * Function: getMeleeHitDamage() - * Purpose : Calculates and returns total damage for a single hit - * Example : getMeleeHitDamage(Attacker,Local Hit Rate) - * Notes : Battleutils calculates hit rate already, so inserting hit rate - * : here only increases chance of missing (assuming < 100)? - * : Not currently used in any scripts (handled by battleutils) - Is this even needed? - ************************************************************************/ - -int CLuaBaseEntity::getMeleeHitDamage(CLuaBaseEntity* PLuaBaseEntity, sol::object const& arg1) -{ - if (m_PBaseEntity->objtype == TYPE_NPC) - { - ShowWarning("Invalid Entity (NPC: %s) calling function.", m_PBaseEntity->getName()); - return 0; - } - - CBattleEntity* PAttacker = static_cast(m_PBaseEntity); - CBattleEntity* PDefender = static_cast(PLuaBaseEntity->GetBaseEntity()); - - uint8 hitrate = (arg1 == sol::lua_nil) ? battleutils::GetHitRate(PAttacker, PDefender) : arg1.as(); - - if (xirand::GetRandomNumber(100) < hitrate) - { - float DamageRatio = battleutils::GetDamageRatio(PAttacker, PDefender, false, 0.f); - int damage = (uint16)((PAttacker->GetMainWeaponDmg() + battleutils::GetFSTR(PAttacker, PDefender, SLOT_MAIN)) * DamageRatio); - - return damage; - } - - return -1; -} - /************************************************************************ * Function: getWeaponDmg() * Purpose : Returns the real damage value of a Weapon in the Main slot @@ -13872,6 +13863,11 @@ uint8 CLuaBaseEntity::getWeaponSkillType(uint8 slotID) { return PWeapon->getSkillType(); } + else + { + // nothing in offhand or non-weapon (shield/grip) + return 0; + } } ShowError("lua::getWeaponSkillType :: Invalid slot specified!"); @@ -14379,7 +14375,7 @@ bool CLuaBaseEntity::isAutomaton() if (m_PBaseEntity->objtype == TYPE_PET) { uint32 petID = static_cast(m_PBaseEntity)->m_PetID; - if (petID >= PETID_HARLEQUINFRAME and petID <= PETID_STORMWAKERFRAME) + if (petID >= PETID_HARLEQUINFRAME && petID <= PETID_STORMWAKERFRAME) { return true; } @@ -17100,6 +17096,22 @@ bool CLuaBaseEntity::deleteRaisedChocobo() return true; } +void CLuaBaseEntity::clearActionQueue() +{ + if (m_PBaseEntity->PAI) + { + m_PBaseEntity->PAI->ClearActionQueue(); + } +} + +void CLuaBaseEntity::clearTimerQueue() +{ + if (m_PBaseEntity->PAI) + { + m_PBaseEntity->PAI->ClearTimerQueue(); + } +} + void CLuaBaseEntity::setMannequinPose(uint16 itemID, uint8 race, uint8 pose) { TracyZoneScoped; @@ -17213,6 +17225,7 @@ void CLuaBaseEntity::Register() SOL_REGISTER("setVar", CLuaBaseEntity::setCharVar); // Compatibility binding SOL_REGISTER("incrementCharVar", CLuaBaseEntity::incrementCharVar); SOL_REGISTER("setVolatileCharVar", CLuaBaseEntity::setVolatileCharVar); + SOL_REGISTER("getLocalVars", CLuaBaseEntity::getLocalVars); SOL_REGISTER("getLocalVar", CLuaBaseEntity::getLocalVar); SOL_REGISTER("setLocalVar", CLuaBaseEntity::setLocalVar); SOL_REGISTER("resetLocalVars", CLuaBaseEntity::resetLocalVars); @@ -17812,7 +17825,6 @@ void CLuaBaseEntity::Register() SOL_REGISTER("handleAfflatusMiseryDamage", CLuaBaseEntity::handleAfflatusMiseryDamage); SOL_REGISTER("isWeaponTwoHanded", CLuaBaseEntity::isWeaponTwoHanded); - SOL_REGISTER("getMeleeHitDamage", CLuaBaseEntity::getMeleeHitDamage); SOL_REGISTER("getWeaponDmg", CLuaBaseEntity::getWeaponDmg); SOL_REGISTER("getWeaponDmgRank", CLuaBaseEntity::getWeaponDmgRank); SOL_REGISTER("getOffhandDmg", CLuaBaseEntity::getOffhandDmg); @@ -18000,6 +18012,9 @@ void CLuaBaseEntity::Register() SOL_REGISTER("getHistory", CLuaBaseEntity::getHistory); + SOL_REGISTER("clearActionQueue", CLuaBaseEntity::clearActionQueue); + SOL_REGISTER("clearTimerQueue", CLuaBaseEntity::clearTimerQueue); + SOL_REGISTER("getChocoboRaisingInfo", CLuaBaseEntity::getChocoboRaisingInfo); SOL_REGISTER("setChocoboRaisingInfo", CLuaBaseEntity::setChocoboRaisingInfo); SOL_REGISTER("deleteRaisedChocobo", CLuaBaseEntity::deleteRaisedChocobo); diff --git a/src/map/lua/lua_baseentity.h b/src/map/lua/lua_baseentity.h index d9b2b27b4b3..d7e3b1e90ad 100644 --- a/src/map/lua/lua_baseentity.h +++ b/src/map/lua/lua_baseentity.h @@ -72,6 +72,7 @@ class CLuaBaseEntity void setCharVarExpiration(std::string const& varName, uint32 expiry); // Sets character variable expiration timestamp void incrementCharVar(std::string const& varname, int32 value); // Increments/decrements/sets a character variable void setVolatileCharVar(std::string const& varName, int32 value, sol::object const& expiry); + auto getLocalVars() -> sol::table; uint32 getLocalVar(std::string const& var); void setLocalVar(std::string const& var, uint32 val); void resetLocalVars(); @@ -692,15 +693,14 @@ class CLuaBaseEntity void handleAfflatusMiseryDamage(double damage); bool isWeaponTwoHanded(); - int getMeleeHitDamage(CLuaBaseEntity* PLuaBaseEntity, sol::object const& arg1); // gets the damage of a single hit vs the specified mob - uint16 getWeaponDmg(); // gets the current equipped weapons' DMG rating - uint16 getWeaponDmgRank(); // gets the current equipped weapons' DMG rating for Rank calc - uint16 getOffhandDmg(); // gets the current equipped offhand's DMG rating (used in WS calcs) - uint16 getOffhandDmgRank(); // gets the current equipped offhand's DMG rating for Rank calc - uint16 getRangedDmg(); // Get ranged weapon DMG rating - uint16 getRangedDmgRank(); // Get ranged weapond DMG rating used for calculating rank - uint16 getAmmoDmg(); // Get ammo DMG rating - uint16 getWeaponHitCount(bool offhand); // Get PC weapon hit count (Occasionally Attacks N times weapons) + uint16 getWeaponDmg(); // gets the current equipped weapons' DMG rating + uint16 getWeaponDmgRank(); // gets the current equipped weapons' DMG rating for Rank calc + uint16 getOffhandDmg(); // gets the current equipped offhand's DMG rating (used in WS calcs) + uint16 getOffhandDmgRank(); // gets the current equipped offhand's DMG rating for Rank calc + uint16 getRangedDmg(); // Get ranged weapon DMG rating + uint16 getRangedDmgRank(); // Get ranged weapond DMG rating used for calculating rank + uint16 getAmmoDmg(); // Get ammo DMG rating + uint16 getWeaponHitCount(bool offhand); // Get PC weapon hit count (Occasionally Attacks N times weapons) void removeAmmo(); @@ -879,6 +879,9 @@ class CLuaBaseEntity bool setChocoboRaisingInfo(sol::table const& table); bool deleteRaisedChocobo(); + void clearActionQueue(); + void clearTimerQueue(); + void setMannequinPose(uint16 itemID, uint8 race, uint8 pose); uint8 getMannequinPose(uint16 itemID); diff --git a/src/map/mobskill.cpp b/src/map/mobskill.cpp index eb3d0076fe1..2358d332e7b 100644 --- a/src/map/mobskill.cpp +++ b/src/map/mobskill.cpp @@ -169,24 +169,6 @@ uint16 CMobSkill::getAnimationID() const uint16 CMobSkill::getPetAnimationID() const { - // garuda - if (m_AnimID >= 565 && m_AnimID <= 573) - { - return m_AnimID - 485; - } - - // titan - if (m_AnimID >= 539 && m_AnimID <= 547) - { - return m_AnimID - 491; - } - - // ifrit - if (m_AnimID >= 526 && m_AnimID <= 534) - { - return m_AnimID - 494; - } - // fenrir if (m_AnimID >= 513 && m_AnimID <= 521) { diff --git a/src/map/modifier.h b/src/map/modifier.h index 017743b3b6c..83c74c0a4c1 100644 --- a/src/map/modifier.h +++ b/src/map/modifier.h @@ -544,12 +544,13 @@ enum class Mod THIRD_EYE_BONUS = 1055, // TODO: Bonus Third Eye Evasion (count) // Ninja - UTSUSEMI = 307, // Everyone's favorite --tracks shadows. - UTSUSEMI_BONUS = 900, // Extra shadows from gear - NINJA_TOOL = 308, // Percent chance to not use a tool. - NIN_NUKE_BONUS = 522, // magic attack bonus for NIN nukes - DAKEN = 911, // chance to throw a shuriken without consuming it - NINJUTSU_DURATION = 1000, + UTSUSEMI = 307, // Everyone's favorite --tracks shadows. + UTSUSEMI_BONUS = 900, // Extra shadows from gear + NINJA_TOOL = 308, // Percent chance to not use a tool. + NIN_NUKE_BONUS_INNIN = 223, // Ninjutsu damage multiplier from Innin. + NIN_NUKE_BONUS_GEAR = 522, // Ninjutsu damage multiplier from gear. + DAKEN = 911, // chance to throw a shuriken without consuming it + NINJUTSU_DURATION = 1000, // Dragoon ANCIENT_CIRCLE_DURATION = 859, // Ancient Circle extended duration in seconds @@ -1002,6 +1003,9 @@ enum class Mod DIG_BYPASS_FATIGUE = 1074, // Chocobo digging modifier found in "Blue Race Silks". Modifier works as a direct percent. BREATH_DMG_DEALT = 1075, // Breath damage dealt + DAMAGE_LIMIT = 1080, // Damage Limit increase, found on some traits. It's a flat value added to max pDIF (maxpDIF + DL/100) https://www.bg-wiki.com/ffxi/Damage_Limit%2B + DAMAGE_LIMITP = 1081, // Damage Limit +% increase, found on some gear. It's a multiplier added after flat Damage Limit ((maxpDIF + DL/100)*(100 + DLP/100)/100) https://www.ffxiah.com/forum/topic/56649/physical-damage-limit/ + // IF YOU ADD ANY NEW MODIFIER HERE, ADD IT IN scripts/enum/mod.lua ASWELL! // The spares take care of finding the next ID to use so long as we don't forget to list IDs that have been freed up by refactoring. @@ -1009,10 +1013,10 @@ enum class Mod // // SPARE IDs: // 141 - // 220 to 223 + // 220 to 222 // 273 to 276 // - // SPARE = 1080 and onward + // SPARE = 1082 and onward }; // temporary workaround for using enum class as unordered_map key until compilers support it diff --git a/src/map/packet_system.cpp b/src/map/packet_system.cpp index 3693e48aaa1..4d3592e52c5 100644 --- a/src/map/packet_system.cpp +++ b/src/map/packet_system.cpp @@ -627,7 +627,7 @@ void SmallPacket0x011(map_session_data_t* const PSession, CCharEntity* const PCh PChar->PAI->QueueAction(queueAction_t(4000ms, false, zoneutils::AfterZoneIn)); - // todo: kill player til theyre dead and bsod + // TODO: kill player til theyre dead and bsod const char* fmtQuery = "SELECT version_mismatch FROM accounts_sessions WHERE charid = %u"; int32 ret = sql->Query(fmtQuery, PChar->id); if (ret != SQL_ERROR && sql->NextRow() == SQL_SUCCESS) @@ -2370,7 +2370,7 @@ void SmallPacket0x04B(map_session_data_t* const PSession, CCharEntity* const PCh PChar->pushPacket(new CServerMessagePacket(login_message, msg_language, msg_timestamp, msg_offset)); PChar->pushPacket(new CCharSyncPacket(PChar)); - // todo: kill player til theyre dead and bsod + // TODO: kill player til theyre dead and bsod const char* fmtQuery = "SELECT version_mismatch FROM accounts_sessions WHERE charid = %u"; int32 ret = sql->Query(fmtQuery, PChar->id); if (ret != SQL_ERROR && sql->NextRow() == SQL_SUCCESS) @@ -3236,7 +3236,7 @@ void SmallPacket0x04E(map_session_data_t* const PSession, CCharEntity* const PCh PChar->pushPacket(new CAuctionHousePacket(action)); // A single SQL query for the player's AH history which is stored in a Char Entity struct + vector. - const char* Query = "SELECT itemid, price, stack FROM auction_house WHERE seller = %u and sale=0 ORDER BY id ASC LIMIT 7;"; + const char* Query = "SELECT itemid, price, stack FROM auction_house WHERE seller = %u AND sale=0 ORDER BY id ASC LIMIT 7;"; int32 ret = sql->Query(Query, PChar->id); diff --git a/src/map/packets/basic.h b/src/map/packets/basic.h index d3c6572b8db..154abe48bb9 100644 --- a/src/map/packets/basic.h +++ b/src/map/packets/basic.h @@ -24,6 +24,7 @@ along with this program. If not, see http://www.gnu.org/licenses/ #include "common/cbasetypes.h" #include "common/socket.h" +#include "common/tracy.h" #include #include @@ -68,6 +69,7 @@ class CBasicPacket , code(ref(2)) , owner(true) { + TracyZoneScoped; std::fill(data, data + PACKET_SIZE, 0); } @@ -78,6 +80,7 @@ class CBasicPacket , code(ref(2)) , owner(false) { + TracyZoneScoped; } CBasicPacket(const CBasicPacket& other) @@ -87,7 +90,8 @@ class CBasicPacket , code(ref(2)) , owner(true) { - memcpy(data, other.data, PACKET_SIZE); + TracyZoneScoped; + std::memcpy(data, other.data, PACKET_SIZE); } CBasicPacket(CBasicPacket&& other) @@ -102,6 +106,7 @@ class CBasicPacket virtual ~CBasicPacket() { + TracyZoneScoped; if (owner && data) { destroy_arr(data); diff --git a/src/map/utils/attackutils.cpp b/src/map/utils/attackutils.cpp index 158f7e5049d..e429092fca7 100644 --- a/src/map/utils/attackutils.cpp +++ b/src/map/utils/attackutils.cpp @@ -262,7 +262,7 @@ namespace attackutils * Check for damage multiplier, relic weapons etc. * * * ************************************************************************/ - uint32 CheckForDamageMultiplier(CCharEntity* PChar, CItemWeapon* PWeapon, uint32 damage, PHYSICAL_ATTACK_TYPE attackType, uint8 weaponSlot) + uint32 CheckForDamageMultiplier(CCharEntity* PChar, CItemWeapon* PWeapon, uint32 damage, PHYSICAL_ATTACK_TYPE attackType, uint8 weaponSlot, bool allowProc) { if (PWeapon == nullptr) { @@ -294,25 +294,28 @@ namespace attackutils float occ_extra_dmg = battleutils::GetScaledItemModifier(PChar, PWeapon, Mod::OCC_DO_EXTRA_DMG) / 100.f; int16 occ_extra_dmg_chance = battleutils::GetScaledItemModifier(PChar, PWeapon, Mod::EXTRA_DMG_CHANCE) / 10; - if (occ_extra_dmg > 3.f && occ_extra_dmg_chance > 0 && xirand::GetRandomNumber(100) <= occ_extra_dmg_chance) + if (allowProc) { - return (uint32)(damage * occ_extra_dmg); - } - else if (occ_do_triple_dmg > 0 && xirand::GetRandomNumber(100) <= occ_do_triple_dmg) - { - return (uint32)(damage * 3.f); - } - else if (occ_extra_dmg > 2.f && occ_extra_dmg_chance > 0 && xirand::GetRandomNumber(100) <= occ_extra_dmg_chance) - { - return (uint32)(damage * occ_extra_dmg); - } - else if (occ_do_double_dmg > 0 && xirand::GetRandomNumber(100) <= occ_do_double_dmg) - { - return (uint32)(damage * 2.f); - } - else if (occ_extra_dmg > 0 && occ_extra_dmg_chance > 0 && xirand::GetRandomNumber(100) <= occ_extra_dmg_chance) - { - return (uint32)(damage * occ_extra_dmg); + if (occ_extra_dmg > 3.f && occ_extra_dmg_chance > 0 && xirand::GetRandomNumber(100) <= occ_extra_dmg_chance) + { + return (uint32)(damage * occ_extra_dmg); + } + else if (occ_do_triple_dmg > 0 && xirand::GetRandomNumber(100) <= occ_do_triple_dmg) + { + return (uint32)(damage * 3.f); + } + else if (occ_extra_dmg > 2.f && occ_extra_dmg_chance > 0 && xirand::GetRandomNumber(100) <= occ_extra_dmg_chance) + { + return (uint32)(damage * occ_extra_dmg); + } + else if (occ_do_double_dmg > 0 && xirand::GetRandomNumber(100) <= occ_do_double_dmg) + { + return (uint32)(damage * 2.f); + } + else if (occ_extra_dmg > 0 && occ_extra_dmg_chance > 0 && xirand::GetRandomNumber(100) <= occ_extra_dmg_chance) + { + return (uint32)(damage * occ_extra_dmg); + } } switch (attackType) diff --git a/src/map/utils/attackutils.h b/src/map/utils/attackutils.h index 404ad3c6abb..f28ea044084 100644 --- a/src/map/utils/attackutils.h +++ b/src/map/utils/attackutils.h @@ -33,7 +33,7 @@ enum class PHYSICAL_ATTACK_TYPE; namespace attackutils { uint8 getHitCount(uint8 hits); // The multihit calculator. - uint32 CheckForDamageMultiplier(CCharEntity* PChar, CItemWeapon* PWeapon, uint32 damage, PHYSICAL_ATTACK_TYPE attackType, uint8 weapnSlot); + uint32 CheckForDamageMultiplier(CCharEntity* PChar, CItemWeapon* PWeapon, uint32 damage, PHYSICAL_ATTACK_TYPE attackType, uint8 weapnSlot, bool allowProc = false); bool IsParried(CBattleEntity* PAttacker, CBattleEntity* PDefender); // Is the attack parried. bool IsGuarded(CBattleEntity* PAttacker, CBattleEntity* PDefender); // Is the attack guarded. diff --git a/src/map/utils/battleutils.cpp b/src/map/utils/battleutils.cpp index 46c3524ea20..7d881432839 100644 --- a/src/map/utils/battleutils.cpp +++ b/src/map/utils/battleutils.cpp @@ -793,22 +793,28 @@ namespace battleutils } else // Struck the target { + SKILLTYPE skilltype = SKILLTYPE::SKILL_NONE; + if (PDefender->objtype == TYPE_PC) { - // Check for skillup - uint8 skilltype = 0; if (auto* weapon = dynamic_cast(PDefender->m_Weapons[SLOT_MAIN])) { - skilltype = weapon->getSkillType(); + skilltype = static_cast(weapon->getSkillType()); + } + else + { + skilltype = SKILLTYPE::SKILL_HAND_TO_HAND; } - charutils::TrySkillUP((CCharEntity*)PDefender, (SKILLTYPE)skilltype, PAttacker->GetMLevel()); + + // Check for skillup + charutils::TrySkillUP((CCharEntity*)PDefender, skilltype, PAttacker->GetMLevel()); } // Check if crit bool crit = battleutils::GetCritHitRate(PDefender, PAttacker, true) > xirand::GetRandomNumber(100); // Dmg math. - float DamageRatio = GetDamageRatio(PDefender, PAttacker, crit, 0.f); + float DamageRatio = GetDamageRatio(PDefender, PAttacker, crit, 1.f, skilltype); uint16 dmg = (uint32)((PDefender->GetMainWeaponDmg() + battleutils::GetFSTR(PDefender, PAttacker, SLOT_MAIN)) * DamageRatio); dmg = attackutils::CheckForDamageMultiplier(((CCharEntity*)PDefender), dynamic_cast(PDefender->m_Weapons[SLOT_MAIN]), dmg, PHYSICAL_ATTACK_TYPE::NORMAL, SLOT_MAIN); @@ -1375,26 +1381,32 @@ namespace battleutils if (PAttacker->objtype == TYPE_PC && PAttacker->PParty != nullptr) { - if (auto* PLeader = dynamic_cast(PAttacker->PParty->GetLeader())) + if (auto* PChar = dynamic_cast(PAttacker)) { - PLeader->ForPartyWithTrusts([&](CBattleEntity* PMember) - { + // clang-format off + PChar->ForPartyWithTrusts([&](CBattleEntity* PMember) + { if (attackerID == PMember->id) { power = PDefender->StatusEffectContainer->GetStatusEffect(daze)->GetPower(); - } }); + } + }); + // clang-format on } } else if (PAttacker->objtype == TYPE_TRUST) { - if (auto* PMaster = dynamic_cast(PAttacker->PMaster)) + if (auto* PChar = dynamic_cast(PAttacker->PMaster)) { - PMaster->ForPartyWithTrusts([&](CBattleEntity* PMember) - { + // clang-format off + PChar->ForPartyWithTrusts([&](CBattleEntity* PMember) + { if (attackerID == PMember->id) { power = PDefender->StatusEffectContainer->GetStatusEffect(daze)->GetPower(); - } }); + } + }); + // clang-format on } } else if (PAttacker->PMaster == nullptr) @@ -1607,7 +1619,17 @@ namespace battleutils // get ratio (not capped for RAs) float ratio = (float)rAttack / (float)PDefender->DEF(); - ratio = std::clamp(ratio, 0, 3); + // Ranged damage limit caluclations + + // get weapon cap + auto* targ_weapon = dynamic_cast(PAttacker->m_Weapons[SLOT_RANGED]); + float maxRatio = 3.25f; + + // If null ignore the checks and fallback to 1H values + if (targ_weapon && targ_weapon->getSkillType() == SKILL_MARKSMANSHIP) + { + maxRatio = 3.5f; + } // level correct (0.025 not 0.05 like for melee) if (PDefender->GetMLevel() > PAttacker->GetMLevel()) @@ -1635,8 +1657,13 @@ namespace battleutils maxPdif = ratio; } - minPdif = std::clamp(minPdif, 0, 3); - maxPdif = std::clamp(maxPdif, 0, 3); + // Apply damage limit modifier + float damageLimitPlus = PAttacker->getMod(Mod::DAMAGE_LIMIT) / 100.0f; + float damageLimitPerc = (100.0f + PAttacker->getMod(Mod::DAMAGE_LIMITP)) / 100.0f; + maxRatio = (maxRatio + damageLimitPlus) * damageLimitPerc; + + minPdif = std::clamp(minPdif, 0, maxRatio); + maxPdif = std::clamp(maxPdif, 0, maxRatio); // return random number between the two float pdif = xirand::GetRandomNumber(minPdif, maxPdif); @@ -2888,203 +2915,36 @@ namespace battleutils * * ************************************************************************/ - float GetDamageRatio(CBattleEntity* PAttacker, CBattleEntity* PDefender, bool isCritical, float bonusAttPercent) + float GetDamageRatio(CBattleEntity* PAttacker, CBattleEntity* PDefender, bool isCritical, float bonusAttPercent, SKILLTYPE weaponType) { - uint16 attack = PAttacker->ATT(); - // Bonus attack currently only from footwork - if (bonusAttPercent >= 1) - { - attack = static_cast(attack * bonusAttPercent); - } - - // Wholly possible for DEF to be near 0 with the amount of debuffs/effects now. - uint16 defense = PDefender->DEF(); - if (defense == 0) - { - defense = 1; - } - - // https://www.bg-wiki.com/bg/PDIF - // https://www.bluegartr.com/threads/127523-pDIF-Changes-(Feb.-10th-2016) - float ratio = (static_cast(attack)) / (static_cast(defense)); - float cRatio = ratio; - - // Level correction does not happen in Adoulin zones, Legion, or zones in Escha/Reisenjima - // Level correction is only a penalty to players, a player does not get any bonus for fighting lower level monsters - // Level correct does give bonuses to Monsters and Avatars. For Avatars it caps at a level difference of 38 - // I am going to assume that the 38 level difference cap applies to monsters as well - // https://www.bluegartr.com/threads/114636-Monster-Avatar-Pet-damage - // This thread references the level correction cap for avatars and states that penalties are ignored for avatars - // Monster pDIF = Avatar pDIF = Pet pDIF - // Based on these points we know monsters and avatars ignore penalties from level correct and only get bonuses so - // I believe it is safe to assume all pets do this. - - uint16 zoneId = PAttacker->getZone(); - // All zones from Adoulin onward have an id of 256+ - // This includes Escha/Reisenjima and the new Dynamis zones - // (Not a post Adoulin Zone) && (Not Legion_A) - bool shouldApplyLevelCorrection = (zoneId < 256) && (zoneId != 183); - - ENTITYTYPE attackerType = PAttacker->objtype; - - uint8 attackerLvl = PAttacker->GetMLevel(); - uint8 defenderLvl = PDefender->GetMLevel(); - uint8 dLvl = std::abs(attackerLvl - defenderLvl); - float correction = static_cast(dLvl) * 0.05f; - - // Assuming the cap for mobs is the same as Avatars - // Cap at 38 level diff so 38*0.05 = 1.9 - float cappedCorrection = std::min(correction, 1.9f); - - if (shouldApplyLevelCorrection) - { - // Players only get penalties - if (attackerType == TYPE_PC) - { - if (attackerLvl < defenderLvl) - { - // Screw the players, no known cap - cRatio -= correction; - } - } - // Mobs, Avatars and pets only get bonuses, no penalties (or they are calculated differently) - else if (attackerType == TYPE_MOB || attackerType == TYPE_PET) - { - if (attackerLvl > defenderLvl) - { - cRatio += cappedCorrection; - } - } - } - - float wRatio = cRatio; - - if (isCritical) - { - wRatio += 1; - } - - float qRatio = wRatio; - float upperLimit = 0.0f; - float lowerLimit = 0.0f; - - // https://www.bg-wiki.com/bg/PDIF - // Pre-Randomized values excluding Damage Limit+ trait - // Damage Limit+ trait adds 0.1/rank to these values - // type : non-crit : crit - // 1H : 3.25 : 4.25 - // H2H & GK : 3.5 : 4.5 - // 2H : 3.75 : 4.75 - // Scythe : 4 : 5 - // Archery & Throwing : 3.25 : 3.25*1.25 - // Marksmanship : 3.5 : 3.5*1.25 + float pDIF = 1.0f; - // https://www.bluegartr.com/threads/114636-Monster-Avatar-Pet-damage - // Monster pDIF = Avatar pDIF = Pet pDIF + auto levelCorrectionFunc = lua["xi"]["combat"]["levelCorrection"]["isLevelCorrectedZone"]; + auto meleePDIFFunc = lua["xi"]["combat"]["physical"]["calculateMeleePDIF"]; + auto luaAttackerEntity = CLuaBaseEntity(PAttacker); - auto* targ_weapon = dynamic_cast(PAttacker->m_Weapons[SLOT_MAIN]); - - // Default for 1H is 3.25 - float maxRatio = 3.25f; - - if (attackerType == TYPE_MOB || attackerType == TYPE_PET) + if (meleePDIFFunc.valid() && levelCorrectionFunc.valid()) { - // Mobs and pets cap at 4.25 regardless of crit so no need to bother with crits for the max - maxRatio = 4.25f; - } - else - { - // If null ignore the checks and fallback to 1H values - if (targ_weapon) + auto levelCorrectionResult = levelCorrectionFunc(luaAttackerEntity); + if (!levelCorrectionResult.valid()) { - if (targ_weapon->isHandToHand() || targ_weapon->getSkillType() == SKILL_GREAT_KATANA) - { - maxRatio = 3.5f; - } - else if (targ_weapon->getSkillType() == SKILL_SCYTHE) - { - maxRatio = 4.0f; - } - else if (targ_weapon->isTwoHanded()) - { - maxRatio = 3.75f; - } + sol::error err = levelCorrectionResult; + ShowError("battleutils::GetDamageRatio(): %s", err.what()); + return pDIF; } - // Skipping Ranged since that is handled in a separate function - // Default to 1H and check for +1 to max from crit - if (isCritical) + auto meleePDIFFuncResult = meleePDIFFunc(luaAttackerEntity, CLuaBaseEntity(PDefender), weaponType, bonusAttPercent, isCritical, levelCorrectionResult.get(0), false, 0.0, false); + if (!meleePDIFFuncResult.valid()) { - maxRatio += 1.0f; + sol::error err = meleePDIFFuncResult; + ShowError("battleutils::GetDamageRatio(): %s", err.what()); + return pDIF; } - } - - // https://www.bg-wiki.com/bg/Damage_Limit+ - // There is an additional step here but I am skipping it for now because we do not have the data in the database. - // The Damage Limit+ trait adds 0.1 to the maxRatio per trait level so a level 80 DRK would get maxRatio += 0.5 - - if (wRatio < 0.5) - { - upperLimit = std::max(wRatio + 0.5f, 0.5f); - } - else if (wRatio < 0.7) - { - upperLimit = 1; - } - else if (wRatio < 1.2) - { - upperLimit = wRatio + 0.3f; - } - else if (wRatio < 1.5) - { - upperLimit = wRatio * 1.25f; + pDIF = meleePDIFFuncResult.get(0); } else { - upperLimit = std::min(wRatio + 0.375f, maxRatio); - } - - if (wRatio < 0.38) - { - lowerLimit = std::max(wRatio, 0.5f); - } - else if (wRatio < 1.25) - { - lowerLimit = (wRatio * (1176.0f / 1024.0f)) - (448.0f / 1024.0f); - } - else if (wRatio < 1.51) - { - lowerLimit = 1.0f; - } - else if (wRatio < 2.44) - { - lowerLimit = (wRatio * (1176.0f / 1024.0f)) - (755.0f / 1024.0f); - } - else - { - lowerLimit = std::min(wRatio - 0.375f, maxRatio); - } - - // https://www.bg-wiki.com/bg/Damage_Limit+ - // See: "Physical damage limit +n%" is a multiplier to the total pDIF cap. - // There is one more step here that I am skipping for Physical Damage +% from gear and augments. - // I don't believe support for this modifier exists yet in the project. - // Physical Damage +% (PDL) is a flat % increase to the final pDIF cap value - // Meaning if a player has PDL+10% and an uppwerLimit of 1 then this would become 1.1 - // upperLimit = upperLimit * 1.1 - - qRatio = xirand::GetRandomNumber(lowerLimit, upperLimit); - - float pDIF = qRatio * xirand::GetRandomNumber(1.f, 1.05f); - - if (isCritical) - { - // Crit Attack Bonus caps at +100% and is a flat increase to final crit damage - // so this is change to increase pDIF and not the qRatio - int16 criticaldamage = PAttacker->getMod(Mod::CRIT_DMG_INCREASE) - PDefender->getMod(Mod::CRIT_DEF_BONUS); - - criticaldamage = std::clamp(criticaldamage, 0, 100); - pDIF *= ((100 + criticaldamage) / 100.0f); + ShowError("battleutils::GetDamageRatio() failed to run lua calls"); } return pDIF; @@ -4657,169 +4517,6 @@ namespace battleutils return shotCount; } - /************************************************************************ - * * - * Calculate DRG Jump ability total damage * - * * - ************************************************************************/ - - uint16 jumpAbility(CBattleEntity* PAttacker, CBattleEntity* PVictim, uint8 tier) - { - // super jump - remove 99% of enmity - if (tier == 3 && PVictim->objtype == TYPE_MOB) - { - ((CMobEntity*)PVictim)->PEnmityContainer->LowerEnmityByPercent(PAttacker, 99, nullptr); - return 0; - } - - // target has perfect dodge - do not go any further - if (PVictim->StatusEffectContainer->HasStatusEffect(EFFECT_PERFECT_DODGE, 0)) - { - // Claim the mob. - battleutils::ClaimMob(PVictim, PAttacker); - return 0; - } - - // multihit's just multiply jump damage - auto* sub = dynamic_cast(PAttacker->m_Weapons[SLOT_SUB]); - uint8 numattacksLeftHand = 0; - - // sub weapon is equipped - if (sub && sub->getDmgType() > DAMAGE_TYPE::NONE && sub->getDmgType() < DAMAGE_TYPE::HTH) - { - numattacksLeftHand = battleutils::CheckMultiHits(PAttacker, sub); - } - - auto* PWeapon = dynamic_cast(PAttacker->m_Weapons[SLOT_MAIN]); - - // h2h equipped - if (PWeapon && PWeapon->getSkillType() == SKILL_HAND_TO_HAND) - { - numattacksLeftHand = battleutils::CheckMultiHits(PAttacker, PWeapon); - } - - // normal multi hit from left hand - uint8 numattacksRightHand = battleutils::CheckMultiHits(PAttacker, PWeapon); - - uint8 fstrslot = SLOT_MAIN; - - uint8 hitrate = battleutils::GetHitRate(PAttacker, PVictim); - uint8 realHits = 0; // to store the real number of hit for tp multipler - uint16 totalDamage = 0; - uint16 damageForRound = 0; - bool hitTarget = false; - - // Loop number of hits - for (uint16 i = 0; i < (numattacksLeftHand + numattacksRightHand); ++i) - { - if (i != 0) - { - if (PVictim->isDead()) - { - break; - } - - if (PWeapon && PWeapon->getSkillType() != SKILL_HAND_TO_HAND && i >= numattacksRightHand) - { - PWeapon = dynamic_cast(PAttacker->m_Weapons[SLOT_SUB]); - fstrslot = SLOT_SUB; - } - } - - if (xirand::GetRandomNumber(100) < hitrate) - { - // attack hit, try to be absorbed by shadow - if (!battleutils::IsAbsorbByShadow(PVictim, PAttacker)) - { - // successful hit, add damage - float AttMultiplerPercent = 0.f; - - // get jump attack bonus from gear - if (PAttacker->objtype == TYPE_PC) - { - AttMultiplerPercent = PAttacker->getMod(Mod::JUMP_ATT_BONUS) / 100.f; - } - - float DamageRatio = battleutils::GetDamageRatio(PAttacker, PVictim, false, AttMultiplerPercent); - damageForRound = (uint16)((PAttacker->GetMainWeaponDmg() + battleutils::GetFSTR(PAttacker, PVictim, SLOT_MAIN)) * DamageRatio); - - // bonus applies to jump only, not high jump - if (tier == 1) - { - float jumpBonus = 1.f + PAttacker->VIT() / 256.f; - damageForRound = (uint16)(damageForRound * jumpBonus); - } - - hitTarget = true; - realHits++; - - // incase player has gungnir^^ (or any other damage increases weapons) - damageForRound = - attackutils::CheckForDamageMultiplier((CCharEntity*)PAttacker, PWeapon, damageForRound, PHYSICAL_ATTACK_TYPE::NORMAL, SLOT_MAIN); - - totalDamage += damageForRound; - } - } - } - - // check for soul eater - if (PAttacker->objtype == TYPE_PC) - { - totalDamage = battleutils::doSoulEaterEffect((CCharEntity*)PAttacker, totalDamage); - } - - // bonus jump tp is added even if damage is 0, will not add if jump misses - if (PAttacker->objtype == TYPE_PC && hitTarget) - { - int mod = PAttacker->getMod(Mod::JUMP_TP_BONUS); - PAttacker->addTP(mod); - } - - // if damage is 0 then jump missed - if (totalDamage == 0) - { - // Claim the mob. - battleutils::ClaimMob(PVictim, PAttacker); - return 0; - } - - // high jump removes %50 emnity + more from any gear mods - if (tier == 2 && PVictim->objtype == TYPE_MOB) - { - uint16 enmityReduction = PAttacker->getMod(Mod::HIGH_JUMP_ENMITY_REDUCTION) + 50; - - // DRG sub has only 30% enmity removed instead of 50%. - if (PAttacker->GetSJob() == JOB_DRG) - { - enmityReduction = PAttacker->getMod(Mod::HIGH_JUMP_ENMITY_REDUCTION) + 30; - } - - // cap it - if (enmityReduction > 100) - { - enmityReduction = 100; - } - ((CMobEntity*)PVictim)->PEnmityContainer->LowerEnmityByPercent(PAttacker, (uint8)enmityReduction, nullptr); - } - - // Under Spirit Surge, High Jump lowers the target's TP proportionately to the amount of damage dealt (TP is reduced by damage * 20) - if (tier == 2 && PAttacker->StatusEffectContainer->HasStatusEffect(EFFECT_SPIRIT_SURGE)) - { - PVictim->addTP(-(totalDamage * 20)); - } - - // try skill up (CharEntity only) - if (PAttacker->objtype == TYPE_PC) - { - charutils::TrySkillUP((CCharEntity*)PAttacker, (SKILLTYPE)PWeapon->getSkillType(), PVictim->GetMLevel()); - } - - // jump + high jump doesn't give any tp to victim - battleutils::TakePhysicalDamage(PAttacker, PVictim, PHYSICAL_ATTACK_TYPE::NORMAL, totalDamage, false, fstrslot, realHits, nullptr, false, true); - - return totalDamage; - } - /************************************************************************ * * * Calculate BST Charm duration * diff --git a/src/map/utils/battleutils.h b/src/map/utils/battleutils.h index 9ce7667b5d5..af31559366f 100644 --- a/src/map/utils/battleutils.h +++ b/src/map/utils/battleutils.h @@ -151,7 +151,7 @@ namespace battleutils float GetBlockRate(CBattleEntity* PAttacker, CBattleEntity* PDefender); uint8 GetParryRate(CBattleEntity* PAttacker, CBattleEntity* PDefender); uint8 GetGuardRate(CBattleEntity* PAttacker, CBattleEntity* PDefender); - float GetDamageRatio(CBattleEntity* PAttacker, CBattleEntity* PDefender, bool isCritical, float bonusAttPercent); + float GetDamageRatio(CBattleEntity* PAttacker, CBattleEntity* PDefender, bool isCritical, float bonusAttPercent, SKILLTYPE weaponType); int32 TakePhysicalDamage(CBattleEntity* PAttacker, CBattleEntity* PDefender, PHYSICAL_ATTACK_TYPE physicalAttackType, int32 damage, bool isBlocked, uint8 slot, uint16 tpMultiplier, CBattleEntity* taChar, bool giveTPtoVictim, bool giveTPtoAttacker, bool isCounter = false, @@ -201,7 +201,6 @@ namespace battleutils uint16 doSoulEaterEffect(CCharEntity* m_PChar, uint32 damage); uint16 doConsumeManaEffect(CCharEntity* m_PChar, uint32 damage); int32 getOverWhelmDamageBonus(CCharEntity* m_PChar, CBattleEntity* PDefender, int32 damage); - uint16 jumpAbility(CBattleEntity* PAttacker, CBattleEntity* PVictim, uint8 tier); void TransferEnmity(CBattleEntity* PHateReceiver, CBattleEntity* PHateGiver, CMobEntity* PMob, uint8 percentToTransfer); uint8 getBarrageShotCount(CCharEntity* PChar); diff --git a/src/map/utils/fishingutils.cpp b/src/map/utils/fishingutils.cpp index 0a6d48217d8..406f8b6537f 100644 --- a/src/map/utils/fishingutils.cpp +++ b/src/map/utils/fishingutils.cpp @@ -886,7 +886,7 @@ namespace fishingutils return lsb; } - // @TODO: figure out how to pass mobs and items and chests here... + // TODO: figure out how to pass mobs and items and chests here... uint8 CalculateFishSense(CCharEntity* PChar, fishresponse_t* response, uint8 fishingSkill, uint8 catchType, uint8 sizeType, uint8 maxSkill, bool legendary, uint16 minLength, uint16 maxLength, uint8 ranking, rod_t* rod) @@ -2990,7 +2990,7 @@ namespace fishingutils "ff.ranking, " // 22 "ff.contest " "FROM fishing_fish ff " - "WHERE ff.disabled = 0 and ff.ranking < 99"; + "WHERE ff.disabled = 0 AND ff.ranking < 99"; int32 ret = sql->Query(Query); diff --git a/src/map/utils/petutils.cpp b/src/map/utils/petutils.cpp index 867118fa808..32ec9f9a23c 100644 --- a/src/map/utils/petutils.cpp +++ b/src/map/utils/petutils.cpp @@ -38,6 +38,7 @@ along with this program. If not, see http://www.gnu.org/licenses/ #include "latent_effect_container.h" #include "map.h" #include "mob_spell_list.h" +#include "notoriety_container.h" #include "petutils.h" #include "puppetutils.h" #include "status_effect_container.h" @@ -1294,6 +1295,24 @@ namespace petutils PMob->PMaster = nullptr; PMob->PAI->SetController(std::make_unique(PMob)); + + // clear all enmity towards a charmed mob when it is released + // use two loops to avoid modifying the container while iterating over it + std::list mobsToPacify; + + // first collect the mobs with hate towards the formerly charmed mob + for (auto* entityWithEnmity : *PMob->PNotorietyContainer) + { + if (auto* mobToPacify = dynamic_cast(entityWithEnmity)) + { + mobsToPacify.emplace_back(mobToPacify); + } + } + // then remove the formerly charmed mob from those mobs enmity containers + for (const auto* mobToPacify : mobsToPacify) + { + mobToPacify->PEnmityContainer->Clear(PMob->id); + } } else if (PPet->objtype == TYPE_PET) {