aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Commands/cs_bf.cpp16
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp40
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp9
-rw-r--r--src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp4
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp53
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp1
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp93
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h65
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/ulduar_teleporter.cpp2
-rw-r--r--src/server/scripts/Outland/zone_netherstorm.cpp1
-rw-r--r--src/server/scripts/Pet/CMakeLists.txt1
-rw-r--r--src/server/scripts/Pet/pet_generic.cpp91
-rw-r--r--src/server/scripts/Spells/spell_quest.cpp74
-rw-r--r--src/server/scripts/World/npcs_special.cpp129
14 files changed, 325 insertions, 254 deletions
diff --git a/src/server/scripts/Commands/cs_bf.cpp b/src/server/scripts/Commands/cs_bf.cpp
index 5ab94062a85..0b239219ddd 100644
--- a/src/server/scripts/Commands/cs_bf.cpp
+++ b/src/server/scripts/Commands/cs_bf.cpp
@@ -35,17 +35,17 @@ public:
{
static ChatCommand battlefieldcommandTable[] =
{
- { "start", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleBattlefieldStart, "", NULL },
- { "stop", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleBattlefieldEnd, "", NULL },
- { "switch", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleBattlefieldSwitch, "", NULL },
- { "timer", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleBattlefieldTimer, "", NULL },
- { "enable", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleBattlefieldEnable, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
+ { "start", RBAC_PERM_COMMAND_BF_START, false, &HandleBattlefieldStart, "", NULL },
+ { "stop", RBAC_PERM_COMMAND_BF_STOP, false, &HandleBattlefieldEnd, "", NULL },
+ { "switch", RBAC_PERM_COMMAND_BF_SWITCH, false, &HandleBattlefieldSwitch, "", NULL },
+ { "timer", RBAC_PERM_COMMAND_BF_TIMER, false, &HandleBattlefieldTimer, "", NULL },
+ { "enable", RBAC_PERM_COMMAND_BF_ENABLE, false, &HandleBattlefieldEnable, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
};
static ChatCommand commandTable[] =
{
- { "bf", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, NULL, "", battlefieldcommandTable },
- { NULL, 0, false, NULL, "", NULL }
+ { "bf", RBAC_PERM_COMMAND_BF, false, NULL, "", battlefieldcommandTable },
+ { NULL, 0, false, NULL, "", NULL }
};
return commandTable;
}
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp
index 473fe000939..780f781f58d 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp
@@ -73,14 +73,12 @@ enum Spells
SPELL_SHIELDWALL = 29390
};
-#define POS_Z 81.73f
-
-float Locations[4][3]=
+Position const Locations[4] =
{
- {-10991.0f, -1884.33f, 0.614315f},
- {-10989.4f, -1885.88f, 0.904913f},
- {-10978.1f, -1887.07f, 2.035550f},
- {-10975.9f, -1885.81f, 2.253890f},
+ {-10991.0f, -1884.33f, 81.73f, 0.614315f},
+ {-10989.4f, -1885.88f, 81.73f, 0.904913f},
+ {-10978.1f, -1887.07f, 81.73f, 2.035550f},
+ {-10975.9f, -1885.81f, 81.73f, 2.253890f},
};
const uint32 Adds[6]=
@@ -137,7 +135,7 @@ public:
Enrage = false;
InVanish = false;
- if (me->GetHealth())
+ if (me->IsAlive())
SpawnAdds();
if (instance)
@@ -183,39 +181,34 @@ public:
void SpawnAdds()
{
DeSpawnAdds();
+
if (isAddlistEmpty())
{
- Creature* creature = NULL;
- std::vector<uint32> AddList;
+ std::list<uint32> AddList;
for (uint8 i = 0; i < 6; ++i)
AddList.push_back(Adds[i]);
- while (AddList.size() > 4)
- AddList.erase((AddList.begin())+(rand()%AddList.size()));
+ Trinity::Containers::RandomResizeList(AddList, 4);
uint8 i = 0;
- for (std::vector<uint32>::const_iterator itr = AddList.begin(); itr != AddList.end(); ++itr)
+ for (std::list<uint32>::const_iterator itr = AddList.begin(); itr != AddList.end() && i < 4; ++itr, ++i)
{
uint32 entry = *itr;
- creature = me->SummonCreature(entry, Locations[i][0], Locations[i][1], POS_Z, Locations[i][2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
- if (creature)
+ if (Creature* creature = me->SummonCreature(entry, Locations[i], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000))
{
AddGUID[i] = creature->GetGUID();
AddId[i] = entry;
}
- ++i;
}
- }else
+ }
+ else
{
for (uint8 i = 0; i < 4; ++i)
{
- Creature* creature = me->SummonCreature(AddId[i], Locations[i][0], Locations[i][1], POS_Z, Locations[i][2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
- if (creature)
- {
+ if (Creature* creature = me->SummonCreature(AddId[i], Locations[i], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000))
AddGUID[i] = creature->GetGUID();
- }
}
}
}
@@ -235,9 +228,8 @@ public:
{
if (AddGUID[i])
{
- Creature* temp = Creature::GetCreature((*me), AddGUID[i]);
- if (temp && temp->IsAlive())
- temp->DisappearAndDie();
+ if (Creature* temp = ObjectAccessor::GetCreature(*me, AddGUID[i]))
+ temp->DespawnOrUnsummon();
}
}
}
diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp
index b1ecdc5904e..7d923e7686f 100644
--- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp
@@ -403,21 +403,19 @@ class spell_devourer_of_souls_mirrored_soul_proc : public SpellScriptLoader
bool Load() OVERRIDE
{
- _procTarget = NULL;
return true;
}
bool CheckProc(ProcEventInfo& /*eventInfo*/)
{
- _procTarget = GetCaster();
- return _procTarget && _procTarget->IsAlive();
+ return GetCaster() && GetCaster()->IsAlive();
}
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
int32 damage = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), 45));
- GetTarget()->CastCustomSpell(SPELL_MIRRORED_SOUL_DAMAGE, SPELLVALUE_BASE_POINT0, damage, _procTarget, true);
+ GetTarget()->CastCustomSpell(SPELL_MIRRORED_SOUL_DAMAGE, SPELLVALUE_BASE_POINT0, damage, GetCaster(), true);
}
void Register() OVERRIDE
@@ -425,9 +423,6 @@ class spell_devourer_of_souls_mirrored_soul_proc : public SpellScriptLoader
DoCheckProc += AuraCheckProcFn(spell_devourer_of_souls_mirrored_soul_proc_AuraScript::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_devourer_of_souls_mirrored_soul_proc_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
-
- private:
- Unit* _procTarget;
};
AuraScript* GetAuraScript() const OVERRIDE
diff --git a/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp b/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp
index afd0e8a4342..0097fe8c4d7 100644
--- a/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp
+++ b/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp
@@ -256,8 +256,6 @@ public:
}
} else uiGripOfSladRanTimer -= diff;
}
-
- InstanceScript* instance;
};
};
@@ -278,8 +276,6 @@ public:
uint32 uiVenomousBiteTimer;
- InstanceScript* instance;
-
void Reset() OVERRIDE
{
uiVenomousBiteTimer = 2*IN_MILLISECONDS;
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp
index 38864effe9f..46776ae9b96 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp
@@ -39,7 +39,7 @@ enum VezaxEmotes
EMOTE_SURGE_OF_DARKNESS = 8,
// Saronite Vapor
- EMOTE_VAPORS = 9
+ EMOTE_VAPORS = 0
};
enum VezaxSpells
@@ -443,14 +443,21 @@ class npc_saronite_vapors : public CreatureScript
}
};
-class spell_mark_of_the_faceless : public SpellScriptLoader
+class spell_general_vezax_mark_of_the_faceless : public SpellScriptLoader
{
public:
- spell_mark_of_the_faceless() : SpellScriptLoader("spell_mark_of_the_faceless") { }
+ spell_general_vezax_mark_of_the_faceless() : SpellScriptLoader("spell_general_vezax_mark_of_the_faceless") { }
- class spell_mark_of_the_faceless_AuraScript : public AuraScript
+ class spell_general_vezax_mark_of_the_faceless_AuraScript : public AuraScript
{
- PrepareAuraScript(spell_mark_of_the_faceless_AuraScript);
+ PrepareAuraScript(spell_general_vezax_mark_of_the_faceless_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_MARK_OF_THE_FACELESS_DAMAGE))
+ return false;
+ return true;
+ }
void HandleEffectPeriodic(AuraEffect const* aurEff)
{
@@ -460,13 +467,42 @@ class spell_mark_of_the_faceless : public SpellScriptLoader
void Register() OVERRIDE
{
- OnEffectPeriodic += AuraEffectPeriodicFn(spell_mark_of_the_faceless_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_general_vezax_mark_of_the_faceless_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
}
};
AuraScript* GetAuraScript() const OVERRIDE
{
- return new spell_mark_of_the_faceless_AuraScript();
+ return new spell_general_vezax_mark_of_the_faceless_AuraScript();
+ }
+};
+
+class spell_general_vezax_mark_of_the_faceless_leech : public SpellScriptLoader
+{
+ public:
+ spell_general_vezax_mark_of_the_faceless_leech() : SpellScriptLoader("spell_general_vezax_mark_of_the_faceless_leech") { }
+
+ class spell_general_vezax_mark_of_the_faceless_leech_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_general_vezax_mark_of_the_faceless_leech_SpellScript);
+
+ void FilterTargets(std::list<WorldObject*>& targets)
+ {
+ targets.remove(GetExplTargetWorldObject());
+
+ if (targets.empty())
+ FinishCast(SPELL_FAILED_NO_VALID_TARGETS);
+ }
+
+ void Register()
+ {
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_general_vezax_mark_of_the_faceless_leech_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_DEST_AREA_ENEMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_general_vezax_mark_of_the_faceless_leech_SpellScript();
}
};
@@ -554,7 +590,8 @@ void AddSC_boss_general_vezax()
new boss_general_vezax();
new boss_saronite_animus();
new npc_saronite_vapors();
- new spell_mark_of_the_faceless();
+ new spell_general_vezax_mark_of_the_faceless();
+ new spell_general_vezax_mark_of_the_faceless_leech();
new spell_general_vezax_saronite_vapors();
new achievement_shadowdodger();
new achievement_smell_saronite();
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp
index 56fd4b310ee..6783d8cd428 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp
@@ -16,6 +16,7 @@
*/
#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "SpellScript.h"
#include "ulduar.h"
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp
index 8691f9769fa..d0cb7108c09 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp
@@ -24,15 +24,21 @@
static DoorData const doorData[] =
{
- {GO_LEVIATHAN_DOOR, BOSS_LEVIATHAN, DOOR_TYPE_ROOM, BOUNDARY_S },
- {GO_XT_002_DOOR, BOSS_XT002, DOOR_TYPE_ROOM, BOUNDARY_S },
- {GO_YOGG_SARON_DOOR, BOSS_YOGG_SARON, DOOR_TYPE_ROOM, BOUNDARY_S },
- {GO_DOODAD_UL_SIGILDOOR_03, BOSS_ALGALON, DOOR_TYPE_ROOM, BOUNDARY_W },
- {GO_DOODAD_UL_UNIVERSEFLOOR_01, BOSS_ALGALON, DOOR_TYPE_ROOM, BOUNDARY_NONE },
- {GO_DOODAD_UL_UNIVERSEFLOOR_02, BOSS_ALGALON, DOOR_TYPE_SPAWN_HOLE, BOUNDARY_NONE },
- {GO_DOODAD_UL_UNIVERSEGLOBE01, BOSS_ALGALON, DOOR_TYPE_SPAWN_HOLE, BOUNDARY_NONE },
- {GO_DOODAD_UL_ULDUAR_TRAPDOOR_03, BOSS_ALGALON, DOOR_TYPE_SPAWN_HOLE, BOUNDARY_NONE },
- {0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE },
+ { GO_LEVIATHAN_DOOR, BOSS_LEVIATHAN, DOOR_TYPE_ROOM, BOUNDARY_S },
+ { GO_XT_002_DOOR, BOSS_XT002, DOOR_TYPE_ROOM, BOUNDARY_S },
+ { GO_IRON_COUNCIL_DOOR, BOSS_ASSEMBLY_OF_IRON, DOOR_TYPE_ROOM, BOUNDARY_N },
+ { GO_ARCHIVUM_DOOR, BOSS_ASSEMBLY_OF_IRON, DOOR_TYPE_PASSAGE, BOUNDARY_S },
+ { GO_HODIR_ENTRANCE, BOSS_HODIR, DOOR_TYPE_ROOM, BOUNDARY_E },
+ { GO_HODIR_DOOR, BOSS_HODIR, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
+ { GO_HODIR_ICE_DOOR, BOSS_HODIR, DOOR_TYPE_PASSAGE, BOUNDARY_W },
+ { GO_VEZAX_DOOR, BOSS_VEZAX, DOOR_TYPE_PASSAGE, BOUNDARY_E },
+ { GO_YOGG_SARON_DOOR, BOSS_YOGG_SARON, DOOR_TYPE_ROOM, BOUNDARY_S },
+ { GO_DOODAD_UL_SIGILDOOR_03, BOSS_ALGALON, DOOR_TYPE_ROOM, BOUNDARY_W },
+ { GO_DOODAD_UL_UNIVERSEFLOOR_01, BOSS_ALGALON, DOOR_TYPE_ROOM, BOUNDARY_NONE },
+ { GO_DOODAD_UL_UNIVERSEFLOOR_02, BOSS_ALGALON, DOOR_TYPE_SPAWN_HOLE, BOUNDARY_NONE },
+ { GO_DOODAD_UL_UNIVERSEGLOBE01, BOSS_ALGALON, DOOR_TYPE_SPAWN_HOLE, BOUNDARY_NONE },
+ { GO_DOODAD_UL_ULDUAR_TRAPDOOR_03, BOSS_ALGALON, DOOR_TYPE_SPAWN_HOLE, BOUNDARY_NONE },
+ { 0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE },
};
MinionData const minionData[] =
@@ -46,7 +52,7 @@ MinionData const minionData[] =
class instance_ulduar : public InstanceMapScript
{
public:
- instance_ulduar() : InstanceMapScript("instance_ulduar", 603) { }
+ instance_ulduar() : InstanceMapScript(UlduarScriptName, 603) { }
struct instance_ulduar_InstanceMapScript : public InstanceScript
{
@@ -73,6 +79,7 @@ class instance_ulduar : public InstanceMapScript
uint64 VoiceOfYoggSaronGUID;
uint64 SaraGUID;
uint64 BrainOfYoggSaronGUID;
+ uint64 KeeperGUIDs[4];
uint64 AlgalonGUID;
uint64 BrannBronzebeardAlgGUID;
@@ -81,16 +88,10 @@ class instance_ulduar : public InstanceMapScript
uint64 RazorHarpoonGUIDs[4];
uint64 KologarnChestGUID;
uint64 KologarnBridgeGUID;
- uint64 KologarnDoorGUID;
uint64 ThorimChestGUID;
uint64 HodirRareCacheGUID;
uint64 HodirChestGUID;
- uint64 HodirDoorGUID;
- uint64 HodirIceDoorGUID;
- uint64 ArchivumDoorGUID;
- uint64 VezaxDoorGUID;
uint64 BrainRoomDoorGUIDs[3];
- uint64 KeeperGUIDs[4];
uint64 AlgalonSigilDoorGUID[3];
uint64 AlgalonFloorGUID[2];
uint64 AlgalonUniverseGUID;
@@ -138,10 +139,6 @@ class instance_ulduar : public InstanceMapScript
HodirRareCacheGUID = 0;
HodirChestGUID = 0;
LeviathanGateGUID = 0;
- VezaxDoorGUID = 0;
- HodirDoorGUID = 0;
- HodirIceDoorGUID = 0;
- ArchivumDoorGUID = 0;
AlgalonUniverseGUID = 0;
AlgalonTrapdoorGUID = 0;
BrannBronzebeardAlgGUID = 0;
@@ -458,9 +455,6 @@ class instance_ulduar : public InstanceMapScript
if (GetBossState(BOSS_KOLOGARN) == DONE)
HandleGameObject(0, false, gameObject);
break;
- case GO_KOLOGARN_DOOR:
- KologarnDoorGUID = gameObject->GetGUID();
- break;
case GO_THORIM_CHEST_HERO:
case GO_THORIM_CHEST:
ThorimChestGUID = gameObject->GetGUID();
@@ -473,20 +467,21 @@ class instance_ulduar : public InstanceMapScript
case GO_HODIR_CHEST:
HodirChestGUID = gameObject->GetGUID();
break;
- case GO_LEVIATHAN_DOOR:
- AddDoor(gameObject, true);
- break;
case GO_LEVIATHAN_GATE:
LeviathanGateGUID = gameObject->GetGUID();
if (GetBossState(BOSS_LEVIATHAN) == DONE)
gameObject->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE);
break;
+ case GO_LEVIATHAN_DOOR:
case GO_XT_002_DOOR:
- AddDoor(gameObject, true);
- break;
+ case GO_IRON_COUNCIL_DOOR:
+ case GO_ARCHIVUM_DOOR:
+ case GO_HODIR_ENTRANCE:
+ case GO_HODIR_DOOR:
+ case GO_HODIR_ICE_DOOR:
case GO_VEZAX_DOOR:
- VezaxDoorGUID = gameObject->GetGUID();
- HandleGameObject(0, false, gameObject);
+ case GO_YOGG_SARON_DOOR:
+ AddDoor(gameObject, true);
break;
case GO_RAZOR_HARPOON_1:
RazorHarpoonGUIDs[0] = gameObject->GetGUID();
@@ -504,20 +499,6 @@ class instance_ulduar : public InstanceMapScript
if (GetBossState(BOSS_RAZORSCALE) == IN_PROGRESS)
gameObject->SetGoState(GO_STATE_ACTIVE);
break;
- case GO_HODIR_DOOR:
- HodirDoorGUID = gameObject->GetGUID();
- break;
- case GO_HODIR_ICE_DOOR:
- HodirIceDoorGUID = gameObject->GetGUID();
- break;
- case GO_ARCHIVUM_DOOR:
- ArchivumDoorGUID = gameObject->GetGUID();
- if (GetBossState(BOSS_ASSEMBLY_OF_IRON) != DONE)
- HandleGameObject(ArchivumDoorGUID, false);
- break;
- case GO_YOGG_SARON_DOOR:
- AddDoor(gameObject, true);
- break;
case GO_BRAIN_ROOM_DOOR_1:
BrainRoomDoorGUIDs[0] = gameObject->GetGUID();
break;
@@ -566,6 +547,8 @@ class instance_ulduar : public InstanceMapScript
case GO_GIFT_OF_THE_OBSERVER_25:
GiftOfTheObserverGUID = gameObject->GetGUID();
break;
+ default:
+ break;
}
}
@@ -575,6 +558,13 @@ class instance_ulduar : public InstanceMapScript
{
case GO_LEVIATHAN_DOOR:
case GO_XT_002_DOOR:
+ case GO_IRON_COUNCIL_DOOR:
+ case GO_ARCHIVUM_DOOR:
+ case GO_HODIR_ENTRANCE:
+ case GO_HODIR_DOOR:
+ case GO_HODIR_ICE_DOOR:
+ case GO_VEZAX_DOOR:
+ case GO_YOGG_SARON_DOOR:
case GO_DOODAD_UL_SIGILDOOR_03:
case GO_DOODAD_UL_UNIVERSEFLOOR_01:
case GO_DOODAD_UL_UNIVERSEFLOOR_02:
@@ -659,7 +649,10 @@ class instance_ulduar : public InstanceMapScript
case BOSS_IGNIS:
case BOSS_RAZORSCALE:
case BOSS_XT002:
+ case BOSS_ASSEMBLY_OF_IRON:
case BOSS_AURIAYA:
+ case BOSS_VEZAX:
+ case BOSS_YOGG_SARON:
break;
case BOSS_MIMIRON:
if (state == DONE)
@@ -669,16 +662,6 @@ class instance_ulduar : public InstanceMapScript
if (state == DONE)
instance->SummonCreature(NPC_FREYA_OBSERVATION_RING, ObservationRingKeepersPos[0]);
break;
- case BOSS_ASSEMBLY_OF_IRON:
- if (state == DONE)
- HandleGameObject(ArchivumDoorGUID, true);
- break;
- case BOSS_VEZAX:
- if (state == DONE)
- HandleGameObject(VezaxDoorGUID, true);
- break;
- case BOSS_YOGG_SARON:
- break;
case BOSS_KOLOGARN:
if (state == DONE)
{
@@ -698,8 +681,6 @@ class instance_ulduar : public InstanceMapScript
HodirRareCache->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
if (GameObject* HodirChest = instance->GetGameObject(HodirChestGUID))
HodirChest->SetRespawnTime(HodirChest->GetRespawnDelay());
- HandleGameObject(HodirDoorGUID, true);
- HandleGameObject(HodirIceDoorGUID, true);
instance->SummonCreature(NPC_HODIR_OBSERVATION_RING, ObservationRingKeepersPos[1]);
}
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h
index 35d11522580..45134cd9ff6 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h
@@ -166,29 +166,46 @@ enum UlduarNPCs
enum UlduarGameObjects
{
- GO_KOLOGARN_CHEST_HERO = 195047,
- GO_KOLOGARN_CHEST = 195046,
- GO_KOLOGARN_BRIDGE = 194232,
- GO_KOLOGARN_DOOR = 194553,
- GO_THORIM_CHEST_HERO = 194315,
- GO_THORIM_CHEST = 194314,
- GO_HODIR_RARE_CACHE_OF_WINTER = 194200,
- GO_HODIR_RARE_CACHE_OF_WINTER_HERO = 194201,
- GO_HODIR_CHEST_HERO = 194308,
- GO_HODIR_CHEST = 194307,
+ // Leviathan
GO_LEVIATHAN_DOOR = 194905,
GO_LEVIATHAN_GATE = 194630,
- GO_XT_002_DOOR = 194631,
- GO_VEZAX_DOOR = 194750,
+
+ // Razorscale
GO_MOLE_MACHINE = 194316,
GO_RAZOR_HARPOON_1 = 194542,
GO_RAZOR_HARPOON_2 = 194541,
GO_RAZOR_HARPOON_3 = 194543,
GO_RAZOR_HARPOON_4 = 194519,
GO_RAZOR_BROKEN_HARPOON = 194565,
+
+ // XT-002
+ GO_XT_002_DOOR = 194631,
+
+ // Assembly of Iron
+ GO_IRON_COUNCIL_DOOR = 194554,
+ GO_ARCHIVUM_DOOR = 194556,
+
+ // Kologarn
+ GO_KOLOGARN_CHEST_HERO = 195047,
+ GO_KOLOGARN_CHEST = 195046,
+ GO_KOLOGARN_BRIDGE = 194232,
+ GO_KOLOGARN_DOOR = 194553,
+
+ // Hodir
+ GO_HODIR_ENTRANCE = 194442,
GO_HODIR_DOOR = 194634,
GO_HODIR_ICE_DOOR = 194441,
- GO_ARCHIVUM_DOOR = 194556,
+ GO_HODIR_RARE_CACHE_OF_WINTER = 194200,
+ GO_HODIR_RARE_CACHE_OF_WINTER_HERO = 194201,
+ GO_HODIR_CHEST_HERO = 194308,
+ GO_HODIR_CHEST = 194307,
+
+ // Thorim
+ GO_THORIM_CHEST_HERO = 194315,
+ GO_THORIM_CHEST = 194314,
+
+ // Vezax
+ GO_VEZAX_DOOR = 194750,
// Yogg-Saron
GO_YOGG_SARON_DOOR = 194773,
@@ -327,26 +344,10 @@ enum YoggSaronIllusions
STORMWIND_ILLUSION = 2,
};
-template<class AI>
-CreatureAI* GetUlduarAI(Creature* creature)
+template<class AI, class T>
+AI* GetUlduarAI(T* obj)
{
- if (InstanceMap* instance = creature->GetMap()->ToInstanceMap())
- if (instance->GetInstanceScript())
- if (instance->GetScriptId() == sObjectMgr->GetScriptId(UlduarScriptName))
- return new AI(creature);
-
- return NULL;
-}
-
-template<class AI>
-GameObjectAI* GetUlduarAI(GameObject* go)
-{
- if (InstanceMap* instance = go->GetMap()->ToInstanceMap())
- if (instance->GetInstanceScript())
- if (instance->GetScriptId() == sObjectMgr->GetScriptId(UlduarScriptName))
- return new AI(go);
-
- return NULL;
+ return GetInstanceAI<AI, T>(obj, UlduarScriptName);
}
class PlayerOrPetCheck
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar_teleporter.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar_teleporter.cpp
index 054a32a75d2..0daa9ea16c6 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar_teleporter.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar_teleporter.cpp
@@ -18,9 +18,9 @@
#include "ScriptMgr.h"
#include "ScriptedGossip.h"
-#include "ulduar.h"
#include "InstanceScript.h"
#include "Player.h"
+#include "ulduar.h"
/*
The teleporter appears to be active and stable.
diff --git a/src/server/scripts/Outland/zone_netherstorm.cpp b/src/server/scripts/Outland/zone_netherstorm.cpp
index 74257c95cf3..7c328f57e78 100644
--- a/src/server/scripts/Outland/zone_netherstorm.cpp
+++ b/src/server/scripts/Outland/zone_netherstorm.cpp
@@ -753,7 +753,6 @@ public:
bool Drained;
uint8 WeakPercent;
- Player* player;
uint64 PlayerGUID;
uint32 ManaBurnTimer;
diff --git a/src/server/scripts/Pet/CMakeLists.txt b/src/server/scripts/Pet/CMakeLists.txt
index b4a8eea77d8..87bbfd63c69 100644
--- a/src/server/scripts/Pet/CMakeLists.txt
+++ b/src/server/scripts/Pet/CMakeLists.txt
@@ -11,6 +11,7 @@
set(scripts_STAT_SRCS
${scripts_STAT_SRCS}
Pet/pet_dk.cpp
+ Pet/pet_generic.cpp
Pet/pet_hunter.cpp
Pet/pet_mage.cpp
Pet/pet_priest.cpp
diff --git a/src/server/scripts/Pet/pet_generic.cpp b/src/server/scripts/Pet/pet_generic.cpp
new file mode 100644
index 00000000000..f10a14716c6
--- /dev/null
+++ b/src/server/scripts/Pet/pet_generic.cpp
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Ordered alphabetically using scriptname.
+ * Scriptnames of files in this file should be prefixed with "npc_pet_gen_".
+ */
+
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "Player.h"
+
+enum Mojo
+{
+ SAY_MOJO = 0,
+
+ SPELL_FEELING_FROGGY = 43906,
+ SPELL_SEDUCTION_VISUAL = 43919
+};
+
+class npc_pet_gen_mojo : public CreatureScript
+{
+ public:
+ npc_pet_gen_mojo() : CreatureScript("npc_pet_gen_mojo") { }
+
+ struct npc_pet_gen_mojoAI : public ScriptedAI
+ {
+ npc_pet_gen_mojoAI(Creature* creature) : ScriptedAI(creature) { }
+
+ void Reset() OVERRIDE
+ {
+ _victimGUID = 0;
+
+ if (Unit* owner = me->GetOwner())
+ me->GetMotionMaster()->MoveFollow(owner, 0.0f, 0.0f);
+ }
+
+ void EnterCombat(Unit* /*who*/) OVERRIDE { }
+ void UpdateAI(uint32 /*diff*/) OVERRIDE { }
+
+ void ReceiveEmote(Player* player, uint32 emote) OVERRIDE
+ {
+ me->HandleEmoteCommand(emote);
+ Unit* owner = me->GetOwner();
+ if (emote != TEXT_EMOTE_KISS || !owner || owner->GetTypeId() != TYPEID_PLAYER ||
+ owner->ToPlayer()->GetTeam() != player->GetTeam())
+ {
+ return;
+ }
+
+ Talk(SAY_MOJO, player->GetGUID());
+
+ if (_victimGUID)
+ if (Player* victim = ObjectAccessor::GetPlayer(*me, _victimGUID))
+ victim->RemoveAura(SPELL_FEELING_FROGGY);
+
+ _victimGUID = player->GetGUID();
+
+ DoCast(player, SPELL_FEELING_FROGGY, true);
+ DoCast(me, SPELL_SEDUCTION_VISUAL, true);
+ me->GetMotionMaster()->MoveFollow(player, 0.0f, 0.0f);
+ }
+
+ private:
+ uint64 _victimGUID;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_pet_gen_mojoAI(creature);
+ }
+};
+
+void AddSC_generic_pet_scripts()
+{
+ new npc_pet_gen_mojo();
+}
diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp
index 7b9821c60a9..7021f6251a2 100644
--- a/src/server/scripts/Spells/spell_quest.cpp
+++ b/src/server/scripts/Spells/spell_quest.cpp
@@ -2034,6 +2034,79 @@ class spell_q12308_escape_from_silverbrook_summon_worgen : public SpellScriptLoa
}
};
+
+enum DeathComesFromOnHigh
+{
+ SPELL_FORGE_CREDIT = 51974,
+ SPELL_TOWN_HALL_CREDIT = 51977,
+ SPELL_SCARLET_HOLD_CREDIT = 51980,
+ SPELL_CHAPEL_CREDIT = 51982,
+
+ NPC_NEW_AVALON_FORGE = 28525,
+ NPC_NEW_AVALON_TOWN_HALL = 28543,
+ NPC_SCARLET_HOLD = 28542,
+ NPC_CHAPEL_OF_THE_CRIMSON_FLAME = 28544
+};
+
+// 51858 - Siphon of Acherus
+class spell_q12641_death_comes_from_on_high : public SpellScriptLoader
+{
+ public:
+ spell_q12641_death_comes_from_on_high() : SpellScriptLoader("spell_q12641_death_comes_from_on_high") { }
+
+ class spell_q12641_death_comes_from_on_high_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_q12641_death_comes_from_on_high_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_FORGE_CREDIT) ||
+ !sSpellMgr->GetSpellInfo(SPELL_TOWN_HALL_CREDIT) ||
+ !sSpellMgr->GetSpellInfo(SPELL_SCARLET_HOLD_CREDIT) ||
+ !sSpellMgr->GetSpellInfo(SPELL_CHAPEL_CREDIT))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ uint32 spellId = 0;
+
+ TC_LOG_ERROR(LOG_FILTER_SPELLS_AURAS, "spell_q12641_death_comes_from_on_high:: Caster: %s (GUID: %u) On Hit Target: Creature: %s (Entry: %u GUID: %u)",
+ GetOriginalCaster()->GetName().c_str(), GetOriginalCaster()->GetGUIDLow(), GetHitCreature()->GetName().c_str(), GetHitCreature()->GetEntry(), GetHitCreature()->GetGUIDLow());
+ switch (GetHitCreature()->GetEntry())
+ {
+ case NPC_NEW_AVALON_FORGE:
+ spellId = SPELL_FORGE_CREDIT;
+ break;
+ case NPC_NEW_AVALON_TOWN_HALL:
+ spellId = SPELL_TOWN_HALL_CREDIT;
+ break;
+ case NPC_SCARLET_HOLD:
+ spellId = SPELL_SCARLET_HOLD_CREDIT;
+ break;
+ case NPC_CHAPEL_OF_THE_CRIMSON_FLAME:
+ spellId = SPELL_CHAPEL_CREDIT;
+ break;
+ default:
+ return;
+ }
+
+ GetOriginalCaster()->CastSpell((Unit*)NULL, spellId, true);
+ }
+
+ void Register() OVERRIDE
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_q12641_death_comes_from_on_high_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const OVERRIDE
+ {
+ return new spell_q12641_death_comes_from_on_high_SpellScript();
+ }
+};
+
void AddSC_quest_spell_scripts()
{
new spell_q55_sacred_cleansing();
@@ -2083,4 +2156,5 @@ void AddSC_quest_spell_scripts()
new spell_q12690_burst_at_the_seams();
new spell_q12308_escape_from_silverbrook_summon_worgen();
new spell_q12308_escape_from_silverbrook();
+ new spell_q12641_death_comes_from_on_high();
}
diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
index 4efdf78154d..5304cbf56ca 100644
--- a/src/server/scripts/World/npcs_special.cpp
+++ b/src/server/scripts/World/npcs_special.cpp
@@ -1575,130 +1575,34 @@ public:
## npc_brewfest_reveler
####*/
-class npc_brewfest_reveler : public CreatureScript
+enum BrewfestReveler
{
-public:
- npc_brewfest_reveler() : CreatureScript("npc_brewfest_reveler") { }
-
- struct npc_brewfest_revelerAI : public ScriptedAI
- {
- npc_brewfest_revelerAI(Creature* creature) : ScriptedAI(creature) {}
- void ReceiveEmote(Player* player, uint32 emote) OVERRIDE
- {
- if (!IsHolidayActive(HOLIDAY_BREWFEST))
- return;
-
- if (emote == TEXT_EMOTE_DANCE)
- me->CastSpell(player, 41586, false);
- }
- };
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_brewfest_revelerAI(creature);
- }
+ SPELL_BREWFEST_TOAST = 41586
};
-
-#define SAY_RANDOM_MOJO0 "Now that's what I call froggy-style!"
-#define SAY_RANDOM_MOJO1 "Your lily pad or mine?"
-#define SAY_RANDOM_MOJO2 "This won't take long, did it?"
-#define SAY_RANDOM_MOJO3 "I thought you'd never ask!"
-#define SAY_RANDOM_MOJO4 "I promise not to give you warts..."
-#define SAY_RANDOM_MOJO5 "Feelin' a little froggy, are ya?"
-#define SAY_RANDOM_MOJO6a "Listen, "
-#define SAY_RANDOM_MOJO6b ", I know of a little swamp not too far from here...."
-#define SAY_RANDOM_MOJO7 "There's just never enough Mojo to go around..."
-
-class npc_mojo : public CreatureScript
+class npc_brewfest_reveler : public CreatureScript
{
-public:
- npc_mojo() : CreatureScript("npc_mojo") { }
+ public:
+ npc_brewfest_reveler() : CreatureScript("npc_brewfest_reveler") { }
- struct npc_mojoAI : public ScriptedAI
- {
- npc_mojoAI(Creature* creature) : ScriptedAI(creature) {Reset();}
- uint32 hearts;
- uint64 victimGUID;
- void Reset() OVERRIDE
+ struct npc_brewfest_revelerAI : public ScriptedAI
{
- victimGUID = 0;
- hearts = 15000;
- if (Unit* own = me->GetOwner())
- me->GetMotionMaster()->MoveFollow(own, 0, 0);
- }
-
- void EnterCombat(Unit* /*who*/)OVERRIDE {}
+ npc_brewfest_revelerAI(Creature* creature) : ScriptedAI(creature) { }
- void UpdateAI(uint32 diff) OVERRIDE
- {
- if (me->HasAura(20372))
+ void ReceiveEmote(Player* player, uint32 emote) OVERRIDE
{
- if (hearts <= diff)
- {
- me->RemoveAurasDueToSpell(20372);
- hearts = 15000;
- } hearts -= diff;
- }
- }
-
- void ReceiveEmote(Player* player, uint32 emote) OVERRIDE
- {
- me->HandleEmoteCommand(emote);
- Unit* owner = me->GetOwner();
- if (emote != TEXT_EMOTE_KISS || !owner || owner->GetTypeId() != TYPEID_PLAYER ||
- owner->ToPlayer()->GetTeam() != player->GetTeam())
- {
- return;
- }
+ if (!IsHolidayActive(HOLIDAY_BREWFEST))
+ return;
- std::string whisp = "";
- switch (rand() % 8)
- {
- case 0:
- whisp.append(SAY_RANDOM_MOJO0);
- break;
- case 1:
- whisp.append(SAY_RANDOM_MOJO1);
- break;
- case 2:
- whisp.append(SAY_RANDOM_MOJO2);
- break;
- case 3:
- whisp.append(SAY_RANDOM_MOJO3);
- break;
- case 4:
- whisp.append(SAY_RANDOM_MOJO4);
- break;
- case 5:
- whisp.append(SAY_RANDOM_MOJO5);
- break;
- case 6:
- whisp.append(SAY_RANDOM_MOJO6a);
- whisp.append(player->GetName());
- whisp.append(SAY_RANDOM_MOJO6b);
- break;
- case 7:
- whisp.append(SAY_RANDOM_MOJO7);
- break;
+ if (emote == TEXT_EMOTE_DANCE)
+ me->CastSpell(player, SPELL_BREWFEST_TOAST, false);
}
+ };
- me->MonsterWhisper(whisp.c_str(), player->GetGUID());
- if (victimGUID)
- if (Player* victim = ObjectAccessor::GetPlayer(*me, victimGUID))
- victim->RemoveAura(43906); // remove polymorph frog thing
- me->AddAura(43906, player); // add polymorph frog thing
- victimGUID = player->GetGUID();
- DoCast(me, 20372, true); // tag.hearts
- me->GetMotionMaster()->MoveFollow(player, 0, 0);
- hearts = 15000;
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_brewfest_revelerAI(creature);
}
- };
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_mojoAI(creature);
- }
};
enum TrainingDummy
@@ -2554,7 +2458,6 @@ void AddSC_npcs_special()
new npc_steam_tonk();
new npc_tonk_mine();
new npc_brewfest_reveler();
- new npc_mojo();
new npc_training_dummy();
new npc_wormhole();
new npc_pet_trainer();