diff --git a/src/bindings/scripts/include/sc_creature.cpp b/src/bindings/scripts/include/sc_creature.cpp index 3e7a1a3987..aa2a3fbf32 100644 --- a/src/bindings/scripts/include/sc_creature.cpp +++ b/src/bindings/scripts/include/sc_creature.cpp @@ -644,6 +644,16 @@ void BossAI::_EnterCombat() instance->SetBossState(bossId, IN_PROGRESS); } +void BossAI::TeleportCheaters() +{ + float x, y, z; + me->GetPosition(x, y, z); + std::list &m_threatlist = me->getThreatManager().getThreatList(); + for(std::list::iterator itr = m_threatlist.begin(); itr!= m_threatlist.end(); ++itr) + if((*itr)->getTarget()->GetTypeId() == TYPEID_PLAYER && !CheckBoundary((*itr)->getTarget())) + (*itr)->getTarget()->NearTeleportTo(x, y, z, 0); +} + bool BossAI::CheckBoundary(Unit *who) { if(!boundary || !who) diff --git a/src/bindings/scripts/include/sc_creature.h b/src/bindings/scripts/include/sc_creature.h index 95bcadacee..6208d10c39 100644 --- a/src/bindings/scripts/include/sc_creature.h +++ b/src/bindings/scripts/include/sc_creature.h @@ -233,6 +233,7 @@ struct TRINITY_DLL_DECL BossAI : public ScriptedAI return false; } bool CheckBoundary(Unit *who); + void TeleportCheaters(); }; #endif diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_heigan.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_heigan.cpp index 06fdec1520..38071251b7 100644 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_heigan.cpp +++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_heigan.cpp @@ -117,6 +117,7 @@ struct TRINITY_DLL_DECL boss_heiganAI : public BossAI return; case EVENT_ERUPT: instance->SetData(DATA_HEIGAN_ERUPT, eruptSection); + TeleportCheaters(); if(eruptSection == 0) eruptDirection = true; diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_thaddius.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_thaddius.cpp index f9f4d7edac..941fe420ed 100644 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_thaddius.cpp +++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_thaddius.cpp @@ -116,7 +116,7 @@ struct TRINITY_DLL_DECL boss_thaddiusAI : public BossAI events.ScheduleEvent(EVENT_CHAIN, 10000+rand()%10000); return; case EVENT_BERSERK: - DoCast(me, EVENT_BERSERK); + DoCast(me, SPELL_BERSERK); return; } }