mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 11:25:42 +00:00
fix(Scripts/Silithus): Wind Stone summons roleplay & despawn (#9899)
This commit is contained in:
@@ -1000,6 +1000,26 @@ enum WindStone
|
||||
SAY_ON_SPAWN_IN = 0
|
||||
};
|
||||
|
||||
class DelayedWindstoneSummonEvent : public BasicEvent
|
||||
{
|
||||
public:
|
||||
DelayedWindstoneSummonEvent(TempSummon* summon, ObjectGuid playerGUID) : _summon(summon), _playerGUID(playerGUID) { }
|
||||
|
||||
bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/) override
|
||||
{
|
||||
if (Player* player = ObjectAccessor::FindPlayer(_playerGUID))
|
||||
{
|
||||
_summon->AI()->AttackStart(player);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
TempSummon* _summon;
|
||||
ObjectGuid _playerGUID;
|
||||
};
|
||||
|
||||
class go_wind_stone : public GameObjectScript
|
||||
{
|
||||
public:
|
||||
@@ -1165,12 +1185,13 @@ public:
|
||||
return;
|
||||
}
|
||||
player->CastSpell(player, spellInfoTrigger->Id, false);
|
||||
if (TempSummon* summons = go->SummonCreature(npc, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), player->GetOrientation() - M_PI, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 10 * 60 * 1000))
|
||||
if (TempSummon* summons = go->SummonCreature(npc, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), player->GetOrientation() - M_PI, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 6000))
|
||||
{
|
||||
summons->CastSpell(summons, SPELL_SPAWN_IN, false);
|
||||
summons->SetTarget(player->GetGUID());
|
||||
summons->SetLootRecipient(player);
|
||||
summons->CastSpell(summons, SPELL_SPAWN_IN, false);
|
||||
summons->AI()->Talk(SAY_ON_SPAWN_IN, player);
|
||||
summons->AI()->AttackStart(player);
|
||||
summons->m_Events.AddEvent(new DelayedWindstoneSummonEvent(summons, player->GetGUID()), summons->m_Events.CalculateTime(5200));
|
||||
_creatureGuid = summons->GetGUID();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user