fix(Scripts/Scholomance): Darkmaster Gandling crash (#10546)
* fix(Scripts/Scholomance): Darkmaster Gandling crash * Update boss_darkmaster_gandling.cpp * Update boss_darkmaster_gandling.cpp * Update boss_darkmaster_gandling.cpp Co-authored-by: Skjalf <47818697+Nyeriah@users.noreply.github.com> Co-authored-by: UltraNix <80540499+UltraNix@users.noreply.github.com>
This commit is contained in:
@@ -296,15 +296,17 @@ public:
|
|||||||
void SpellHitTarget(Unit* target, SpellInfo const* spellinfo) override
|
void SpellHitTarget(Unit* target, SpellInfo const* spellinfo) override
|
||||||
{
|
{
|
||||||
uint32 room = 0;
|
uint32 room = 0;
|
||||||
if (spellinfo && spellinfo->Id == SPELL_SHADOW_PORTAL && target && me->GetVictim())
|
if (spellinfo && spellinfo->Id == SPELL_SHADOW_PORTAL && target)
|
||||||
{
|
{
|
||||||
room = GetData(GANDLING_ROOM_TO_USE);
|
room = GetData(GANDLING_ROOM_TO_USE);
|
||||||
SetGate(room, CLOSED);
|
SetGate(room, CLOSED);
|
||||||
SpawnMobsInRoom(room);
|
SpawnMobsInRoom(room);
|
||||||
DoCast(target, GandlingPortalSpells[room], true); // needs triggered somehow.
|
DoCast(target, GandlingPortalSpells[room], true); // needs triggered somehow.
|
||||||
if (target->GetGUID() == me->GetVictim()->GetGUID())
|
|
||||||
|
auto victim = me->GetVictim();
|
||||||
|
if (victim && (target->GetGUID() == victim->GetGUID()))
|
||||||
{
|
{
|
||||||
me->AddThreat(me->GetVictim(), -1000000); // drop current player, add a ton to second. This should guarantee that we don't end up with both 1 and 2 in a cage...
|
me->AddThreat(victim, -1000000); // drop current player, add a ton to second. This should guarantee that we don't end up with both 1 and 2 in a cage...
|
||||||
if (Unit* newTarget = SelectTarget(SelectTargetMethod::MaxThreat, 1, 200.0f)) // search in whole room
|
if (Unit* newTarget = SelectTarget(SelectTargetMethod::MaxThreat, 1, 200.0f)) // search in whole room
|
||||||
{
|
{
|
||||||
me->AddThreat(newTarget, 1000000);
|
me->AddThreat(newTarget, 1000000);
|
||||||
|
|||||||
Reference in New Issue
Block a user