本文整理汇总了C++中DoSpellAttackIfReady函数的典型用法代码示例。如果您正苦于以下问题:C++ DoSpellAttackIfReady函数的具体用法?C++ DoSpellAttackIfReady怎么用?C++ DoSpellAttackIfReady使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DoSpellAttackIfReady函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateAI
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED))
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_CONJURE_FIRE:
if (summons.size() >= RAID_MODE<uint64>(2, 4))
break;
DoCast(me, SPELL_CONJURE_FIRE, true);
events.ScheduleEvent(EVENT_CONJURE_FIRE, 15s, 20s);
break;
case EVENT_MELT_ICE:
if (Creature* FlashFreeze = me->FindNearestCreature(NPC_FLASH_FREEZE, 50.0f, true))
DoCast(FlashFreeze, SPELL_MELT_ICE, true);
events.ScheduleEvent(EVENT_MELT_ICE, 10s, 15s);
break;
}
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
}
DoSpellAttackIfReady(SPELL_FIREBALL);
}
示例2: UpdateAI
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
DoSpellAttackIfReady(SPELL_CHAIN_LIGHTNING);
}
示例3: DoSpellAttackIfReady
void TurretAI::UpdateAI(uint32 /*diff*/)
{
if (!UpdateVictim())
return;
DoSpellAttackIfReady(me->m_spells[0]);
}
示例4: UpdateAI
void UpdateAI(uint32 /*diff*/) override
{
if (!UpdateVictim())
return;
DoSpellAttackIfReady(SPELL_ERUPTION);
}
示例5: UpdateAI
void UpdateAI(uint32 const diff)
{
if (!UpdateVictim() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED))
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_CONJURE_FIRE:
if (summons.size() >= RAID_MODE<uint64>(2, 4))
break;
// The fire is gets positioned at a random coordinate.
DoCast(me, SPELL_CONJURE_FIRE, true);
events.ScheduleEvent(EVENT_CONJURE_FIRE, urand(15*IN_MILLISECONDS, 20*IN_MILLISECONDS));
return;
case EVENT_MELT_ICE:
if (Creature* FlashFreeze = me->FindNearestCreature(NPC_FLASH_FREEZE, 50.0f, true))
DoCast(FlashFreeze, SPELL_MELT_ICE, true);
events.ScheduleEvent(EVENT_MELT_ICE, urand(10*IN_MILLISECONDS, 15*IN_MILLISECONDS));
return;
default:
return;
}
}
DoSpellAttackIfReady(SPELL_FIREBALL);
}
示例6: UpdateAI
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim())
return;
DoSpellAttackIfReady(DUNGEON_MODE(CLAW_PUNCTURE,CLAW_PUNCTURE_H));
}
示例7: DoSpellAttackIfReady
void ArchorAI::UpdateAI(const uint32 /*diff*/) {
if (!UpdateVictim())
return;
if (!me->IsWithinCombatRange(me->getVictim(), m_minRange))
DoSpellAttackIfReady(me->m_spells[0]);
else
DoMeleeAttackIfReady();
}
示例8: DoSpellAttackIfReady
void TurretAI::UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
DoSpellAttackIfReady(me->m_spells[0]);
//if (!DoSpellAttackIfReady(me->m_spells[0]))
//if (HostileReference *ref = me->getThreatManager().getCurrentVictim())
//ref->removeReference();
}
示例9: UpdateAI
void UpdateAI(uint32 diff) override
{
// Only update events if Millhouse is aggressive
if (me->GetReactState() != REACT_AGGRESSIVE)
return;
events.Update(diff);
// Impending Doom is exception because it needs to be interrupted.
if (me->HasUnitState(UNIT_STATE_CASTING) && !me->GetCurrentSpell(SPELL_IMPENDING_DOOM))
return;
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_FROSTBOLT_VOLLEY:
DoCast(SPELL_FROSTBOLT_VOLLEY);
events.ScheduleEvent(EVENT_FROSTBOLT_VOLLEY, 7000);
break;
case EVENT_SHADOWFURY:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
DoCast(target, SPELL_SHADOWFURY);
events.ScheduleEvent(EVENT_SHADOWFURY, 7000);
break;
case EVENT_FEAR:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
DoCast(target, SPELL_FEAR);
events.ScheduleEvent(EVENT_FEAR, 18000);
break;
case EVENT_READY_FOR_COMBAT:
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
me->SetReactState(REACT_AGGRESSIVE);
ScheduleEvents();
break;
case EVENT_CAST_IMPENDING_DOOM:
DoCast(SPELL_IMPENDING_DOOM);
DoCast(SPELL_IMPENDING_DOOM_CHANNEL);
events.ScheduleEvent(EVENT_INTERRUPT_IMPENDING_DOOM, urand(15000,20000));
break;
case EVENT_INTERRUPT_IMPENDING_DOOM:
me->InterruptNonMeleeSpells(true);
me->RemoveAllAuras();
me->HandleEmoteCommand(EMOTE_ONESHOT_KNOCKDOWN);
events.ScheduleEvent(EVENT_CAST_IMPENDING_DOOM, 3000);
break;
default:
break;
}
}
DoSpellAttackIfReady(SPELL_SHADOW_BOLT);
}
示例10: UpdateAI
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim())
return;
// Shadow Burst ad area e reset threat
if (BurstTimer <= uiDiff)
{
me->InterruptNonMeleeSpells(false);
me->DeleteThreatList();
DoCast(me->GetVictim(), SHADOW_BURST);
BurstTimer = urand(25000,35000);
} else BurstTimer -= uiDiff;
// Storm of Grief ogni 20 sec colpisce ad area
if (GriefTimer <= uiDiff)
{
me->InterruptNonMeleeSpells(false);
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0))
DoCast(pTarget, STORM_OF_GRIEF);
GriefTimer = 20000;
} else GriefTimer -= uiDiff;
// Ogni 10 sec casta Piercing Shadow sul target a maggior aggro dopo il tank
if (PiercingTimer <= uiDiff)
{
me->InterruptNonMeleeSpells(false);
if (Unit *pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO,0))
DoCast(pTarget, PIERCING_SHADOW);
PiercingTimer = 10000;
} else PiercingTimer -= uiDiff;
// Ogni 15 sec casta Shadow Flame che fa danno a cono
if (FlameTimer <= uiDiff)
{
me->InterruptNonMeleeSpells(false);
DoCastAOE(SHADOW_FLAME);
FlameTimer = 15000;
} else FlameTimer -= uiDiff;
// Ogni 45 sec casta Harvest Soul su tutto il raid
if (HarvestTimer <= uiDiff)
{
me->InterruptNonMeleeSpells(false);
me->MonsterYell(SAY_PEROTHARN_SOUL, LANG_UNIVERSAL, 0);
DoCastAOE(HARVEST_SOUL);
HarvestTimer = 45000;
} else HarvestTimer -= uiDiff;
DoSpellAttackIfReady(SHADOW_BOLT);
}
示例11: UpdateAI
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim())
return;
if (StarlightTimer <= uiDiff)
{
DoCast(me, SPELL_STARLIGHT);
StarlightTimer = urand(25000, 35000);
}
else StarlightTimer -= uiDiff;
DoSpellAttackIfReady(SPELL_WRATH);
}
示例12: UpdateAI
void UpdateAI(const uint32 diff)
{
if (tSeek <= diff)
{
if ((me->isAlive()) && (!me->isInCombat() && (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) <= 1.0f)))
if (Creature* enemy = me->FindNearestCreature(NPC_BLOODFANG_WORGEN, 5.0f, true))
me->AI()->AttackStart(enemy); //She should really only grab agro when npc Cleese is not there, so we will keep this range small
tSeek = urand(1000, 2000); //optimize cpu load, seeking only sometime between 1 and 2 seconds
}
else tSeek -= diff;
if (!UpdateVictim())
return;
if (dmgCount < 2)
DoSpellAttackIfReady(SPELL_FROSTBOLT_VISUAL_ONLY); //Dummy spell, visual only to prevent getting agro (Blizz-like)
}
示例13: UpdateAI
void UpdateAI(const uint32 diff)
{
if(!me->isInCombat())
return;
if(me->getThreatManager().isThreatListEmpty())
{
EnterEvadeMode();
return;
}
events.Update(diff);
if(me->hasUnitState(UNIT_STAT_CASTING))
return;
uint32 eventId = events.GetEvent();
if(!me->getVictim())
eventId = EVENT_PURSUE;
switch(eventId)
{
case 0:
return;
case EVENT_PURSUE:
DoCastAOE(SPELL_PURSUED);
events.RepeatEvent(35000);
return;
case EVENT_MISSILE:
//TODO: without unittarget no visual effect
//DoCastAOE(SPELL_MISSILE_BARRAGE);
DoCast(me->getVictim(), SPELL_MISSILE_BARRAGE);
events.RepeatEvent(1500);
return;
case EVENT_VENT:
DoCastAOE(SPELL_FLAME_VENTS);
events.RepeatEvent(20000);
return;
default:
events.PopEvent();
break;
}
DoSpellAttackIfReady(SPELL_BATTERING_RAM);
}
示例14: 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);
}
示例15: UpdateAI
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
if (_phase == 0 && !CheckGuardAlive())
{
_phase = 1;
me->SetCanDualWield(true);
DoCast(me, SPELL_WINDFURY, true);
}
scheduler.Update(diff, [this]
{
if (_phase == 1)
DoSpellAttackIfReady(SPELL_STORMSTRIKE);
else
DoMeleeAttackIfReady();
});
}