本文整理匯總了C++中AddSpellToCast函數的典型用法代碼示例。如果您正苦於以下問題:C++ AddSpellToCast函數的具體用法?C++ AddSpellToCast怎麽用?C++ AddSpellToCast使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了AddSpellToCast函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: UpdateAI
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
DoSpecialThings(diff, DO_COMBAT_N_SPEED, 200.0f, 1.6f);
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_HEAL:
{
AddSpellToCast(SPELL_HEAL, CAST_SELF);
events.ScheduleEvent(eventId, urand(10000, 35000));
break;
}
case EVENT_SHIELD:
{
AddSpellToCast(SPELL_GREATER_PW_SHIELD, CAST_SELF);
AddSpellToCast(SPELL_PRAYEROFHEALING, CAST_SELF);
events.ScheduleEvent(eventId, urand(30000, 40000));
break;
}
}
}
CastNextSpellIfAnyAndReady();
DoMeleeAttackIfReady();
}
示例2: UpdateAI
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (ShadowfuryTimer < diff)
{
if (me->IsWithinMeleeRange(me->getVictim()) && roll_chance_f(15))
{
AddSpellToCast(SPELL_SHADOW_FURY, CAST_NULL);
ShadowfuryTimer = 5000;
}
ShadowfuryTimer = 1500;
}
else
ShadowfuryTimer -= diff;
if (DarkstrikeTimer < diff)
{
if (!me->IsNonMeleeSpellCasted(false))
{
//If we are within range melee the target
if (me->IsWithinMeleeRange(me->getVictim()))
AddSpellToCast(SPELL_DARK_STRIKE, CAST_TANK);
}
DarkstrikeTimer = 1000;
}
else
DarkstrikeTimer -= diff;
CastNextSpellIfAnyAndReady();
}
示例3: UpdateAI
void UpdateAI(const uint32 diff)
{
if(!me->isInCombat())
if(yelltimer < diff)
{
me->Yell(RAND(YELL_OOC1,YELL_OOC2,YELL_OOC3,YELL_OOC4,YELL_OOC5,YELL_OOC6),0,0);
yelltimer = urand(60000,120000);
}
else
yelltimer -=diff;
if(!UpdateVictim())
return;
if(hamstringtimer < diff)
{
AddSpellToCast(SPELL_HAMSTRING);
hamstringtimer = 9000;
}
else
hamstringtimer -= diff;
if(headcracktimer < diff)
{
AddSpellToCast(SPELL_HEAD_CRACK,CAST_RANDOM);
headcracktimer = urand(20000,25000);
}
else
headcracktimer -= diff;
DoMeleeAttackIfReady();
CastNextSpellIfAnyAndReady(diff);
}
示例4: UpdateAI
void UpdateAI(const uint32 diff)
{
if(!me->IsNonMeleeSpellCasted(false) && !me->isInCombat())
{
if(OOCTimer < diff)
{
HandleOffCombatEffects();
OOCTimer = 10000;
}
else
OOCTimer -= diff;
}
if(!UpdateVictim())
return;
if(Drink_Timer < diff)
{
AddSpellToCast(SPELL_DRINK_FEL_INFUSION, CAST_SELF);
Drink_Timer = HeroicMode?urand(10000, 18000):urand(15000, 25000);
}
else
Drink_Timer -= diff;
if(Wretched_Strike_Timer < diff)
{
AddSpellToCast(m_creature->getVictim(), SPELL_WRETCHED_STRIKE);
Wretched_Strike_Timer = urand(7000, 16000);
}
else
Wretched_Strike_Timer -= diff;
CastNextSpellIfAnyAndReady(diff);
DoMeleeAttackIfReady();
}
示例5: UpdateAI
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (CheckTimer < diff)
{
if (!m_creature->IsWithinDistInMap(&wLoc, 20.0f))
EnterEvadeMode();
me->SetSpeed(MOVE_WALK, 1.5f, true);
me->SetSpeed(MOVE_RUN, 1.5f, true);
CheckTimer = 2000;
}
else
CheckTimer -= diff;
if (chargeTimer < diff)
{
Unit * target = SelectUnit(SELECT_TARGET_RANDOM, 0, 25.0f, true, 0, 8.0f);
if (target)
AddSpellToCast(target, AV_VO_CHARGE);
chargeTimer = urand(7500, 20000);
}
else
chargeTimer -= diff;
if (cleaveTimer < diff)
{
AddSpellToCast(AV_VO_CLEAVE, CAST_TANK);
cleaveTimer = urand(5000, 10000);
}
else
cleaveTimer -= diff;
if (demoShoutTimer < diff)
{
AddSpellToCast(AV_VO_DEMOSHOUT, CAST_NULL);
demoShoutTimer = urand(14000, 25000);
}
else
demoShoutTimer -= diff;
if (whirlwindTimer < diff)
{
AddSpellToCast(AV_VO_WHIRLWIND, CAST_SELF);
whirlwindTimer = urand(9000, 13000);
}
else
whirlwindTimer -= diff;
CastNextSpellIfAnyAndReady();
DoMeleeAttackIfReady();
}
示例6: UpdateAI
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
DoSpecialThings(diff, DO_EVERYTHING);
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_CORRUPTED_MIND:
{
AddSpellToCast(SPELL_CORRUPTED_MIND, CAST_NULL);
events.ScheduleEvent(EVENT_CORRUPTED_MIND, 62000);
break;
}
case EVENT_POISON_AURA:
{
AddSpellToCast(SPELL_POISON_AURA, CAST_NULL);
events.ScheduleEvent(EVENT_POISON_AURA, 12000);
break;
}
case EVENT_INEVITABLE_DOOM_5MIN:
{
inevitableTimer = 15000;
break;
}
case EVENT_INEVITABLE_DOOM:
{
AddSpellToCast(SPELL_INEVITABLE_DOOM, CAST_NULL);
events.ScheduleEvent(EVENT_INEVITABLE_DOOM, inevitableTimer);
break;
}
case EVENT_REMOVE_CURSE:
{
AddSpellToCast(SPELL_REMOVE_CURSE, CAST_SELF);
events.ScheduleEvent(EVENT_REMOVE_CURSE, 30000);
break;
}
case EVENT_SUMMON_SPORE:
{
for (uint8 i = 0; i < 3; ++i)
m_creature->SummonCreature(16286, SporesLocations[i][0], SporesLocations[i][1], SporesLocations[i][2], 0, TEMPSUMMON_TIMED_DESPAWN, 12000);
break;
}
default:
break;
}
}
CastNextSpellIfAnyAndReady();
DoMeleeAttackIfReady();
}
示例7: UpdateAI
void UpdateAI(const uint32 diff)
{
if (TransitionTimer)
{
if (TransitionTimer <= diff)
{
if(Unit* Muru = me->GetUnit(pInstance->GetData64(DATA_MURU)))
{
Muru->SetVisibility(VISIBILITY_OFF);
Muru->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
me->SetRooted(false);
AttackStart(me->getVictim());
DoCast(me, SPELL_NEGATIVE_ENERGY_PERIODIC_E);
TransitionTimer = 0;
}
else
TransitionTimer -= diff;
return;
}
if (!UpdateVictim())
return;
DoSpecialThings(diff, DO_COMBAT_N_EVADE, 100.0f);
if (EnrageTimer < diff)
{
AddSpellToCast(me, SPELL_ENRAGE);
EnrageTimer = 60000;
}
else
EnrageTimer -= diff;
if (DarknessTimer < diff)
{
if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0, 100, true))
AddSpellToCast(target, SPELL_DARKNESS);
DarknessTimer = 15000;
}
else
DarknessTimer -= diff;
if (BlackHole < diff)
{
if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0, 100, true, me->getVictimGUID(), 10.0))
AddSpellToCast(target, SPELL_BLACK_HOLE);
BlackHole = urand(15000, 18000);
}
else
BlackHole -= diff;
DoMeleeAttackIfReady();
CastNextSpellIfAnyAndReady();
}
示例8: UpdateAI
void UpdateAI(const uint32 diff)
{
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EMBERSEER_EVENT_GROWING:
{
me->CastSpell(me, SPELL_GROWING, true);
break;
}
case EMBERSEER_EVENT_TRANSFORM:
{
DoScriptText(-2100023, me);
DoScriptText(-2100024, me);
me->CastSpell(me, SPELL_TRANSFORM, true);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE);
events.SetPhase(2);
events.ScheduleEvent(EMBERSEER_EVENT_FIRENOVA, 6000, 0, 2);
events.ScheduleEvent(EMBERSEER_EVENT_FLAMEBUFFET, 3000, 0, 2);
events.ScheduleEvent(EMBERSEER_EVENT_PYROBLAST, 14000, 0, 2);
break;
}
case EMBERSEER_EVENT_FIRENOVA:
{
AddSpellToCast(SPELL_FIRENOVA, CAST_SELF);
events.ScheduleEvent(EMBERSEER_EVENT_FIRENOVA, 6000, 0, 2);
break;
}
case EMBERSEER_EVENT_FLAMEBUFFET:
{
AddSpellToCast(SPELL_FLAMEBUFFET, CAST_TANK);
events.ScheduleEvent(EMBERSEER_EVENT_FLAMEBUFFET, 3000, 0, 2);
break;
}
case EMBERSEER_EVENT_PYROBLAST:
{
AddSpellToCast(SPELL_PYROBLAST, CAST_RANDOM);
events.ScheduleEvent(EMBERSEER_EVENT_PYROBLAST, 14000, 0, 2);
break;
}
}
}
if (!UpdateVictim())
{
return;
}
CastNextSpellIfAnyAndReady();
DoMeleeAttackIfReady();
}
示例9: UpdateAI
void UpdateAI(const uint32 diff)
{
if(!UpdateVictim())
{
//UpdateAIOOC(diff); // not working in 100%
return;
}
if(Shout_Timer < diff)
{
AddSpellToCast(SPELL_FRIGHTENING_SHOUT, CAST_TANK);
Shout_Timer = urand(30000, 40000);
}
else
Shout_Timer -= diff;
if(Knockback_Timer < diff)
{
AddSpellToCast(SPELL_KNOCKBACK, CAST_TANK);
Knockback_Timer = urand(10000, 15000);
}
else
Knockback_Timer -= diff;
if(Execute_Timer < diff)
{
if(me->getVictim()->GetHealth() * 5 <= me->getVictim()->GetMaxHealth()) // below 20%
{
AddSpellToCast(SPELL_EXECUTE, CAST_TANK);
Execute_Timer = 30000;
}
}
else
Execute_Timer -= diff;
if(Cleave_Timer < diff)
{
AddSpellToCast(SPELL_MORTAL_CLEAVE, CAST_TANK);
Cleave_Timer = urand(3000, 6000);
}
else
Cleave_Timer -= diff;
if(!Frenzy_Casted && HealthBelowPct(50))
{
AddSpellToCast(SPELL_FRENZY, CAST_SELF);
Frenzy_Casted = true;
}
CastNextSpellIfAnyAndReady();
DoMeleeAttackIfReady();
}
示例10: UpdateAI
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
DoSpecialThings(diff, DO_EVERYTHING, 60.0f);
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_BLAU_MARK:
{
AddSpellToCast(SPELL_MARK_OF_BLAUMEUX, CAST_NULL);
events.ScheduleEvent(EVENT_BLAU_MARK, 12000);
break;
}
case EVENT_BLAU_VOID_ZONE:
{
if (Unit * tmpUnit = SelectUnit(SELECT_TARGET_RANDOM, 0, 45.0f))
AddSpellToCast(tmpUnit, SPELL_VOID_ZONE);
events.ScheduleEvent(EVENT_BLAU_VOID_ZONE, 12000);
break;
}
default:
break;
}
}
// Shield Wall - All 4 horsemen will shield wall at 50% hp and 20% hp for 20 seconds
if (!ShieldWall1)
{
if (HealthBelowPct(50))
{
AddSpellToCast(SPELL_SHIELDWALL, CAST_SELF);
ShieldWall1 = true;
}
}
else
{
if (!ShieldWall2 && HealthBelowPct(20))
{
AddSpellToCast(SPELL_SHIELDWALL, CAST_SELF);
ShieldWall2 = true;
}
}
CastNextSpellIfAnyAndReady();
DoMeleeAttackIfReady();
}
示例11: UpdateAI
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim() )
return;
if (checkTimer < diff)
{
if (!me->IsWithinDistInMap(&pos, 105.0f))
{
EnterEvadeMode();
return;
}
checkTimer = 3000;
}
else
checkTimer -= diff;
if (Rage_Timer < diff)
{
Creature* distiller = GetClosestCreatureWithEntry(me, 17954, 100);
if (distiller)
{
float x, y, z;
distiller->GetNearPoint(x, y, z, INTERACTION_DISTANCE);
me->GetMotionMaster()->MovePoint(1, x, y, z);
CurrentDistiller = distiller->GetGUID();
}
Rage_Timer = 15000+rand()%15000;
}else Rage_Timer -= diff;
//Reflection_Timer
if (Reflection_Timer < diff)
{
AddSpellToCast(me, SPELL_SPELL_REFLECTION);
Reflection_Timer = 15000+rand()%10000;
}else Reflection_Timer -= diff;
//Impale_Timer
if (Impale_Timer < diff)
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
AddSpellToCast(target,SPELL_IMPALE);
Impale_Timer = 7500+rand()%5000;
}else Impale_Timer -= diff;
CastNextSpellIfAnyAndReady();
DoMeleeAttackIfReady();
}
示例12: UpdateAI
void UpdateAI(const uint32 diff)
{
if(!UpdateVictim())
return;
if(HealingWard_Timer < diff)
{
AddSpellToCast(m_creature, SPELL_HEALING_WARD);
HealingWard_Timer = 30000;
}
else
HealingWard_Timer -= diff;
if(NovaTotem_Timer < diff)
{
AddSpellToCast(m_creature, SPELL_CORRUPTED_NOVA_TOTEM);
NovaTotem_Timer = 45000;
}
else
NovaTotem_Timer -= diff;
if(LightningBolt_Timer < diff)
{
if (HeroicMode)
AddCustomSpellToCast(m_creature->getVictim(), SPELL_LIGHTNING_BOLT,142,0,0);
else
AddCustomSpellToCast(m_creature->getVictim(), SPELL_LIGHTNING_BOLT,175,0,0);
LightningBolt_Timer = 10000;
}
else
LightningBolt_Timer -= diff;
if(EarthGrab_Timer < diff)
{
AddSpellToCast(m_creature, SPELL_EARTHGRAB_TOTEM);
EarthGrab_Timer = 30000;
}
else
EarthGrab_Timer -= diff;
if(StoneSkin_Timer < diff)
{
AddSpellToCast(m_creature, SPELL_STONESKIN_TOTEM);
StoneSkin_Timer = 60000;
}
else
StoneSkin_Timer -= diff;
CastNextSpellIfAnyAndReady(diff);
DoMeleeAttackIfReady();
}
示例13: DoMeleeAttackIfReady
void DoMeleeAttackIfReady()
{
if (me->hasUnitState(UNIT_STAT_CASTING) || m_submerged || m_rotating || RotType)
return;
//Make sure our attack is ready and we aren't currently casting before checking distance
if (me->isAttackReady())
{
//If we are within range melee the target
if (me->IsWithinMeleeRange(me->getVictim()))
{
me->AttackerStateUpdate(me->getVictim());
me->resetAttackTimer();
}
else
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 0, 5.0f, true))
{
me->AttackerStateUpdate(pTarget);
me->resetAttackTimer();
}
else
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0, 100.0f, true, 0, 5.0f))
AddSpellToCast(pTarget, SPELL_WATERBOLT);
else
EnterEvadeMode();
}
}
}
}
示例14: UpdateAI
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
//AmnenarsWrath_Timer
if (AmnenarsWrath_Timer <= diff)
{
AddSpellToCast(me->getVictim(),SPELL_AMNENNARSWRATH);
AmnenarsWrath_Timer = 12000;
}
else
AmnenarsWrath_Timer -= diff;
//FrostBolt_Timer
if (FrostBolt_Timer <= diff)
{
Unit *pTarget = NULL;
pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
if (pTarget)
AddSpellToCast(pTarget,SPELL_FROSTBOLT);
FrostBolt_Timer = 8000;
}
else
FrostBolt_Timer -= diff;
if (!Spectrals && me->GetHealth()*100 / me->GetMaxHealth() < 50)
{
DoYell(SAY_1, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_SUMMON);
Unit *pTarget = NULL;
pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
if (pTarget)
{
SummonSpectrals(pTarget);
SummonSpectrals(pTarget);
SummonSpectrals(pTarget);
}
Spectrals = true;
}
CastNextSpellIfAnyAndReady();
DoMeleeAttackIfReady();
}
示例15: UpdateAI
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
DoSpecialThings(diff, DO_EVERYTHING, 120.0f);
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_IMPALE:
{
//Cast Impale on a random target
//Do NOT cast it when we are afflicted by locust swarm
if (!m_creature->HasAura(SPELL_LOCUSTSWARM,1))
AddSpellToCast(SPELL_IMPALE, CAST_RANDOM);
events.ScheduleEvent(EVENT_IMPALE, 15000);
break;
}
case EVENT_SWARM:
{
AddSpellToCast(SPELL_LOCUSTSWARM, CAST_SELF);
events.ScheduleEvent(EVENT_SWARM, 90000);
break;
}
case EVENT_SUMMON:
{
AddSpellToCast(SPELL_SUMMONGUARD, CAST_SELF);
events.ScheduleEvent(EVENT_SUMMON, 45000);
break;
}
default:
break;
}
}
CastNextSpellIfAnyAndReady();
DoMeleeAttackIfReady();
}