fix(Scripts/DB): Jiklik's bats from phase 2 now won't engage players… (#8142)
This commit is contained in:
@@ -0,0 +1,6 @@
|
|||||||
|
INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1632863354170415400');
|
||||||
|
|
||||||
|
UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=14965;
|
||||||
|
|
||||||
|
UPDATE `creature_template` SET `ScriptName`='npc_batrider' WHERE `entry`=14965;
|
||||||
|
|
||||||
@@ -221,6 +221,7 @@ public:
|
|||||||
{
|
{
|
||||||
Bomb_Timer = 2000;
|
Bomb_Timer = 2000;
|
||||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||||
|
me->AddUnitState(UNIT_STATE_ROOT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnterCombat(Unit* /*who*/) override { }
|
void EnterCombat(Unit* /*who*/) override { }
|
||||||
@@ -232,16 +233,25 @@ public:
|
|||||||
|
|
||||||
if (Bomb_Timer <= diff)
|
if (Bomb_Timer <= diff)
|
||||||
{
|
{
|
||||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
std::list<Unit*> targets;
|
||||||
|
SelectTargetList(targets, 1, SELECT_TARGET_RANDOM, 500.0f, true);
|
||||||
|
if (!targets.empty())
|
||||||
{
|
{
|
||||||
DoCast(target, SPELL_BOMB);
|
if (targets.size() > 1)
|
||||||
Bomb_Timer = 5000;
|
{
|
||||||
|
targets.resize(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (std::list<Unit*>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
|
||||||
|
{
|
||||||
|
me->CastSpell((*itr), SPELL_BOMB);
|
||||||
|
}
|
||||||
|
|
||||||
|
Bomb_Timer = 7000;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
Bomb_Timer -= diff;
|
Bomb_Timer -= diff;
|
||||||
|
|
||||||
DoMeleeAttackIfReady();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user