fix(Core/Scripts) Add respawn timer to wind stones (#9392)

This commit is contained in:
Malcrom
2021-12-05 07:33:08 -04:00
committed by GitHub
parent 6b6e90d43d
commit 92d6463930
@@ -1010,6 +1010,11 @@ public:
{ {
go_wind_stoneAI(GameObject* go) : GameObjectAI(go) {} go_wind_stoneAI(GameObject* go) : GameObjectAI(go) {}
void InitializeAI() override
{
me->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
}
bool GossipHello(Player* player, bool reportUse) override bool GossipHello(Player* player, bool reportUse) override
{ {
if (reportUse) if (reportUse)
@@ -1048,10 +1053,13 @@ public:
bool GossipSelect(Player* player, uint32 sender, uint32 action) override bool GossipSelect(Player* player, uint32 sender, uint32 action) override
{ {
Seconds respawnTimer = 0s;
player->PlayerTalkClass->SendCloseGossip(); player->PlayerTalkClass->SendCloseGossip();
if (sender == GOSSIPID_LESSER_WS) if (sender == GOSSIPID_LESSER_WS)
{ {
respawnTimer = 300s; // Lesser Windstone respawn in 5 minutes
switch (action) switch (action)
{ {
case 0: case 0:
@@ -1075,6 +1083,8 @@ public:
} }
else if (sender == GOSSIPID_WS) else if (sender == GOSSIPID_WS)
{ {
respawnTimer = 900s; // Windstone respawn in 15 minutes
switch (action) switch (action)
{ {
case 0: case 0:
@@ -1098,6 +1108,8 @@ public:
} }
else if (sender == GOSSIPID_GREATER_WS) else if (sender == GOSSIPID_GREATER_WS)
{ {
respawnTimer = 10800s; // Greater Windstone respawn in 3 hours
switch (action) switch (action)
{ {
case 0: case 0:
@@ -1119,6 +1131,10 @@ public:
break; break;
} }
} }
me->DespawnOrUnsummon(5000ms, respawnTimer); // Despawn in 5 Seconds for respawnTimer value
me->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
CloseGossipMenuFor(player);
return false; return false;
} }