diff options
Diffstat (limited to 'src/server/scripts/World')
| -rw-r--r-- | src/server/scripts/World/go_scripts.cpp | 4 | ||||
| -rw-r--r-- | src/server/scripts/World/mob_generic_creature.cpp | 4 | ||||
| -rw-r--r-- | src/server/scripts/World/npcs_special.cpp | 8 |
3 files changed, 8 insertions, 8 deletions
diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index f73d1c77da4..f5301fe5cac 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -245,7 +245,7 @@ public: bool OnGossipHello(Player* player, GameObject* go) override { go->UseDoorOrButton(); - int Random = rand() % (sizeof(NpcPrisonEntry) / sizeof(uint32)); + int Random = rand32() % (sizeof(NpcPrisonEntry) / sizeof(uint32)); if (Creature* creature = player->SummonCreature(NpcPrisonEntry[Random], go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), go->GetAngle(player), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000)) @@ -295,7 +295,7 @@ public: bool OnGossipHello(Player* player, GameObject* go) override { go->UseDoorOrButton(); - int Random = rand() % (sizeof(NpcStasisEntry) / sizeof(uint32)); + int Random = rand32() % (sizeof(NpcStasisEntry) / sizeof(uint32)); player->SummonCreature(NpcStasisEntry[Random], go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), go->GetAngle(player), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); diff --git a/src/server/scripts/World/mob_generic_creature.cpp b/src/server/scripts/World/mob_generic_creature.cpp index 2eb91b7b8fe..a27a78a5338 100644 --- a/src/server/scripts/World/mob_generic_creature.cpp +++ b/src/server/scripts/World/mob_generic_creature.cpp @@ -107,7 +107,7 @@ public: else info = SelectSpell(me->GetVictim(), 0, 0, SELECT_TARGET_ANY_ENEMY, 0, 0, 0, 0, SELECT_EFFECT_DONTCARE); //50% chance if elite or higher, 20% chance if not, to replace our white hit with a spell - if (info && (rand() % (me->GetCreatureTemplate()->rank > 1 ? 2 : 5) == 0) && !GlobalCooldown) + if (info && (rand32() % (me->GetCreatureTemplate()->rank > 1 ? 2 : 5) == 0) && !GlobalCooldown) { //Cast the spell if (Healing)DoCastSpell(me, info); @@ -130,7 +130,7 @@ public: SpellInfo const* info = NULL; //Select a healing spell if less than 30% hp ONLY 33% of the time - if (HealthBelowPct(30) && rand() % 3 == 0) + if (HealthBelowPct(30) && rand32() % 3 == 0) info = SelectSpell(me, 0, 0, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING); //No healing spell available, See if we can cast a ranged spell (Range must be greater than ATTACK_DISTANCE) diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index d2f0a7898bb..969bfa57d58 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -365,7 +365,7 @@ public: switch (emote) { case TEXT_EMOTE_CHICKEN: - if (player->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_NONE && rand() % 30 == 1) + if (player->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_NONE && rand32() % 30 == 1) { me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); me->setFaction(FACTION_FRIENDLY); @@ -835,16 +835,16 @@ void npc_doctor::npc_doctorAI::UpdateAI(uint32 diff) if (Coordinates.empty()) return; - std::vector<Location*>::iterator itr = Coordinates.begin() + rand() % Coordinates.size(); + std::vector<Location*>::iterator itr = Coordinates.begin() + rand32() % Coordinates.size(); uint32 patientEntry = 0; switch (me->GetEntry()) { case DOCTOR_ALLIANCE: - patientEntry = AllianceSoldierId[rand() % 3]; + patientEntry = AllianceSoldierId[rand32() % 3]; break; case DOCTOR_HORDE: - patientEntry = HordeSoldierId[rand() % 3]; + patientEntry = HordeSoldierId[rand32() % 3]; break; default: TC_LOG_ERROR("scripts", "Invalid entry for Triage doctor. Please check your database"); |
