*Fix a problem that freeze the server in boss Eck the Ferocious' script. Maybe this fix a crash.

--HG--
branch : trunk
This commit is contained in:
Anubisss
2009-09-27 18:02:57 +02:00
parent 23d7fa65e8
commit 82ae128317

View File

@@ -71,12 +71,12 @@ struct TRINITY_DLL_DECL boss_eckAI : public ScriptedAI
} else uiSpitTimer -= diff;
if (uiSpringTimer < diff)
{
Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
while (pTarget && (pTarget->GetTypeId() != TYPEID_PLAYER || pTarget == m_creature->getVictim()))
pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
if (pTarget)
Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,1);
if(pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
{
DoCast(pTarget,RAND(SPELL_ECK_SPRING_1,SPELL_ECK_SPRING_2));
uiSpringTimer = 5000 + rand()%10000;
uiSpringTimer = 5000 + rand()%10000;
}
} else uiSpringTimer -= diff;
//Berserk on timer or 20% of health
if (!bBerserk && (uiBerserkTimer < diff || m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 20))