fix(Scripts/Silithus): Wind Stone summons roleplay & despawn (#9899)
This commit is contained in:
@@ -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
|
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
|
class go_wind_stone : public GameObjectScript
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -1165,12 +1185,13 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
player->CastSpell(player, spellInfoTrigger->Id, false);
|
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->SetTarget(player->GetGUID());
|
||||||
|
summons->SetLootRecipient(player);
|
||||||
|
summons->CastSpell(summons, SPELL_SPAWN_IN, false);
|
||||||
summons->AI()->Talk(SAY_ON_SPAWN_IN, player);
|
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();
|
_creatureGuid = summons->GetGUID();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user