Core/Shared: Move container functions to shared project under Trinity::Container namespace. Also implement RandomResizeList which takes a predicate function as parameter.

Core/ScriptedAI: Extend SummonList::DoAction to take a predicate function as parameter and allow specifying a maximum number of units to be selected.
This commit is contained in:
Machiavelli
2012-04-08 17:40:05 +02:00
parent e636531da3
commit bc96df1aae
33 changed files with 153 additions and 82 deletions
@@ -139,7 +139,7 @@ class boss_emalon : public CreatureScript
case EVENT_OVERCHARGE:
if (!summons.empty())
{
Creature* minion = Unit::GetCreature(*me, SelectRandomContainerElement(summons));
Creature* minion = Unit::GetCreature(*me, Trinity::Containers::SelectRandomContainerElement(summons));
if (minion && minion->isAlive())
{
minion->CastSpell(me, SPELL_OVERCHARGED, true);