diff options
4 files changed, 161 insertions, 148 deletions
diff --git a/sql/updates/world/2013_01_07_17_world_creature_text.sql b/sql/updates/world/2013_01_07_17_world_creature_text.sql new file mode 100644 index 00000000000..137308da214 --- /dev/null +++ b/sql/updates/world/2013_01_07_17_world_creature_text.sql @@ -0,0 +1,4 @@ +-- Texts for Postmaster Malown +DELETE FROM `creature_text` WHERE `entry`= 11143; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(11143,0,0, 'You just got MALOWNED!',14,0,100,0,0,0, 'Postmaster Malown - Yell on Kill'); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp index 6445019e5c8..5b0b39c1de2 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp @@ -25,123 +25,109 @@ EndScriptData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "stratholme.h" //Spell ID to summon this guy is 24627 "Summon Postmaster Malown" //He should be spawned along with three other elites once the third postbox has been opened -#define SAY_MALOWNED "You just got MALOWNED!" +enum Says +{ + SAY_KILL = 0 +}; -#define SPELL_WAILINGDEAD 7713 -#define SPELL_BACKHAND 6253 -#define SPELL_CURSEOFWEAKNESS 8552 -#define SPELL_CURSEOFTONGUES 12889 -#define SPELL_CALLOFTHEGRAVE 17831 +enum Spells +{ + SPELL_WAILINGDEAD = 7713, + SPELL_BACKHAND = 6253, + SPELL_CURSEOFWEAKNESS = 8552, + SPELL_CURSEOFTONGUES = 12889, + SPELL_CALLOFTHEGRAVE = 17831 +}; + +enum Events +{ + EVENT_WAILINGDEAD = 1, + EVENT_BACKHAND = 2, + EVENT_CURSEOFWEAKNESS = 3, + EVENT_CURSEOFTONGUES = 4, + EVENT_CALLOFTHEGRAVE = 5 +}; class boss_postmaster_malown : public CreatureScript { -public: - boss_postmaster_malown() : CreatureScript("boss_postmaster_malown") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new boss_postmaster_malownAI (creature); - } - - struct boss_postmaster_malownAI : public ScriptedAI - { - boss_postmaster_malownAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 WailingDead_Timer; - uint32 Backhand_Timer; - uint32 CurseOfWeakness_Timer; - uint32 CurseOfTongues_Timer; - uint32 CallOfTheGrave_Timer; - bool HasYelled; - - void Reset() - { - WailingDead_Timer = 19000; //lasts 6 sec - Backhand_Timer = 8000; //2 sec stun - CurseOfWeakness_Timer = 20000; //lasts 2 mins - CurseOfTongues_Timer = 22000; - CallOfTheGrave_Timer = 25000; - HasYelled = false; - } + public: boss_postmaster_malown() : CreatureScript("boss_postmaster_malown") { } - void EnterCombat(Unit* /*who*/) + struct boss_postmaster_malownAI : public BossAI { - } + boss_postmaster_malownAI(Creature* creature) : BossAI(creature, TYPE_MALOWN) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; + void Reset() {} - //WailingDead - if (WailingDead_Timer <= diff) + void EnterCombat(Unit* /*who*/) { - //Cast - if (rand()%100 < 65) //65% chance to cast - { - DoCast(me->getVictim(), SPELL_WAILINGDEAD); - } - //19 seconds until we should cast this again - WailingDead_Timer = 19000; - } else WailingDead_Timer -= diff; - - //Backhand - if (Backhand_Timer <= diff) + events.ScheduleEvent(EVENT_WAILINGDEAD, 19000); // lasts 6 sec + events.ScheduleEvent(EVENT_BACKHAND, 8000); // 2 sec stun + events.ScheduleEvent(EVENT_CURSEOFWEAKNESS, 20000); // lasts 2 mins + events.ScheduleEvent(EVENT_CURSEOFTONGUES, 22000); + events.ScheduleEvent(EVENT_CALLOFTHEGRAVE, 25000); + } + + void KilledUnit(Unit* /*victim*/) { - //Cast - if (rand()%100 < 45) //45% chance to cast - { - DoCast(me->getVictim(), SPELL_BACKHAND); - } - //8 seconds until we should cast this again - Backhand_Timer = 8000; - } else Backhand_Timer -= diff; + Talk(SAY_KILL); + } - //CurseOfWeakness - if (CurseOfWeakness_Timer <= diff) + void UpdateAI(uint32 const diff) { - //Cast - if (rand()%100 < 3) //3% chance to cast - { - DoCast(me->getVictim(), SPELL_CURSEOFWEAKNESS); - } - //20 seconds until we should cast this again - CurseOfWeakness_Timer = 20000; - } else CurseOfWeakness_Timer -= diff; + if (!UpdateVictim()) + return; - //CurseOfTongues - if (CurseOfTongues_Timer <= diff) - { - //Cast - if (rand()%100 < 3) //3% chance to cast - { - DoCast(me->getVictim(), SPELL_CURSEOFTONGUES); - } - //22 seconds until we should cast this again - CurseOfTongues_Timer = 22000; - } else CurseOfTongues_Timer -= diff; + events.Update(diff); - //CallOfTheGrave - if (CallOfTheGrave_Timer <= diff) - { - //Cast - if (rand()%100 < 5) //5% chance to cast + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = events.ExecuteEvent()) { - DoCast(me->getVictim(), SPELL_CALLOFTHEGRAVE); + switch (eventId) + { + case EVENT_WAILINGDEAD: + if (rand()%100 < 65) //65% chance to cast + DoCastVictim(SPELL_WAILINGDEAD, true); + events.ScheduleEvent(EVENT_WAILINGDEAD, 19000); + break; + case EVENT_BACKHAND: + if (rand()%100 < 45) //45% chance to cast + DoCastVictim(SPELL_BACKHAND, true); + events.ScheduleEvent(EVENT_WAILINGDEAD, 8000); + break; + case EVENT_CURSEOFWEAKNESS: + if (rand()%100 < 3) //3% chance to cast + DoCastVictim(SPELL_CURSEOFWEAKNESS, true); + events.ScheduleEvent(EVENT_WAILINGDEAD, 20000); + break; + case EVENT_CURSEOFTONGUES: + if (rand()%100 < 3) //3% chance to cast + DoCastVictim(SPELL_CURSEOFTONGUES, true); + events.ScheduleEvent(EVENT_WAILINGDEAD, 22000); + break; + case EVENT_CALLOFTHEGRAVE: + if (rand()%100 < 5) //5% chance to cast + DoCastVictim(SPELL_CALLOFTHEGRAVE, true); + events.ScheduleEvent(EVENT_WAILINGDEAD, 25000); + break; + default: + break; + } } - //25 seconds until we should cast this again - CallOfTheGrave_Timer = 25000; - } else CallOfTheGrave_Timer -= diff; + DoMeleeAttackIfReady(); + } + }; - DoMeleeAttackIfReady(); + CreatureAI* GetAI(Creature* creature) const + { + return new boss_postmaster_malownAI(creature); } - }; - }; void AddSC_boss_postmaster_malown() diff --git a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp index 38613385161..c3244c63de6 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp @@ -29,33 +29,15 @@ EndScriptData */ #include "stratholme.h" #include "Player.h" -#define GO_SERVICE_ENTRANCE 175368 -#define GO_GAUNTLET_GATE1 175357 -#define GO_ZIGGURAT1 175380 //baroness -#define GO_ZIGGURAT2 175379 //nerub'enkan -#define GO_ZIGGURAT3 175381 //maleki -#define GO_ZIGGURAT4 175405 //rammstein -#define GO_ZIGGURAT5 175796 //baron -#define GO_PORT_GAUNTLET 175374 //port from gauntlet to slaugther -#define GO_PORT_SLAUGTHER 175373 //port at slaugther -#define GO_PORT_ELDERS 175377 //port at elders square - -#define C_CRYSTAL 10415 //three ziggurat crystals -#define C_BARON 10440 -#define C_YSIDA_TRIGGER 16100 - -#define C_RAMSTEIN 10439 -#define C_ABOM_BILE 10416 -#define C_ABOM_VENOM 10417 -#define C_BLACK_GUARD 10394 -#define C_YSIDA 16031 - -#define MAX_ENCOUNTER 6 +enum Misc +{ + MAX_ENCOUNTER = 6 +}; enum InstanceEvents { EVENT_BARON_RUN = 1, - EVENT_SLAUGHTER_SQUARE = 2, + EVENT_SLAUGHTER_SQUARE = 2 }; class instance_stratholme : public InstanceMapScript @@ -148,17 +130,17 @@ class instance_stratholme : public InstanceMapScript { switch (creature->GetEntry()) { - case C_BARON: + case NPC_BARON: baronGUID = creature->GetGUID(); break; - case C_YSIDA_TRIGGER: + case NPC_YSIDA_TRIGGER: ysidaTriggerGUID = creature->GetGUID(); break; - case C_CRYSTAL: + case NPC_CRYSTAL: crystalsGUID.insert(creature->GetGUID()); break; - case C_ABOM_BILE: - case C_ABOM_VENOM: + case NPC_ABOM_BILE: + case NPC_ABOM_VENOM: abomnationGUID.insert(creature->GetGUID()); break; } @@ -168,11 +150,11 @@ class instance_stratholme : public InstanceMapScript { switch (creature->GetEntry()) { - case C_CRYSTAL: + case NPC_CRYSTAL: crystalsGUID.erase(creature->GetGUID()); break; - case C_ABOM_BILE: - case C_ABOM_VENOM: + case NPC_ABOM_BILE: + case NPC_ABOM_VENOM: abomnationGUID.erase(creature->GetGUID()); break; } @@ -255,7 +237,7 @@ class instance_stratholme : public InstanceMapScript { Position ysidaPos; ysidaTrigger->GetPosition(&ysidaPos); - ysidaTrigger->SummonCreature(C_YSIDA, ysidaPos, TEMPSUMMON_TIMED_DESPAWN, 1800000); + ysidaTrigger->SummonCreature(NPC_YSIDA, ysidaPos, TEMPSUMMON_TIMED_DESPAWN, 1800000); } events.CancelEvent(EVENT_BARON_RUN); break; @@ -300,7 +282,7 @@ class instance_stratholme : public InstanceMapScript //a bit itchy, it should close the door after 10 secs, but it doesn't. skipping it for now. //UpdateGoState(ziggurat4GUID, 0, true); if (Creature* pBaron = instance->GetCreature(baronGUID)) - pBaron->SummonCreature(C_RAMSTEIN, 4032.84f, -3390.24f, 119.73f, 4.71f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 1800000); + pBaron->SummonCreature(NPC_RAMSTEIN, 4032.84f, -3390.24f, 119.73f, 4.71f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 1800000); sLog->outDebug(LOG_FILTER_TSCR, "Instance Stratholme: Ramstein spawned."); } else @@ -455,7 +437,7 @@ class instance_stratholme : public InstanceMapScript if (Creature* baron = instance->GetCreature(baronGUID)) { for (uint8 i = 0; i < 4; ++i) - baron->SummonCreature(C_BLACK_GUARD, 4032.84f, -3390.24f, 119.73f, 4.71f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 1800000); + baron->SummonCreature(NPC_BLACK_GUARD, 4032.84f, -3390.24f, 119.73f, 4.71f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 1800000); HandleGameObject(ziggurat4GUID, true); HandleGameObject(ziggurat5GUID, true); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.h b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.h index d141f94ddf0..fc7630d7403 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.h +++ b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.h @@ -19,24 +19,65 @@ #ifndef DEF_STRATHOLME_H #define DEF_STRATHOLME_H -#define TYPE_BARON_RUN 1 -#define TYPE_BARONESS 2 -#define TYPE_NERUB 3 -#define TYPE_PALLID 4 -#define TYPE_RAMSTEIN 5 -#define TYPE_BARON 6 - -#define DATA_BARON 10 -#define DATA_YSIDA_TRIGGER 11 - -#define TYPE_SH_QUEST 20 -#define TYPE_SH_CATHELA 21 -#define TYPE_SH_GREGOR 22 -#define TYPE_SH_NEMAS 23 -#define TYPE_SH_VICAR 24 -#define TYPE_SH_AELMAR 25 - -#define QUEST_DEAD_MAN_PLEA 8945 -#define SPELL_BARON_ULTIMATUM 27861 +enum DataTypes +{ + TYPE_BARON_RUN = 1, + TYPE_BARONESS = 2, + TYPE_NERUB = 3, + TYPE_PALLID = 4, + TYPE_RAMSTEIN = 5, + TYPE_BARON = 6, + + TYPE_MALOWN = 7, + + DATA_BARON = 10, + DATA_YSIDA_TRIGGER = 11, + + TYPE_SH_QUEST = 20, + TYPE_SH_CATHELA = 21, + TYPE_SH_GREGOR = 22, + TYPE_SH_NEMAS = 23, + TYPE_SH_VICAR = 24, + TYPE_SH_AELMAR = 25 +}; + +enum CreatureIds +{ + NPC_CRYSTAL = 10415, // ziggurat crystal + NPC_BARON = 10440, // ziggurat crystal + NPC_YSIDA_TRIGGER = 16100, // ziggurat crystal + + NPC_RAMSTEIN = 10439, + NPC_ABOM_BILE = 10416, + NPC_ABOM_VENOM = 10417, + NPC_BLACK_GUARD = 10394, + NPC_YSIDA = 16031, +}; + +enum GameobjectIds +{ + GO_DOOR_HALAZZI = 186303, + GO_SERVICE_ENTRANCE = 175368, + GO_GAUNTLET_GATE1 = 175357, + GO_ZIGGURAT1 = 175380, // baroness + GO_ZIGGURAT2 = 175379, // nerub'enkan + GO_ZIGGURAT3 = 175381, // maleki + GO_ZIGGURAT4 = 175405, // rammstein + GO_ZIGGURAT5 = 175796, // baron + GO_PORT_GAUNTLET = 175374, // port from gauntlet to slaugther + GO_PORT_SLAUGTHER = 175373, // port at slaugther + GO_PORT_ELDERS = 175377 // port at elders square +}; + +enum QuestIds +{ + QUEST_DEAD_MAN_PLEA = 8945 +}; + +enum SpellIds +{ + SPELL_BARON_ULTIMATUM = 27861 +}; + #endif |