diff --git a/conf/ghost_speed.conf.dist b/conf/ghost_speed.conf.dist index 99abe68..f7c6ad1 100644 --- a/conf/ghost_speed.conf.dist +++ b/conf/ghost_speed.conf.dist @@ -12,14 +12,31 @@ # Description: Custom BasePoints for 8326 Ghost EFFECT_1 SPELL_AURA_MOD_INCREASE_SPEED # Default: 200 - Fast # 50 - Blizzard Default +# 75 - Blizzard Default for Night Elves (+50% racial bonus) # 500 - Zoom # # GhostSpeed.SpeedSwim # Description: Custom BasePoints for 8326 Ghost EFFECT_2 SPELL_AURA_MOD_INCREASE_SWIM_SPEED # Default: 200 - Fast # 50 - Blizzard Default +# 75 - Blizzard Default for Night Elves (+50% racial bonus) # 500 - Zoom # +# GhostSpeed.SpeedNightElf +# Description: Custom BasePoints for Night Elf 20584 Ghost EFFECT_1 SPELL_AURA_MOD_INCREASE_SPEED +# Default: 300 - Fast (200 + 50% racial bonus) +# 50 - Blizzard Default +# 75 - Blizzard Default for Night Elves (+50% racial bonus) +# 500 - Zoom +# +# GhostSpeed.SpeedSwimNightElf +# Description: Custom BasePoints for Night Elf 20584 Ghost EFFECT_2 SPELL_AURA_MOD_INCREASE_SWIM_SPEED +# Default: 300 - Fast (200 + 50% racial bonus) +# 50 - Blizzard Default +# 75 - Blizzard Default for Night Elves (+50% racial bonus) +# 500 - Zoom -GhostSpeed.Speed = 200 -GhostSpeed.SpeedSwim = 200 +GhostSpeed.Speed = 200 +GhostSpeed.SpeedSwim = 200 +GhostSpeed.SpeedNightElf = 300 +GhostSpeed.SpeedSwimNightElf = 300 diff --git a/data/sql/db-world/base/ghost_speed.sql b/data/sql/db-world/base/ghost_speed.sql index bc6f878..57bf19a 100644 --- a/data/sql/db-world/base/ghost_speed.sql +++ b/data/sql/db-world/base/ghost_speed.sql @@ -1,3 +1,5 @@ -- modify ghost speed -DELETE FROM `spell_script_names` WHERE `spell_id` = 8326; +DELETE FROM `spell_script_names` WHERE `spell_id` = 8326 AND `ScriptName` = 'spell_ghost_speed_aura'; INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (8326, 'spell_ghost_speed_aura'); +DELETE FROM `spell_script_names` WHERE `spell_id` = 20584 AND `ScriptName` = 'spell_ghost_speed_night_elf_aura'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (20584, 'spell_ghost_speed_night_elf_aura'); diff --git a/optional/undo_ghost_speed.sql b/optional/undo_ghost_speed.sql index abb0ea8..afbcca4 100644 --- a/optional/undo_ghost_speed.sql +++ b/optional/undo_ghost_speed.sql @@ -1,2 +1,3 @@ -- -DELETE FROM `spell_script_names` WHERE `spell_id` = 8326; +DELETE FROM `spell_script_names` WHERE `spell_id` = 8326 AND `ScriptName` = 'spell_ghost_speed_aura'; +DELETE FROM `spell_script_names` WHERE `spell_id` = 20584 AND `ScriptName` = 'spell_ghost_speed_night_elf_aura'; diff --git a/src/mod_ghost_speed.cpp b/src/mod_ghost_speed.cpp index 4d4365d..0551889 100644 --- a/src/mod_ghost_speed.cpp +++ b/src/mod_ghost_speed.cpp @@ -24,6 +24,8 @@ class world_ghost_speed : public WorldScript { sGhostSpeed->speed = sConfigMgr->GetOption("GhostSpeed.Speed", 200); sGhostSpeed->speedSwim = sConfigMgr->GetOption("GhostSpeed.SpeedSwim", 200); + sGhostSpeed->speedNightElf = sConfigMgr->GetOption("GhostSpeed.SpeedNightElf", 300); + sGhostSpeed->speedSwimNightElf = sConfigMgr->GetOption("GhostSpeed.SpeedSwimNightElf", 300); } }; @@ -49,8 +51,31 @@ class spell_ghost_speed_aura : public AuraScript } }; +// 20584 Ghost - Night Elf +class spell_ghost_speed_night_elf_aura : public AuraScript +{ + PrepareAuraScript(spell_ghost_speed_night_elf_aura); + + void CalculateAmountSpeed(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + amount = sGhostSpeed->speedNightElf; + } + + void CalculateAmountSwimSpeed(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + amount = sGhostSpeed->speedSwimNightElf; + } + + void Register() override + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_ghost_speed_night_elf_aura::CalculateAmountSpeed, EFFECT_1, SPELL_AURA_MOD_INCREASE_SPEED); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_ghost_speed_night_elf_aura::CalculateAmountSwimSpeed, EFFECT_2, SPELL_AURA_MOD_INCREASE_SWIM_SPEED); + } +}; + void AddSC_ghost_speed_spell_script() { new world_ghost_speed(); RegisterSpellScript(spell_ghost_speed_aura); + RegisterSpellScript(spell_ghost_speed_night_elf_aura); } diff --git a/src/mod_ghost_speed.h b/src/mod_ghost_speed.h index 0385d82..fa15137 100644 --- a/src/mod_ghost_speed.h +++ b/src/mod_ghost_speed.h @@ -8,6 +8,8 @@ class GhostSpeed int32 speed; int32 speedSwim; + int32 speedNightElf; + int32 speedSwimNightElf; }; #define sGhostSpeed GhostSpeed::instance()