本文整理汇总了C++中instance_naxxramas::GetSingleCreatureFromStorage方法的典型用法代码示例。如果您正苦于以下问题:C++ instance_naxxramas::GetSingleCreatureFromStorage方法的具体用法?C++ instance_naxxramas::GetSingleCreatureFromStorage怎么用?C++ instance_naxxramas::GetSingleCreatureFromStorage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类instance_naxxramas
的用法示例。
在下文中一共展示了instance_naxxramas::GetSingleCreatureFromStorage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetOtherAdd
Creature* GetOtherAdd() // For Stalagg returns pFeugen, for Feugen returns pStalagg
{
switch (m_creature->GetEntry())
{
case NPC_FEUGEN: return m_pInstance->GetSingleCreatureFromStorage(NPC_STALAGG);
case NPC_STALAGG: return m_pInstance->GetSingleCreatureFromStorage(NPC_FEUGEN);
default:
return NULL;
}
}
示例2: JustDied
void JustDied(Unit* /*pKiller*/) override
{
DoScriptText(SAY_DEATH, m_creature);
if (m_pInstance)
{
m_pInstance->SetData(TYPE_THADDIUS, DONE);
// Force Despawn of Adds
Creature* pFeugen = m_pInstance->GetSingleCreatureFromStorage(NPC_FEUGEN);
Creature* pStalagg = m_pInstance->GetSingleCreatureFromStorage(NPC_STALAGG);
if (pFeugen)
pFeugen->ForcedDespawn();
if (pStalagg)
pStalagg->ForcedDespawn();
}
}
示例3: JustReachedHome
void JustReachedHome() override
{
if (m_pInstance)
{
m_pInstance->SetData(TYPE_THADDIUS, FAIL);
// Respawn Adds:
Creature* pFeugen = m_pInstance->GetSingleCreatureFromStorage(NPC_FEUGEN);
Creature* pStalagg = m_pInstance->GetSingleCreatureFromStorage(NPC_STALAGG);
if (pFeugen)
{
pFeugen->ForcedDespawn();
pFeugen->Respawn();
}
if (pStalagg)
{
pStalagg->ForcedDespawn();
pStalagg->Respawn();
}
}
}
示例4: UpdateAI
void UpdateAI(const uint32 uiDiff) override
{
if (m_bBothDead) // This is the case while fighting Thaddius
return;
if (m_bFakeDeath)
{
if (m_uiReviveTimer < uiDiff)
{
if (Creature* pOther = GetOtherAdd())
{
if (boss_thaddiusAddsAI* pOtherAI = dynamic_cast<boss_thaddiusAddsAI*>(pOther->AI()))
{
if (!pOtherAI->IsCountingDead()) // Raid was to slow to kill the second add
Revive();
else
{
m_bBothDead = true; // Now both adds are counting dead
pOtherAI->m_bBothDead = true;
// Set both Teslas to overload
GuidList lTeslaGUIDList;
m_pInstance->GetThadTeslaCreatures(lTeslaGUIDList);
for (GuidList::const_iterator itr = lTeslaGUIDList.begin(); itr != lTeslaGUIDList.end(); ++itr)
{
if (Creature* pTesla = m_pInstance->instance->GetCreature(*itr))
{
if (npc_tesla_coilAI* pTeslaAI = dynamic_cast<npc_tesla_coilAI*>(pTesla->AI()))
pTeslaAI->SetOverloading();
}
}
Creature* pThad = m_pInstance->GetSingleCreatureFromStorage(NPC_THADDIUS);
if(pThad)
pThad->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
}
}
}
}
else
m_uiReviveTimer -= uiDiff;
return;
}
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
return;
if (m_uiHoldTimer) // A short timer preventing combat movement after revive
{
if (m_uiHoldTimer <= uiDiff)
{
SetCombatMovement(true);
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
m_uiHoldTimer = 0;
}
else
m_uiHoldTimer -= uiDiff;
}
if (m_uiWarStompTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature, SPELL_WARSTOMP) == CAST_OK)
m_uiWarStompTimer = urand(8 * IN_MILLISECONDS, 10 * IN_MILLISECONDS);
}
else
m_uiWarStompTimer -= uiDiff;
UpdateAddAI(uiDiff); // For Add Specific Abilities
DoMeleeAttackIfReady();
}
示例5: UpdateAI
//.........这里部分代码省略.........
m_uiFrostBoltNovaTimer = 15000;
}
else
m_uiFrostBoltNovaTimer -= uiDiff;
if (m_uiManaDetonationTimer < uiDiff)
{
if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0, SPELL_MANA_DETONATION, SELECT_FLAG_PLAYER | SELECT_FLAG_POWER_MANA))
{
if (DoCastSpellIfCan(pTarget, SPELL_MANA_DETONATION) == CAST_OK)
{
if (urand(0, 1))
DoScriptText(SAY_SPECIAL1_MANA_DET, m_creature);
m_uiManaDetonationTimer = 20000;
}
}
}
else
m_uiManaDetonationTimer -= uiDiff;
if (m_uiShadowFissureTimer < uiDiff)
{
if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
{
if (DoCastSpellIfCan(pTarget, SPELL_SHADOW_FISSURE) == CAST_OK)
{
if (urand(0, 1))
DoScriptText(SAY_SPECIAL3_MANA_DET, m_creature);
m_uiShadowFissureTimer = 25000;
}
}
}
else
m_uiShadowFissureTimer -= uiDiff;
if (m_uiFrostBlastTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_FROST_BLAST) == CAST_OK)
{
if (urand(0, 1))
DoScriptText(SAY_FROST_BLAST, m_creature);
m_uiFrostBlastTimer = urand(30000, 60000);
}
}
else
m_uiFrostBlastTimer -= uiDiff;
if (!m_bIsRegularMode)
{
if (m_uiChainsTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_CHAINS_OF_KELTHUZAD) == CAST_OK)
{
DoScriptText(urand(0, 1) ? SAY_CHAIN1 : SAY_CHAIN2, m_creature);
m_uiChainsTimer = urand(30000, 60000);
}
}
else
m_uiChainsTimer -= uiDiff;
}
if (m_uiPhase == PHASE_NORMAL)
{
if (m_creature->GetHealthPercent() < 45.0f)
{
m_uiPhase = PHASE_GUARDIANS;
DoScriptText(SAY_REQUEST_AID, m_creature);
}
}
else if (m_uiPhase == PHASE_GUARDIANS && m_uiGuardiansCount < m_uiGuardiansCountMax)
{
if (m_uiGuardiansTimer < uiDiff)
{
// Summon a Guardian of Icecrown in a random alcove
SummonMob(NPC_GUARDIAN);
m_uiGuardiansTimer = 5000;
}
else
m_uiGuardiansTimer -= uiDiff;
if (m_uiLichKingAnswerTimer && m_pInstance)
{
if (m_uiLichKingAnswerTimer <= uiDiff)
{
if (Creature* pLichKing = m_pInstance->GetSingleCreatureFromStorage(NPC_THE_LICHKING))
DoScriptText(SAY_ANSWER_REQUEST, pLichKing);
m_uiLichKingAnswerTimer = 0;
}
else
m_uiLichKingAnswerTimer -= uiDiff;
}
}
DoMeleeAttackIfReady();
}
}