*Fix a typo in Thaddius script that make he not berserk.

*Update Heigan script so that players outside the room will be teleported in when eruption happens.
Thanks to cryingcloud.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-05-26 19:55:41 -05:00
parent fa9bfed91f
commit 9624f6e099
4 changed files with 13 additions and 1 deletions
@@ -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<HostilReference*> &m_threatlist = me->getThreatManager().getThreatList();
for(std::list<HostilReference*>::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)
@@ -233,6 +233,7 @@ struct TRINITY_DLL_DECL BossAI : public ScriptedAI
return false;
}
bool CheckBoundary(Unit *who);
void TeleportCheaters();
};
#endif
@@ -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;
@@ -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;
}
}