aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Northrend
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2014-07-22 21:43:19 +0200
committerjackpoz <giacomopoz@gmail.com>2014-07-22 21:43:19 +0200
commit3388587b7a2ded9333ab48ce4d02372d750a60fe (patch)
tree04adaaa84bd21e4693ebb5492125468504f9faae /src/server/scripts/Northrend
parent0b236d480a9ff5e75da966e50c144d3bcce9b1fa (diff)
Core/Misc: Replace rand() calls with SFMT
Diffstat (limited to 'src/server/scripts/Northrend')
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp2
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp2
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp8
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp2
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp4
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp2
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp4
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp2
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_noth.cpp6
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp2
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp2
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp2
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp6
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp2
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp8
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp20
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp6
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp6
-rw-r--r--src/server/scripts/Northrend/VioletHold/boss_erekem.cpp2
-rw-r--r--src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp2
-rw-r--r--src/server/scripts/Northrend/zone_dragonblight.cpp2
21 files changed, 46 insertions, 46 deletions
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp
index 77697cdb3e8..0a43c01081f 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp
@@ -652,7 +652,7 @@ struct boss_faction_championsAI : public BossAI
std::list<Creature*>::const_iterator itr = lst.begin();
if (lst.empty())
return NULL;
- advance(itr, rand() % lst.size());
+ advance(itr, rand32() % lst.size());
return (*itr);
}
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp
index d4f00414b7d..2a587e535a3 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp
@@ -93,7 +93,7 @@ public:
void KilledUnit(Unit* victim) override
{
/// Force the player to spawn corpse scarabs via spell, @todo Check percent chance for scarabs, 20% at the moment
- if (!(rand()%5))
+ if (!(rand32() % 5))
if (victim->GetTypeId() == TYPEID_PLAYER)
victim->CastSpell(victim, SPELL_SUMMON_CORPSE_SCARABS_PLR, true, NULL, NULL, me->GetGUID());
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp
index 77486c37498..ca478244d2a 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp
@@ -288,7 +288,7 @@ public:
void KilledUnit(Unit* /*victim*/) override
{
- if (!(rand()%5))
+ if (!(rand32() % 5))
Talk(SAY_SLAY);
}
@@ -318,7 +318,7 @@ public:
Talk(SAY_AGGRO);
events.ScheduleEvent(EVENT_MARK, 15000);
- events.ScheduleEvent(EVENT_CAST, 20000+rand()%5000);
+ events.ScheduleEvent(EVENT_CAST, 20000 + rand32() % 5000);
events.ScheduleEvent(EVENT_BERSERK, 15*100*1000);
}
@@ -343,13 +343,13 @@ public:
switch (eventId)
{
case EVENT_MARK:
- if (!(rand()%5))
+ if (!(rand32() % 5))
Talk(SAY_SPECIAL);
DoCastAOE(SPELL_MARK[id]);
events.ScheduleEvent(EVENT_MARK, 15000);
break;
case EVENT_CAST:
- if (!(rand()%5))
+ if (!(rand32() % 5))
Talk(SAY_TAUNT);
if (caster)
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp
index 381be8d5cd1..cea4b540f7b 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp
@@ -129,7 +129,7 @@ public:
break;
case EVENT_SUMMON:
for (int32 i = 0; i < RAID_MODE(1, 2); ++i)
- DoSummon(NPC_ZOMBIE, PosSummon[rand() % RAID_MODE(1, 3)]);
+ DoSummon(NPC_ZOMBIE, PosSummon[rand32() % RAID_MODE(1, 3)]);
events.ScheduleEvent(EVENT_SUMMON, 10000);
break;
}
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp
index 554c7957d2a..fa5a0c47808 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp
@@ -236,7 +236,7 @@ class boss_gothik : public CreatureScript
void KilledUnit(Unit* /*victim*/) override
{
- if (!(rand()%5))
+ if (!(rand32() % 5))
Talk(SAY_KILL);
}
@@ -359,7 +359,7 @@ class boss_gothik : public CreatureScript
if (spellId && me->IsInCombat())
{
me->HandleEmoteCommand(EMOTE_ONESHOT_SPELL_CAST);
- if (Creature* pRandomDeadTrigger = ObjectAccessor::GetCreature(*me, DeadTriggerGUID[rand() % POS_DEAD]))
+ if (Creature* pRandomDeadTrigger = ObjectAccessor::GetCreature(*me, DeadTriggerGUID[rand32() % POS_DEAD]))
me->CastSpell(pRandomDeadTrigger, spellId, true);
}
}
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp
index 48dc889ef2b..53efc628aa2 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp
@@ -75,7 +75,7 @@ public:
void KilledUnit(Unit* who) override
{
- if (!(rand()%5))
+ if (!(rand32() % 5))
Talk(SAY_SLAY);
if (who->GetTypeId() == TYPEID_PLAYER)
safetyDance = false;
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp
index c5c70cf3957..61ee650b37a 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp
@@ -583,7 +583,7 @@ public:
if (!unitList.empty())
{
std::vector<Unit*>::const_iterator itr = unitList.begin();
- advance(itr, rand()%unitList.size());
+ advance(itr, rand32() % unitList.size());
DoCast(*itr, SPELL_MANA_DETONATION);
Talk(SAY_SPECIAL);
}
@@ -599,7 +599,7 @@ public:
case EVENT_BLAST:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, RAID_MODE(1, 0), 0, true))
DoCast(target, SPELL_FROST_BLAST);
- if (rand()%2)
+ if (rand32() % 2)
Talk(SAY_FROST_BLAST);
events.Repeat(30000, 90000);
break;
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp b/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp
index 52723b591a2..7f7adefc2fb 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp
@@ -109,7 +109,7 @@ public:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0, true, -SPELL_WEB_WRAP))
{
target->RemoveAura(RAID_MODE(SPELL_WEB_SPRAY_10, SPELL_WEB_SPRAY_25));
- uint8 pos = rand()%MAX_POS_WRAP;
+ uint8 pos = rand32() % MAX_POS_WRAP;
target->GetMotionMaster()->MoveJump(PosWrap[pos].GetPositionX(), PosWrap[pos].GetPositionY(), PosWrap[pos].GetPositionZ(), 20, 20);
if (Creature* wrap = DoSummon(NPC_WEB_WRAP, PosWrap[pos], 0, TEMPSUMMON_CORPSE_DESPAWN))
wrap->AI()->SetGUID(target->GetGUID());
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp
index d6d91d14a21..94117e9dbbf 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp
@@ -100,7 +100,7 @@ public:
else
{
events.ScheduleEvent(EVENT_BALCONY, 110000);
- events.ScheduleEvent(EVENT_CURSE, 10000+rand()%15000);
+ events.ScheduleEvent(EVENT_CURSE, 10000 + rand32() % 15000);
events.ScheduleEvent(EVENT_WARRIOR, 30000);
if (GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL)
events.ScheduleEvent(EVENT_BLINK, urand(20000, 40000));
@@ -109,7 +109,7 @@ public:
void KilledUnit(Unit* /*victim*/) override
{
- if (!(rand()%5))
+ if (!(rand32() % 5))
Talk(SAY_SLAY);
}
@@ -129,7 +129,7 @@ public:
void SummonUndead(uint32 entry, uint32 num)
{
for (uint32 i = 0; i < num; ++i)
- me->SummonCreature(entry, SummonPos[rand()%MAX_SUMMON_POS], TEMPSUMMON_CORPSE_DESPAWN, 60000);
+ me->SummonCreature(entry, SummonPos[rand32() % MAX_SUMMON_POS], TEMPSUMMON_CORPSE_DESPAWN, 60000);
}
void UpdateAI(uint32 diff) override
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp
index a713474d256..a47b75ec234 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp
@@ -75,7 +75,7 @@ public:
void KilledUnit(Unit* /*Victim*/) override
{
- if (!(rand()%5))
+ if (!(rand32() % 5))
Talk(SAY_SLAY);
}
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp b/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp
index d9a64569516..3a29e8ac83f 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp
@@ -72,7 +72,7 @@ public:
void KilledUnit(Unit* /*victim*/) override
{
- if (!(rand()%3))
+ if (!(rand32() % 3))
DoPlaySoundToSet(me, SOUND_SLAY);
}
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp
index e3527b46bed..6a3927d4aa0 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp
@@ -312,7 +312,7 @@ class boss_sapphiron : public CreatureScript
else
{
std::vector<Unit*>::const_iterator itr = targets.begin();
- advance(itr, rand()%targets.size());
+ advance(itr, rand32() % targets.size());
_iceblocks.insert(std::make_pair((*itr)->GetGUID(), 0));
DoCast(*itr, SPELL_ICEBOLT);
--_iceboltCount;
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp
index 406ca3963a4..34e21336547 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp
@@ -149,7 +149,7 @@ public:
void KilledUnit(Unit* /*victim*/) override
{
- if (!(rand()%5))
+ if (!(rand32() % 5))
Talk(SAY_SLAY);
}
@@ -309,7 +309,7 @@ public:
void KilledUnit(Unit* /*victim*/) override
{
- if (!(rand()%5))
+ if (!(rand32() % 5))
Talk(SAY_STAL_SLAY);
}
@@ -399,7 +399,7 @@ public:
void KilledUnit(Unit* /*victim*/) override
{
- if (!(rand()%5))
+ if (!(rand32() % 5))
Talk(SAY_FEUG_SLAY);
}
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp
index 13ea815febc..40fa5a5c934 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp
@@ -245,7 +245,7 @@ public:
DoRemoveStanceAura(m_uiStance);
- int uiTempStance = rand()%(3-1);
+ int uiTempStance = rand32() % (3 - 1);
if (uiTempStance >= m_uiStance)
++uiTempStance;
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp
index 9be91bf9c64..8e619864201 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp
@@ -201,7 +201,7 @@ class boss_skarvald_the_constructor : public CreatureScript
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, SkarvaldChargePredicate(me)))
DoCast(target, SPELL_CHARGE);
- Charge_Timer = 5000+rand()%5000;
+ Charge_Timer = 5000 + rand32() % 5000;
}
else
Charge_Timer -= diff;
@@ -209,7 +209,7 @@ class boss_skarvald_the_constructor : public CreatureScript
if (StoneStrike_Timer <= diff)
{
DoCastVictim(SPELL_STONE_STRIKE);
- StoneStrike_Timer = 5000+rand()%5000;
+ StoneStrike_Timer = 5000 + rand32() % 5000;
}
else
StoneStrike_Timer -= diff;
@@ -374,7 +374,7 @@ class boss_dalronn_the_controller : public CreatureScript
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
DoCast(target, SPELL_DEBILITATE);
- Debilitate_Timer = 5000+rand()%5000;
+ Debilitate_Timer = 5000 + rand32() % 5000;
}
}
else
@@ -387,7 +387,7 @@ class boss_dalronn_the_controller : public CreatureScript
if (!me->IsNonMeleeSpellCast(false))
{
DoCast(me, H_SPELL_SUMMON_SKELETONS);
- Summon_Timer = (rand()%10000) + 20000;
+ Summon_Timer = (rand32() % 10000) + 20000;
}
}
else
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp
index 664facd31a1..245cf46336d 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp
@@ -297,19 +297,19 @@ public:
if (uiChainLightingTimer <= diff)
{
DoCastVictim(SPELL_CHAIN_LIGHTING);
- uiChainLightingTimer = 5000 + rand() % 5000;
+ uiChainLightingTimer = 5000 + rand32() % 5000;
} else uiChainLightingTimer -= diff;
if (uiCrazedTimer <= diff)
{
DoCast(me, SPELL_CRAZED);
- uiCrazedTimer = 8000 + rand() % 4000;
+ uiCrazedTimer = 8000 + rand32() % 4000;
} else uiCrazedTimer -= diff;
if (uiTerrifyingRoarTimer <= diff)
{
DoCast(me, SPELL_TERRIFYING_ROAR);
- uiTerrifyingRoarTimer = 10000 + rand() % 10000;
+ uiTerrifyingRoarTimer = 10000 + rand32() % 10000;
} else uiTerrifyingRoarTimer -= diff;
DoMeleeAttackIfReady();
@@ -405,7 +405,7 @@ public:
if (uiMortalWoundTimer <= diff)
{
DoCastVictim(SPELL_MORTAL_WOUND);
- uiMortalWoundTimer = 3000 + rand() % 4000;
+ uiMortalWoundTimer = 3000 + rand32() % 4000;
} else uiMortalWoundTimer -= diff;
if (uiEnrage1Timer <= diff)
@@ -515,20 +515,20 @@ public:
if (uiStompTimer <= diff)
{
DoCastVictim(SPELL_STOMP);
- uiStompTimer = 8000 + rand() % 4000;
+ uiStompTimer = 8000 + rand32() % 4000;
} else uiStompTimer -= diff;
if (uiGoreTimer <= diff)
{
DoCastVictim(SPELL_GORE);
- uiGoreTimer = 13000 + rand() % 4000;
+ uiGoreTimer = 13000 + rand32() % 4000;
} else uiGoreTimer -= diff;
if (uiGrievousWoundTimer <= diff)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_GRIEVOUS_WOUND);
- uiGrievousWoundTimer = 18000 + rand() % 4000;
+ uiGrievousWoundTimer = 18000 + rand32() % 4000;
} else uiGrievousWoundTimer -= diff;
DoMeleeAttackIfReady();
@@ -631,20 +631,20 @@ public:
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_ACID_SPIT);
- uiAcidSpitTimer = 2000 + rand() % 2000;
+ uiAcidSpitTimer = 2000 + rand32() % 2000;
} else uiAcidSpitTimer -= diff;
if (uiAcidSplatterTimer <= diff)
{
DoCast(me, SPELL_POISON_BREATH);
- uiAcidSplatterTimer = 10000 + rand() % 4000;
+ uiAcidSplatterTimer = 10000 + rand32() % 4000;
} else uiAcidSplatterTimer -= diff;
if (uiPoisonBreathTimer <= diff)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_POISON_BREATH);
- uiPoisonBreathTimer = 8000 + rand() % 4000;
+ uiPoisonBreathTimer = 8000 + rand32() % 4000;
} else uiPoisonBreathTimer -= diff;
DoMeleeAttackIfReady();
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp
index 41dd1a165f2..ea44d76e7e6 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp
@@ -421,15 +421,15 @@ public:
switch (urand(0, 2))
{
case 0:
- me->SummonCreature(NPC_YMIRJAR_WARRIOR, SpawnLoc.GetPositionX()+rand()%5, SpawnLoc.GetPositionY()+rand()%5, SpawnLoc.GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
+ me->SummonCreature(NPC_YMIRJAR_WARRIOR, SpawnLoc.GetPositionX() + rand32() % 5, SpawnLoc.GetPositionY() + rand32() % 5, SpawnLoc.GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
break;
case 1:
- me->SummonCreature(NPC_YMIRJAR_WITCH_DOCTOR, SpawnLoc.GetPositionX()+rand()%5, SpawnLoc.GetPositionY()+rand()%5, SpawnLoc.GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
+ me->SummonCreature(NPC_YMIRJAR_WITCH_DOCTOR, SpawnLoc.GetPositionX() + rand32() % 5, SpawnLoc.GetPositionY() + rand32() % 5, SpawnLoc.GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
break;
case 2:
- me->SummonCreature(NPC_YMIRJAR_HARPOONER, SpawnLoc.GetPositionX()+rand()%5, SpawnLoc.GetPositionY()+rand()%5, SpawnLoc.GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
+ me->SummonCreature(NPC_YMIRJAR_HARPOONER, SpawnLoc.GetPositionX() + rand32() % 5, SpawnLoc.GetPositionY() + rand32() % 5, SpawnLoc.GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
break;
}
}
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp
index de4d6c32c97..dfef80133c4 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp
@@ -111,7 +111,7 @@ public:
m_uiActiveOrder[i] = i;
for (int i = 0; i < 3; ++i)
{
- int r = i + (rand() % (4 - i));
+ int r = i + (rand32() % (4 - i));
int temp = m_uiActiveOrder[i];
m_uiActiveOrder[i] = m_uiActiveOrder[r];
m_uiActiveOrder[r] = temp;
@@ -275,7 +275,7 @@ public:
if (m_bIsActiveWithBJORN && m_uiAbility_BJORN_Timer <= diff)
{
//DoCast(me, SPELL_SUMMON_SPIRIT_FOUNT); // works fine, but using summon has better control
- if (Creature* temp = me->SummonCreature(NPC_SPIRIT_FOUNT, 385.0f + rand() % 10, -330.0f + rand() % 10, 104.756f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 180000))
+ if (Creature* temp = me->SummonCreature(NPC_SPIRIT_FOUNT, 385.0f + rand32() % 10, -330.0f + rand32() % 10, 104.756f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 180000))
{
temp->SetSpeed(MOVE_RUN, 0.4f);
temp->CastSpell(temp, DUNGEON_MODE(SPELL_SPIRIT_FOUNT, H_SPELL_SPIRIT_FOUNT), true);
@@ -307,7 +307,7 @@ public:
for (uint8 i = 0; i < 4; ++i)
{
//DoCast(me, SPELL_SUMMON_AVENGING_SPIRIT); // works fine, but using summon has better control
- if (Creature* temp = me->SummonCreature(NPC_AVENGING_SPIRIT, x + rand() % 10, y + rand() % 10, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))
+ if (Creature* temp = me->SummonCreature(NPC_AVENGING_SPIRIT, x + rand32() % 10, y + rand32() % 10, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
diff --git a/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp b/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp
index 66ab5a04c3c..b63709b34c8 100644
--- a/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp
+++ b/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp
@@ -174,7 +174,7 @@ public:
//If one of the adds is dead spawn heals faster
Creature* pGuard1 = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_EREKEM_GUARD_1));
Creature* pGuard2 = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_EREKEM_GUARD_2));
- uiChainHealTimer = ((pGuard1 && !pGuard1->IsAlive()) || (pGuard2 && !pGuard2->IsAlive()) ? 3000 : 8000) + rand()%3000;
+ uiChainHealTimer = ((pGuard1 && !pGuard1->IsAlive()) || (pGuard2 && !pGuard2->IsAlive()) ? 3000 : 8000) + rand32() % 3000;
}
} else uiChainHealTimer -= diff;
diff --git a/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp b/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp
index 2bac444a558..734c20000eb 100644
--- a/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp
+++ b/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp
@@ -177,7 +177,7 @@ public:
Talk(SAY_SPAWN);
DoCast(me, SPELL_SUMMON_ETHEREAL_SPHERE_1);
if (IsHeroic()) // extra one for heroic
- me->SummonCreature(NPC_ETHEREAL_SPHERE, me->GetPositionX()-5+rand()%10, me->GetPositionY()-5+rand()%10, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 40000);
+ me->SummonCreature(NPC_ETHEREAL_SPHERE, me->GetPositionX() - 5 + rand32() % 10, me->GetPositionY() - 5 + rand32() % 10, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 40000);
uiSummonEtherealSphere_Timer = urand(45000, 47000);
uiArcaneBuffet_Timer = urand(5000, 6000);
diff --git a/src/server/scripts/Northrend/zone_dragonblight.cpp b/src/server/scripts/Northrend/zone_dragonblight.cpp
index 59c9b21a220..80e496a6e13 100644
--- a/src/server/scripts/Northrend/zone_dragonblight.cpp
+++ b/src/server/scripts/Northrend/zone_dragonblight.cpp
@@ -433,7 +433,7 @@ public:
void HandleDummy(SpellEffIndex /*effIndex*/)
{
- uint32 roll = rand() % 2;
+ uint32 roll = rand32() % 2;
Creature* tree = GetHitCreature();
Player* player = GetCaster()->ToPlayer();