mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-29 08:33:47 +00:00
fix(Scripts/Pets): Darting Hatchling not running around. (#15251)
* fix(Scripts/Pets): Darting Hatchling not running around. * cs * Update pet_generic.cpp * RemoveAurasDueToSpell
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
-- Darting Hatchling (pet)
|
||||
UPDATE `creature_template_addon` SET `auras` = 62586 WHERE `entry` = 35396;
|
||||
UPDATE `creature_template` SET `ScriptName` = 'npc_pet_darting_hatchling' WHERE `entry` = 35396;
|
||||
@@ -4547,6 +4547,12 @@ void SpellMgr::LoadSpellInfoCorrections()
|
||||
spellInfo->MaxAffectedTargets = 1;
|
||||
});
|
||||
|
||||
// Mulgore Hatchling (periodic)
|
||||
ApplySpellFix({ 62586 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
spellInfo->Effects[EFFECT_0].TriggerSpell = 62585; // Mulgore Hatchling (fear)
|
||||
});
|
||||
|
||||
for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
|
||||
{
|
||||
SpellInfo* spellInfo = mSpellInfoMap[i];
|
||||
|
||||
@@ -774,6 +774,49 @@ struct npc_pet_gen_moth : public NullCreatureAI
|
||||
}
|
||||
};
|
||||
|
||||
// Darting Hatchling
|
||||
enum Darting
|
||||
{
|
||||
SPELL_DARTING_ON_SPAWN = 62586, // Applied on spawn via creature_template_addon
|
||||
SPELL_DARTING_FEAR = 62585, // Applied every 20s from SPELL_DARTING_ON_SPAWN
|
||||
};
|
||||
|
||||
struct npc_pet_darting_hatchling : public NullCreatureAI
|
||||
{
|
||||
npc_pet_darting_hatchling(Creature* c) : NullCreatureAI(c)
|
||||
{
|
||||
goFast = false;
|
||||
checkTimer = 0;
|
||||
}
|
||||
|
||||
bool goFast;
|
||||
uint32 checkTimer;
|
||||
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* spellInfo) override
|
||||
{
|
||||
if (spellInfo->Id == SPELL_DARTING_FEAR)
|
||||
{
|
||||
goFast = true;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!goFast)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
checkTimer += diff;
|
||||
if (checkTimer >= 2000)
|
||||
{
|
||||
me->RemoveAurasDueToSpell(SPELL_DARTING_FEAR);
|
||||
checkTimer = 0;
|
||||
goFast = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_generic_pet_scripts()
|
||||
{
|
||||
RegisterCreatureAI(npc_pet_gen_soul_trader_beacon);
|
||||
@@ -788,4 +831,5 @@ void AddSC_generic_pet_scripts()
|
||||
RegisterCreatureAI(npc_pet_gen_toxic_wasteling);
|
||||
RegisterCreatureAI(npc_pet_gen_fetch_ball);
|
||||
RegisterCreatureAI(npc_pet_gen_moth);
|
||||
RegisterCreatureAI(npc_pet_darting_hatchling);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user