diff options
| author | jackpoz <giacomopoz@gmail.com> | 2014-07-22 21:43:19 +0200 |
|---|---|---|
| committer | jackpoz <giacomopoz@gmail.com> | 2014-07-22 21:43:19 +0200 |
| commit | 3388587b7a2ded9333ab48ce4d02372d750a60fe (patch) | |
| tree | 04adaaa84bd21e4693ebb5492125468504f9faae /src/server/scripts/Kalimdor | |
| parent | 0b236d480a9ff5e75da966e50c144d3bcce9b1fa (diff) | |
Core/Misc: Replace rand() calls with SFMT
Diffstat (limited to 'src/server/scripts/Kalimdor')
16 files changed, 61 insertions, 61 deletions
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp index d86e3342cf0..576b3dbdb39 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp @@ -558,7 +558,7 @@ public: if (SummonWispTimer <= diff) { - DoSpawnCreature(CREATURE_ANCIENT_WISP, float(rand()%40), float(rand()%40), 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + DoSpawnCreature(CREATURE_ANCIENT_WISP, float(rand32() % 40), float(rand32() % 40), 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); SummonWispTimer = 1500; ++WispCount; } else SummonWispTimer -= diff; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp index c9e010e4159..38e398f3d5b 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp @@ -142,13 +142,13 @@ public: if (RainTimer <= diff) { DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 30, true), SPELL_RAIN_OF_FIRE); - RainTimer = 20000+rand()%15000; + RainTimer = 20000 + rand32() % 15000; } else RainTimer -= diff; if (DoomTimer <= diff) { DoCast(SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true), SPELL_DOOM);//never on tank - DoomTimer = 45000+rand()%5000; + DoomTimer = 45000 + rand32() % 5000; } else DoomTimer -= diff; if (HowlTimer <= diff) @@ -160,7 +160,7 @@ public: if (CleaveTimer <= diff) { DoCastVictim(SPELL_CLEAVE); - CleaveTimer = 10000+rand()%5000; + CleaveTimer = 10000 + rand32() % 5000; } else CleaveTimer -= diff; if (EnrageTimer < diff && !enraged) @@ -259,13 +259,13 @@ public: if (WarstompTimer <= diff) { DoCast(me, SPELL_WARSTOMP); - WarstompTimer = 10000+rand()%5000; + WarstompTimer = 10000 + rand32() % 5000; } else WarstompTimer -= diff; if (CrippleTimer <= diff) { DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_CRIPPLE); - CrippleTimer = 25000+rand()%5000; + CrippleTimer = 25000 + rand32() % 5000; } else CrippleTimer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp index 5266f2b22c5..c5fcb150d3f 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp @@ -137,7 +137,7 @@ public: if (CleaveTimer <= diff) { DoCast(me, SPELL_CLEAVE); - CleaveTimer = 6000+rand()%15000; + CleaveTimer = 6000 + rand32() % 15000; } else CleaveTimer -= diff; if (WarStompTimer <= diff) diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp index 9ac5034d954..c37b9d910e7 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp @@ -132,24 +132,24 @@ public: if (FrostArmorTimer <= diff) { DoCast(me, SPELL_FROST_ARMOR); - FrostArmorTimer = 40000+rand()%20000; + FrostArmorTimer = 40000 + rand32() % 20000; } else FrostArmorTimer -= diff; if (DecayTimer <= diff) { DoCastVictim(SPELL_DEATH_AND_DECAY); - DecayTimer = 60000+rand()%20000; + DecayTimer = 60000 + rand32() % 20000; Talk(SAY_DECAY); } else DecayTimer -= diff; if (NovaTimer <= diff) { DoCastVictim(SPELL_FROST_NOVA); - NovaTimer = 30000+rand()%15000; + NovaTimer = 30000 + rand32() % 15000; Talk(SAY_NOVA); } else NovaTimer -= diff; if (IceboltTimer <= diff) { DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 40, true), SPELL_ICEBOLT); - IceboltTimer = 11000+rand()%20000; + IceboltTimer = 11000 + rand32() % 20000; } else IceboltTimer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp index 4e6da7dcac2..316834c422a 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp @@ -444,7 +444,7 @@ void hyjalAI::MoveInLineOfSight(Unit* who) void hyjalAI::SummonCreature(uint32 entry, float Base[4][3]) { - uint32 random = rand()%4; + uint32 random = rand32() % 4; float SpawnLoc[3]; for (uint8 i = 0; i < 3; ++i) @@ -529,7 +529,7 @@ void hyjalAI::SummonCreature(uint32 entry, float Base[4][3]) void hyjalAI::SummonNextWave(const Wave wave[18], uint32 Count, float Base[4][3]) { // 1 in 4 chance we give a rally yell. Not sure if the chance is offilike. - if (rand()%4 == 0) + if (rand32() % 4 == 0) Talk(RALLY); InfernalCount = 0;//reset infernal count every new wave @@ -1032,7 +1032,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff) for (uint8 i = 0; i < 25; ++i)//summon 25 ghouls { - uint8 r = rand()%4; + uint8 r = rand32() % 4; Creature* unit = me->SummonCreature(GHOUL, AllianceBase[r][0]+irand(-15, 15), AllianceBase[r][1]+irand(-15, 15), AllianceBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); if (unit) { @@ -1044,7 +1044,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff) } for (uint8 i = 0; i < 3; ++i)//summon 3 abominations { - uint8 r = rand()%4; + uint8 r = rand32() % 4; Creature* unit = me->SummonCreature(ABOMINATION, AllianceBase[r][0]+irand(-15, 15), AllianceBase[r][1]+irand(-15, 15), AllianceBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); if (unit) { @@ -1085,7 +1085,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff) } for (uint8 i = 0; i < 25; ++i)//summon 25 ghouls { - uint8 r = rand()%4; + uint8 r = rand32() % 4; Creature* unit = me->SummonCreature(GHOUL, HordeBase[r][0]+irand(-15, 15), HordeBase[r][1]+irand(-15, 15), HordeBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); if (unit) { @@ -1097,7 +1097,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff) } for (uint8 i = 0; i < 5; ++i)//summon 5 abominations { - uint8 r = rand()%4; + uint8 r = rand32() % 4; Creature* unit = me->SummonCreature(ABOMINATION, HordeBase[r][0]+irand(-15, 15), HordeBase[r][1]+irand(-15, 15), HordeBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); if (unit) { diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp index 85de43cb4c4..3a5025695f8 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp @@ -417,7 +417,7 @@ public: instance = creature->GetInstanceScript(); meteor = false;//call once! CanMove = false; - Delay = rand()%30000; + Delay = rand32() % 30000; me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetDisplayId(MODEL_INVIS); @@ -467,7 +467,7 @@ public: { float x, y, z; me->GetPosition(x, y, z); - Creature* trigger = me->SummonCreature(NPC_TRIGGER, x+8, y+8, z+25+rand()%10, me->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 1000); + Creature* trigger = me->SummonCreature(NPC_TRIGGER, x + 8, y + 8, z + 25 + rand32() % 10, me->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 1000); if (trigger) { trigger->SetVisible(false); @@ -618,7 +618,7 @@ public: if (KnockDownTimer <= diff) { DoCastVictim(SPELL_KNOCKDOWN); - KnockDownTimer = 15000+rand()%10000; + KnockDownTimer = 15000 + rand32() % 10000; } else KnockDownTimer -= diff; DoMeleeAttackIfReady(); } @@ -651,7 +651,7 @@ public: bool RandomMove; void Reset() override { - FrenzyTimer = 5000+rand()%5000; + FrenzyTimer = 5000 + rand32() % 5000; MoveTimer = 2000; RandomMove = false; } @@ -714,7 +714,7 @@ public: if (FrenzyTimer <= diff) { DoCast(me, SPELL_FRENZY); - FrenzyTimer = 15000+rand()%15000; + FrenzyTimer = 15000 + rand32() % 15000; } else FrenzyTimer -= diff; if (!UpdateVictim()) return; @@ -750,7 +750,7 @@ public: void Reset() override { - ShadowBoltTimer = 1000+rand()%5000; + ShadowBoltTimer = 1000 + rand32() % 5000; summons.DespawnAll(); } @@ -840,7 +840,7 @@ public: if (ShadowBoltTimer <= diff) { DoCastVictim(SPELL_SHADOW_BOLT); - ShadowBoltTimer = 20000+rand()%10000; + ShadowBoltTimer = 20000 + rand32() % 10000; } else ShadowBoltTimer -= diff; DoMeleeAttackIfReady(); @@ -875,9 +875,9 @@ public: void Reset() override { - CourseTimer = 20000+rand()%5000; - WailTimer = 15000+rand()%5000; - ShellTimer = 50000+rand()%10000; + CourseTimer = 20000 + rand32() % 5000; + WailTimer = 15000 + rand32() % 5000; + ShellTimer = 50000 + rand32() % 10000; } void WaypointReached(uint32 waypointId) override @@ -931,17 +931,17 @@ public: if (CourseTimer <= diff) { DoCastVictim(SPELL_BANSHEE_CURSE); - CourseTimer = 20000+rand()%5000; + CourseTimer = 20000 + rand32() % 5000; } else CourseTimer -= diff; if (WailTimer <= diff) { DoCastVictim(SPELL_BANSHEE_WAIL); - WailTimer = 15000+rand()%5000; + WailTimer = 15000 + rand32() % 5000; } else WailTimer -= diff; if (ShellTimer <= diff) { DoCast(me, SPELL_ANTI_MAGIC_SHELL); - ShellTimer = 50000+rand()%10000; + ShellTimer = 50000 + rand32() % 10000; } else ShellTimer -= diff; DoMeleeAttackIfReady(); } @@ -973,7 +973,7 @@ public: void Reset() override { - WebTimer = 20000+rand()%5000; + WebTimer = 20000 + rand32() % 5000; } void WaypointReached(uint32 waypointId) override @@ -1027,7 +1027,7 @@ public: if (WebTimer <= diff) { DoCastVictim(SPELL_WEB); - WebTimer = 20000+rand()%5000; + WebTimer = 20000 + rand32() % 5000; } else WebTimer -= diff; DoMeleeAttackIfReady(); } @@ -1059,7 +1059,7 @@ public: void Reset() override { - ManaBurnTimer = 9000+rand()%5000; + ManaBurnTimer = 9000 + rand32() % 5000; } void WaypointReached(uint32 waypointId) override @@ -1113,7 +1113,7 @@ public: if (ManaBurnTimer <= diff) { DoCastVictim(SPELL_MANA_BURN); - ManaBurnTimer = 9000+rand()%5000; + ManaBurnTimer = 9000 + rand32() % 5000; } else ManaBurnTimer -= diff; DoMeleeAttackIfReady(); } @@ -1267,7 +1267,7 @@ public: { forcemove = true; Zpos = 10.0f; - StrikeTimer = 2000+rand()%5000; + StrikeTimer = 2000 + rand32() % 5000; MoveTimer = 0; me->SetDisableGravity(true); } @@ -1332,7 +1332,7 @@ public: if (StrikeTimer <= diff) { me->CastSpell(DummyTarget[0], DummyTarget[1], DummyTarget[2], SPELL_GARGOYLE_STRIKE, false); - StrikeTimer = 2000+rand()%1000; + StrikeTimer = 2000 + rand32() % 1000; } else StrikeTimer -= diff; } } @@ -1367,7 +1367,7 @@ public: DoCastVictim(SPELL_GARGOYLE_STRIKE); me->StopMoving(); me->GetMotionMaster()->Clear(); - StrikeTimer = 2000+rand()%1000; + StrikeTimer = 2000 + rand32() % 1000; } else StrikeTimer=0; } else StrikeTimer -= diff; } @@ -1399,7 +1399,7 @@ public: void Reset() override { - ExplodeTimer = 5000+rand()%5000; + ExplodeTimer = 5000 + rand32() % 5000; } void MoveInLineOfSight(Unit* who) override @@ -1432,9 +1432,9 @@ public: EnterEvadeMode(); return; } - int dmg = 500+rand()%700; + int dmg = 500 + rand32() % 700; me->CastCustomSpell(me->GetVictim(), SPELL_EXPLODING_SHOT, &dmg, 0, 0, false); - ExplodeTimer = 5000+rand()%5000; + ExplodeTimer = 5000 + rand32() % 5000; } else ExplodeTimer -= diff; DoMeleeAttackIfReady(); } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp index 4192feb52a7..e27dec09802 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp @@ -117,14 +117,14 @@ public: if (ImpendingDeath_Timer <= diff) { DoCastVictim(SPELL_IMPENDING_DEATH); - ImpendingDeath_Timer = 25000+rand()%5000; + ImpendingDeath_Timer = 25000 + rand32() % 5000; } else ImpendingDeath_Timer -= diff; if (WingBuffet_Timer <= diff) { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_WING_BUFFET); - WingBuffet_Timer = 25000+rand()%10000; + WingBuffet_Timer = 25000 + rand32() % 10000; } else WingBuffet_Timer -= diff; if (Mda_Timer <= diff) diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp index a6f1cdd5b0b..2cf5169b530 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp @@ -167,7 +167,7 @@ public: if (Whirlwind_Timer <= diff) { DoCastVictim(SPELL_WHIRLWIND); - Whirlwind_Timer = 20000+rand()%5000; + Whirlwind_Timer = 20000 + rand32() % 5000; } else Whirlwind_Timer -= diff; //Fear @@ -175,7 +175,7 @@ public: { Talk(SAY_SHOUT); DoCastVictim(SPELL_FRIGHTENING_SHOUT); - Fear_Timer = 25000+rand()%10000; + Fear_Timer = 25000 + rand32() % 10000; } else Fear_Timer -= diff; //Mortal Strike @@ -183,7 +183,7 @@ public: { Talk(SAY_MORTAL); DoCastVictim(SPELL_MORTAL_STRIKE); - MortalStrike_Timer = 20000+rand()%10000; + MortalStrike_Timer = 20000 + rand32() % 10000; } else MortalStrike_Timer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/instance_the_black_morass.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/instance_the_black_morass.cpp index cf3eff4732c..3e776a0c905 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/instance_the_black_morass.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/instance_the_black_morass.cpp @@ -37,7 +37,7 @@ enum Misc RIFT_BOSS = 1 }; -inline uint32 RandRiftBoss() { return ((rand()%2) ? NPC_RIFT_KEEPER : NPC_RIFT_LORD); } +inline uint32 RandRiftBoss() { return ((rand32() % 2) ? NPC_RIFT_KEEPER : NPC_RIFT_LORD); } float PortalLocation[4][4]= { diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp index b904ed44b47..189cb7854ad 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp @@ -309,7 +309,7 @@ public: break; } - Heal_Timer = 15000+rand()%15000; + Heal_Timer = 15000 + rand32() % 15000; } else Heal_Timer -= diff; //Checking if Vem is dead. If yes we will enrage. diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp index 21da920e4fd..dd0c93e8a28 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp @@ -561,7 +561,7 @@ public: //Get random but only if we have more than one unit on threat list if (temp.size() > 1) - advance (j, rand() % (temp.size() - 1)); + advance(j, rand32() % (temp.size() - 1)); return (*j); } @@ -692,7 +692,7 @@ public: if (unit && i->second == true) { //Teleport each player out - DoTeleportPlayer(unit, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()+10, float(rand()%6)); + DoTeleportPlayer(unit, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 10, float(rand32() % 6)); //Cast knockback on them DoCast(unit, SPELL_EXIT_STOMACH_KNOCKBACK, true); @@ -729,7 +729,7 @@ public: if (unit->IsWithinDist3d(&KickPos, 15.0f)) { //Teleport each player out - DoTeleportPlayer(unit, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()+10, float(rand()%6)); + DoTeleportPlayer(unit, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 10, float(rand32() % 6)); //Cast knockback on them DoCast(unit, SPELL_EXIT_STOMACH_KNOCKBACK, true); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp index 5eced848b47..5947c9860ec 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp @@ -77,15 +77,15 @@ public: if (!victim) return; - Rand = 10 + (rand()%10); - switch (rand()%2) + Rand = 10 + (rand32() % 10); + switch (rand32() % 2) { case 0: RandX = 0.0f - Rand; break; case 1: RandX = 0.0f + Rand; break; } - Rand = 10 + (rand()%10); - switch (rand()%2) + Rand = 10 + (rand32() % 10); + switch (rand32() % 2) { case 0: RandY = 0.0f - Rand; break; case 1: RandY = 0.0f + Rand; break; diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp index acf0215f9ff..c5011eba2f8 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp @@ -330,7 +330,7 @@ struct boss_twinemperorsAI : public ScriptedAI } if (c->IsWithinDistInMap(me, ABUSE_BUG_RANGE)) { - if (!nearb || (rand()%4) == 0) + if (!nearb || (rand32() % 4) == 0) nearb = c; } } @@ -437,7 +437,7 @@ public: if (UnbalancingStrike_Timer <= diff) { DoCastVictim(SPELL_UNBALANCING_STRIKE); - UnbalancingStrike_Timer = 8000+rand()%12000; + UnbalancingStrike_Timer = 8000 + rand32() % 12000; } else UnbalancingStrike_Timer -= diff; if (UpperCut_Timer <= diff) @@ -445,7 +445,7 @@ public: Unit* randomMelee = SelectTarget(SELECT_TARGET_RANDOM, 0, NOMINAL_MELEE_RANGE, true); if (randomMelee) DoCast(randomMelee, SPELL_UPPERCUT); - UpperCut_Timer = 15000+rand()%15000; + UpperCut_Timer = 15000 + rand32() % 15000; } else UpperCut_Timer -= diff; HandleBugs(diff); @@ -542,7 +542,7 @@ public: target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45, true); if (target) DoCast(target, SPELL_BLIZZARD); - Blizzard_Timer = 15000+rand()%15000; + Blizzard_Timer = 15000 + rand32() % 15000; } else Blizzard_Timer -= diff; if (ArcaneBurst_Timer <= diff) diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp index 0614303515c..e41fbb7d90d 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp @@ -169,7 +169,7 @@ public: { for (int t = 0; t < 2; ++t) { - for (int i = !t ? (rand()%9) : 0; i < 9; ++i) + for (int i = !t ? (rand32()%9) : 0; i < 9; ++i) { if (!chosenAbilities[i]) { diff --git a/src/server/scripts/Kalimdor/zone_silithus.cpp b/src/server/scripts/Kalimdor/zone_silithus.cpp index 04cec70b7ad..8bafdfebcd5 100644 --- a/src/server/scripts/Kalimdor/zone_silithus.cpp +++ b/src/server/scripts/Kalimdor/zone_silithus.cpp @@ -905,7 +905,7 @@ public: if (Creature* spawn = me->SummonCreature(WavesInfo[WaveCount].CreatureId, SpawnLocation[i], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, desptimer)) { if (spawn->GetEntry() == 15423) - spawn->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15427+rand()%4); + spawn->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15427 + rand32() % 4); if (i >= 30) WaveCount = 1; if (i >= 33) WaveCount = 2; if (i >= 45) WaveCount = 3; diff --git a/src/server/scripts/Kalimdor/zone_the_barrens.cpp b/src/server/scripts/Kalimdor/zone_the_barrens.cpp index dabfee00065..b158422054f 100644 --- a/src/server/scripts/Kalimdor/zone_the_barrens.cpp +++ b/src/server/scripts/Kalimdor/zone_the_barrens.cpp @@ -161,7 +161,7 @@ public: void EnterCombat(Unit* who) override { //not always use - if (rand()%4) + if (rand32() % 4) return; //only aggro text if not player and only in this area |
