diff options
| author | Carbenium <carbenium@outlook.com> | 2020-07-26 00:54:23 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2022-01-23 23:58:48 +0100 |
| commit | 38695b0943cb7208d87968bc14ac50aac712c5f8 (patch) | |
| tree | 0ac53452ace349bc16cc5b92d9a87e3d450aa50a /src/server/scripts/Spells | |
| parent | 271462ceec0cec215211e05ab4341b0adc7f39dd (diff) | |
Scripts/World+Outland+Spells: Use std::chrono overload of Creature::DespawnOrUnsummon
(cherry picked from commit 5832790428b124876ba48eacaf47806fd10a3c47)
Diffstat (limited to 'src/server/scripts/Spells')
| -rw-r--r-- | src/server/scripts/Spells/spell_quest.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 7c6d7276343..98f04cc7b45 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); } } @@ -209,9 +209,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: @@ -247,7 +248,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); } } @@ -961,7 +962,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); } } @@ -1005,7 +1006,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); } } @@ -2234,7 +2235,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 |
