本文整理汇总了C++中DUNGEON_MODE函数的典型用法代码示例。如果您正苦于以下问题:C++ DUNGEON_MODE函数的具体用法?C++ DUNGEON_MODE怎么用?C++ DUNGEON_MODE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DUNGEON_MODE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateAI
void UpdateAI(const uint32 uiDiff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//exploit fix, remove later
if (m_uiCheckZ <= uiDiff)
{
if (me->GetPositionZ() < 50.0f)
{
EnterEvadeMode();
return;
}
m_uiCheckZ = 1000;
}
else m_uiCheckZ -= uiDiff;
if (m_bIsStriking && !m_bMove)
{
if (m_uiPause_Timer <= uiDiff)
{
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE)
{
if (me->getVictim())
me->GetMotionMaster()->MoveChase(me->getVictim());
}
m_bHasTemper = false;
m_bIsStriking = false;
m_uiPause_Timer = 1500;
}
else
m_uiPause_Timer -= uiDiff;
return;
}
// ShatteringStomp all the Time,
if (!m_bHasTemper && !m_bMove)
{
if (m_uiShatteringStomp_Timer <= uiDiff)
{
DoScriptText(RAND(SAY_STOMP_1,SAY_STOMP_2), me);
DoCast(me, DUNGEON_MODE(SPELL_SHATTERING_STOMP_N,SPELL_SHATTERING_STOMP_H));
if (Creature* temp = me->FindNearestCreature(NPC_BRITTLE_GOLEM,99))
{
DoScriptText(EMOTE_SHATTER, me);
m_bCanShatterGolem = true;
}
m_uiShatteringStomp_Timer = 30000;
}
else
m_uiShatteringStomp_Timer -= uiDiff;
}
// Shatter Golems 3 seconds after Shattering Stomp
if (m_bCanShatterGolem)
{
if (m_uiShatter_Timer <= uiDiff)
{
ShatterGolem();
m_uiShatter_Timer = 3000;
m_bCanShatterGolem = false;
}
else
m_uiShatter_Timer -= uiDiff;
}
Creature* pAnvil = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_VOLKHAN_ANVIL));
float fX, fY, fZ;
me->GetContactPoint(pAnvil, fX, fY, fZ, INTERACTION_DISTANCE);
// Health check
if (!m_bCanShatterGolem && me->HealthBelowPct(100 - 20 * m_uiHealthAmountModifier) && !m_bMove)
{
++m_uiHealthAmountModifier;
if (me->IsNonMeleeSpellCasted(false))
me->InterruptNonMeleeSpells(false);
DoScriptText(RAND(SAY_FORGE_1,SAY_FORGE_2), me);
if (me->GetDistance(pAnvil) > 5)
{
me->GetMotionMaster()->Clear();
me->SetReactState(REACT_PASSIVE);
me->GetMotionMaster()->MovePoint(5,fX,fY,fZ);
}
DoScriptText(EMOTE_TO_ANVIL, me);
m_bMove=true;
}
if (me->IsWithinMeleeRange(pAnvil,5) && m_bMove)
//.........这里部分代码省略.........
示例2: UpdateAI
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (SpawnCount == 0 && Phase == PHASE_SUMMONS)
{
me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_INTERRUPT, false);
SpawnCount = 10;
SetCombatMovement(true);
Phase = PHASE_NORMAL;
Phased = false;
CurseBloodTimer = urand(8000,13000);
ForceGripTimer = 22000;
SummonGravityWellTimer = urand(11000,16000);
SummonDevoutTimer = urand(19000,27000);
me->RemoveAurasDueToSpell(DUNGEON_MODE(SPELL_ENERGY_SHIELD_N,SPELL_ENERGY_SHIELD_H));
}
if (me->HealthBelowPct(67) && Phase == PHASE_NORMAL && PhaseCount == 0)
{
me->MonsterYell(SAY_P2, LANG_UNIVERSAL, NULL);
me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_INTERRUPT, true);
PhaseCount++;
SetCombatMovement(false);
Phase = PHASE_SUMMONS;
DoTeleportTo(1337.89f, 963.287f, 214.184f, 1.8407);
DoCast(me, DUNGEON_MODE(SPELL_ENERGY_SHIELD_N,SPELL_ENERGY_SHIELD_H));
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true), SPELL_SEISMIC_SHARD);
me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[0].GetPositionX(),addSpawnLocations[0].GetPositionY(),addSpawnLocations[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN);
me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[1].GetPositionX(),addSpawnLocations[1].GetPositionY(),addSpawnLocations[1].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN);
me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[0].GetPositionX(),addSpawnLocations[0].GetPositionY(),addSpawnLocations[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN);
me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[1].GetPositionX(),addSpawnLocations[1].GetPositionY(),addSpawnLocations[1].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN);
me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[0].GetPositionX(),addSpawnLocations[0].GetPositionY(),addSpawnLocations[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN);
me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[1].GetPositionX(),addSpawnLocations[1].GetPositionY(),addSpawnLocations[1].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN);
me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[0].GetPositionX(),addSpawnLocations[0].GetPositionY(),addSpawnLocations[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN);
me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[1].GetPositionX(),addSpawnLocations[1].GetPositionY(),addSpawnLocations[1].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN);
me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[0].GetPositionX(),addSpawnLocations[0].GetPositionY(),addSpawnLocations[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN);
Phase2EndTimer = 60000;
}
if (me->HealthBelowPct(34) && Phase == PHASE_NORMAL && PhaseCount == 1)
{
me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_INTERRUPT, true);
me->MonsterYell(SAY_P2, LANG_UNIVERSAL, NULL);
PhaseCount++;
SetCombatMovement(false);
Phase = PHASE_SUMMONS;
DoTeleportTo(1337.89f, 963.287f, 214.184f, 1.8407);
DoCast(me, DUNGEON_MODE(SPELL_ENERGY_SHIELD_N,SPELL_ENERGY_SHIELD_H));
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true), SPELL_SEISMIC_SHARD);
me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[0].GetPositionX(),addSpawnLocations[0].GetPositionY(),addSpawnLocations[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN);
me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[1].GetPositionX(),addSpawnLocations[1].GetPositionY(),addSpawnLocations[1].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN);
me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[0].GetPositionX(),addSpawnLocations[0].GetPositionY(),addSpawnLocations[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN);
me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[1].GetPositionX(),addSpawnLocations[1].GetPositionY(),addSpawnLocations[1].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN);
me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[0].GetPositionX(),addSpawnLocations[0].GetPositionY(),addSpawnLocations[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN);
me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[1].GetPositionX(),addSpawnLocations[1].GetPositionY(),addSpawnLocations[1].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN);
me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[0].GetPositionX(),addSpawnLocations[0].GetPositionY(),addSpawnLocations[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN);
me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[1].GetPositionX(),addSpawnLocations[1].GetPositionY(),addSpawnLocations[1].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN);
me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[0].GetPositionX(),addSpawnLocations[0].GetPositionY(),addSpawnLocations[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN);
Phase2EndTimer = 60000;
}
if (CurseBloodTimer <= diff && Phase == PHASE_NORMAL)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, DUNGEON_MODE(SPELL_CURSE_OF_BLOOD_N,SPELL_CURSE_OF_BLOOD_H));
CurseBloodTimer = urand(5000,7000);
} else CurseBloodTimer -= diff;
if (ForceGripTimer <= diff && Phase == PHASE_NORMAL)
{
me->InterruptNonMeleeSpells(true);
DoCastVictim(SPELL_FORCE_GRIP);
ForceGripTimer = urand(12000,15000);
} else ForceGripTimer -= diff;
if (SummonGravityWellTimer <= diff && Phase == PHASE_NORMAL)
{
me->MonsterYell(SAY_EARTH, LANG_UNIVERSAL, NULL);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
DoCast(target, SPELL_SUMMON_GRAVITY_WELL);
SummonGravityWellTimer = urand(13000,16000);
} else SummonGravityWellTimer -= diff;
if (SummonDevoutTimer <= diff && Phase == PHASE_NORMAL)
{
me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[0].GetPositionX(),addSpawnLocations[0].GetPositionY(),addSpawnLocations[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN);
me->SummonCreature(MOB_DEVOUT_FOLLOWER, addSpawnLocations[1].GetPositionX(),addSpawnLocations[1].GetPositionY(),addSpawnLocations[1].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN);
SummonDevoutTimer = urand(19000,27000);
} else SummonDevoutTimer -= diff;
if (Phase == PHASE_SUMMONS)
{
if (Phase2EndTimer <= diff)
{
SpawnCount = 10;
SetCombatMovement(true);
//.........这里部分代码省略.........
示例3: UpdateAI
void UpdateAI(const uint32 diff)
{
if (m_bIsWalking)
{
if (m_uiPause_Timer <= diff)
{
DoScriptText(ActiveBot[m_uiActiveOrder[m_uiActivedNumber]].say, me);
DoCast(me, SPELL_CHANNEL_YMIRON_TO_SPIRIT); // should be on spirit
if (Creature* pTemp = me->SummonCreature(ActiveBot[m_uiActiveOrder[m_uiActivedNumber]].npc, ActiveBot[m_uiActiveOrder[m_uiActivedNumber]].SpawnX, ActiveBot[m_uiActiveOrder[m_uiActivedNumber]].SpawnY, ActiveBot[m_uiActiveOrder[m_uiActivedNumber]].SpawnZ, ActiveBot[m_uiActiveOrder[m_uiActivedNumber]].SpawnO, TEMPSUMMON_CORPSE_DESPAWN, 0))
{
m_uiActivedCreatureGUID = pTemp->GetGUID();
pTemp->CastSpell(me, SPELL_CHANNEL_SPIRIT_TO_YMIRON, true);
pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
pTemp->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
switch(m_uiActiveOrder[m_uiActivedNumber])
{
case 0: m_bIsActiveWithBJORN = true; break;
case 1: m_bIsActiveWithHALDOR = true; break;
case 2: m_bIsActiveWithRANULF = true; break;
case 3: m_bIsActiveWithTORGYN = true; break;
}
}
m_bIsPause = true;
m_bIsWalking = false;
m_uiPause_Timer = 3000;
} else m_uiPause_Timer -= diff;
return;
}
else if (m_bIsPause)
{
if (m_uiPause_Timer <= diff)
{
m_uiAbility_BJORN_Timer = 5000;
m_uiAbility_HALDOR_Timer = 5000;
m_uiAbility_RANULF_Timer = 5000;
m_uiAbility_TORGYN_Timer = 5000;
m_bIsPause = false;
m_uiPause_Timer = 0;
} else m_uiPause_Timer -= diff;
return;
}
//Return since we have no target
if (!UpdateVictim())
return;
if (!m_bIsPause)
{
// Normal spells ------------------------------------------------------------------------
if (m_uiBane_Timer <= diff)
{
DoCast(me, SPELL_BANE);
m_uiBane_Timer = urand(20000, 25000);
} else m_uiBane_Timer -= diff;
if (m_uiFetidRot_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_FETID_ROT);
m_uiFetidRot_Timer = urand(10000, 15000);
} else m_uiFetidRot_Timer -= diff;
if (m_uiDarkSlash_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_DARK_SLASH);
m_uiDarkSlash_Timer = urand(30000, 35000);
} else m_uiDarkSlash_Timer -= diff;
if (m_uiAncestors_Vengeance_Timer <= diff)
{
DoCast(me, SPELL_ANCESTORS_VENGEANCE);
m_uiAncestors_Vengeance_Timer = DUNGEON_MODE(urand(60000, 65000), urand(45000, 50000));
} else m_uiAncestors_Vengeance_Timer -= diff;
// Abilities ------------------------------------------------------------------------------
if (m_bIsActiveWithBJORN && m_uiAbility_BJORN_Timer <= diff)
{
//DoCast(me, SPELL_SUMMON_SPIRIT_FOUNT); // works fine, but using summon has better control
if (Creature* pTemp = me->SummonCreature(CREATURE_SPIRIT_FOUNT, 385.0f + rand() % 10, -330.0f + rand() % 10, 104.756f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 180000))
{
pTemp->SetSpeed(MOVE_RUN, 0.4f);
pTemp->CastSpell(pTemp, DUNGEON_MODE(SPELL_SPIRIT_FOUNT, H_SPELL_SPIRIT_FOUNT), true);
pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
pTemp->SetDisplayId(11686);
m_uiOrbGUID = pTemp->GetGUID();
}
m_bIsActiveWithBJORN = false; // only one orb
} else m_uiAbility_BJORN_Timer -= diff;
if (m_bIsActiveWithHALDOR && m_uiAbility_HALDOR_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_SPIRIT_STRIKE);
m_uiAbility_HALDOR_Timer = 5000; // overtime
} else m_uiAbility_HALDOR_Timer -= diff;
if (m_bIsActiveWithRANULF && m_uiAbility_RANULF_Timer <= diff)
{
DoCast(me, SPELL_SPIRIT_BURST);
m_uiAbility_RANULF_Timer = 10000; // overtime
//.........这里部分代码省略.........
示例4: JustSummoned
void JustSummoned(Creature* summon)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
summon->CastSpell(target, DUNGEON_MODE(SPELL_STAMPEDE_DMG, H_SPELL_STAMPEDE_DMG),true);
}
示例5: UpdateAI
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (uiPhaseTimer <= diff)
{
switch (Phase)
{
case CASTING_FLAME_SPHERES:
{
Creature* pSpheres[3];
//DoCast(me, SPELL_FLAME_SPHERE_SUMMON_1);
pSpheres[0] = DoSpawnCreature(CREATURE_FLAME_SPHERE, 0, 0, 5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10*IN_MILLISECONDS);
Unit* pSphereTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
if (pSphereTarget && pSpheres[0])
{
float angle, x, y;
angle = pSpheres[0]->GetAngle(pSphereTarget);
x = pSpheres[0]->GetPositionX() + DATA_SPHERE_DISTANCE * std::cos(angle);
y = pSpheres[0]->GetPositionY() + DATA_SPHERE_DISTANCE * std::sin(angle);
pSpheres[0]->GetMotionMaster()->MovePoint(0, x, y, pSpheres[0]->GetPositionZ());
}
if (IsHeroic())
{
//DoCast(me, H_SPELL_FLAME_SPHERE_SUMMON_1);
pSpheres[1] = DoSpawnCreature(H_CREATURE_FLAME_SPHERE_1, 0, 0, 5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10*IN_MILLISECONDS);
//DoCast(me, H_SPELL_FLAME_SPHERE_SUMMON_2);
pSpheres[2] = DoSpawnCreature(H_CREATURE_FLAME_SPHERE_2, 0, 0, 5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10*IN_MILLISECONDS);
if (pSphereTarget && pSpheres[1] && pSpheres[2])
{
float angle, x, y;
angle = pSpheres[1]->GetAngle(pSphereTarget) + DATA_SPHERE_ANGLE_OFFSET;
x = pSpheres[1]->GetPositionX() + DATA_SPHERE_DISTANCE/2 * std::cos(angle);
y = pSpheres[1]->GetPositionY() + DATA_SPHERE_DISTANCE/2 * std::sin(angle);
pSpheres[1]->GetMotionMaster()->MovePoint(0, x, y, pSpheres[1]->GetPositionZ());
angle = pSpheres[2]->GetAngle(pSphereTarget) - DATA_SPHERE_ANGLE_OFFSET;
x = pSpheres[2]->GetPositionX() + DATA_SPHERE_DISTANCE/2 * std::cos(angle);
y = pSpheres[2]->GetPositionY() + DATA_SPHERE_DISTANCE/2 * std::sin(angle);
pSpheres[2]->GetMotionMaster()->MovePoint(0, x, y, pSpheres[2]->GetPositionZ());
}
}
Phase = NORMAL;
uiPhaseTimer = 0;
break;
}
case JUST_VANISHED:
if (Unit* pEmbraceTarget = GetEmbraceTarget())
{
me->GetMotionMaster()->Clear();
me->SetSpeed(MOVE_WALK, 2.0f, true);
me->GetMotionMaster()->MoveChase(pEmbraceTarget);
}
Phase = VANISHED;
uiPhaseTimer = 1300;
break;
case VANISHED:
if (Unit* pEmbraceTarget = GetEmbraceTarget())
DoCast(pEmbraceTarget, DUNGEON_MODE(SPELL_EMBRACE_OF_THE_VAMPYR, H_SPELL_EMBRACE_OF_THE_VAMPYR));
Talk(SAY_FEED);
me->GetMotionMaster()->Clear();
me->SetSpeed(MOVE_WALK, 1.0f, true);
me->GetMotionMaster()->MoveChase(me->getVictim());
Phase = FEEDING;
uiPhaseTimer = 20*IN_MILLISECONDS;
break;
case FEEDING:
Phase = NORMAL;
uiPhaseTimer = 0;
uiEmbraceTarget = 0;
break;
case NORMAL:
if (uiBloodthirstTimer <= diff)
{
DoCast(me, SPELL_BLOODTHIRST);
uiBloodthirstTimer = 10*IN_MILLISECONDS;
} else uiBloodthirstTimer -= diff;
if (uiFlamesphereTimer <= diff)
{
// because TARGET_UNIT_TARGET_ENEMY we need a target selected to cast
DoCastVictim(SPELL_CONJURE_FLAME_SPHERE);
Phase = CASTING_FLAME_SPHERES;
uiPhaseTimer = 3*IN_MILLISECONDS + diff;
uiFlamesphereTimer = 15*IN_MILLISECONDS;
} else uiFlamesphereTimer -= diff;
if (uiVanishTimer <= diff)
{
//Count alive players
Unit* target = NULL;
std::list<HostileReference*> t_list = me->getThreatManager().getThreatList();
std::vector<Unit*> target_list;
for (std::list<HostileReference*>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
target = Unit::GetUnit(*me, (*itr)->getUnitGuid());
// exclude pets & totems
if (target && target->GetTypeId() == TYPEID_PLAYER && target->isAlive())
target_list.push_back(target);
//.........这里部分代码省略.........
示例6: UpdateAI
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
if (uiSpawnTimer <= diff)
{
uint32 spawnNumber = urand(2, DUNGEON_MODE(3, 5));
for (uint8 i = 0; i < spawnNumber; ++i)
if (Creature* temp = DoSummon(RAND(NPC_DRAKKARI_INVADER_1, NPC_DRAKKARI_INVADER_2), AddSpawnPoint, 0, TEMPSUMMON_DEAD_DESPAWN))
{
if (temp->GetAI())
{
temp->GetAI()->AttackStart(me);
temp->AddThreat(me, 5000000.0f);
}
}
uiSpawnTimer = urand(30*IN_MILLISECONDS, 40*IN_MILLISECONDS);
} else uiSpawnTimer -= diff;
if (uiConsumeTimer <= diff)
{
std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
if (!t_list.empty())
{
for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
if (Unit* target = Unit::GetUnit((*me), (*itr)->getUnitGuid()))
{
if (me->GetDistance(target) <= 50.0f && target->isAlive() && me->IsValidAttackTarget(target))
{
// Apply aura for every target in 50yards ~ 45m
DoCast(me, DUNGEON_MODE(SPELL_CONSUME_AURA, H_SPELL_CONSUME), true);
}
}
}
}
DoScriptText(SAY_CONSUME, me);
DoCast(SPELL_CONSUME);
uiConsumeTimer = 15*IN_MILLISECONDS;
} else uiConsumeTimer -= diff;
if (consumptionJunction)
{
Aura* ConsumeAura = me->GetAura(DUNGEON_MODE(SPELL_CONSUME_AURA, H_SPELL_CONSUME_AURA));
if (ConsumeAura && ConsumeAura->GetStackAmount() > 9)
consumptionJunction = false;
}
if (uiCrushTimer <= diff)
{
DoCastVictim(SPELL_CRUSH);
uiCrushTimer = urand(10*IN_MILLISECONDS, 15*IN_MILLISECONDS);
} else uiCrushTimer -= diff;
if (uiInfectedWoundTimer <= diff)
{
DoCastVictim(SPELL_INFECTED_WOUND);
uiInfectedWoundTimer = urand(25*IN_MILLISECONDS, 35*IN_MILLISECONDS);
} else uiInfectedWoundTimer -= diff;
if (uiExplodeCorpseTimer <= diff)
{
std::list<Creature*> addList;
me->GetCreatureListWithEntryInGrid(addList,NPC_DRAKKARI_INVADER_1, 10.0f);
me->GetCreatureListWithEntryInGrid(addList,NPC_DRAKKARI_INVADER_2, 10.0f);
if(!addList.empty())
{
DoCast(SPELL_CORPSE_EXPLODE);
DoScriptText(SAY_EXPLODE, me);
for(std::list<Creature*>::iterator i = addList.begin(); i != addList.end(); i++)
{
if ((*i))
{
if(!(*i)->isAlive())
{
DoCast((*i), DUNGEON_MODE(SPELL_CORPSE_EXPLODE_NH, SPELL_CORPSE_EXPLODE_HC), true);
(*i)->DespawnOrUnsummon();
}
}
}
}
uiExplodeCorpseTimer = urand(15*IN_MILLISECONDS, 19*IN_MILLISECONDS);
} else uiExplodeCorpseTimer -= diff;
DoMeleeAttackIfReady();
}
示例7: UpdateAI
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (Fireball_Timer <= diff)
{
if (Unit* victim = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(victim, DUNGEON_MODE(SPELL_FIREBALL, SPELL_FIREBALL_H), true);
Fireball_Timer = urand(4000, 7000);
}
else
Fireball_Timer -= diff;
if (flight) // phase 1 - the flight
{
Creature* Vazruden = Unit::GetCreature(*me, VazrudenGUID);
if (Fly_Timer < diff || !(Vazruden && Vazruden->isAlive() && Vazruden->HealthAbovePct(20)))
{
flight = false;
BellowingRoar_Timer = 6000;
ConeOfFire_Timer = 12000;
me->SetLevitate(false);
me->SetWalk(true);
me->GetMotionMaster()->Clear();
if (Unit* victim = SelectTarget(SELECT_TARGET_NEAREST, 0))
me->AI()->AttackStart(victim);
DoStartMovement(me->getVictim());
DoScriptText(EMOTE, me);
return;
}
else
Fly_Timer -= diff;
if (Turn_Timer <= diff)
{
uint32 waypoint = (Fly_Timer/10000)%2;
if (!me->IsWithinDist3d(VazrudenRing[waypoint][0], VazrudenRing[waypoint][1], VazrudenRing[waypoint][2], 5))
me->GetMotionMaster()->MovePoint(0, VazrudenRing[waypoint][0], VazrudenRing[waypoint][1], VazrudenRing[waypoint][2]);
Turn_Timer = 10000;
}
else
Turn_Timer -= diff;
}
else // phase 2 - land fight
{
if (ConeOfFire_Timer <= diff)
{
DoCast(me, DUNGEON_MODE(SPELL_CONE_OF_FIRE, SPELL_CONE_OF_FIRE_H));
ConeOfFire_Timer = 12000;
Fireball_Timer = 4000;
}
else
ConeOfFire_Timer -= diff;
if (IsHeroic())
{
if (BellowingRoar_Timer <= diff)
{
DoCast(me, SPELL_BELLOWING_ROAR);
BellowingRoar_Timer = 45000;
}
else
BellowingRoar_Timer -= diff;
}
DoMeleeAttackIfReady();
}
}
示例8: Reset
void Reset()
{
uidespawnTimer = DUNGEON_MODE(15000, 33000);
events.ScheduleEvent(EVENT_ERUPTION, DUNGEON_MODE(5000, 3000));
DoCast(SPELL_LAVA_FISSURE_DUM);
}
示例9: UpdateAI
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
if (!bGoToColossus && HealthBelowPct(50))
{
if (Creature *pColossus = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_DRAKKARI_COLOSSUS) : 0))
{
if (!CAST_AI(boss_drakkari_colossus::boss_drakkari_colossusAI,pColossus->AI())->HealthBelowPct(6))
{
me->InterruptNonMeleeSpells(true);
DoCast(pColossus, SPELL_MERGE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
bGoToColossus = true;
}
}
}
if (bGoToColossus)
{
if (uiDisappearTimer <= diff)
{
if (Creature *pColossus = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_DRAKKARI_COLOSSUS) : 0))
{
CAST_AI(boss_drakkari_colossus::boss_drakkari_colossusAI, pColossus->AI())->CreatureState(pColossus, true);
CAST_AI(boss_drakkari_colossus::boss_drakkari_colossusAI, pColossus->AI())->bHealth1 = false;
}
me->DisappearAndDie();
} else uiDisappearTimer -= diff;
}
if (uiSurgeTimer <= diff)
{
DoCast(me->getVictim(), SPELL_SURGE);
uiSurgeTimer = urand(15000, 25000);
} else uiSurgeTimer -= diff;
if (uiMojoWaveTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
DoCast(pTarget, DUNGEON_MODE(SPELL_MOJO_WAVE, H_SPELL_MOJO_WAVE));
uiMojoWaveTimer = urand(10000, 20000);
}
} else uiMojoWaveTimer -= diff;
// switch mojo volley max targets 1<->2
if (uiSwitchTimer <= diff)
{
uint32 maxtargets = urand(1,2);
SpellEntry* TempSpell;
TempSpell = GET_SPELL(DUNGEON_MODE(SPELL_MOJO_VOLLEY_TRIGGERED,H_SPELL_MOJO_VOLLEY_TRIGGERED));
if (TempSpell)
TempSpell->MaxAffectedTargets = maxtargets;
uiSwitchTimer = 2*IN_MILLISECONDS;
} else uiSwitchTimer -= diff;
DoMeleeAttackIfReady();
}
示例10: UpdateAI
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (uiCheckIntenseColdTimer < diff /*&& !bMoreThanTwoIntenseCold*/)
{
/*std::list<HostileReference*> ThreatList = me->getThreatManager().getThreatList();
for (std::list<HostileReference*>::const_iterator itr = ThreatList.begin(); itr != ThreatList.end(); ++itr)
{
Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
if (!pTarget || pTarget->GetTypeId() != TYPEID_PLAYER)
continue;
Aura *AuraIntenseCold = pTarget->GetAura(SPELL_INTENSE_COLD_TRIGGERED);
if (AuraIntenseCold && AuraIntenseCold->GetStackAmount() > 2)
{
bMoreThanTwoIntenseCold = true;
break;
}
}*/
Map::PlayerList const &players = pInstance->instance->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
Aura *AuraIntenseCold = itr->getSource()->GetAura(SPELL_INTENSE_COLD_TRIGGERED);
if (AuraIntenseCold)
if (AuraIntenseCold->GetStackAmount() > 2)
lMoreThanTwoIntenseCold.insert(itr->getSource()->GetGUID());
}
uiCheckIntenseColdTimer = 2*IN_MILLISECONDS;
} else uiCheckIntenseColdTimer -= diff;
if (!bEnrage && HealthBelowPct(25))
{
DoScriptText(SAY_ENRAGE, me);
DoCast(me, SPELL_ENRAGE);
bEnrage = true;
}
if (uiCrystalfireBreathTimer <= diff)
{
DoCast(me->getVictim(), SPELL_CRYSTALFIRE_BREATH);
uiCrystalfireBreathTimer = 14*IN_MILLISECONDS;
} else uiCrystalfireBreathTimer -= diff;
if (uiTailSweepTimer <= diff)
{
DoCast(me, SPELL_TAIL_SWEEP);
uiTailSweepTimer = 5*IN_MILLISECONDS;
} else uiTailSweepTimer -= diff;
if (uiCrystalChainsCrystalizeTimer <= diff)
{
DoScriptText(SAY_CRYSTAL_NOVA, me);
if (IsHeroic())
DoCast(me, SPELL_CRYSTALIZE);
else if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_CRYSTAL_CHAINS);
uiCrystalChainsCrystalizeTimer = DUNGEON_MODE(30*IN_MILLISECONDS,11*IN_MILLISECONDS);
} else uiCrystalChainsCrystalizeTimer -= diff;
DoMeleeAttackIfReady();
}
示例11: EnterCombat
void EnterCombat(Unit* /*who*/)
{
DoCast(me, DUNGEON_MODE(SPELL_MOJO_VOLLEY,H_SPELL_MOJO_VOLLEY));
}
示例12: UpdateAI
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (TargetTimer <= diff && Enslaved == false)
{
EnslaveTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
TargetTimer = 1000;
} else TargetTimer -= diff;
if (EnslaveEndTimer <= diff && Enslaved == true)
{
me->SetReactState(REACT_AGGRESSIVE);
EnslaveTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
EnslaveTarget->RemoveAurasDueToSpell(SPELL_ENSLAVE);
EnslaveTarget->RemoveAurasDueToSpell(SPELL_ENSLAVE_BUFF);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
Enslaved = false;
EnslaveTimer = 30000;
AbsorbMagicTimer = 20000;
MindFogTimer = urand(6000,12000);
UnrelentingAgonyTimer = 10000;
EnslaveEndTimer = 90000;
} else EnslaveEndTimer -= diff;
if (EnslaveTimer <= diff && Enslaved == false)
{
if (EnslaveTarget)
{
DoZoneInCombat();
me->SetReactState(REACT_PASSIVE);
DoCast(EnslaveTarget, SPELL_ENSLAVE);
DoCast(EnslaveTarget, SPELL_ENSLAVE_BUFF);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
DoScriptText(RAND(SAY_MIND_CONTROL_1,SAY_MIND_CONTROL_2,SAY_MIND_CONTROL_3), me);
Enslaved = true;
EnslaveTimer = 180000;
AbsorbMagicTimer = 180000;
MindFogTimer = 180000;
UnrelentingAgonyTimer = 180000;
EnslaveEndTimer = DUNGEON_MODE(60000,30000);
CastTimer = 2000;
}
EnslaveTimer = 1000;
} else EnslaveTimer -= diff;
if (EnslaveTarget && Enslaved == true)
if (EnslaveTarget->HealthBelowPct(50))
{
me->SetReactState(REACT_AGGRESSIVE);
EnslaveTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
EnslaveTarget->RemoveAurasDueToSpell(SPELL_ENSLAVE);
EnslaveTarget->RemoveAurasDueToSpell(SPELL_ENSLAVE_BUFF);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
Enslaved = false;
EnslaveTimer = 30000;
AbsorbMagicTimer = 20000;
MindFogTimer = urand(6000,12000);
UnrelentingAgonyTimer = 10000;
}
if (CastTimer <= diff && Enslaved == true)
{
if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, NotCharmedTargetSelector()))
{
switch(EnslaveTarget->getClass())
{
case CLASS_DRUID:
if (urand(0, 1))
EnslaveTarget->CastSpell(target, 8921, false);
else
EnslaveTarget->CastSpell(me, 774, false);
break;
case CLASS_HUNTER:
EnslaveTarget->CastSpell(target, RAND(2643, 1978), false);
break;
case CLASS_MAGE:
EnslaveTarget->CastSpell(target, RAND(44614, 30455), false);
break;
case CLASS_WARLOCK:
EnslaveTarget->CastSpell(target, RAND(980, 686), true);
break;
case CLASS_WARRIOR:
EnslaveTarget->CastSpell(target, RAND(46924, 845), false);
break;
case CLASS_PALADIN:
if (urand(0, 1))
EnslaveTarget->CastSpell(target, 853, false);
else
EnslaveTarget->CastSpell(me, 20473, false);
break;
case CLASS_PRIEST:
if (urand(0,1))
EnslaveTarget->CastSpell(target, 34914, false);
else
EnslaveTarget->CastSpell(me, 139, false);
break;
case CLASS_SHAMAN:
if (urand(0,1))
//.........这里部分代码省略.........
示例13: UpdateAI
void UpdateAI(const uint32 uiDiff)
{
//Return since we have no target
if (!UpdateVictim())
return;
if (!bIsFrenzy && HealthBelowPct(25) && !bIsExploded)
{
DoScriptText(SAY_ENRAGE, me);
DoCast(me, DUNGEON_MODE(SPELL_FRENZY,SPELL_FRENZY_H), true);
bIsFrenzy = true;
}
if (!bIsFrenzy)
{
if (uiBubbleCheckerTimer <= uiDiff)
{
if (!bIsExploded)
{
if (!me->HasAura(SPELL_PROTECTIVE_BUBBLE, 0))
{
DoScriptText(SAY_SHATTER, me);
DoCast(me, SPELL_DRAINED);
DoCast(me, SPELL_BURST, true);
bIsExploded = true;
me->AttackStop();
me->SetVisible(false);
for (uint8 i = 0; i < 10; i++)
{
int tmp = urand(0, MAX_SPAWN_LOC-1);
me->SummonCreature(NPC_ICHOR_GLOBULE, SpawnLoc[tmp], TEMPSUMMON_CORPSE_DESPAWN);
}
}
}
else
{
bool bIsWaterElementsAlive = false;
if (!m_waterElements.empty())
{
for (std::list<uint64>::const_iterator itr = m_waterElements.begin(); itr != m_waterElements.end(); ++itr)
if (Creature* pTemp = Unit::GetCreature(*me, *itr))
if (pTemp->isAlive())
{
bIsWaterElementsAlive = true;
break;
}
}
if (!bIsWaterElementsAlive)
DoExplodeCompleted();
}
uiBubbleCheckerTimer = 1000;
}
else uiBubbleCheckerTimer -= uiDiff;
}
if (!bIsExploded)
{
if (uiWaterBoltVolleyTimer <= uiDiff)
{
if(!me->IsNonMeleeSpellCasted(false))
{
DoCast(me, DUNGEON_MODE(SPELL_WATER_BOLT_VOLLEY,SPELL_WATER_BOLT_VOLLEY_H));
uiWaterBoltVolleyTimer = urand(10000, 15000);
}
}
else uiWaterBoltVolleyTimer -= uiDiff;
if (uiWaterBlastTimer <= uiDiff)
{
if(!me->IsNonMeleeSpellCasted(false))
{
DoCast(me->getVictim(), DUNGEON_MODE(SPELL_WATER_BLAST,SPELL_WATER_BLAST_H));
uiWaterBlastTimer = urand(10000, 15000);
}
}
else uiWaterBlastTimer -= uiDiff;
DoMeleeAttackIfReady();
}
}
示例14: EnterCombat
void EnterCombat(Unit* who)
{
DoCast(DUNGEON_MODE(SPELL_EMPOWERING_BLOWS, SPELL_EMPOWERING_BLOWS_H));
}
示例15: UpdateAI
void UpdateAI(uint32 const diff)
{
if (me->IsVisible() && !_movementStarted)
{
_movementStarted = true;
_wpReached = true;
_events.ScheduleEvent(EVENT_CLOUD, urand(5, 10) *IN_MILLISECONDS);
_events.ScheduleEvent(EVENT_LEECH, urand(7, 12) *IN_MILLISECONDS);
_events.ScheduleEvent(EVENT_UNSTUCK, 3*IN_MILLISECONDS);
_events.ScheduleEvent(EVENT_SPAWN, 1*IN_MILLISECONDS);
}
if (_wpReached)
{
_wpReached = false;
if (me->isInCombat())
{
me->SetReactState(REACT_AGGRESSIVE);
_events.ScheduleEvent(EVENT_FORCEMOVE, urand(7, 10) *IN_MILLISECONDS);
}
else
me->GetMotionMaster()->MovePoint(_wpCount, HadronoxWaypoints[_wpCount]);
}
if (!UpdateVictim() && _engaged)
return;
_events.Update(diff);
if (me->HasUnitState(UNIT_STAT_CASTING))
return;
while (uint32 eventId = _events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_CLOUD:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 60, false))
DoCast(target, DUNGEON_MODE(SPELL_ACID_CLOUD, H_SPELL_ACID_CLOUD));
_events.ScheduleEvent(EVENT_CLOUD, urand(25, 35) *IN_MILLISECONDS);
break;
case EVENT_LEECH:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 20, false))
DoCast(target, DUNGEON_MODE(SPELL_LEECH_POISON, H_SPELL_LEECH_POISON));
_events.ScheduleEvent(EVENT_LEECH, urand(10, 20) *IN_MILLISECONDS);
break;
case EVENT_PIECRE:
DoCastVictim(SPELL_PIERCE_ARMOR);
_events.ScheduleEvent(EVENT_PIECRE, urand(15, 20) *IN_MILLISECONDS);
break;
case EVENT_GRAB:
DoCast(me, DUNGEON_MODE(SPELL_WEB_GRAB, H_SPELL_WEB_GRAB));
DoCast(me, DUNGEON_MODE(SPELL_ACID_CLOUD, H_SPELL_ACID_CLOUD));
_events.ScheduleEvent(EVENT_GRAB, urand(17, 23) *IN_MILLISECONDS);
break;
case EVENT_SPAWN:
me->SummonCreature(RAND(NPC_ADD_CHAMPION, NPC_ADD_CRYPT_FIEND, NPC_ADD_NECROMANCER), AddWaypoints[0]);
_events.ScheduleEvent(EVENT_SPAWN, urand(1500, 3000));
break;
case EVENT_FORCEMOVE:
me->SetReactState(REACT_PASSIVE);
me->GetMotionMaster()->MovePoint(_wpCount, HadronoxWaypoints[_wpCount]);
break;
case EVENT_UNSTUCK:
if (me->getVictim())
if (me->IsWithinCombatRange(me->getVictim(), 10.0f) && !me->IsWithinLOSInMap(me->getVictim()))
me->GetMotionMaster()->MoveJump(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 10.0f, 1.0f, 1.0f);
if (_engaged)
{
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 150.0f, true);
if (!target)
EnterEvadeMode();
}
_events.ScheduleEvent(EVENT_UNSTUCK, 3*IN_MILLISECONDS);
break;
}
}
DoMeleeAttackIfReady();
}