Scripts/World+Outland+Spells: Use std::chrono overload of Creature::DespawnOrUnsummon
(cherry picked from commit 5832790428b124876ba48eacaf47806fd10a3c47)
This commit is contained in:
@@ -120,7 +120,7 @@ public:
|
||||
return;
|
||||
|
||||
if (id == 0)
|
||||
me->DespawnOrUnsummon(1);
|
||||
me->DespawnOrUnsummon(1ms);
|
||||
}
|
||||
|
||||
void SpellHit(WorldObject* caster, SpellInfo const* spellInfo) override
|
||||
@@ -612,7 +612,7 @@ class npc_simon_bunny : public CreatureScript
|
||||
if (GameObject* relic = me->FindNearestGameObject(large ? GO_APEXIS_MONUMENT : GO_APEXIS_RELIC, searchDistance))
|
||||
relic->RemoveFlag(GO_FLAG_NOT_SELECTABLE);
|
||||
|
||||
me->DespawnOrUnsummon(1000);
|
||||
me->DespawnOrUnsummon(1s);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -947,7 +947,7 @@ public:
|
||||
// Spell 37392 does not exist in dbc, manually spawning
|
||||
me->SummonCreature(NPC_OSCILLATING_FREQUENCY_SCANNER_TOP_BUNNY, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 0.5f, me->GetOrientation(), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 50000);
|
||||
me->SummonGameObject(GO_OSCILLATING_FREQUENCY_SCANNER, *me, QuaternionData::fromEulerAnglesZYX(me->GetOrientation(), 0.0f, 0.0f), 50);
|
||||
me->DespawnOrUnsummon(50000);
|
||||
me->DespawnOrUnsummon(50s);
|
||||
}
|
||||
|
||||
timer = 500;
|
||||
|
||||
@@ -422,7 +422,7 @@ public:
|
||||
PlayerGUID.Clear();
|
||||
}
|
||||
|
||||
me->DespawnOrUnsummon(1);
|
||||
me->DespawnOrUnsummon(1ms);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -441,7 +441,7 @@ class npc_spirit_shade : public CreatureScript
|
||||
if (moveType == FOLLOW_MOTION_TYPE && data == _summonerGuid.GetCounter())
|
||||
{
|
||||
me->CastSpell(nullptr, SPELL_DARK_OFFERING, false);
|
||||
me->DespawnOrUnsummon(1000);
|
||||
me->DespawnOrUnsummon(1s);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -840,7 +840,7 @@ class go_veil_skith_cage : public GameObjectScript
|
||||
for (Creature* creature : childrenList)
|
||||
{
|
||||
player->KilledMonsterCredit(NPC_CAPTIVE_CHILD, creature->GetGUID());
|
||||
creature->DespawnOrUnsummon(5000);
|
||||
creature->DespawnOrUnsummon(5s);
|
||||
creature->GetMotionMaster()->MovePoint(1, me->GetPositionX() + 5, me->GetPositionY(), me->GetPositionZ());
|
||||
creature->AI()->Talk(SAY_FREE_0);
|
||||
creature->GetMotionMaster()->Clear();
|
||||
|
||||
@@ -2231,7 +2231,7 @@ class npc_train_wrecker : public CreatureScript
|
||||
if (GameObject* target = ObjectAccessor::GetGameObject(*me, _target))
|
||||
return target;
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_RUDE);
|
||||
me->DespawnOrUnsummon(3 * IN_MILLISECONDS);
|
||||
me->DespawnOrUnsummon(3s);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -2298,7 +2298,7 @@ class npc_train_wrecker : public CreatureScript
|
||||
}
|
||||
me->UpdateEntry(NPC_EXULTING_WIND_UP_TRAIN_WRECKER);
|
||||
me->SetEmoteState(EMOTE_ONESHOT_DANCE);
|
||||
me->DespawnOrUnsummon(5 * IN_MILLISECONDS);
|
||||
me->DespawnOrUnsummon(5s);
|
||||
_nextAction = 0;
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user