Misc/Util: Add a template function for returning a random element from any container
This commit is contained in:
@@ -104,14 +104,7 @@ class boss_sulfuron : public CreatureScript
|
||||
Creature* target = NULL;
|
||||
std::list<Creature*> healers = DoFindFriendlyMissingBuff(45.0f, SPELL_INSPIRE);
|
||||
if (!healers.empty())
|
||||
{
|
||||
std::list<Creature*>::const_iterator itr = healers.begin();
|
||||
std::advance(itr, urand(0, healers.size()-1));
|
||||
target = *itr;
|
||||
}
|
||||
|
||||
if (target)
|
||||
DoCast(target, SPELL_INSPIRE);
|
||||
DoCast(SelectRandomContainerElement(healers), SPELL_INSPIRE);
|
||||
|
||||
DoCast(me, SPELL_INSPIRE);
|
||||
events.ScheduleEvent(EVENT_INSPIRE, urand(20000, 26000));
|
||||
|
||||
Reference in New Issue
Block a user