本文整理汇总了C++中instance_ulduar::GetData方法的典型用法代码示例。如果您正苦于以下问题:C++ instance_ulduar::GetData方法的具体用法?C++ instance_ulduar::GetData怎么用?C++ instance_ulduar::GetData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类instance_ulduar
的用法示例。
在下文中一共展示了instance_ulduar::GetData方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: JustReachedHome
void JustReachedHome() override
{
if (!m_pInstance)
return;
if (m_bEventFinished)
{
if (m_pInstance->GetData(TYPE_ALGALON) == DONE)
{
// complete the achiev and start outro dialogue
DoCastSpellIfCan(m_creature, SPELL_KILL_CREDIT, CAST_TRIGGERED);
DoCastSpellIfCan(m_creature, SPELL_SUPERMASSIVE_FAIL, CAST_TRIGGERED);
StartNextDialogueText(NPC_ALGALON);
}
else
StartNextDialogueText(SAY_DESPAWN_1);
}
else
m_pInstance->SetData(TYPE_ALGALON, FAIL);
// despawn everything
for (GuidList::const_iterator itr = m_lSummonedGuids.begin(); itr != m_lSummonedGuids.end(); ++itr)
{
if (Creature* pSummoned = m_creature->GetMap()->GetCreature(*itr))
pSummoned->ForcedDespawn();
}
}
示例2: DamageTaken
void DamageTaken(Unit* /*pDoneBy*/, uint32& uiDamage) override
{
// switch to phase 2 as soon as it's hit by any damage
if (m_uiPhase == PHASE_ARENA && uiDamage > 0)
{
StartNextDialogueText(SAY_JUMP);
m_uiPhase = PHASE_TRANSITION;
// prepare the hard mode if necessary
if (m_pInstance && m_pInstance->GetData(TYPE_THORIM_HARD) != FAIL)
{
if (Creature* pSif = m_pInstance->GetSingleCreatureFromStorage(NPC_SIF))
pSif->InterruptNonMeleeSpells(false);
m_pInstance->SetData(TYPE_THORIM_HARD, DONE);
}
return;
}
// handle outro
if (uiDamage >= m_creature->GetHealth())
{
uiDamage = 0;
if (!m_bEventFinished)
{
if (m_pInstance)
{
m_pInstance->SetData(TYPE_THORIM, DONE);
// start a different outro version for hard mode
if (m_pInstance->GetData(TYPE_THORIM_HARD) == DONE)
StartNextDialogueText(SPELL_STORMHAMMER_OUTRO);
else
StartNextDialogueText(SAY_DEFEATED);
}
m_creature->CastSpell(m_creature, SPELL_THORIM_CREDIT, true);
m_creature->setFaction(FACTION_ID_FRIENDLY);
m_bEventFinished = true;
EnterEvadeMode();
}
}
}
示例3: MoveInLineOfSight
void MoveInLineOfSight(Unit* pWho) override
{
// spawn the arena npcs only when players are close to Thorim in order to avoid the possible bugs
if (!m_bArenaSpawned && pWho->GetTypeId() == TYPEID_PLAYER && pWho->IsAlive() && !((Player*)pWho)->isGameMaster() && m_creature->IsWithinDistInMap(pWho, DEFAULT_VISIBILITY_INSTANCE))
{
if (m_pInstance && m_pInstance->GetData(TYPE_THORIM) != DONE)
m_pInstance->DoSpawnThorimNpcs((Player*)pWho);
m_bArenaSpawned = true;
}
ScriptedAI::MoveInLineOfSight(pWho);
}
示例4: Aggro
void Aggro(Unit* /*pWho*/) override
{
if (m_pInstance)
{
// start the counter at the first aggro
if (m_pInstance->GetData(TYPE_ALGALON) == SPECIAL)
{
m_pInstance->DoUpdateWorldState(WORLD_STATE_TIMER, 1);
m_pInstance->SetData(TYPE_ALGALON_TIMER, 60);
}
m_pInstance->SetData(TYPE_ALGALON, IN_PROGRESS);
}
DoCastSpellIfCan(m_creature, SPELL_SUPERMASSIVE_FAIL, CAST_TRIGGERED);
// Note: it's not clear wether these texts should be yelled on every aggro
StartNextDialogueText(SAY_AGGRO);
}
示例5: MovementInform
void MovementInform(uint32 uiMotionType, uint32 uiPointId) override
{
if (uiMotionType != EFFECT_MOTION_TYPE || !uiPointId)
return;
m_uiPhase = PHASE_SOLO;
m_uiAttackTimer = 1000;
m_uiChargeOrbTimer = 20000;
m_uiBerserkTimer = 5 * MINUTE * IN_MILLISECONDS;
m_creature->RemoveAurasDueToSpell(SPELL_SHEAT_OF_LIGHTNING);
// make Sif attack too if hard mode is active
if (m_pInstance && m_pInstance->GetData(TYPE_THORIM_HARD) == DONE)
{
if (Creature* pSif = m_pInstance->GetSingleCreatureFromStorage(NPC_SIF))
{
DoScriptText(SAY_SIF_EVENT, pSif);
SendAIEvent(AI_EVENT_CUSTOM_A, m_creature, pSif);
pSif->AI()->AttackStart(m_creature->getVictim());
}
}
}
示例6: DamageTaken
void DamageTaken(Unit* /*pDoneBy*/, uint32& uiDamage) override
{
if (uiDamage >= m_creature->GetHealth())
{
uiDamage = 0;
if (!m_bEventFinished)
{
if (m_pInstance)
{
m_pInstance->SetData(TYPE_FREYA, DONE);
// spawn chest loot
switch (m_pInstance->GetData(TYPE_FREYA_HARD))
{
case 0: DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_SUMMON_CHEST_0 : SPELL_SUMMON_CHEST_0_H, CAST_TRIGGERED); break;
case 1: DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_SUMMON_CHEST_1 : SPELL_SUMMON_CHEST_1_H, CAST_TRIGGERED); break;
case 2: DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_SUMMON_CHEST_2 : SPELL_SUMMON_CHEST_2_H, CAST_TRIGGERED); break;
case 3: DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_SUMMON_CHEST_3 : SPELL_SUMMON_CHEST_3_H, CAST_TRIGGERED); break;
}
// check aura stacks for achiev
if (SpellAuraHolder* pNatureAura = m_creature->GetSpellAuraHolder(SPELL_ATTUNED_TO_NATURE))
{
if (pNatureAura && pNatureAura->GetStackAmount() >= MIN_ATTUNED_NATURE_STACKS)
m_pInstance->SetSpecialAchievementCriteria(TYPE_ACHIEV_BACK_NATURE, true);
}
}
DoScriptText(SAY_EPILOGUE, m_creature);
m_creature->CastSpell(m_creature, SPELL_FREYA_CREDIT, true);
m_uiEpilogueTimer = 10000;
m_bEventFinished = true;
EnterEvadeMode();
}
}
}
示例7: UpdateAI
//.........这里部分代码省略.........
else
m_uiBerserkTimer -= uiDiff;
}
switch (m_uiPhase)
{
case PHASE_NORMAL:
if (m_uiLightBombTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_SEARING_LIGHT : SPELL_SEARING_LIGHT_H) == CAST_OK)
m_uiLightBombTimer = 20000;
}
else
m_uiLightBombTimer -= uiDiff;
if (m_uiGravityBombTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_GRAVITY_BOMB : SPELL_GRAVITY_BOMB_H) == CAST_OK)
m_uiGravityBombTimer = 20000;
}
else
m_uiGravityBombTimer -= uiDiff;
if (m_uiTanctrumTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature, SPELL_TYMPANIC_TANTRUM) == CAST_OK)
{
DoScriptText(SAY_TANCTRUM, m_creature);
DoScriptText(EMOTE_EARTH_QUAKE, m_creature);
m_uiTanctrumTimer = 60000;
}
}
else
m_uiTanctrumTimer -= uiDiff;
// start heart stage transition
if (m_creature->GetHealthPercent() < float(100 - 25 * m_uiHeartStage))
{
DoScriptText(SAY_HEART_OPEN, m_creature);
++m_uiHeartStage;
m_uiHeartTimer = 5000;
m_uiPhase = PHASE_TRANSITION;
// stop all movement
m_creature->GetMotionMaster()->MoveIdle();
}
DoMeleeAttackIfReady();
break;
case PHASE_TRANSITION:
if (m_uiHeartTimer < uiDiff)
{
// inform the heart about the phase switch
if (Creature* pHeart = m_pInstance->GetSingleCreatureFromStorage(NPC_HEART_DECONSTRUCTOR))
SendAIEvent(AI_EVENT_CUSTOM_A, m_creature, pHeart);
DoScriptText(EMOTE_HEART, m_creature);
m_creature->SetStandState(UNIT_STAND_STATE_CUSTOM);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_uiHeartTimer = 30000;
m_uiPhase = PHASE_HEART;
}
else
m_uiHeartTimer -= uiDiff;
break;
case PHASE_HEART:
// reset to normal phase when timer expires
if (m_uiHeartTimer < uiDiff)
{
DoResetToNormalPhase();
m_uiHeartTimer = 0;
// mount the heart back inside if not already killed
if (m_pInstance && m_pInstance->GetData(TYPE_XT002_HARD) != DONE)
{
if (Creature* pHeart = m_pInstance->GetSingleCreatureFromStorage(NPC_HEART_DECONSTRUCTOR))
{
pHeart->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->RemoveSpellsCausingAura(SPELL_AURA_CONTROL_VEHICLE);
pHeart->CastSpell(m_creature, SPELL_HEART_RIDE_VEHICLE, true);
// no spell found for this
pHeart->SetHealth(pHeart->GetMaxHealth());
}
}
}
else
m_uiHeartTimer -= uiDiff;
break;
}
}