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
@@ -134,7 +134,8 @@ public:
if (!phase || phase == PHASE_CHASE)
{
phase = PHASE_STRIKE;
summons.DoAction(EVENT_VOLCANO, 0);
DummyEntryCheckPredicate pred;
summons.DoAction(EVENT_VOLCANO, pred);
events.ScheduleEvent(EVENT_HATEFUL_STRIKE, 5000, GCD_CAST, PHASE_STRIKE);
me->SetSpeed(MOVE_RUN, 1.2f);
me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false);
+1 -1
View File
@@ -812,7 +812,7 @@ public:
}
if (!UnitsWithMana.empty())
{
DoCast(SelectRandomContainerElement(UnitsWithMana), SPELL_MANA_BURN);
DoCast(Trinity::Containers::SelectRandomContainerElement(UnitsWithMana), SPELL_MANA_BURN);
ManaBurnTimer = 8000 + (rand() % 10 * 1000); // 8-18 sec cd
}
else