本文整理汇总了C++中DoZoneInCombat函数的典型用法代码示例。如果您正苦于以下问题:C++ DoZoneInCombat函数的具体用法?C++ DoZoneInCombat怎么用?C++ DoZoneInCombat使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DoZoneInCombat函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateAI
//.........这里部分代码省略.........
}
CheckTimer = 2000;
} else CheckTimer -= diff;
if (RotTimer)
{
Map* pMap = me->GetMap();
if (pMap->IsDungeon())
{
Map::PlayerList const &PlayerList = pMap->GetPlayers();
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
if (i->getSource() && i->getSource()->isAlive() && me->HasInArc(float(diff/20000*M_PI*2),i->getSource()) && me->IsWithinDist(i->getSource(), SPOUT_DIST) && !i->getSource()->IsInWater())
DoCast(i->getSource(), SPELL_SPOUT, true);//only knock back palyers in arc, in 100yards, not in water
}
}
if (SpoutAnimTimer <= diff)
{
DoCast(me, SPELL_SPOUT_ANIM, true);
SpoutAnimTimer = 1000;
} else SpoutAnimTimer -= diff;
if (RotTimer <= diff)
{
RotTimer = 0;
} else RotTimer -= diff;
return;
}
if (GeyserTimer <= diff)
{
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1);
if (!pTarget && me->getVictim())
pTarget = me->getVictim();
if (pTarget)
DoCast(pTarget, SPELL_GEYSER, true);
GeyserTimer = rand()%5000 + 15000;
} else GeyserTimer -= diff;
if (!InRange)//if on players in melee range cast Waterbolt
{
if (WaterboltTimer <= diff)
{
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
if (!pTarget && me->getVictim())
pTarget = me->getVictim();
if (pTarget)
DoCast(pTarget, SPELL_WATERBOLT, true);
WaterboltTimer = 3000;
} else WaterboltTimer -= diff;
}
if (!UpdateVictim())
return;
DoMeleeAttackIfReady();
}else//submerged
{
if (PhaseTimer <= diff)
{
Submerged = false;
me->InterruptNonMeleeSpells(false);//shouldn't be any
me->RemoveAllAuras();
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
me->RemoveFlag(UNIT_NPC_EMOTESTATE,EMOTE_STATE_SUBMERGED);
DoCast(me, SPELL_EMERGE, true);
Spawned = false;
SpoutTimer = 3000; // directly cast Spout after emerging!
PhaseTimer = 120000;
return;
} else PhaseTimer-=diff;
if (me->getThreatManager().getThreatList().empty())//check if should evade
{
EnterEvadeMode();
return;
}
if (!me->isInCombat())
DoZoneInCombat();
if (!Spawned)
{
me->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
//spawn adds
for (uint8 i = 0; i < 9; ++i)
{
Creature* Summoned;
if (i < 6)
Summoned = me->SummonCreature(MOB_COILFANG_AMBUSHER,AddPos[i][0],AddPos[i][1],AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
else Summoned = me->SummonCreature(MOB_COILFANG_GUARDIAN,AddPos[i][0],AddPos[i][1],AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
if (Summoned)
Summons.Summon(Summoned);
}
Spawned = true;
}
}
}
示例2: EnterCombat
void EnterCombat(Unit* /*who*/)
{
DoCast(me, ENSLAVED_SOUL_PASSIVE, true);
DoZoneInCombat();
}
示例3: EnterCombat
void EnterCombat(Unit* /*who*/) override
{
DoZoneInCombat();
}
示例4: DoZoneInCombat
void BossAI::JustSummoned(Creature* summon)
{
summons.Summon(summon);
if (me->isInCombat())
DoZoneInCombat(summon);
}
示例5: EnterCombat
void EnterCombat(Unit* /*who*/)
{
DoScriptText(SAY_AGGRO, me);
DoZoneInCombat();
}
示例6: EnterCombat
void EnterCombat(Unit* /*who*/)
{
DoZoneInCombat();
//DoCast(me, SPELL_VAPOR_FORCE, true); core bug
}
示例7: Reset
void Reset() override
{
me->RemoveAllAuras();
DoZoneInCombat();
events.ScheduleEvent(EVENT_FADE_ARMOR, 1000);
}
示例8: JustSummoned
void JustSummoned(Creature* summon)
{
if (me->isInCombat())
DoZoneInCombat(summon);
}
示例9: JustSummoned
void JustSummoned(Creature* summon)
{
Summons.push_back(summon->GetGUID());
DoZoneInCombat(summon);
}
示例10: JustSummoned
void JustSummoned(Creature* who) override
{
DoZoneInCombat(who);
}
示例11: EnterCombat
void EnterCombat(Unit * /*who*/) {
DoCast(me, SPELL_ESSENCEOFTHERED);
DoZoneInCombat();
me->SetHealth(me->CountPctFromMaxHealth(30));
}
示例12: UpdateAI
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (!me->HasAura(SPELL_BERSERK, 0))
{
if (BerserkTimer <= diff)
DoCast(me, SPELL_BERSERK);
else BerserkTimer -= diff;
}
if (SummonFlameTimer <= diff)
{
DoCast(me, SPELL_MOLTEN_PUNCH);
SummonFlameTimer = 10000;
}
else SummonFlameTimer -= diff;
if (Phase1)
{
if (HatefulStrikeTimer <= diff)
{
if (Unit* pTarget = CalculateHatefulStrikeTarget())
{
DoCast(pTarget, SPELL_HATEFUL_STRIKE);
HatefulStrikeTimer = 5000;
}
}
else HatefulStrikeTimer -= diff;
}
if (!Phase1)
{
if (SwitchTargetTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
{
if (me->GetDistance2d(me->GetVictim()) < 40)
me->CastSpell(me->GetVictim(), SPELL_CHARGE, false);
DoResetThreat();
me->AddThreat(pTarget, 5000000.0f);
DoScriptText(EMOTE_NEW_TARGET, me);
SwitchTargetTimer = 10000;
}
}
else SwitchTargetTimer -= diff;
if (SummonVolcanoTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true))
{
DoCast(pTarget, SPELL_VOLCANIC_SUMMON);
DoScriptText(EMOTE_GROUND_CRACK, me);
SummonVolcanoTimer = 10000;
}
}
else SummonVolcanoTimer -= diff;
}
if (PhaseSwitchTimer <= diff)
{
if (!Phase1)
{
Phase1 = true;
DoResetThreat();
PhaseSwitchTimer = 60000;
me->SetSpeed(MOVE_RUN, 1.2f);
DoZoneInCombat();
me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false);
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, false);
}
else
{
Phase1 = false;
DoResetThreat();
SwitchTargetTimer = 10000;
SummonVolcanoTimer = 2000;
PhaseSwitchTimer = 60000;
me->SetSpeed(MOVE_RUN, 0.9f);
DoZoneInCombat();
me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true);
}
}
else PhaseSwitchTimer -= diff;
DoMeleeAttackIfReady();
}
示例13: UpdateAI
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim() && !events.IsInPhase(PHASE_EVENT))
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
// PHASE ONE
case EVENT_CLEAVE:
DoCastVictim(SPELL_CLEAVE);
events.ScheduleEvent(EVENT_CLEAVE, urand(6, 12)*IN_MILLISECONDS, 0, PHASE_HUMAN);
break;
case EVENT_STAGGERING_ROAR:
DoCast(me, SPELL_STAGGERING_ROAR);
events.ScheduleEvent(EVENT_STAGGERING_ROAR, urand(18, 22)*IN_MILLISECONDS, 0, PHASE_HUMAN);
break;
case EVENT_ENRAGE:
DoCast(me, SPELL_ENRAGE);
events.ScheduleEvent(EVENT_ENRAGE, urand(7, 14)*IN_MILLISECONDS, 0, PHASE_HUMAN);
break;
case EVENT_SMASH:
DoCastAOE(SPELL_SMASH);
events.ScheduleEvent(EVENT_SMASH, urand(12, 16)*IN_MILLISECONDS, 0, PHASE_HUMAN);
break;
case EVENT_JUST_TRANSFORMED:
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
DoZoneInCombat();
ScheduleSecondPhase();
return;
case EVENT_SUMMON_BANSHEE:
DoCast(me, SPELL_SUMMON_BANSHEE);
return;
// PHASE TWO
case EVENT_DARK_SMASH:
DoCastVictim(SPELL_DARK_SMASH);
events.ScheduleEvent(EVENT_DARK_SMASH, urand(12, 16)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
break;
case EVENT_DREADFUL_ROAR:
DoCast(me, SPELL_DREADFUL_ROAR);
events.ScheduleEvent(EVENT_DREADFUL_ROAR, urand(18, 22)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
break;
case EVENT_WOE_STRIKE:
DoCastVictim(SPELL_WOE_STRIKE);
events.ScheduleEvent(EVENT_WOE_STRIKE, urand(10, 14)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
break;
case EVENT_SHADOW_AXE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true))
DoCast(target, SPELL_SHADOW_AXE_SUMMON);
events.ScheduleEvent(EVENT_SHADOW_AXE, 30*IN_MILLISECONDS, 0, PHASE_UNDEAD);
break;
default:
break;
}
}
if (!events.IsInPhase(PHASE_EVENT))
DoMeleeAttackIfReady();
}
示例14: EnterCombat
void EnterCombat(Unit* who)
{
DoZoneInCombat();
}
示例15: UpdateAI
void UpdateAI(const uint32 diff)
{
if(InciteChaos)
{
if(InciteChaosWait_Timer < diff)
{
InciteChaos = false;
DoZoneInCombat();
DoResetThreat();
Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0, 50, true);
if(target)
AttackStart(target);
}
else
InciteChaosWait_Timer -= diff;
return;
}
if (!UpdateVictim())
return;
else
TrashAggro();
if(InciteChaos_Timer < diff)
{
DoCast(me, SPELL_INCITE_CHAOS);
Map *map = me->GetMap();
Map::PlayerList const &PlayerList = map->GetPlayers();
if(PlayerList.isEmpty())
return;
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
Player *plr = i->getSource();
Player *target = (Player*)SelectUnit(SELECT_TARGET_RANDOM, 0, 100, true, plr->GetGUID());
if(plr && plr->IsAIEnabled && target)
plr->AI()->AttackStart(target);
}
//DoResetThreat();
InciteChaos = true;
InciteChaos_Timer = 40000;
InciteChaosWait_Timer = 16000;
return;
}
else
InciteChaos_Timer -= diff;
//Charge_Timer
if (Charge_Timer < diff)
{
if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0, 50, true))
DoCast(target, SPELL_CHARGE);
Charge_Timer = 25000;
}
else
Charge_Timer -= diff;
//Knockback_Timer
if (Knockback_Timer < diff)
{
DoCast(me, SPELL_WAR_STOMP);
Knockback_Timer = 20000;
}
else
Knockback_Timer -= diff;
DoMeleeAttackIfReady();
}