mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 21:26:23 +00:00
fix(Scripts/SSC): Improve Tainted Elemental combat behaviour (#20505)
* fix(Scripts/SSC): Improve Tainted Elemental combat behaviour * Update boss_lady_vashj.cpp
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
--
|
||||
UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` = 22009;
|
||||
|
||||
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 22009) AND (`source_type` = 0) AND (`id` IN (0, 1, 2));
|
||||
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
|
||||
(22009, 0, 0, 1, 25, 0, 100, 0, 0, 0, 0, 0, 0, 0, 38, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Tainted Elemental - On Reset - Set In Combat With Zone'),
|
||||
(22009, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 41, 15000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Tainted Elemental - On Reset - Despawn In 15000 ms'),
|
||||
(22009, 0, 2, 0, 0, 0, 100, 0, 1000, 2000, 2350, 2650, 0, 0, 11, 38253, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Tainted Elemental - In Combat - Cast \'Poison Bolt\'');
|
||||
@@ -58,17 +58,13 @@ enum Spells
|
||||
SPELL_SUMMON_SPOREBAT2 = 38490,
|
||||
SPELL_SUMMON_SPOREBAT3 = 38492,
|
||||
SPELL_SUMMON_SPOREBAT4 = 38493,
|
||||
SPELL_TOXIC_SPORES = 38574,
|
||||
|
||||
SPELL_POISON_BOLT = 38253
|
||||
SPELL_TOXIC_SPORES = 38574
|
||||
};
|
||||
|
||||
enum Misc
|
||||
{
|
||||
ITEM_TAINTED_CORE = 31088,
|
||||
|
||||
POINT_HOME = 1,
|
||||
|
||||
NPC_TRIGGER = 15384
|
||||
};
|
||||
|
||||
@@ -125,29 +121,29 @@ struct boss_lady_vashj : public BossAI
|
||||
BossAI::JustEngagedWith(who);
|
||||
Talk(SAY_AGGRO);
|
||||
DoCastSelf(SPELL_REMOVE_TAINTED_CORES, true);
|
||||
|
||||
ScheduleSpells();
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon) override
|
||||
{
|
||||
summons.Summon(summon);
|
||||
switch (summon->GetEntry()) {
|
||||
case(WORLD_TRIGGER):
|
||||
switch (summon->GetEntry())
|
||||
{
|
||||
case WORLD_TRIGGER:
|
||||
summon->CastSpell(summon, SPELL_MAGIC_BARRIER);
|
||||
break;
|
||||
case(NPC_ENCHANTED_ELEMENTAL):
|
||||
case NPC_ENCHANTED_ELEMENTAL:
|
||||
summon->GetMotionMaster()->MoveFollow(me, 0.0f, 0.0f, MOTION_SLOT_ACTIVE, false);
|
||||
summon->SetWalk(true);
|
||||
summon->SetReactState(REACT_PASSIVE);
|
||||
break;
|
||||
case(NPC_TAINTED_ELEMENTAL):
|
||||
case NPC_TAINTED_ELEMENTAL:
|
||||
break;
|
||||
case(NPC_TOXIC_SPOREBAT):
|
||||
case NPC_TOXIC_SPOREBAT:
|
||||
summon->GetMotionMaster()->MoveRandom(30.0f);
|
||||
break;
|
||||
default:
|
||||
summon->GetMotionMaster()->MovePoint(POINT_HOME, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), true, true);
|
||||
summon->GetMotionMaster()->MovePoint(POINT_HOME, me->GetPosition());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,9 +178,8 @@ struct boss_lady_vashj : public BossAI
|
||||
void MovementInform(uint32 type, uint32 id) override
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE || id != POINT_HOME)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
me->AddUnitState(UNIT_STATE_ROOT);
|
||||
me->SetFacingTo(me->GetHomePosition().GetOrientation());
|
||||
instance->SetData(DATA_ACTIVATE_SHIELD, 0);
|
||||
@@ -232,9 +227,7 @@ struct boss_lady_vashj : public BossAI
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
context.Repeat(1s);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -246,19 +239,15 @@ struct boss_lady_vashj : public BossAI
|
||||
scheduler.Update(diff);
|
||||
|
||||
if (me->GetReactState() != REACT_AGGRESSIVE || !me->isAttackReady())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!me->IsWithinMeleeRange(me->GetVictim()))
|
||||
{
|
||||
me->resetAttackTimer();
|
||||
me->SetSheath(SHEATH_STATE_RANGED);
|
||||
me->CastSpell(me->GetVictim(), roll_chance_i(33) ? SPELL_MULTI_SHOT : SPELL_SHOOT, false);
|
||||
DoCastVictim(roll_chance_i(33) ? SPELL_MULTI_SHOT : SPELL_SHOOT);
|
||||
if (roll_chance_i(15))
|
||||
{
|
||||
Talk(SAY_BOWSHOT);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -280,42 +269,6 @@ private:
|
||||
std::chrono::seconds _batTimer;
|
||||
};
|
||||
|
||||
struct npc_tainted_elemental : public ScriptedAI
|
||||
{
|
||||
npc_tainted_elemental(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
scheduler.CancelAll();
|
||||
me->SetInCombatWithZone();
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
|
||||
{
|
||||
me->AddThreat(target, 1000.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{
|
||||
scheduler.Schedule(100ms, 500ms, [this](TaskContext context)
|
||||
{
|
||||
DoCastVictim(SPELL_POISON_BOLT);
|
||||
context.Repeat(2350ms, 2650ms);
|
||||
}).Schedule(15s, [this](TaskContext)
|
||||
{
|
||||
me->DespawnOrUnsummon();
|
||||
});
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
scheduler.Update(diff);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class spell_lady_vashj_magic_barrier : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_lady_vashj_magic_barrier);
|
||||
@@ -339,9 +292,7 @@ class spell_lady_vashj_remove_tainted_cores : public SpellScript
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
if (Player* target = GetHitPlayer())
|
||||
{
|
||||
target->DestroyItemCount(ITEM_TAINTED_CORE, -1, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -374,9 +325,7 @@ class spell_lady_vashj_spore_drop_effect : public SpellScript
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
target->CastSpell(target, SPELL_TOXIC_SPORES, true, nullptr, nullptr, GetCaster()->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -455,7 +404,6 @@ class spell_lady_vashj_summons : public SpellScript
|
||||
void AddSC_boss_lady_vashj()
|
||||
{
|
||||
RegisterSerpentShrineAI(boss_lady_vashj);
|
||||
RegisterSerpentShrineAI(npc_tainted_elemental);
|
||||
RegisterSpellScript(spell_lady_vashj_magic_barrier);
|
||||
RegisterSpellScript(spell_lady_vashj_remove_tainted_cores);
|
||||
RegisterSpellScript(spell_lady_vashj_summon_sporebat);
|
||||
|
||||
Reference in New Issue
Block a user