Scripts/HoO: Implemented the weather effect while on Earthrager Ptah's sandstorm.
This commit is contained in:
1 parent
e873a22a37
commit
05a7b3aaea
3 files changed
+29
No files matched your search
@@ -21,6 +21,7 @@
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "Player.h"
|
||||
#include "Weather.h"
|
||||
#include "halls_of_origination.h"
|
||||
|
||||
enum Texts
|
||||
@@ -127,6 +128,26 @@ public:
|
||||
(*itr)->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void SendWeather(WeatherState weather, float grade) const
|
||||
{
|
||||
WorldPacket data(SMSG_WEATHER, 9);
|
||||
data << uint32(weather);
|
||||
data << float(grade);
|
||||
data << uint8(0);
|
||||
SendPacketToPlayers(&data);
|
||||
}
|
||||
|
||||
// Send packet to all players in Tomb of the Earthrager
|
||||
void SendPacketToPlayers(WorldPacket const* data) const
|
||||
{
|
||||
Map::PlayerList const& players = me->GetMap()->GetPlayers();
|
||||
if (!players.isEmpty())
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
if (Player* player = itr->getSource())
|
||||
if (player->GetAreaId() == AREA_TOMB_OF_THE_EARTHRAGER)
|
||||
player->GetSession()->SendPacket(data);
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_summonDeaths = 0;
|
||||
@@ -148,6 +169,7 @@ public:
|
||||
|
||||
me->AttackStop();
|
||||
DoCast(me, SPELL_SANDSTORM);
|
||||
SendWeather(WEATHER_STATE_LIGHT_SANDSTORM, 1.0f);
|
||||
events.ScheduleEvent(EVENT_PTAH_EXPLODE, 6000, 0, PHASE_DISPERSE);
|
||||
events.ScheduleEvent(EVENT_QUICKSAND, 10000, 0, PHASE_DISPERSE);
|
||||
|
||||
@@ -179,6 +201,7 @@ public:
|
||||
++_summonDeaths;
|
||||
if (_summonDeaths == 11) // All summons died
|
||||
{
|
||||
SendWeather(WEATHER_STATE_UNK, 0.0f);
|
||||
me->RemoveAurasDueToSpell(SPELL_PTAH_EXPLOSION);
|
||||
events.SetPhase(PHASE_NORMAL);
|
||||
events.ScheduleEvent(EVENT_RAGING_SMASH, urand(7000, 12000), 0, PHASE_NORMAL);
|
||||
|
||||
@@ -63,6 +63,11 @@ enum GameObjects
|
||||
GO_ANHUURS_LEFT_BEACON = 203133,
|
||||
};
|
||||
|
||||
enum AreaIds
|
||||
{
|
||||
AREA_TOMB_OF_THE_EARTHRAGER = 5610,
|
||||
};
|
||||
|
||||
template<class AI>
|
||||
CreatureAI* GetHallsOfOriginationAI(Creature* creature)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user