diff options
| author | Carbenium <carbenium@outlook.com> | 2020-07-26 00:54:23 +0200 |
|---|---|---|
| committer | Peter Keresztes Schmidt <carbenium@outlook.com> | 2020-07-26 22:21:59 +0200 |
| commit | 5832790428b124876ba48eacaf47806fd10a3c47 (patch) | |
| tree | 81184c3a1efae84addd56231c390711013571ce4 /src/server/scripts/Spells | |
| parent | fc9e7226c0785fd12b01b724ed3666e6c08dd017 (diff) | |
Scripts/World+Outland+Spells: Use std::chrono overload of Creature::DespawnOrUnsummon
Diffstat (limited to 'src/server/scripts/Spells')
| -rw-r--r-- | src/server/scripts/Spells/spell_dk.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_quest.cpp | 17 |
2 files changed, 10 insertions, 9 deletions
diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index d6ab0057cd4..bf929e52919 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -2991,7 +2991,7 @@ public: if (Creature* ghoul = ObjectAccessor::GetCreature(*player, ghoulGuid)) { ghoul->RemoveCharmedBy(player); - ghoul->DespawnOrUnsummon(1000); + ghoul->DespawnOrUnsummon(1s); } player->RemoveAura(SPELL_GHOUL_FRENZY); diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index c3258bb85aa..756dec2e48e 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -41,10 +41,10 @@ class spell_generic_quest_update_entry_SpellScript : public SpellScript uint32 _originalEntry; uint32 _newEntry; bool _shouldAttack; - uint32 _despawnTime; + Milliseconds _despawnTime; public: - spell_generic_quest_update_entry_SpellScript(uint16 spellEffect, uint8 effIndex, uint32 originalEntry, uint32 newEntry, bool shouldAttack, uint32 despawnTime = 0) : + spell_generic_quest_update_entry_SpellScript(uint16 spellEffect, uint8 effIndex, uint32 originalEntry, uint32 newEntry, bool shouldAttack, Milliseconds despawnTime = 0s) : SpellScript(), _spellEffect(spellEffect), _effIndex(effIndex), _originalEntry(originalEntry), _newEntry(newEntry), _shouldAttack(shouldAttack), _despawnTime(despawnTime) { } @@ -57,7 +57,7 @@ class spell_generic_quest_update_entry_SpellScript : public SpellScript if (_shouldAttack) creatureTarget->EngageWithTarget(GetCaster()); - if (_despawnTime) + if (_despawnTime != 0s) creatureTarget->DespawnOrUnsummon(_despawnTime); } } @@ -208,9 +208,10 @@ enum Quests6124_6129Data NPC_CURED_GAZELLE = 12297, NPC_SICKLY_DEER = 12298, NPC_CURED_DEER = 12299, - DESPAWN_TIME = 30000 }; +constexpr Milliseconds Quest6124_6129_DESPAWN_TIME = 30s; + class spell_q6124_6129_apply_salve : public SpellScriptLoader { public: @@ -246,7 +247,7 @@ class spell_q6124_6129_apply_salve : public SpellScriptLoader if (newEntry) { creatureTarget->UpdateEntry(newEntry); - creatureTarget->DespawnOrUnsummon(DESPAWN_TIME); + creatureTarget->DespawnOrUnsummon(Quest6124_6129_DESPAWN_TIME); caster->KilledMonsterCredit(newEntry); } } @@ -955,7 +956,7 @@ class spell_q9874_liquid_fire : public SpellScriptLoader { caster->KilledMonsterCredit(NPC_VILLAGER_KILL_CREDIT); target->CastSpell(target, SPELL_FLAMES, true); - target->DespawnOrUnsummon(60000); + target->DespawnOrUnsummon(60s); } } @@ -999,7 +1000,7 @@ class spell_q12805_lifeblood_dummy : public SpellScriptLoader { caster->KilledMonsterCredit(NPC_SHARD_KILL_CREDIT); target->CastSpell(target, uint32(GetEffectValue()), true); - target->DespawnOrUnsummon(2000); + target->DespawnOrUnsummon(2s); } } @@ -2227,7 +2228,7 @@ class spell_q12690_burst_at_the_seams_52510 : public SpellScript void HandleScript(SpellEffIndex /*effIndex*/) { - GetCaster()->ToCreature()->DespawnOrUnsummon(2 * IN_MILLISECONDS); + GetCaster()->ToCreature()->DespawnOrUnsummon(2s); } void Register() override |
