aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSubv <s.v.h21@hotmail.com>2012-12-26 12:46:34 -0500
committerSubv <s.v.h21@hotmail.com>2012-12-26 12:48:10 -0500
commit05a7b3aaea1b6299cb8af0d4fb51028e56742ffe (patch)
treef672905942451e72d9b9b848ce0b6093b7d361fc /src
parente873a22a379547c52c0e759ed333f134062164b9 (diff)
Scripts/HoO: Implemented the weather effect while on Earthrager Ptah's sandstorm.
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Weather/Weather.h1
-rw-r--r--src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp23
-rw-r--r--src/server/scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h5
3 files changed, 29 insertions, 0 deletions
diff --git a/src/server/game/Weather/Weather.h b/src/server/game/Weather/Weather.h
index 59bff95d7ea..be3aa1f58a7 100644
--- a/src/server/game/Weather/Weather.h
+++ b/src/server/game/Weather/Weather.h
@@ -46,6 +46,7 @@ struct WeatherData
enum WeatherState
{
WEATHER_STATE_FINE = 0,
+ WEATHER_STATE_UNK = 1, // Used in some instance encounters.
WEATHER_STATE_LIGHT_RAIN = 3,
WEATHER_STATE_MEDIUM_RAIN = 4,
WEATHER_STATE_HEAVY_RAIN = 5,
diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp
index 19c27d49a79..63ee95cb3de 100644
--- a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp
+++ b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp
@@ -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);
diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h b/src/server/scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h
index f1316c5db3c..8bdd4a16c9e 100644
--- a/src/server/scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h
+++ b/src/server/scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h
@@ -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)
{