本文整理汇总了C++中DoPlaySoundToSet函数的典型用法代码示例。如果您正苦于以下问题:C++ DoPlaySoundToSet函数的具体用法?C++ DoPlaySoundToSet怎么用?C++ DoPlaySoundToSet使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DoPlaySoundToSet函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EnterCombat
//*** HANDLED FUNCTION ***
//Attack Start is called whenever someone hits us.
void EnterCombat(Unit* /*who*/)
{
//Say some stuff
me->MonsterSay(SAY_AGGRO,LANG_UNIVERSAL,0);
DoPlaySoundToSet(me,8280);
}
示例2: KilledUnit
void KilledUnit(Unit* /*victim*/)
{
me->MonsterYell(SAY_KILL, LANGUAGE_UNIVERSAL, 0);
DoPlaySoundToSet(me, SOUND_KILL);
}
示例3: KilledUnit
void KilledUnit(Unit* /*victim*/)
{
if (!(rand()%3))
DoPlaySoundToSet(me, SOUND_SLAY);
}
示例4: UpdateAI
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (StormCount)
{
Unit* pTarget = Unit::GetUnit(*me, CloudGUID);
if (!pTarget || !pTarget->isAlive())
{
EnterEvadeMode();
return;
}
else if (Unit* Cyclone = Unit::GetUnit(*me, CycloneGUID))
Cyclone->CastSpell(pTarget, 25160, true); // keep casting or...
if (StormSequenceTimer <= diff)
HandleStormSequence(pTarget);
else
StormSequenceTimer -= diff;
return;
}
if (Enrage_Timer <= diff)
{
me->MonsterYell(SAY_ONENRAGE, LANG_UNIVERSAL, 0);
DoPlaySoundToSet(me, SOUND_ONENRAGE);
DoCast(me, SPELL_BERSERK, true);
Enrage_Timer = 600000;
} else Enrage_Timer -= diff;
if (StaticDisruption_Timer <= diff)
{
Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1);
if (!pTarget) pTarget = me->getVictim();
TargetGUID = pTarget->GetGUID();
DoCast(pTarget, SPELL_STATIC_DISRUPTION, false);
me->SetInFront(me->getVictim());
StaticDisruption_Timer = (10+rand()%8)*1000; // < 20s
/*if (float dist = me->IsWithinDist3d(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 5.0f) dist = 5.0f;
SDisruptAOEVisual_Timer = 1000 + floor(dist / 30 * 1000.0f);*/
} else StaticDisruption_Timer -= diff;
if (GustOfWind_Timer <= diff)
{
Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1);
if (!pTarget) pTarget = me->getVictim();
DoCast(pTarget, SPELL_GUST_OF_WIND);
GustOfWind_Timer = (20+rand()%10)*1000; //20 to 30 seconds(bosskillers)
} else GustOfWind_Timer -= diff;
if (CallLighting_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_CALL_LIGHTNING);
CallLighting_Timer = (12 + rand()%5)*1000; //totaly random timer. can't find any info on this
} else CallLighting_Timer -= diff;
if (!isRaining && ElectricalStorm_Timer < 8000 + urand(0,5000))
{
SetWeather(WEATHER_STATE_HEAVY_RAIN, 0.9999f);
isRaining = true;
}
if (ElectricalStorm_Timer <= diff) {
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 50, true);
if (!pTarget)
{
EnterEvadeMode();
return;
}
pTarget->CastSpell(pTarget, 44007, true);//cloud visual
DoCast(pTarget, SPELL_ELECTRICAL_STORM, false);//storm cyclon + visual
float x,y,z;
pTarget->GetPosition(x,y,z);
if (pTarget)
{
pTarget->SetUnitMovementFlags(MOVEFLAG_LEVITATING);
pTarget->SendMonsterMove(x,y,me->GetPositionZ()+15,0);
}
Unit* Cloud = me->SummonTrigger(x, y, me->GetPositionZ()+16, 0, 15000);
if (Cloud)
{
CloudGUID = Cloud->GetGUID();
Cloud->SetUnitMovementFlags(MOVEFLAG_LEVITATING);
Cloud->StopMoving();
Cloud->SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f);
Cloud->setFaction(35);
Cloud->SetMaxHealth(9999999);
Cloud->SetHealth(9999999);
Cloud->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
ElectricalStorm_Timer = 60000; //60 seconds(bosskillers)
StormCount = 1;
StormSequenceTimer = 0;
} else ElectricalStorm_Timer -= diff;
if (SummonEagles_Timer <= diff)
{
//.........这里部分代码省略.........
示例5: UpdateAI
void UpdateAI(const uint32 diff)
{
if (waitTimer)
{
if (inMove)
{
if (waitTimer <= diff)
{
(*me).GetMotionMaster()->MovementExpired();
(*me).GetMotionMaster()->MovePoint(MovePhase,NalorakkWay[MovePhase][0],NalorakkWay[MovePhase][1],NalorakkWay[MovePhase][2]);
waitTimer = 0;
} else waitTimer -= diff;
}
}
if (!UpdateVictim())
return;
if (Berserk_Timer <= diff)
{
DoCast(me, SPELL_BERSERK, true);
me->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, 0);
DoPlaySoundToSet(me, SOUND_YELL_BERSERK);
Berserk_Timer = 600000;
} else Berserk_Timer -= diff;
if (ShapeShift_Timer <= diff)
{
if (inBearForm)
{
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + 1, 5122);
me->MonsterYell(YELL_SHIFTEDTOTROLL, LANG_UNIVERSAL, 0);
DoPlaySoundToSet(me, SOUND_YELL_TOTROLL);
me->RemoveAurasDueToSpell(SPELL_BEARFORM);
Surge_Timer = 15000 + rand()%5000;
BrutalSwipe_Timer = 7000 + rand()%5000;
Mangle_Timer = 10000 + rand()%5000;
ShapeShift_Timer = 45000 + rand()%5000;
inBearForm = false;
}
else
{
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + 1, 0);
me->MonsterYell(YELL_SHIFTEDTOBEAR, LANG_UNIVERSAL, 0);
DoPlaySoundToSet(me, SOUND_YELL_TOBEAR);
DoCast(me, SPELL_BEARFORM, true);
LaceratingSlash_Timer = 2000; // dur 18s
RendFlesh_Timer = 3000; // dur 5s
DeafeningRoar_Timer = 5000 + rand()%5000; // dur 2s
ShapeShift_Timer = 20000 + rand()%5000; // dur 30s
inBearForm = true;
}
} else ShapeShift_Timer -= diff;
if (!inBearForm)
{
if (BrutalSwipe_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_BRUTALSWIPE);
BrutalSwipe_Timer = 7000 + rand()%5000;
} else BrutalSwipe_Timer -= diff;
if (Mangle_Timer <= diff)
{
if (me->getVictim() && !me->getVictim()->HasAura(SPELL_MANGLEEFFECT, 0))
{
DoCast(me->getVictim(), SPELL_MANGLE);
Mangle_Timer = 1000;
}
else Mangle_Timer = 10000 + rand()%5000;
} else Mangle_Timer -= diff;
if (Surge_Timer <= diff)
{
me->MonsterYell(YELL_SURGE, LANG_UNIVERSAL, 0);
DoPlaySoundToSet(me, SOUND_YELL_SURGE);
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 45, true);
if (pTarget)
DoCast(pTarget, SPELL_SURGE);
Surge_Timer = 15000 + rand()%5000;
} else Surge_Timer -= diff;
}
else
{
if (LaceratingSlash_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_LACERATINGSLASH);
LaceratingSlash_Timer = 18000 + rand()%5000;
} else LaceratingSlash_Timer -= diff;
if (RendFlesh_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_RENDFLESH);
RendFlesh_Timer = 5000 + rand()%5000;
} else RendFlesh_Timer -= diff;
if (DeafeningRoar_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_DEAFENINGROAR);
DeafeningRoar_Timer = 15000 + rand()%5000;
//.........这里部分代码省略.........
示例6: UpdateAI
void UpdateAI(const uint32 diff)
{
if (!TankGUID)
{
if (!UpdateVictim())
return;
if (me->GetHealth() < health_20 * (4 - Phase))
EnterPhase(Phase + 1);
}
if (Berserk_Timer <= diff)
{
DoCast(me, SPELL_BERSERK, true);
me->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, 0);
DoPlaySoundToSet(me, SOUND_BERSERK);
Berserk_Timer = 60000;
}
else Berserk_Timer -= diff;
switch (Phase)
{
case 0:
if (Intro_Timer)
{
if (Intro_Timer <= diff)
{
me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, 0);
DoPlaySoundToSet(me, SOUND_AGGRO);
Intro_Timer = 0;
}
else Intro_Timer -= diff;
}
if (Whirlwind_Timer <= diff)
{
DoCast(me, SPELL_WHIRLWIND);
Whirlwind_Timer = 15000 + rand() % 5000;
}
else Whirlwind_Timer -= diff;
if (Grievous_Throw_Timer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_GRIEVOUS_THROW, false);
Grievous_Throw_Timer = 10000;
}
else Grievous_Throw_Timer -= diff;
break;
case 1:
if (Creeping_Paralysis_Timer <= diff)
{
DoCast(me, SPELL_CREEPING_PARALYSIS);
Creeping_Paralysis_Timer = 20000;
}
else Creeping_Paralysis_Timer -= diff;
if (Overpower_Timer <= diff)
{
// implemented in DoMeleeAttackIfReady()
Overpower_Timer = 0;
}
else Overpower_Timer -= diff;
break;
case 2:
return;
case 3:
if (Claw_Rage_Timer <= diff)
{
if (!TankGUID)
{
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
{
TankGUID = me->GetVictim()->GetGUID();
me->SetSpeed(MOVE_RUN, 5.0f);
AttackStart(pTarget); // change victim
Claw_Rage_Timer = 0;
Claw_Loop_Timer = 500;
Claw_Counter = 0;
}
}
else if (!Claw_Rage_Timer) // do not do this when Lynx_Rush
{
if (Claw_Loop_Timer <= diff)
{
Unit* pTarget = me->GetVictim();
if (!pTarget || !pTarget->isTargetableForAttack()) pTarget = Unit::GetUnit(*me, TankGUID);
if (!pTarget || !pTarget->isTargetableForAttack()) pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (pTarget)
{
AttackStart(pTarget);
if (me->IsWithinMeleeRange(pTarget))
{
DoCast(pTarget, SPELL_CLAW_RAGE_DAMAGE, true);
++Claw_Counter;
if (Claw_Counter == 12)
{
//.........这里部分代码省略.........
示例7: JustDied
void JustDied(Unit* Killer)
{
DoPlaySoundToSet(m_creature, SOUND_DEATH);
}
示例8: UpdateAI
void UpdateAI(const uint32 diff)
{
if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
return;
if(m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 11)
{
Enraged = true;
}
if(!Enraged)
{
//used for check, when Vexallus cast adds 85%, 70%, 55%, 40%, 25%
if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < (100-(SpawnAddInterval*(AlreadySpawnedAmount+1))))
{
DoYell(SAY_ENERGY, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(m_creature, SOUND_ENERGY);
Creature* PureEnergyCreature = NULL;
PureEnergyCreature = DoSpawnCreature(CREATURE_PURE_ENERGY, 10, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
Unit* target = NULL;
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (PureEnergyCreature && target)
PureEnergyCreature->AI()->AttackStart(target);
if(Heroic) // *Heroic mode only - he summons two instead of one.
{
PureEnergyCreature = DoSpawnCreature(CREATURE_PURE_ENERGY, -10, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (PureEnergyCreature && target)
PureEnergyCreature->AI()->AttackStart(target);
}
++AlreadySpawnedAmount;
};
if(ChainLightningTimer < diff)
{
Unit* target = NULL;
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
DoCast(target, SPELL_CHAIN_LIGHTNING);
ChainLightningTimer = 10000;
}else ChainLightningTimer -= diff;
if(ArcaneShockTimer < diff)
{
Unit* target = NULL;
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
DoCast(target, SPELL_ARCANE_SHOCK);
ArcaneShockTimer = 8000;
}else ArcaneShockTimer -= diff;
}else
{
if(OverloadTimer < diff)
{
Unit* target = NULL;
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
DoCast(target, SPELL_OVERLOAD);
OverloadTimer = 2200;
}else OverloadTimer -= diff;
}
DoMeleeAttackIfReady();
}
示例9: KilledUnit
void KilledUnit(Unit *victim)
{
DoYell(SAY_KILL, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(victim, SOUND_KILL);
}
示例10: UpdateAI
void UpdateAI(const uint32 diff)
{
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
return;
if(m_uiEnrageTimer < diff)
{
DoCastSpellIfCan(m_creature, SPELL_ENRAGE, true);
m_uiEnrageTimer = 30000;
}m_uiEnrageTimer -= diff;
if(!m_bIsFlyPhase) //ground phase
{
if(m_uiFlyPhaseTimer < diff) // fly phase start
{
//Go Fly
m_creature->GetMap()->CreatureRelocation(m_creature, 1469, 596, m_creature->GetPositionZ()+20, m_creature->GetOrientation());
m_creature->StopMoving();
m_creature->GetMotionMaster()->Clear();
m_creature->GetMotionMaster()->MoveIdle();
//FlyPhase Timers Start
m_uiLandPhaseTimer = 80000;
m_uiDemonicVaporTimer = 2000;
m_uiFogOfCorruptionTimer = 20000;
m_uiFogTimer = 500;
m_uiMaxBreathCount = 0;
m_uiFogCount = 0;
m_uiCycle = 0;
m_bIsFlyPhase = true;
m_bToStartPos = false;
m_bToLineStartPos = false;
m_bFlyOver = false;
m_bFog = false;
m_bNextCycle = false;
return;
}else m_uiFlyPhaseTimer -= diff;
if(m_uiCorrosionTimer < diff)
{
DoScriptText(YELL_CORROSION, m_creature);
if(m_creature->getVictim())
DoCastSpellIfCan(m_creature->getVictim(), SPELL_CORROSION);
m_uiCorrosionTimer = 72000;
}else m_uiCorrosionTimer -= diff;
if(m_uiNoxiousFumesTimer < diff && !m_bIsCastedNoxiousFumes)
{
DoScriptText(YELL_NOXIOUSFUMES, m_creature);
DoPlaySoundToSet(m_creature, 12478);
DoCastSpellIfCan(m_creature, SPELL_NOXIOUSFUMES_AURA);
m_bIsCastedNoxiousFumes = true;
}else m_uiNoxiousFumesTimer -= diff;
if(m_uiGasNovaTimer < diff)
{
DoCastSpellIfCan(m_creature, SPELL_GASNOVA);
m_uiGasNovaTimer = 35000;
}else m_uiGasNovaTimer -= diff;
if(m_uiEncapsulateTimer < diff)
{
if(Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
{
m_uiEncapsulateGUID = target->GetGUID();
DoCastSpellIfCan(target, SPELL_ENCAPSULATE_CHANNEL);
}
m_uiEncapsulateTimer = 30000;
}else m_uiEncapsulateTimer -= diff;
if(m_uiCleaveTimer < diff)
{
DoScriptText(YELL_CLEAVE, m_creature);
if(m_creature->getVictim())
DoCastSpellIfCan(m_creature->getVictim(), SPELL_CLEAVE);
m_uiCleaveTimer = 28000;
}else m_uiCleaveTimer -= diff;
DoMeleeAttackIfReady();
}
else // fly phase
{
if(m_uiLandPhaseTimer < diff) //fly phase -> ground phase
{
m_creature->GetMap()->CreatureRelocation(m_creature, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()-20, m_creature->GetOrientation());
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
m_uiFlyPhaseTimer = 60000;
m_bIsFlyPhase = false;
m_uiCorrosionTimer = 20000;
m_uiCleaveTimer = 10000;
m_uiEncapsulateTimer = 10000;
m_uiGasNovaTimer = 15000;
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
//.........这里部分代码省略.........
示例11: UpdateAI
//*** HANDLED FUNCTION ***
//Update AI is called Every single map update (roughly once every 100ms if a player is within the grid)
void UpdateAI(const uint32 diff)
{
//Out of combat timers
if (!me->getVictim())
{
//Random Say timer
if (Say_Timer <= diff)
{
//Random switch between 5 outcomes
switch (rand()%5)
{
case 0:
me->MonsterYell(SAY_RANDOM_0,LANG_UNIVERSAL,0);
DoPlaySoundToSet(me,8831); //8831 is the index of the sound we are playing. You find these numbers in SoundEntries.dbc
break;
case 1:
me->MonsterYell(SAY_RANDOM_1,LANG_UNIVERSAL,0);
DoPlaySoundToSet(me,8818);
break;
case 2:
me->MonsterYell(SAY_RANDOM_2,LANG_UNIVERSAL,0);
DoPlaySoundToSet(me,8041);
break;
case 3:
me->MonsterYell(SAY_RANDOM_3,LANG_UNIVERSAL,0);
DoPlaySoundToSet(me,8581);
break;
case 4:
me->MonsterYell(SAY_RANDOM_4,LANG_UNIVERSAL,0);
DoPlaySoundToSet(me,8791);
break;
}
Say_Timer = 45000; //Say something agian in 45 seconds
} else Say_Timer -= diff;
//Rebuff timer
if (Rebuff_Timer <= diff)
{
DoCast(me,SPELL_BUFF);
Rebuff_Timer = 900000; //Rebuff agian in 15 minutes
} else Rebuff_Timer -= diff;
}
//Return since we have no target
if (!UpdateVictim())
return;
//Spell 1 timer
if (Spell_1_Timer <= diff)
{
//Cast spell one on our current target.
if (rand()%50 > 10)
DoCast(me->getVictim(),SPELL_ONE_ALT);
else if (me->GetDistance(me->getVictim()) < 25)
DoCast(me->getVictim(),SPELL_ONE);
Spell_1_Timer = 5000;
} else Spell_1_Timer -= diff;
//Spell 2 timer
if (Spell_2_Timer <= diff)
{
//Cast spell one on our current target.
DoCast(me->getVictim(),SPELL_TWO);
Spell_2_Timer = 37000;
} else Spell_2_Timer -= diff;
//Spell 3 timer
if (Phase > 1)
{
if (Spell_3_Timer <= diff)
{
//Cast spell one on our current target.
DoCast(me->getVictim(),SPELL_THREE);
Spell_3_Timer = 19000;
} else Spell_3_Timer -= diff;
}
//Beserk timer
if (Phase > 1)
{
if (Beserk_Timer <= diff)
{
//Say our line then cast uber death spell
DoPlaySoundToSet(me,8588);
me->MonsterYell(SAY_BESERK,LANG_UNIVERSAL,me->getVictim()->GetGUID());
DoCast(me->getVictim(),SPELL_BESERK);
//Cast our beserk spell agian in 12 seconds if we didn't kill everyone
Beserk_Timer = 12000;
} else Beserk_Timer -= diff;
//.........这里部分代码省略.........
示例12: JustDied
void JustDied(Unit* Killer)
{
me->MonsterYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
DoPlaySoundToSet(me, SOUND_DEATH);
}
示例13: UpdateAI
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (ResetTimer <= diff)
{
if (me->IsWithinDist3d(119.223f, 1035.45f, 29.4481f, 10))
{
EnterEvadeMode();
return;
}
ResetTimer = 5000;
} else ResetTimer -= diff;
if (CheckAddState_Timer <= diff)
{
for (uint8 i = 0; i < 4; ++i)
if (Creature *pTemp = Unit::GetCreature(*me, AddGUID[i]))
if (pTemp->isAlive() && !pTemp->getVictim())
pTemp->AI()->AttackStart(me->getVictim());
CheckAddState_Timer = 5000;
} else CheckAddState_Timer -= diff;
if (DrainPower_Timer <= diff)
{
DoCast(me, SPELL_DRAIN_POWER, true);
Map *map = me->GetMap();
if (!map->IsDungeon()) return;
Map::PlayerList const &PlayerList = map->GetPlayers();
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
if (Player* i_pl = i->getSource())
if (i_pl->isAlive())me->AddAura(44132, me); //+1% Damage for each active player on boss (+ActivePlayer_Stack)
}
//me->AddAura(44132, me);
me->MonsterYell(YELL_DRAIN_POWER, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_YELL_DRAIN_POWER);
DrainPower_Timer = urand(40000,55000); // must cast in 60 sec, or buff/debuff will disappear
} else DrainPower_Timer -= diff;
if (SpiritBolts_Timer <= diff)
{
if (DrainPower_Timer < 12000) // channel 10 sec
SpiritBolts_Timer = 13000; // cast drain power first
else
{
DoCast(me, SPELL_SPIRIT_BOLTS, true);
me->MonsterYell(YELL_SPIRIT_BOLTS, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_YELL_SPIRIT_BOLTS);
SpiritBolts_Timer = 40000;
SiphonSoul_Timer = 10000; // ready to drain
PlayerAbility_Timer = 99999;
}
} else SpiritBolts_Timer -= diff;
if (SiphonSoul_Timer <= diff)
{
Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 70, true);
Unit *trigger = DoSpawnCreature(MOB_TEMP_TRIGGER, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 30000);
if (!pTarget || !trigger)
{
EnterEvadeMode();
return;
}
else
{
trigger->SetDisplayId(11686);
trigger->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
trigger->CastSpell(pTarget, SPELL_SIPHON_SOUL, true);
trigger->GetMotionMaster()->MoveChase(me);
//DoCast(pTarget, SPELL_SIPHON_SOUL, true);
//me->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, pTarget->GetGUID());
//me->SetUInt32Value(UNIT_CHANNEL_SPELL, SPELL_SIPHON_SOUL);
PlayerGUID = pTarget->GetGUID();
PlayerAbility_Timer = urand(8000,10000);
PlayerClass = pTarget->getClass() - 1;
if (PlayerClass == 10)
PlayerClass = 9; // druid
else if (PlayerClass == 4 && pTarget->HasSpell(15473))
PlayerClass = 5; // shadow priest
SiphonSoul_Timer = 99999; // buff lasts 30 sec
}
} else SiphonSoul_Timer -= diff;
if (PlayerAbility_Timer <= diff)
{
//Unit *pTarget = Unit::GetUnit(*me, PlayerGUID);
//if (pTarget && pTarget->isAlive())
//{
UseAbility();
PlayerAbility_Timer = urand(8000,10000);
//}
} else PlayerAbility_Timer -= diff;
//.........这里部分代码省略.........
示例14: EnterCombat
void EnterCombat(Unit *who)
{
DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
DoPlaySoundToSet(m_creature,SOUND_AGGRO);
}
示例15: UpdateAI
void UpdateAI(uint32 diff) override
{
//Only if not incombat check if the event is started
if (!me->IsInCombat() && instance->GetData(DATA_KARATHRESSEVENT))
{
if (Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_KARATHRESSEVENT_STARTER)))
{
AttackStart(target);
GetAdvisors();
}
}
//Return since we have no target
if (!UpdateVictim())
return;
//someone evaded!
if (!instance->GetData(DATA_KARATHRESSEVENT))
{
EnterEvadeMode();
return;
}
//CataclysmicBolt_Timer
if (CataclysmicBolt_Timer <= diff)
{
//select a random unit other than the main tank
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1);
//if there aren't other units, cast on the tank
if (!target)
target = me->GetVictim();
if (target)
DoCast(target, SPELL_CATACLYSMIC_BOLT);
CataclysmicBolt_Timer = 10000;
} else CataclysmicBolt_Timer -= diff;
//SearNova_Timer
if (SearNova_Timer <= diff)
{
DoCastVictim(SPELL_SEAR_NOVA);
SearNova_Timer = 20000 + rand32() % 40000;
} else SearNova_Timer -= diff;
//Enrage_Timer
if (Enrage_Timer <= diff)
{
DoCast(me, SPELL_ENRAGE);
Enrage_Timer = 90000;
} else Enrage_Timer -= diff;
//Blessing of Tides Trigger
if (!HealthAbovePct(75) && !BlessingOfTides)
{
BlessingOfTides = true;
bool continueTriggering = false;
for (uint8 i = 0; i < MAX_ADVISORS; ++i)
if (Advisors[i])
{
Creature* advisor = ObjectAccessor::GetCreature(*me, Advisors[i]);
if (advisor && advisor->IsAlive())
{
continueTriggering = true;
break;
}
}
if (continueTriggering)
{
DoCast(me, SPELL_BLESSING_OF_THE_TIDES);
me->Yell(SAY_GAIN_BLESSING_OF_TIDES, LANG_UNIVERSAL);
DoPlaySoundToSet(me, SOUND_GAIN_BLESSING_OF_TIDES);
}
}
DoMeleeAttackIfReady();
}