本文整理汇总了C++中DoCastSelf函数的典型用法代码示例。如果您正苦于以下问题:C++ DoCastSelf函数的具体用法?C++ DoCastSelf怎么用?C++ DoCastSelf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DoCastSelf函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ExecuteEvent
void ExecuteEvent(uint32 eventId) override
{
switch (eventId)
{
case EVENT_FLAMESTRIKE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_FLAMESTRIKE);
Talk(SAY_COUNCIL_SPECIAL);
events.Repeat(Seconds(40));
break;
case EVENT_BLIZZARD:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_BLIZZARD);
events.Repeat(Seconds(15), Seconds(40));
break;
case EVENT_ARCANE_EXPLOSION_CHECK:
_canUseArcaneExplosion = true;
break;
case EVENT_ARCANE_EXPLOSION:
if (_canUseArcaneExplosion && SelectTarget(SELECT_TARGET_RANDOM, 0, 10.0f))
{
DoCastSelf(SPELL_ARCANE_EXPLOSION);
_canUseArcaneExplosion = false;
events.ScheduleEvent(EVENT_ARCANE_EXPLOSION_CHECK, Seconds(5));
}
events.Repeat(Seconds(1));
break;
case EVENT_DAMPEN_MAGIC:
DoCastSelf(SPELL_DAMPEN_MAGIC);
break;
default:
break;
}
}
示例2: UpdateAI
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_SOUL_DRAIN:
DoCastSelf(SPELL_SOUL_DRAIN, { SPELLVALUE_MAX_TARGETS, 5 });
events.Repeat(Seconds(30), Seconds(35));
break;
case EVENT_FRENZY:
Talk(SUFF_SAY_ENRAGE);
DoCastSelf(SPELL_FRENZY);
events.Repeat(Seconds(45), Seconds(50));
break;
default:
break;
}
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
}
DoMeleeAttackIfReady();
}
示例3: Emerge
void Emerge()
{
me->UpdateSpeed(MOVE_RUN);
uint32 submergeSpell = wasMobile ? SPELL_SUBMERGE : SPELL_SUBMERGE_2;
me->RemoveAurasDueToSpell(submergeSpell);
me->RemoveAurasDueToSpell(SPELL_GROUND_VISUAL_0);
DoCastSelf(SPELL_EMERGE);
DoCastAOE(SPELL_HATE_TO_ZERO, true);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
me->SetReactState(REACT_AGGRESSIVE);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
AttackStart(target);
// if the worm was mobile before submerging, make him stationary now
if (wasMobile)
{
me->SetControlled(true, UNIT_STATE_ROOT);
me->SetDisplayId(modelStationary);
DoCastSelf(SPELL_GROUND_VISUAL_1, true);
events.SetPhase(PHASE_STATIONARY);
}
else
{
if (Unit* target = me->GetVictim())
me->GetMotionMaster()->MoveChase(target);
me->SetDisplayId(modelMobile);
events.SetPhase(PHASE_MOBILE);
}
wasMobile = !wasMobile;
ScheduleTasks();
}
示例4: Submerge
void Submerge()
{
me->SetReactState(REACT_PASSIVE);
me->AttackStop();
if (wasMobile)
{
me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE);
DoCastSelf(SPELL_SUBMERGE);
me->SetSpeedRate(MOVE_RUN, 8.0f);
DoCastSelf(SPELL_GROUND_VISUAL_0, true);
events.SetPhase(PHASE_SUBMERGED);
events.ScheduleEvent(EVENT_EMERGE, 5s, 0, PHASE_SUBMERGED);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
}
else
{
me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE);
DoCastSelf(SPELL_SUBMERGE_2);
me->RemoveAurasDueToSpell(SPELL_GROUND_VISUAL_1);
me->SetSpeedRate(MOVE_RUN, 1.1111f);
DoCastSelf(SPELL_GROUND_VISUAL_0, true);
events.SetPhase(PHASE_SUBMERGED);
me->SetControlled(false, UNIT_STATE_ROOT);
events.ScheduleEvent(EVENT_EMERGE, 6s, 0, PHASE_SUBMERGED);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
}
me->GetMotionMaster()->MovePoint(0, ToCCommonLoc[1].GetPositionX() + frand(-40.0f, 40.0f), ToCCommonLoc[1].GetPositionY() + frand(-40.0f, 40.0f), ToCCommonLoc[1].GetPositionZ() + me->GetCollisionHeight());
}
示例5: MovementInform
void MovementInform(uint32 type, uint32 pointId) override
{
if (type != POINT_MOTION_TYPE && type != EFFECT_MOTION_TYPE && type != SPLINE_CHAIN_MOTION_TYPE)
return;
switch (pointId)
{
case POINT_INITIAL_MOVEMENT:
events.ScheduleEvent(EVENT_ENGAGE, 3s);
break;
case POINT_MIDDLE:
DoCastSelf(SPELL_MASSIVE_CRASH);
events.ScheduleEvent(EVENT_SELECT_CHARGE_TARGET, 4s);
break;
case POINT_ICEHOWL_CHARGE:
events.Reset();
events.SetPhase(PHASE_COMBAT);
RescheduleTasks();
me->SetReactState(REACT_AGGRESSIVE);
DoCastSelf(SPELL_TRAMPLE);
break;
default:
break;
}
}
示例6: ExecuteEvent
void ExecuteEvent(uint32 eventId) override
{
switch (eventId)
{
case EVENT_RANDOM_BEAM:
DoCastSelf(BeamTriggers[urand(0, 3)]);
events.Repeat(Seconds(30));
break;
case EVENT_PRISMATIC_SHIELD:
DoCastSelf(PrismaticAuras[urand(0, 5)]);
events.Repeat(Seconds(15));
break;
case EVENT_FATAL_ATTRACTION:
Talk(SAY_SPELL);
me->CastCustomSpell(SPELL_FATAL_ATTACTION_TELEPORT, SPELLVALUE_MAX_TARGETS, 3, me);
events.Repeat(Seconds(30));
break;
case EVENT_SILENCING_SHRIEK:
DoCastVictim(SPELL_SILENCING_SHRIEK);
events.Repeat(Seconds(18), Seconds(30));
break;
case EVENT_TAUNT:
Talk(SAY_TAUNT);
events.Repeat(Seconds(30), Seconds(40));
break;
case EVENT_BERSERK:
Talk(EMOTE_BERSERK, me);
DoCastSelf(SPELL_BERSERK);
break;
default:
break;
}
}
示例7: Reset
void Reset() override
{
me->m_Events.AddEventAtOffset([this]()
{
DoCastSelf(SPELL_SLIME_POOL_EFFECT, true);
DoCastSelf(SPELL_PACIFY_SELF, true);
}, 1s);
}
示例8: UpdateAI
void UpdateAI(uint32 diff) override
{
if (!events.IsInPhase(PHASE_INTRO) && (!UpdateVictim() || !CheckInRoom()))
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_ANRAPHET_APPEAR:
me->GetMotionMaster()->MoveSmoothPath(POINT_ANRAPHET_ACTIVATE, AnraphetPath, AnraphetPathSize);
break;
case EVENT_ANRAPHET_ACTIVATE:
Talk(ANRAPHET_SAY_INTRO);
events.ScheduleEvent(EVENT_ANRAPHET_DESTRUCTION, Seconds(10), 0, PHASE_INTRO); // Note: 10800 ms
break;
case EVENT_ANRAPHET_DESTRUCTION:
DoCastAOE(SPELL_DESTRUCTION_PROTOCOL);
events.ScheduleEvent(EVENT_ANRAPHET_READY, Seconds(6), 0, PHASE_INTRO); // Note: 6400 ms
break;
case EVENT_ANRAPHET_READY:
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
events.SetPhase(PHASE_COMBAT);
ScheduleCombatEvents();
break;
case EVENT_ANRAPHET_NEMESIS_STRIKE:
DoCastVictim(SPELL_NEMESIS_STRIKE);
events.ScheduleEvent(EVENT_ANRAPHET_NEMESIS_STRIKE, Seconds(21), 0, PHASE_COMBAT);
break;
case EVENT_ANRAPHET_ALPHA_BEAMS:
DoCastSelf(SPELL_ALPHA_BEAMS);
events.ScheduleEvent(EVENT_ANRAPHET_CRUMBLING_RUIN, Seconds(12), 0, PHASE_COMBAT);
events.ScheduleEvent(EVENT_ANRAPHET_ALPHA_BEAMS, Seconds(40), Seconds(45), 0, PHASE_COMBAT);
break;
case EVENT_ANRAPHET_OMEGA_STANCE:
DoCastSelf(SPELL_OMEGA_STANCE_SUMMON);
DoCastSelf(SPELL_OMEGA_STANCE);
Talk(ANRAPHET_SAY_OMEGA_STANCE);
events.ScheduleEvent(EVENT_ANRAPHET_OMEGA_STANCE, Seconds(45), Seconds(50), 0, PHASE_COMBAT);
events.ScheduleEvent(EVENT_ANRAPHET_CRUMBLING_RUIN, Seconds(13), 0, PHASE_COMBAT);
break;
case EVENT_ANRAPHET_CRUMBLING_RUIN:
DoCastSelf(SPELL_CRUMBLING_RUIN);
break;
}
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
}
if (UpdateVictim())
DoMeleeAttackIfReady();
}
示例9: UpdateAI
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_FLIGHT:
{
me->SetCanFly(true);
me->SetDisableGravity(true);
me->SetByteFlag(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_ANIM_TIER, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER);
me->SetReactState(REACT_PASSIVE);
me->AttackStop();
Position pos;
pos.Relocate(me);
pos.m_positionZ += 10.0f;
me->GetMotionMaster()->MoveTakeoff(POINT_TAKEOFF, pos);
events.CancelEventGroup(EVENT_GROUP_LAND_PHASE);
break;
}
case EVENT_CONFLAGRATION:
DoCastSelf(SPELL_CONFLAGRATION, true);
break;
case EVENT_ENRAGE:
DoCastSelf(SPELL_ENRAGE);
Talk(EMOTE_ENRAGED);
events.Repeat(Seconds(24));
break;
case EVENT_FLAME_BREATH:
DoCastVictim(SPELL_FLAME_BREATH);
events.Repeat(Seconds(20), Seconds(30));
break;
case EVENT_AIR_MOVEMENT:
me->GetMotionMaster()->MovePoint(POINT_FLIGHT, SavianaRagefireFlyOutPos);
break;
case EVENT_LAND_GROUND:
me->GetMotionMaster()->MoveLand(POINT_LAND_GROUND, SavianaRagefireLandPos);
break;
default:
break;
}
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
}
DoMeleeAttackIfReady();
}
示例10: UpdateAI
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_SEARING_LIGHT:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_SEARING_LIGHT);
events.ScheduleEvent(EVENT_SEARING_LIGHT, TIMER_SEARING_LIGHT);
break;
case EVENT_GRAVITY_BOMB:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_GRAVITY_BOMB);
events.ScheduleEvent(EVENT_GRAVITY_BOMB, TIMER_GRAVITY_BOMB);
break;
case EVENT_TYMPANIC_TANTRUM:
Talk(SAY_TYMPANIC_TANTRUM);
Talk(EMOTE_TYMPANIC_TANTRUM);
DoCast(SPELL_TYMPANIC_TANTRUM);
events.ScheduleEvent(EVENT_TYMPANIC_TANTRUM, urand(TIMER_TYMPANIC_TANTRUM_MIN, TIMER_TYMPANIC_TANTRUM_MAX));
break;
case EVENT_DISPOSE_HEART:
SetPhaseOne();
break;
case EVENT_ENRAGE:
Talk(SAY_BERSERK);
DoCastSelf(SPELL_ENRAGE);
break;
case EVENT_ENTER_HARD_MODE:
me->SetFullHealth();
DoCastSelf(SPELL_HEARTBREAK, true);
me->AddLootMode(LOOT_MODE_HARD_MODE_1);
_hardMode = true;
SetPhaseOne();
break;
}
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
}
if (_phase == 1)
DoMeleeAttackIfReady();
}
示例11: UpdateAI
void UpdateAI(uint32 diff) override
{
if (!events.IsInPhase(PHASE_INTRO) && !UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_ENRAGE:
DoCast(SPELL_BERSERK);
break;
case EVENT_INCINERATE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_INCINERATE);
Talk(SAY_INCINERATE);
events.Repeat(Seconds(12), Seconds(20));
break;
case EVENT_SUMMON_DOOM_BLOSSOM:
DoCastSelf(SPELL_SUMMON_DOOM_BLOSSOM, true);
Talk(SAY_BLOSSOM);
events.Repeat(Seconds(30), Seconds(40));
break;
case EVENT_SHADOW_DEATH:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100.0f, true, true, -SPELL_SPIRITUAL_VENGEANCE))
DoCast(target, SPELL_SHADOW_OF_DEATH);
events.Repeat(Seconds(30), Seconds(35));
break;
case EVENT_CRUSHING_SHADOWS:
DoCastSelf(SPELL_CRUSHING_SHADOWS, { SPELLVALUE_MAX_TARGETS, 5 });
Talk(SAY_CRUSHING);
events.Repeat(Seconds(18), Seconds(30));
break;
case EVENT_FINISH_INTRO:
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
me->SetReactState(REACT_AGGRESSIVE);
break;
default:
break;
}
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
}
DoMeleeAttackIfReady();
}
示例12: IsSummonedBy
void IsSummonedBy(Unit* summoner) override
{
_summonerGUID = summoner->GetGUID();
_scheduler.Schedule(Milliseconds(3650), [this](TaskContext /*context*/)
{
DoCastSelf(SPELL_ICICLE_FALL_TRIGGER, true);
DoCastSelf(SPELL_ICICLE_FALL_VISUAL);
if (Unit* caster = ObjectAccessor::GetUnit(*me, _summonerGUID))
caster->RemoveDynObject(SPELL_ICICLE_SUMMON);
});
}
示例13: DoAction
void DoAction(int32 action) override
{
if (action == ACTION_ENRAGE)
{
DoCastSelf(SPELL_FROTHING_RAGE, true);
Talk(EMOTE_TRAMPLE_ENRAGE);
}
else if (action == ACTION_TRAMPLE_FAIL)
{
DoCastSelf(SPELL_STAGGERED_DAZE, true);
Talk(EMOTE_TRAMPLE_FAIL);
events.DelayEvents(15s);
}
}
示例14: ExposeHeart
void ExposeHeart()
{
Talk(SAY_HEART_OPENED);
Talk(EMOTE_HEART_OPENED);
DoCastSelf(SPELL_SUBMERGE); // Will make creature untargetable
me->AttackStop();
me->SetReactState(REACT_PASSIVE);
Unit* heart = me->GetVehicleKit() ? me->GetVehicleKit()->GetPassenger(HEART_VEHICLE_SEAT_NORMAL) : nullptr;
if (heart)
{
heart->CastSpell(heart, SPELL_HEART_OVERLOAD);
heart->CastSpell(me, SPELL_HEART_LIGHTNING_TETHER);
heart->CastSpell(heart, SPELL_HEART_HEAL_TO_FULL, true);
heart->CastSpell(me, SPELL_RIDE_VEHICLE_EXPOSED, true);
heart->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
heart->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_29);
}
events.CancelEvent(EVENT_SEARING_LIGHT);
events.CancelEvent(EVENT_GRAVITY_BOMB);
events.CancelEvent(EVENT_TYMPANIC_TANTRUM);
// Start "end of phase 2 timer"
events.ScheduleEvent(EVENT_DISPOSE_HEART, TIMER_HEART_PHASE);
// Phase 2 has officially started
_phase = 2;
_heartExposed++;
}
示例15: DoAction
void DoAction(int32 action) override
{
switch (action)
{
case ACTION_PET_DIED:
if (!_petCount) // underflow check - something has gone horribly wrong
{
EnterEvadeMode(EVADE_REASON_OTHER);
return;
}
if (!--_petCount) // last pet died, emerge
{
me->RemoveAurasDueToSpell(SPELL_SUBMERGE);
me->RemoveAurasDueToSpell(SPELL_IMPALE_AURA);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
DoCastSelf(SPELL_EMERGE);
events.SetPhase(PHASE_EMERGE);
events.ScheduleEvent(EVENT_POUND, randtime(Seconds(13), Seconds(18)), 0, PHASE_EMERGE);
events.ScheduleEvent(EVENT_LEECHING_SWARM, randtime(Seconds(3), Seconds(7)), 0, PHASE_EMERGE);
events.ScheduleEvent(EVENT_CARRION_BEETLES, randtime(Seconds(10), Seconds(15)), 0, PHASE_EMERGE);
}
break;
case ACTION_PET_EVADE:
EnterEvadeMode(EVADE_REASON_OTHER);
break;
}
}