diff options
| author | Carbenium <carbenium@outlook.com> | 2020-07-26 20:44:07 +0200 |
|---|---|---|
| committer | Peter Keresztes Schmidt <carbenium@outlook.com> | 2020-07-26 23:30:32 +0200 |
| commit | 1131229ee9c43704b11187f0b11c327db92018b6 (patch) | |
| tree | bc8614c3f34492f46789033f3272f4dc0c24426f /src/server/scripts/World | |
| parent | e6f36f83b8af4d973a96f01c6095b075dd12f5d5 (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);
Diffstat (limited to 'src/server/scripts/World')
| -rw-r--r-- | src/server/scripts/World/areatrigger_scripts.cpp | 8 | ||||
| -rw-r--r-- | src/server/scripts/World/go_scripts.cpp | 18 | ||||
| -rw-r--r-- | src/server/scripts/World/npcs_special.cpp | 4 |
3 files changed, 15 insertions, 15 deletions
diff --git a/src/server/scripts/World/areatrigger_scripts.cpp b/src/server/scripts/World/areatrigger_scripts.cpp index 3ee8aed6240..782f040d25a 100644 --- a/src/server/scripts/World/areatrigger_scripts.cpp +++ b/src/server/scripts/World/areatrigger_scripts.cpp @@ -153,7 +153,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; @@ -228,7 +228,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; @@ -262,7 +262,7 @@ public: if (!player->FindNearestCreature(NPC_TERVOSH, 100.0f)) { - if (Creature* tervosh = player->SummonCreature(NPC_TERVOSH, -3476.51f, -4105.94f, 17.1f, 5.3816f, TEMPSUMMON_TIMED_DESPAWN, 60000)) + if (Creature* tervosh = player->SummonCreature(NPC_TERVOSH, -3476.51f, -4105.94f, 17.1f, 5.3816f, TEMPSUMMON_TIMED_DESPAWN, 1min)) tervosh->CastSpell(tervosh, SPELL_TELEPORT_VISUAL, true); } @@ -384,7 +384,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 9f13d419266..eb4fe996dba 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -77,7 +77,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); } } @@ -158,7 +158,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)) { @@ -218,7 +218,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; } @@ -251,7 +251,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; } @@ -288,7 +288,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; @@ -501,7 +501,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; } @@ -537,7 +537,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; } @@ -850,8 +850,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 2c0f85e4ef8..ac8d2f80a26 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -116,7 +116,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; @@ -2057,7 +2057,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: |
