本文整理汇总了C++中ExecuteEvent函数的典型用法代码示例。如果您正苦于以下问题:C++ ExecuteEvent函数的具体用法?C++ ExecuteEvent怎么用?C++ ExecuteEvent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ExecuteEvent函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateAI
void UpdateAI(uint32 const diff)
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STAT_CASTING))
return;
if (_banished)
{
// If all three shades are dead, OR it has taken too long, end the current event and get Taerar back into business
if (_banishedTimer <= diff || !_shades)
{
_banished = false;
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NON_ATTACKABLE);
me->RemoveAurasDueToSpell(SPELL_SHADE);
me->SetReactState(REACT_AGGRESSIVE);
}
// _banishtimer has not expired, and we still have active shades:
else
_banishedTimer -= diff;
return;
}
while (uint32 eventId = events.ExecuteEvent())
ExecuteEvent(eventId);
DoMeleeAttackIfReady();
}
示例2: ExecuteEvent
void ExclusivePoolMgr::CheckEvents()
{
for (std::pair<const uint32, ExclusivePool>& poolPair : m_pools)
{
ExclusivePool& pool = poolPair.second;
if (pool.currentRespawnTime <= time(nullptr))
ExecuteEvent(pool);
}
}
示例3: while
void WorldBossAI::UpdateAI(uint32 const diff)
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STAT_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
ExecuteEvent(eventId);
}
示例4: while
void BossAI::UpdateAI(uint32 const diff)
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
ExecuteEvent(eventId);
DoMeleeAttackIfReady();
}
示例5: UpdateAI
void UpdateAI(uint32 const diff)
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STAT_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
ExecuteEvent(eventId);
if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 0, -50.0f, true))
DoCast(target, SPELL_SUMMON_PLAYER);
DoMeleeAttackIfReady();
}
示例6: UpdateAI
void UpdateAI(auint32 diff) // (uint32 diff)
{
if(!UbdateVictim()) // !UpdateVictim
return;
event.Update(diff); //events.Update(diff)
while(uint32 eventID = events* ExecuteEvent()) // events.ExecuteEvent()
{
switch(eventID)
{
case DRAIN_ESENCE; // case EVENT_DRAIN_ESENCE:
if (!me->isInCombat())
if(Unit* target = me->FindNearestCreature(npcID, distance)) // a jeje... distance v yardech for example 100.0f
DoCast (target, SPELL_DRAIN_ESENCE);
return false; // wtf? break;
case EVENT_DARK_COMMAND;
if(Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
if(!Heroic()) //If(!IsHeroic())
DoCast(target, SPELL_DARK_COMMAND);
else
DoCast(target, DARK_COMMAND_H);
}
events.RescheduleEvent(EVENT_DARK_COMMAND, 20000);
break;
case EVENT_AURA_OF_ACCELERATION;
DoCast(SPELL_AURA_OF_ACCELERATION)
break;
}
}
DoMeleeAttackIfReady();
}
示例7: UpdateAI
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim() && !events.IsInPhase(PHASE_EVENT))
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
ExecuteEvent(eventId);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
}
DoMeleeAttackIfReady();
}
示例8: UpdateAI
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
ExecuteEvent(eventId);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
}
DoSpellAttackIfReady(SPELL_EMPOWERED_SMITE);
}
示例9: UpdateAdventure
void UpdateAdventure(void)
{
if(!adventureWindowVisible)
return;
if(IsBattleForced())
{
INFO_LOG("Triggering forced battle.");
ShowBattleWindow();
return;
}
#if EVENT_CHANCE_SCALING
++ticksSinceLastEvent;
#endif
if(updateDelay > 0 && !GetFastMode())
{
--updateDelay;
return;
}
ExecuteEvent(ComputeRandomEvent_inline(baseChanceOfEvent, ticksSinceLastEvent, chances, sizeof(chances), GetFastMode()));
LoadRandomDungeonImage();
}
示例10: ExecuteEvent
bool NFActorModule::Execute()
{
ExecuteEvent();
return true;
}
示例11: while
void IICHANEventAllocator::Process()
{
if(current_time - _tick >= 1000)
{
_time++;
_tick = current_time;
}
int i = 0;
while(i < _count)
{
if(events[i]->solved)
{
delete events[i];
events.erase(events.begin() + i);
_count--;
continue;
}
else
{
EVENT* e = events[i];
if(e)
{
if(e->condition == EVENT_CONDITION_TIME_ELAPSED)
{
if(e->condition_param == _time)
{
ExecuteEvent(e);
e->solved = true;
}
}
else if(e->condition == EVENT_CONDITION_HERO_X_GR)
{
if(GetItemAllocator())
{
if(GetItemAllocator()->GetFirstPlayer())
{
if(GetItemAllocator()->GetFirstPlayer()->GetSprite())
{
if(GetItemAllocator()->GetFirstPlayer()->
GetSprite()->GetX() > e->condition_param)
{
ExecuteEvent(e);
e->solved = true;
}
}
else
WriteToLog("Event error: Player sprite does not exist");
}
else
WriteToLog("Event error: Player does not exist");
}
else
WriteToLog("Event error: Item Allocator does not exist");
}
else if(e->condition == EVENT_CONDITION_ID_X_GR)
{
if(GetItemAllocator())
{
int id = e->action_param_int;
CHARACTER* enemy = (CHARACTER*)GetItemAllocator()->GetItem(id);
if(enemy)
{
ANIMATEDSPRITE* sprite = enemy->GetSprite();
if(sprite)
if(sprite->GetX() > e->condition_param)
{
ExecuteEvent(e);
e->solved = true;
}
}
else
WriteToLog("Event error: Character sprite does not exist");
}
else
WriteToLog("Event error: Item Allocator does not exist");
}
else if(e->condition == EVENT_CONDITION_ID_X_EQ)
{
if(GetItemAllocator())
{
int id = e->action_param_int;
CHARACTER* enemy = (CHARACTER*)GetItemAllocator()->GetItem(id);
if(enemy)
{
ANIMATEDSPRITE* sprite = enemy->GetSprite();
if(sprite)
if(sprite->GetX() == e->condition_param)
{
ExecuteEvent(e);
e->solved = true;
}
}
else
WriteToLog("Event error: Character sprite does not exist");
}
else
WriteToLog("Event error: Item Allocator does not exist");
}
}
//.........这里部分代码省略.........
示例12: ForceEvent
void ForceEvent(void)
{
PopMenu();
ExecuteEvent(ComputeRandomEvent_inline(baseChanceOfEvent, ticksSinceLastEvent, chances, sizeof(chances), true));
}