aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/World
diff options
context:
space:
mode:
authorCarbenium <carbenium@outlook.com>2020-07-26 20:44:07 +0200
committerShauren <shauren.trinity@gmail.com>2022-01-24 11:55:32 +0100
commit310f996b1daf9dea701276847aa3fb30fcd43b9e (patch)
tree6016e31d8f9f3f439f4c35868cfcde4652a898b1 /src/server/scripts/World
parent906a47b1616eebe1b9f73f0b5a849c5d946e8137 (diff)
Core/WorldObject: Partially std::chrono-ify SummonCreature overloads
TempSummon* SummonCreature(uint32 entry, float x, float y, float z, float o = 0, TempSummonType despawnType = TEMPSUMMON_MANUAL_DESPAWN, uint32 despawnTime = 0); to TempSummon* SummonCreature(uint32 entry, float x, float y, float z, float o = 0, TempSummonType despawnType = TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime = 0s); (cherry picked from commit 1131229ee9c43704b11187f0b11c327db92018b6)
Diffstat (limited to 'src/server/scripts/World')
-rw-r--r--src/server/scripts/World/areatrigger_scripts.cpp6
-rw-r--r--src/server/scripts/World/go_scripts.cpp18
-rw-r--r--src/server/scripts/World/npcs_special.cpp4
3 files changed, 14 insertions, 14 deletions
diff --git a/src/server/scripts/World/areatrigger_scripts.cpp b/src/server/scripts/World/areatrigger_scripts.cpp
index 7bf23ca054a..013012ee7d9 100644
--- a/src/server/scripts/World/areatrigger_scripts.cpp
+++ b/src/server/scripts/World/areatrigger_scripts.cpp
@@ -155,7 +155,7 @@ class AreaTrigger_at_scent_larkorwi : public AreaTriggerScript
if (!player->isDead() && player->GetQuestStatus(QUEST_SCENT_OF_LARKORWI) == QUEST_STATUS_INCOMPLETE)
{
if (!player->FindNearestCreature(NPC_LARKORWI_MATE, 15))
- player->SummonCreature(NPC_LARKORWI_MATE, player->GetPositionX()+5, player->GetPositionY(), player->GetPositionZ(), 3.3f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 100000);
+ player->SummonCreature(NPC_LARKORWI_MATE, player->GetPositionX()+5, player->GetPositionY(), player->GetPositionZ(), 3.3f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 100s);
}
return false;
@@ -230,7 +230,7 @@ class AreaTrigger_at_nats_landing : public AreaTriggerScript
{
if (!player->FindNearestCreature(NPC_LURKING_SHARK, 20.0f))
{
- if (Creature* shark = player->SummonCreature(NPC_LURKING_SHARK, -4246.243f, -3922.356f, -7.488f, 5.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 100000))
+ if (Creature* shark = player->SummonCreature(NPC_LURKING_SHARK, -4246.243f, -3922.356f, -7.488f, 5.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 100s))
shark->AI()->AttackStart(player);
return false;
@@ -354,7 +354,7 @@ class AreaTrigger_at_area_52_entrance : public AreaTriggerScript
break;
}
- player->SummonCreature(NPC_SPOTLIGHT, x, y, z, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 5000);
+ player->SummonCreature(NPC_SPOTLIGHT, x, y, z, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 5s);
player->AddAura(SPELL_A52_NEURALYZER, player);
_triggerTimes[trigger->ID] = GameTime::GetGameTime();
return false;
diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp
index fa0bb684cc9..546a8f60ce2 100644
--- a/src/server/scripts/World/go_scripts.cpp
+++ b/src/server/scripts/World/go_scripts.cpp
@@ -74,7 +74,7 @@ public:
{
if (player->GetQuestStatus(QUEST_THE_FIRST_TRIAL) == QUEST_STATUS_INCOMPLETE)
{
- if (Creature* Stillblade = player->SummonCreature(NPC_STILLBLADE, 8106.11f, -7542.06f, 151.775f, 3.02598f, TEMPSUMMON_DEAD_DESPAWN, 60000))
+ if (Creature* Stillblade = player->SummonCreature(NPC_STILLBLADE, 8106.11f, -7542.06f, 151.775f, 3.02598f, TEMPSUMMON_DEAD_DESPAWN, 1min))
Stillblade->AI()->AttackStart(player);
}
}
@@ -155,7 +155,7 @@ public:
int Random = rand32() % (sizeof(NpcPrisonEntry) / sizeof(uint32));
if (Creature* creature = player->SummonCreature(NpcPrisonEntry[Random], me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetAbsoluteAngle(player),
- TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))
+ TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30s))
{
if (!creature->IsHostileTo(player))
{
@@ -215,7 +215,7 @@ public:
int Random = rand32() % (sizeof(NpcStasisEntry) / sizeof(uint32));
player->SummonCreature(NpcStasisEntry[Random], me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetAbsoluteAngle(player),
- TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
+ TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30s);
return false;
}
@@ -248,7 +248,7 @@ public:
bool GossipHello(Player* /*player*/) override
{
if (me->GetGoType() == GAMEOBJECT_TYPE_GOOBER)
- me->SummonCreature(NPC_GOGGEROC, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 300000);
+ me->SummonCreature(NPC_GOGGEROC, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5min);
return false;
}
@@ -285,7 +285,7 @@ public:
//implicitTarget=48 not implemented as of writing this code, and manual summon may be just ok for our purpose
//player->CastSpell(player, SPELL_SUMMON_RIZZLE, false);
- if (Creature* creature = player->SummonCreature(NPC_RIZZLE, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0))
+ if (Creature* creature = player->SummonCreature(NPC_RIZZLE, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_DEAD_DESPAWN))
creature->CastSpell(player, SPELL_BLACKJACK, false);
return false;
@@ -498,7 +498,7 @@ public:
{
if (player->GetQuestStatus(QUEST_PRISON_BREAK) == QUEST_STATUS_INCOMPLETE)
{
- me->SummonCreature(25318, 3485.089844f, 6115.7422188f, 70.966812f, 0, TEMPSUMMON_TIMED_DESPAWN, 60000);
+ me->SummonCreature(25318, 3485.089844f, 6115.7422188f, 70.966812f, 0, TEMPSUMMON_TIMED_DESPAWN, 1min);
player->CastSpell(player, SPELL_ARCANE_PRISONER_KILL_CREDIT, true);
return true;
}
@@ -534,7 +534,7 @@ public:
bool GossipHello(Player* player) override
{
if (me->GetGoType() == GAMEOBJECT_TYPE_GOOBER)
- player->SummonCreature(NPC_ZELEMAR, -369.746f, 166.759f, -21.50f, 5.235f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
+ player->SummonCreature(NPC_ZELEMAR, -369.746f, 166.759f, -21.50f, 5.235f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30s);
return true;
}
@@ -776,8 +776,8 @@ public:
bool GossipHello(Player* player) override
{
player->SendLoot(me->GetGUID(), LOOT_CORPSE);
- me->SummonCreature(NPC_HIVE_AMBUSHER, me->GetPositionX() + 1, me->GetPositionY(), me->GetPositionZ(), me->GetAbsoluteAngle(player), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
- me->SummonCreature(NPC_HIVE_AMBUSHER, me->GetPositionX(), me->GetPositionY() + 1, me->GetPositionZ(), me->GetAbsoluteAngle(player), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
+ me->SummonCreature(NPC_HIVE_AMBUSHER, me->GetPositionX() + 1, me->GetPositionY(), me->GetPositionZ(), me->GetAbsoluteAngle(player), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 1min);
+ me->SummonCreature(NPC_HIVE_AMBUSHER, me->GetPositionX(), me->GetPositionY() + 1, me->GetPositionZ(), me->GetAbsoluteAngle(player), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 1min);
return true;
}
};
diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
index 1e626d6319a..4dc53fde78a 100644
--- a/src/server/scripts/World/npcs_special.cpp
+++ b/src/server/scripts/World/npcs_special.cpp
@@ -119,7 +119,7 @@ public:
{
Creature* guard = ObjectAccessor::GetCreature(*me, _myGuard);
- if (!guard && (guard = me->SummonCreature(_spawn.otherEntry, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 300000)))
+ if (!guard && (guard = me->SummonCreature(_spawn.otherEntry, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5min)))
_myGuard = guard->GetGUID();
return guard;
@@ -2018,7 +2018,7 @@ public:
case 1:
case 2:
case 3:
- if (Creature* minion = me->SummonCreature(NPC_MINION_OF_OMEN, me->GetPositionX()+frand(-5.0f, 5.0f), me->GetPositionY()+frand(-5.0f, 5.0f), me->GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000))
+ if (Creature* minion = me->SummonCreature(NPC_MINION_OF_OMEN, me->GetPositionX()+frand(-5.0f, 5.0f), me->GetPositionY()+frand(-5.0f, 5.0f), me->GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20s))
minion->AI()->AttackStart(me->SelectNearestPlayer(20.0f));
break;
case 9: