本文整理汇总了C++中instance_onyxias_lair类的典型用法代码示例。如果您正苦于以下问题:C++ instance_onyxias_lair类的具体用法?C++ instance_onyxias_lair怎么用?C++ instance_onyxias_lair使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了instance_onyxias_lair类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: MovementInform
void MovementInform(uint32 uiMoveType, uint32 uiPointId) override
{
if (uiMoveType != POINT_MOTION_TYPE || !m_pInstance)
return;
switch (uiPointId)
{
case POINT_ID_IN_AIR:
// sort of a hack, it is unclear how this really work but the values are valid
m_creature->SetByteValue(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_FLY_ANIM);
m_creature->SetLevitate(true);
m_uiPhaseTimer = 1000; // Movement to Initial North Position is delayed
return;
case POINT_ID_LAND:
// undo flying
m_creature->SetByteValue(UNIT_FIELD_BYTES_1, 3, 0);
m_creature->SetLevitate(false);
m_creature->HandleEmote(EMOTE_ONESHOT_LAND);
m_uiPhaseTimer = 500; // Start PHASE_END shortly delayed
return;
case POINT_ID_LIFTOFF:
m_uiPhaseTimer = 500; // Start Flying shortly delayed
m_creature->HandleEmote(EMOTE_ONESHOT_LIFTOFF);
break;
case POINT_ID_INIT_NORTH: // Start PHASE_BREATH
m_uiPhase = PHASE_BREATH;
break;
}
if (Creature* pTrigger = m_pInstance->GetSingleCreatureFromStorage(NPC_ONYXIA_TRIGGER))
m_creature->SetFacingToObject(pTrigger);
}
开发者ID:Warlockbugs,项目名称:mangos-tbc,代码行数:32,代码来源:boss_onyxia.cpp
示例2: Aggro
void Aggro(Unit* /*pWho*/) override
{
DoScriptText(SAY_AGGRO, m_creature);
if (m_pInstance)
m_pInstance->SetData(TYPE_ONYXIA, IN_PROGRESS);
}
开发者ID:Warlockbugs,项目名称:mangos-tbc,代码行数:7,代码来源:boss_onyxia.cpp
示例3: JustDied
void JustDied(Unit* /*pKiller*/) override
{
if (m_pInstance)
{
m_pInstance->SetData(TYPE_ONYXIA, DONE);
}
}
开发者ID:lucasdnd,项目名称:mangoszero-bots-test,代码行数:7,代码来源:boss_onyxia.cpp
示例4: JustReachedHome
void JustReachedHome() override
{
// in case evade in phase 2, see comments for hack where phase 2 is set
m_creature->SetLevitate(false);
m_creature->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0);
if (m_pInstance)
m_pInstance->SetData(TYPE_ONYXIA, FAIL);
}
开发者ID:Warlockbugs,项目名称:mangos-tbc,代码行数:9,代码来源:boss_onyxia.cpp
示例5: JustSummoned
void JustSummoned(Creature* pSummoned) override
{
if (!m_pInstance)
return;
if (Creature* pTrigger = m_pInstance->GetSingleCreatureFromStorage(NPC_ONYXIA_TRIGGER))
{
// Get some random point near the center
float fX, fY, fZ;
pSummoned->GetRandomPoint(pTrigger->GetPositionX(), pTrigger->GetPositionY(), pTrigger->GetPositionZ(), 20.0f, fX, fY, fZ);
pSummoned->GetMotionMaster()->MovePoint(1, fX, fY, fZ);
}
else
pSummoned->SetInCombatWithZone();
if (pSummoned->GetEntry() == NPC_ONYXIA_WHELP)
++m_uiSummonCount;
}
开发者ID:natedahl32,项目名称:portalclassic,代码行数:18,代码来源:boss_onyxia.cpp
示例6: UpdateAI
void UpdateAI(const uint32 uiDiff) override
{
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
return;
// Whelps summoning timer, outside encounter phase switch because the summoning spans across several sub-parts of phase 2
if (m_uiSummonWhelpsTimer)
{
if (m_uiSummonWhelpsTimer < uiDiff)
{
SummonWhelps();
// no update of timer: handled in SummonWhelps()
}
else
{
m_uiSummonWhelpsTimer -= uiDiff;
if (m_uiSummonWhelpsTimer == 0) // check needed for the rare but possible case where (m_uiSummonWhelpsTimer - uiDiff == 0)
SummonWhelps();
}
}
switch (m_uiPhase)
{
case PHASE_END:
if (m_uiBellowingRoarTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature, SPELL_BELLOWINGROAR) == CAST_OK)
m_uiBellowingRoarTimer = urand(15000, 45000);
}
else
m_uiBellowingRoarTimer -= uiDiff;
// no break, phase 3 will use same abilities as in 1
case PHASE_START:
{
if (m_uiFlameBreathTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_FLAMEBREATH) == CAST_OK)
m_uiFlameBreathTimer = urand(10000, 20000);
}
else
m_uiFlameBreathTimer -= uiDiff;
if (m_uiTailSweepTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature, SPELL_TAILSWEEP) == CAST_OK)
m_uiTailSweepTimer = urand(15000, 20000);
}
else
m_uiTailSweepTimer -= uiDiff;
if (m_uiCleaveTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_CLEAVE) == CAST_OK)
m_uiCleaveTimer = urand(2000, 5000);
}
else
m_uiCleaveTimer -= uiDiff;
if (m_uiWingBuffetTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature, SPELL_WINGBUFFET) == CAST_OK)
m_uiWingBuffetTimer = urand(15000, 30000);
}
else
m_uiWingBuffetTimer -= uiDiff;
if (m_uiCheckInLairTimer < uiDiff)
{
if (m_pInstance)
{
Creature* pOnyTrigger = m_pInstance->GetSingleCreatureFromStorage(NPC_ONYXIA_TRIGGER);
if (pOnyTrigger && !m_creature->IsWithinDistInMap(pOnyTrigger, 90.0f, false))
{
if (!m_bHasYelledLured)
{
m_bHasYelledLured = true;
DoScriptText(SAY_KITE, m_creature);
}
DoCastSpellIfCan(m_creature, SPELL_BREATH_ENTRANCE);
}
else
m_bHasYelledLured = false;
}
m_uiCheckInLairTimer = 3000;
}
else
m_uiCheckInLairTimer -= uiDiff;
if (m_uiPhase == PHASE_START && m_creature->GetHealthPercent() < 65.0f)
{
m_uiPhase = PHASE_TO_LIFTOFF;
DoScriptText(SAY_PHASE_2_TRANS, m_creature);
SetCombatMovement(false);
m_creature->GetMotionMaster()->MoveIdle();
m_creature->SetTarget(nullptr);
float fGroundZ = m_creature->GetMap()->GetHeight(aMoveData[POINT_ID_SOUTH].fX, aMoveData[POINT_ID_SOUTH].fY, aMoveData[POINT_ID_SOUTH].fZ);
m_creature->GetMotionMaster()->MovePoint(POINT_ID_LIFTOFF, aMoveData[POINT_ID_SOUTH].fX, aMoveData[POINT_ID_SOUTH].fY, fGroundZ);
return;
}
//.........这里部分代码省略.........
开发者ID:Warlockbugs,项目名称:mangos-tbc,代码行数:101,代码来源:boss_onyxia.cpp
示例7: UpdateAI
void UpdateAI(const uint32 uiDiff) override
{
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
{
return;
}
switch (m_uiPhase)
{
case PHASE_END: // Here is room for additional summoned whelps and Erruption
if (m_uiBellowingRoarTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature, SPELL_BELLOWINGROAR) == CAST_OK)
{
m_uiBellowingRoarTimer = 30000;
}
}
else
{
m_uiBellowingRoarTimer -= uiDiff;
}
// no break, phase 3 will use same abilities as in 1
case PHASE_START:
{
if (m_uiFlameBreathTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_FLAMEBREATH) == CAST_OK)
{
m_uiFlameBreathTimer = urand(10000, 20000);
}
}
else
{
m_uiFlameBreathTimer -= uiDiff;
}
if (m_uiTailSweepTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature, SPELL_TAILSWEEP) == CAST_OK)
{
m_uiTailSweepTimer = urand(15000, 20000);
}
}
else
{
m_uiTailSweepTimer -= uiDiff;
}
if (m_uiCleaveTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_CLEAVE) == CAST_OK)
{
m_uiCleaveTimer = urand(2000, 5000);
}
}
else
{
m_uiCleaveTimer -= uiDiff;
}
if (m_uiWingBuffetTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature, SPELL_WINGBUFFET) == CAST_OK)
{
m_uiWingBuffetTimer = urand(15000, 30000);
}
}
else
{
m_uiWingBuffetTimer -= uiDiff;
}
if (m_uiCheckInLairTimer < uiDiff)
{
if (m_pInstance)
{
Creature* pOnyTrigger = m_pInstance->GetSingleCreatureFromStorage(NPC_ONYXIA_TRIGGER);
if (pOnyTrigger && !m_creature->IsWithinDistInMap(pOnyTrigger, 90.0f, false))
{
DoCastSpellIfCan(m_creature, SPELL_BREATH_ENTRANCE);
}
}
m_uiCheckInLairTimer = 3000;
}
else
{
m_uiCheckInLairTimer -= uiDiff;
}
if (m_uiPhase == PHASE_START && m_creature->GetHealthPercent() < 65.0f)
{
m_uiPhase = PHASE_TO_LIFTOFF;
DoScriptText(SAY_PHASE_2_TRANS, m_creature);
SetCombatMovement(false);
m_creature->GetMotionMaster()->MoveIdle();
m_creature->SetTargetGuid(ObjectGuid());
float fGroundZ = m_creature->GetMap()->GetHeight(aMoveData[POINT_ID_SOUTH].fX, aMoveData[POINT_ID_SOUTH].fY, aMoveData[POINT_ID_SOUTH].fZ);
m_creature->GetMotionMaster()->MovePoint(POINT_ID_LIFTOFF, aMoveData[POINT_ID_SOUTH].fX, aMoveData[POINT_ID_SOUTH].fY, fGroundZ);
return;
//.........这里部分代码省略.........
开发者ID:lucasdnd,项目名称:mangoszero-bots-test,代码行数:101,代码来源:boss_onyxia.cpp
注:本文中的instance_onyxias_lair类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论