fix(Scripts/Silithus): Wind Stone summons roleplay & despawn (#9899)
This commit is contained in:
parent
a54c84f349
commit
3412c3e219
2 changed files with 28 additions and 3 deletions
|
|
@ -0,0 +1,4 @@
|
|||
INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1640694155370414400');
|
||||
|
||||
-- High Marshal Whirlaxis unit flags: UNK_6 & IMMUNE_TO_PC
|
||||
UPDATE `acore_world`.`creature_template` SET `unit_flags`='320' WHERE `entry` = 15204;
|
||||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue