mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-07 15:28:02 +00:00
refactor(Scripts/ZulAman): Move Hexlord adds to SAI (#20185)
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
--
|
||||
UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName`= '' WHERE `entry` = 24247;
|
||||
|
||||
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 24247) AND (`source_type` = 0) AND (`id` IN (0, 1));
|
||||
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
|
||||
(24247, 0, 0, 0, 0, 0, 100, 0, 10000, 10000, 12000, 12000, 0, 0, 11, 43592, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Koragg - In Combat - Cast \'Mighty Blow\''),
|
||||
(24247, 0, 1, 0, 0, 0, 100, 0, 15000, 15000, 12000, 12000, 0, 0, 11, 43593, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 'Koragg - In Combat - Cast \'Cold Stare\'');
|
||||
|
||||
UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName`= '' WHERE `entry` = 24246;
|
||||
|
||||
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 24246) AND (`source_type` = 0) AND (`id` IN (0));
|
||||
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
|
||||
(24246, 0, 0, 0, 0, 0, 100, 0, 8000, 8000, 12000, 12000, 0, 0, 11, 43590, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Darkheart - In Combat - Cast \'Psychic Wail\'');
|
||||
|
||||
UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName`= '' WHERE `entry` = 24244;
|
||||
|
||||
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 24244) AND (`source_type` = 0) AND (`id` IN (0));
|
||||
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
|
||||
(24244, 0, 0, 0, 0, 0, 100, 0, 2000, 2000, 1000, 1000, 0, 0, 11, 43584, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Gazakroth - In Combat - Cast \'Firebolt\'');
|
||||
|
||||
UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName`= '' WHERE `entry` = 24245;
|
||||
|
||||
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 24245) AND (`source_type` = 0) AND (`id` IN (0));
|
||||
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
|
||||
(24245, 0, 0, 0, 0, 0, 100, 0, 15000, 15000, 12000, 12000, 0, 0, 11, 43586, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Fenstalker - In Combat - Cast \'Volatile Infection\'');
|
||||
|
||||
UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName`= '' WHERE `entry` = 24242;
|
||||
|
||||
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 24242) AND (`source_type` = 0) AND (`id` IN (0));
|
||||
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
|
||||
(24242, 0, 0, 0, 0, 0, 100, 0, 5000, 5000, 2500, 2500, 0, 0, 11, 43579, 64, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 'Slither - In Combat - Cast \'Venom Spit\'');
|
||||
|
||||
UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName`= '' WHERE `entry` = 24243;
|
||||
|
||||
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 24243) AND (`source_type` = 0) AND (`id` IN (0, 1));
|
||||
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
|
||||
(24243, 0, 0, 0, 0, 0, 100, 0, 13000, 13000, 12000, 12000, 0, 0, 11, 43583, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Lord Raadan - In Combat - Cast \'Thunderclap\''),
|
||||
(24243, 0, 1, 0, 0, 0, 100, 0, 8000, 8000, 12000, 12000, 0, 0, 11, 43582, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Lord Raadan - In Combat - Cast \'Flame Breath\'');
|
||||
|
||||
UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName`= '' WHERE `entry` = 24241;
|
||||
|
||||
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 24241) AND (`source_type` = 0) AND (`id` IN (0, 1));
|
||||
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
|
||||
(24241, 0, 0, 0, 16, 0, 100, 0, 43578, 100, 12000, 15000, 1, 0, 11, 43578, 32, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Thurg - On Friendly Unit Missing Buff \'Bloodlust\' - Cast \'Bloodlust\''),
|
||||
(24241, 0, 1, 0, 14, 0, 100, 0, 10000, 10000, 12000, 12000, 0, 0, 11, 15496, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Thurg - In Combat - Cast \'Cleave\'');
|
||||
@@ -509,63 +509,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class boss_thurg : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_thurg()
|
||||
: CreatureScript("boss_thurg")
|
||||
{
|
||||
}
|
||||
|
||||
struct boss_thurgAI : public boss_hexlord_addAI
|
||||
{
|
||||
boss_thurgAI(Creature* creature) : boss_hexlord_addAI(creature) { }
|
||||
|
||||
uint32 bloodlust_timer;
|
||||
uint32 cleave_timer;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
bloodlust_timer = 15000;
|
||||
cleave_timer = 10000;
|
||||
|
||||
boss_hexlord_addAI::Reset();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (bloodlust_timer <= diff)
|
||||
{
|
||||
std::list<Creature*> templist = DoFindFriendlyMissingBuff(50, SPELL_BLOODLUST);
|
||||
if (!templist.empty())
|
||||
{
|
||||
if (Unit* target = *(templist.begin()))
|
||||
DoCast(target, SPELL_BLOODLUST, false);
|
||||
}
|
||||
bloodlust_timer = 12000;
|
||||
}
|
||||
else bloodlust_timer -= diff;
|
||||
|
||||
if (cleave_timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_CLEAVE, false);
|
||||
cleave_timer = 12000; //3 sec cast
|
||||
}
|
||||
else cleave_timer -= diff;
|
||||
|
||||
boss_hexlord_addAI::UpdateAI(diff);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetZulAmanAI<boss_thurgAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_alyson_antille : public CreatureScript
|
||||
{
|
||||
public:
|
||||
@@ -668,331 +611,30 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
struct boss_gazakrothAI : public boss_hexlord_addAI
|
||||
class spell_hexlord_unstable_affliction : public AuraScript
|
||||
{
|
||||
boss_gazakrothAI(Creature* creature) : boss_hexlord_addAI(creature) { }
|
||||
PrepareAuraScript(spell_hexlord_unstable_affliction);
|
||||
|
||||
uint32 firebolt_timer;
|
||||
|
||||
void Reset() override
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
firebolt_timer = 2000;
|
||||
boss_hexlord_addAI::Reset();
|
||||
return ValidateSpellInfo({ SPELL_WL_UNSTABLE_AFFL_DISPEL });
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who) override
|
||||
void HandleDispel(DispelInfo* dispelInfo)
|
||||
{
|
||||
if (!who)
|
||||
return;
|
||||
|
||||
if (who->isTargetableForAttack())
|
||||
{
|
||||
if (me->Attack(who, false))
|
||||
{
|
||||
me->GetMotionMaster()->MoveChase(who, 20);
|
||||
me->AddThreat(who, 0.0f);
|
||||
}
|
||||
}
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(dispelInfo->GetDispeller(), SPELL_WL_UNSTABLE_AFFL_DISPEL, true, nullptr, GetEffect(EFFECT_0));
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
void Register() override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (firebolt_timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_FIREBOLT, false);
|
||||
firebolt_timer = 700;
|
||||
}
|
||||
else firebolt_timer -= diff;
|
||||
|
||||
boss_hexlord_addAI::UpdateAI(diff);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_lord_raadan : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_lord_raadan()
|
||||
: CreatureScript("boss_lord_raadan")
|
||||
{
|
||||
}
|
||||
|
||||
struct boss_lord_raadanAI : public boss_hexlord_addAI
|
||||
{
|
||||
boss_lord_raadanAI(Creature* creature) : boss_hexlord_addAI(creature) { }
|
||||
|
||||
uint32 flamebreath_timer;
|
||||
uint32 thunderclap_timer;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
flamebreath_timer = 8000;
|
||||
thunderclap_timer = 13000;
|
||||
|
||||
boss_hexlord_addAI::Reset();
|
||||
}
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (thunderclap_timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_THUNDERCLAP, false);
|
||||
thunderclap_timer = 12000;
|
||||
}
|
||||
else thunderclap_timer -= diff;
|
||||
|
||||
if (flamebreath_timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_FLAME_BREATH, false);
|
||||
flamebreath_timer = 12000;
|
||||
}
|
||||
else flamebreath_timer -= diff;
|
||||
|
||||
boss_hexlord_addAI::UpdateAI(diff);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetZulAmanAI<boss_lord_raadanAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_darkheart : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_darkheart()
|
||||
: CreatureScript("boss_darkheart")
|
||||
{
|
||||
}
|
||||
|
||||
struct boss_darkheartAI : public boss_hexlord_addAI
|
||||
{
|
||||
boss_darkheartAI(Creature* creature) : boss_hexlord_addAI(creature) { }
|
||||
|
||||
uint32 psychicwail_timer;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
psychicwail_timer = 8000;
|
||||
boss_hexlord_addAI::Reset();
|
||||
}
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (psychicwail_timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_PSYCHIC_WAIL, false);
|
||||
psychicwail_timer = 12000;
|
||||
}
|
||||
else psychicwail_timer -= diff;
|
||||
|
||||
boss_hexlord_addAI::UpdateAI(diff);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetZulAmanAI<boss_darkheartAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_slither : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_slither()
|
||||
: CreatureScript("boss_slither")
|
||||
{
|
||||
}
|
||||
|
||||
struct boss_slitherAI : public boss_hexlord_addAI
|
||||
{
|
||||
boss_slitherAI(Creature* creature) : boss_hexlord_addAI(creature) { }
|
||||
|
||||
uint32 venomspit_timer;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
venomspit_timer = 5000;
|
||||
boss_hexlord_addAI::Reset();
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who) override
|
||||
{
|
||||
if (!who)
|
||||
return;
|
||||
|
||||
if (who->isTargetableForAttack())
|
||||
{
|
||||
if (me->Attack(who, false))
|
||||
{
|
||||
me->GetMotionMaster()->MoveChase(who, 20);
|
||||
me->AddThreat(who, 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (venomspit_timer <= diff)
|
||||
{
|
||||
if (Unit* victim = SelectTarget(SelectTargetMethod::Random, 0, 100, true))
|
||||
DoCast(victim, SPELL_VENOM_SPIT, false);
|
||||
venomspit_timer = 2500;
|
||||
}
|
||||
else venomspit_timer -= diff;
|
||||
|
||||
boss_hexlord_addAI::UpdateAI(diff);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetZulAmanAI<boss_slitherAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_fenstalker : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_fenstalker()
|
||||
: CreatureScript("boss_fenstalker")
|
||||
{
|
||||
}
|
||||
|
||||
struct boss_fenstalkerAI : public boss_hexlord_addAI
|
||||
{
|
||||
boss_fenstalkerAI(Creature* creature) : boss_hexlord_addAI(creature) { }
|
||||
|
||||
uint32 volatileinf_timer;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
volatileinf_timer = 15000;
|
||||
boss_hexlord_addAI::Reset();
|
||||
}
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (volatileinf_timer <= diff)
|
||||
{
|
||||
// core bug
|
||||
me->GetVictim()->CastSpell(me->GetVictim(), SPELL_VOLATILE_INFECTION, false);
|
||||
volatileinf_timer = 12000;
|
||||
}
|
||||
else volatileinf_timer -= diff;
|
||||
|
||||
boss_hexlord_addAI::UpdateAI(diff);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetZulAmanAI<boss_fenstalkerAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_koragg : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_koragg()
|
||||
: CreatureScript("boss_koragg")
|
||||
{
|
||||
}
|
||||
|
||||
struct boss_koraggAI : public boss_hexlord_addAI
|
||||
{
|
||||
boss_koraggAI(Creature* creature) : boss_hexlord_addAI(creature) { }
|
||||
|
||||
uint32 coldstare_timer;
|
||||
uint32 mightyblow_timer;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
coldstare_timer = 15000;
|
||||
mightyblow_timer = 10000;
|
||||
boss_hexlord_addAI::Reset();
|
||||
}
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (mightyblow_timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_MIGHTY_BLOW, false);
|
||||
mightyblow_timer = 12000;
|
||||
}
|
||||
if (coldstare_timer <= diff)
|
||||
{
|
||||
if (Unit* victim = SelectTarget(SelectTargetMethod::Random, 0, 100, true))
|
||||
DoCast(victim, SPELL_COLD_STARE, false);
|
||||
coldstare_timer = 12000;
|
||||
}
|
||||
|
||||
boss_hexlord_addAI::UpdateAI(diff);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetZulAmanAI<boss_koraggAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_hexlord_unstable_affliction : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_hexlord_unstable_affliction() : SpellScriptLoader("spell_hexlord_unstable_affliction") { }
|
||||
|
||||
class spell_hexlord_unstable_affliction_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_hexlord_unstable_affliction_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_WL_UNSTABLE_AFFL_DISPEL });
|
||||
}
|
||||
|
||||
void HandleDispel(DispelInfo* dispelInfo)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(dispelInfo->GetDispeller(), SPELL_WL_UNSTABLE_AFFL_DISPEL, true, nullptr, GetEffect(EFFECT_0));
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterDispel += AuraDispelFn(spell_hexlord_unstable_affliction_AuraScript::HandleDispel);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_hexlord_unstable_affliction_AuraScript();
|
||||
AfterDispel += AuraDispelFn(spell_hexlord_unstable_affliction::HandleDispel);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_hex_lord_malacrass()
|
||||
{
|
||||
new boss_hexlord_malacrass();
|
||||
new boss_thurg();
|
||||
// new boss_gazakroth();
|
||||
new boss_lord_raadan();
|
||||
new boss_darkheart();
|
||||
new boss_slither();
|
||||
new boss_fenstalker();
|
||||
new boss_koragg();
|
||||
new boss_alyson_antille();
|
||||
new spell_hexlord_unstable_affliction();
|
||||
RegisterSpellScript(spell_hexlord_unstable_affliction);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user