本文整理汇总了C++中instance_naxxramas::DoTriggerHeiganTraps方法的典型用法代码示例。如果您正苦于以下问题:C++ instance_naxxramas::DoTriggerHeiganTraps方法的具体用法?C++ instance_naxxramas::DoTriggerHeiganTraps怎么用?C++ instance_naxxramas::DoTriggerHeiganTraps使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类instance_naxxramas
的用法示例。
在下文中一共展示了instance_naxxramas::DoTriggerHeiganTraps方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateAI
void UpdateAI(const uint32 uiDiff) override
{
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
return;
if (m_uiPhase == PHASE_GROUND)
{
// Teleport to platform
if (m_uiPhaseTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature, SPELL_TELEPORT) == CAST_OK)
{
DoScriptText(EMOTE_TELEPORT, m_creature);
m_creature->GetMotionMaster()->MoveIdle();
m_uiPhase = PHASE_PLATFORM;
ResetPhase();
return;
}
}
else
m_uiPhaseTimer -= uiDiff;
// Fever
if (m_uiFeverTimer < uiDiff)
{
DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_DECREPIT_FEVER : SPELL_DECREPIT_FEVER_H);
m_uiFeverTimer = 21000;
}
else
m_uiFeverTimer -= uiDiff;
// Disruption
if (m_uiDisruptionTimer < uiDiff)
{
DoCastSpellIfCan(m_creature, SPELL_DISRUPTION);
m_uiDisruptionTimer = 10000;
}
else
m_uiDisruptionTimer -= uiDiff;
}
else // Platform Phase
{
if (m_uiPhaseTimer < uiDiff) // Return to fight
{
m_creature->InterruptNonMeleeSpells(true);
DoScriptText(EMOTE_RETURN, m_creature);
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
m_uiPhase = PHASE_GROUND;
ResetPhase();
return;
}
else
m_uiPhaseTimer -= uiDiff;
if (m_uiStartChannelingTimer)
{
if (m_uiStartChannelingTimer <= uiDiff)
{
DoScriptText(SAY_CHANNELING, m_creature);
DoCastSpellIfCan(m_creature, SPELL_PLAGUE_CLOUD);
m_uiStartChannelingTimer = 0; // no more
}
else
m_uiStartChannelingTimer -= uiDiff;
}
}
// Taunt
if (m_uiTauntTimer < uiDiff)
{
switch (urand(0, 3))
{
case 0: DoScriptText(SAY_TAUNT1, m_creature); break;
case 1: DoScriptText(SAY_TAUNT2, m_creature); break;
case 2: DoScriptText(SAY_TAUNT3, m_creature); break;
case 3: DoScriptText(SAY_TAUNT4, m_creature); break;
}
m_uiTauntTimer = urand(20000, 70000);
}
else
m_uiTauntTimer -= uiDiff;
DoMeleeAttackIfReady();
// Handling of the erruptions, this is not related to melee attack or spell-casting
if (!m_pInstance)
return;
// Eruption
if (m_uiEruptionTimer < uiDiff)
{
for (uint8 uiArea = 0; uiArea < MAX_HEIGAN_TRAP_AREAS; ++uiArea)
{
// Actually this is correct :P
if (uiArea == (m_uiPhaseEruption % 6) || uiArea == 6 - (m_uiPhaseEruption % 6))
continue;
m_pInstance->DoTriggerHeiganTraps(m_creature, uiArea);
//.........这里部分代码省略.........
示例2: UpdateAI
//.........这里部分代码省略.........
else
m_uiFeverTimer -= uiDiff;
// Disruption
if (m_uiDisruptionTimer < uiDiff)
{
DoCastSpellIfCan(m_creature, SPELL_DISRUPTION);
m_uiDisruptionTimer = 10000;
}
else
m_uiDisruptionTimer -= uiDiff;
if (m_uiTeleportTimer < uiDiff)
{
float fX, fY, fZ;
// Teleport players in the tunnel
for (uint8 i = 0; i < MAX_PLAYERS_TELEPORT; i++)
{
if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1, uint32(0), SELECT_FLAG_PLAYER))
{
m_creature->GetRandomPoint(aTunnelLoc[0], aTunnelLoc[1], aTunnelLoc[2], 5.0f, fX, fY, fZ);
pTarget->NearTeleportTo(fX, fY, fZ, aTunnelLoc[3]);
}
}
m_uiTeleportTimer = 70000;
}
else
m_uiTeleportTimer -= uiDiff;
}
else // Platform Phase
{
if (m_uiPhaseTimer <= uiDiff) // Return to fight
{
m_creature->InterruptNonMeleeSpells(true);
DoScriptText(EMOTE_RETURN, m_creature);
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
m_uiPhase = PHASE_GROUND;
ResetPhase();
return;
}
else
m_uiPhaseTimer -= uiDiff;
if (m_uiStartChannelingTimer)
{
if (m_uiStartChannelingTimer <= uiDiff)
{
DoScriptText(SAY_CHANNELING, m_creature);
DoCastSpellIfCan(m_creature, SPELL_PLAGUE_CLOUD);
// ToDo: fill the tunnel with poison - required further research
m_uiStartChannelingTimer = 0; // no more
}
else
m_uiStartChannelingTimer -= uiDiff;
}
}
// Taunt
if (m_uiTauntTimer < uiDiff)
{
switch (urand(0, 3))
{
case 0: DoScriptText(SAY_TAUNT1, m_creature); break;
case 1: DoScriptText(SAY_TAUNT2, m_creature); break;
case 2: DoScriptText(SAY_TAUNT3, m_creature); break;
case 3: DoScriptText(SAY_TAUNT4, m_creature); break;
}
m_uiTauntTimer = urand(20000, 70000);
}
else
m_uiTauntTimer -= uiDiff;
DoMeleeAttackIfReady();
// Handling of the erruptions, this is not related to melee attack or spell-casting
if (!m_pInstance)
return;
// Eruption
if (m_uiEruptionTimer < uiDiff)
{
for (uint8 uiArea = 0; uiArea < MAX_HEIGAN_TRAP_AREAS; ++uiArea)
{
// Actually this is correct :P
if (uiArea == (m_uiPhaseEruption % 6) || uiArea == 6 - (m_uiPhaseEruption % 6))
continue;
m_pInstance->DoTriggerHeiganTraps(m_creature, uiArea);
}
m_uiEruptionTimer = m_uiPhase == PHASE_GROUND ? 10000 : 3000;
++m_uiPhaseEruption;
}
else
m_uiEruptionTimer -= uiDiff;
}