本文整理汇总了C++中RemoveGravityLapse函数的典型用法代码示例。如果您正苦于以下问题:C++ RemoveGravityLapse函数的具体用法?C++ RemoveGravityLapse怎么用?C++ RemoveGravityLapse使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RemoveGravityLapse函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DamageTaken
// Boss has an interesting speech before killed, so we need to fake death (without stand state) and allow him to finish his theatre
void DamageTaken(Unit* /*pKiller*/, uint32& uiDamage, DamageEffectType /*damagetype*/) override
{
if (uiDamage < m_creature->GetHealth())
return;
// Make sure it won't die by accident
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
{
uiDamage = 0;
return;
}
uiDamage = 0;
RemoveGravityLapse();
StartNextDialogueText(SAY_DEATH);
m_creature->HandleEmote(EMOTE_STATE_TALK);
m_creature->InterruptNonMeleeSpells(true);
m_creature->SetHealth(1);
m_creature->StopMoving();
m_creature->ClearComboPointHolders();
m_creature->RemoveAllAurasOnDeath();
m_creature->ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false);
m_creature->ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->ClearAllReactives();
m_creature->GetMotionMaster()->Clear();
m_creature->GetMotionMaster()->MoveIdle();
}
示例2: JustDied
void JustDied(Unit *killer)
{
RemoveGravityLapse();
DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
DoPlaySoundToSet(m_creature,SOUND_DEATH);
if(pInstance)
pInstance->SetData(DATA_KAELTHAS_EVENT, DONE);
}
示例3: EnterEvadeMode
void EnterEvadeMode()
{
RemoveGravityLapse();
m_creature->InterruptNonMeleeSpells(true);
m_creature->RemoveAllAuras();
m_creature->DeleteThreatList();
m_creature->CombatStop();
m_creature->LoadCreaturesAddon();
if( m_creature->isAlive() )
m_creature->GetMotionMaster()->MoveTargetedHome();
m_creature->SetLootRecipient(NULL);
InCombat = false;
Reset();
}
示例4: UpdateAI
//.........这里部分代码省略.........
if (m_creature->IsNonMeleeSpellCasted(false))
m_creature->InterruptNonMeleeSpells(false);
DoCastSpellIfCan(pTarget, SPELL_FLAME_STRIKE);
DoScriptText(SAY_FLAMESTRIKE, m_creature);
}
FlameStrikeTimer = urand(15000, 25000);
}else FlameStrikeTimer -= diff;
// Below 50%
if (m_creature->GetHealth() * 2 < m_creature->GetMaxHealth())
{
m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true);
m_creature->StopMoving();
m_creature->GetMotionMaster()->Clear();
m_creature->GetMotionMaster()->MoveIdle();
GravityLapseTimer = 0;
GravityLapsePhase = 0;
Phase = 1;
}
DoMeleeAttackIfReady();
}
break;
case 1:
{
if (GravityLapseTimer < diff)
{
switch(GravityLapsePhase)
{
case 0:
if (FirstGravityLapse) // Different yells at 50%, and at every following Gravity Lapse
{
DoScriptText(SAY_GRAVITY_LAPSE, m_creature);
FirstGravityLapse = false;
if (m_pInstance)
{
if (GameObject* pKaelLeft = m_pInstance->instance->GetGameObject(m_pInstance->GetData64(DATA_KAEL_STATUE_LEFT)))
pKaelLeft->SetGoState(GO_STATE_ACTIVE);
if (GameObject* pKaelRight = m_pInstance->instance->GetGameObject(m_pInstance->GetData64(DATA_KAEL_STATUE_RIGHT)))
pKaelRight->SetGoState(GO_STATE_ACTIVE);
}
}
else
{
DoScriptText(SAY_RECAST_GRAVITY, m_creature);
}
DoCastSpellIfCan(m_creature, SPELL_GRAVITY_LAPSE_INITIAL);
GravityLapseTimer = 2000 + diff;// Don't interrupt the visual spell
GravityLapsePhase = 1;
break;
case 1:
TeleportPlayersToSelf();
GravityLapseTimer = 1000;
GravityLapsePhase = 2;
break;
case 2:
CastGravityLapseKnockUp();
GravityLapseTimer = 1000;
GravityLapsePhase = 3;
break;
case 3:
CastGravityLapseFly();
GravityLapseTimer = 30000;
GravityLapsePhase = 4;
for(uint8 i = 0; i < 3; ++i)
{
if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0))
{
if (Creature* Orb = DoSpawnCreature(CREATURE_ARCANE_SPHERE, 5, 5, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000))
Orb->AI()->AttackStart(pTarget);
}
}
DoCastSpellIfCan(m_creature, SPELL_GRAVITY_LAPSE_CHANNEL);
break;
case 4:
m_creature->InterruptNonMeleeSpells(false);
DoScriptText(SAY_TIRED, m_creature);
DoCastSpellIfCan(m_creature, SPELL_POWER_FEEDBACK);
RemoveGravityLapse();
GravityLapseTimer = 10000;
GravityLapsePhase = 0;
break;
}
}else GravityLapseTimer -= diff;
}
break;
}
}
示例5: DamageTaken
void DamageTaken(Unit* done_by, uint32 &damage)
{
if (damage > m_creature->GetHealth())
RemoveGravityLapse(); // Remove Gravity Lapse so that players fall to ground if they kill him when in air.
}
示例6: UpdateAI
//.........这里部分代码省略.........
{
if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
{
if (DoCastSpellIfCan(pTarget, m_bIsRegularMode ? SPELL_FIREBALL : SPELL_FIREBALL_H) == CAST_OK)
m_uiFireballTimer = urand(2000, 4000);
}
}
else
m_uiFireballTimer -= uiDiff;
if (m_uiPhoenixTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature, SPELL_PHOENIX) == CAST_OK)
{
DoScriptText(SAY_PHOENIX, m_creature);
m_uiPhoenixTimer = 45000;
}
}
else
m_uiPhoenixTimer -= uiDiff;
if (m_uiFlameStrikeTimer < uiDiff)
{
if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
{
if (DoCastSpellIfCan(pTarget, SPELL_FLAME_STRIKE) == CAST_OK)
{
DoScriptText(SAY_FLAMESTRIKE, m_creature);
m_uiFlameStrikeTimer = urand(15000, 25000);
}
}
}
else
m_uiFlameStrikeTimer -= uiDiff;
// Below 50%
if (m_creature->GetHealthPercent() < 50.0f)
{
if (DoCastSpellIfCan(m_creature, SPELL_TELEPORT_CENTER, CAST_INTERRUPT_PREVIOUS) == CAST_OK)
{
SetCombatMovement(false);
m_creature->GetMotionMaster()->Clear();
m_creature->GetMotionMaster()->MoveIdle();
m_bIsFirstPhase = false;
}
}
DoMeleeAttackIfReady();
}
else
{
if (m_uiGravityLapseTimer < uiDiff)
{
switch (m_uiGravityLapseStage)
{
case 0:
// Cast Gravity Lapse on Players
if (DoCastSpellIfCan(m_creature, SPELL_GRAVITY_LAPSE) == CAST_OK)
{
if (m_bFirstGravityLapse)
{
DoScriptText(SAY_GRAVITY_LAPSE, m_creature);
m_bFirstGravityLapse = false;
}
else
DoScriptText(SAY_RECAST_GRAVITY, m_creature);
m_uiGravityLapseTimer = 2000;
m_uiGravityIndex = 0;
++m_uiGravityLapseStage;
}
break;
case 1:
// Summon spheres and apply the Gravity Lapse visual - upon visual expire, the gravity lapse is removed
if (DoCastSpellIfCan(m_creature, SPELL_GRAVITY_LAPSE_VISUAL) == CAST_OK)
{
for (uint8 i = 0; i < MAX_ARCANE_SPHERES; ++i)
DoCastSpellIfCan(m_creature, SPELL_ARCANE_SPHERE_SUMMON, CAST_TRIGGERED);
m_uiGravityLapseTimer = 30000;
++m_uiGravityLapseStage;
}
break;
case 2:
// Cast Power Feedback and stay stunned for 10 secs - also break the statues if they are not broken
if (DoCastSpellIfCan(m_creature, SPELL_POWER_FEEDBACK) == CAST_OK)
{
DoScriptText(SAY_TIRED, m_creature);
RemoveGravityLapse();
m_uiGravityLapseTimer = 10000;
m_uiGravityLapseStage = 0;
}
break;
}
}
else
m_uiGravityLapseTimer -= uiDiff;
}
}
示例7: UpdateAI
//.........这里部分代码省略.........
m_uiFlameStrikeTimer = urand(15000, 25000);
}
else
m_uiFlameStrikeTimer -= uiDiff;
// Below 50%
if (m_creature->GetHealthPercent() < 50.0f)
{
m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true);
m_creature->StopMoving();
m_creature->GetMotionMaster()->Clear();
m_creature->GetMotionMaster()->MoveIdle();
m_uiGravityLapseTimer = 0;
m_uiGravityLapsePhase = 0;
m_uiPhase = 1;
return;
}
DoMeleeAttackIfReady();
break;
}
case 1:
{
if (m_uiGravityLapseTimer < uiDiff)
{
switch (m_uiGravityLapsePhase)
{
case 0:
if (m_bFirstGravityLapse) // Different yells at 50%, and at every following Gravity Lapse
{
DoScriptText(SAY_GRAVITY_LAPSE, m_creature);
m_bFirstGravityLapse = false;
if (m_pInstance)
{
if (GameObject* pKaelLeft = m_pInstance->GetSingleGameObjectFromStorage(GO_KAEL_STATUE_LEFT))
pKaelLeft->SetGoState(GO_STATE_ACTIVE);
if (GameObject* pKaelRight = m_pInstance->GetSingleGameObjectFromStorage(GO_KAEL_STATUE_RIGHT))
pKaelRight->SetGoState(GO_STATE_ACTIVE);
}
}
else
{
DoScriptText(SAY_RECAST_GRAVITY, m_creature);
}
DoCastSpellIfCan(m_creature, SPELL_GRAVITY_LAPSE_INITIAL);
m_uiGravityLapseTimer = 2000 + uiDiff;// Don't interrupt the visual spell
m_uiGravityLapsePhase = 1;
break;
case 1:
TeleportPlayersToSelf();
m_uiGravityLapseTimer = 1000;
m_uiGravityLapsePhase = 2;
break;
case 2:
CastGravityLapseKnockUp();
m_uiGravityLapseTimer = 1000;
m_uiGravityLapsePhase = 3;
break;
case 3:
CastGravityLapseFly();
m_uiGravityLapseTimer = 30000;
m_uiGravityLapsePhase = 4;
for(uint8 i = 0; i < 3; ++i)
{
if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0))
{
if (Creature* Orb = DoSpawnCreature(NPC_ARCANE_SPHERE, 5, 5, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000))
Orb->AI()->AttackStart(pTarget);
}
}
DoCastSpellIfCan(m_creature, SPELL_GRAVITY_LAPSE_CHANNEL);
break;
case 4:
m_creature->InterruptNonMeleeSpells(false);
DoScriptText(SAY_TIRED, m_creature);
DoCastSpellIfCan(m_creature, SPELL_POWER_FEEDBACK);
RemoveGravityLapse();
m_uiGravityLapseTimer = 10000;
m_uiGravityLapsePhase = 0;
break;
}
}
else
m_uiGravityLapseTimer -= uiDiff;
break;
}
}
}
示例8: UpdateAI
//.........这里部分代码省略.........
DoScriptText(SAY_FLAMESTRIKE, m_creature);
}
FlameStrikeTimer = 15000 + rand()%10000;
}else FlameStrikeTimer -= diff;
// Below 50%
if (m_creature->GetMaxHealth() * 0.5 > m_creature->GetHealth())
{
m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true);
m_creature->StopMoving();
m_creature->GetMotionMaster()->Clear();
m_creature->GetMotionMaster()->MoveIdle();
GravityLapseTimer = 0;
GravityLapsePhase = 0;
Phase = 1;
}
DoMeleeAttackIfReady();
}
break;
case 1:
{
if (GravityLapseTimer < diff)
{
switch(GravityLapsePhase)
{
case 0:
if (FirstGravityLapse) // Different yells at 50%, and at every following Gravity Lapse
{
DoScriptText(SAY_GRAVITY_LAPSE, m_creature);
FirstGravityLapse = false;
if (pInstance)
{
GameObject* KaelLeft = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_KAEL_STATUE_LEFT));
if (KaelLeft) KaelLeft->SetGoState(GO_STATE_ACTIVE);
GameObject* KaelRight = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_KAEL_STATUE_RIGHT));
if (KaelRight) KaelRight->SetGoState(GO_STATE_ACTIVE);
}
}else
{
DoScriptText(SAY_RECAST_GRAVITY, m_creature);
}
DoCast(m_creature, SPELL_GRAVITY_LAPSE_INITIAL);
GravityLapseTimer = 2000 + diff;// Don't interrupt the visual spell
GravityLapsePhase = 1;
break;
case 1:
TeleportPlayersToSelf();
GravityLapseTimer = 1000;
GravityLapsePhase = 2;
break;
case 2:
CastGravityLapseKnockUp();
GravityLapseTimer = 1000;
GravityLapsePhase = 3;
break;
case 3:
CastGravityLapseFly();
GravityLapseTimer = 30000;
GravityLapsePhase = 4;
for(uint8 i = 0; i < 3; ++i)
{
Unit* target = NULL;
target = SelectUnit(SELECT_TARGET_RANDOM,0);
Creature* Orb = DoSpawnCreature(CREATURE_ARCANE_SPHERE, 5, 5, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
if (Orb && target)
{
//SetThreatList(Orb);
Orb->AddThreat(target, 1.0f);
Orb->AI()->AttackStart(target);
}
}
DoCast(m_creature, SPELL_GRAVITY_LAPSE_CHANNEL);
break;
case 4:
m_creature->InterruptNonMeleeSpells(false);
DoScriptText(SAY_TIRED, m_creature);
DoCast(m_creature, SPELL_POWER_FEEDBACK);
RemoveGravityLapse();
GravityLapseTimer = 10000;
GravityLapsePhase = 0;
break;
}
}else GravityLapseTimer -= diff;
}
break;
}
}
示例9: DamageTaken
void DamageTaken(Unit* /*done_by*/, uint32 &damage) override
{
if (damage > me->GetHealth())
RemoveGravityLapse(); // Remove Gravity Lapse so that players fall to ground if they kill him when in air.
}