mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Scripting: Update Script for Postmaster Malown
This commit is contained in:
4
sql/updates/world/2013_01_07_17_world_creature_text.sql
Normal file
4
sql/updates/world/2013_01_07_17_world_creature_text.sql
Normal file
@@ -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');
|
||||
@@ -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") { }
|
||||
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()
|
||||
struct boss_postmaster_malownAI : public BossAI
|
||||
{
|
||||
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;
|
||||
}
|
||||
boss_postmaster_malownAI(Creature* creature) : BossAI(creature, TYPE_MALOWN) {}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
void Reset() {}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
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*/)
|
||||
{
|
||||
Talk(SAY_KILL);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 const diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_postmaster_malownAI(creature);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//WailingDead
|
||||
if (WailingDead_Timer <= diff)
|
||||
{
|
||||
//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)
|
||||
{
|
||||
//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;
|
||||
|
||||
//CurseOfWeakness
|
||||
if (CurseOfWeakness_Timer <= 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;
|
||||
|
||||
//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;
|
||||
|
||||
//CallOfTheGrave
|
||||
if (CallOfTheGrave_Timer <= diff)
|
||||
{
|
||||
//Cast
|
||||
if (rand()%100 < 5) //5% chance to cast
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CALLOFTHEGRAVE);
|
||||
}
|
||||
//25 seconds until we should cast this again
|
||||
CallOfTheGrave_Timer = 25000;
|
||||
} else CallOfTheGrave_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_boss_postmaster_malown()
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
enum DataTypes
|
||||
{
|
||||
TYPE_BARON_RUN = 1,
|
||||
TYPE_BARONESS = 2,
|
||||
TYPE_NERUB = 3,
|
||||
TYPE_PALLID = 4,
|
||||
TYPE_RAMSTEIN = 5,
|
||||
TYPE_BARON = 6,
|
||||
|
||||
#define DATA_BARON 10
|
||||
#define DATA_YSIDA_TRIGGER 11
|
||||
TYPE_MALOWN = 7,
|
||||
|
||||
#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
|
||||
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
|
||||
};
|
||||
|
||||
#define QUEST_DEAD_MAN_PLEA 8945
|
||||
#define SPELL_BARON_ULTIMATUM 27861
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user