diff options
-rw-r--r-- | sql/updates/world/3.3.5/2017_07_18_01_world.sql | 2 | ||||
-rw-r--r-- | src/server/game/DataStores/DBCEnums.h | 2 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_item.cpp | 27 |
3 files changed, 18 insertions, 13 deletions
diff --git a/sql/updates/world/3.3.5/2017_07_18_01_world.sql b/sql/updates/world/3.3.5/2017_07_18_01_world.sql new file mode 100644 index 00000000000..8123ceafc6d --- /dev/null +++ b/sql/updates/world/3.3.5/2017_07_18_01_world.sql @@ -0,0 +1,2 @@ +-- correct typo in script name +UPDATE `spell_script_names` SET `ScriptName`="spell_item_nitro_boosts" WHERE `ScriptName`="spell_item_nitro_boots"; diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index f7d3fe325dc..923ed40b93a 100644 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -248,7 +248,7 @@ enum AreaFlags AREA_FLAG_UNK0 = 0x00000001, // Unknown AREA_FLAG_UNK1 = 0x00000002, // Razorfen Downs, Naxxramas and Acherus: The Ebon Hold (3.3.5a) AREA_FLAG_UNK2 = 0x00000004, // Only used for areas on map 571 (development before) - AREA_FLAG_SLAVE_CAPITAL = 0x00000008, // city and city subsones + AREA_FLAG_SLAVE_CAPITAL = 0x00000008, // city and city subzones AREA_FLAG_UNK3 = 0x00000010, // can't find common meaning AREA_FLAG_SLAVE_CAPITAL2 = 0x00000020, // slave capital city flag? AREA_FLAG_ALLOW_DUELS = 0x00000040, // allow to duel here diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 0de0c0c00b9..418718e809e 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -3333,18 +3333,18 @@ class spell_item_brewfest_mount_transformation : public SpellScriptLoader enum NitroBoots { - SPELL_NITRO_BOOTS_SUCCESS = 54861, - SPELL_NITRO_BOOTS_BACKFIRE = 46014, + SPELL_NITRO_BOOSTS_SUCCESS = 54861, + SPELL_NITRO_BOOSTS_BACKFIRE = 46014, }; -class spell_item_nitro_boots : public SpellScriptLoader +class spell_item_nitro_boosts : public SpellScriptLoader { public: - spell_item_nitro_boots() : SpellScriptLoader("spell_item_nitro_boots") { } + spell_item_nitro_boosts() : SpellScriptLoader("spell_item_nitro_boosts") { } - class spell_item_nitro_boots_SpellScript : public SpellScript + class spell_item_nitro_boosts_SpellScript : public SpellScript { - PrepareSpellScript(spell_item_nitro_boots_SpellScript); + PrepareSpellScript(spell_item_nitro_boosts_SpellScript); bool Load() override { @@ -3355,25 +3355,28 @@ class spell_item_nitro_boots : public SpellScriptLoader bool Validate(SpellInfo const* /*spell*/) override { - return ValidateSpellInfo({ SPELL_NITRO_BOOTS_SUCCESS, SPELL_NITRO_BOOTS_BACKFIRE }); + return ValidateSpellInfo({ SPELL_NITRO_BOOSTS_SUCCESS, SPELL_NITRO_BOOSTS_BACKFIRE }); } void HandleDummy(SpellEffIndex /* effIndex */) { Unit* caster = GetCaster(); - bool success = caster->GetMap()->IsDungeon() || roll_chance_i(95); - caster->CastSpell(caster, success ? SPELL_NITRO_BOOTS_SUCCESS : SPELL_NITRO_BOOTS_BACKFIRE, true, GetCastItem()); + AreaTableEntry const* areaEntry = sAreaTableStore.LookupEntry(caster->GetAreaId()); + bool success = true; + if (areaEntry && areaEntry->IsFlyable() && !caster->GetMap()->IsDungeon()) + success = roll_chance_i(95); // nitro boosts can only fail in flying-enabled locations on 3.3.5 + caster->CastSpell(caster, success ? SPELL_NITRO_BOOSTS_SUCCESS : SPELL_NITRO_BOOSTS_BACKFIRE, true, GetCastItem()); } void Register() override { - OnEffectHitTarget += SpellEffectFn(spell_item_nitro_boots_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + OnEffectHitTarget += SpellEffectFn(spell_item_nitro_boosts_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; SpellScript* GetSpellScript() const override { - return new spell_item_nitro_boots_SpellScript(); + return new spell_item_nitro_boosts_SpellScript(); } }; @@ -4732,7 +4735,7 @@ void AddSC_item_spell_scripts() new spell_item_complete_raptor_capture(); new spell_item_impale_leviroth(); new spell_item_brewfest_mount_transformation(); - new spell_item_nitro_boots(); + new spell_item_nitro_boosts(); new spell_item_teach_language(); new spell_item_rocket_boots(); new spell_item_pygmy_oil(); |