Scripts/TotT: implement cosmetic event for Mindbender Ghur'sha's wing adds during the shock defense event

This commit is contained in:
Ovahlord
2019-01-21 18:31:39 +01:00
parent 071b63251a
commit e412d636be
3 changed files with 210 additions and 1 deletions

View File

@@ -65,6 +65,7 @@ enum Events
EVENT_BREAK_CORAL,
EVENT_MOVE_COMMANDER_ULTHOK_TO_HOME_POS,
EVENT_CHECK_DEAD_PLAYERS,
EVENT_SUMMON_GHURSHA_FLOOR_ADDS
};
Position const fallingRocksDummyPos = { -144.283f, 983.316f, 230.4773f };
@@ -117,6 +118,39 @@ class JumpThroughWindowEvent : public BasicEvent
Position const _jumpPos;
};
class DelayedPathEvent : public BasicEvent
{
public:
DelayedPathEvent(Creature* owner) : _owner(owner) { }
bool Execute(uint64 /*time*/, uint32 /*diff*/) override
{
_owner->GetMotionMaster()->MovePath(_owner->GetEntry() * 10 + 1, true);
return true;
}
private:
Creature* _owner;
};
class EmoteStateEvent : public BasicEvent
{
public:
EmoteStateEvent(Creature* owner) : _owner(owner) { }
bool Execute(uint64 /*time*/, uint32 /*diff*/) override
{
if (_owner->GetEntry() == NPC_GILGOBLIN_HUNTER)
_owner->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_HOLD_THROWN);
else
_owner->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2HL);
return true;
}
private:
Creature* _owner;
};
class instance_throne_of_the_tides : public InstanceMapScript
{
public:
@@ -350,6 +384,9 @@ class instance_throne_of_the_tides : public InstanceMapScript
if (GameObject* tentacle2 = GetGameObject(DATA_LEVIATHAN_TENTACLE_2))
tentacle2->DespawnOrUnsummon(15s);
events.ScheduleEvent(EVENT_SUMMON_GHURSHA_FLOOR_ADDS, 17s);
break;
case EVENT_INDEX_ULTHOK_ARRIVED:
if (Creature* ulthok = instance->SummonCreature(BOSS_COMMANDER_ULTHOK, commanderUlthokIntroPos))
@@ -447,6 +484,31 @@ class instance_throne_of_the_tides : public InstanceMapScript
}
break;
}
case EVENT_SUMMON_GHURSHA_FLOOR_ADDS:
for (uint8 i = 0; i < 6; i++)
{
if (Creature* hunter = instance->SummonCreature(NPC_GILGOBLIN_HUNTER, TotTGilgoblinHunterPositions[i]))
{
hunter->GetMotionMaster()->MovePath(hunter->GetEntry() * 10 + i, false);
hunter->m_Events.AddEventAtOffset(new EmoteStateEvent(hunter), 5s);
}
}
for (uint8 i = 0; i < 2; i++)
{
if (Creature* aquamage = instance->SummonCreature(NPC_GILGOBLIN_AQUAMAGE, TotTGilgoblinAquamagePositions[i]))
{
aquamage->GetMotionMaster()->MovePath(aquamage->GetEntry() * 10 + i, false);
aquamage->m_Events.AddEventAtOffset(new EmoteStateEvent(aquamage), 5s);
}
}
if (Creature* watcher = instance->SummonCreature(NPC_FACELESS_WATCHER, TotTFacelessWatcherPosition))
{
watcher->GetMotionMaster()->MovePath(watcher->GetEntry() * 10, false);
watcher->m_Events.AddEventAtOffset(new DelayedPathEvent(watcher), 16s);
}
break;
default:
break;
}

View File

@@ -91,7 +91,10 @@ enum TotTCreatureIds
NPC_LADY_NAZJAR = 39959,
// Generic Creatures
NPC_GEYSER_DUMMY = 48983
NPC_GEYSER_DUMMY = 48983,
NPC_GILGOBLIN_HUNTER = 40935,
NPC_FACELESS_WATCHER = 40936,
NPC_GILGOBLIN_AQUAMAGE = 40943
};
enum TotTGameObjectIds
@@ -204,6 +207,24 @@ Position const TotTLadyNazjarInvaderJumpPositions[] =
{ -101.955f, 806.373f, 796.964f, 3.071779f }
};
Position const TotTGilgoblinHunterPositions[] =
{
{ -296.0759f, 668.8297f, 280.8867f, 2.188809f },
{ -295.146f, 662.971f, 281.3593f, 2.202956f },
{ -291.068f, 665.408f, 281.9814f, 2.15424f },
{ -296.477f, 661.01f, 281.4153f, 2.23188f },
{ -297.7917f, 671.1694f, 280.5178f, 2.186387f },
{ -296.523f, 665.198f, 281.0583f, 2.25458f }
};
Position const TotTGilgoblinAquamagePositions[] =
{
{ -288.911f, 667.142f, 282.2543f, 2.14487f },
{ -297.938f, 659.363f, 281.7794f, 2.262644f }
};
Position const TotTFacelessWatcherPosition = { -292.3462f, 664.1631f, 281.7034f, 2.1634f };
template <class AI, class T>
inline AI* GetThroneOfTheTodesAI(T* obj)
{