Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts: src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp src/server/scripts/EasternKingdoms/zone_hinterlands.cpp
This commit is contained in:
commit
8bc519a308
116 files changed
+412
-422
No files matched your search
@@ -0,0 +1,4 @@
|
||||
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=19 AND `SourceEntry`=1790;
|
||||
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
|
||||
(19,0,1790,0,0,8,0,1786,0,0,1,0,0,'','Show quest ''The Symbol of Life'' only if quest ''The Tome of Divinity'' is not rewarded'),
|
||||
(19,0,1790,0,0,28,0,1786,0,0,1,0,0,'','Show quest ''The Symbol of Life'' only if quest ''The Tome of Divinity'' is not completed');
|
||||
@@ -0,0 +1 @@
|
||||
ALTER TABLE `playercreateinfo_skills` ENGINE MyISAM;
|
||||
@@ -0,0 +1,4 @@
|
||||
--
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`=17716 AND `source_type`=0 AND `id`=1;
|
||||
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
|
||||
(17716, 0, 1, 0, 6, 0, 100, 1, 0, 30, 0, 0, 15, 9678, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Sangrias Stillblade - On Death - Complete quest');
|
||||
@@ -145,7 +145,7 @@ void AuthSession::AsyncReadHeader()
|
||||
if ((uint8)entry.cmd == _readBuffer[0] && (entry.status == STATUS_CONNECTED || (_isAuthenticated && entry.status == STATUS_AUTHED)))
|
||||
{
|
||||
// Handle dynamic size packet
|
||||
if (_readBuffer[0] == AUTH_LOGON_CHALLENGE)
|
||||
if (_readBuffer[0] == AUTH_LOGON_CHALLENGE || _readBuffer[0] == AUTH_RECONNECT_CHALLENGE)
|
||||
{
|
||||
_socket.read_some(boost::asio::buffer(&_readBuffer[1], sizeof(uint8) + sizeof(uint16))); //error + size
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ void CombatAI::EnterCombat(Unit* who)
|
||||
if (AISpellInfo[*i].condition == AICOND_AGGRO)
|
||||
me->CastSpell(who, *i, false);
|
||||
else if (AISpellInfo[*i].condition == AICOND_COMBAT)
|
||||
events.ScheduleEvent(*i, AISpellInfo[*i].cooldown + rand()%AISpellInfo[*i].cooldown);
|
||||
events.ScheduleEvent(*i, AISpellInfo[*i].cooldown + rand32() % AISpellInfo[*i].cooldown);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ void CombatAI::UpdateAI(uint32 diff)
|
||||
if (uint32 spellId = events.ExecuteEvent())
|
||||
{
|
||||
DoCast(spellId);
|
||||
events.ScheduleEvent(spellId, AISpellInfo[spellId].cooldown + rand()%AISpellInfo[spellId].cooldown);
|
||||
events.ScheduleEvent(spellId, AISpellInfo[spellId].cooldown + rand32() % AISpellInfo[spellId].cooldown);
|
||||
}
|
||||
else
|
||||
DoMeleeAttackIfReady();
|
||||
@@ -125,7 +125,7 @@ void CasterAI::EnterCombat(Unit* who)
|
||||
if (spells.empty())
|
||||
return;
|
||||
|
||||
uint32 spell = rand()%spells.size();
|
||||
uint32 spell = rand32() % spells.size();
|
||||
uint32 count = 0;
|
||||
for (SpellVct::iterator itr = spells.begin(); itr != spells.end(); ++itr, ++count)
|
||||
{
|
||||
|
||||
@@ -3465,7 +3465,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
|
||||
return;
|
||||
|
||||
uint32 spellId = 0;
|
||||
switch (rand() % 4)
|
||||
switch (rand32() % 4)
|
||||
{
|
||||
case 0: spellId = 46740; break;
|
||||
case 1: spellId = 46739; break;
|
||||
|
||||
+2
-2
@@ -125,7 +125,7 @@ public:
|
||||
npc_grimstoneAI(Creature* creature) : npc_escortAI(creature)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
MobSpawnId = rand()%6;
|
||||
MobSpawnId = rand32() % 6;
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
@@ -175,7 +175,7 @@ public:
|
||||
/// @todo move them to center
|
||||
void SummonRingBoss()
|
||||
{
|
||||
if (Creature* tmp = me->SummonCreature(RingBoss[rand()%6], 644.300f, -175.989f, -53.739f, 3.418f, TEMPSUMMON_DEAD_DESPAWN, 0))
|
||||
if (Creature* tmp = me->SummonCreature(RingBoss[rand32() % 6], 644.300f, -175.989f, -53.739f, 3.418f, TEMPSUMMON_DEAD_DESPAWN, 0))
|
||||
RingBossGUID = tmp->GetGUID();
|
||||
|
||||
MobDeath_Timer = 2500;
|
||||
|
||||
+1
-1
@@ -418,7 +418,7 @@ public:
|
||||
|
||||
void KilledUnit(Unit* victim) override
|
||||
{
|
||||
if (rand()%5)
|
||||
if (rand32() % 5)
|
||||
return;
|
||||
|
||||
Talk(SAY_SLAY, victim);
|
||||
|
||||
+1
-1
@@ -111,7 +111,7 @@ public:
|
||||
|
||||
void KilledUnit(Unit* victim) override
|
||||
{
|
||||
if (rand()%5)
|
||||
if (rand32() % 5)
|
||||
return;
|
||||
|
||||
Talk(SAY_KILLTARGET, victim);
|
||||
|
||||
@@ -136,7 +136,7 @@ public:
|
||||
if (AddTimer <= diff)
|
||||
{
|
||||
//Summon Astral Flare
|
||||
Creature* AstralFlare = DoSpawnCreature(17096, float(rand()%37), float(rand()%37), 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
|
||||
Creature* AstralFlare = DoSpawnCreature(17096, float(rand32() % 37), float(rand32() % 37), 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
|
||||
Unit* target = NULL;
|
||||
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
|
||||
|
||||
@@ -64,9 +64,9 @@ public:
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
Repentance_Timer = 25000+(rand()%15000);
|
||||
Holyfire_Timer = 8000+(rand()%17000);
|
||||
Holywrath_Timer = 15000+(rand()%10000);
|
||||
Repentance_Timer = 25000 + (rand32() % 15000);
|
||||
Holyfire_Timer = 8000 + (rand32() % 17000);
|
||||
Holywrath_Timer = 15000 + (rand32() % 10000);
|
||||
Holyground_Timer = 3000;
|
||||
Enrage_Timer = 600000;
|
||||
|
||||
|
||||
@@ -294,7 +294,7 @@ void boss_attumen::boss_attumenAI::UpdateAI(uint32 diff)
|
||||
target = NULL;
|
||||
}
|
||||
if (!target_list.empty())
|
||||
target = *(target_list.begin()+rand()%target_list.size());
|
||||
target = *(target_list.begin() + rand32() % target_list.size());
|
||||
|
||||
DoCast(target, SPELL_BERSERKER_CHARGE);
|
||||
ChargeTimer = 20000;
|
||||
|
||||
@@ -358,7 +358,7 @@ struct boss_moroes_guestAI : public ScriptedAI
|
||||
|
||||
Unit* SelectGuestTarget()
|
||||
{
|
||||
uint64 TempGUID = GuestGUID[rand()%4];
|
||||
uint64 TempGUID = GuestGUID[rand32() % 4];
|
||||
if (TempGUID)
|
||||
{
|
||||
Unit* unit = ObjectAccessor::GetUnit(*me, TempGUID);
|
||||
|
||||
@@ -140,7 +140,7 @@ public:
|
||||
|
||||
void SummonPortals()
|
||||
{
|
||||
uint8 r = rand()%4;
|
||||
uint8 r = rand32() % 4;
|
||||
uint8 pos[3];
|
||||
pos[RED_PORTAL] = ((r % 2) ? (r > 1 ? 2 : 1) : 0);
|
||||
pos[GREEN_PORTAL] = ((r % 2) ? 0 : (r > 1 ? 2 : 1));
|
||||
|
||||
@@ -322,7 +322,7 @@ public:
|
||||
|
||||
//cut down to size if we have more than 5 targets
|
||||
while (targets.size() > 5)
|
||||
targets.erase(targets.begin()+rand()%targets.size());
|
||||
targets.erase(targets.begin() + rand32() % targets.size());
|
||||
|
||||
uint32 i = 0;
|
||||
for (std::vector<Unit*>::const_iterator iter = targets.begin(); iter != targets.end(); ++iter, ++i)
|
||||
|
||||
@@ -131,7 +131,7 @@ public:
|
||||
BerserkTimer = 720000;
|
||||
CloseDoorTimer = 15000;
|
||||
|
||||
LastSuperSpell = rand()%3;
|
||||
LastSuperSpell = rand32() % 3;
|
||||
|
||||
FlameWreathTimer = 0;
|
||||
FlameWreathCheckTime = 0;
|
||||
@@ -192,7 +192,7 @@ public:
|
||||
|
||||
//cut down to size if we have more than 3 targets
|
||||
while (targets.size() > 3)
|
||||
targets.erase(targets.begin()+rand()%targets.size());
|
||||
targets.erase(targets.begin() + rand32() % targets.size());
|
||||
|
||||
uint32 i = 0;
|
||||
for (std::vector<Unit*>::const_iterator itr = targets.begin(); itr!= targets.end(); ++itr)
|
||||
@@ -322,7 +322,7 @@ public:
|
||||
//If no available spells wait 1 second and try again
|
||||
if (AvailableSpells)
|
||||
{
|
||||
CurrentNormalSpell = Spells[rand() % AvailableSpells];
|
||||
CurrentNormalSpell = Spells[rand32() % AvailableSpells];
|
||||
DoCast(target, CurrentNormalSpell);
|
||||
}
|
||||
}
|
||||
@@ -514,7 +514,7 @@ public:
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
CastTimer = 2000 + (rand()%3000);
|
||||
CastTimer = 2000 + (rand32() % 3000);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) override { }
|
||||
|
||||
@@ -350,7 +350,7 @@ public:
|
||||
|
||||
void SpellHit(Unit* /*caster*/, const SpellInfo* Spell) override
|
||||
{
|
||||
if ((Spell->SchoolMask == SPELL_SCHOOL_MASK_FIRE) && (!(rand()%10)))
|
||||
if ((Spell->SchoolMask == SPELL_SCHOOL_MASK_FIRE) && (!(rand32() % 10)))
|
||||
{
|
||||
/*
|
||||
if (not direct damage(aoe, dot))
|
||||
|
||||
@@ -195,7 +195,7 @@ public:
|
||||
|
||||
//remove random entries
|
||||
while (LackeyEntryList.size() > MAX_ACTIVE_LACKEY)
|
||||
LackeyEntryList.erase(LackeyEntryList.begin() + rand()%LackeyEntryList.size());
|
||||
LackeyEntryList.erase(LackeyEntryList.begin() + rand32() % LackeyEntryList.size());
|
||||
|
||||
//summon all the remaining in vector
|
||||
for (std::vector<uint32>::const_iterator itr = LackeyEntryList.begin(); itr != LackeyEntryList.end(); ++itr)
|
||||
@@ -287,7 +287,7 @@ public:
|
||||
Unit* target = me;
|
||||
|
||||
if (urand(0, 1))
|
||||
if (Unit* pAdd = ObjectAccessor::GetUnit(*me, m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY]))
|
||||
if (Unit* pAdd = ObjectAccessor::GetUnit(*me, m_auiLackeyGUID[rand32() % MAX_ACTIVE_LACKEY]))
|
||||
if (pAdd->IsAlive())
|
||||
target = pAdd;
|
||||
|
||||
@@ -300,7 +300,7 @@ public:
|
||||
Unit* target = me;
|
||||
|
||||
if (urand(0, 1))
|
||||
if (Unit* pAdd = ObjectAccessor::GetUnit(*me, m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY]))
|
||||
if (Unit* pAdd = ObjectAccessor::GetUnit(*me, m_auiLackeyGUID[rand32() % MAX_ACTIVE_LACKEY]))
|
||||
if (pAdd->IsAlive() && !pAdd->HasAura(SPELL_SHIELD))
|
||||
target = pAdd;
|
||||
|
||||
@@ -319,7 +319,7 @@ public:
|
||||
if (urand(0, 1))
|
||||
target = me;
|
||||
else
|
||||
if (Unit* pAdd = ObjectAccessor::GetUnit(*me, m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY]))
|
||||
if (Unit* pAdd = ObjectAccessor::GetUnit(*me, m_auiLackeyGUID[rand32() % MAX_ACTIVE_LACKEY]))
|
||||
if (pAdd->IsAlive())
|
||||
target = pAdd;
|
||||
}
|
||||
@@ -1167,17 +1167,8 @@ public:
|
||||
|
||||
if (Healing_Wave_Timer <= diff)
|
||||
{
|
||||
// std::vector<Add*>::const_iterator itr = Group.begin() + rand()%Group.size();
|
||||
// uint64 guid = (*itr)->guid;
|
||||
// if (guid)
|
||||
// {
|
||||
// Unit* pAdd = ObjectAccessor::GetUnit(*me, (*itr)->guid);
|
||||
// if (pAdd && pAdd->IsAlive())
|
||||
// {
|
||||
DoCast(me, SPELL_LESSER_HEALING_WAVE);
|
||||
Healing_Wave_Timer = 5000;
|
||||
// }
|
||||
// }
|
||||
} else Healing_Wave_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
|
||||
@@ -514,7 +514,7 @@ public:
|
||||
|
||||
void Shout()
|
||||
{
|
||||
if (rand()%100 < 15)
|
||||
if (rand32() % 100 < 15)
|
||||
Talk(SAY_VALROTH_RAND);
|
||||
}
|
||||
|
||||
|
||||
@@ -669,7 +669,7 @@ public:
|
||||
uiPhase_timer = 500;
|
||||
if (uiSummon_counter < ENCOUNTER_GHOUL_NUMBER)
|
||||
{
|
||||
Unit* temp = me->SummonCreature(NPC_ACHERUS_GHOUL, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
|
||||
Unit* temp = me->SummonCreature(NPC_ACHERUS_GHOUL, (me->GetPositionX() - 20) + rand32() % 40, (me->GetPositionY() - 20) + rand32() % 40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
|
||||
temp->SetWalk(false);
|
||||
temp->setFaction(2084);
|
||||
uiGhoulGUID[uiSummon_counter] = temp->GetGUID();
|
||||
@@ -687,7 +687,7 @@ public:
|
||||
uiPhase_timer = 500;
|
||||
if (uiSummon_counter < ENCOUNTER_ABOMINATION_NUMBER)
|
||||
{
|
||||
Unit* temp = me->SummonCreature(NPC_RAMPAGING_ABOMINATION, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
|
||||
Unit* temp = me->SummonCreature(NPC_RAMPAGING_ABOMINATION, (me->GetPositionX() - 20) + rand32() % 40, (me->GetPositionY() - 20) + rand32() % 40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
|
||||
temp->SetWalk(false);
|
||||
temp->setFaction(2084);
|
||||
uiAbominationGUID[uiSummon_counter] = temp->GetGUID();
|
||||
@@ -705,7 +705,7 @@ public:
|
||||
uiPhase_timer = 500;
|
||||
if (uiSummon_counter < ENCOUNTER_WARRIOR_NUMBER)
|
||||
{
|
||||
Unit* temp = me->SummonCreature(NPC_WARRIOR_OF_THE_FROZEN_WASTES, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
|
||||
Unit* temp = me->SummonCreature(NPC_WARRIOR_OF_THE_FROZEN_WASTES, (me->GetPositionX() - 20) + rand32() % 40, (me->GetPositionY() - 20) + rand32() % 40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
|
||||
temp->SetWalk(false);
|
||||
temp->setFaction(2084);
|
||||
uiWarriorGUID[uiSummon_counter] = temp->GetGUID();
|
||||
@@ -723,7 +723,7 @@ public:
|
||||
uiPhase_timer = 500;
|
||||
if (uiSummon_counter < ENCOUNTER_BEHEMOTH_NUMBER)
|
||||
{
|
||||
Unit* temp = me->SummonCreature(NPC_FLESH_BEHEMOTH, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
|
||||
Unit* temp = me->SummonCreature(NPC_FLESH_BEHEMOTH, (me->GetPositionX() - 20) + rand32() % 40, (me->GetPositionY() - 20) + rand32() % 40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
|
||||
temp->SetWalk(false);
|
||||
temp->setFaction(2084);
|
||||
uiBehemothGUID[uiSummon_counter] = temp->GetGUID();
|
||||
@@ -746,30 +746,30 @@ public:
|
||||
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiKoltiraGUID))
|
||||
{
|
||||
temp->SetWalk(false);
|
||||
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z);
|
||||
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x + rand32() % 30, LightofDawnLoc[0].y + rand32() % 30, LightofDawnLoc[0].z);
|
||||
}
|
||||
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiOrbazGUID))
|
||||
{
|
||||
temp->SetWalk(false);
|
||||
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z);
|
||||
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x + rand32() % 30, LightofDawnLoc[0].y + rand32() % 30, LightofDawnLoc[0].z);
|
||||
}
|
||||
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiThassarianGUID))
|
||||
{
|
||||
temp->SetWalk(false);
|
||||
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z);
|
||||
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x + rand32() % 30, LightofDawnLoc[0].y + rand32() % 30, LightofDawnLoc[0].z);
|
||||
}
|
||||
for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i)
|
||||
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiAbominationGUID[i]))
|
||||
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z);
|
||||
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x + rand32() % 30, LightofDawnLoc[0].y + rand32() % 30, LightofDawnLoc[0].z);
|
||||
for (uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i)
|
||||
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiBehemothGUID[i]))
|
||||
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z);
|
||||
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x + rand32() % 30, LightofDawnLoc[0].y + rand32() % 30, LightofDawnLoc[0].z);
|
||||
for (uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i)
|
||||
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiGhoulGUID[i]))
|
||||
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z);
|
||||
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x + rand32() % 30, LightofDawnLoc[0].y + rand32() % 30, LightofDawnLoc[0].z);
|
||||
for (uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i)
|
||||
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiWarriorGUID[i]))
|
||||
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z);
|
||||
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x + rand32() % 30, LightofDawnLoc[0].y + rand32() % 30, LightofDawnLoc[0].z);
|
||||
JumpToNextStep(5000);
|
||||
break;
|
||||
|
||||
@@ -1016,7 +1016,7 @@ public:
|
||||
|
||||
if (fLichPositionX && fLichPositionY)
|
||||
{
|
||||
Unit* temp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
|
||||
Unit* temp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].x + rand32() % 10, LightofDawnLoc[0].y + rand32() % 10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
|
||||
temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED);
|
||||
temp->SetWalk(false);
|
||||
temp->SetSpeed(MOVE_RUN, 2.0f);
|
||||
@@ -1024,7 +1024,7 @@ public:
|
||||
temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ);
|
||||
uiDefenderGUID[0] = temp->GetGUID();
|
||||
|
||||
temp = me->SummonCreature(NPC_RIMBLAT_EARTHSHATTER, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
|
||||
temp = me->SummonCreature(NPC_RIMBLAT_EARTHSHATTER, LightofDawnLoc[0].x + rand32() % 10, LightofDawnLoc[0].y + rand32() % 10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
|
||||
temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED);
|
||||
temp->SetWalk(false);
|
||||
temp->SetSpeed(MOVE_RUN, 2.0f);
|
||||
@@ -1088,13 +1088,13 @@ public:
|
||||
{
|
||||
temp->SetSpeed(MOVE_RUN, 6.0f);
|
||||
temp->SetStandState(UNIT_STAND_STATE_DEAD);
|
||||
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z);
|
||||
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x + rand32() % 10, LightofDawnLoc[0].y + rand32() % 10, LightofDawnLoc[0].z);
|
||||
}
|
||||
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiEarthshatterGUID[0]))
|
||||
{
|
||||
temp->SetSpeed(MOVE_RUN, 6.0f);
|
||||
temp->SetStandState(UNIT_STAND_STATE_DEAD);
|
||||
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z);
|
||||
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x + rand32() % 10, LightofDawnLoc[0].y + rand32() % 10, LightofDawnLoc[0].z);
|
||||
}
|
||||
JumpToNextStep(3000);
|
||||
break;
|
||||
@@ -1556,7 +1556,7 @@ public:
|
||||
temp = ObjectAccessor::GetCreature(*me, uiGhoulGUID[i]);
|
||||
if (!temp)
|
||||
{
|
||||
temp = me->SummonCreature(NPC_ACHERUS_GHOUL, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
|
||||
temp = me->SummonCreature(NPC_ACHERUS_GHOUL, LightofDawnLoc[0].x + rand32() % 30, LightofDawnLoc[0].y + rand32() % 30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
|
||||
temp->setFaction(2084);
|
||||
uiGhoulGUID[i] = temp->GetGUID();
|
||||
}
|
||||
@@ -1566,7 +1566,7 @@ public:
|
||||
temp = ObjectAccessor::GetCreature(*me, uiAbominationGUID[i]);
|
||||
if (!temp)
|
||||
{
|
||||
temp = me->SummonCreature(NPC_WARRIOR_OF_THE_FROZEN_WASTES, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
|
||||
temp = me->SummonCreature(NPC_WARRIOR_OF_THE_FROZEN_WASTES, LightofDawnLoc[0].x + rand32() % 30, LightofDawnLoc[0].y + rand32() % 30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
|
||||
temp->setFaction(2084);
|
||||
uiAbominationGUID[i] = temp->GetGUID();
|
||||
}
|
||||
@@ -1576,7 +1576,7 @@ public:
|
||||
temp = ObjectAccessor::GetCreature(*me, uiWarriorGUID[i]);
|
||||
if (!temp)
|
||||
{
|
||||
temp = me->SummonCreature(NPC_RAMPAGING_ABOMINATION, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
|
||||
temp = me->SummonCreature(NPC_RAMPAGING_ABOMINATION, LightofDawnLoc[0].x + rand32() % 30, LightofDawnLoc[0].y + rand32() % 30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
|
||||
temp->setFaction(2084);
|
||||
uiWarriorGUID[i] = temp->GetGUID();
|
||||
}
|
||||
@@ -1586,7 +1586,7 @@ public:
|
||||
temp = ObjectAccessor::GetCreature(*me, uiBehemothGUID[i]);
|
||||
if (!temp)
|
||||
{
|
||||
temp = me->SummonCreature(NPC_FLESH_BEHEMOTH, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
|
||||
temp = me->SummonCreature(NPC_FLESH_BEHEMOTH, LightofDawnLoc[0].x + rand32() % 30, LightofDawnLoc[0].y + rand32() % 30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
|
||||
temp->setFaction(2084);
|
||||
uiBehemothGUID[i] = temp->GetGUID();
|
||||
}
|
||||
@@ -1598,7 +1598,7 @@ public:
|
||||
temp = ObjectAccessor::GetCreature(*me, uiDefenderGUID[i]);
|
||||
if (!temp)
|
||||
{
|
||||
temp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
|
||||
temp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].x + rand32() % 30, LightofDawnLoc[0].y + rand32() % 30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
|
||||
temp->setFaction(2089);
|
||||
me->AddThreat(temp, 0.0f);
|
||||
uiDefenderGUID[i] = temp->GetGUID();
|
||||
@@ -1609,7 +1609,7 @@ public:
|
||||
temp = ObjectAccessor::GetCreature(*me, uiEarthshatterGUID[i]);
|
||||
if (!temp)
|
||||
{
|
||||
temp = me->SummonCreature(NPC_RIMBLAT_EARTHSHATTER, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
|
||||
temp = me->SummonCreature(NPC_RIMBLAT_EARTHSHATTER, LightofDawnLoc[0].x + rand32() % 30, LightofDawnLoc[0].y + rand32() % 30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
|
||||
temp->setFaction(2089);
|
||||
me->AddThreat(temp, 0.0f);
|
||||
uiEarthshatterGUID[i] = temp->GetGUID();
|
||||
@@ -1618,7 +1618,7 @@ public:
|
||||
temp = ObjectAccessor::GetCreature(*me, uiKorfaxGUID);
|
||||
if (!temp)
|
||||
{
|
||||
temp = me->SummonCreature(NPC_KORFAX_CHAMPION_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000);
|
||||
temp = me->SummonCreature(NPC_KORFAX_CHAMPION_OF_THE_LIGHT, LightofDawnLoc[0].x + rand32() % 30, LightofDawnLoc[0].y + rand32() % 30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000);
|
||||
temp->setFaction(2089);
|
||||
me->AddThreat(temp, 0.0f);
|
||||
uiKorfaxGUID = temp->GetGUID();
|
||||
@@ -1626,7 +1626,7 @@ public:
|
||||
temp = ObjectAccessor::GetCreature(*me, uiMaxwellGUID);
|
||||
if (!temp)
|
||||
{
|
||||
temp = me->SummonCreature(NPC_LORD_MAXWELL_TYROSUS, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000);
|
||||
temp = me->SummonCreature(NPC_LORD_MAXWELL_TYROSUS, LightofDawnLoc[0].x + rand32() % 30, LightofDawnLoc[0].y + rand32() % 30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000);
|
||||
temp->setFaction(2089);
|
||||
me->AddThreat(temp, 0.0f);
|
||||
uiMaxwellGUID = temp->GetGUID();
|
||||
@@ -1634,7 +1634,7 @@ public:
|
||||
temp = ObjectAccessor::GetCreature(*me, uiEligorGUID);
|
||||
if (!temp)
|
||||
{
|
||||
temp = me->SummonCreature(NPC_COMMANDER_ELIGOR_DAWNBRINGER, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000);
|
||||
temp = me->SummonCreature(NPC_COMMANDER_ELIGOR_DAWNBRINGER, LightofDawnLoc[0].x + rand32() % 30, LightofDawnLoc[0].y + rand32() % 30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000);
|
||||
temp->setFaction(2089);
|
||||
me->AddThreat(temp, 0.0f);
|
||||
uiEligorGUID = temp->GetGUID();
|
||||
@@ -1642,7 +1642,7 @@ public:
|
||||
temp = ObjectAccessor::GetCreature(*me, uiRayneGUID);
|
||||
if (!temp)
|
||||
{
|
||||
temp = me->SummonCreature(NPC_RAYNE, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
|
||||
temp = me->SummonCreature(NPC_RAYNE, LightofDawnLoc[0].x + rand32() % 30, LightofDawnLoc[0].y + rand32() % 30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
|
||||
temp->setFaction(2089);
|
||||
me->AddThreat(temp, 0.0f);
|
||||
uiRayneGUID = temp->GetGUID();
|
||||
|
||||
@@ -546,7 +546,7 @@ public:
|
||||
if (!temp.empty())
|
||||
{
|
||||
std::list<Player*>::const_iterator j = temp.begin();
|
||||
advance(j, rand()%temp.size());
|
||||
advance(j, rand32() % temp.size());
|
||||
return (*j);
|
||||
}
|
||||
return NULL;
|
||||
@@ -619,7 +619,7 @@ public:
|
||||
me->SetName("Headless Horseman, Unhorsed");
|
||||
|
||||
if (!headGUID)
|
||||
headGUID = DoSpawnCreature(HEAD, float(rand()%6), float(rand()%6), 0, 0, TEMPSUMMON_DEAD_DESPAWN, 0)->GetGUID();
|
||||
headGUID = DoSpawnCreature(HEAD, float(rand32() % 6), float(rand32() % 6), 0, 0, TEMPSUMMON_DEAD_DESPAWN, 0)->GetGUID();
|
||||
|
||||
Unit* Head = ObjectAccessor::GetUnit(*me, headGUID);
|
||||
if (Head && Head->IsAlive())
|
||||
@@ -720,7 +720,7 @@ public:
|
||||
{
|
||||
laugh = urand(11000, 22000);
|
||||
me->MonsterTextEmote(EMOTE_LAUGHS, NULL);
|
||||
DoPlaySoundToSet(me, RandomLaugh[rand()%3]);
|
||||
DoPlaySoundToSet(me, RandomLaugh[rand32() % 3]);
|
||||
}
|
||||
else laugh -= diff;
|
||||
|
||||
|
||||
@@ -134,14 +134,14 @@ public:
|
||||
{
|
||||
DoCastVictim(SPELL_CLEAVE);
|
||||
//13 seconds until we should cast this again
|
||||
Cleave_Timer = 7000 + (rand()%10000);
|
||||
Cleave_Timer = 7000 + (rand32() % 10000);
|
||||
} else Cleave_Timer -= diff;
|
||||
|
||||
//MortalStrike
|
||||
if (MortalStrike_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_MORTALSTRIKE);
|
||||
MortalStrike_Timer = 10000 + (rand()%15000);
|
||||
MortalStrike_Timer = 10000 + (rand32() % 15000);
|
||||
} else MortalStrike_Timer -= diff;
|
||||
|
||||
//RaiseDead
|
||||
|
||||
@@ -84,7 +84,7 @@ public:
|
||||
//BansheeWail
|
||||
if (BansheeWail_Timer <= diff)
|
||||
{
|
||||
if (rand()%100 < 95)
|
||||
if (rand32() % 100 < 95)
|
||||
DoCastVictim(SPELL_BANSHEEWAIL);
|
||||
//4 seconds until we should cast this again
|
||||
BansheeWail_Timer = 4000;
|
||||
@@ -93,7 +93,7 @@ public:
|
||||
//BansheeCurse
|
||||
if (BansheeCurse_Timer <= diff)
|
||||
{
|
||||
if (rand()%100 < 75)
|
||||
if (rand32() % 100 < 75)
|
||||
DoCastVictim(SPELL_BANSHEECURSE);
|
||||
//18 seconds until we should cast this again
|
||||
BansheeCurse_Timer = 18000;
|
||||
@@ -102,27 +102,12 @@ public:
|
||||
//Silence
|
||||
if (Silence_Timer <= diff)
|
||||
{
|
||||
if (rand()%100 < 80)
|
||||
if (rand32() % 100 < 80)
|
||||
DoCastVictim(SPELL_SILENCE);
|
||||
//13 seconds until we should cast this again
|
||||
Silence_Timer = 13000;
|
||||
} else Silence_Timer -= diff;
|
||||
|
||||
//Possess
|
||||
/* if (Possess_Timer <= diff)
|
||||
{
|
||||
//Cast
|
||||
if (rand()%100 < 65)
|
||||
{
|
||||
Unit* target = NULL;
|
||||
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
|
||||
if (target)DoCast(target, SPELL_POSSESS);
|
||||
}
|
||||
//50 seconds until we should cast this again
|
||||
Possess_Timer = 50000;
|
||||
} else Possess_Timer -= diff;
|
||||
*/
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -132,7 +132,7 @@ public:
|
||||
if (Pummel_Timer <= diff)
|
||||
{
|
||||
//Cast
|
||||
if (rand()%100 < 90) //90% chance to cast
|
||||
if (rand32() % 100 < 90) //90% chance to cast
|
||||
{
|
||||
DoCastVictim(SPELL_PUMMEL);
|
||||
}
|
||||
@@ -144,7 +144,7 @@ public:
|
||||
if (KnockAway_Timer <= diff)
|
||||
{
|
||||
//Cast
|
||||
if (rand()%100 < 80) //80% chance to cast
|
||||
if (rand32() % 100 < 80) //80% chance to cast
|
||||
{
|
||||
DoCastVictim(SPELL_KNOCKAWAY);
|
||||
}
|
||||
@@ -165,7 +165,7 @@ public:
|
||||
if (SummonRifleman_Timer <= diff)
|
||||
{
|
||||
//Cast
|
||||
switch (rand()%9)
|
||||
switch (rand32() % 9)
|
||||
{
|
||||
case 0:
|
||||
me->SummonCreature(11054, ADD_1X, ADD_1Y, ADD_1Z, ADD_1O, TEMPSUMMON_TIMED_DESPAWN, 240000);
|
||||
|
||||
@@ -84,7 +84,7 @@ public:
|
||||
//Frostbolt
|
||||
if (Frostbolt_Timer <= diff)
|
||||
{
|
||||
if (rand()%100 < 90)
|
||||
if (rand32() % 100 < 90)
|
||||
DoCastVictim(SPELL_FROSTBOLT);
|
||||
Frostbolt_Timer = 3500;
|
||||
} else Frostbolt_Timer -= diff;
|
||||
@@ -92,7 +92,7 @@ public:
|
||||
//IceTomb
|
||||
if (IceTomb_Timer <= diff)
|
||||
{
|
||||
if (rand()%100 < 65)
|
||||
if (rand32() % 100 < 65)
|
||||
DoCastVictim(SPELL_ICETOMB);
|
||||
IceTomb_Timer = 28000;
|
||||
} else IceTomb_Timer -= diff;
|
||||
@@ -100,7 +100,7 @@ public:
|
||||
//DrainLife
|
||||
if (DrainLife_Timer <= diff)
|
||||
{
|
||||
if (rand()%100 < 55)
|
||||
if (rand32() % 100 < 55)
|
||||
DoCastVictim(SPELL_DRAINLIFE);
|
||||
DrainLife_Timer = 31000;
|
||||
} else DrainLife_Timer -= diff;
|
||||
|
||||
@@ -92,27 +92,27 @@ class boss_postmaster_malown : public CreatureScript
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_WAILINGDEAD:
|
||||
if (rand()%100 < 65) //65% chance to cast
|
||||
if (rand32() % 100 < 65) //65% chance to cast
|
||||
DoCastVictim(SPELL_WAILINGDEAD, true);
|
||||
events.ScheduleEvent(EVENT_WAILINGDEAD, 19000);
|
||||
break;
|
||||
case EVENT_BACKHAND:
|
||||
if (rand()%100 < 45) //45% chance to cast
|
||||
if (rand32() % 100 < 45) //45% chance to cast
|
||||
DoCastVictim(SPELL_BACKHAND, true);
|
||||
events.ScheduleEvent(EVENT_WAILINGDEAD, 8000);
|
||||
break;
|
||||
case EVENT_CURSEOFWEAKNESS:
|
||||
if (rand()%100 < 3) //3% chance to cast
|
||||
if (rand32() % 100 < 3) //3% chance to cast
|
||||
DoCastVictim(SPELL_CURSEOFWEAKNESS, true);
|
||||
events.ScheduleEvent(EVENT_WAILINGDEAD, 20000);
|
||||
break;
|
||||
case EVENT_CURSEOFTONGUES:
|
||||
if (rand()%100 < 3) //3% chance to cast
|
||||
if (rand32() % 100 < 3) //3% chance to cast
|
||||
DoCastVictim(SPELL_CURSEOFTONGUES, true);
|
||||
events.ScheduleEvent(EVENT_WAILINGDEAD, 22000);
|
||||
break;
|
||||
case EVENT_CALLOFTHEGRAVE:
|
||||
if (rand()%100 < 5) //5% chance to cast
|
||||
if (rand32() % 100 < 5) //5% chance to cast
|
||||
DoCastVictim(SPELL_CALLOFTHEGRAVE, true);
|
||||
events.ScheduleEvent(EVENT_WAILINGDEAD, 25000);
|
||||
break;
|
||||
|
||||
@@ -136,7 +136,7 @@ public:
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) override
|
||||
{
|
||||
if (rand()%4 == 0)
|
||||
if (rand32() % 4 == 0)
|
||||
Talk(YELL_SAC_KILL);
|
||||
}
|
||||
|
||||
@@ -222,7 +222,7 @@ public:
|
||||
me->InterruptSpell(CURRENT_GENERIC_SPELL);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_CONFLAGRATION);
|
||||
ConflagrationTimer = 30000+(rand()%5000);
|
||||
ConflagrationTimer = 30000 + (rand32() % 5000);
|
||||
}
|
||||
} else ConflagrationTimer -= diff;
|
||||
}
|
||||
@@ -242,7 +242,7 @@ public:
|
||||
Talk(EMOTE_SHADOW_NOVA, target);
|
||||
Talk(YELL_SHADOW_NOVA);
|
||||
}
|
||||
ShadownovaTimer = 30000+(rand()%5000);
|
||||
ShadownovaTimer = 30000 + (rand32() % 5000);
|
||||
}
|
||||
} else ShadownovaTimer -=diff;
|
||||
}
|
||||
@@ -253,7 +253,7 @@ public:
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_CONFOUNDING_BLOW);
|
||||
ConfoundingblowTimer = 20000 + (rand()%5000);
|
||||
ConfoundingblowTimer = 20000 + (rand32() % 5000);
|
||||
}
|
||||
} else ConfoundingblowTimer -=diff;
|
||||
|
||||
@@ -407,7 +407,7 @@ public:
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) override
|
||||
{
|
||||
if (rand()%4 == 0)
|
||||
if (rand32() % 4 == 0)
|
||||
Talk(YELL_ALY_KILL);
|
||||
}
|
||||
|
||||
@@ -552,7 +552,7 @@ public:
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_SHADOW_NOVA);
|
||||
ShadownovaTimer= 30000+(rand()%5000);
|
||||
ShadownovaTimer = 30000 + (rand32() % 5000);
|
||||
}
|
||||
} else ShadownovaTimer -=diff;
|
||||
}
|
||||
@@ -566,7 +566,7 @@ public:
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (target)
|
||||
DoCast(target, SPELL_CONFLAGRATION);
|
||||
ConflagrationTimer = 30000+(rand()%5000);
|
||||
ConflagrationTimer = 30000 + (rand32() % 5000);
|
||||
|
||||
if (!SisterDeath)
|
||||
{
|
||||
@@ -644,7 +644,7 @@ public:
|
||||
void Reset() override
|
||||
{
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
ShadowfuryTimer = 5000 + (rand()%15000);
|
||||
ShadowfuryTimer = 5000 + (rand32() % 15000);
|
||||
DarkstrikeTimer = 3000;
|
||||
KillTimer = 15000;
|
||||
}
|
||||
|
||||
@@ -288,7 +288,7 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
if (Creature* Vapor = me->SummonCreature(NPC_VAPOR, target->GetPositionX()-5+rand()%10, target->GetPositionY()-5+rand()%10, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 9000))
|
||||
if (Creature* Vapor = me->SummonCreature(NPC_VAPOR, target->GetPositionX() - 5 + rand32() % 10, target->GetPositionY() - 5 + rand32() % 10, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 9000))
|
||||
{
|
||||
Vapor->AI()->AttackStart(target);
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
@@ -315,7 +315,7 @@ public:
|
||||
}
|
||||
|
||||
//target->CastSpell(target, SPELL_VAPOR_SUMMON, true); need core support
|
||||
if (Creature* pVapor = me->SummonCreature(NPC_VAPOR, target->GetPositionX()-5+rand()%10, target->GetPositionY()-5+rand()%10, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 9000))
|
||||
if (Creature* pVapor = me->SummonCreature(NPC_VAPOR, target->GetPositionX() - 5 + rand32() % 10, target->GetPositionY() - 5 + rand32() % 10, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 9000))
|
||||
{
|
||||
if (pVapor->AI())
|
||||
pVapor->AI()->AttackStart(target);
|
||||
|
||||
@@ -285,7 +285,7 @@ public:
|
||||
|
||||
if (WildMagicTimer <= diff)
|
||||
{
|
||||
DoCastAOE(WildMagic[rand()%6]);
|
||||
DoCastAOE(WildMagic[rand32() % 6]);
|
||||
WildMagicTimer = 20000;
|
||||
} else WildMagicTimer -= diff;
|
||||
|
||||
@@ -312,11 +312,11 @@ public:
|
||||
}
|
||||
|
||||
std::list<Unit*>::const_iterator i = targetList.begin();
|
||||
advance(i, rand()%targetList.size());
|
||||
advance(i, rand32() % targetList.size());
|
||||
if ((*i))
|
||||
{
|
||||
(*i)->CastSpell((*i), SPELL_SPECTRAL_BLAST, true);
|
||||
SpectralBlastTimer = 20000+rand()%5000;
|
||||
SpectralBlastTimer = 20000 + rand32() % 5000;
|
||||
} else SpectralBlastTimer = 1000;
|
||||
} else SpectralBlastTimer -= diff;
|
||||
|
||||
@@ -775,10 +775,10 @@ public:
|
||||
|
||||
if (ShadowBoltTimer <= diff)
|
||||
{
|
||||
if (!(rand()%5))
|
||||
if (!(rand32() % 5))
|
||||
Talk(SAY_SATH_SPELL1);
|
||||
DoCast(me, SPELL_SHADOW_BOLT);
|
||||
ShadowBoltTimer = 7000+(rand()%3000);
|
||||
ShadowBoltTimer = 7000 + (rand32() % 3000);
|
||||
} else ShadowBoltTimer -= diff;
|
||||
|
||||
if (AgonyCurseTimer <= diff)
|
||||
@@ -792,7 +792,7 @@ public:
|
||||
|
||||
if (CorruptionStrikeTimer <= diff)
|
||||
{
|
||||
if (!(rand()%5))Talk(SAY_SATH_SPELL2);
|
||||
if (!(rand32() % 5))Talk(SAY_SATH_SPELL2);
|
||||
DoCastVictim(SPELL_CORRUPTION_STRIKE);
|
||||
CorruptionStrikeTimer = 13000;
|
||||
} else CorruptionStrikeTimer -= diff;
|
||||
|
||||
@@ -539,7 +539,7 @@ public:
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
me->SummonCreature(NPC_VOID_SPAWN, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), float(rand()%6), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 180000);
|
||||
me->SummonCreature(NPC_VOID_SPAWN, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), float(rand32() % 6), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 180000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
|
||||
@@ -285,9 +285,9 @@ public:
|
||||
|
||||
if (WaveTimer < diff && !Completed && Progress)
|
||||
{
|
||||
uint32 ran1 = rand()%8;
|
||||
uint32 ran2 = rand()%8;
|
||||
uint32 ran3 = rand()%8;
|
||||
uint32 ran1 = rand32() % 8;
|
||||
uint32 ran2 = rand32() % 8;
|
||||
uint32 ran3 = rand32() % 8;
|
||||
me->SummonCreature(NPC_ENRAGED_WRAITH, SpawnLocations[ran1].x, SpawnLocations[ran1].y, SpawnLocations[ran1].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
|
||||
me->SummonCreature(NPC_ENRAGED_WRAITH, SpawnLocations[ran2].x, SpawnLocations[ran2].y, SpawnLocations[ran2].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
|
||||
me->SummonCreature(NPC_ENRAGED_WRAITH, SpawnLocations[ran3].x, SpawnLocations[ran3].y, SpawnLocations[ran3].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
|
||||
|
||||
@@ -170,7 +170,7 @@ public:
|
||||
DoCast(me, SPELL_FADE);
|
||||
// add a blink to simulate a stealthed movement and reappearing elsewhere
|
||||
DoCast(me, SPELL_FADE_BLINK);
|
||||
FadeTimer = 30000 + rand()%5000;
|
||||
FadeTimer = 30000 + rand32() % 5000;
|
||||
// if the victim is out of melee range she cast multi shot
|
||||
if (Unit* victim = me->GetVictim())
|
||||
if (me->GetDistance(victim) > 10.0f)
|
||||
@@ -180,7 +180,7 @@ public:
|
||||
if (SummonSkeletonTimer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_SUMMON_SKELETON);
|
||||
SummonSkeletonTimer = 20000 + rand()%10000;
|
||||
SummonSkeletonTimer = 20000 + rand32() % 10000;
|
||||
} else SummonSkeletonTimer -= diff;
|
||||
|
||||
if (BlackArrowTimer <= diff)
|
||||
@@ -188,7 +188,7 @@ public:
|
||||
if (Unit* victim = me->GetVictim())
|
||||
{
|
||||
DoCast(victim, SPELL_BLACK_ARROW);
|
||||
BlackArrowTimer = 15000 + rand()%5000;
|
||||
BlackArrowTimer = 15000 + rand32() % 5000;
|
||||
}
|
||||
} else BlackArrowTimer -= diff;
|
||||
|
||||
@@ -197,7 +197,7 @@ public:
|
||||
if (Unit* victim = me->GetVictim())
|
||||
{
|
||||
DoCast(victim, SPELL_SHOT);
|
||||
ShotTimer = 8000 + rand()%2000;
|
||||
ShotTimer = 8000 + rand32() % 2000;
|
||||
}
|
||||
} else ShotTimer -= diff;
|
||||
|
||||
@@ -206,7 +206,7 @@ public:
|
||||
if (Unit* victim = me->GetVictim())
|
||||
{
|
||||
DoCast(victim, SPELL_MULTI_SHOT);
|
||||
MultiShotTimer = 10000 + rand()%3000;
|
||||
MultiShotTimer = 10000 + rand32() % 3000;
|
||||
}
|
||||
} else MultiShotTimer -= diff;
|
||||
|
||||
|
||||
@@ -199,7 +199,7 @@ class example_creature : public CreatureScript
|
||||
if (m_uiSpell1Timer <= uiDiff)
|
||||
{
|
||||
//Cast spell one on our current target.
|
||||
if (rand()%50 > 10)
|
||||
if (rand32() % 50 > 10)
|
||||
DoCastVictim(SPELL_ONE_ALT);
|
||||
else if (me->IsWithinDist(me->GetVictim(), 25.0f))
|
||||
DoCastVictim(SPELL_ONE);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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)
|
||||
|
||||
+4
-4
@@ -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();
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
+2
-2
@@ -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)
|
||||
|
||||
+3
-3
@@ -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();
|
||||
|
||||
+1
-1
@@ -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]=
|
||||
{
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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])
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -156,7 +156,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
|
||||
|
||||
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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());
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -75,7 +75,7 @@ public:
|
||||
|
||||
void KilledUnit(Unit* /*Victim*/) override
|
||||
{
|
||||
if (!(rand()%5))
|
||||
if (!(rand32() % 5))
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) override
|
||||
{
|
||||
if (!(rand()%3))
|
||||
if (!(rand32() % 3))
|
||||
DoPlaySoundToSet(me, SOUND_SLAY);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -245,7 +245,7 @@ public:
|
||||
|
||||
DoRemoveStanceAura(m_uiStance);
|
||||
|
||||
int uiTempStance = rand()%(3-1);
|
||||
int uiTempStance = rand32() % (3 - 1);
|
||||
|
||||
if (uiTempStance >= m_uiStance)
|
||||
++uiTempStance;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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))
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -433,7 +433,7 @@ public:
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
uint32 roll = rand() % 2;
|
||||
uint32 roll = rand32() % 2;
|
||||
|
||||
Creature* tree = GetHitCreature();
|
||||
Player* player = GetCaster()->ToPlayer();
|
||||
|
||||
@@ -190,9 +190,9 @@ public:
|
||||
soulholder = 0;
|
||||
soulclass = 0;
|
||||
|
||||
Fear_timer = 15000 + rand()% 5000;
|
||||
Fear_timer = 15000 + rand32() % 5000;
|
||||
Ribbon_of_Souls_timer = 5000;
|
||||
StolenSoul_Timer = 25000 + rand()% 10000;
|
||||
StolenSoul_Timer = 25000 + rand32() % 10000;
|
||||
|
||||
Avatar_summoned = false;
|
||||
}
|
||||
@@ -234,7 +234,7 @@ public:
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) override
|
||||
{
|
||||
if (rand()%2)
|
||||
if (rand32() % 2)
|
||||
return;
|
||||
|
||||
Talk(SAY_SLAY);
|
||||
@@ -261,7 +261,7 @@ public:
|
||||
|
||||
DoCast(me, SPELL_SUMMON_AVATAR);
|
||||
Avatar_summoned = true;
|
||||
StolenSoul_Timer = 15000 + rand()% 15000;
|
||||
StolenSoul_Timer = 15000 + rand32() % 15000;
|
||||
}
|
||||
|
||||
if (StolenSoul_Timer <= diff)
|
||||
@@ -282,7 +282,7 @@ public:
|
||||
DoCast(target, SPELL_STOLEN_SOUL);
|
||||
me->SummonCreature(ENTRY_STOLEN_SOUL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
|
||||
|
||||
StolenSoul_Timer = 20000 + rand()% 10000;
|
||||
StolenSoul_Timer = 20000 + rand32() % 10000;
|
||||
} else StolenSoul_Timer = 1000;
|
||||
}
|
||||
} else StolenSoul_Timer -= diff;
|
||||
@@ -292,13 +292,13 @@ public:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_RIBBON_OF_SOULS);
|
||||
|
||||
Ribbon_of_Souls_timer = 5000 + (rand()%20 * 1000);
|
||||
Ribbon_of_Souls_timer = 5000 + (rand32() % 20 * 1000);
|
||||
} else Ribbon_of_Souls_timer -= diff;
|
||||
|
||||
if (Fear_timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_SOUL_SCREAM);
|
||||
Fear_timer = 15000 + rand()% 15000;
|
||||
Fear_timer = 15000 + rand32() % 15000;
|
||||
} else Fear_timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
|
||||
+3
-3
@@ -118,7 +118,7 @@ public:
|
||||
if (dist < 15)
|
||||
me->AddAura(SPELL_INHIBITMAGIC, i_pl);
|
||||
}
|
||||
Inhibitmagic_Timer = 3000+(rand()%1000);
|
||||
Inhibitmagic_Timer = 3000 + (rand32() % 1000);
|
||||
} else Inhibitmagic_Timer -= diff;
|
||||
|
||||
//Return since we have no target
|
||||
@@ -151,7 +151,7 @@ public:
|
||||
me->SummonCreature(NPC_FOCUS_FIRE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 5500);
|
||||
Talk(EMOTE_FOCUSED, target);
|
||||
}
|
||||
FocusFire_Timer = 15000+(rand()%5000);
|
||||
FocusFire_Timer = 15000 + (rand32() % 5000);
|
||||
} else FocusFire_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
@@ -181,7 +181,7 @@ public:
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
FieryBlast_Timer = 3000+(rand()%1000);
|
||||
FieryBlast_Timer = 3000 + (rand32() % 1000);
|
||||
fiery1 = fiery2 = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
VoidBlast_Timer = 8000+rand()%15000;
|
||||
VoidBlast_Timer = 8000 + rand32() % 15000;
|
||||
DarkShell_Timer = 20000;
|
||||
VoidBlast_Counter = 0;
|
||||
}
|
||||
@@ -97,7 +97,7 @@ public:
|
||||
|
||||
if (VoidBlast_Counter == 5)
|
||||
{
|
||||
VoidBlast_Timer = 15000+rand()%10000;
|
||||
VoidBlast_Timer = 15000 + rand32() % 10000;
|
||||
VoidBlast_Counter = 0;
|
||||
}
|
||||
} else VoidBlast_Timer -= diff;
|
||||
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
ArcaneVolley_Timer = 5000;
|
||||
Sheep_Timer = 8000;
|
||||
Blink_Timer = 35000;
|
||||
Slow_Timer = 15000+rand()%15000;
|
||||
Slow_Timer = 15000 + rand32() % 15000;
|
||||
Blink = false;
|
||||
Intro = false;
|
||||
ManaShield = false;
|
||||
@@ -127,7 +127,7 @@ public:
|
||||
if (ArcaneVolley_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_ARCANE_VOLLEY);
|
||||
ArcaneVolley_Timer = 7000+rand()%5000;
|
||||
ArcaneVolley_Timer = 7000 + rand32() % 5000;
|
||||
} else ArcaneVolley_Timer -= diff;
|
||||
|
||||
if (Sheep_Timer <= diff)
|
||||
@@ -142,7 +142,7 @@ public:
|
||||
|
||||
if (target)
|
||||
DoCast(target, SPELL_POLYMORPH);
|
||||
Sheep_Timer = 15000+rand()%2500;
|
||||
Sheep_Timer = 15000 + rand32() % 2500;
|
||||
} else Sheep_Timer -= diff;
|
||||
|
||||
//may not be correct time to cast
|
||||
@@ -157,7 +157,7 @@ public:
|
||||
if (Slow_Timer <= diff)
|
||||
{
|
||||
DoCast(me, H_SPELL_SLOW);
|
||||
Slow_Timer = 15000+rand()%25000;
|
||||
Slow_Timer = 15000 + rand32() % 25000;
|
||||
} else Slow_Timer -= diff;
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ public:
|
||||
DoCast(target, SPELL_BLINK_TELEPORT);
|
||||
Blink = true;
|
||||
}
|
||||
Blink_Timer = 35000+rand()%5000;
|
||||
Blink_Timer = 35000 + rand32() % 5000;
|
||||
} else Blink_Timer -= diff;
|
||||
|
||||
if (!Blink)
|
||||
|
||||
@@ -637,7 +637,7 @@ public:
|
||||
break;
|
||||
case PHASE_FLIGHT:
|
||||
Timer[EVENT_FIREBALL] = 1000;
|
||||
if (!(rand()%4))
|
||||
if (!(rand32() % 4))
|
||||
Timer[EVENT_DARK_BARRAGE] = 10000;
|
||||
Timer[EVENT_EYE_BLAST] = urand(10, 25) * 1000;
|
||||
Timer[EVENT_MOVE_POINT] = urand(20, 40) * 1000;
|
||||
@@ -993,7 +993,7 @@ public:
|
||||
case EVENT_SHEAR:
|
||||
// no longer exists in 3.0f.2
|
||||
// DoCastVictim(SPELL_SHEAR);
|
||||
Timer[EVENT_SHEAR] = 25000 + (rand()%16 * 1000);
|
||||
Timer[EVENT_SHEAR] = 25000 + (rand32() % 16 * 1000);
|
||||
break;
|
||||
|
||||
case EVENT_FLAME_CRASH:
|
||||
@@ -1062,7 +1062,7 @@ public:
|
||||
case EVENT_MOVE_POINT:
|
||||
Phase = PHASE_FLIGHT_SEQUENCE;
|
||||
Timer[EVENT_FLIGHT_SEQUENCE] = 0; // do not start Event when changing hover point
|
||||
HoverPoint += (rand()%3 + 1);
|
||||
HoverPoint += (rand32() % 3 + 1);
|
||||
if (HoverPoint > 3)
|
||||
HoverPoint -= 4;
|
||||
me->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z);
|
||||
@@ -1254,7 +1254,7 @@ public:
|
||||
|
||||
if (!target || !me->IsWithinDistInMap(target, 80) || illidan->IsWithinDistInMap(target, 20))
|
||||
{
|
||||
uint8 pos = rand()%4;
|
||||
uint8 pos = rand32() % 4;
|
||||
BlinkTo(HoverPosition[pos].x, HoverPosition[pos].y, HoverPosition[pos].z);
|
||||
}
|
||||
else
|
||||
@@ -1720,7 +1720,7 @@ public:
|
||||
{
|
||||
float x, y, z;
|
||||
me->GetPosition(x, y, z);
|
||||
Creature* Elite = me->SummonCreature(ILLIDARI_ELITE, x+rand()%10, y+rand()%10, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000);
|
||||
Creature* Elite = me->SummonCreature(ILLIDARI_ELITE, x + rand32() % 10, y + rand32() % 10, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000);
|
||||
// Creature* Elite = me->SummonCreature(ILLIDARI_ELITE, x, y, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000);
|
||||
if (Elite)
|
||||
{
|
||||
|
||||
@@ -155,7 +155,7 @@ public:
|
||||
|
||||
void TeleportPlayers()
|
||||
{
|
||||
uint32 random = rand()%7;
|
||||
uint32 random = rand32() % 7;
|
||||
float X = TeleportPoint[random].x;
|
||||
float Y = TeleportPoint[random].y;
|
||||
float Z = TeleportPoint[random].z;
|
||||
@@ -211,14 +211,14 @@ public:
|
||||
uint32 Beam = CurrentBeam;
|
||||
if (BeamCount > 3)
|
||||
while (CurrentBeam == Beam)
|
||||
CurrentBeam = rand()%3;
|
||||
CurrentBeam = rand32() % 3;
|
||||
|
||||
} else BeamTimer -= diff;
|
||||
|
||||
// Random Prismatic Shield every 15 seconds.
|
||||
if (PrismaticShieldTimer <= diff)
|
||||
{
|
||||
uint32 random = rand()%6;
|
||||
uint32 random = rand32() % 6;
|
||||
if (PrismaticAuras[random])
|
||||
DoCast(me, PrismaticAuras[random]);
|
||||
PrismaticShieldTimer = 15000;
|
||||
@@ -264,13 +264,13 @@ public:
|
||||
if (ShriekTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_SILENCING_SHRIEK);
|
||||
ShriekTimer = 25000+rand()%10 * 1000;
|
||||
ShriekTimer = 25000 + rand32() % 10 * 1000;
|
||||
} else ShriekTimer -= diff;
|
||||
|
||||
if (SaberTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_SABER_LASH);
|
||||
SaberTimer = 25000+rand()%10 * 1000;
|
||||
SaberTimer = 25000 + rand32() % 10 * 1000;
|
||||
} else SaberTimer -= diff;
|
||||
|
||||
//Enrage
|
||||
|
||||
@@ -205,7 +205,7 @@ public:
|
||||
|
||||
bool SummonSoul()
|
||||
{
|
||||
uint32 random = rand()%6;
|
||||
uint32 random = rand32() % 6;
|
||||
float x = Coords[random].x;
|
||||
float y = Coords[random].y;
|
||||
|
||||
@@ -478,7 +478,7 @@ public:
|
||||
{
|
||||
CastFixate();
|
||||
FixateTimer = 5000;
|
||||
if (!(rand()%16))
|
||||
if (!(rand32() % 16))
|
||||
{
|
||||
Talk(SUFF_SAY_AGGRO);
|
||||
}
|
||||
@@ -599,7 +599,7 @@ public:
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
DoCastVictim(SPELL_DEADEN);
|
||||
DeadenTimer = urand(25000, 35000);
|
||||
if (!(rand()%2))
|
||||
if (!(rand32() % 2))
|
||||
{
|
||||
Talk(DESI_SAY_SPEC);
|
||||
}
|
||||
@@ -692,7 +692,7 @@ public:
|
||||
{
|
||||
DoCastVictim(SPELL_SOUL_SCREAM);
|
||||
SoulScreamTimer = urand(9000, 11000);
|
||||
if (!(rand()%3))
|
||||
if (!(rand32() % 3))
|
||||
{
|
||||
Talk(ANGER_SAY_SPEC);
|
||||
}
|
||||
|
||||
@@ -306,10 +306,10 @@ public:
|
||||
switch (urand(0, 1))
|
||||
{
|
||||
case 0:
|
||||
coord += rand()%radius;
|
||||
coord += rand32() % radius;
|
||||
break;
|
||||
case 1:
|
||||
coord -= rand()%radius;
|
||||
coord -= rand32() % radius;
|
||||
break;
|
||||
}
|
||||
return coord;
|
||||
|
||||
@@ -132,7 +132,7 @@ public:
|
||||
Talk(SAY_AGGRO);
|
||||
DoZoneInCombat();
|
||||
events.ScheduleEvent(EVENT_BERSERK, 480000, GCD_CAST);
|
||||
events.ScheduleEvent(EVENT_YELL, 45000 + (rand()%76)*1000, GCD_YELL);
|
||||
events.ScheduleEvent(EVENT_YELL, 45000 + (rand32() % 76) * 1000, GCD_YELL);
|
||||
ResetTimer();
|
||||
}
|
||||
|
||||
|
||||
@@ -489,7 +489,7 @@ public:
|
||||
Unit* unit = me;
|
||||
uint32 member = 0; // He chooses Lady Malande most often
|
||||
|
||||
if (rand()%10 == 0) // But there is a chance he picks someone else.
|
||||
if (rand32() % 10 == 0) // But there is a chance he picks someone else.
|
||||
member = urand(1, 3);
|
||||
|
||||
if (member != 2) // No need to create another pointer to us using Unit::GetUnit
|
||||
|
||||
+9
-9
@@ -131,7 +131,7 @@ public:
|
||||
{
|
||||
CataclysmicBolt_Timer = 10000;
|
||||
Enrage_Timer = 600000; //10 minutes
|
||||
SearNova_Timer = 20000+rand()%40000; // 20 - 60 seconds
|
||||
SearNova_Timer = 20000 + rand32() % 40000; // 20 - 60 seconds
|
||||
|
||||
BlessingOfTides = false;
|
||||
|
||||
@@ -253,7 +253,7 @@ public:
|
||||
if (SearNova_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_SEAR_NOVA);
|
||||
SearNova_Timer = 20000+rand()%40000;
|
||||
SearNova_Timer = 20000 + rand32() % 40000;
|
||||
} else SearNova_Timer -= diff;
|
||||
|
||||
//Enrage_Timer
|
||||
@@ -508,7 +508,7 @@ public:
|
||||
if (FrostShock_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_FROST_SHOCK);
|
||||
FrostShock_Timer = 25000+rand()%5000;
|
||||
FrostShock_Timer = 25000 + rand32() % 5000;
|
||||
} else FrostShock_Timer -= diff;
|
||||
|
||||
//Spitfire_Timer
|
||||
@@ -575,9 +575,9 @@ public:
|
||||
void Reset() override
|
||||
{
|
||||
WaterBoltVolley_Timer = 35000;
|
||||
TidalSurge_Timer = 15000+rand()%5000;
|
||||
TidalSurge_Timer = 15000 + rand32() % 5000;
|
||||
Heal_Timer = 55000;
|
||||
Cyclone_Timer = 30000+rand()%10000;
|
||||
Cyclone_Timer = 30000 + rand32() % 10000;
|
||||
|
||||
instance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED);
|
||||
}
|
||||
@@ -628,16 +628,16 @@ public:
|
||||
// Hacky way to do it - won't trigger elseways
|
||||
if (me->GetVictim())
|
||||
me->EnsureVictim()->CastSpell(me->GetVictim(), SPELL_TIDAL_SURGE_FREEZE, true);
|
||||
TidalSurge_Timer = 15000+rand()%5000;
|
||||
TidalSurge_Timer = 15000 + rand32() % 5000;
|
||||
} else TidalSurge_Timer -= diff;
|
||||
|
||||
//Cyclone_Timer
|
||||
if (Cyclone_Timer <= diff)
|
||||
{
|
||||
//DoCast(me, SPELL_SUMMON_CYCLONE); // Doesn't work
|
||||
Cyclone_Timer = 30000+rand()%10000;
|
||||
Cyclone_Timer = 30000 + rand32() % 10000;
|
||||
|
||||
if (Creature* Cyclone = me->SummonCreature(CREATURE_CYCLONE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), float(rand()%5), TEMPSUMMON_TIMED_DESPAWN, 15000))
|
||||
if (Creature* Cyclone = me->SummonCreature(CREATURE_CYCLONE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), float(rand32() % 5), TEMPSUMMON_TIMED_DESPAWN, 15000))
|
||||
{
|
||||
Cyclone->SetObjectScale(3.0f);
|
||||
Cyclone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
@@ -672,7 +672,7 @@ public:
|
||||
Unit* selectAdvisorUnit()
|
||||
{
|
||||
Unit* unit = NULL;
|
||||
switch (rand()%4)
|
||||
switch (rand32() % 4)
|
||||
{
|
||||
case 0:
|
||||
unit = ObjectAccessor::GetUnit(*me, instance->GetData64(DATA_KARATHRESS));
|
||||
|
||||
@@ -182,15 +182,15 @@ public:
|
||||
void Reset() override
|
||||
{
|
||||
AggroTimer = 19000;
|
||||
ShockBlastTimer = 1+rand()%60000;
|
||||
ShockBlastTimer = 1 + rand32() % 60000;
|
||||
EntangleTimer = 30000;
|
||||
StaticChargeTimer = 10000+rand()%15000;
|
||||
StaticChargeTimer = 10000 + rand32() % 15000;
|
||||
ForkedLightningTimer = 2000;
|
||||
CheckTimer = 15000;
|
||||
EnchantedElementalTimer = 5000;
|
||||
TaintedElementalTimer = 50000;
|
||||
CoilfangEliteTimer = 45000+rand()%5000;
|
||||
CoilfangStriderTimer = 60000+rand()%10000;
|
||||
CoilfangEliteTimer = 45000 + rand32() % 5000;
|
||||
CoilfangStriderTimer = 60000 + rand32() % 10000;
|
||||
SummonSporebatTimer = 10000;
|
||||
SummonSporebatStaticTimer = 30000;
|
||||
EnchantedElementalPos = 0;
|
||||
@@ -304,7 +304,7 @@ public:
|
||||
DoCastVictim(SPELL_MULTI_SHOT);
|
||||
break;
|
||||
}
|
||||
if (rand()%3)
|
||||
if (rand32() % 3)
|
||||
{
|
||||
Talk(SAY_BOWSHOT);
|
||||
}
|
||||
@@ -346,7 +346,7 @@ public:
|
||||
DoCastVictim(SPELL_SHOCK_BLAST);
|
||||
me->TauntApply(me->GetVictim());
|
||||
|
||||
ShockBlastTimer = 1000+rand()%14000; // random cooldown
|
||||
ShockBlastTimer = 1000 + rand32() % 14000; // random cooldown
|
||||
} else ShockBlastTimer -= diff;
|
||||
|
||||
// StaticChargeTimer
|
||||
@@ -358,7 +358,7 @@ public:
|
||||
if (target && !target->HasAura(SPELL_STATIC_CHARGE_TRIGGER))
|
||||
DoCast(target, SPELL_STATIC_CHARGE_TRIGGER); // cast Static Charge every 2 seconds for 20 seconds
|
||||
|
||||
StaticChargeTimer = 10000+rand()%20000;
|
||||
StaticChargeTimer = 10000 + rand32() % 20000;
|
||||
} else StaticChargeTimer -= diff;
|
||||
|
||||
// EntangleTimer
|
||||
@@ -376,7 +376,7 @@ public:
|
||||
{
|
||||
CastShootOrMultishot();
|
||||
Entangle = false;
|
||||
EntangleTimer = 20000+rand()%5000;
|
||||
EntangleTimer = 20000 + rand32() % 5000;
|
||||
}
|
||||
} else EntangleTimer -= diff;
|
||||
|
||||
@@ -461,7 +461,7 @@ public:
|
||||
|
||||
DoCast(target, SPELL_FORKED_LIGHTNING);
|
||||
|
||||
ForkedLightningTimer = 2000+rand()%6000;
|
||||
ForkedLightningTimer = 2000 + rand32() % 6000;
|
||||
} else ForkedLightningTimer -= diff;
|
||||
|
||||
// EnchantedElementalTimer
|
||||
@@ -474,13 +474,13 @@ public:
|
||||
else
|
||||
++EnchantedElementalPos;
|
||||
|
||||
EnchantedElementalTimer = 10000+rand()%5000;
|
||||
EnchantedElementalTimer = 10000 + rand32() % 5000;
|
||||
} else EnchantedElementalTimer -= diff;
|
||||
|
||||
// TaintedElementalTimer
|
||||
if (TaintedElementalTimer <= diff)
|
||||
{
|
||||
uint32 pos = rand()%8;
|
||||
uint32 pos = rand32() % 8;
|
||||
me->SummonCreature(TAINTED_ELEMENTAL, ElementPos[pos][0], ElementPos[pos][1], ElementPos[pos][2], ElementPos[pos][3], TEMPSUMMON_DEAD_DESPAWN, 0);
|
||||
|
||||
TaintedElementalTimer = 120000;
|
||||
@@ -489,7 +489,7 @@ public:
|
||||
// CoilfangEliteTimer
|
||||
if (CoilfangEliteTimer <= diff)
|
||||
{
|
||||
uint32 pos = rand()%3;
|
||||
uint32 pos = rand32() % 3;
|
||||
Creature* coilfangElite = me->SummonCreature(COILFANG_ELITE, CoilfangElitePos[pos][0], CoilfangElitePos[pos][1], CoilfangElitePos[pos][2], CoilfangElitePos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
|
||||
if (coilfangElite)
|
||||
{
|
||||
@@ -498,13 +498,13 @@ public:
|
||||
else if (me->GetVictim())
|
||||
coilfangElite->AI()->AttackStart(me->GetVictim());
|
||||
}
|
||||
CoilfangEliteTimer = 45000+rand()%5000;
|
||||
CoilfangEliteTimer = 45000 + rand32() % 5000;
|
||||
} else CoilfangEliteTimer -= diff;
|
||||
|
||||
// CoilfangStriderTimer
|
||||
if (CoilfangStriderTimer <= diff)
|
||||
{
|
||||
uint32 pos = rand()%3;
|
||||
uint32 pos = rand32() % 3;
|
||||
if (Creature* CoilfangStrider = me->SummonCreature(COILFANG_STRIDER, CoilfangStriderPos[pos][0], CoilfangStriderPos[pos][1], CoilfangStriderPos[pos][2], CoilfangStriderPos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000))
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
@@ -512,7 +512,7 @@ public:
|
||||
else if (me->GetVictim())
|
||||
CoilfangStrider->AI()->AttackStart(me->GetVictim());
|
||||
}
|
||||
CoilfangStriderTimer = 60000+rand()%10000;
|
||||
CoilfangStriderTimer = 60000 + rand32() % 10000;
|
||||
} else CoilfangStriderTimer -= diff;
|
||||
|
||||
// CheckTimer
|
||||
@@ -656,7 +656,7 @@ public:
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
PoisonBoltTimer = 5000+rand()%5000;
|
||||
PoisonBoltTimer = 5000 + rand32() % 5000;
|
||||
DespawnTimer = 30000;
|
||||
}
|
||||
|
||||
@@ -681,7 +681,7 @@ public:
|
||||
if (target && target->IsWithinDistInMap(me, 30))
|
||||
DoCast(target, SPELL_POISON_BOLT);
|
||||
|
||||
PoisonBoltTimer = 5000+rand()%5000;
|
||||
PoisonBoltTimer = 5000 + rand32() % 5000;
|
||||
} else PoisonBoltTimer -= diff;
|
||||
|
||||
// DespawnTimer
|
||||
@@ -754,7 +754,7 @@ public:
|
||||
// Random movement
|
||||
if (MovementTimer <= diff)
|
||||
{
|
||||
uint32 rndpos = rand()%8;
|
||||
uint32 rndpos = rand32() % 8;
|
||||
me->GetMotionMaster()->MovePoint(1, SporebatWPPos[rndpos][0], SporebatWPPos[rndpos][1], SporebatWPPos[rndpos][2]);
|
||||
MovementTimer = 6000;
|
||||
} else MovementTimer -= diff;
|
||||
@@ -770,7 +770,7 @@ public:
|
||||
trig->CastSpell(trig, SPELL_TOXIC_SPORES, true);
|
||||
}
|
||||
}
|
||||
BoltTimer = 10000+rand()%5000;
|
||||
BoltTimer = 10000 + rand32() % 5000;
|
||||
}
|
||||
else BoltTimer -= diff;
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ public:
|
||||
SpoutTimer = 45000;
|
||||
WhirlTimer = 18000; // after avery spout
|
||||
PhaseTimer = 120000;
|
||||
GeyserTimer = rand()%5000 + 15000;
|
||||
GeyserTimer = rand32() % 5000 + 15000;
|
||||
CheckTimer = 15000; // give time to get in range when fight starts
|
||||
WaitTimer = 60000; // never reached
|
||||
WaitTimer2 = 60000; // never reached
|
||||
@@ -299,7 +299,7 @@ public:
|
||||
target = me->GetVictim();
|
||||
if (target)
|
||||
DoCast(target, SPELL_GEYSER, true);
|
||||
GeyserTimer = rand()%5000 + 15000;
|
||||
GeyserTimer = rand32() % 5000 + 15000;
|
||||
} else GeyserTimer -= diff;
|
||||
|
||||
if (!InRange) // if on players in melee range cast Waterbolt
|
||||
@@ -403,7 +403,7 @@ public:
|
||||
if (me->GetVictim())
|
||||
DoCastVictim(SPELL_SPREAD_SHOT, true);
|
||||
|
||||
MultiShotTimer = 10000+rand()%10000;
|
||||
MultiShotTimer = 10000 + rand32() % 10000;
|
||||
ShootBowTimer += 1500; // add global cooldown
|
||||
} else MultiShotTimer -= diff;
|
||||
|
||||
@@ -412,7 +412,7 @@ public:
|
||||
int bp0 = 1100;
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
me->CastCustomSpell(target, SPELL_SHOOT, &bp0, NULL, NULL, true);
|
||||
ShootBowTimer = 4000+rand()%5000;
|
||||
ShootBowTimer = 4000 + rand32() % 5000;
|
||||
MultiShotTimer += 1500; // add global cooldown
|
||||
} else ShootBowTimer -= diff;
|
||||
}
|
||||
|
||||
+1
-1
@@ -197,7 +197,7 @@ public:
|
||||
}
|
||||
Talk(EMOTE_EARTHQUAKE);
|
||||
Earthquake = false;
|
||||
Earthquake_Timer = 40000+rand()%5000;
|
||||
Earthquake_Timer = 40000 + rand32() % 5000;
|
||||
}
|
||||
} else Earthquake_Timer -= diff;
|
||||
|
||||
|
||||
+5
-5
@@ -101,7 +101,7 @@ public:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_LIGHTNING_CLOUD);
|
||||
|
||||
LightningCloud_Timer = 15000+rand()%10000;
|
||||
LightningCloud_Timer = 15000 + rand32() % 10000;
|
||||
} else LightningCloud_Timer -=diff;
|
||||
|
||||
//LungBurst_Timer
|
||||
@@ -109,7 +109,7 @@ public:
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_LUNG_BURST);
|
||||
LungBurst_Timer = 7000+rand()%5000;
|
||||
LungBurst_Timer = 7000 + rand32() % 5000;
|
||||
} else LungBurst_Timer -=diff;
|
||||
|
||||
//EnvelopingWinds_Timer
|
||||
@@ -122,7 +122,7 @@ public:
|
||||
if (IsHeroic())
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_ENVELOPING_WINDS);
|
||||
EnvelopingWinds_Timer = 10000+rand()%5000;
|
||||
EnvelopingWinds_Timer = 10000 + rand32() % 5000;
|
||||
} else EnvelopingWinds_Timer -=diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
@@ -149,7 +149,7 @@ public:
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
WaterBoltVolley_Timer = 3000+rand()%3000;
|
||||
WaterBoltVolley_Timer = 3000 + rand32() % 3000;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) override { }
|
||||
@@ -162,7 +162,7 @@ public:
|
||||
if (WaterBoltVolley_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_WATER_BOLT_VOLLEY);
|
||||
WaterBoltVolley_Timer = 7000+rand()%5000;
|
||||
WaterBoltVolley_Timer = 7000 + rand32() % 5000;
|
||||
} else WaterBoltVolley_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
|
||||
+2
-2
@@ -117,9 +117,9 @@ public:
|
||||
DoSpawnCreature(NPC_STREAMRIGGER_MECHANIC, -5, 5, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000);
|
||||
DoSpawnCreature(NPC_STREAMRIGGER_MECHANIC, -5, -5, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000);
|
||||
|
||||
if (rand()%2)
|
||||
if (rand32() % 2)
|
||||
DoSpawnCreature(NPC_STREAMRIGGER_MECHANIC, 5, -7, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000);
|
||||
if (rand()%2)
|
||||
if (rand32() % 2)
|
||||
DoSpawnCreature(NPC_STREAMRIGGER_MECHANIC, 7, -5, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000);
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ public:
|
||||
void Reset() override
|
||||
{
|
||||
Reflection_Timer = 10000;
|
||||
Impale_Timer = 7000+rand()%7000;
|
||||
Impale_Timer = 7000 + rand32() % 7000;
|
||||
Rage_Timer = 45000;
|
||||
CanRage = false;
|
||||
|
||||
@@ -170,14 +170,14 @@ public:
|
||||
DoCast(me, SPELL_WARLORDS_RAGE);
|
||||
CAST_AI(npc_naga_distiller::npc_naga_distillerAI, distiller->AI())->StartRageGen(me);
|
||||
}
|
||||
Rage_Timer = 3000+rand()%15000;
|
||||
Rage_Timer = 3000 + rand32() % 15000;
|
||||
} else Rage_Timer -= diff;
|
||||
|
||||
//Reflection_Timer
|
||||
if (Reflection_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_SPELL_REFLECTION);
|
||||
Reflection_Timer = 15000+rand()%10000;
|
||||
Reflection_Timer = 15000 + rand32() % 10000;
|
||||
} else Reflection_Timer -= diff;
|
||||
|
||||
//Impale_Timer
|
||||
@@ -186,7 +186,7 @@ public:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_IMPALE);
|
||||
|
||||
Impale_Timer = 7500+rand()%5000;
|
||||
Impale_Timer = 7500 + rand32() % 5000;
|
||||
} else Impale_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
|
||||
@@ -84,9 +84,9 @@ public:
|
||||
if (Mushroom_Timer <= diff)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
me->SummonCreature(17990, target->GetPositionX()+(rand()%8), target->GetPositionY()+(rand()%8), target->GetPositionZ(), float(rand()%5), TEMPSUMMON_TIMED_DESPAWN, 22000);
|
||||
me->SummonCreature(17990, target->GetPositionX() + (rand32() % 8), target->GetPositionY() + (rand32() % 8), target->GetPositionZ(), float(rand32() % 5), TEMPSUMMON_TIMED_DESPAWN, 22000);
|
||||
else
|
||||
me->SummonCreature(17990, me->GetPositionX()+(rand()%8), me->GetPositionY()+(rand()%8), me->GetPositionZ(), float(rand()%5), TEMPSUMMON_TIMED_DESPAWN, 22000);
|
||||
me->SummonCreature(17990, me->GetPositionX() + (rand32() % 8), me->GetPositionY() + (rand32() % 8), me->GetPositionZ(), float(rand32() % 5), TEMPSUMMON_TIMED_DESPAWN, 22000);
|
||||
|
||||
Mushroom_Timer = 10000;
|
||||
} else Mushroom_Timer -= diff;
|
||||
@@ -95,7 +95,7 @@ public:
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_ACID_GEYSER);
|
||||
AcidGeyser_Timer = 10000+rand()%7500;
|
||||
AcidGeyser_Timer = 10000 + rand32() % 7500;
|
||||
} else AcidGeyser_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
Levitate_Timer = 12000;
|
||||
ChainLightning_Timer = 6000;
|
||||
StaticCharge_Timer = 10000;
|
||||
SporeStriders_Timer = 10000+rand()%5000;
|
||||
SporeStriders_Timer = 10000 + rand32() % 5000;
|
||||
check_Timer = 5000;
|
||||
LevitatedTarget = 0;
|
||||
LevitatedTarget_Timer = 0;
|
||||
@@ -124,7 +124,7 @@ public:
|
||||
if (IsHeroic() && SporeStriders_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_SUMMON_SPORE_STRIDER);
|
||||
SporeStriders_Timer = 10000+rand()%5000;
|
||||
SporeStriders_Timer = 10000 + rand32() % 5000;
|
||||
} else SporeStriders_Timer -= diff;
|
||||
|
||||
// Levitate
|
||||
@@ -164,7 +164,7 @@ public:
|
||||
LevitatedTarget_Timer = 2000;
|
||||
InAir = false;
|
||||
}
|
||||
Levitate_Timer = 12000+rand()%3000;
|
||||
Levitate_Timer = 12000 + rand32() % 3000;
|
||||
} else Levitate_Timer -= diff;
|
||||
|
||||
// Chain Lightning
|
||||
|
||||
@@ -153,7 +153,7 @@ public:
|
||||
if (MightyBlow_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_MIGHTY_BLOW);
|
||||
MightyBlow_Timer = 30000+rand()%10000;
|
||||
MightyBlow_Timer = 30000 + rand32() % 10000;
|
||||
} else MightyBlow_Timer -= diff;
|
||||
|
||||
//Entering Phase 2
|
||||
@@ -186,7 +186,7 @@ public:
|
||||
if (Roar_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_ROAR);
|
||||
Roar_Timer = 40000+(rand()%10000);
|
||||
Roar_Timer = 40000 + (rand32() % 10000);
|
||||
} else Roar_Timer -= diff;
|
||||
}
|
||||
|
||||
@@ -537,7 +537,7 @@ public:
|
||||
target = NULL;
|
||||
}
|
||||
if (!target_list.empty())
|
||||
target = *(target_list.begin()+rand()%target_list.size());
|
||||
target = *(target_list.begin() + rand32() % target_list.size());
|
||||
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
DoCast(target, SPELL_BLAST_WAVE);
|
||||
|
||||
@@ -83,7 +83,7 @@ class boss_broggok : public CreatureScript
|
||||
if (AcidSpray_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_SLIME_SPRAY);
|
||||
AcidSpray_Timer = 4000+rand()%8000;
|
||||
AcidSpray_Timer = 4000 + rand32() % 8000;
|
||||
}
|
||||
else
|
||||
AcidSpray_Timer -=diff;
|
||||
@@ -91,7 +91,7 @@ class boss_broggok : public CreatureScript
|
||||
if (PoisonBolt_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_POISON_BOLT);
|
||||
PoisonBolt_Timer = 4000+rand()%8000;
|
||||
PoisonBolt_Timer = 4000 + rand32() % 8000;
|
||||
}
|
||||
else
|
||||
PoisonBolt_Timer -=diff;
|
||||
|
||||
+8
-8
@@ -103,7 +103,7 @@ class boss_kelidan_the_breaker : public CreatureScript
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) override
|
||||
{
|
||||
if (rand()%2)
|
||||
if (rand32() % 2)
|
||||
return;
|
||||
|
||||
Talk(SAY_KILL);
|
||||
@@ -206,7 +206,7 @@ class boss_kelidan_the_breaker : public CreatureScript
|
||||
if (ShadowVolley_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_SHADOW_BOLT_VOLLEY);
|
||||
ShadowVolley_Timer = 5000+rand()%8000;
|
||||
ShadowVolley_Timer = 5000 + rand32() % 8000;
|
||||
}
|
||||
else
|
||||
ShadowVolley_Timer -=diff;
|
||||
@@ -214,7 +214,7 @@ class boss_kelidan_the_breaker : public CreatureScript
|
||||
if (Corruption_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_CORRUPTION);
|
||||
Corruption_Timer = 30000+rand()%20000;
|
||||
Corruption_Timer = 30000 + rand32() % 20000;
|
||||
}
|
||||
else
|
||||
Corruption_Timer -=diff;
|
||||
@@ -235,7 +235,7 @@ class boss_kelidan_the_breaker : public CreatureScript
|
||||
if (IsHeroic())
|
||||
DoTeleportAll(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
|
||||
|
||||
BurningNova_Timer = 20000+rand()%8000;
|
||||
BurningNova_Timer = 20000 + rand32() % 8000;
|
||||
Firenova_Timer= 5000;
|
||||
Firenova = true;
|
||||
}
|
||||
@@ -281,8 +281,8 @@ class npc_shadowmoon_channeler : public CreatureScript
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
ShadowBolt_Timer = 1000+rand()%1000;
|
||||
MarkOfShadow_Timer = 5000+rand()%2000;
|
||||
ShadowBolt_Timer = 1000 + rand32() % 1000;
|
||||
MarkOfShadow_Timer = 5000 + rand32() % 2000;
|
||||
check_Timer = 0;
|
||||
if (me->IsNonMeleeSpellCast(false))
|
||||
me->InterruptNonMeleeSpells(true);
|
||||
@@ -327,7 +327,7 @@ class npc_shadowmoon_channeler : public CreatureScript
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_MARK_OF_SHADOW);
|
||||
MarkOfShadow_Timer = 15000+rand()%5000;
|
||||
MarkOfShadow_Timer = 15000 + rand32() % 5000;
|
||||
}
|
||||
else
|
||||
MarkOfShadow_Timer -=diff;
|
||||
@@ -335,7 +335,7 @@ class npc_shadowmoon_channeler : public CreatureScript
|
||||
if (ShadowBolt_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_SHADOW_BOLT);
|
||||
ShadowBolt_Timer = 5000+rand()%1000;
|
||||
ShadowBolt_Timer = 5000 + rand32() % 1000;
|
||||
}
|
||||
else
|
||||
ShadowBolt_Timer -=diff;
|
||||
|
||||
@@ -91,7 +91,7 @@ class boss_the_maker : public CreatureScript
|
||||
if (AcidSpray_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_ACID_SPRAY);
|
||||
AcidSpray_Timer = 15000+rand()%8000;
|
||||
AcidSpray_Timer = 15000 + rand32() % 8000;
|
||||
}
|
||||
else
|
||||
AcidSpray_Timer -=diff;
|
||||
@@ -100,7 +100,7 @@ class boss_the_maker : public CreatureScript
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_EXPLODING_BREAKER);
|
||||
ExplodingBreaker_Timer = 4000+rand()%8000;
|
||||
ExplodingBreaker_Timer = 4000 + rand32() % 8000;
|
||||
}
|
||||
else
|
||||
ExplodingBreaker_Timer -=diff;
|
||||
@@ -120,7 +120,7 @@ class boss_the_maker : public CreatureScript
|
||||
if (Knockdown_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_KNOCKDOWN);
|
||||
Knockdown_Timer = 4000+rand()%8000;
|
||||
Knockdown_Timer = 4000 + rand32() % 8000;
|
||||
}
|
||||
else
|
||||
Knockdown_Timer -=diff;
|
||||
|
||||
+5
-5
@@ -88,7 +88,7 @@ class boss_omor_the_unscarred : public CreatureScript
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) override
|
||||
{
|
||||
if (rand()%2)
|
||||
if (rand32() % 2)
|
||||
return;
|
||||
|
||||
Talk(SAY_KILL_1);
|
||||
@@ -122,7 +122,7 @@ class boss_omor_the_unscarred : public CreatureScript
|
||||
{
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
DoCast(me, SPELL_SUMMON_FIENDISH_HOUND);
|
||||
Summon_Timer = 15000+rand()%15000;
|
||||
Summon_Timer = 15000 + rand32() % 15000;
|
||||
}
|
||||
else
|
||||
Summon_Timer -= diff;
|
||||
@@ -159,7 +159,7 @@ class boss_omor_the_unscarred : public CreatureScript
|
||||
if (temp && temp->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
DoCast(temp, SPELL_ORBITAL_STRIKE);
|
||||
OrbitalStrike_Timer = 14000+rand()%2000;
|
||||
OrbitalStrike_Timer = 14000 + rand32() % 2000;
|
||||
PlayerGUID = temp->GetGUID();
|
||||
|
||||
if (PlayerGUID)
|
||||
@@ -187,7 +187,7 @@ class boss_omor_the_unscarred : public CreatureScript
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
DoCast(target, SPELL_TREACHEROUS_AURA);
|
||||
Aura_Timer = 8000+rand()%8000;
|
||||
Aura_Timer = 8000 + rand32() % 8000;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -201,7 +201,7 @@ class boss_omor_the_unscarred : public CreatureScript
|
||||
target = me->GetVictim();
|
||||
|
||||
DoCast(target, SPELL_SHADOW_BOLT);
|
||||
Shadowbolt_Timer = 4000+rand()%2500;
|
||||
Shadowbolt_Timer = 4000 + rand32() % 2500;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -180,7 +180,7 @@ class npc_abyssal : public CreatureScript
|
||||
if (FireBlast_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_FIRE_BLAST);
|
||||
FireBlast_Timer = 5000+rand()%10000;
|
||||
FireBlast_Timer = 5000 + rand32() % 10000;
|
||||
}
|
||||
else FireBlast_Timer -= diff;
|
||||
|
||||
@@ -232,7 +232,7 @@ class boss_magtheridon : public CreatureScript
|
||||
Berserk_Timer = 1320000;
|
||||
Quake_Timer = 40000;
|
||||
Debris_Timer = 10000;
|
||||
Blaze_Timer = 10000+rand()%20000;
|
||||
Blaze_Timer = 10000 + rand32() % 20000;
|
||||
BlastNova_Timer = 60000;
|
||||
Cleave_Timer = 15000;
|
||||
RandChat_Timer = 90000;
|
||||
@@ -538,7 +538,7 @@ class npc_hellfire_channeler : public CreatureScript
|
||||
{
|
||||
if (HealthBelowPct(50))
|
||||
DoCast(me, SPELL_DARK_MENDING);
|
||||
DarkMending_Timer = 10000 +(rand() % 10000);
|
||||
DarkMending_Timer = 10000 + (rand32() % 10000);
|
||||
}
|
||||
else
|
||||
DarkMending_Timer -= diff;
|
||||
|
||||
@@ -243,7 +243,7 @@ class boss_grand_warlock_nethekurse : public CreatureScript
|
||||
if (Cleave_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_SHADOW_CLEAVE);
|
||||
Cleave_Timer = 6000+rand()%2500;
|
||||
Cleave_Timer = 6000 + rand32() % 2500;
|
||||
}
|
||||
else
|
||||
Cleave_Timer -= diff;
|
||||
|
||||
+6
-6
@@ -178,7 +178,7 @@ class boss_warbringer_omrogg : public CreatureScript
|
||||
if (!LeftHead || !RightHead)
|
||||
return;
|
||||
|
||||
ithreat = rand()%4;
|
||||
ithreat = rand32() % 4;
|
||||
|
||||
Creature* source = (LeftHead->GetEntry() == Threat[ithreat].creature ? LeftHead : RightHead);
|
||||
|
||||
@@ -195,7 +195,7 @@ class boss_warbringer_omrogg : public CreatureScript
|
||||
|
||||
if (Creature* LeftHead = ObjectAccessor::GetCreature(*me, LeftHeadGUID))
|
||||
{
|
||||
iaggro = rand()%3;
|
||||
iaggro = rand32() % 3;
|
||||
|
||||
LeftHead->AI()->Talk(GoCombat[iaggro].id);
|
||||
|
||||
@@ -227,7 +227,7 @@ class boss_warbringer_omrogg : public CreatureScript
|
||||
if (!LeftHead || !RightHead)
|
||||
return;
|
||||
|
||||
ikilling = rand()%2;
|
||||
ikilling = rand32() % 2;
|
||||
|
||||
Creature* source = (LeftHead->GetEntry() == Killing[ikilling].creature ? LeftHead : RightHead);
|
||||
|
||||
@@ -338,7 +338,7 @@ class boss_warbringer_omrogg : public CreatureScript
|
||||
DoResetThreat();
|
||||
me->AddThreat(target, 0.0f);
|
||||
}
|
||||
ResetThreat_Timer = 25000+rand()%15000;
|
||||
ResetThreat_Timer = 25000 + rand32() % 15000;
|
||||
}
|
||||
else
|
||||
ResetThreat_Timer -= diff;
|
||||
@@ -346,7 +346,7 @@ class boss_warbringer_omrogg : public CreatureScript
|
||||
if (Fear_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_FEAR);
|
||||
Fear_Timer = 15000+rand()%20000;
|
||||
Fear_Timer = 15000 + rand32() % 20000;
|
||||
}
|
||||
else
|
||||
Fear_Timer -= diff;
|
||||
@@ -354,7 +354,7 @@ class boss_warbringer_omrogg : public CreatureScript
|
||||
if (ThunderClap_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_THUNDERCLAP);
|
||||
ThunderClap_Timer = 15000+rand()%15000;
|
||||
ThunderClap_Timer = 15000 + rand32() % 15000;
|
||||
}
|
||||
else
|
||||
ThunderClap_Timer -= diff;
|
||||
|
||||
+2
-2
@@ -213,8 +213,8 @@ class boss_warchief_kargath_bladefist : public CreatureScript
|
||||
{
|
||||
//move in bladedance
|
||||
float x, y, randx, randy;
|
||||
randx = 0.0f + rand()%40;
|
||||
randy = 0.0f + rand()%40;
|
||||
randx = 0.0f + rand32() % 40;
|
||||
randy = 0.0f + rand32() % 40;
|
||||
x = 210+ randx;
|
||||
y = -60- randy;
|
||||
me->GetMotionMaster()->MovePoint(1, x, y, me->GetPositionZ());
|
||||
|
||||
@@ -245,7 +245,7 @@ class boss_alar : public CreatureScript
|
||||
switch (WaitEvent)
|
||||
{
|
||||
case WE_PLATFORM:
|
||||
Platforms_Move_Timer = 30000+rand()%5000;
|
||||
Platforms_Move_Timer = 30000 + rand32() % 5000;
|
||||
break;
|
||||
case WE_QUILL:
|
||||
DoCast(me, SPELL_FLAME_QUILLS, true);
|
||||
@@ -268,7 +268,7 @@ class boss_alar : public CreatureScript
|
||||
DoCast(me, SPELL_REBIRTH, true);
|
||||
MeltArmor_Timer = 60000;
|
||||
Charge_Timer = 7000;
|
||||
DiveBomb_Timer = 40000+rand()%5000;
|
||||
DiveBomb_Timer = 40000 + rand32() % 5000;
|
||||
FlamePatch_Timer = 30000;
|
||||
Phase1 = false;
|
||||
break;
|
||||
@@ -391,7 +391,7 @@ class boss_alar : public CreatureScript
|
||||
me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 50);
|
||||
WaitEvent = WE_METEOR;
|
||||
WaitTimer = 0;
|
||||
DiveBomb_Timer = 40000+rand()%5000;
|
||||
DiveBomb_Timer = 40000 + rand32() % 5000;
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -143,7 +143,7 @@ class boss_high_astromancer_solarian : public CreatureScript
|
||||
AppearDelay_Timer = 2000;
|
||||
BlindingLight = false;
|
||||
AppearDelay = false;
|
||||
Wrath_Timer = 20000+rand()%5000;//twice in phase one
|
||||
Wrath_Timer = 20000 + rand32() % 5000;//twice in phase one
|
||||
Phase = 1;
|
||||
|
||||
instance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, NOT_STARTED);
|
||||
@@ -195,7 +195,7 @@ class boss_high_astromancer_solarian : public CreatureScript
|
||||
if (urand(0, 1))
|
||||
radius = -radius;
|
||||
|
||||
return radius * (float)(rand()%100)/100.0f + CENTER_X;
|
||||
return radius * (float)(rand32() % 100) / 100.0f + CENTER_X;
|
||||
}
|
||||
|
||||
float Portal_Y(float x, float radius)
|
||||
@@ -241,7 +241,7 @@ class boss_high_astromancer_solarian : public CreatureScript
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
|
||||
DoCast(target, SPELL_WRATH_OF_THE_ASTROMANCER, true);
|
||||
Wrath_Timer = 20000+rand()%5000;
|
||||
Wrath_Timer = 20000 + rand32() % 5000;
|
||||
}
|
||||
else
|
||||
Wrath_Timer -= diff;
|
||||
@@ -359,7 +359,7 @@ class boss_high_astromancer_solarian : public CreatureScript
|
||||
{
|
||||
Phase = 1;
|
||||
//15 seconds later Solarian reappears out of one of the 3 portals. Simultaneously, 2 healers appear in the two other portals.
|
||||
int i = rand()%3;
|
||||
int i = rand32() % 3;
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->SetPosition(Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O);
|
||||
|
||||
|
||||
Loaded 100 of 116 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user