本文整理汇总了C++中instance_ulduar::SetSpecialAchievementCriteria方法的典型用法代码示例。如果您正苦于以下问题:C++ instance_ulduar::SetSpecialAchievementCriteria方法的具体用法?C++ instance_ulduar::SetSpecialAchievementCriteria怎么用?C++ instance_ulduar::SetSpecialAchievementCriteria使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类instance_ulduar
的用法示例。
在下文中一共展示了instance_ulduar::SetSpecialAchievementCriteria方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateAI
void UpdateAI(const uint32 /*uiDiff*/) override
{
// Flash Freeze npcs should be always be summoned
if (!m_creature->IsTemporarySummon())
return;
// do the freezing on the first update tick
if (!m_bFreezeInit)
{
// Flash Freeze npc will always stun or kill the summoner
if (m_creature->GetEntry() == NPC_FLASH_FREEZE_NPC)
{
if (DoCastSpellIfCan(m_creature, SPELL_FLASH_FREEZE_AURA_NPC) == CAST_OK)
DoCastSpellIfCan(m_creature, SPELL_FLASH_FREEZE_INITIAL, CAST_TRIGGERED);
}
else if (m_creature->GetEntry() == NPC_FLASH_FREEZE)
{
if (Unit* pSummoner = m_creature->GetMap()->GetUnit(((TemporarySummon*)m_creature)->GetSummonerGuid()))
{
// kill frozen players
if (pSummoner->HasAura(SPELL_FREEZE))
DoCastSpellIfCan(pSummoner, SPELL_FLASH_FREEZE_KILL);
else
DoCastSpellIfCan(m_creature, SPELL_FLASH_FREEZE_AURA);
if (pSummoner->GetTypeId() == TYPEID_PLAYER && m_pInstance)
m_pInstance->SetSpecialAchievementCriteria(TYPE_ACHIEV_CHEESE_FREEZE, false);
}
}
m_bFreezeInit = true;
}
}
示例2: SpellHitTarget
void SpellHitTarget(Unit* pTarget, SpellEntry const* pSpellEntry) override
{
if (pSpellEntry->Id == SPELL_LIGHTNING_CHARGE_DAMAGE && pTarget->GetTypeId() == TYPEID_PLAYER)
{
if (m_pInstance)
m_pInstance->SetSpecialAchievementCriteria(TYPE_ACHIEV_LIGHTNING, false);
}
}
示例3: ReceiveAIEvent
void ReceiveAIEvent(AIEventType eventType, Unit* /*pSender*/, Unit* pInvoker, uint32 /*uiMiscValue*/) override
{
// count the summoned Rubble
if (eventType == AI_EVENT_CUSTOM_A && pInvoker->GetEntry() == NPC_RUBBLE_STALKER)
{
++m_uiRubbleCount;
if (m_uiRubbleCount == MAX_ACHIEV_RUBBLE && m_pInstance)
m_pInstance->SetSpecialAchievementCriteria(TYPE_ACHIEV_RUBBLE, true);
}
}
示例4: 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();
}
}
}
示例5: SpellHitTarget
void SpellHitTarget(Unit* pTarget, SpellEntry const* pSpellEntry) override
{
if (pTarget->GetTypeId() == TYPEID_PLAYER && (pSpellEntry->Id == SPELL_EYEBEAM_DAMAGE || pSpellEntry->Id == SPELL_EYEBEAM_DAMAGE_H) && m_pInstance)
m_pInstance->SetSpecialAchievementCriteria(TYPE_ACHIEV_LOOKS_KILL, false);
}
示例6: UpdateAI
//.........这里部分代码省略.........
if (m_uiRespawnLeftTimer <= uiDiff)
{
DoScriptText(EMOTE_ARM_LEFT, m_creature);
m_creature->SummonCreature(NPC_LEFT_ARM, afKoloArmsLoc[0], afKoloArmsLoc[1], afKoloArmsLoc[2], afKoloArmsLoc[3], TEMPSPAWN_DEAD_DESPAWN, 0);
m_uiRespawnLeftTimer = 0;
}
else
m_uiRespawnLeftTimer -= uiDiff;
}
// use left arm ability if available - spell always cast by Kologarn
else
{
if (m_uiShockwaveTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_ARM_SWEEP : SPELL_ARM_SWEEP_H) == CAST_OK)
{
DoScriptText(SAY_SHOCKWAVE, m_creature);
m_uiShockwaveTimer = 17000;
}
}
else
m_uiShockwaveTimer -= uiDiff;
}
// respawn right arm if killed
if (m_uiRespawnRightTimer)
{
if (m_uiRespawnRightTimer <= uiDiff)
{
DoScriptText(EMOTE_ARM_RIGHT, m_creature);
m_creature->SummonCreature(NPC_RIGHT_ARM, afKoloArmsLoc[0], afKoloArmsLoc[1], afKoloArmsLoc[2], afKoloArmsLoc[3], TEMPSPAWN_DEAD_DESPAWN, 0);
m_uiRespawnRightTimer = 0;
}
else
m_uiRespawnRightTimer -= uiDiff;
}
// use right arm ability if available - spell always cast by Kologarn
else
{
if (m_uiStoneGripTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_STONE_GRIP : SPELL_STONE_GRIP_H) == CAST_OK)
{
DoScriptText(SAY_GRAB, m_creature);
DoScriptText(EMOTE_STONE_GRIP, m_creature);
m_uiStoneGripTimer = urand(20000, 30000);
}
}
else
m_uiStoneGripTimer -= uiDiff;
}
if (m_uiBerserkTimer)
{
if (m_uiBerserkTimer <= uiDiff)
{
if (DoCastSpellIfCan(m_creature, SPELL_BERSERK) == CAST_OK)
{
if (m_pInstance)
{
if (Creature* pRightArm = m_pInstance->GetSingleCreatureFromStorage(NPC_RIGHT_ARM))
pRightArm->CastSpell(pRightArm, SPELL_BERSERK, TRIGGERED_OLD_TRIGGERED);
if (Creature* pLeftArm = m_pInstance->GetSingleCreatureFromStorage(NPC_LEFT_ARM))
pLeftArm->CastSpell(pLeftArm, SPELL_BERSERK, TRIGGERED_OLD_TRIGGERED);
}
DoScriptText(SAY_BERSERK, m_creature);
m_uiBerserkTimer = 0;
}
}
else
m_uiBerserkTimer -= uiDiff;
}
if (m_uiDisarmedTimer)
{
if (m_uiDisarmedTimer <= uiDiff)
{
if (m_pInstance)
m_pInstance->SetSpecialAchievementCriteria(TYPE_ACHIEV_DISARMED, false);
m_uiDisarmedTimer = 0;
}
else
m_uiDisarmedTimer -= uiDiff;
}
// melee range check
if (!m_creature->CanReachWithMeleeAttack(m_creature->getVictim()))
{
if (m_uiPetrifyingBreathTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_PETRIFYING_BREATH : SPELL_PETRIFYING_BREATH_H) == CAST_OK)
m_uiPetrifyingBreathTimer = 4000;
}
else
m_uiPetrifyingBreathTimer -= uiDiff;
}
else
DoMeleeAttackIfReady();
}
示例7: SummonedCreatureJustDied
void SummonedCreatureJustDied(Creature* pSummoned) override
{
if (!m_creature->isAlive() || !m_creature->getVictim())
return;
if (pSummoned->GetEntry() == NPC_LEFT_ARM)
{
if (m_pInstance)
{
if (Creature* pStalker = m_creature->GetMap()->GetCreature(m_pInstance->GetKoloRubbleStalker(false)))
{
pStalker->CastSpell(pStalker, m_bIsRegularMode ? SPELL_FALLING_RUBBLE : SPELL_FALLING_RUBBLE_H, TRIGGERED_OLD_TRIGGERED);
pStalker->CastSpell(pStalker, SPELL_SUMMON_RUBBLE, TRIGGERED_OLD_TRIGGERED);
pStalker->CastSpell(pStalker, SPELL_CANCEL_STONE_GRIP, TRIGGERED_OLD_TRIGGERED);
}
m_pInstance->SetSpecialAchievementCriteria(TYPE_ACHIEV_OPEN_ARMS, false);
}
m_creature->RemoveAurasByCasterSpell(SPELL_RIDE_KOLOGARN_ARMS, pSummoned->GetObjectGuid());
pSummoned->CastSpell(m_creature, m_bIsRegularMode ? SPELL_ARM_DEAD_DAMAGE_KOLOGARN : SPELL_ARM_DEAD_DAMAGE_KOLOGARN_H, TRIGGERED_OLD_TRIGGERED);
DoScriptText(SAY_ARM_LOST_LEFT, m_creature);
m_uiRespawnLeftTimer = 48000;
// start disarmed achiev timer or set achiev crit as true if timer already started
if (m_uiDisarmedTimer)
{
if (m_pInstance)
m_pInstance->SetSpecialAchievementCriteria(TYPE_ACHIEV_DISARMED, true);
}
else
m_uiDisarmedTimer = 12000;
}
else if (pSummoned->GetEntry() == NPC_RIGHT_ARM)
{
// spawn Rubble and cancel stone grip
if (m_pInstance)
{
if (Creature* pStalker = m_creature->GetMap()->GetCreature(m_pInstance->GetKoloRubbleStalker(true)))
{
pStalker->CastSpell(pStalker, m_bIsRegularMode ? SPELL_FALLING_RUBBLE : SPELL_FALLING_RUBBLE_H, TRIGGERED_OLD_TRIGGERED);
pStalker->CastSpell(pStalker, SPELL_SUMMON_RUBBLE, TRIGGERED_OLD_TRIGGERED);
pStalker->CastSpell(pStalker, SPELL_CANCEL_STONE_GRIP, TRIGGERED_OLD_TRIGGERED);
}
m_pInstance->SetSpecialAchievementCriteria(TYPE_ACHIEV_OPEN_ARMS, false);
}
m_creature->RemoveAurasByCasterSpell(SPELL_RIDE_KOLOGARN_ARMS, pSummoned->GetObjectGuid());
pSummoned->CastSpell(m_creature, m_bIsRegularMode ? SPELL_ARM_DEAD_DAMAGE_KOLOGARN : SPELL_ARM_DEAD_DAMAGE_KOLOGARN_H, TRIGGERED_OLD_TRIGGERED);
DoScriptText(SAY_ARM_LOST_RIGHT, m_creature);
m_uiRespawnRightTimer = 48000;
// start disarmed achiev timer or set achiev crit as true if timer already started
if (m_uiDisarmedTimer)
{
if (m_pInstance)
m_pInstance->SetSpecialAchievementCriteria(TYPE_ACHIEV_DISARMED, true);
}
else
m_uiDisarmedTimer = 12000;
}
}
示例8: UpdateAI
//.........这里部分代码省略.........
if (m_bIsGrounded)
{
SetCombatMovement(true);
DoResetThreat();
DoStartMovement(m_creature->getVictim());
m_uiPhase = PHASE_ONLY_GROUND;
}
// resume air phase
else
{
m_creature->SetLevitate(true);
m_creature->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_FLY_ANIM);
float fX, fY, fZ;
m_creature->GetRespawnCoord(fX, fY, fZ);
// use upgraded speed rate for FlyOrLand. This isn't supported by DB but it's confirmed to happen on retail
uint32 uiSpeedRate = m_creature->GetSpeedRate(MOVE_RUN);
m_creature->SetSpeedRate(MOVE_RUN, SPEED_RATE_RAZORSCALE);
m_creature->GetMotionMaster()->MoveFlyOrLand(1, fX, fY, fZ, true);
m_creature->SetSpeedRate(MOVE_RUN, uiSpeedRate);
// reset timers
m_uiPhase = PHASE_AIR;
m_uiCurrentHarpoon = 0;
m_uiHarpoonsUsed = 0;
m_uiRepairHarpoonTimer = 20000;
m_uiFireballTimer = 5000;
m_uiDevouringFlameTimer = 10000;
++m_uiFlyPhaseCount;
// set achiev criteria as failed
if (m_uiFlyPhaseCount >= 2 && m_pInstance)
m_pInstance->SetSpecialAchievementCriteria(TYPE_ACHIEV_QUICK_SHAVE, false);
}
// make the Trappers evade or move to home position
for (GuidList::const_iterator itr = m_lTrappersGuids.begin(); itr != m_lTrappersGuids.end(); ++itr)
{
if (Creature* pTrapper = m_creature->GetMap()->GetCreature(*itr))
pTrapper->AI()->EnterEvadeMode();
}
break;
}
++m_uiGroundedStep;
}
else
m_uiGroundedTimer -= uiDiff;
// make boss land at 50% hp
if (!m_bIsGrounded && m_creature->GetHealthPercent() < 50.0f)
{
DoScriptText(EMOTE_GROUNDED, m_creature);
m_creature->RemoveAurasDueToSpell(SPELL_STUN);
m_uiGroundedStep = 1;
m_uiGroundedTimer = 0;
m_bIsGrounded = true;
}
break;
case PHASE_ONLY_GROUND:
if (m_uiDevouringFlameTimer < uiDiff)
{
if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
{
示例9: JustDied
void JustDied(Unit* /*pKiller*/) override
{
// Set achiev criteria to true
if (m_pInstance)
m_pInstance->SetSpecialAchievementCriteria(TYPE_ACHIEV_NINE_LIVES, true);
}