mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-30 09:03:47 +00:00
fix(Scripts/Spell): Don't use invalid spells for the Magic Rooster mount (#9797)
* fix(Scripts/Spell): Don't use invalid spells for the Magic Rooster mount
- cherry-pick commit (246a8661fd)
Co-Authored-By: Wyrserth <43747507+Wyrserth@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1639953303883016900');
|
||||
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName`="spell_gen_magic_rooster";
|
||||
DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=65917;
|
||||
INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `comment`) VALUES
|
||||
(65917, 66122, "Magic Rooster");
|
||||
@@ -3752,9 +3752,14 @@ void SpellMgr::LoadSpellInfoCorrections()
|
||||
spellInfo->Effects[EFFECT_1].MiscValue = 126;
|
||||
});
|
||||
|
||||
// Magic Broom
|
||||
ApplySpellFix({ 47977 }, [](SpellInfo* spellInfo)
|
||||
ApplySpellFix({
|
||||
47977, // Magic Broom
|
||||
65917 // Magic Rooster
|
||||
}, [](SpellInfo* spellInfo)
|
||||
{
|
||||
// First two effects apply auras, which shouldn't be there
|
||||
// due to NO_TARGET applying aura on current caster (core bug)
|
||||
// Just wipe effect data, to mimic blizz-behavior
|
||||
spellInfo->Effects[EFFECT_0].Effect = 0;
|
||||
spellInfo->Effects[EFFECT_1].Effect = 0;
|
||||
});
|
||||
|
||||
@@ -2296,56 +2296,6 @@ class spell_gen_lifeblood : public AuraScript
|
||||
}
|
||||
};
|
||||
|
||||
enum MagicRoosterSpells
|
||||
{
|
||||
SPELL_MAGIC_ROOSTER_NORMAL = 66122,
|
||||
SPELL_MAGIC_ROOSTER_DRAENEI_MALE = 66123,
|
||||
SPELL_MAGIC_ROOSTER_TAUREN_MALE = 66124
|
||||
};
|
||||
|
||||
// 65917 - Magic Rooster
|
||||
class spell_gen_magic_rooster : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gen_magic_rooster);
|
||||
|
||||
void HandleScript(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
if (Player* target = GetHitPlayer())
|
||||
{
|
||||
uint32 petNumber = target->GetTemporaryUnsummonedPetNumber();
|
||||
target->SetTemporaryUnsummonedPetNumber(0);
|
||||
|
||||
// prevent client crashes from stacking mounts
|
||||
target->RemoveAurasByType(SPELL_AURA_MOUNTED);
|
||||
|
||||
uint32 spellId = SPELL_MAGIC_ROOSTER_NORMAL;
|
||||
switch (target->getRace())
|
||||
{
|
||||
case RACE_DRAENEI:
|
||||
if (target->getGender() == GENDER_MALE)
|
||||
spellId = SPELL_MAGIC_ROOSTER_DRAENEI_MALE;
|
||||
break;
|
||||
case RACE_TAUREN:
|
||||
if (target->getGender() == GENDER_MALE)
|
||||
spellId = SPELL_MAGIC_ROOSTER_TAUREN_MALE;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
target->CastSpell(target, spellId, true);
|
||||
if (petNumber)
|
||||
target->SetTemporaryUnsummonedPetNumber(petNumber);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_gen_magic_rooster::HandleScript, EFFECT_2, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
/* 4073 - Mechanical Dragonling
|
||||
12749 - Mithril Mechanical Dragonling
|
||||
13166 - Battle Chicken
|
||||
@@ -4484,7 +4434,6 @@ void AddSC_generic_spell_scripts()
|
||||
RegisterSpellScript(spell_gen_seaforium_blast);
|
||||
RegisterSpellScript(spell_gen_turkey_marker);
|
||||
RegisterSpellScript(spell_gen_lifeblood);
|
||||
RegisterSpellScript(spell_gen_magic_rooster);
|
||||
RegisterSpellScript(spell_gen_allow_cast_from_item_only);
|
||||
RegisterSpellAndAuraScriptPair(spell_gen_vehicle_scaling, spell_gen_vehicle_scaling_aura);
|
||||
RegisterSpellScript(spell_gen_oracle_wolvar_reputation);
|
||||
|
||||
Reference in New Issue
Block a user