*Fix the bug that hexlord causes crash.

--HG--
branch : trunk
This commit is contained in:
megamage
2008-12-05 18:55:32 -06:00
parent 824ca42c50
commit 8c24dd2031
@@ -467,8 +467,8 @@ struct TRINITY_DLL_DECL boss_thurgAI : public boss_hexlord_addAI
std::list<Creature*> templist = DoFindFriendlyMissingBuff(50, SPELL_BLOODLUST); std::list<Creature*> templist = DoFindFriendlyMissingBuff(50, SPELL_BLOODLUST);
if(!templist.empty()) if(!templist.empty())
{ {
Unit* target = *(templist.begin()); if(Unit* target = *(templist.begin()))
m_creature->CastSpell(target, SPELL_BLOODLUST, false); m_creature->CastSpell(target, SPELL_BLOODLUST, false);
} }
bloodlust_timer = 12000; bloodlust_timer = 12000;
}else bloodlust_timer -= diff; }else bloodlust_timer -= diff;
@@ -548,11 +548,11 @@ struct TRINITY_DLL_DECL boss_alyson_antilleAI : public boss_hexlord_addAI
{ {
if(rand()%2) if(rand()%2)
{ {
Unit* target = DoSelectLowestHpFriendly(50, 0); if(Unit* target = DoSelectLowestHpFriendly(50, 0))
m_creature->CastSpell(target, SPELL_DISPEL_MAGIC, false); m_creature->CastSpell(target, SPELL_DISPEL_MAGIC, false);
} }
else else if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
m_creature->CastSpell(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DISPEL_MAGIC, false); m_creature->CastSpell(target, SPELL_DISPEL_MAGIC, false);
} }
flashheal_timer = 2500; flashheal_timer = 2500;
}else flashheal_timer -= diff; }else flashheal_timer -= diff;
@@ -737,8 +737,8 @@ struct TRINITY_DLL_DECL boss_slitherAI : public boss_hexlord_addAI
if (venomspit_timer < diff) if (venomspit_timer < diff)
{ {
Unit* victim = SelectUnit(SELECT_TARGET_RANDOM, 0); if(Unit* victim = SelectUnit(SELECT_TARGET_RANDOM, 0))
m_creature->CastSpell(victim,SPELL_VENOM_SPIT, false); m_creature->CastSpell(victim,SPELL_VENOM_SPIT, false);
venomspit_timer = 2500; venomspit_timer = 2500;
}else venomspit_timer -= diff; }else venomspit_timer -= diff;
@@ -810,8 +810,8 @@ struct TRINITY_DLL_DECL boss_koraggAI : public boss_hexlord_addAI
} }
if (coldstare_timer < diff) if (coldstare_timer < diff)
{ {
Unit* victim = SelectUnit(SELECT_TARGET_RANDOM, 0); if(Unit* victim = SelectUnit(SELECT_TARGET_RANDOM, 0))
m_creature->CastSpell(victim,SPELL_COLD_STARE, false); m_creature->CastSpell(victim,SPELL_COLD_STARE, false);
coldstare_timer = 12000; coldstare_timer = 12000;
} }