本文整理汇总了C++中doCast函数的典型用法代码示例。如果您正苦于以下问题:C++ doCast函数的具体用法?C++ doCast怎么用?C++ doCast使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了doCast函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: UpdateAI
void UpdateAI(const uint32 diff)
{
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) return;
timedCast(SPELL_Fear, diff);
if (EnemiesInRange(10.0f) > 2)
timedCast(SPELL_HELLFIRE, diff);
timedCast(SPELL_Unstable_Affliction, diff);
if (timedQuery(SPELL_Shadow_Bolt, diff))
{
switch (urand(0,5))
{
case 0:
doCast(SPELL_Searing_Pain);
break;
case 1: case 2:
doCast(SPELL_Shadow_Bolt);
break;
case 3:
doCast(SPELL_CORRUPTION);
break;
case 4:
doCast(SPELL_Curse_of_Agony);
break;
case 5:
doCast(SPELL_Curse_of_Exhaustion);
break;
}
}
boss_faction_championsAI::UpdateAI(diff);
}
开发者ID:Subv,项目名称:diamondcore,代码行数:34,代码来源:boss_faction_champions.cpp
示例2: Aggro
void Aggro(Unit *pWho)
{
if(!pInstance) return;
if (pWho->GetTypeId() != TYPEID_PLAYER)
return;
Creature* pBlightTarget = m_creature->GetMap()->GetCreature(blightTargetGUID);
pInstance->SetData(TYPE_FESTERGUT, IN_PROGRESS);
DoScriptText(-1631203,m_creature,pWho);
if (pBlightTarget && !pBlightTarget->isAlive())
pBlightTarget->Respawn();
if (pBlightTarget)
{
pBlightTarget->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pBlightTarget->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
doRemove(SPELL_BLIGHT_VISUAL_1,pBlightTarget);
doRemove(SPELL_BLIGHT_VISUAL_2,pBlightTarget);
doRemove(SPELL_BLIGHT_VISUAL_3,pBlightTarget);
doCast(SPELL_BLIGHT_VISUAL_1,pBlightTarget);
}
doCast(SPELL_GASEOUS_BLIGHT_1);
doRemoveFromAll(SPELL_BLIGHT_VISUAL_3);
doRemoveFromAll(SPELL_BLIGHT_VISUAL_2);
doRemoveFromAll(SPELL_BLIGHT_VISUAL_1);
/* for(uint8 i = 0; i < 3; ++i)
if (pPuddleStalkerGUID[i])
doCast(SPELL_GASEOUS_SPIGOT, m_creature->GetMap()->GetCreature(pPuddleStalkerGUID[i]));
*/
}
开发者ID:Telaris,项目名称:scriptdev2,代码行数:30,代码来源:boss_festergut.cpp
示例3: CheckBlink
void CheckBlink(uint32 diff)
{
if (GetBotCommandState() == COMMAND_STAY || me->IsMounted()) return;
if (!BLINK || Blink_cd > diff || me->getLevel() < 20 || IsCasting()) return;
if (!me->IsInCombat() && me->GetExactDist(master) > std::max(float(master->GetBotFollowDist()), 35.f) &&
me->HasInArc(M_PI*0.75f, master))
{
temptimer = GC_Timer;
if (doCast(me, BLINK))
{
Blink_cd = 13000;
GC_Timer = temptimer;
}
return;
}
if (!me->getAttackers().empty() && me->GetExactDist(master) > 15)
{
if (Unit* op = me->SelectNearestTarget(7))
{
if (op->GetVictim() == me)
{
me->SetFacingTo(me->GetAngle(master));
temptimer = GC_Timer;
if (doCast(me, BLINK))
{
Blink_cd = 13000;
GC_Timer = temptimer;
}
}
}
}
}
开发者ID:sunshitwowsucks,项目名称:ArkCORE-NG,代码行数:32,代码来源:bot_mage_ai.cpp
示例4: CheckBlink
void CheckBlink(uint32 diff)
{
if (GetBotCommandState() == COMMAND_STAY || me->IsMounted()) return;
if (Blink_cd > diff || me->getLevel() < 20 || IsCasting()) return;
if (me->GetExactDist(master) > std::max(float(master->GetBotFollowDist()), 25.f)/* && me->IsWithinLOSInMap(master)*/)
{
me->SetFacingTo(me->GetAngle(master));
if (doCast(me, BLINK))
{
Blink_cd = 15000 - me->getLevel()/4 * 100; //13 sec with improved
GC_Timer = 500;
}
return;
}
if (!me->getAttackers().empty() && me->GetExactDist(master) > 15)
{
if (Unit* op = me->SelectNearestTarget(10))
{
if (op->GetVictim() == me)
{
me->SetFacingTo(me->GetAngle(master));
if (doCast(me, BLINK))
{
Blink_cd = 15000 - me->getLevel()/4 * 100; //13 sec with improved
GC_Timer = 500;
}
}
}
}
}
开发者ID:ddark,项目名称:ecl,代码行数:30,代码来源:bot_mage_ai.cpp
示例5: CheckPots
void CheckPots(uint32 diff)
{
if (me->IsMounted() || IsCasting()) return;
if (GetHealthPCT(me) < 67 && Potion_cd <= diff)
{
temptimer = GC_Timer;
if (doCast(me, HEALINGPOTION))
{
Potion_cd = POTION_CD;
GC_Timer = temptimer;
}
}
if (GetManaPCT(me) < 35 && Rand() < 35)
{
if (EVOCATION && Evocation_cd <= diff && !me->isMoving() &&
me->getAttackers().empty() && doCast(me, EVOCATION))
Evocation_cd = 60000;
else if (Potion_cd <= diff)
{
temptimer = GC_Timer;
if (doCast(me, MANAPOTION))
{
Potion_cd = POTION_CD;
GC_Timer = temptimer;
}
}
}
}
开发者ID:sunshitwowsucks,项目名称:ArkCORE-NG,代码行数:29,代码来源:bot_mage_ai.cpp
示例6: doBeacon
void doBeacon(bool command = false)
{
if (command)
{
for(uint8 i = 0; i < getSpellData(SPELL_BEACON); ++i)
{
if (Unit* pTarget = doSelectRandomPlayer(SPELL_BEACON, false, 100.0f))
{
if (doCast(SPELL_BEACON, pTarget) == CAST_OK)
marked[i] = pTarget;
else marked[i] = NULL;
}
}
conflagated = true;
}
else
{
m_creature->InterruptNonMeleeSpells(true);
for(uint8 i = 0; i < getSpellData(SPELL_BEACON); ++i)
{
if (marked[i])
doCast(SPELL_CONFLAGATION_2, marked[i]);
marked[i] = NULL;
}
doCast(SPELL_CONFLAGATION_1);
conflagated = false;
}
}
开发者ID:Krath,项目名称:scriptdev2,代码行数:28,代码来源:boss_saviana.cpp
示例7: Counter
void Counter()
{
Unit* u = me->GetVictim();
bool cSpell = COUNTERSPELL && CounterSpell_cd <= 5000;
bool blast = FIREBLAST && FireBlast_cd <= 3000 && !(u && u->ToCreature() && (u->ToCreature()->isWorldBoss() || u->ToCreature()->IsDungeonBoss())) && me->HasAura(IMPACT_BUFF);
if (!cSpell && !blast) return;
if (u && u->IsNonMeleeSpellCast(false) &&
((cSpell && me->GetDistance(u) < 40) || (blast && me->GetDistance(u) < 30)))
{
temptimer = GC_Timer;
if (me->IsNonMeleeSpellCast(false))
me->InterruptNonMeleeSpells(false);
if (cSpell && doCast(u, COUNTERSPELL))
CounterSpell_cd = 15000;
else if (blast && doCast(u, FIREBLAST))
FireBlast_cd = 6000;
GC_Timer = temptimer;
}
else if (cSpell)
{
if (Unit* target = FindCastingTarget(40))
{
temptimer = GC_Timer;
if (me->IsNonMeleeSpellCast(false))
me->InterruptNonMeleeSpells(false);
if (doCast(target, COUNTERSPELL))
{
CounterSpell_cd = 15000;
GC_Timer = temptimer;
}
}
}
}
开发者ID:sunshitwowsucks,项目名称:ArkCORE-NG,代码行数:33,代码来源:bot_mage_ai.cpp
示例8: UpdateAI
void UpdateAI(const uint32 diff)
{
if(!pInstance) return;
if (!pet)
{
if (Creature* pGuard = m_creature->GetMap()->GetCreature(pInstance->GetData64(NPC_PRECIOUS)))
if (!pGuard->isAlive())
{
pet = true;
if (pInstance->GetData(TYPE_PRECIOUS) == NOT_STARTED)
{
DoScriptText(-1631228,m_creature);
pInstance->SetData(TYPE_PRECIOUS,DONE);
}
}
}
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
return;
if (nexttick)
{
doCast(SPELL_OOZE_FLOOD_1);
DoScriptText(-1631227,m_creature);
nexttick = false;
};
if (timedQuery(SPELL_OOZE_FLOOD_1, diff))
{
uint8 i = urand(0,3);
if (Unit* pTemp = doSummon(NPC_OOZE_STALKER,SpawnLoc[i].x, SpawnLoc[i].y, SpawnLoc[i].z, TEMPSUMMON_TIMED_DESPAWN, 15000))
{
doCast(SPELL_OOZE_FLOOD, pTemp);
nexttick = true;
}
};
if (timedQuery(SPELL_SLIME_SPRAY, diff))
if (doSummon(NPC_OOZE_SPRAY_STALKER))
doCast(SPELL_SLIME_SPRAY);
if (timedQuery(SPELL_MUTATED_INFECTION, diff))
{
for(uint8 i = 0; i < getSpellData(SPELL_MUTATED_INFECTION); ++i)
if (Unit* pTarget = doSelectRandomPlayer(SPELL_MUTATED_INFECTION_AURA, false, 60.0f))
doCast(SPELL_MUTATED_INFECTION, pTarget);
DoScriptText(-1631226,m_creature);
}
if (timedQuery(SPELL_BERSERK, diff))
{
doCast(SPELL_BERSERK);
DoScriptText(-1631225,m_creature);
};
DoMeleeAttackIfReady();
}
开发者ID:Ancient,项目名称:scriptdev2,代码行数:59,代码来源:boss_rotface.cpp
示例9: UpdateAI
void UpdateAI(const uint32 diff)
{
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
return;
timedCast(SPELL_TWILIGHT_PRECISION, diff);
if ( m_creature->GetHealthPercent() <= 80.0f && phase == 0)
{
phase = 1;
}
if ( m_creature->GetHealthPercent() <= 60.0f && phase == 1)
{
phase = 2;
}
if ( m_creature->GetHealthPercent() <= 40.0f && phase == 2)
{
phase = 3;
}
if ( m_creature->GetHealthPercent() <= 20.0f && phase == 3)
{
phase = 4;
}
switch (phase)
{
case 0: //GROUND
doCast(SPELL_FLAME_BREATH);
doCast(SPELL_ENRAGE);
break;
case 1: //AIR
//NEED SCRIPT AIR MOVEMENT
DoScriptText(-1666404,m_creature);
doCast(SPELL_BEACON);
doCast(SPELL_CONFLAG);
break;
case 2: //GROUND
doCast(SPELL_FLAME_BREATH);
doCast(SPELL_ENRAGE);
break;
case 3: //AIR
//NEED SCRIPT AIR MOVEMENT
DoScriptText(-1666404,m_creature);
doCast(SPELL_BEACON);
doCast(SPELL_CONFLAG);
break;
case 4: //GROUND
doCast(SPELL_FLAME_BREATH);
doCast(SPELL_ENRAGE);
break;
default:
break;
}
DoMeleeAttackIfReady();
}
开发者ID:Subv,项目名称:diamondcore,代码行数:56,代码来源:boss_ragefire.cpp
示例10: DoNonCombatActions
void DoNonCombatActions(uint32 diff)
{
if (GC_Timer > diff || me->IsMounted()) return;
if (Feasting()) return;
if (!HasAuraName(me, DAMPENMAGIC) &&
doCast(me, DAMPENMAGIC))
{ /*GC_Timer = 800;*/ return; }
if (!HasAuraName(me, ICEARMOR) &&
doCast(me, ICEARMOR))
{ /*GC_Timer = 800;*/ return; }
}
开发者ID:ddark,项目名称:ecl,代码行数:13,代码来源:bot_mage_ai.cpp
示例11: UpdateAI
void UpdateAI(const uint32 uiDiff) override
{
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
return;
switch (m_uiStage)
{
case 0:
break;
case 1:
doCast(SPELL_BERSERK);
m_uiStage = 2;
break;
case 2:
default:
break;
}
timedCast(SPELL_CLEAVE, uiDiff);
timedCast(SPELL_BLIZZARD, uiDiff);
timedCast(SPELL_FROST_BREATH, uiDiff);
if (m_creature->GetHealthPercent() < 10.0f && m_uiStage == 0)
m_uiStage = 1;
timedCast(SPELL_BERSERK, uiDiff);
DoMeleeAttackIfReady();
}
开发者ID:mynew4,项目名称:RustEmu-Core,代码行数:30,代码来源:icecrown_spire.cpp
示例12: CheckSpellSteal
void CheckSpellSteal(uint32 diff)
{
if (!SPELLSTEAL || GC_Timer > diff || Rand() > 25 || IsCasting()) return;
Unit* target = FindHostileDispelTarget(40, true);
if (target && doCast(target, SPELLSTEAL))
GC_Timer = 800;
}
开发者ID:sunshitwowsucks,项目名称:ArkCORE-NG,代码行数:7,代码来源:bot_mage_ai.cpp
示例13: DoNormalAttack
void DoNormalAttack(uint32 diff)
{
opponent = me->GetVictim();
if (opponent)
{
if (!IsCasting())
StartAttack(opponent, true);
}
else
return;
if (MoveBehind(*opponent))
wait = 5;
//float dist = me->GetExactDist(opponent);
float meleedist = me->GetDistance(opponent);
//TORMENT
if (TORMENT && Torment_cd <= diff && meleedist < 5 && (!tank || tank == me || opponent->GetVictim() == m_creatureOwner))
{
temptimer = GC_Timer;
if (doCast(opponent, TORMENT))
{
Torment_cd = 5000;
GC_Timer = temptimer;
return;
}
}
}
开发者ID:Arkania,项目名称:ArkCORE-NG,代码行数:28,代码来源:bot_warlock_ai.cpp
示例14: Reset
void Reset()
{
pOwner = (Creature*)Unit::GetUnit((*m_creature),pInstance->GetData64(NPC_DEATHBRINGER_SAURFANG));
resetTimers();
doCast(SPELL_BLOOD_LINK_BEAST);
scentcasted = false;
}
开发者ID:Subv,项目名称:diamondcore,代码行数:7,代码来源:boss_deathbringer_saurfang.cpp
示例15: DoNormalAttack
void DoNormalAttack(uint32 diff)
{
opponent = me->GetVictim();
if (opponent)
{
if (!IsCasting())
StartAttack(opponent, true);
}
else
return;
if (MoveBehind(*opponent))
wait = 5;
//float dist = me->GetExactDist(opponent);
float meleedist = me->GetDistance(opponent);
//TORMENT
if (IsSpellReady(TORMENT_1, diff, false) && meleedist < 5 && !IsTank(opponent->GetVictim()))
{
temptimer = GC_Timer;
if (doCast(opponent, GetSpell(TORMENT_1)))
{
GC_Timer = temptimer;
return;
}
}
}
开发者ID:GlassFace,项目名称:TrinityCoreOld,代码行数:27,代码来源:bot_warlock_ai.cpp
示例16: UpdateAI
void UpdateAI(const uint32 diff)
{
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
return;
switch(stage)
{
case 0: {
timedCast(SPELL_SOUL_FEAST, diff);
break;}
case 1: {
doCast(SPELL_BERSERK);
stage = 2;
break;}
case 2: {
break;}
}
timedCast(SPELL_CLEAVE, diff);
timedCast(SPELL_BLIZZARD, diff);
timedCast(SPELL_FROST_BREATH, diff);
if (m_creature->GetHealthPercent() < 10.0f && stage == 0) stage = 1;
timedCast(SPELL_BERSERK, diff);
DoMeleeAttackIfReady();
}
开发者ID:cbcs,项目名称:ChgSD2,代码行数:29,代码来源:icecrown_spire.cpp
示例17: UpdateAI
void UpdateAI(const uint32 uiDiff)
{
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
return;
doCast(SPELL_METEOR_FLAME);
}
开发者ID:Subv,项目名称:diamondcore,代码行数:7,代码来源:boss_halion.cpp
示例18: UpdateAI
void UpdateAI(uint32 diff)
{
ReduceCD(diff);
if (!GlobalUpdate(diff))
return;
CheckAttackState();
CheckAuras();
if (wait == 0)
wait = GetWait();
else
return;
BreakCC(diff);
if (CCed(me)) return;
////if pet is dead or unreachable
//Creature* m_botsPet = me->GetBotsPet();
//if (!m_botsPet || m_botsPet->FindMap() != master->GetMap() || (me->GetDistance2d(m_botsPet) > sWorld->GetMaxVisibleDistanceOnContinents() - 20.f))
// if (master->getLevel() >= 10 && !me->IsInCombat() && !IsCasting() && !me->IsMounted())
// SummonBotsPet(PET_VOIDWALKER);
//TODO: implement healthstone
if (Potion_cd <= diff && GetHealthPCT(me) < 67)
{
temptimer = GC_Timer;
if (doCast(me, HEALINGPOTION))
{
Potion_cd = POTION_CD;
GC_Timer = temptimer;
}
}
if (Potion_cd <= diff && GetManaPCT(me) < 50)
{
temptimer = GC_Timer;
if (doCast(me, MANAPOTION))
{
Potion_cd = POTION_CD;
GC_Timer = temptimer;
}
}
if (!me->IsInCombat())
DoNonCombatActions();
if (!CheckAttackTarget(BOT_CLASS_WARLOCK))
return;
DoNormalAttack(diff);
}
开发者ID:GlassFace,项目名称:TrinityCoreOld,代码行数:47,代码来源:bot_warlock_ai.cpp
示例19: JustDied
void JustDied(Unit *killer)
{
if (!pInstance) return;
pInstance->SetData(TYPE_PUTRICIDE, DONE);
DoScriptText(-1631243,m_creature, killer);
doCast(QUEST_24749);
}
开发者ID:Heuristicks,项目名称:scriptdev2,代码行数:8,代码来源:boss_professor_putricide.cpp
注:本文中的doCast函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论