Merge branch 'master' into 4.3.4
Conflicts: src/server/game/Battlegrounds/Battleground.cpp src/server/game/Battlegrounds/BattlegroundMgr.cpp src/server/game/Battlegrounds/BattlegroundMgr.h src/server/game/Battlegrounds/BattlegroundQueue.cpp src/server/game/DataStores/DBCfmt.h src/server/game/Guilds/Guild.cpp src/server/game/Handlers/BattleGroundHandler.cpp src/server/game/Handlers/BattlefieldHandler.cpp src/server/game/Handlers/GuildHandler.cpp src/server/game/Movement/Spline/MoveSplineInit.cpp src/server/game/Movement/Spline/MovementPacketBuilder.cpp src/server/game/Movement/Spline/MovementUtil.cpp src/server/game/Server/WorldSession.cpp src/server/game/Spells/Auras/SpellAuras.cpp src/server/game/Spells/Spell.cpp src/server/game/Spells/SpellEffects.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h src/server/scripts/EasternKingdoms/boss_kruul.cpp src/server/scripts/Kalimdor/zone_feralas.cpp src/server/scripts/Spells/spell_druid.cpp src/server/scripts/Spells/spell_mage.cpp src/server/scripts/Spells/spell_paladin.cpp src/server/scripts/Spells/spell_rogue.cpp src/server/scripts/Spells/spell_shaman.cpp src/server/scripts/Spells/spell_warlock.cpp src/server/scripts/Spells/spell_warrior.cpp src/server/shared/Packets/ByteBuffer.h
This commit is contained in:
commit
d75222feca
486 files changed
+3261
-2604
No files matched your search
@@ -1134,13 +1134,13 @@ public:
|
||||
if (isInt32)
|
||||
{
|
||||
uint32 value = (uint32)atoi(y);
|
||||
target->SetUInt32Value(opcode , value);
|
||||
target->SetUInt32Value(opcode, value);
|
||||
handler->PSendSysMessage(LANG_SET_UINT_FIELD, GUID_LOPART(guid), opcode, value);
|
||||
}
|
||||
else
|
||||
{
|
||||
float value = (float)atof(y);
|
||||
target->SetFloatValue(opcode , value);
|
||||
target->SetFloatValue(opcode, value);
|
||||
handler->PSendSysMessage(LANG_SET_FLOAT_FIELD, GUID_LOPART(guid), opcode, value);
|
||||
}
|
||||
|
||||
|
||||
@@ -1533,7 +1533,7 @@ public:
|
||||
return false;
|
||||
|
||||
Field* fields = result->Fetch();
|
||||
totalPlayerTime = fields[0].GetUInt32();
|
||||
totalPlayerTime = fields[0].GetUInt32();
|
||||
level = fields[1].GetUInt8();
|
||||
money = fields[2].GetUInt32();
|
||||
accId = fields[3].GetUInt32();
|
||||
@@ -1616,7 +1616,7 @@ public:
|
||||
if (result2)
|
||||
{
|
||||
Field* fields = result2->Fetch();
|
||||
banTime = int64(fields[1].GetBool() ? 0 : fields[0].GetUInt32());
|
||||
banTime = int64(fields[1].GetUInt64() ? 0 : fields[0].GetUInt32());
|
||||
bannedby = fields[2].GetString();
|
||||
banreason = fields[3].GetString();
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public:
|
||||
|
||||
// check item starting quest (it can work incorrectly if added without item in inventory)
|
||||
ItemTemplateContainer const* itc = sObjectMgr->GetItemTemplateStore();
|
||||
ItemTemplateContainer::const_iterator result = find_if(itc->begin(), itc->end(), Finder<uint32, ItemTemplate>(entry, &ItemTemplate::StartQuest));
|
||||
ItemTemplateContainer::const_iterator result = find_if (itc->begin(), itc->end(), Finder<uint32, ItemTemplate>(entry, &ItemTemplate::StartQuest));
|
||||
|
||||
if (result != itc->end())
|
||||
{
|
||||
|
||||
@@ -386,12 +386,13 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string assignedTo = ticket->GetAssignedToName(); // copy assignedto name because we need it after the ticket has been unnassigned
|
||||
SQLTransaction trans = SQLTransaction(NULL);
|
||||
ticket->SetUnassigned();
|
||||
ticket->SaveToDB(trans);
|
||||
sTicketMgr->UpdateLastChange();
|
||||
|
||||
std::string msg = ticket->FormatMessageString(*handler, NULL, ticket->GetAssignedToName().c_str(),
|
||||
std::string msg = ticket->FormatMessageString(*handler, NULL, assignedTo.c_str(),
|
||||
handler->GetSession() ? handler->GetSession()->GetPlayer()->GetName().c_str() : "Console", NULL);
|
||||
handler->SendGlobalGMSysMessage(msg.c_str());
|
||||
|
||||
|
||||
@@ -66,7 +66,6 @@ public:
|
||||
{
|
||||
if (instance->GetBossState(DATA_PYROGAURD_EMBERSEER) == IN_PROGRESS)
|
||||
OpenDoors(false);
|
||||
instance->SetBossState(DATA_PYROGAURD_EMBERSEER,NOT_STARTED);
|
||||
// respawn any dead Blackhand Incarcerators
|
||||
DoCast(me, SPELL_ENCAGED_EMBERSEER);
|
||||
//DoCast(me, SPELL_FIRE_SHIELD_TRIGGER);
|
||||
@@ -83,7 +82,6 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
instance->SetBossState(DATA_PYROGAURD_EMBERSEER,DONE);
|
||||
OpenDoors(true);
|
||||
_JustDied();
|
||||
}
|
||||
@@ -102,7 +100,6 @@ public:
|
||||
void UpdateAI(uint32 const diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
@@ -115,11 +112,11 @@ public:
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_FIRENOVA:
|
||||
DoCast(me->getVictim(), SPELL_FIRENOVA);
|
||||
DoCastVictim(SPELL_FIRENOVA);
|
||||
events.ScheduleEvent(EVENT_FIRENOVA, 6 * IN_MILLISECONDS);
|
||||
break;
|
||||
case EVENT_FLAMEBUFFET:
|
||||
DoCast(me->getVictim(), SPELL_FLAMEBUFFET);
|
||||
DoCastVictim(SPELL_FLAMEBUFFET);
|
||||
events.ScheduleEvent(EVENT_FLAMEBUFFET, 14 * IN_MILLISECONDS);
|
||||
break;
|
||||
case EVENT_PYROBLAST:
|
||||
@@ -129,6 +126,7 @@ public:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -215,7 +215,8 @@ public:
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_PYROGUARD_EMBERSEER:
|
||||
SetBossState(DATA_PYROGAURD_EMBERSEER,IN_PROGRESS);
|
||||
if (GetBossState(DATA_PYROGAURD_EMBERSEER) == NOT_STARTED)
|
||||
SetBossState(DATA_PYROGAURD_EMBERSEER, IN_PROGRESS);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -603,7 +603,7 @@ public:
|
||||
|
||||
void netherspite_infernal::netherspite_infernalAI::Cleanup()
|
||||
{
|
||||
Creature *pMalchezaar = Unit::GetCreature(*me, malchezaar);
|
||||
Creature* pMalchezaar = Unit::GetCreature(*me, malchezaar);
|
||||
|
||||
if (pMalchezaar && pMalchezaar->isAlive())
|
||||
CAST_AI(boss_malchezaar::boss_malchezaarAI, pMalchezaar->AI())->Cleanup(me, point);
|
||||
|
||||
@@ -146,7 +146,7 @@ public:
|
||||
me->CastSpell(me, SPELL_DK_INITIATE_VISUAL, true);
|
||||
|
||||
if (Player* starter = Unit::GetPlayer(*me, playerGUID))
|
||||
Talk(SAY_EVENT_ATTACK);
|
||||
sCreatureTextMgr->SendChat(me, SAY_EVENT_ATTACK, 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, starter);
|
||||
|
||||
phase = PHASE_TO_ATTACK;
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ public:
|
||||
{
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_CUSTOM_SPELL_01);
|
||||
DoCast(player, SPELL_REVIVE, true);
|
||||
Talk(WHISPER_REVIVE,player->GetGUID());
|
||||
Talk(WHISPER_REVIVE, player->GetGUID());
|
||||
}
|
||||
FlyBackTimer = 5000;
|
||||
break;
|
||||
|
||||
@@ -58,20 +58,21 @@ class boss_darkmaster_gandling : public CreatureScript
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_Reset();
|
||||
if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_GATE_GANDLING)))
|
||||
gate->SetGoState(GO_STATE_ACTIVE);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(DATA_DARKMASTERGANDLING, DONE);
|
||||
_JustDied();
|
||||
if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_GATE_GANDLING)))
|
||||
gate->SetGoState(GO_STATE_ACTIVE);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
events.ScheduleEvent(EVENT_ARCANEMISSILES, 4500);
|
||||
events.ScheduleEvent(EVENT_SHADOWSHIELD, 12000);
|
||||
events.ScheduleEvent(EVENT_CURSE, 2000);
|
||||
@@ -116,7 +117,7 @@ class boss_darkmaster_gandling : public CreatureScript
|
||||
case EVENT_SHADOW_PORTAL:
|
||||
if (HealthAbovePct(3))
|
||||
{
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM,0, 100, true),SPELL_SHADOW_PORTAL,true);
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_SHADOW_PORTAL, true);
|
||||
events.ScheduleEvent(EVENT_SHADOW_PORTAL, urand(17000, 27000));
|
||||
}
|
||||
}
|
||||
@@ -171,7 +172,7 @@ class spell_shadow_portal : public SpellScriptLoader
|
||||
{
|
||||
if (attempts++ >= 6) break;
|
||||
|
||||
switch (urand(0,5))
|
||||
switch (urand(0, 5))
|
||||
{
|
||||
case ROOM_HALL_OF_SECRETS:
|
||||
if (InstanceScript* instance = GetCaster()->GetInstanceScript())
|
||||
@@ -222,7 +223,7 @@ class spell_shadow_portal : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// Script for Shadow Portal spells 17863,17939,17943,17944,17946,17948
|
||||
// Script for Shadow Portal spells 17863, 17939, 17943, 17944, 17946, 17948
|
||||
Position const SummonPos[18] =
|
||||
{
|
||||
// Hall of Secrects
|
||||
@@ -330,7 +331,7 @@ class spell_shadow_portal_rooms : public SpellScriptLoader
|
||||
if (Summoned)
|
||||
{
|
||||
Summoned->GetMotionMaster()->MoveRandom(5);
|
||||
Summoned->AI()->SetData(0,phase_to_set);
|
||||
Summoned->AI()->SetData(0, phase_to_set);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,16 +53,9 @@ class boss_doctor_theolen_krastinov : public CreatureScript
|
||||
{
|
||||
boss_theolenkrastinovAI(Creature* creature) : BossAI(creature, DATA_DOCTORTHEOLENKRASTINOV) {}
|
||||
|
||||
void Reset() {}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(DATA_DOCTORTHEOLENKRASTINOV, DONE);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
events.ScheduleEvent(EVENT_REND, 8000);
|
||||
events.ScheduleEvent(EVENT_BACKHAND, 9000);
|
||||
events.ScheduleEvent(EVENT_FRENZY, 1000);
|
||||
|
||||
@@ -48,18 +48,11 @@ class boss_illucia_barov : public CreatureScript
|
||||
|
||||
struct boss_illuciabarovAI : public BossAI
|
||||
{
|
||||
boss_illuciabarovAI(Creature* creature) : BossAI(creature,DATA_LADYILLUCIABAROV) {}
|
||||
|
||||
void Reset() {}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(DATA_LADYILLUCIABAROV, DONE);
|
||||
}
|
||||
boss_illuciabarovAI(Creature* creature) : BossAI(creature, DATA_LADYILLUCIABAROV) {}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
events.ScheduleEvent(EVENT_CURSEOFAGONY, 18000);
|
||||
events.ScheduleEvent(EVENT_SHADOWSHOCK, 9000);
|
||||
events.ScheduleEvent(EVENT_SILENCE, 5000);
|
||||
@@ -85,7 +78,7 @@ class boss_illucia_barov : public CreatureScript
|
||||
events.ScheduleEvent(EVENT_CURSEOFAGONY, 30000);
|
||||
break;
|
||||
case EVENT_SHADOWSHOCK:
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM,0, 100, true),SPELL_SHADOWSHOCK,true);
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_SHADOWSHOCK, true);
|
||||
events.ScheduleEvent(EVENT_SHADOWSHOCK, 12000);
|
||||
break;
|
||||
case EVENT_SILENCE:
|
||||
|
||||
@@ -57,18 +57,14 @@ class boss_instructor_malicia : public CreatureScript
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_Reset();
|
||||
FlashCounter = 0;
|
||||
TouchCounter = 0;
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(DATA_INSTRUCTORMALICIA, DONE);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
events.ScheduleEvent(EVENT_CALLOFGRAVES, 4000);
|
||||
events.ScheduleEvent(EVENT_CORRUPTION, 8000);
|
||||
events.ScheduleEvent(EVENT_RENEW, 32000);
|
||||
@@ -95,7 +91,7 @@ class boss_instructor_malicia : public CreatureScript
|
||||
events.ScheduleEvent(EVENT_CALLOFGRAVES, 65000);
|
||||
break;
|
||||
case EVENT_CORRUPTION:
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM,0, 100, true),SPELL_CORRUPTION,true);
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_CORRUPTION, true);
|
||||
events.ScheduleEvent(EVENT_CORRUPTION, 24000);
|
||||
break;
|
||||
case EVENT_RENEW:
|
||||
|
||||
@@ -103,8 +103,7 @@ class boss_kirtonos_the_herald : public CreatureScript
|
||||
brazier->ResetDoorOrButton();
|
||||
brazier->SetGoState(GO_STATE_READY);
|
||||
}
|
||||
if (instance)
|
||||
instance->SetData(DATA_KIRTONOS, DONE);
|
||||
_JustDied();
|
||||
}
|
||||
|
||||
void EnterEvadeMode()
|
||||
@@ -153,7 +152,7 @@ class boss_kirtonos_the_herald : public CreatureScript
|
||||
switch (_introEvent)
|
||||
{
|
||||
case INTRO_1:
|
||||
me->GetMotionMaster()->MovePath(KIRTONOS_PATH,false);
|
||||
me->GetMotionMaster()->MovePath(KIRTONOS_PATH, false);
|
||||
_introEvent = 0;
|
||||
break;
|
||||
case INTRO_2:
|
||||
|
||||
@@ -48,17 +48,13 @@ class boss_lord_alexei_barov : public CreatureScript
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_Reset();
|
||||
me->LoadCreaturesAddon();
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(DATA_LORDALEXEIBAROV, DONE);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
events.ScheduleEvent(EVENT_IMMOLATE, 7000);
|
||||
events.ScheduleEvent(EVENT_VEILOFSHADOW, 15000);
|
||||
}
|
||||
@@ -78,7 +74,7 @@ class boss_lord_alexei_barov : public CreatureScript
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_IMMOLATE:
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM,0, 100, true),SPELL_IMMOLATE,true);
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_IMMOLATE, true);
|
||||
events.ScheduleEvent(EVENT_IMMOLATE, 12000);
|
||||
break;
|
||||
case EVENT_VEILOFSHADOW:
|
||||
|
||||
@@ -50,16 +50,9 @@ class boss_lorekeeper_polkelt : public CreatureScript
|
||||
{
|
||||
boss_lorekeeperpolkeltAI(Creature* creature) : BossAI(creature, DATA_LOREKEEPERPOLKELT) {}
|
||||
|
||||
void Reset() {}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(DATA_LOREKEEPERPOLKELT, DONE);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
events.ScheduleEvent(EVENT_VOLATILEINFECTION, 38000);
|
||||
events.ScheduleEvent(EVENT_DARKPLAGUE, 8000);
|
||||
events.ScheduleEvent(EVENT_CORROSIVEACID, 45000);
|
||||
|
||||
@@ -42,7 +42,6 @@ enum Events
|
||||
EVENT_KNOCKAWAY = 4
|
||||
};
|
||||
|
||||
|
||||
class boss_the_ravenian : public CreatureScript
|
||||
{
|
||||
public: boss_the_ravenian() : CreatureScript("boss_the_ravenian") { }
|
||||
@@ -51,16 +50,9 @@ class boss_the_ravenian : public CreatureScript
|
||||
{
|
||||
boss_theravenianAI(Creature* creature) : BossAI(creature, DATA_THERAVENIAN) {}
|
||||
|
||||
void Reset() {}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(DATA_THERAVENIAN, DONE);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
events.ScheduleEvent(EVENT_TRAMPLE, 24000);
|
||||
events.ScheduleEvent(EVENT_CLEAVE, 15000);
|
||||
events.ScheduleEvent(EVENT_SUNDERINCLEAVE, 40000);
|
||||
|
||||
@@ -15,160 +15,215 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
Name: Instance_Scholomance
|
||||
%Complete: 100
|
||||
Comment:
|
||||
Category: Scholomance
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "scholomance.h"
|
||||
#include "Player.h"
|
||||
#include "scholomance.h"
|
||||
|
||||
enum CreatureId
|
||||
{
|
||||
NPC_DARKMASTER_GANDLING = 1853
|
||||
};
|
||||
|
||||
Position const GandlingLoc = {180.7712f, -5.428603f, 75.57024f, 1.291544f};
|
||||
Position const GandlingLoc = { 180.7712f, -5.428603f, 75.57024f, 1.291544f };
|
||||
|
||||
class instance_scholomance : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_scholomance() : InstanceMapScript("instance_scholomance", 289) { }
|
||||
public:
|
||||
instance_scholomance() : InstanceMapScript("instance_scholomance", 289) { }
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_scholomance_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
struct instance_scholomance_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_scholomance_InstanceMapScript(Map* map) : InstanceScript(map) {}
|
||||
|
||||
//Lord Alexei Barov, Doctor Theolen Krastinov, The Ravenian, Lorekeeper Polkelt, Instructor Malicia and the Lady Illucia Barov.
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
uint64 GateKirtonosGUID;
|
||||
uint64 GateGandlingGUID;
|
||||
uint64 GateMiliciaGUID;
|
||||
uint64 GateTheolenGUID;
|
||||
uint64 GatePolkeltGUID;
|
||||
uint64 GateRavenianGUID;
|
||||
uint64 GateBarovGUID;
|
||||
uint64 GateIlluciaGUID;
|
||||
uint64 BrazierOfTheHeraldGUID;
|
||||
|
||||
void Initialize()
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
GateKirtonosGUID = 0;
|
||||
GateGandlingGUID = 0;
|
||||
GateMiliciaGUID = 0;
|
||||
GateTheolenGUID = 0;
|
||||
GatePolkeltGUID = 0;
|
||||
GateRavenianGUID = 0;
|
||||
GateBarovGUID = 0;
|
||||
GateIlluciaGUID = 0;
|
||||
BrazierOfTheHeraldGUID = 0;
|
||||
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
m_auiEncounter[i] = NOT_STARTED;
|
||||
return new instance_scholomance_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* go)
|
||||
struct instance_scholomance_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
instance_scholomance_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
case GO_GATE_KIRTONOS: GateKirtonosGUID = go->GetGUID(); break;
|
||||
case GO_GATE_GANDLING: GateGandlingGUID = go->GetGUID(); break;
|
||||
case GO_GATE_MALICIA: GateMiliciaGUID = go->GetGUID(); break;
|
||||
case GO_GATE_THEOLEN: GateTheolenGUID = go->GetGUID(); break;
|
||||
case GO_GATE_POLKELT: GatePolkeltGUID = go->GetGUID(); break;
|
||||
case GO_GATE_RAVENIAN: GateRavenianGUID = go->GetGUID(); break;
|
||||
case GO_GATE_BAROV: GateBarovGUID = go->GetGUID(); break;
|
||||
case GO_GATE_ILLUCIA: GateIlluciaGUID = go->GetGUID(); break;
|
||||
case GO_BRAZIER_OF_THE_HERALD: BrazierOfTheHeraldGUID = go->GetGUID(); break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_LORDALEXEIBAROV:
|
||||
m_auiEncounter[DATA_LORDALEXEIBAROV] = data;
|
||||
CheckToSpawnGandling();
|
||||
break;
|
||||
case DATA_DOCTORTHEOLENKRASTINOV:
|
||||
m_auiEncounter[DATA_DOCTORTHEOLENKRASTINOV] = data;
|
||||
CheckToSpawnGandling();
|
||||
break;
|
||||
case DATA_THERAVENIAN:
|
||||
m_auiEncounter[DATA_THERAVENIAN] = data;
|
||||
CheckToSpawnGandling();
|
||||
break;
|
||||
case DATA_LOREKEEPERPOLKELT:
|
||||
m_auiEncounter[DATA_LOREKEEPERPOLKELT] = data;
|
||||
CheckToSpawnGandling();
|
||||
break;
|
||||
case DATA_INSTRUCTORMALICIA:
|
||||
m_auiEncounter[DATA_INSTRUCTORMALICIA] = data;
|
||||
CheckToSpawnGandling();
|
||||
break;
|
||||
case DATA_LADYILLUCIABAROV:
|
||||
m_auiEncounter[DATA_LADYILLUCIABAROV] = data;
|
||||
CheckToSpawnGandling();
|
||||
break;
|
||||
case DATA_DARKMASTERGANDLING:
|
||||
m_auiEncounter[DATA_DARKMASTERGANDLING] = data;
|
||||
break;
|
||||
case DATA_KIRTONOS:
|
||||
m_auiEncounter[DATA_KIRTONOS] = data;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type) const
|
||||
{
|
||||
return type == (m_auiEncounter[DATA_LORDALEXEIBAROV] == DONE) && (m_auiEncounter[DATA_DOCTORTHEOLENKRASTINOV] == DONE) &&
|
||||
(m_auiEncounter[DATA_THERAVENIAN] == DONE) && (m_auiEncounter[DATA_LOREKEEPERPOLKELT] == DONE) &&
|
||||
(m_auiEncounter[DATA_INSTRUCTORMALICIA] == DONE) && (m_auiEncounter[DATA_LADYILLUCIABAROV] == DONE)
|
||||
? IN_PROGRESS : 0;
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 type) const
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case GO_GATE_KIRTONOS: return GateKirtonosGUID; break;
|
||||
case GO_GATE_GANDLING: return GateGandlingGUID; break;
|
||||
case GO_GATE_MALICIA: return GateMiliciaGUID; break;
|
||||
case GO_GATE_THEOLEN: return GateTheolenGUID; break;
|
||||
case GO_GATE_POLKELT: return GatePolkeltGUID; break;
|
||||
case GO_GATE_RAVENIAN: return GateRavenianGUID; break;
|
||||
case GO_GATE_BAROV: return GateBarovGUID; break;
|
||||
case GO_GATE_ILLUCIA: return GateIlluciaGUID; break;
|
||||
case GO_BRAZIER_OF_THE_HERALD: return BrazierOfTheHeraldGUID; break;
|
||||
SetBossNumber(EncounterCount);
|
||||
GateKirtonosGUID = 0;
|
||||
GateGandlingGUID = 0;
|
||||
GateMiliciaGUID = 0;
|
||||
GateTheolenGUID = 0;
|
||||
GatePolkeltGUID = 0;
|
||||
GateRavenianGUID = 0;
|
||||
GateBarovGUID = 0;
|
||||
GateIlluciaGUID = 0;
|
||||
BrazierOfTheHeraldGUID = 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CheckToSpawnGandling()
|
||||
{
|
||||
if (GetData(DATA_DARKMASTERGANDLING) == IN_PROGRESS)
|
||||
void OnGameObjectCreate(GameObject* go)
|
||||
{
|
||||
Map::PlayerList const &PlayerList = instance->GetPlayers();
|
||||
if (PlayerList.isEmpty())
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case GO_GATE_KIRTONOS:
|
||||
GateKirtonosGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_GATE_GANDLING:
|
||||
GateGandlingGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_GATE_MALICIA:
|
||||
GateMiliciaGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_GATE_THEOLEN:
|
||||
GateTheolenGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_GATE_POLKELT:
|
||||
GatePolkeltGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_GATE_RAVENIAN:
|
||||
GateRavenianGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_GATE_BAROV:
|
||||
GateBarovGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_GATE_ILLUCIA:
|
||||
GateIlluciaGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_BRAZIER_OF_THE_HERALD:
|
||||
BrazierOfTheHeraldGUID = go->GetGUID();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool SetBossState(uint32 type, EncounterState state)
|
||||
{
|
||||
if (!InstanceScript::SetBossState(type, state))
|
||||
return false;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case DATA_LORDALEXEIBAROV:
|
||||
case DATA_DOCTORTHEOLENKRASTINOV:
|
||||
case DATA_THERAVENIAN:
|
||||
case DATA_LOREKEEPERPOLKELT:
|
||||
case DATA_INSTRUCTORMALICIA:
|
||||
case DATA_LADYILLUCIABAROV:
|
||||
CheckToSpawnGandling();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 type) const
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case GO_GATE_KIRTONOS:
|
||||
return GateKirtonosGUID;
|
||||
case GO_GATE_GANDLING:
|
||||
return GateGandlingGUID;
|
||||
case GO_GATE_MALICIA:
|
||||
return GateMiliciaGUID;
|
||||
case GO_GATE_THEOLEN:
|
||||
return GateTheolenGUID;
|
||||
case GO_GATE_POLKELT:
|
||||
return GatePolkeltGUID;
|
||||
case GO_GATE_RAVENIAN:
|
||||
return GateRavenianGUID;
|
||||
case GO_GATE_BAROV:
|
||||
return GateBarovGUID;
|
||||
case GO_GATE_ILLUCIA:
|
||||
return GateIlluciaGUID;
|
||||
case GO_BRAZIER_OF_THE_HERALD:
|
||||
return BrazierOfTheHeraldGUID;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool CheckPreBosses(uint32 bossId) const
|
||||
{
|
||||
switch (bossId)
|
||||
{
|
||||
case DATA_DARKMASTERGANDLING:
|
||||
if (GetBossState(DATA_LORDALEXEIBAROV) != DONE)
|
||||
return false;
|
||||
if (GetBossState(DATA_DOCTORTHEOLENKRASTINOV) != DONE)
|
||||
return false;
|
||||
if (GetBossState(DATA_THERAVENIAN) != DONE)
|
||||
return false;
|
||||
if (GetBossState(DATA_LOREKEEPERPOLKELT) != DONE)
|
||||
return false;
|
||||
if (GetBossState(DATA_INSTRUCTORMALICIA) != DONE)
|
||||
return false;
|
||||
if (GetBossState(DATA_LADYILLUCIABAROV) != DONE)
|
||||
return false;
|
||||
if (GetBossState(DATA_DARKMASTERGANDLING) == DONE)
|
||||
return false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CheckToSpawnGandling()
|
||||
{
|
||||
if (CheckPreBosses(DATA_DARKMASTERGANDLING))
|
||||
instance->SummonCreature(NPC_DARKMASTER_GANDLING, GandlingLoc);
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "S O " << GetBossSaveData();
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(const char* str)
|
||||
{
|
||||
if (!str)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
Map::PlayerList::const_iterator i = PlayerList.begin();
|
||||
if (Player* i_pl = i->getSource())
|
||||
i_pl->SummonCreature(NPC_DARKMASTER_GANDLING, GandlingLoc);
|
||||
OUT_LOAD_INST_DATA(str);
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
|
||||
std::istringstream loadStream(str);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
|
||||
if (dataHead1 == 'S' && dataHead2 == 'O')
|
||||
{
|
||||
for (uint32 i = 0; i < EncounterCount; ++i)
|
||||
{
|
||||
uint32 tmpState;
|
||||
loadStream >> tmpState;
|
||||
if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
|
||||
tmpState = NOT_STARTED;
|
||||
SetBossState(i, EncounterState(tmpState));
|
||||
}
|
||||
|
||||
CheckToSpawnGandling();
|
||||
}
|
||||
else
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
protected:
|
||||
uint64 GateKirtonosGUID;
|
||||
uint64 GateGandlingGUID;
|
||||
uint64 GateMiliciaGUID;
|
||||
uint64 GateTheolenGUID;
|
||||
uint64 GatePolkeltGUID;
|
||||
uint64 GateRavenianGUID;
|
||||
uint64 GateBarovGUID;
|
||||
uint64 GateIlluciaGUID;
|
||||
uint64 BrazierOfTheHeraldGUID;
|
||||
};
|
||||
};
|
||||
|
||||
void AddSC_instance_scholomance()
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
#ifndef DEF_SCHOLOMANCE_H
|
||||
#define DEF_SCHOLOMANCE_H
|
||||
|
||||
uint32 const EncounterCount = 8;
|
||||
|
||||
enum DataTypes
|
||||
{
|
||||
DATA_DOCTORTHEOLENKRASTINOV = 0,
|
||||
@@ -30,6 +32,11 @@ enum DataTypes
|
||||
DATA_KIRTONOS = 7
|
||||
};
|
||||
|
||||
enum CreatureIds
|
||||
{
|
||||
NPC_DARKMASTER_GANDLING = 1853
|
||||
};
|
||||
|
||||
enum GameobjectIds
|
||||
{
|
||||
GO_GATE_KIRTONOS = 175570,
|
||||
@@ -43,9 +50,4 @@ enum GameobjectIds
|
||||
GO_BRAZIER_OF_THE_HERALD = 175564
|
||||
};
|
||||
|
||||
enum Misc
|
||||
{
|
||||
MAX_ENCOUNTER = 8
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
|
||||
if (instance)
|
||||
{
|
||||
if (Creature *temp = Unit::GetCreature(*me, instance->GetData64(DATA_ALYTHESS)))
|
||||
if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_ALYTHESS)))
|
||||
{
|
||||
if (temp->isDead())
|
||||
temp->Respawn();
|
||||
@@ -145,7 +145,7 @@ public:
|
||||
|
||||
if (instance)
|
||||
{
|
||||
Creature *temp = Unit::GetCreature(*me, instance->GetData64(DATA_ALYTHESS));
|
||||
Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_ALYTHESS));
|
||||
if (temp && temp->isAlive() && !temp->getVictim())
|
||||
temp->AI()->AttackStart(who);
|
||||
}
|
||||
@@ -374,7 +374,7 @@ public:
|
||||
|
||||
if (instance)
|
||||
{
|
||||
if (Creature *temp = Unit::GetCreature((*me), instance->GetData64(DATA_SACROLASH)))
|
||||
if (Creature* temp = Unit::GetCreature((*me), instance->GetData64(DATA_SACROLASH)))
|
||||
{
|
||||
if (temp->isDead())
|
||||
temp->Respawn();
|
||||
@@ -406,7 +406,7 @@ public:
|
||||
|
||||
if (instance)
|
||||
{
|
||||
Creature *temp = Unit::GetCreature(*me, instance->GetData64(DATA_SACROLASH));
|
||||
Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_SACROLASH));
|
||||
if (temp && temp->isAlive() && !temp->getVictim())
|
||||
temp->AI()->AttackStart(who);
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
Player const * GetPlayerInMap() const
|
||||
Player const* GetPlayerInMap() const
|
||||
{
|
||||
Map::PlayerList const& players = instance->GetPlayers();
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ class boss_archaedas : public CreatureScript
|
||||
DoCast(minion, SPELL_AWAKEN_VAULT_WALKER, flag);
|
||||
minion->CastSpell(minion, SPELL_ARCHAEDAS_AWAKEN, true);
|
||||
minion->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
minion->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE);
|
||||
minion->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
||||
minion->setFaction(14);
|
||||
}
|
||||
}
|
||||
@@ -399,35 +399,6 @@ class go_altar_of_archaedas : public GameObjectScript
|
||||
}
|
||||
};
|
||||
|
||||
/* ScriptData
|
||||
SDName: go_altar_of_the_keepers
|
||||
SD%Complete: 100
|
||||
SDComment: Need 1 person to activate to open the altar. One by one the StoneKeepers will activate. After all four are dead than the door will open.
|
||||
SDCategory: Uldaman
|
||||
EndScriptData */
|
||||
|
||||
class go_altar_of_the_keepers : public GameObjectScript
|
||||
{
|
||||
public:
|
||||
|
||||
go_altar_of_the_keepers()
|
||||
: GameObjectScript("go_altar_of_the_keepers")
|
||||
{
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* /*go*/)
|
||||
{
|
||||
InstanceScript* instance = player->GetInstanceScript();
|
||||
if (!instance)
|
||||
return false;
|
||||
|
||||
player->CastSpell (player, SPELL_BOSS_OBJECT_VISUAL, false);
|
||||
|
||||
instance->SetData(DATA_STONE_KEEPERS, IN_PROGRESS); // activate the Stone Keepers
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
//This is the actual function called only once durring InitScripts()
|
||||
//It must define all handled functions that are to be run in this script
|
||||
void AddSC_boss_archaedas()
|
||||
@@ -436,6 +407,5 @@ void AddSC_boss_archaedas()
|
||||
new mob_archaedas_minions();
|
||||
new mob_stonekeepers();
|
||||
new go_altar_of_archaedas();
|
||||
new go_altar_of_the_keepers();
|
||||
}
|
||||
|
||||
@@ -33,38 +33,38 @@ enum eSpells
|
||||
SPELL_AWAKEN_VAULT_WALKER = 10258,
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_SUB_BOSS_AGGRO = 2228
|
||||
};
|
||||
|
||||
class instance_uldaman : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_uldaman()
|
||||
: InstanceMapScript("instance_uldaman", 70)
|
||||
{
|
||||
}
|
||||
instance_uldaman() : InstanceMapScript("instance_uldaman", 70) {}
|
||||
|
||||
struct instance_uldaman_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_uldaman_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
}
|
||||
instance_uldaman_InstanceMapScript(Map* map) : InstanceScript(map) {}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
|
||||
uiArchaedasGUID = 0;
|
||||
uiIronayaGUID = 0;
|
||||
uiWhoWokeuiArchaedasGUID = 0;
|
||||
archaedasGUID = 0;
|
||||
ironayaGUID = 0;
|
||||
whoWokeuiArchaedasGUID = 0;
|
||||
|
||||
uiAltarOfTheKeeperTempleDoor = 0;
|
||||
uiArchaedasTempleDoor = 0;
|
||||
uiAncientVaultDoor = 0;
|
||||
altarOfTheKeeperTempleDoor = 0;
|
||||
archaedasTempleDoor = 0;
|
||||
ancientVaultDoor = 0;
|
||||
|
||||
uiIronayaSealDoor = 0;
|
||||
ironayaSealDoor = 0;
|
||||
|
||||
uiKeystoneGUID = 0;
|
||||
keystoneGUID = 0;
|
||||
|
||||
uiIronayaSealDoorTimer = 27000; //animation time
|
||||
bKeystoneCheck = false;
|
||||
ironayaSealDoorTimer = 27000; //animation time
|
||||
keystoneCheck = false;
|
||||
}
|
||||
|
||||
bool IsEncounterInProgress() const
|
||||
@@ -76,25 +76,25 @@ class instance_uldaman : public InstanceMapScript
|
||||
return false;
|
||||
}
|
||||
|
||||
uint64 uiArchaedasGUID;
|
||||
uint64 uiIronayaGUID;
|
||||
uint64 uiWhoWokeuiArchaedasGUID;
|
||||
uint64 archaedasGUID;
|
||||
uint64 ironayaGUID;
|
||||
uint64 whoWokeuiArchaedasGUID;
|
||||
|
||||
uint64 uiAltarOfTheKeeperTempleDoor;
|
||||
uint64 uiArchaedasTempleDoor;
|
||||
uint64 uiAncientVaultDoor;
|
||||
uint64 uiIronayaSealDoor;
|
||||
uint64 altarOfTheKeeperTempleDoor;
|
||||
uint64 archaedasTempleDoor;
|
||||
uint64 ancientVaultDoor;
|
||||
uint64 ironayaSealDoor;
|
||||
|
||||
uint64 uiKeystoneGUID;
|
||||
uint64 keystoneGUID;
|
||||
|
||||
uint32 uiIronayaSealDoorTimer;
|
||||
bool bKeystoneCheck;
|
||||
uint32 ironayaSealDoorTimer;
|
||||
bool keystoneCheck;
|
||||
|
||||
std::vector<uint64> vStoneKeeper;
|
||||
std::vector<uint64> vAltarOfTheKeeperCount;
|
||||
std::vector<uint64> vVaultWalker;
|
||||
std::vector<uint64> vEarthenGuardian;
|
||||
std::vector<uint64> vArchaedasWallMinions; // minions lined up around the wall
|
||||
std::vector<uint64> stoneKeepers;
|
||||
std::vector<uint64> altarOfTheKeeperCounts;
|
||||
std::vector<uint64> vaultWalkers;
|
||||
std::vector<uint64> earthenGuardians;
|
||||
std::vector<uint64> archaedasWallMinions; // minions lined up around the wall
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
std::string str_data;
|
||||
@@ -104,14 +104,14 @@ class instance_uldaman : public InstanceMapScript
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case GO_ALTAR_OF_THE_KEEPER_TEMPLE_DOOR: // lock the door
|
||||
uiAltarOfTheKeeperTempleDoor = go->GetGUID();
|
||||
altarOfTheKeeperTempleDoor = go->GetGUID();
|
||||
|
||||
if (m_auiEncounter[0] == DONE)
|
||||
HandleGameObject(0, true, go);
|
||||
break;
|
||||
|
||||
case GO_ARCHAEDAS_TEMPLE_DOOR:
|
||||
uiArchaedasTempleDoor = go->GetGUID();
|
||||
archaedasTempleDoor = go->GetGUID();
|
||||
|
||||
if (m_auiEncounter[0] == DONE)
|
||||
HandleGameObject(0, true, go);
|
||||
@@ -120,21 +120,21 @@ class instance_uldaman : public InstanceMapScript
|
||||
case GO_ANCIENT_VAULT_DOOR:
|
||||
go->SetGoState(GO_STATE_READY);
|
||||
go->SetUInt32Value(GAMEOBJECT_FLAGS, 33);
|
||||
uiAncientVaultDoor = go->GetGUID();
|
||||
ancientVaultDoor = go->GetGUID();
|
||||
|
||||
if (m_auiEncounter[1] == DONE)
|
||||
HandleGameObject(0, true, go);
|
||||
break;
|
||||
|
||||
case GO_IRONAYA_SEAL_DOOR:
|
||||
uiIronayaSealDoor = go->GetGUID();
|
||||
ironayaSealDoor = go->GetGUID();
|
||||
|
||||
if (m_auiEncounter[2] == DONE)
|
||||
HandleGameObject(0, true, go);
|
||||
break;
|
||||
|
||||
case GO_KEYSTONE:
|
||||
uiKeystoneGUID = go->GetGUID();
|
||||
keystoneGUID = go->GetGUID();
|
||||
|
||||
if (m_auiEncounter[2] == DONE)
|
||||
{
|
||||
@@ -174,35 +174,38 @@ class instance_uldaman : public InstanceMapScript
|
||||
|
||||
void ActivateStoneKeepers()
|
||||
{
|
||||
for (std::vector<uint64>::const_iterator i = vStoneKeeper.begin(); i != vStoneKeeper.end(); ++i)
|
||||
if (GetData(DATA_ALTAR_DOORS) != DONE)
|
||||
{
|
||||
Creature* target = instance->GetCreature(*i);
|
||||
if (!target || !target->isAlive() || target->getFaction() == 14)
|
||||
continue;
|
||||
target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
||||
target->setFaction(14);
|
||||
target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
return; // only want the first one we find
|
||||
for (std::vector<uint64>::const_iterator i = stoneKeepers.begin(); i != stoneKeepers.end(); ++i)
|
||||
{
|
||||
Creature* target = instance->GetCreature(*i);
|
||||
if (!target || !target->isAlive())
|
||||
continue;
|
||||
target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
||||
target->setFaction(14);
|
||||
target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
return; // only want the first one we find
|
||||
}
|
||||
// if we get this far than all four are dead so open the door
|
||||
SetData(DATA_ALTAR_DOORS, DONE);
|
||||
SetDoor(archaedasTempleDoor, true); //open next the door too
|
||||
}
|
||||
// if we get this far than all four are dead so open the door
|
||||
SetData(DATA_ALTAR_DOORS, DONE);
|
||||
SetDoor(uiArchaedasTempleDoor, true); //open next the door too
|
||||
}
|
||||
|
||||
void ActivateWallMinions()
|
||||
{
|
||||
Creature* archaedas = instance->GetCreature(uiArchaedasGUID);
|
||||
Creature* archaedas = instance->GetCreature(archaedasGUID);
|
||||
if (!archaedas)
|
||||
return;
|
||||
|
||||
for (std::vector<uint64>::const_iterator i = vArchaedasWallMinions.begin(); i != vArchaedasWallMinions.end(); ++i)
|
||||
for (std::vector<uint64>::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i)
|
||||
{
|
||||
Creature* target = instance->GetCreature(*i);
|
||||
if (!target || !target->isAlive() || target->getFaction() == 14)
|
||||
continue;
|
||||
archaedas->CastSpell(target, SPELL_AWAKEN_VAULT_WALKER, true);
|
||||
target->CastSpell(target, SPELL_ARCHAEDAS_AWAKEN, true);
|
||||
target->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE);
|
||||
target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
||||
target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
target->setFaction(14);
|
||||
return; // only want the first one we find
|
||||
@@ -213,7 +216,7 @@ class instance_uldaman : public InstanceMapScript
|
||||
void DeActivateMinions()
|
||||
{
|
||||
// first despawn any aggroed wall minions
|
||||
for (std::vector<uint64>::const_iterator i = vArchaedasWallMinions.begin(); i != vArchaedasWallMinions.end(); ++i)
|
||||
for (std::vector<uint64>::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i)
|
||||
{
|
||||
Creature* target = instance->GetCreature(*i);
|
||||
if (!target || target->isDead() || target->getFaction() != 14)
|
||||
@@ -223,7 +226,7 @@ class instance_uldaman : public InstanceMapScript
|
||||
}
|
||||
|
||||
// Vault Walkers
|
||||
for (std::vector<uint64>::const_iterator i = vVaultWalker.begin(); i != vVaultWalker.end(); ++i)
|
||||
for (std::vector<uint64>::const_iterator i = vaultWalkers.begin(); i != vaultWalkers.end(); ++i)
|
||||
{
|
||||
Creature* target = instance->GetCreature(*i);
|
||||
if (!target || target->isDead() || target->getFaction() != 14)
|
||||
@@ -233,7 +236,7 @@ class instance_uldaman : public InstanceMapScript
|
||||
}
|
||||
|
||||
// Earthen Guardians
|
||||
for (std::vector<uint64>::const_iterator i = vEarthenGuardian.begin(); i != vEarthenGuardian.end(); ++i)
|
||||
for (std::vector<uint64>::const_iterator i = earthenGuardians.begin(); i != earthenGuardians.end(); ++i)
|
||||
{
|
||||
Creature* target = instance->GetCreature(*i);
|
||||
if (!target || target->isDead() || target->getFaction() != 14)
|
||||
@@ -245,20 +248,20 @@ class instance_uldaman : public InstanceMapScript
|
||||
|
||||
void ActivateArchaedas(uint64 target)
|
||||
{
|
||||
Creature* archaedas = instance->GetCreature(uiArchaedasGUID);
|
||||
Creature* archaedas = instance->GetCreature(archaedasGUID);
|
||||
if (!archaedas)
|
||||
return;
|
||||
|
||||
if (Unit::GetUnit(*archaedas, target))
|
||||
{
|
||||
archaedas->CastSpell(archaedas, SPELL_ARCHAEDAS_AWAKEN, false);
|
||||
uiWhoWokeuiArchaedasGUID = target;
|
||||
whoWokeuiArchaedasGUID = target;
|
||||
}
|
||||
}
|
||||
|
||||
void ActivateIronaya()
|
||||
{
|
||||
Creature* ironaya = instance->GetCreature(uiIronayaGUID);
|
||||
Creature* ironaya = instance->GetCreature(ironayaGUID);
|
||||
if (!ironaya)
|
||||
return;
|
||||
|
||||
@@ -270,7 +273,7 @@ class instance_uldaman : public InstanceMapScript
|
||||
void RespawnMinions()
|
||||
{
|
||||
// first respawn any aggroed wall minions
|
||||
for (std::vector<uint64>::const_iterator i = vArchaedasWallMinions.begin(); i != vArchaedasWallMinions.end(); ++i)
|
||||
for (std::vector<uint64>::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i)
|
||||
{
|
||||
Creature* target = instance->GetCreature(*i);
|
||||
if (target && target->isDead())
|
||||
@@ -282,7 +285,7 @@ class instance_uldaman : public InstanceMapScript
|
||||
}
|
||||
|
||||
// Vault Walkers
|
||||
for (std::vector<uint64>::const_iterator i = vVaultWalker.begin(); i != vVaultWalker.end(); ++i)
|
||||
for (std::vector<uint64>::const_iterator i = vaultWalkers.begin(); i != vaultWalkers.end(); ++i)
|
||||
{
|
||||
Creature* target = instance->GetCreature(*i);
|
||||
if (target && target->isDead())
|
||||
@@ -294,7 +297,7 @@ class instance_uldaman : public InstanceMapScript
|
||||
}
|
||||
|
||||
// Earthen Guardians
|
||||
for (std::vector<uint64>::const_iterator i = vEarthenGuardian.begin(); i != vEarthenGuardian.end(); ++i)
|
||||
for (std::vector<uint64>::const_iterator i = earthenGuardians.begin(); i != earthenGuardians.end(); ++i)
|
||||
{
|
||||
Creature* target = instance->GetCreature(*i);
|
||||
if (target && target->isDead())
|
||||
@@ -307,21 +310,21 @@ class instance_uldaman : public InstanceMapScript
|
||||
}
|
||||
void Update(uint32 diff)
|
||||
{
|
||||
if (!bKeystoneCheck)
|
||||
if (!keystoneCheck)
|
||||
return;
|
||||
|
||||
if (uiIronayaSealDoorTimer <= diff)
|
||||
if (ironayaSealDoorTimer <= diff)
|
||||
{
|
||||
ActivateIronaya();
|
||||
|
||||
SetDoor(uiIronayaSealDoor, true);
|
||||
BlockGO(uiKeystoneGUID);
|
||||
SetDoor(ironayaSealDoor, true);
|
||||
BlockGO(keystoneGUID);
|
||||
|
||||
SetData(DATA_IRONAYA_DOOR, DONE); //save state
|
||||
bKeystoneCheck = false;
|
||||
keystoneCheck = false;
|
||||
}
|
||||
else
|
||||
uiIronayaSealDoorTimer -= diff;
|
||||
ironayaSealDoorTimer -= diff;
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
@@ -331,15 +334,15 @@ class instance_uldaman : public InstanceMapScript
|
||||
case DATA_ALTAR_DOORS:
|
||||
m_auiEncounter[0] = data;
|
||||
if (data == DONE)
|
||||
SetDoor(uiAltarOfTheKeeperTempleDoor, true);
|
||||
SetDoor(altarOfTheKeeperTempleDoor, true);
|
||||
break;
|
||||
|
||||
case DATA_ANCIENT_DOOR:
|
||||
m_auiEncounter[1] = data;
|
||||
if (data == DONE) //archeadas defeat
|
||||
{
|
||||
SetDoor(uiArchaedasTempleDoor, true); //re open enter door
|
||||
SetDoor(uiAncientVaultDoor, true);
|
||||
SetDoor(archaedasTempleDoor, true); //re open enter door
|
||||
SetDoor(ancientVaultDoor, true);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -356,7 +359,7 @@ class instance_uldaman : public InstanceMapScript
|
||||
{
|
||||
case NOT_STARTED:
|
||||
if (m_auiEncounter[0] == DONE) //if players opened the doors
|
||||
SetDoor(uiArchaedasTempleDoor, true);
|
||||
SetDoor(archaedasTempleDoor, true);
|
||||
|
||||
RespawnMinions();
|
||||
break;
|
||||
@@ -372,7 +375,7 @@ class instance_uldaman : public InstanceMapScript
|
||||
break;
|
||||
|
||||
case DATA_IRONAYA_SEAL:
|
||||
bKeystoneCheck = true;
|
||||
keystoneCheck = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -396,7 +399,7 @@ class instance_uldaman : public InstanceMapScript
|
||||
if (type == 0)
|
||||
{
|
||||
ActivateArchaedas (data);
|
||||
SetDoor(uiArchaedasTempleDoor, false); //close when event is started
|
||||
SetDoor(archaedasTempleDoor, false); //close when event is started
|
||||
}
|
||||
}
|
||||
|
||||
@@ -433,34 +436,34 @@ class instance_uldaman : public InstanceMapScript
|
||||
{
|
||||
case 4857: // Stone Keeper
|
||||
SetFrozenState (creature);
|
||||
vStoneKeeper.push_back(creature->GetGUID());
|
||||
stoneKeepers.push_back(creature->GetGUID());
|
||||
break;
|
||||
|
||||
case 7309: // Earthen Custodian
|
||||
vArchaedasWallMinions.push_back(creature->GetGUID());
|
||||
archaedasWallMinions.push_back(creature->GetGUID());
|
||||
break;
|
||||
|
||||
case 7077: // Earthen Hallshaper
|
||||
vArchaedasWallMinions.push_back(creature->GetGUID());
|
||||
archaedasWallMinions.push_back(creature->GetGUID());
|
||||
break;
|
||||
|
||||
case 7076: // Earthen Guardian
|
||||
vEarthenGuardian.push_back(creature->GetGUID());
|
||||
earthenGuardians.push_back(creature->GetGUID());
|
||||
break;
|
||||
|
||||
case 7228: // Ironaya
|
||||
uiIronayaGUID = creature->GetGUID();
|
||||
ironayaGUID = creature->GetGUID();
|
||||
|
||||
if (m_auiEncounter[2] != DONE)
|
||||
SetFrozenState (creature);
|
||||
break;
|
||||
|
||||
case 10120: // Vault Walker
|
||||
vVaultWalker.push_back(creature->GetGUID());
|
||||
vaultWalkers.push_back(creature->GetGUID());
|
||||
break;
|
||||
|
||||
case 2748: // Archaedas
|
||||
uiArchaedasGUID = creature->GetGUID();
|
||||
archaedasGUID = creature->GetGUID();
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -471,25 +474,37 @@ class instance_uldaman : public InstanceMapScript
|
||||
switch (identifier)
|
||||
{
|
||||
case 0:
|
||||
return uiWhoWokeuiArchaedasGUID;
|
||||
return whoWokeuiArchaedasGUID;
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
return vVaultWalker.at(identifier - 1);
|
||||
return vaultWalkers.at(identifier - 1);
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
case 10:
|
||||
return vEarthenGuardian.at(identifier - 5);
|
||||
return earthenGuardians.at(identifier - 5);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
} // end GetData64
|
||||
|
||||
void ProcessEvent(WorldObject* /*gameObject*/, uint32 eventId)
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_SUB_BOSS_AGGRO:
|
||||
SetData(DATA_STONE_KEEPERS, IN_PROGRESS); // activate the Stone Keepers
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
|
||||
@@ -45,32 +45,37 @@ EndScriptData */
|
||||
#define YELL_BERSERK "Whatch you be doing? Pissin' yourselves..."
|
||||
#define SOUND_BERSERK 12025
|
||||
|
||||
#define SPELL_DUAL_WIELD 29651
|
||||
#define SPELL_SABER_LASH 43267
|
||||
#define SPELL_FRENZY 43139
|
||||
#define SPELL_FLAMESHOCK 43303
|
||||
#define SPELL_EARTHSHOCK 43305
|
||||
#define SPELL_TRANSFORM_SPLIT 43142
|
||||
#define SPELL_TRANSFORM_SPLIT2 43573
|
||||
#define SPELL_TRANSFORM_MERGE 43271
|
||||
#define SPELL_SUMMON_LYNX 43143
|
||||
#define SPELL_SUMMON_TOTEM 43302
|
||||
#define SPELL_BERSERK 45078
|
||||
enum Spells
|
||||
{
|
||||
SPELL_DUAL_WIELD = 29651,
|
||||
SPELL_SABER_LASH = 43267,
|
||||
SPELL_FRENZY = 43139,
|
||||
SPELL_FLAMESHOCK = 43303,
|
||||
SPELL_EARTHSHOCK = 43305,
|
||||
SPELL_TRANSFORM_SPLIT = 43142,
|
||||
SPELL_TRANSFORM_SPLIT2 = 43573,
|
||||
SPELL_TRANSFORM_MERGE = 43271,
|
||||
SPELL_SUMMON_LYNX = 43143,
|
||||
SPELL_SUMMON_TOTEM = 43302,
|
||||
SPELL_BERSERK = 45078,
|
||||
SPELL_LYNX_FRENZY = 43290, // Used by Spirit Lynx
|
||||
SPELL_SHRED_ARMOR = 43243 // Used by Spirit Lynx
|
||||
};
|
||||
|
||||
#define MOB_SPIRIT_LYNX 24143
|
||||
#define SPELL_LYNX_FRENZY 43290
|
||||
#define SPELL_SHRED_ARMOR 43243
|
||||
|
||||
#define MOB_TOTEM 24224
|
||||
enum Hal_CreatureIds
|
||||
{
|
||||
NPC_SPIRIT_LYNX = 24143,
|
||||
NPC_TOTEM = 24224
|
||||
};
|
||||
|
||||
enum PhaseHalazzi
|
||||
{
|
||||
PHASE_NONE = 0,
|
||||
PHASE_LYNX = 1,
|
||||
PHASE_SPLIT = 2,
|
||||
PHASE_HUMAN = 3,
|
||||
PHASE_MERGE = 4,
|
||||
PHASE_ENRAGE = 5
|
||||
PHASE_NONE = 0,
|
||||
PHASE_LYNX = 1,
|
||||
PHASE_SPLIT = 2,
|
||||
PHASE_HUMAN = 3,
|
||||
PHASE_MERGE = 4,
|
||||
PHASE_ENRAGE = 5
|
||||
};
|
||||
|
||||
class boss_halazzi : public CreatureScript
|
||||
@@ -134,7 +139,7 @@ class boss_halazzi : public CreatureScript
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summon->AI()->AttackStart(me->getVictim());
|
||||
if (summon->GetEntry() == MOB_SPIRIT_LYNX)
|
||||
if (summon->GetEntry() == NPC_SPIRIT_LYNX)
|
||||
LynxGUID = summon->GetGUID();
|
||||
}
|
||||
|
||||
@@ -183,7 +188,7 @@ class boss_halazzi : public CreatureScript
|
||||
break;
|
||||
case PHASE_HUMAN:
|
||||
//DoCast(me, SPELL_SUMMON_LYNX, true);
|
||||
DoSpawnCreature(MOB_SPIRIT_LYNX, 5, 5, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
DoSpawnCreature(NPC_SPIRIT_LYNX, 5, 5, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
me->SetMaxHealth(400000);
|
||||
me->SetHealth(400000);
|
||||
ShockTimer = 10000;
|
||||
@@ -413,3 +418,4 @@ void AddSC_boss_halazzi()
|
||||
new mob_halazzi_lynx();
|
||||
}
|
||||
|
||||
|
||||
@@ -314,7 +314,7 @@ class npc_harrison_jones : public CreatureScript
|
||||
me->SetEntry(NPC_HARRISON_JONES_2);
|
||||
me->SetDisplayId(MODEL_HARRISON_JONES_2);
|
||||
me->SetTarget(0);
|
||||
me->SetByteValue(UNIT_FIELD_BYTES_1,0,UNIT_STAND_STATE_DEAD);
|
||||
me->SetByteValue(UNIT_FIELD_BYTES_1, 0,UNIT_STAND_STATE_DEAD);
|
||||
me->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
if (instance)
|
||||
instance->SetData(DATA_GONGEVENT, DONE);
|
||||
@@ -330,7 +330,7 @@ class npc_harrison_jones : public CreatureScript
|
||||
switch (_gongEvent)
|
||||
{
|
||||
case GONG_EVENT_1:
|
||||
me->GetMotionMaster()->MovePath(HARRISON_MOVE_1,false);
|
||||
me->GetMotionMaster()->MovePath(HARRISON_MOVE_1, false);
|
||||
_gongEvent = GONG_EVENT_2;
|
||||
_gongTimer = 12000;
|
||||
break;
|
||||
@@ -345,14 +345,14 @@ class npc_harrison_jones : public CreatureScript
|
||||
break;
|
||||
case GONG_EVENT_3:
|
||||
if (GameObject* gong = me->GetMap()->GetGameObject(instance->GetData64(GO_STRANGE_GONG)))
|
||||
gong->RemoveFlag(GAMEOBJECT_FLAGS,GO_FLAG_NOT_SELECTABLE);
|
||||
gong->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
_gongEvent = GONG_EVENT_4;
|
||||
_gongTimer = 105000;
|
||||
break;
|
||||
case GONG_EVENT_4:
|
||||
me->RemoveAura(SPELL_BANGING_THE_GONG);
|
||||
if (GameObject* gong = me->GetMap()->GetGameObject(instance->GetData64(GO_STRANGE_GONG)))
|
||||
gong->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_NOT_SELECTABLE);
|
||||
gong->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
|
||||
// trigger or gong will need to be scripted to set IN_PROGRESS after enough hits.
|
||||
// This is temp workaround.
|
||||
@@ -362,7 +362,7 @@ class npc_harrison_jones : public CreatureScript
|
||||
if (instance->GetData(DATA_GONGEVENT) == IN_PROGRESS)
|
||||
{
|
||||
// Players are Now Saved to instance at SPECIAL (Player should be notified?)
|
||||
me->GetMotionMaster()->MovePath(HARRISON_MOVE_2,false);
|
||||
me->GetMotionMaster()->MovePath(HARRISON_MOVE_2, false);
|
||||
_gongEvent = GONG_EVENT_5;
|
||||
_gongTimer = 5000;
|
||||
}
|
||||
@@ -401,12 +401,12 @@ class npc_harrison_jones : public CreatureScript
|
||||
ptarget->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_SPEAR));
|
||||
ptarget->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
|
||||
ptarget->SetReactState(REACT_PASSIVE);
|
||||
ptarget->AI()->SetData(0,1);
|
||||
ptarget->AI()->SetData(0, 1);
|
||||
}
|
||||
else
|
||||
ptarget->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
|
||||
ptarget->SetReactState(REACT_PASSIVE);
|
||||
ptarget->AI()->SetData(0,2);
|
||||
ptarget->AI()->SetData(0, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -421,7 +421,7 @@ class npc_harrison_jones : public CreatureScript
|
||||
DoCast(me, SPELL_STEALTH);
|
||||
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(0));
|
||||
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
|
||||
me->GetMotionMaster()->MovePath(HARRISON_MOVE_3,false);
|
||||
me->GetMotionMaster()->MovePath(HARRISON_MOVE_3, false);
|
||||
_gongTimer = 1000;
|
||||
_gongEvent = 0;
|
||||
break;
|
||||
|
||||
@@ -225,7 +225,7 @@ class boss_mandokir : public CreatureScript
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SetGUID(uint64 guid, int32 type/* = 0 */)
|
||||
void SetGUID(uint64 guid, int32 /*type = 0 */)
|
||||
{
|
||||
_reviveGUID = guid;
|
||||
}
|
||||
@@ -341,7 +341,7 @@ class npc_ohgan : public CreatureScript
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 const diff)
|
||||
void UpdateAI(uint32 const /*diff*/)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
@@ -378,7 +378,7 @@ class npc_chained_spirit : public CreatureScript
|
||||
_revivePlayerGUID = 0;
|
||||
}
|
||||
|
||||
void SetGUID(uint64 guid, int32 type/* = 0 */)
|
||||
void SetGUID(uint64 guid, int32 /*type = 0 */)
|
||||
{
|
||||
_revivePlayerGUID = guid;
|
||||
}
|
||||
@@ -711,7 +711,6 @@ class spell_mandokir_reanimate_ohgan : public SpellScriptLoader
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
target->RemoveAura(SPELL_PERMANENT_FEIGN_DEATH);
|
||||
|
||||
@@ -189,10 +189,10 @@ class npc_winterfin_playmate : public CreatureScript
|
||||
return;
|
||||
}
|
||||
|
||||
switch(phase)
|
||||
switch (phase)
|
||||
{
|
||||
case 1:
|
||||
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5,me->GetPositionY() + sin(me->GetOrientation()) * 5, me->GetPositionZ());
|
||||
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + sin(me->GetOrientation()) * 5, me->GetPositionZ());
|
||||
orphan->AI()->Talk(TEXT_ORACLE_ORPHAN_1);
|
||||
timer = 3000;
|
||||
break;
|
||||
@@ -290,7 +290,7 @@ class npc_snowfall_glade_playmate : public CreatureScript
|
||||
switch (phase)
|
||||
{
|
||||
case 1:
|
||||
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5,me->GetPositionY() + sin(me->GetOrientation()) * 5, me->GetPositionZ());
|
||||
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + sin(me->GetOrientation()) * 5, me->GetPositionZ());
|
||||
orphan->AI()->Talk(TEXT_WOLVAR_ORPHAN_1);
|
||||
timer = 5000;
|
||||
break;
|
||||
@@ -810,7 +810,7 @@ class npc_alexstraza_the_lifebinder : public CreatureScript
|
||||
timer = 5000;
|
||||
break;
|
||||
case 8:
|
||||
if(Creature* krasus = me->FindNearestCreature(NPC_KRASUS, 10.0f))
|
||||
if (Creature* krasus = me->FindNearestCreature(NPC_KRASUS, 10.0f))
|
||||
{
|
||||
orphan->SetFacingToObject(krasus);
|
||||
krasus->AI()->Talk(TEXT_KRASUS_8);
|
||||
@@ -974,7 +974,7 @@ class npc_cw_area_trigger : public CreatureScript
|
||||
if (Creature* samuro = me->FindNearestCreature(25151, 20.0f))
|
||||
{
|
||||
uint32 emote = 0;
|
||||
switch(urand(1,5))
|
||||
switch (urand(1, 5))
|
||||
{
|
||||
case 1:
|
||||
emote = EMOTE_ONESHOT_WAVE;
|
||||
|
||||
@@ -544,7 +544,7 @@ public:
|
||||
switch (AnimationCount)
|
||||
{
|
||||
case 0:
|
||||
Talk(ANACHRONOS_SAY_1,Fandral->GetGUID());
|
||||
Talk(ANACHRONOS_SAY_1, Fandral->GetGUID());
|
||||
break;
|
||||
case 1:
|
||||
Fandral->SetTarget(me->GetGUID());
|
||||
|
||||
@@ -141,7 +141,7 @@ public:
|
||||
Talk(SAY_GIL_FREEBOOTERS, player->GetGUID());
|
||||
break;
|
||||
case 37:
|
||||
Talk(SAY_GIL_ALMOST,player->GetGUID());
|
||||
Talk(SAY_GIL_ALMOST, player->GetGUID());
|
||||
break;
|
||||
case 47:
|
||||
Talk(SAY_GIL_SWEET, player->GetGUID());
|
||||
|
||||
@@ -89,11 +89,11 @@ public:
|
||||
{
|
||||
_EnterCombat();
|
||||
|
||||
events.ScheduleEvent(EVENT_ROOT, urand(5,9)*IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_BASH, urand(10,14)*IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_BOLT, urand(15,20)*IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_MINI, urand(12,18)*IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_SPAWN, 5 *IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_ROOT, urand(5, 9) * IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_BASH, urand(10, 14) * IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_BOLT, urand(15, 20) * IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_MINI, urand(12, 18) * IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_SPAWN, 5 * IN_MILLISECONDS);
|
||||
|
||||
me->SetInCombatWithZone();
|
||||
if (instance)
|
||||
@@ -123,7 +123,7 @@ public:
|
||||
{
|
||||
u = 1 - u;
|
||||
trigger->DisappearAndDie();
|
||||
me->SummonCreature(u > 0 ? NPC_POISONOUS_MUSHROOM : NPC_HEALTHY_MUSHROOM, pos, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60*IN_MILLISECONDS);
|
||||
me->SummonCreature(u > 0 ? NPC_POISONOUS_MUSHROOM : NPC_HEALTHY_MUSHROOM, pos, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60 * IN_MILLISECONDS);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -145,23 +145,23 @@ public:
|
||||
{
|
||||
case EVENT_SPAWN:
|
||||
SpawnAdds();
|
||||
events.ScheduleEvent(EVENT_SPAWN, 20*IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_SPAWN, 20 * IN_MILLISECONDS);
|
||||
break;
|
||||
case EVENT_MINI:
|
||||
DoCast(SPELL_MINI);
|
||||
events.ScheduleEvent(EVENT_MINI, urand(25,30)*IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_MINI, urand(25, 30) * IN_MILLISECONDS);
|
||||
break;
|
||||
case EVENT_ROOT:
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM,0, 100, true),SPELL_ENTANGLING_ROOTS,true);
|
||||
events.ScheduleEvent(EVENT_ROOT, urand(10,15)*IN_MILLISECONDS);
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_ENTANGLING_ROOTS, true);
|
||||
events.ScheduleEvent(EVENT_ROOT, urand(10, 15) * IN_MILLISECONDS);
|
||||
break;
|
||||
case EVENT_BASH:
|
||||
DoCastVictim(SPELL_BASH);
|
||||
events.ScheduleEvent(EVENT_BASH, urand(7,12)*IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_BASH, urand(7, 12) * IN_MILLISECONDS);
|
||||
break;
|
||||
case EVENT_BOLT:
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM,0, 100, true),SPELL_VENOM_BOLT_VOLLEY,true);
|
||||
events.ScheduleEvent(EVENT_BOLT, urand(18,22)*IN_MILLISECONDS);
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_VENOM_BOLT_VOLLEY, true);
|
||||
events.ScheduleEvent(EVENT_BOLT, urand(18, 22) * IN_MILLISECONDS);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -191,7 +191,7 @@ public:
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_AURA, 1*IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_AURA, 1 * IN_MILLISECONDS);
|
||||
|
||||
me->SetDisplayId(me->GetCreatureTemplate()->Modelid2);
|
||||
DoCast(SPELL_PUTRID_MUSHROOM);
|
||||
@@ -231,7 +231,7 @@ public:
|
||||
DoCast(me, SPELL_POISONOUS_MUSHROOM_VISUAL_AREA, true);
|
||||
DoCast(me, SPELL_POISONOUS_MUSHROOM_POISON_CLOUD);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_AURA, 7*IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_AURA, 7 * IN_MILLISECONDS);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -250,4 +250,4 @@ void AddSC_boss_amanitar()
|
||||
{
|
||||
new boss_amanitar();
|
||||
new mob_amanitar_mushrooms();
|
||||
}
|
||||
}
|
||||
@@ -94,13 +94,13 @@ class boss_elder_nadox : public CreatureScript
|
||||
if (instance)
|
||||
instance->SetData(DATA_ELDER_NADOX_EVENT, IN_PROGRESS);
|
||||
|
||||
events.ScheduleEvent(EVENT_PLAGUE, 13*IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_SUMMON_SWARMER, 10*IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_PLAGUE, 13 * IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_SUMMON_SWARMER, 10 * IN_MILLISECONDS);
|
||||
|
||||
if (IsHeroic())
|
||||
{
|
||||
events.ScheduleEvent(EVENT_RAGE, 12*IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_CHECK_ENRAGE, 5*IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_RAGE, 12 * IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_CHECK_ENRAGE, 5 * IN_MILLISECONDS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,25 +151,25 @@ class boss_elder_nadox : public CreatureScript
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_PLAGUE:
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM,0, 100, true),SPELL_BROOD_PLAGUE,true);
|
||||
events.ScheduleEvent(EVENT_PLAGUE, 15*IN_MILLISECONDS);
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_BROOD_PLAGUE, true);
|
||||
events.ScheduleEvent(EVENT_PLAGUE, 15 * IN_MILLISECONDS);
|
||||
break;
|
||||
case EVENT_RAGE:
|
||||
DoCast(H_SPELL_BROOD_RAGE);
|
||||
events.ScheduleEvent(EVENT_RAGE, urand(10*IN_MILLISECONDS, 50*IN_MILLISECONDS));
|
||||
events.ScheduleEvent(EVENT_RAGE, urand(10 * IN_MILLISECONDS, 50 * IN_MILLISECONDS));
|
||||
break;
|
||||
case EVENT_SUMMON_SWARMER:
|
||||
DoCast(me, SPELL_SUMMON_SWARMERS);
|
||||
if (urand(1, 3) == 3) // 33% chance of dialog
|
||||
Talk(SAY_EGG_SAC);
|
||||
events.ScheduleEvent(EVENT_SUMMON_SWARMER, 10*IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_SUMMON_SWARMER, 10 * IN_MILLISECONDS);
|
||||
break;
|
||||
case EVENT_CHECK_ENRAGE:
|
||||
if (me->HasAura(SPELL_ENRAGE))
|
||||
return;
|
||||
if (me->GetPositionZ() < 24.0f)
|
||||
DoCast(me, SPELL_ENRAGE, true);
|
||||
events.ScheduleEvent(EVENT_CHECK_ENRAGE, 5*IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_CHECK_ENRAGE, 5 * IN_MILLISECONDS);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -209,7 +209,7 @@ class mob_ahnkahar_nerubian : public CreatureScript
|
||||
if (me->GetEntry() == NPC_AHNKAHAR_GUARDIAN)
|
||||
DoCast(me, SPELL_GUARDIAN_AURA, true);
|
||||
|
||||
events.ScheduleEvent(EVENT_SPRINT, 13*IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_SPRINT, 13 * IN_MILLISECONDS);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
@@ -234,7 +234,7 @@ class mob_ahnkahar_nerubian : public CreatureScript
|
||||
{
|
||||
case EVENT_SPRINT:
|
||||
DoCast(me, SPELL_SPRINT);
|
||||
events.ScheduleEvent(EVENT_SPRINT, 20*IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_SPRINT, 20 * IN_MILLISECONDS);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+11
-6
@@ -135,13 +135,18 @@ class boss_general_zarithrian : public CreatureScript
|
||||
Talk(SAY_KILL);
|
||||
}
|
||||
|
||||
bool CanAIAttack(Unit const* /*target*/) const
|
||||
{
|
||||
return (instance->GetBossState(DATA_SAVIANA_RAGEFIRE) == DONE && instance->GetBossState(DATA_BALTHARUS_THE_WARBORN) == DONE);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 const diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
// Can't use room boundary here, the gameobject is spawned at the same position as the boss. This is just as good anyway.
|
||||
if (me->GetPositionX() > 3060.0f)
|
||||
if (me->GetPositionX() > 3058.0f)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
@@ -159,9 +164,11 @@ class boss_general_zarithrian : public CreatureScript
|
||||
case EVENT_SUMMON_ADDS:
|
||||
{
|
||||
if (Creature* stalker1 = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_ZARITHRIAN_SPAWN_STALKER_1)))
|
||||
stalker1->AI()->DoCast(stalker1, SPELL_SUMMON_FLAMECALLER);
|
||||
stalker1->CastSpell(stalker1, SPELL_SUMMON_FLAMECALLER, false);
|
||||
|
||||
if (Creature* stalker2 = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_ZARITHRIAN_SPAWN_STALKER_2)))
|
||||
stalker2->AI()->DoCast(stalker2, SPELL_SUMMON_FLAMECALLER);
|
||||
stalker2->CastSpell(stalker2, SPELL_SUMMON_FLAMECALLER, false);
|
||||
|
||||
Talk(SAY_ADDS);
|
||||
events.ScheduleEvent(EVENT_SUMMON_ADDS, 42000);
|
||||
break;
|
||||
@@ -195,9 +202,8 @@ class npc_onyx_flamecaller : public CreatureScript
|
||||
|
||||
struct npc_onyx_flamecallerAI : public npc_escortAI
|
||||
{
|
||||
npc_onyx_flamecallerAI(Creature* creature) : npc_escortAI(creature)
|
||||
npc_onyx_flamecallerAI(Creature* creature) : npc_escortAI(creature), _instance(creature->GetInstanceScript())
|
||||
{
|
||||
_instance = creature->GetInstanceScript();
|
||||
npc_escortAI::SetDespawnAtEnd(false);
|
||||
}
|
||||
|
||||
@@ -289,7 +295,6 @@ class npc_onyx_flamecaller : public CreatureScript
|
||||
}
|
||||
private:
|
||||
EventMap _events;
|
||||
bool _movementComplete;
|
||||
InstanceScript* _instance;
|
||||
uint8 _lavaGoutCount;
|
||||
};
|
||||
|
||||
@@ -225,9 +225,9 @@ struct generic_halionAI : public BossAI
|
||||
{
|
||||
generic_halionAI(Creature* creature, uint32 bossId) : BossAI(creature, bossId), _canEvade(false) { }
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
BossAI::EnterCombat(who);
|
||||
_EnterCombat();
|
||||
me->AddAura(SPELL_TWILIGHT_PRECISION, me);
|
||||
_canEvade = false;
|
||||
events.ScheduleEvent(EVENT_CLEAVE, urand(8000, 10000));
|
||||
@@ -238,13 +238,13 @@ struct generic_halionAI : public BossAI
|
||||
void Reset()
|
||||
{
|
||||
_canEvade = false;
|
||||
BossAI::Reset();
|
||||
_Reset();
|
||||
}
|
||||
|
||||
void EnterEvadeMode()
|
||||
void JustReachedHome()
|
||||
{
|
||||
BossAI::EnterEvadeMode();
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
|
||||
_JustReachedHome();
|
||||
}
|
||||
|
||||
void ExecuteEvent(uint32 const eventId)
|
||||
@@ -348,15 +348,20 @@ class boss_halion : public CreatureScript
|
||||
controller->AI()->SetData(DATA_FIGHT_PHASE, PHASE_ONE);
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
BossAI::JustDied(killer);
|
||||
_JustDied();
|
||||
|
||||
Talk(SAY_DEATH);
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
|
||||
|
||||
if (Creature* twilightHalion = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_TWILIGHT_HALION)))
|
||||
if (twilightHalion->isAlive())
|
||||
twilightHalion->Kill(twilightHalion);
|
||||
|
||||
if (Creature* controller = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_HALION_CONTROLLER)))
|
||||
me->Kill(controller);
|
||||
if (controller->isAlive())
|
||||
controller->Kill(controller);
|
||||
}
|
||||
|
||||
Position const* GetMeteorStrikePosition() const { return &_meteorStrikePos; }
|
||||
@@ -514,7 +519,8 @@ class boss_twilight_halion : public CreatureScript
|
||||
}
|
||||
|
||||
if (Creature* controller = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_HALION_CONTROLLER)))
|
||||
controller->Kill(controller);
|
||||
if (controller->isAlive())
|
||||
controller->Kill(controller);
|
||||
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
|
||||
}
|
||||
@@ -591,7 +597,6 @@ class npc_halion_controller : public CreatureScript
|
||||
_instance(creature->GetInstanceScript()), _summons(me)
|
||||
{
|
||||
me->SetPhaseMask(me->GetPhaseMask() | 0x20, true);
|
||||
_events.SetPhase(PHASE_INTRO);
|
||||
}
|
||||
|
||||
void Reset()
|
||||
|
||||
+17
-5
@@ -60,8 +60,11 @@ class instance_ruby_sanctum : public InstanceMapScript
|
||||
void OnPlayerEnter(Player* /*player*/)
|
||||
{
|
||||
if (!GetData64(DATA_HALION_CONTROLLER) && GetBossState(DATA_HALION) != DONE && GetBossState(DATA_GENERAL_ZARITHRIAN) == DONE)
|
||||
{
|
||||
instance->LoadGrid(HalionControllerSpawnPos.GetPositionX(), HalionControllerSpawnPos.GetPositionY());
|
||||
if (Creature* halionController = instance->SummonCreature(NPC_HALION_CONTROLLER, HalionControllerSpawnPos))
|
||||
halionController->AI()->DoAction(ACTION_INTRO_HALION);
|
||||
}
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature)
|
||||
@@ -164,6 +167,20 @@ class instance_ruby_sanctum : public InstanceMapScript
|
||||
}
|
||||
}
|
||||
|
||||
void OnUnitDeath(Unit* unit)
|
||||
{
|
||||
Creature* creature = unit->ToCreature();
|
||||
if (!creature)
|
||||
return;
|
||||
|
||||
if (creature->GetEntry() == NPC_GENERAL_ZARITHRIAN && GetBossState(DATA_HALION) != DONE)
|
||||
{
|
||||
instance->LoadGrid(HalionControllerSpawnPos.GetPositionX(), HalionControllerSpawnPos.GetPositionY());
|
||||
if (Creature* halionController = instance->SummonCreature(NPC_HALION_CONTROLLER, HalionControllerSpawnPos))
|
||||
halionController->AI()->DoAction(ACTION_INTRO_HALION);
|
||||
}
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 type) const
|
||||
{
|
||||
switch (type)
|
||||
@@ -238,11 +255,6 @@ class instance_ruby_sanctum : public InstanceMapScript
|
||||
{
|
||||
if (GetBossState(DATA_SAVIANA_RAGEFIRE) == DONE && GetBossState(DATA_BALTHARUS_THE_WARBORN) == DONE)
|
||||
HandleGameObject(FlameWallsGUID, state != IN_PROGRESS);
|
||||
|
||||
// Not called at instance loading, no big deal.
|
||||
if (state == DONE && GetBossState(DATA_HALION) != DONE)
|
||||
if (Creature* halionController = instance->SummonCreature(NPC_HALION_CONTROLLER, HalionControllerSpawnPos))
|
||||
halionController->AI()->DoAction(ACTION_INTRO_HALION);
|
||||
break;
|
||||
}
|
||||
case DATA_HALION:
|
||||
|
||||
+1
-1
@@ -182,7 +182,7 @@ class boss_jaraxxus : public CreatureScript
|
||||
events.ScheduleEvent(EVENT_INCINERATE_FLESH, urand(20*IN_MILLISECONDS, 25*IN_MILLISECONDS));
|
||||
return;
|
||||
case EVENT_NETHER_POWER:
|
||||
me->CastCustomSpell(SPELL_NETHER_POWER, SPELLVALUE_AURA_STACK, RAID_MODE<uint32>(5, 10, 5,10), me, true);
|
||||
me->CastCustomSpell(SPELL_NETHER_POWER, SPELLVALUE_AURA_STACK, RAID_MODE<uint32>(5, 10, 5, 10), me, true);
|
||||
events.ScheduleEvent(EVENT_NETHER_POWER, 40*IN_MILLISECONDS);
|
||||
return;
|
||||
case EVENT_LEGION_FLAME:
|
||||
|
||||
+2
-2
@@ -136,8 +136,8 @@ const Position AnubarakLoc[]=
|
||||
const Position EndSpawnLoc[]=
|
||||
{
|
||||
{648.9167f, 131.0208f, 141.6161f, 0}, // 0 - Highlord Tirion Fordring
|
||||
{649.1614f, 142.0399f, 141.3057f ,0}, // 1 - Argent Mage
|
||||
{644.6250f, 149.2743f, 140.6015f ,0} // 2 - Portal to Dalaran
|
||||
{649.1614f, 142.0399f, 141.3057f, 0}, // 1 - Argent Mage
|
||||
{644.6250f, 149.2743f, 140.6015f, 0} // 2 - Portal to Dalaran
|
||||
};
|
||||
|
||||
enum euiWorldStates
|
||||
|
||||
@@ -109,7 +109,7 @@ struct outroPosition
|
||||
{ { 0, 0 }, { 0.0f, 0.0f, 0.0f, 0.0f } }
|
||||
};
|
||||
|
||||
Position const CrucibleSummonPos = {5672.294f,2520.686f, 713.4386f, 0.9599311f};
|
||||
Position const CrucibleSummonPos = {5672.294f, 2520.686f, 713.4386f, 0.9599311f};
|
||||
|
||||
#define DATA_THREE_FACED 1
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ public:
|
||||
|
||||
if (TempSummon* _me = me->ToTempSummon())
|
||||
if (Creature* sladran = _me->GetSummoner()->ToCreature())
|
||||
sladran->AI()->SetGUID(target->GetGUID() ,DATA_SNAKES_WHYD_IT_HAVE_TO_BE_SNAKES);
|
||||
sladran->AI()->SetGUID(target->GetGUID(), DATA_SNAKES_WHYD_IT_HAVE_TO_BE_SNAKES);
|
||||
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
@@ -20,25 +20,33 @@
|
||||
#include "naxxramas.h"
|
||||
#include "SpellInfo.h"
|
||||
|
||||
#define SPELL_BOMBARD_SLIME 28280
|
||||
enum Spells
|
||||
{
|
||||
SPELL_BOMBARD_SLIME = 28280,
|
||||
SPELL_POISON_CLOUD = 28240,
|
||||
SPELL_MUTATING_INJECTION = 28169,
|
||||
SPELL_SLIME_SPRAY = 28157,
|
||||
H_SPELL_SLIME_SPRAY = 54364,
|
||||
SPELL_BERSERK = 26662,
|
||||
SPELL_POISON_CLOUD_ADD = 59116
|
||||
};
|
||||
|
||||
#define SPELL_POISON_CLOUD 28240
|
||||
#define SPELL_MUTATING_INJECTION 28169
|
||||
#define SPELL_SLIME_SPRAY RAID_MODE(28157, 54364)
|
||||
#define SPELL_BERSERK 26662
|
||||
#define SPELL_POISON_CLOUD_ADD 59116
|
||||
enum Events
|
||||
{
|
||||
EVENT_BERSERK = 0,
|
||||
EVENT_CLOUD = 1,
|
||||
EVENT_INJECT = 2,
|
||||
EVENT_SPRAY = 3
|
||||
};
|
||||
|
||||
#define EVENT_BERSERK 1
|
||||
#define EVENT_CLOUD 2
|
||||
#define EVENT_INJECT 3
|
||||
#define EVENT_SPRAY 4
|
||||
|
||||
#define MOB_FALLOUT_SLIME 16290
|
||||
enum CreatureId
|
||||
{
|
||||
MOB_FALLOUT_SLIME = 16290
|
||||
};
|
||||
|
||||
class boss_grobbulus : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_grobbulus() : CreatureScript("boss_grobbulus") { }
|
||||
public: boss_grobbulus() : CreatureScript("boss_grobbulus") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
|
||||
@@ -603,7 +603,7 @@ public:
|
||||
ThreatContainer::StorageType const &threatList = me->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr)
|
||||
{
|
||||
Unit * const target = (*itr)->getTarget();
|
||||
Unit* const target = (*itr)->getTarget();
|
||||
|
||||
if (target->GetTypeId() == TYPEID_PLAYER
|
||||
&& target->getPowerType() == POWER_MANA
|
||||
|
||||
@@ -167,7 +167,7 @@ enum Texts
|
||||
|
||||
#define MAX_HOVER_DISK_WAYPOINTS 18
|
||||
|
||||
// Sniffed data (x, y,z)
|
||||
// Sniffed data (x, y, z)
|
||||
const Position HoverDiskWaypoints[MAX_HOVER_DISK_WAYPOINTS] =
|
||||
{
|
||||
{782.9821f, 1296.652f, 282.1114f, 0.0f},
|
||||
@@ -192,7 +192,7 @@ const Position HoverDiskWaypoints[MAX_HOVER_DISK_WAYPOINTS] =
|
||||
|
||||
#define GROUND_Z 268
|
||||
|
||||
// Source: Sniffs (x,y,z)
|
||||
// Source: Sniffs (x, y, z)
|
||||
#define MALYGOS_MAX_WAYPOINTS 16
|
||||
const Position MalygosPhaseTwoWaypoints[MALYGOS_MAX_WAYPOINTS] =
|
||||
{
|
||||
|
||||
@@ -787,7 +787,7 @@ class instance_ulduar : public InstanceMapScript
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool CheckAchievementCriteriaMeet(uint32 criteriaId, Player const* , Unit const* /* = NULL */, uint32 /* = 0 */)
|
||||
bool CheckAchievementCriteriaMeet(uint32 criteriaId, Player const*, Unit const* /* = NULL */, uint32 /* = 0 */)
|
||||
{
|
||||
switch (criteriaId)
|
||||
{
|
||||
|
||||
+14
-14
@@ -124,10 +124,10 @@ public:
|
||||
events.Reset();
|
||||
events.SetPhase(PHASE_HUMAN);
|
||||
|
||||
events.ScheduleEvent(EVENT_CLEAVE, urand(6,12)*IN_MILLISECONDS, 0, PHASE_HUMAN);
|
||||
events.ScheduleEvent(EVENT_STAGGERING_ROAR, urand(18,21)*IN_MILLISECONDS, 0, PHASE_HUMAN);
|
||||
events.ScheduleEvent(EVENT_ENRAGE, urand(7,14)*IN_MILLISECONDS, 0, PHASE_HUMAN);
|
||||
events.ScheduleEvent(EVENT_SMASH, urand(12,17)*IN_MILLISECONDS, 0, PHASE_HUMAN);
|
||||
events.ScheduleEvent(EVENT_CLEAVE, urand(6, 12)*IN_MILLISECONDS, 0, PHASE_HUMAN);
|
||||
events.ScheduleEvent(EVENT_STAGGERING_ROAR, urand(18, 21)*IN_MILLISECONDS, 0, PHASE_HUMAN);
|
||||
events.ScheduleEvent(EVENT_ENRAGE, urand(7, 14)*IN_MILLISECONDS, 0, PHASE_HUMAN);
|
||||
events.ScheduleEvent(EVENT_SMASH, urand(12, 17)*IN_MILLISECONDS, 0, PHASE_HUMAN);
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_INGVAR_EVENT, NOT_STARTED);
|
||||
@@ -193,9 +193,9 @@ public:
|
||||
void ScheduleSecondPhase()
|
||||
{
|
||||
events.SetPhase(PHASE_UNDEAD);
|
||||
events.ScheduleEvent(EVENT_DARK_SMASH, urand(14,18)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
|
||||
events.ScheduleEvent(EVENT_DREADFUL_ROAR, urand(18,22)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
|
||||
events.ScheduleEvent(EVENT_WOE_STRIKE, urand(10,14)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
|
||||
events.ScheduleEvent(EVENT_DARK_SMASH, urand(14, 18)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
|
||||
events.ScheduleEvent(EVENT_DREADFUL_ROAR, urand(18, 22)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
|
||||
events.ScheduleEvent(EVENT_WOE_STRIKE, urand(10, 14)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
|
||||
events.ScheduleEvent(EVENT_SHADOW_AXE, 30*IN_MILLISECONDS, 0, PHASE_UNDEAD);
|
||||
}
|
||||
|
||||
@@ -221,19 +221,19 @@ public:
|
||||
// PHASE ONE
|
||||
case EVENT_CLEAVE:
|
||||
DoCastVictim(SPELL_CLEAVE);
|
||||
events.ScheduleEvent(EVENT_CLEAVE, urand(6,12)*IN_MILLISECONDS, 0, PHASE_HUMAN);
|
||||
events.ScheduleEvent(EVENT_CLEAVE, urand(6, 12)*IN_MILLISECONDS, 0, PHASE_HUMAN);
|
||||
break;
|
||||
case EVENT_STAGGERING_ROAR:
|
||||
DoCast(me, SPELL_STAGGERING_ROAR);
|
||||
events.ScheduleEvent(EVENT_STAGGERING_ROAR, urand(18,22)*IN_MILLISECONDS, 0, PHASE_HUMAN);
|
||||
events.ScheduleEvent(EVENT_STAGGERING_ROAR, urand(18, 22)*IN_MILLISECONDS, 0, PHASE_HUMAN);
|
||||
break;
|
||||
case EVENT_ENRAGE:
|
||||
DoCast(me, SPELL_ENRAGE);
|
||||
events.ScheduleEvent(EVENT_ENRAGE, urand(7,14)*IN_MILLISECONDS, 0, PHASE_HUMAN);
|
||||
events.ScheduleEvent(EVENT_ENRAGE, urand(7, 14)*IN_MILLISECONDS, 0, PHASE_HUMAN);
|
||||
break;
|
||||
case EVENT_SMASH:
|
||||
DoCastAOE(SPELL_SMASH);
|
||||
events.ScheduleEvent(EVENT_SMASH, urand(12,16)*IN_MILLISECONDS, 0, PHASE_HUMAN);
|
||||
events.ScheduleEvent(EVENT_SMASH, urand(12, 16)*IN_MILLISECONDS, 0, PHASE_HUMAN);
|
||||
break;
|
||||
case EVENT_JUST_TRANSFORMED:
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
@@ -247,15 +247,15 @@ public:
|
||||
// PHASE TWO
|
||||
case EVENT_DARK_SMASH:
|
||||
DoCastVictim(SPELL_DARK_SMASH);
|
||||
events.ScheduleEvent(EVENT_DARK_SMASH, urand(12,16)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
|
||||
events.ScheduleEvent(EVENT_DARK_SMASH, urand(12, 16)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
|
||||
break;
|
||||
case EVENT_DREADFUL_ROAR:
|
||||
DoCast(me, SPELL_DREADFUL_ROAR);
|
||||
events.ScheduleEvent(EVENT_DREADFUL_ROAR, urand(18,22)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
|
||||
events.ScheduleEvent(EVENT_DREADFUL_ROAR, urand(18, 22)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
|
||||
break;
|
||||
case EVENT_WOE_STRIKE:
|
||||
DoCastVictim(SPELL_WOE_STRIKE);
|
||||
events.ScheduleEvent(EVENT_WOE_STRIKE, urand(10,14)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
|
||||
events.ScheduleEvent(EVENT_WOE_STRIKE, urand(10, 14)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
|
||||
break;
|
||||
case EVENT_SHADOW_AXE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1))
|
||||
|
||||
@@ -129,8 +129,8 @@ public:
|
||||
instance->SetData(DATA_PRINCEKELESETH_EVENT, NOT_STARTED);
|
||||
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_SHADOWBOLT, urand(2,3)*IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_FROST_TOMB, urand(14,19)*IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_SHADOWBOLT, urand(2, 3)*IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_FROST_TOMB, urand(14, 19)*IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_SUMMON_SKELETONS, 6*IN_MILLISECONDS);
|
||||
|
||||
summons.DespawnAll();
|
||||
@@ -213,7 +213,7 @@ public:
|
||||
break;
|
||||
case EVENT_SHADOWBOLT:
|
||||
DoCastVictim(SPELL_SHADOWBOLT);
|
||||
events.ScheduleEvent(EVENT_SHADOWBOLT, urand(2,3)*IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_SHADOWBOLT, urand(2, 3)*IN_MILLISECONDS);
|
||||
break;
|
||||
case EVENT_FROST_TOMB:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true, -SPELL_FROST_TOMB))
|
||||
@@ -225,7 +225,7 @@ public:
|
||||
// checked from sniffs - the player casts the spell
|
||||
target->CastSpell(target, SPELL_FROST_TOMB_SUMMON, true);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_FROST_TOMB, urand(14,19)*IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_FROST_TOMB, urand(14, 19)*IN_MILLISECONDS);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -261,7 +261,7 @@ public:
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_DECREPIFY, urand(4,6)*IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_DECREPIFY, urand(4, 6)*IN_MILLISECONDS);
|
||||
|
||||
}
|
||||
|
||||
@@ -280,7 +280,7 @@ public:
|
||||
me->SetFlag(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD);
|
||||
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_RESURRECT, urand(18,22)*IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_RESURRECT, urand(18, 22)*IN_MILLISECONDS);
|
||||
|
||||
me->GetMotionMaster()->MovementExpired(false);
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
@@ -304,7 +304,7 @@ public:
|
||||
{
|
||||
case EVENT_DECREPIFY:
|
||||
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, -SPELL_DECREPIFY), SPELL_DECREPIFY);
|
||||
events.ScheduleEvent(EVENT_DECREPIFY, urand(1,5)*IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_DECREPIFY, urand(1, 5)*IN_MILLISECONDS);
|
||||
break;
|
||||
case EVENT_RESURRECT:
|
||||
events.ScheduleEvent(EVENT_FULL_HEAL, 1*IN_MILLISECONDS);
|
||||
@@ -325,7 +325,7 @@ public:
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->RemoveFlag(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD);
|
||||
me->GetMotionMaster()->MoveChase(me->getVictim());
|
||||
events.ScheduleEvent(EVENT_DECREPIFY, urand(4,6)*IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_DECREPIFY, urand(4, 6)*IN_MILLISECONDS);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,8 +101,8 @@ enum SvalaPhase
|
||||
|
||||
static const float spectatorWP[2][3] =
|
||||
{
|
||||
{296.95f,-312.76f,86.36f},
|
||||
{297.69f,-275.81f,86.36f}
|
||||
{296.95f, -312.76f, 86.36f},
|
||||
{297.69f, -275.81f, 86.36f}
|
||||
};
|
||||
|
||||
static Position ArthasPos = { 295.81f, -366.16f, 92.57f, 1.58f };
|
||||
@@ -517,7 +517,7 @@ public:
|
||||
if (motionType == POINT_MOTION_TYPE)
|
||||
{
|
||||
if (pointId == 1)
|
||||
me->GetMotionMaster()->MovePoint(2,spectatorWP[1][0],spectatorWP[1][1],spectatorWP[1][2]);
|
||||
me->GetMotionMaster()->MovePoint(2, spectatorWP[1][0], spectatorWP[1][1], spectatorWP[1][2]);
|
||||
else if (pointId == 2)
|
||||
me->DespawnOrUnsummon(1000);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ enum Spells
|
||||
SPELL_ARCANE_BUFFET_H = 59485,
|
||||
SPELL_SUMMON_ETHEREAL_SPHERE_1 = 54102,
|
||||
SPELL_SUMMON_ETHEREAL_SPHERE_2 = 54137,
|
||||
SPELL_SUMMON_ETHEREAL_SPHERE_3 = 54138,
|
||||
SPELL_SUMMON_ETHEREAL_SPHERE_3 = 54138
|
||||
};
|
||||
|
||||
enum NPCs
|
||||
@@ -42,7 +42,7 @@ enum CreatureSpells
|
||||
SPELL_ARCANE_POWER = 54160,
|
||||
H_SPELL_ARCANE_POWER = 59474,
|
||||
SPELL_SUMMON_PLAYERS = 54164,
|
||||
SPELL_POWER_BALL_VISUAL = 54141,
|
||||
SPELL_POWER_BALL_VISUAL = 54141
|
||||
};
|
||||
|
||||
enum Yells
|
||||
|
||||
@@ -586,7 +586,7 @@ public:
|
||||
|
||||
struct npc_blessed_bannerAI : public Scripted_NoMovementAI
|
||||
{
|
||||
npc_blessed_bannerAI(Creature* creature) : Scripted_NoMovementAI(creature) , Summons(me)
|
||||
npc_blessed_bannerAI(Creature* creature) : Scripted_NoMovementAI(creature), Summons(me)
|
||||
{
|
||||
HalofSpawned = false;
|
||||
PhaseCount = 0;
|
||||
@@ -611,7 +611,7 @@ public:
|
||||
me->setRegeneratingHealth(false);
|
||||
DoCast(SPELL_THREAT_PULSE);
|
||||
me->AI()->Talk(BANNER_SAY);
|
||||
events.ScheduleEvent(EVENT_SPAWN,3000);
|
||||
events.ScheduleEvent(EVENT_SPAWN, 3000);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) {}
|
||||
@@ -672,167 +672,167 @@ public:
|
||||
guidMason[2] = Mason3->GetGUID();
|
||||
Mason3->GetMotionMaster()->MovePoint(0, Mason3Pos[1]);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_INTRO_1,15000);
|
||||
events.ScheduleEvent(EVENT_INTRO_1, 15000);
|
||||
}
|
||||
break;
|
||||
case EVENT_INTRO_1:
|
||||
{
|
||||
if (Creature* Dalfors = me->GetCreature(*me,guidDalfors))
|
||||
if (Creature* Dalfors = me->GetCreature(*me, guidDalfors))
|
||||
Dalfors->AI()->Talk(DALFORS_SAY_PRE_1);
|
||||
events.ScheduleEvent(EVENT_INTRO_2,5000);
|
||||
events.ScheduleEvent(EVENT_INTRO_2, 5000);
|
||||
}
|
||||
break;
|
||||
case EVENT_INTRO_2:
|
||||
{
|
||||
if (Creature* Dalfors = me->GetCreature(*me,guidDalfors))
|
||||
if (Creature* Dalfors = me->GetCreature(*me, guidDalfors))
|
||||
{
|
||||
Dalfors->SetFacingTo(6.215f);
|
||||
Dalfors->AI()->Talk(DALFORS_SAY_PRE_2);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_INTRO_3,5000);
|
||||
events.ScheduleEvent(EVENT_INTRO_3, 5000);
|
||||
}
|
||||
break;
|
||||
case EVENT_INTRO_3:
|
||||
{
|
||||
if (Creature* Dalfors = me->GetCreature(*me,guidDalfors))
|
||||
if (Creature* Dalfors = me->GetCreature(*me, guidDalfors))
|
||||
{
|
||||
Dalfors->GetMotionMaster()->MovePoint(0, DalforsPos[2]);
|
||||
Dalfors->SetHomePosition(DalforsPos[2]);
|
||||
}
|
||||
if (Creature* Priest1 = me->GetCreature(*me,guidPriest[0]))
|
||||
if (Creature* Priest1 = me->GetCreature(*me, guidPriest[0]))
|
||||
{
|
||||
Priest1->SetFacingTo(5.7421f);
|
||||
Priest1->SetHomePosition(Priest1Pos[1]);
|
||||
}
|
||||
if (Creature* Priest2 = me->GetCreature(*me,guidPriest[1]))
|
||||
if (Creature* Priest2 = me->GetCreature(*me, guidPriest[1]))
|
||||
{
|
||||
Priest2->SetFacingTo(5.7421f);
|
||||
Priest2->SetHomePosition(Priest2Pos[1]);
|
||||
}
|
||||
if (Creature* Priest3 = me->GetCreature(*me,guidPriest[2]))
|
||||
if (Creature* Priest3 = me->GetCreature(*me, guidPriest[2]))
|
||||
{
|
||||
Priest3->SetFacingTo(5.7421f);
|
||||
Priest3->SetHomePosition(Priest3Pos[1]);
|
||||
}
|
||||
if (Creature* Mason1 = me->GetCreature(*me,guidMason[0]))
|
||||
if (Creature* Mason1 = me->GetCreature(*me, guidMason[0]))
|
||||
{
|
||||
Mason1->GetMotionMaster()->MovePoint(0, Mason1Pos[2]);
|
||||
Mason1->SetHomePosition(Mason1Pos[2]);
|
||||
}
|
||||
if (Creature* Mason2 = me->GetCreature(*me,guidMason[1]))
|
||||
if (Creature* Mason2 = me->GetCreature(*me, guidMason[1]))
|
||||
{
|
||||
Mason2->GetMotionMaster()->MovePoint(0, Mason2Pos[2]);
|
||||
Mason2->SetHomePosition(Mason2Pos[2]);
|
||||
}
|
||||
if (Creature* Mason3 = me->GetCreature(*me,guidMason[2]))
|
||||
if (Creature* Mason3 = me->GetCreature(*me, guidMason[2]))
|
||||
{
|
||||
Mason3->GetMotionMaster()->MovePoint(0, Mason3Pos[2]);
|
||||
Mason3->SetHomePosition(Mason3Pos[2]);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_START_FIGHT,5000);
|
||||
events.ScheduleEvent(EVENT_MASON_ACTION,15000);
|
||||
events.ScheduleEvent(EVENT_START_FIGHT, 5000);
|
||||
events.ScheduleEvent(EVENT_MASON_ACTION, 15000);
|
||||
}
|
||||
break;
|
||||
case EVENT_MASON_ACTION:
|
||||
{
|
||||
if (Creature* Mason1 = me->GetCreature(*me,guidMason[0]))
|
||||
if (Creature* Mason1 = me->GetCreature(*me, guidMason[0]))
|
||||
{
|
||||
Mason1->SetFacingTo(2.8972f);
|
||||
Mason1->AI()->SetData(1,1); // triggers SAI actions on npc
|
||||
Mason1->AI()->SetData(1, 1); // triggers SAI actions on npc
|
||||
}
|
||||
if (Creature* Mason2 = me->GetCreature(*me,guidMason[1]))
|
||||
if (Creature* Mason2 = me->GetCreature(*me, guidMason[1]))
|
||||
{
|
||||
Mason2->SetFacingTo(3.1241f);
|
||||
Mason2->AI()->SetData(1,1); // triggers SAI actions on npc
|
||||
Mason2->AI()->SetData(1, 1); // triggers SAI actions on npc
|
||||
}
|
||||
if (Creature* Mason3 = me->GetCreature(*me,guidMason[2]))
|
||||
if (Creature* Mason3 = me->GetCreature(*me, guidMason[2]))
|
||||
{
|
||||
Mason3->SetFacingTo(3.6651f);
|
||||
Mason3->AI()->SetData(1,1); // triggers SAI actions on npc
|
||||
Mason3->AI()->SetData(1, 1); // triggers SAI actions on npc
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EVENT_START_FIGHT:
|
||||
{
|
||||
if(Creature* LK = GetClosestCreatureWithEntry(me,NPC_LK,100))
|
||||
if (Creature* LK = GetClosestCreatureWithEntry(me, NPC_LK, 100))
|
||||
LK->AI()->Talk(LK_TALK_1);
|
||||
if (Creature* Dalfors = me->GetCreature(*me,guidDalfors))
|
||||
if (Creature* Dalfors = me->GetCreature(*me, guidDalfors))
|
||||
Dalfors->AI()->Talk(DALFORS_SAY_START);
|
||||
events.ScheduleEvent(EVENT_WAVE_SPAWN,1000);
|
||||
events.ScheduleEvent(EVENT_WAVE_SPAWN, 1000);
|
||||
}
|
||||
break;
|
||||
case EVENT_WAVE_SPAWN:
|
||||
{
|
||||
if (PhaseCount == 3)
|
||||
{
|
||||
if (Creature* LK = GetClosestCreatureWithEntry(me,NPC_LK,100))
|
||||
if (Creature* LK = GetClosestCreatureWithEntry(me, NPC_LK, 100))
|
||||
LK->AI()->Talk(LK_TALK_2);
|
||||
}
|
||||
else if (PhaseCount == 6)
|
||||
{
|
||||
if (Creature* LK = GetClosestCreatureWithEntry(me,NPC_LK,100))
|
||||
if (Creature* LK = GetClosestCreatureWithEntry(me, NPC_LK, 100))
|
||||
LK->AI()->Talk(LK_TALK_3);
|
||||
}
|
||||
if (Creature* tempsum = DoSummon(NPC_SCOURGE_DRUDGE,Mason3Pos[0]))
|
||||
if (Creature* tempsum = DoSummon(NPC_SCOURGE_DRUDGE, Mason3Pos[0]))
|
||||
{
|
||||
tempsum->SetHomePosition(DalforsPos[2]);
|
||||
tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me,NPC_BLESSED_BANNER,100));
|
||||
tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100));
|
||||
}
|
||||
if (urand(0,1) == 0)
|
||||
if (urand(0, 1) == 0)
|
||||
{
|
||||
if (Creature* tempsum = DoSummon(NPC_HIDEOUS_PLAGEBRINGER,Mason1Pos[0]))
|
||||
if (Creature* tempsum = DoSummon(NPC_HIDEOUS_PLAGEBRINGER, Mason1Pos[0]))
|
||||
{
|
||||
tempsum->SetHomePosition(DalforsPos[2]);
|
||||
tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me,NPC_BLESSED_BANNER,100));
|
||||
tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100));
|
||||
}
|
||||
if (Creature* tempsum = DoSummon(NPC_HIDEOUS_PLAGEBRINGER,Mason2Pos[0]))
|
||||
if (Creature* tempsum = DoSummon(NPC_HIDEOUS_PLAGEBRINGER, Mason2Pos[0]))
|
||||
{
|
||||
tempsum->SetHomePosition(DalforsPos[2]);
|
||||
tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me,NPC_BLESSED_BANNER,100));
|
||||
tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Creature* tempsum = DoSummon(NPC_REANIMATED_CAPTAIN,Mason1Pos[0]))
|
||||
if (Creature* tempsum = DoSummon(NPC_REANIMATED_CAPTAIN, Mason1Pos[0]))
|
||||
{
|
||||
tempsum->SetHomePosition(DalforsPos[2]);
|
||||
tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me,NPC_BLESSED_BANNER,100));
|
||||
tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100));
|
||||
}
|
||||
if (Creature* tempsum = DoSummon(NPC_REANIMATED_CAPTAIN,Mason2Pos[0]))
|
||||
if (Creature* tempsum = DoSummon(NPC_REANIMATED_CAPTAIN, Mason2Pos[0]))
|
||||
{
|
||||
tempsum->SetHomePosition(DalforsPos[2]);
|
||||
tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me,NPC_BLESSED_BANNER,100));
|
||||
tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100));
|
||||
}
|
||||
}
|
||||
|
||||
PhaseCount++;
|
||||
|
||||
if (PhaseCount < 8)
|
||||
events.ScheduleEvent(EVENT_WAVE_SPAWN,urand(10000,20000));
|
||||
events.ScheduleEvent(EVENT_WAVE_SPAWN, urand(10000, 20000));
|
||||
else
|
||||
events.ScheduleEvent(EVENT_HALOF,urand(10000,20000));
|
||||
events.ScheduleEvent(EVENT_HALOF, urand(10000, 20000));
|
||||
}
|
||||
break;
|
||||
case EVENT_HALOF:
|
||||
{
|
||||
if (Creature* LK = GetClosestCreatureWithEntry(me,NPC_LK,100))
|
||||
if (Creature* LK = GetClosestCreatureWithEntry(me, NPC_LK, 100))
|
||||
LK->AI()->Talk(LK_TALK_4);
|
||||
if (Creature* tempsum = DoSummon(NPC_SCOURGE_DRUDGE,Mason1Pos[0]))
|
||||
if (Creature* tempsum = DoSummon(NPC_SCOURGE_DRUDGE, Mason1Pos[0]))
|
||||
{
|
||||
tempsum->SetHomePosition(DalforsPos[2]);
|
||||
tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me,NPC_BLESSED_BANNER,100));
|
||||
tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100));
|
||||
}
|
||||
if (Creature* tempsum = DoSummon(NPC_SCOURGE_DRUDGE,Mason2Pos[0]))
|
||||
if (Creature* tempsum = DoSummon(NPC_SCOURGE_DRUDGE, Mason2Pos[0]))
|
||||
{
|
||||
tempsum->SetHomePosition(DalforsPos[2]);
|
||||
tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me,NPC_BLESSED_BANNER,100));
|
||||
tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100));
|
||||
}
|
||||
if (Creature* tempsum = DoSummon(NPC_HALOF_THE_DEATHBRINGER,DalforsPos[0]))
|
||||
if (Creature* tempsum = DoSummon(NPC_HALOF_THE_DEATHBRINGER, DalforsPos[0]))
|
||||
{
|
||||
HalofSpawned = true;
|
||||
guidHalof = tempsum->GetGUID();
|
||||
tempsum->SetHomePosition(DalforsPos[2]);
|
||||
tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me,NPC_BLESSED_BANNER,100));
|
||||
tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100));
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -845,17 +845,17 @@ public:
|
||||
}
|
||||
|
||||
if (PhaseCount == 8)
|
||||
if (Creature* Halof = me->GetCreature(*me,guidHalof))
|
||||
if (Creature* Halof = me->GetCreature(*me, guidHalof))
|
||||
if (Halof->isDead())
|
||||
{
|
||||
DoCast(me,SPELL_CRUSADERS_SPIRE_VICTORY,true);
|
||||
DoCast(me, SPELL_CRUSADERS_SPIRE_VICTORY, true);
|
||||
Summons.DespawnEntry(NPC_HIDEOUS_PLAGEBRINGER);
|
||||
Summons.DespawnEntry(NPC_REANIMATED_CAPTAIN);
|
||||
Summons.DespawnEntry(NPC_SCOURGE_DRUDGE);
|
||||
Summons.DespawnEntry(NPC_HALOF_THE_DEATHBRINGER);
|
||||
if (Creature* Dalfors = me->GetCreature(*me,guidDalfors))
|
||||
if (Creature* Dalfors = me->GetCreature(*me, guidDalfors))
|
||||
Dalfors->AI()->Talk(DALFORS_YELL_FINISHED);
|
||||
events.ScheduleEvent(EVENT_ENDED,10000);
|
||||
events.ScheduleEvent(EVENT_ENDED, 10000);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -540,13 +540,13 @@ public:
|
||||
Player* player = Player::GetPlayer(*me, playerGUID);
|
||||
Creature* orphan = Creature::GetCreature(*me, orphanGUID);
|
||||
|
||||
if(!orphan || !player)
|
||||
if (!orphan || !player)
|
||||
{
|
||||
Reset();
|
||||
return;
|
||||
}
|
||||
|
||||
switch(phase)
|
||||
switch (phase)
|
||||
{
|
||||
case 1:
|
||||
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + sin(me->GetOrientation()) * 5, me->GetPositionZ());
|
||||
|
||||
@@ -423,7 +423,7 @@ public:
|
||||
Unit* player = me->GetVehicleKit()->GetPassenger(0);
|
||||
if (player && player->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
// for each prisoner on drake,give credit
|
||||
// for each prisoner on drake, give credit
|
||||
for (uint8 i = 1; i < 4; ++i)
|
||||
if (Unit* prisoner = me->GetVehicleKit()->GetPassenger(i))
|
||||
{
|
||||
|
||||
@@ -271,7 +271,7 @@ class npc_wg_queue : public CreatureScript
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* /*creature*/ , uint32 /*sender*/ , uint32 /*action*/)
|
||||
bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 /*action*/)
|
||||
{
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ enum MotherShahraz
|
||||
SPELL_ATTRACTION = 40871,
|
||||
SPELL_SILENCING_SHRIEK = 40823,
|
||||
SPELL_ENRAGE = 23537,
|
||||
SPELL_SABER_LASH = 40810,//43267
|
||||
SPELL_SABER_LASH = 40810, //43267
|
||||
SPELL_SABER_LASH_IMM = 43690,
|
||||
SPELL_TELEPORT_VISUAL = 40869,
|
||||
SPELL_BERSERK = 45078
|
||||
|
||||
@@ -26,8 +26,11 @@ EndScriptData */
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
|
||||
#define SPELL_FOUL_SPORES 31673
|
||||
#define SPELL_ACID_GEYSER 38739
|
||||
enum Spells
|
||||
{
|
||||
SPELL_FOUL_SPORES = 31673,
|
||||
SPELL_ACID_GEYSER = 38739
|
||||
};
|
||||
|
||||
class boss_hungarfen : public CreatureScript
|
||||
{
|
||||
|
||||
@@ -375,23 +375,23 @@ class instance_blood_furnace : public InstanceMapScript
|
||||
switch (id)
|
||||
{
|
||||
case DATA_PRISON_CELL5:
|
||||
HandleGameObject(PrisonCell5GUID,true);
|
||||
HandleGameObject(PrisonCell5GUID, true);
|
||||
ActivatePrisoners(PrisonersCell5);
|
||||
break;
|
||||
case DATA_PRISON_CELL6:
|
||||
HandleGameObject(PrisonCell6GUID,true);
|
||||
HandleGameObject(PrisonCell6GUID, true);
|
||||
ActivatePrisoners(PrisonersCell6);
|
||||
break;
|
||||
case DATA_PRISON_CELL7:
|
||||
HandleGameObject(PrisonCell7GUID,true);
|
||||
HandleGameObject(PrisonCell7GUID, true);
|
||||
ActivatePrisoners(PrisonersCell7);
|
||||
break;
|
||||
case DATA_PRISON_CELL8:
|
||||
HandleGameObject(PrisonCell8GUID,true);
|
||||
HandleGameObject(PrisonCell8GUID, true);
|
||||
ActivatePrisoners(PrisonersCell8);
|
||||
break;
|
||||
case DATA_DOOR5:
|
||||
HandleGameObject(Door5GUID,true);
|
||||
HandleGameObject(Door5GUID, true);
|
||||
if (Creature* broggok = instance->GetCreature(BroggokGUID))
|
||||
broggok->AI()->DoAction(ACTION_ACTIVATE_BROGGOK);
|
||||
break;
|
||||
|
||||
@@ -518,7 +518,7 @@ class spell_astromancer_wrath_of_the_astromancer : public SpellScriptLoader
|
||||
return;
|
||||
|
||||
Unit* target = GetUnitOwner();
|
||||
target->CastSpell(target, GetSpellInfo()->Effects[EFFECT_1].CalcValue(),false);
|
||||
target->CastSpell(target, GetSpellInfo()->Effects[EFFECT_1].CalcValue(), false);
|
||||
}
|
||||
|
||||
void Register()
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
*
|
||||
* 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
|
||||
@@ -17,26 +16,112 @@
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Boss_Gatewatcher_Gyrokill
|
||||
SD%Complete: 0
|
||||
SDComment: Place Holder
|
||||
SDName: boss_gatewatcher_gyrokill
|
||||
SD%Complete: 99%
|
||||
SDComment:
|
||||
SDCategory: Tempest Keep, The Mechanar
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "mechanar.h"
|
||||
|
||||
//not used
|
||||
#define SAY_AGGRO -1554000
|
||||
#define SAY_SAW_ATTACK1 -1554001
|
||||
#define SAY_SAW_ATTACK2 -1554002
|
||||
#define SAY_SLAY1 -1554003
|
||||
#define SAY_SLAY2 -1554004
|
||||
#define SAY_DEATH -1554005
|
||||
enum Say
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_SLAY = 1,
|
||||
SAY_SAW_BLADEs = 2,
|
||||
SAY_DEATH = 3
|
||||
};
|
||||
|
||||
#define SPELL_STREAM_OF_MACHINE_FLUID 35311
|
||||
#define SPELL_SAW_BLADE 35318
|
||||
#define H_SPELL_SAW_BLADE 39192
|
||||
#define SPELL_SHADOW_POWER 35322
|
||||
#define H_SPELL_SHADOW_POWER 39193
|
||||
enum Spells
|
||||
{
|
||||
SPELL_STREAM_OF_MACHINE_FLUID = 35311,
|
||||
SPELL_SAW_BLADE = 35318,
|
||||
H_SPELL_SAW_BLADE = 39192,
|
||||
SPELL_SHADOW_POWER = 35322,
|
||||
H_SPELL_SHADOW_POWER = 39193
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_STREAM_OF_MACHINE_FLUID = 0,
|
||||
EVENT_SAW_BLADE = 1,
|
||||
EVENT_SHADOW_POWER = 2
|
||||
};
|
||||
|
||||
class boss_gatewatcher_gyrokill : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_gatewatcher_gyrokill() : CreatureScript("boss_gatewatcher_gyrokill") {}
|
||||
|
||||
struct boss_gatewatcher_gyrokillAI : public BossAI
|
||||
{
|
||||
boss_gatewatcher_gyrokillAI(Creature* creature) : BossAI(creature, DATA_GATEWATCHER_GYROKILL) {}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
events.ScheduleEvent(EVENT_STREAM_OF_MACHINE_FLUID, 10000);
|
||||
events.ScheduleEvent(EVENT_SAW_BLADE, 20000);
|
||||
events.ScheduleEvent(EVENT_SHADOW_POWER, 25000);
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
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_STREAM_OF_MACHINE_FLUID:
|
||||
DoCastVictim(SPELL_STREAM_OF_MACHINE_FLUID, true);
|
||||
events.ScheduleEvent(EVENT_STREAM_OF_MACHINE_FLUID, urand(13000, 17000));
|
||||
break;
|
||||
case EVENT_SAW_BLADE:
|
||||
DoCast(me, SPELL_SAW_BLADE);
|
||||
Talk(SAY_SAW_BLADEs);
|
||||
events.ScheduleEvent(EVENT_SAW_BLADE, urand(20000, 30000));
|
||||
break;
|
||||
case EVENT_SHADOW_POWER:
|
||||
DoCast(me, SPELL_SHADOW_POWER);
|
||||
events.ScheduleEvent(EVENT_SAW_BLADE, urand(25000, 35000));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_gatewatcher_gyrokillAI (creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_gatewatcher_gyrokill()
|
||||
{
|
||||
new boss_gatewatcher_gyrokill();
|
||||
}
|
||||
@@ -25,8 +25,9 @@ EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "mechanar.h"
|
||||
|
||||
enum eSays
|
||||
enum Says
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_HAMMER = 1,
|
||||
@@ -35,111 +36,96 @@ enum eSays
|
||||
EMOTE_HAMMER = 4
|
||||
};
|
||||
|
||||
enum eSpells
|
||||
enum Spells
|
||||
{
|
||||
// Spells to be casted
|
||||
SPELL_SHADOW_POWER = 35322,
|
||||
H_SPELL_SHADOW_POWER = 39193,
|
||||
SPELL_HAMMER_PUNCH = 35326,
|
||||
SPELL_JACKHAMMER = 35327,
|
||||
H_SPELL_JACKHAMMER = 39194,
|
||||
SPELL_STREAM_OF_MACHINE_FLUID = 35311,
|
||||
SPELL_STREAM_OF_MACHINE_FLUID = 35311
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_STREAM_OF_MACHINE_FLUID = 0,
|
||||
EVENT_JACKHAMMER = 1,
|
||||
EVENT_SHADOW_POWER = 2
|
||||
};
|
||||
|
||||
class boss_gatewatcher_iron_hand : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_gatewatcher_iron_hand(): CreatureScript("boss_gatewatcher_iron_hand") {}
|
||||
|
||||
boss_gatewatcher_iron_hand()
|
||||
: CreatureScript("boss_gatewatcher_iron_hand")
|
||||
struct boss_gatewatcher_iron_handAI : public BossAI
|
||||
{
|
||||
}
|
||||
// Gatewatcher Iron-Hand AI
|
||||
struct boss_gatewatcher_iron_handAI : public ScriptedAI
|
||||
boss_gatewatcher_iron_handAI(Creature* creature) : BossAI(creature, DATA_GATEWATCHER_IRON_HAND) {}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
boss_gatewatcher_iron_handAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
}
|
||||
|
||||
uint32 Shadow_Power_Timer;
|
||||
uint32 Jackhammer_Timer;
|
||||
uint32 Stream_of_Machine_Fluid_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Shadow_Power_Timer = 25000;
|
||||
Jackhammer_Timer = 45000;
|
||||
Stream_of_Machine_Fluid_Timer = 55000;
|
||||
|
||||
}
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
if (rand()%2)
|
||||
return;
|
||||
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
//TODO: Add door check/open code
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Shadow Power
|
||||
if (Shadow_Power_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_SHADOW_POWER);
|
||||
Shadow_Power_Timer = urand(20000, 28000);
|
||||
}
|
||||
else
|
||||
Shadow_Power_Timer -= diff;
|
||||
|
||||
//Jack Hammer
|
||||
if (Jackhammer_Timer <= diff)
|
||||
{
|
||||
//TODO: expect cast this about 5 times in a row (?), announce it by emote only once
|
||||
Talk(EMOTE_HAMMER);
|
||||
DoCast(me->getVictim(), SPELL_JACKHAMMER);
|
||||
|
||||
//chance to yell, but not same time as emote (after spell in fact casted)
|
||||
if (rand()%2)
|
||||
return;
|
||||
|
||||
Talk(SAY_HAMMER);
|
||||
Jackhammer_Timer = 30000;
|
||||
}
|
||||
else
|
||||
Jackhammer_Timer -= diff;
|
||||
|
||||
//Stream of Machine Fluid
|
||||
if (Stream_of_Machine_Fluid_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_STREAM_OF_MACHINE_FLUID);
|
||||
Stream_of_Machine_Fluid_Timer = urand(35000, 50000);
|
||||
}
|
||||
else
|
||||
Stream_of_Machine_Fluid_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_gatewatcher_iron_handAI(creature);
|
||||
_EnterCombat();
|
||||
events.ScheduleEvent(EVENT_STREAM_OF_MACHINE_FLUID, 55000);
|
||||
events.ScheduleEvent(EVENT_JACKHAMMER, 45000);
|
||||
events.ScheduleEvent(EVENT_SHADOW_POWER, 25000);
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
if (roll_chance_i(50))
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
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_STREAM_OF_MACHINE_FLUID:
|
||||
DoCastVictim(SPELL_STREAM_OF_MACHINE_FLUID, true);
|
||||
events.ScheduleEvent(EVENT_STREAM_OF_MACHINE_FLUID, urand(35000, 50000));
|
||||
break;
|
||||
case EVENT_JACKHAMMER:
|
||||
Talk(EMOTE_HAMMER);
|
||||
//TODO: expect cast this about 5 times in a row (?), announce it by emote only once
|
||||
DoCastVictim(SPELL_JACKHAMMER, true);
|
||||
if (roll_chance_i(50))
|
||||
Talk(SAY_HAMMER);
|
||||
events.ScheduleEvent(EVENT_JACKHAMMER, 30000);
|
||||
break;
|
||||
case EVENT_SHADOW_POWER:
|
||||
DoCast(me, SPELL_SHADOW_POWER);
|
||||
events.ScheduleEvent(EVENT_SHADOW_POWER, urand(20000, 28000));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_gatewatcher_iron_handAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_gatewatcher_iron_hand()
|
||||
|
||||
@@ -15,21 +15,144 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
//! TODO - Boss not scripted, just ported required spellscript from core
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellScript.h"
|
||||
#include "mechanar.h"
|
||||
#include "Player.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_HEADCRACK = 35161,
|
||||
SPELL_REFLECTIVE_MAGIC_SHIELD = 35158,
|
||||
SPELL_REFLECTIVE_DAMAGE_SHIELD = 35159,
|
||||
SPELL_POLARITY_SHIFT = 39096,
|
||||
SPELL_BERSERK = 26662,
|
||||
SPELL_NETHER_CHARGE_TIMER = 37670,
|
||||
SPELL_NETHER_CHARGE_PASSIVE = 37670,
|
||||
|
||||
SPELL_POSITIVE_POLARITY = 39088,
|
||||
SPELL_POSITIVE_CHARGE_STACK = 39089,
|
||||
SPELL_POSITIVE_CHARGE = 39090,
|
||||
|
||||
SPELL_NEGATIVE_POLARITY = 39091,
|
||||
SPELL_NEGATIVE_CHARGE_STACK = 39092,
|
||||
SPELL_NEGATIVE_CHARGE = 39093,
|
||||
SPELL_NEGATIVE_CHARGE = 39093
|
||||
};
|
||||
|
||||
enum Yells
|
||||
{
|
||||
YELL_AGGRO = 0,
|
||||
YELL_REFLECTIVE_MAGIC_SHIELD = 1,
|
||||
YELL_REFLECTIVE_DAMAGE_SHIELD = 2,
|
||||
YELL_KILL = 3,
|
||||
YELL_DEATH = 4
|
||||
};
|
||||
|
||||
enum Creatures
|
||||
{
|
||||
NPC_NETHER_CHARGE = 20405
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_NONE = 0,
|
||||
|
||||
EVENT_HEADCRACK = 1,
|
||||
EVENT_REFLECTIVE_DAMAGE_SHIELD = 2,
|
||||
EVENT_REFLECTIVE_MAGIE_SHIELD = 3,
|
||||
EVENT_POSITIVE_SHIFT = 4,
|
||||
EVENT_SUMMON_NETHER_CHARGE = 5,
|
||||
EVENT_BERSERK = 6
|
||||
};
|
||||
|
||||
class boss_mechano_lord_capacitus : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_mechano_lord_capacitus() : CreatureScript("boss_mechano_lord_capacitus") { }
|
||||
|
||||
struct boss_mechano_lord_capacitusAI : public BossAI
|
||||
{
|
||||
boss_mechano_lord_capacitusAI(Creature* creature) : BossAI(creature, DATA_MECHANOLORD_CAPACITUS) { }
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
Talk(YELL_AGGRO);
|
||||
events.ScheduleEvent(EVENT_HEADCRACK, 10 * IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_REFLECTIVE_DAMAGE_SHIELD, 15 * IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_SUMMON_NETHER_CHARGE, 10 * IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_BERSERK, 3 * MINUTE * IN_MILLISECONDS);
|
||||
|
||||
if (IsHeroic())
|
||||
events.ScheduleEvent(EVENT_POSITIVE_SHIFT, 15 * IN_MILLISECONDS);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
Talk(YELL_KILL);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*victim*/)
|
||||
{
|
||||
_JustDied();
|
||||
Talk(YELL_DEATH);
|
||||
}
|
||||
|
||||
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_HEADCRACK:
|
||||
DoCastVictim(SPELL_HEADCRACK);
|
||||
events.ScheduleEvent(EVENT_HEADCRACK, 10 * IN_MILLISECONDS);
|
||||
break;
|
||||
case EVENT_REFLECTIVE_DAMAGE_SHIELD:
|
||||
Talk(YELL_REFLECTIVE_DAMAGE_SHIELD);
|
||||
DoCast(me, SPELL_REFLECTIVE_DAMAGE_SHIELD);
|
||||
events.ScheduleEvent(EVENT_REFLECTIVE_MAGIE_SHIELD, 30 * IN_MILLISECONDS);
|
||||
break;
|
||||
case EVENT_REFLECTIVE_MAGIE_SHIELD:
|
||||
Talk(YELL_REFLECTIVE_MAGIC_SHIELD);
|
||||
DoCast(me, SPELL_REFLECTIVE_MAGIC_SHIELD);
|
||||
events.ScheduleEvent(EVENT_REFLECTIVE_DAMAGE_SHIELD, 30 * IN_MILLISECONDS);
|
||||
break;
|
||||
case EVENT_POSITIVE_SHIFT:
|
||||
DoCastAOE(SPELL_POLARITY_SHIFT);
|
||||
events.ScheduleEvent(EVENT_POSITIVE_SHIFT, urand(45, 60) * IN_MILLISECONDS);
|
||||
break;
|
||||
case EVENT_SUMMON_NETHER_CHARGE:
|
||||
Position pos;
|
||||
me->GetRandomNearPosition(pos, 5.0f);
|
||||
me->SummonCreature(NPC_NETHER_CHARGE, pos, TEMPSUMMON_TIMED_DESPAWN, 18000);
|
||||
events.ScheduleEvent(EVENT_SUMMON_NETHER_CHARGE, 10 * IN_MILLISECONDS);
|
||||
break;
|
||||
case EVENT_BERSERK:
|
||||
DoCast(me, SPELL_BERSERK);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_mechano_lord_capacitusAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_capacitus_polarity_charge : public SpellScriptLoader
|
||||
@@ -138,6 +261,7 @@ class spell_capacitus_polarity_shift : public SpellScriptLoader
|
||||
|
||||
void AddSC_boss_mechano_lord_capacitus()
|
||||
{
|
||||
new boss_mechano_lord_capacitus();
|
||||
new spell_capacitus_polarity_charge();
|
||||
new spell_capacitus_polarity_shift();
|
||||
}
|
||||
@@ -36,60 +36,45 @@ enum eSays
|
||||
SAY_DEATH = 4
|
||||
};
|
||||
|
||||
enum eSpells
|
||||
enum Spells
|
||||
{
|
||||
SPELL_SUMMON_RAGIN_FLAMES = 35275,
|
||||
SPELL_SUMMON_RAGIN_FLAMES = 35275, // Not scripted
|
||||
SPELL_FROST_ATTACK = 35263,
|
||||
SPELL_ARCANE_BLAST = 35314,
|
||||
SPELL_DRAGONS_BREATH = 35250,
|
||||
SPELL_KNOCKBACK = 37317,
|
||||
SPELL_SOLARBURN = 35267,
|
||||
H_SPELL_SUMMON_RAGIN_FLAMES = 39084,
|
||||
SPELL_INFERNO = 35268,
|
||||
H_SPELL_INFERNO = 39346,
|
||||
SPELL_FIRE_TAIL = 35278,
|
||||
H_SPELL_SUMMON_RAGIN_FLAMES = 39084, // Not scripted
|
||||
SPELL_INFERNO = 35268, // Not scripted
|
||||
H_SPELL_INFERNO = 39346, // Not scripted
|
||||
SPELL_FIRE_TAIL = 35278 // Not scripted
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_FROST_ATTACK = 0,
|
||||
EVENT_ARCANE_BLAST = 1,
|
||||
EVENT_DRAGONS_BREATH = 2,
|
||||
EVENT_KNOCKBACK = 3,
|
||||
EVENT_SOLARBURN = 4
|
||||
};
|
||||
|
||||
class boss_nethermancer_sepethrea : public CreatureScript
|
||||
{
|
||||
public:
|
||||
public: boss_nethermancer_sepethrea(): CreatureScript("boss_nethermancer_sepethrea") {}
|
||||
|
||||
boss_nethermancer_sepethrea()
|
||||
: CreatureScript("boss_nethermancer_sepethrea")
|
||||
struct boss_nethermancer_sepethreaAI : public BossAI
|
||||
{
|
||||
}
|
||||
struct boss_nethermancer_sepethreaAI : public ScriptedAI
|
||||
{
|
||||
boss_nethermancer_sepethreaAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 frost_attack_Timer;
|
||||
uint32 arcane_blast_Timer;
|
||||
uint32 dragons_breath_Timer;
|
||||
uint32 knockback_Timer;
|
||||
uint32 solarburn_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
frost_attack_Timer = urand(7000, 10000);
|
||||
arcane_blast_Timer = urand(12000, 18000);
|
||||
dragons_breath_Timer = urand(18000, 22000);
|
||||
knockback_Timer = urand(22000, 28000);
|
||||
solarburn_Timer = 30000;
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_NETHERMANCER_EVENT, NOT_STARTED);
|
||||
}
|
||||
boss_nethermancer_sepethreaAI(Creature* creature) : BossAI(creature, DATA_NETHERMANCER_SEPRETHREA) {}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(DATA_NETHERMANCER_EVENT, IN_PROGRESS);
|
||||
|
||||
_EnterCombat();
|
||||
events.ScheduleEvent(EVENT_FROST_ATTACK, urand(7000, 10000));
|
||||
events.ScheduleEvent(EVENT_ARCANE_BLAST, urand(12000, 18000));
|
||||
events.ScheduleEvent(EVENT_DRAGONS_BREATH, urand(18000, 22000));
|
||||
events.ScheduleEvent(EVENT_KNOCKBACK, urand(22000, 28000));
|
||||
events.ScheduleEvent(EVENT_SOLARBURN, 30000);
|
||||
Talk(SAY_AGGRO);
|
||||
DoCast(who, SPELL_SUMMON_RAGIN_FLAMES);
|
||||
Talk(SAY_SUMMON);
|
||||
@@ -102,66 +87,50 @@ class boss_nethermancer_sepethrea : public CreatureScript
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
if (instance)
|
||||
instance->SetData(DATA_NETHERMANCER_EVENT, DONE);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
void UpdateAI(uint32 const diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Frost Attack
|
||||
if (frost_attack_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FROST_ATTACK);
|
||||
events.Update(diff);
|
||||
|
||||
frost_attack_Timer = urand(7000, 10000);
|
||||
}
|
||||
else
|
||||
frost_attack_Timer -= diff;
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
//Arcane Blast
|
||||
if (arcane_blast_Timer <= diff)
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_ARCANE_BLAST);
|
||||
arcane_blast_Timer = 15000;
|
||||
}
|
||||
else
|
||||
arcane_blast_Timer -= diff;
|
||||
//Dragons Breath
|
||||
if (dragons_breath_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_DRAGONS_BREATH);
|
||||
switch (eventId)
|
||||
{
|
||||
if (rand()%2)
|
||||
return;
|
||||
Talk(SAY_DRAGONS_BREATH);
|
||||
case EVENT_FROST_ATTACK:
|
||||
DoCastVictim(SPELL_FROST_ATTACK, true);
|
||||
events.ScheduleEvent(EVENT_FROST_ATTACK, urand(7000, 10000));
|
||||
break;
|
||||
case EVENT_ARCANE_BLAST:
|
||||
DoCastVictim(SPELL_ARCANE_BLAST, true);
|
||||
events.ScheduleEvent(EVENT_ARCANE_BLAST, 15000);
|
||||
break;
|
||||
case EVENT_DRAGONS_BREATH:
|
||||
DoCastVictim(SPELL_DRAGONS_BREATH, true);
|
||||
events.ScheduleEvent(EVENT_DRAGONS_BREATH, urand(12000, 22000));
|
||||
if (roll_chance_i(50))
|
||||
Talk(SAY_DRAGONS_BREATH);
|
||||
break;
|
||||
case EVENT_KNOCKBACK:
|
||||
DoCastVictim(SPELL_KNOCKBACK, true);
|
||||
events.ScheduleEvent(EVENT_KNOCKBACK, urand(15000, 25000));
|
||||
break;
|
||||
case EVENT_SOLARBURN:
|
||||
DoCastVictim(SPELL_SOLARBURN, true);
|
||||
events.ScheduleEvent(EVENT_SOLARBURN, 30000);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
dragons_breath_Timer = urand(12000, 22000);
|
||||
}
|
||||
else
|
||||
dragons_breath_Timer -= diff;
|
||||
|
||||
//Knockback
|
||||
if (knockback_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_KNOCKBACK);
|
||||
knockback_Timer = urand(15000, 25000);
|
||||
}
|
||||
else
|
||||
knockback_Timer -= diff;
|
||||
|
||||
//Solarburn
|
||||
if (solarburn_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SOLARBURN);
|
||||
solarburn_Timer = 30000;
|
||||
}
|
||||
else
|
||||
solarburn_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
@@ -172,13 +141,11 @@ class boss_nethermancer_sepethrea : public CreatureScript
|
||||
return new boss_nethermancer_sepethreaAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class mob_ragin_flames : public CreatureScript
|
||||
{
|
||||
public:
|
||||
mob_ragin_flames()
|
||||
: CreatureScript("mob_ragin_flames")
|
||||
{
|
||||
}
|
||||
mob_ragin_flames() : CreatureScript("mob_ragin_flames") { }
|
||||
|
||||
struct mob_ragin_flamesAI : public ScriptedAI
|
||||
{
|
||||
@@ -217,7 +184,7 @@ class mob_ragin_flames : public CreatureScript
|
||||
{
|
||||
if (instance)
|
||||
{
|
||||
if (instance->GetData(DATA_NETHERMANCER_EVENT) != IN_PROGRESS)
|
||||
if (instance->GetData(DATA_NETHERMANCER_SEPRETHREA) != IN_PROGRESS)
|
||||
{
|
||||
//remove
|
||||
me->setDeathState(JUST_DIED);
|
||||
@@ -259,9 +226,9 @@ class mob_ragin_flames : public CreatureScript
|
||||
return new mob_ragin_flamesAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_nethermancer_sepethrea()
|
||||
{
|
||||
new boss_nethermancer_sepethrea();
|
||||
new mob_ragin_flames();
|
||||
}
|
||||
|
||||
+89
-125
@@ -25,8 +25,9 @@ EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "mechanar.h"
|
||||
|
||||
enum eSays
|
||||
enum Says
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_DOMINATION = 1,
|
||||
@@ -35,65 +36,53 @@ enum eSays
|
||||
SAY_SLAY = 4,
|
||||
SAY_DEATH = 5
|
||||
};
|
||||
// Spells to be casted
|
||||
enum eSpells
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_MANA_TAP = 36021,
|
||||
SPELL_ARCANE_TORRENT = 36022,
|
||||
SPELL_DOMINATION = 35280,
|
||||
H_SPELL_ARCANE_EXPLOSION = 15453,
|
||||
SPELL_FRENZY = 36992,
|
||||
//Spells work, but not implemented
|
||||
SPELL_SUMMON_NETHER_WRAITH_1 = 35285,
|
||||
SPELL_SUMMON_NETHER_WRAITH_2 = 35286,
|
||||
SPELL_SUMMON_NETHER_WRAITH_3 = 35287,
|
||||
SPELL_SUMMON_NETHER_WRAITH_4 = 35288,
|
||||
// Add Spells
|
||||
SPELL_DETONATION = 35058,
|
||||
SPELL_ARCANE_MISSILES = 35034,
|
||||
SPELL_SUMMON_NETHER_WRAITH_1 = 35285, // Not scripted
|
||||
SPELL_SUMMON_NETHER_WRAITH_2 = 35286, // Not scripted
|
||||
SPELL_SUMMON_NETHER_WRAITH_3 = 35287, // Not scripted
|
||||
SPELL_SUMMON_NETHER_WRAITH_4 = 35288, // Not scripted
|
||||
SPELL_DETONATION = 35058, // Used by Nether Wraith
|
||||
SPELL_ARCANE_MISSILES = 35034 // Used by Nether Wraith
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_SUMMON = 0,
|
||||
EVENT_MANA_TAP = 1,
|
||||
EVENT_ARCANE_TORRENT = 2,
|
||||
EVENT_DOMINATION = 3,
|
||||
EVENT_ARCANE_EXPLOSION = 4
|
||||
};
|
||||
|
||||
enum Creatures
|
||||
{
|
||||
NPC_NETHER_WRAITH = 21062
|
||||
};
|
||||
|
||||
class boss_pathaleon_the_calculator : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_pathaleon_the_calculator(): CreatureScript("boss_pathaleon_the_calculator") {}
|
||||
|
||||
boss_pathaleon_the_calculator()
|
||||
: CreatureScript("boss_pathaleon_the_calculator")
|
||||
struct boss_pathaleon_the_calculatorAI : public BossAI
|
||||
{
|
||||
}
|
||||
boss_pathaleon_the_calculatorAI(Creature* creature) : BossAI(creature, DATA_PATHALEON_THE_CALCULATOR) { }
|
||||
|
||||
struct boss_pathaleon_the_calculatorAI : public ScriptedAI
|
||||
{
|
||||
boss_pathaleon_the_calculatorAI(Creature* creature) : ScriptedAI(creature), summons(me)
|
||||
{
|
||||
}
|
||||
|
||||
uint32 Summon_Timer;
|
||||
SummonList summons;
|
||||
uint32 ManaTap_Timer;
|
||||
uint32 ArcaneTorrent_Timer;
|
||||
uint32 Domination_Timer;
|
||||
uint32 ArcaneExplosion_Timer;
|
||||
|
||||
bool Enraged;
|
||||
|
||||
uint32 Counter;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Summon_Timer = 30000;
|
||||
ManaTap_Timer = urand(12000, 20000);
|
||||
ArcaneTorrent_Timer = urand(16000, 25000);
|
||||
Domination_Timer = urand(25000, 40000);
|
||||
ArcaneExplosion_Timer = urand(8000, 13000);
|
||||
|
||||
Enraged = false;
|
||||
|
||||
Counter = 0;
|
||||
summons.DespawnAll();
|
||||
}
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
events.ScheduleEvent(EVENT_SUMMON, 30000);
|
||||
events.ScheduleEvent(EVENT_MANA_TAP, urand(12000, 20000));
|
||||
events.ScheduleEvent(EVENT_ARCANE_TORRENT, urand(16000, 25000));
|
||||
events.ScheduleEvent(EVENT_DOMINATION, urand(25000, 40000));
|
||||
events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, urand(8000, 13000));
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
@@ -104,107 +93,82 @@ class boss_pathaleon_the_calculator : public CreatureScript
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
|
||||
summons.DespawnAll();
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
void DamageTaken(Unit* /*attacker*/, uint32& damage)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
}
|
||||
void SummonedCreatureDespawn(Creature* summon)
|
||||
{
|
||||
summons.Despawn(summon);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (Summon_Timer <= diff)
|
||||
{
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
Creature* Wraith = me->SummonCreature(21062, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
|
||||
if (target && Wraith)
|
||||
Wraith->AI()->AttackStart(target);
|
||||
}
|
||||
Talk(SAY_SUMMON);
|
||||
Summon_Timer = urand(30000, 45000);
|
||||
}
|
||||
else
|
||||
Summon_Timer -= diff;
|
||||
|
||||
if (ManaTap_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_MANA_TAP);
|
||||
ManaTap_Timer = urand(14000, 22000);
|
||||
}
|
||||
else
|
||||
ManaTap_Timer -= diff;
|
||||
|
||||
if (ArcaneTorrent_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_ARCANE_TORRENT);
|
||||
ArcaneTorrent_Timer = urand(12000, 18000);
|
||||
}
|
||||
else
|
||||
ArcaneTorrent_Timer -= diff;
|
||||
|
||||
if (Domination_Timer <= diff)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
{
|
||||
Talk(SAY_DOMINATION);
|
||||
DoCast(target, SPELL_DOMINATION);
|
||||
}
|
||||
Domination_Timer = urand(25000, 30000);
|
||||
}
|
||||
else
|
||||
Domination_Timer -= diff;
|
||||
|
||||
//Only casting if Heroic Mode is used
|
||||
if (IsHeroic())
|
||||
{
|
||||
if (ArcaneExplosion_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), H_SPELL_ARCANE_EXPLOSION);
|
||||
ArcaneExplosion_Timer = urand(10000, 14000);
|
||||
}
|
||||
else
|
||||
ArcaneExplosion_Timer -= diff;
|
||||
}
|
||||
|
||||
if (!Enraged && HealthBelowPct(21))
|
||||
if (me->HealthBelowPctDamaged(20, damage) && !me->HasAura(SPELL_FRENZY))
|
||||
{
|
||||
DoCast(me, SPELL_FRENZY);
|
||||
Talk(SAY_ENRAGE);
|
||||
Enraged = true;
|
||||
}
|
||||
}
|
||||
|
||||
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_SUMMON:
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
if (Creature* Wraith = me->SummonCreature(NPC_NETHER_WRAITH, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000))
|
||||
Wraith->AI()->AttackStart(target);
|
||||
}
|
||||
}
|
||||
Talk(SAY_SUMMON);
|
||||
events.ScheduleEvent(EVENT_SUMMON, urand(30000, 45000));
|
||||
break;
|
||||
case EVENT_MANA_TAP:
|
||||
DoCastVictim(SPELL_MANA_TAP, true);
|
||||
events.ScheduleEvent(EVENT_MANA_TAP, urand(14000, 22000));
|
||||
break;
|
||||
case EVENT_ARCANE_TORRENT:
|
||||
DoCastVictim(SPELL_ARCANE_TORRENT, true);
|
||||
events.ScheduleEvent(EVENT_ARCANE_TORRENT, urand(12000, 18000));
|
||||
break;
|
||||
case EVENT_DOMINATION:
|
||||
Talk(SAY_DOMINATION);
|
||||
DoCastVictim(SPELL_DOMINATION, true);
|
||||
events.ScheduleEvent(EVENT_DOMINATION, urand(25000, 30000));
|
||||
break;
|
||||
case EVENT_ARCANE_EXPLOSION: // Heroic only
|
||||
DoCastVictim(H_SPELL_ARCANE_EXPLOSION, true);
|
||||
events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, urand(10000, 14000));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_pathaleon_the_calculatorAI (creature);
|
||||
}
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_pathaleon_the_calculatorAI (creature);
|
||||
}
|
||||
};
|
||||
|
||||
class mob_nether_wraith : public CreatureScript
|
||||
{
|
||||
public:
|
||||
|
||||
mob_nether_wraith()
|
||||
: CreatureScript("mob_nether_wraith")
|
||||
{
|
||||
}
|
||||
mob_nether_wraith() : CreatureScript("mob_nether_wraith") { }
|
||||
|
||||
struct mob_nether_wraithAI : public ScriptedAI
|
||||
{
|
||||
|
||||
@@ -16,68 +16,122 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Instance_Mechanar
|
||||
SD%Complete: 100
|
||||
SDComment:
|
||||
SDCategory: Mechanar
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "mechanar.h"
|
||||
|
||||
#define MAX_ENCOUNTER 1
|
||||
static DoorData const doorData[] =
|
||||
{
|
||||
{ GO_DOOR_MOARG_1, DATA_GATEWATCHER_IRON_HAND, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ GO_DOOR_MOARG_2, DATA_GATEWATCHER_GYROKILL, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ GO_DOOR_NETHERMANCER, DATA_NETHERMANCER_SEPRETHREA, DOOR_TYPE_ROOM, BOUNDARY_NONE },
|
||||
{0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE }
|
||||
};
|
||||
|
||||
class instance_mechanar : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_mechanar()
|
||||
: InstanceMapScript("instance_mechanar", 554)
|
||||
{
|
||||
}
|
||||
instance_mechanar(): InstanceMapScript("instance_mechanar", 554) { }
|
||||
|
||||
struct instance_mechanar_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_mechanar_InstanceMapScript(Map* map) : InstanceScript(map) {}
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
|
||||
void Initialize()
|
||||
instance_mechanar_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
SetBossNumber(EncounterCount);
|
||||
LoadDoorData(doorData);
|
||||
}
|
||||
|
||||
bool IsEncounterInProgress() const
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
void OnGameObjectCreate(GameObject* gameObject)
|
||||
{
|
||||
switch (gameObject->GetEntry())
|
||||
{
|
||||
case GO_DOOR_MOARG_1:
|
||||
case GO_DOOR_MOARG_2:
|
||||
case GO_DOOR_NETHERMANCER:
|
||||
AddDoor(gameObject, true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type) const
|
||||
void OnGameObjectRemove(GameObject* gameObject)
|
||||
{
|
||||
switch (gameObject->GetEntry())
|
||||
{
|
||||
case GO_DOOR_MOARG_1:
|
||||
case GO_DOOR_MOARG_2:
|
||||
case GO_DOOR_NETHERMANCER:
|
||||
AddDoor(gameObject, false);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool SetBossState(uint32 type, EncounterState state)
|
||||
{
|
||||
if (!InstanceScript::SetBossState(type, state))
|
||||
return false;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case DATA_NETHERMANCER_EVENT: return m_auiEncounter[0];
|
||||
case DATA_GATEWATCHER_GYROKILL:
|
||||
case DATA_GATEWATCHER_IRON_HAND:
|
||||
case DATA_MECHANOLORD_CAPACITUS:
|
||||
case DATA_NETHERMANCER_SEPRETHREA:
|
||||
case DATA_PATHALEON_THE_CALCULATOR:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 /*identifier*/) const
|
||||
std::string GetSaveData()
|
||||
{
|
||||
return 0;
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "M C " << GetBossSaveData();
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
void Load(const char* str)
|
||||
{
|
||||
switch (type)
|
||||
if (!str)
|
||||
{
|
||||
case DATA_NETHERMANCER_EVENT: m_auiEncounter[0] = data; break;
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(str);
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
|
||||
std::istringstream loadStream(str);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
|
||||
if (dataHead1 == 'M' && dataHead2 == 'C')
|
||||
{
|
||||
for (uint32 i = 0; i < EncounterCount; ++i)
|
||||
{
|
||||
uint32 tmpState;
|
||||
loadStream >> tmpState;
|
||||
if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
|
||||
tmpState = NOT_STARTED;
|
||||
SetBossState(i, EncounterState(tmpState));
|
||||
}
|
||||
}
|
||||
else
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -89,6 +143,5 @@ class instance_mechanar : public InstanceMapScript
|
||||
|
||||
void AddSC_instance_mechanar()
|
||||
{
|
||||
new instance_mechanar;
|
||||
new instance_mechanar();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
*
|
||||
* 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
|
||||
@@ -19,6 +18,22 @@
|
||||
#ifndef DEF_MECHANAR_H
|
||||
#define DEF_MECHANAR_H
|
||||
|
||||
#define DATA_NETHERMANCER_EVENT 1
|
||||
#endif
|
||||
uint32 const EncounterCount = 5;
|
||||
|
||||
enum DataTypes
|
||||
{
|
||||
DATA_GATEWATCHER_GYROKILL = 0,
|
||||
DATA_GATEWATCHER_IRON_HAND = 1,
|
||||
DATA_MECHANOLORD_CAPACITUS = 2,
|
||||
DATA_NETHERMANCER_SEPRETHREA = 3,
|
||||
DATA_PATHALEON_THE_CALCULATOR = 4
|
||||
};
|
||||
|
||||
enum GameobjectIds
|
||||
{
|
||||
GO_DOOR_MOARG_1 = 184632,
|
||||
GO_DOOR_MOARG_2 = 184322,
|
||||
GO_DOOR_NETHERMANCER = 184449
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -639,7 +639,7 @@ public:
|
||||
if (ChainLightningTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_KUR_CHAIN_LIGHTNING);
|
||||
ChainLightningTimer = urand(7000,14000);
|
||||
ChainLightningTimer = urand(7000, 14000);
|
||||
} else ChainLightningTimer -= diff;
|
||||
|
||||
if (HealthBelowPct(30))
|
||||
@@ -654,7 +654,7 @@ public:
|
||||
if (FrostShockTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_KUR_FROST_SHOCK);
|
||||
FrostShockTimer = urand(7500,15000);
|
||||
FrostShockTimer = urand(7500, 15000);
|
||||
} else FrostShockTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
|
||||
@@ -172,7 +172,7 @@ class spell_dk_anti_magic_zone : public SpellScriptLoader
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Validate(SpellInfo const* /*spellEntry*/)
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DK_ANTI_MAGIC_SHELL_TALENT))
|
||||
return false;
|
||||
|
||||
@@ -29,18 +29,19 @@
|
||||
|
||||
enum DruidSpells
|
||||
{
|
||||
DRUID_INCREASED_MOONFIRE_DURATION = 38414,
|
||||
DRUID_NATURES_SPLENDOR = 57865,
|
||||
DRUID_LIFEBLOOM_FINAL_HEAL = 33778,
|
||||
DRUID_LIFEBLOOM_ENERGIZE = 64372,
|
||||
DRUID_SURVIVAL_INSTINCTS = 50322,
|
||||
DRUID_SAVAGE_ROAR = 62071,
|
||||
SPELL_DRUID_ITEM_T8_BALANCE_RELIC = 64950,
|
||||
SPELL_KING_OF_THE_JUNGLE = 48492,
|
||||
SPELL_TIGER_S_FURY_ENERGIZE = 51178,
|
||||
SPELL_ENRAGE_MOD_DAMAGE = 51185,
|
||||
SPELL_DRUID_ENRAGE_MOD_DAMAGE = 51185,
|
||||
SPELL_DRUID_INCREASED_MOONFIRE_DURATION = 38414,
|
||||
SPELL_DRUID_KING_OF_THE_JUNGLE = 48492,
|
||||
SPELL_DRUID_LIFEBLOOM_ENERGIZE = 64372,
|
||||
SPELL_DRUID_LIFEBLOOM_FINAL_HEAL = 33778,
|
||||
SPELL_DRUID_NATURES_SPLENDOR = 57865,
|
||||
SPELL_DRUID_SURVIVAL_INSTINCTS = 50322,
|
||||
SPELL_DRUID_SAVAGE_ROAR = 62071,
|
||||
SPELL_DRUID_TIGER_S_FURY_ENERGIZE = 51178,
|
||||
SPELL_DRUID_ITEM_T8_BALANCE_RELIC = 64950,
|
||||
};
|
||||
|
||||
// -5229 - Enrage
|
||||
class spell_dru_enrage : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -52,8 +53,8 @@ class spell_dru_enrage : public SpellScriptLoader
|
||||
|
||||
void OnHit()
|
||||
{
|
||||
if (AuraEffect const* aurEff = GetHitUnit()->GetAuraEffectOfRankedSpell(SPELL_KING_OF_THE_JUNGLE, EFFECT_0))
|
||||
GetHitUnit()->CastCustomSpell(SPELL_ENRAGE_MOD_DAMAGE, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetHitUnit(), true);
|
||||
if (AuraEffect const* aurEff = GetHitUnit()->GetAuraEffectOfRankedSpell(SPELL_DRUID_KING_OF_THE_JUNGLE, EFFECT_0))
|
||||
GetHitUnit()->CastCustomSpell(SPELL_DRUID_ENRAGE_MOD_DAMAGE, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetHitUnit(), true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
@@ -68,7 +69,7 @@ class spell_dru_enrage : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 54846 Glyph of Starfire
|
||||
// 54846 - Glyph of Starfire
|
||||
class spell_dru_glyph_of_starfire : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -78,9 +79,9 @@ class spell_dru_glyph_of_starfire : public SpellScriptLoader
|
||||
{
|
||||
PrepareSpellScript(spell_dru_glyph_of_starfire_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellEntry*/)
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(DRUID_INCREASED_MOONFIRE_DURATION) || !sSpellMgr->GetSpellInfo(DRUID_NATURES_SPLENDOR))
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_INCREASED_MOONFIRE_DURATION) || !sSpellMgr->GetSpellInfo(SPELL_DRUID_NATURES_SPLENDOR))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -95,9 +96,9 @@ class spell_dru_glyph_of_starfire : public SpellScriptLoader
|
||||
|
||||
uint32 countMin = aura->GetMaxDuration();
|
||||
uint32 countMax = aura->GetSpellInfo()->GetMaxDuration() + 9000;
|
||||
if (caster->HasAura(DRUID_INCREASED_MOONFIRE_DURATION))
|
||||
if (caster->HasAura(SPELL_DRUID_INCREASED_MOONFIRE_DURATION))
|
||||
countMax += 3000;
|
||||
if (caster->HasAura(DRUID_NATURES_SPLENDOR))
|
||||
if (caster->HasAura(SPELL_DRUID_NATURES_SPLENDOR))
|
||||
countMax += 3000;
|
||||
|
||||
if (countMin < countMax)
|
||||
@@ -120,6 +121,7 @@ class spell_dru_glyph_of_starfire : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// -5570 - Insect Swarm
|
||||
class spell_dru_insect_swarm : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -282,9 +284,9 @@ class spell_dru_lifebloom : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(DRUID_LIFEBLOOM_FINAL_HEAL))
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_LIFEBLOOM_FINAL_HEAL))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(DRUID_LIFEBLOOM_ENERGIZE))
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_LIFEBLOOM_ENERGIZE))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -303,15 +305,15 @@ class spell_dru_lifebloom : public SpellScriptLoader
|
||||
healAmount = caster->SpellHealingBonusDone(GetTarget(), GetSpellInfo(), healAmount, HEAL, stack);
|
||||
healAmount = GetTarget()->SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, HEAL, stack);
|
||||
|
||||
GetTarget()->CastCustomSpell(GetTarget(), DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
|
||||
GetTarget()->CastCustomSpell(GetTarget(), SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
|
||||
|
||||
// restore mana
|
||||
int32 returnMana = CalculatePct(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * stack / 2;
|
||||
caster->CastCustomSpell(caster, DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
|
||||
caster->CastCustomSpell(caster, SPELL_DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
|
||||
return;
|
||||
}
|
||||
|
||||
GetTarget()->CastCustomSpell(GetTarget(), DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
|
||||
GetTarget()->CastCustomSpell(GetTarget(), SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
|
||||
}
|
||||
|
||||
void HandleDispel(DispelInfo* dispelInfo)
|
||||
@@ -326,15 +328,15 @@ class spell_dru_lifebloom : public SpellScriptLoader
|
||||
{
|
||||
healAmount = caster->SpellHealingBonusDone(target, GetSpellInfo(), healAmount, HEAL, dispelInfo->GetRemovedCharges());
|
||||
healAmount = target->SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, HEAL, dispelInfo->GetRemovedCharges());
|
||||
target->CastCustomSpell(target, DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID());
|
||||
target->CastCustomSpell(target, SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID());
|
||||
|
||||
// restore mana
|
||||
int32 returnMana = CalculatePct(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * dispelInfo->GetRemovedCharges() / 2;
|
||||
caster->CastCustomSpell(caster, DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, NULL, GetCasterGUID());
|
||||
caster->CastCustomSpell(caster, SPELL_DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, NULL, GetCasterGUID());
|
||||
return;
|
||||
}
|
||||
|
||||
target->CastCustomSpell(target, DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID());
|
||||
target->CastCustomSpell(target, SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -396,6 +398,7 @@ class spell_dru_moonkin_form_passive : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// -16972 - Predatory Strikes
|
||||
class spell_dru_predatory_strikes : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -511,6 +514,7 @@ class spell_dru_savage_defense : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 52610 - Savage Roar
|
||||
class spell_dru_savage_roar : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -541,7 +545,7 @@ class spell_dru_savage_roar : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(DRUID_SAVAGE_ROAR))
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_SAVAGE_ROAR))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -549,12 +553,12 @@ class spell_dru_savage_roar : public SpellScriptLoader
|
||||
void AfterApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
target->CastSpell(target, DRUID_SAVAGE_ROAR, true, NULL, aurEff, GetCasterGUID());
|
||||
target->CastSpell(target, SPELL_DRUID_SAVAGE_ROAR, true, NULL, aurEff, GetCasterGUID());
|
||||
}
|
||||
|
||||
void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetTarget()->RemoveAurasDueToSpell(DRUID_SAVAGE_ROAR);
|
||||
GetTarget()->RemoveAurasDueToSpell(SPELL_DRUID_SAVAGE_ROAR);
|
||||
}
|
||||
|
||||
void Register()
|
||||
@@ -575,6 +579,7 @@ class spell_dru_savage_roar : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// -50294 - Starfall (AOE)
|
||||
class spell_dru_starfall_aoe : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -601,6 +606,7 @@ class spell_dru_starfall_aoe : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// -50286 - Starfall (Dummy)
|
||||
class spell_dru_starfall_dummy : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -646,6 +652,7 @@ class spell_dru_starfall_dummy : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 61336 - Survival Instincts
|
||||
class spell_dru_survival_instincts : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -676,7 +683,7 @@ class spell_dru_survival_instincts : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(DRUID_SURVIVAL_INSTINCTS))
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_SURVIVAL_INSTINCTS))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -685,12 +692,12 @@ class spell_dru_survival_instincts : public SpellScriptLoader
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
int32 bp0 = target->CountPctFromMaxHealth(aurEff->GetAmount());
|
||||
target->CastCustomSpell(target, DRUID_SURVIVAL_INSTINCTS, &bp0, NULL, NULL, true);
|
||||
target->CastCustomSpell(target, SPELL_DRUID_SURVIVAL_INSTINCTS, &bp0, NULL, NULL, true);
|
||||
}
|
||||
|
||||
void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetTarget()->RemoveAurasDueToSpell(DRUID_SURVIVAL_INSTINCTS);
|
||||
GetTarget()->RemoveAurasDueToSpell(SPELL_DRUID_SURVIVAL_INSTINCTS);
|
||||
}
|
||||
|
||||
void Register()
|
||||
@@ -745,6 +752,7 @@ class spell_dru_swift_flight_passive : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// -5217 - Tiger's Fury
|
||||
class spell_dru_tiger_s_fury : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -756,8 +764,8 @@ class spell_dru_tiger_s_fury : public SpellScriptLoader
|
||||
|
||||
void OnHit()
|
||||
{
|
||||
if (AuraEffect const* aurEff = GetHitUnit()->GetAuraEffectOfRankedSpell(SPELL_KING_OF_THE_JUNGLE, EFFECT_1))
|
||||
GetHitUnit()->CastCustomSpell(SPELL_TIGER_S_FURY_ENERGIZE, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetHitUnit(), true);
|
||||
if (AuraEffect const* aurEff = GetHitUnit()->GetAuraEffectOfRankedSpell(SPELL_DRUID_KING_OF_THE_JUNGLE, EFFECT_1))
|
||||
GetHitUnit()->CastCustomSpell(SPELL_DRUID_TIGER_S_FURY_ENERGIZE, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetHitUnit(), true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
@@ -772,6 +780,7 @@ class spell_dru_tiger_s_fury : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 70691 - Item T10 Restoration 4P Bonus
|
||||
class spell_dru_t10_restoration_4p_bonus : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -1539,7 +1539,7 @@ class spell_gen_gnomish_transporter : public SpellScriptLoader
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
caster->CastSpell(caster, roll_chance_i(50) ? SPELL_TRANSPORTER_SUCCESS : SPELL_TRANSPORTER_FAILURE , true);
|
||||
caster->CastSpell(caster, roll_chance_i(50) ? SPELL_TRANSPORTER_SUCCESS : SPELL_TRANSPORTER_FAILURE, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
/*
|
||||
* Spells used in holidays/game events that do not fit any other category.
|
||||
* Ordered alphabetically using scriptname.
|
||||
* Scriptnames in this file should be prefixed with "spell_#holidayname_".
|
||||
*/
|
||||
|
||||
@@ -133,6 +134,7 @@ class spell_hallow_end_trick : public SpellScriptLoader
|
||||
class spell_hallow_end_trick_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_hallow_end_trick_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PIRATE_COSTUME_MALE) || !sSpellMgr->GetSpellInfo(SPELL_PIRATE_COSTUME_FEMALE) || !sSpellMgr->GetSpellInfo(SPELL_NINJA_COSTUME_MALE)
|
||||
@@ -170,7 +172,7 @@ class spell_hallow_end_trick : public SpellScriptLoader
|
||||
break;
|
||||
}
|
||||
|
||||
caster->CastSpell(target, spellId, true, NULL);
|
||||
caster->CastSpell(target, spellId, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,8 +220,8 @@ class spell_hallow_end_trick_or_treat : public SpellScriptLoader
|
||||
Unit* caster = GetCaster();
|
||||
if (Player* target = GetHitPlayer())
|
||||
{
|
||||
caster->CastSpell(target, roll_chance_i(50) ? SPELL_TRICK : SPELL_TREAT, true, NULL);
|
||||
caster->CastSpell(target, SPELL_TRICKED_OR_TREATED, true, NULL);
|
||||
caster->CastSpell(target, roll_chance_i(50) ? SPELL_TRICK : SPELL_TREAT, true);
|
||||
caster->CastSpell(target, SPELL_TRICKED_OR_TREATED, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -286,7 +286,6 @@ class spell_hun_last_stand_pet : public SpellScriptLoader
|
||||
|
||||
void Register()
|
||||
{
|
||||
// add dummy effect spell handler to pet's Last Stand
|
||||
OnEffectHitTarget += SpellEffectFn(spell_hun_last_stand_pet_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
@@ -452,7 +451,6 @@ class spell_hun_pet_carrion_feeder : public SpellScriptLoader
|
||||
|
||||
void Register()
|
||||
{
|
||||
// add dummy effect spell handler to pet's Last Stand
|
||||
OnEffectHit += SpellEffectFn(spell_hun_pet_carrion_feeder_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
OnCheckCast += SpellCheckCastFn(spell_hun_pet_carrion_feeder_SpellScript::CheckIfCorpseNear);
|
||||
}
|
||||
@@ -501,7 +499,6 @@ class spell_hun_pet_heart_of_the_phoenix : public SpellScriptLoader
|
||||
|
||||
void Register()
|
||||
{
|
||||
// add dummy effect spell handler to pet's Last Stand
|
||||
OnEffectHitTarget += SpellEffectFn(spell_hun_pet_heart_of_the_phoenix_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
@@ -551,7 +548,6 @@ class spell_hun_readiness : public SpellScriptLoader
|
||||
|
||||
void Register()
|
||||
{
|
||||
// add dummy effect spell handler to Readiness
|
||||
OnEffectHitTarget += SpellEffectFn(spell_hun_readiness_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1350,7 +1350,7 @@ class spell_item_poultryizer : public SpellScriptLoader
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
{
|
||||
if (GetCastItem() && GetHitUnit())
|
||||
GetCaster()->CastSpell(GetHitUnit(), roll_chance_i(80) ? SPELL_POULTRYIZER_SUCCESS : SPELL_POULTRYIZER_BACKFIRE , true, GetCastItem());
|
||||
GetCaster()->CastSpell(GetHitUnit(), roll_chance_i(80) ? SPELL_POULTRYIZER_SUCCESS : SPELL_POULTRYIZER_BACKFIRE, true, GetCastItem());
|
||||
}
|
||||
|
||||
void Register()
|
||||
@@ -1710,7 +1710,7 @@ class spell_item_teach_language : public SpellScriptLoader
|
||||
Player* caster = GetCaster()->ToPlayer();
|
||||
|
||||
if (roll_chance_i(34))
|
||||
caster->CastSpell(caster,caster->GetTeam() == ALLIANCE ? SPELL_LEARN_GNOMISH_BINARY : SPELL_LEARN_GOBLIN_BINARY, true);
|
||||
caster->CastSpell(caster, caster->GetTeam() == ALLIANCE ? SPELL_LEARN_GNOMISH_BINARY : SPELL_LEARN_GOBLIN_BINARY, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
@@ -2004,7 +2004,7 @@ public:
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (GetHitUnit())
|
||||
GetCaster()->CastSpell(GetCaster(),SPELL_FORCE_CAST_SUMMON_GNOME_SOUL);
|
||||
GetCaster()->CastSpell(GetCaster(), SPELL_FORCE_CAST_SUMMON_GNOME_SOUL);
|
||||
}
|
||||
|
||||
void Register()
|
||||
|
||||
@@ -71,7 +71,7 @@ class spell_mage_blast_wave : public SpellScriptLoader
|
||||
{
|
||||
PrepareSpellScript(spell_mage_blast_wave_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellEntry*/)
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_FLAMESTRIKE))
|
||||
return false;
|
||||
@@ -131,7 +131,6 @@ class spell_mage_cold_snap : public SpellScriptLoader
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
|
||||
Player* caster = GetCaster()->ToPlayer();
|
||||
// immediately finishes the cooldown on Frost spells
|
||||
const SpellCooldowns& cm = caster->GetSpellCooldownMap();
|
||||
@@ -152,7 +151,6 @@ class spell_mage_cold_snap : public SpellScriptLoader
|
||||
|
||||
void Register()
|
||||
{
|
||||
// add dummy effect spell handler to Cold Snap
|
||||
OnEffectHit += SpellEffectFn(spell_mage_cold_snap_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
@@ -553,7 +551,7 @@ class spell_mage_ice_barrier : public SpellScriptLoader
|
||||
{
|
||||
PrepareAuraScript(spell_mage_ice_barrier_AuraScript);
|
||||
|
||||
void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_ENEMY_SPELL)
|
||||
return;
|
||||
@@ -587,7 +585,7 @@ class spell_mage_mana_shield : public SpellScriptLoader
|
||||
{
|
||||
PrepareAuraScript(spell_mage_mana_shield_AuraScript);
|
||||
|
||||
void HandleAbsorb(AuraEffect* aurEff, DamageInfo & /*dmgInfo*/, uint32 & absorbAmount)
|
||||
void HandleAbsorb(AuraEffect* /*aurEff*/, DamageInfo & /*dmgInfo*/, uint32 & absorbAmount)
|
||||
{
|
||||
if (AuraEffect* aurEff = GetTarget()->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_GENERIC, ICON_MAGE_INCANTER_S_ABSORPTION, EFFECT_0))
|
||||
{
|
||||
@@ -596,7 +594,7 @@ class spell_mage_mana_shield : public SpellScriptLoader
|
||||
}
|
||||
}
|
||||
|
||||
void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_ENEMY_SPELL)
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_MAGE_INCANTER_S_ABSORPTION_KNOCKBACK, true);
|
||||
@@ -626,7 +624,7 @@ class spell_mage_mage_ward : public SpellScriptLoader
|
||||
{
|
||||
PrepareAuraScript(spell_mage_mage_ward_AuraScript);
|
||||
|
||||
void HandleAbsorb(AuraEffect* aurEff, DamageInfo & /*dmgInfo*/, uint32 & absorbAmount)
|
||||
void HandleAbsorb(AuraEffect* /*aurEff*/, DamageInfo & /*dmgInfo*/, uint32 & absorbAmount)
|
||||
{
|
||||
if (AuraEffect* aurEff = GetTarget()->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_GENERIC, ICON_MAGE_INCANTER_S_ABSORPTION, EFFECT_0))
|
||||
{
|
||||
|
||||
@@ -29,28 +29,28 @@
|
||||
|
||||
enum PaladinSpells
|
||||
{
|
||||
PALADIN_SPELL_DIVINE_PLEA = 54428,
|
||||
PALADIN_SPELL_BLESSING_OF_SANCTUARY_BUFF = 67480,
|
||||
SPELL_PALADIN_DIVINE_PLEA = 54428,
|
||||
SPELL_PALADIN_BLESSING_OF_SANCTUARY_BUFF = 67480,
|
||||
|
||||
PALADIN_SPELL_HOLY_SHOCK_R1 = 20473,
|
||||
PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE = 25912,
|
||||
PALADIN_SPELL_HOLY_SHOCK_R1_HEALING = 25914,
|
||||
SPELL_PALADIN_HOLY_SHOCK_R1 = 20473,
|
||||
SPELL_PALADIN_HOLY_SHOCK_R1_DAMAGE = 25912,
|
||||
SPELL_PALADIN_HOLY_SHOCK_R1_HEALING = 25914,
|
||||
|
||||
SPELL_BLESSING_OF_LOWER_CITY_DRUID = 37878,
|
||||
SPELL_BLESSING_OF_LOWER_CITY_PALADIN = 37879,
|
||||
SPELL_BLESSING_OF_LOWER_CITY_PRIEST = 37880,
|
||||
SPELL_BLESSING_OF_LOWER_CITY_SHAMAN = 37881,
|
||||
SPELL_PALADIN_BLESSING_OF_LOWER_CITY_DRUID = 37878,
|
||||
SPELL_PALADIN_BLESSING_OF_LOWER_CITY_PALADIN = 37879,
|
||||
SPELL_PALADIN_BLESSING_OF_LOWER_CITY_PRIEST = 37880,
|
||||
SPELL_PALADIN_BLESSING_OF_LOWER_CITY_SHAMAN = 37881,
|
||||
|
||||
SPELL_DIVINE_STORM = 53385,
|
||||
SPELL_DIVINE_STORM_DUMMY = 54171,
|
||||
SPELL_DIVINE_STORM_HEAL = 54172,
|
||||
SPELL_PALADIN_DIVINE_STORM = 53385,
|
||||
SPELL_PALADIN_DIVINE_STORM_DUMMY = 54171,
|
||||
SPELL_PALADIN_DIVINE_STORM_HEAL = 54172,
|
||||
|
||||
SPELL_FORBEARANCE = 25771,
|
||||
SPELL_AVENGING_WRATH_MARKER = 61987,
|
||||
SPELL_IMMUNE_SHIELD_MARKER = 61988,
|
||||
SPELL_PALADIN_FORBEARANCE = 25771,
|
||||
SPELL_PALADIN_AVENGING_WRATH_MARKER = 61987,
|
||||
SPELL_PALADIN_IMMUNE_SHIELD_MARKER = 61988,
|
||||
|
||||
SPELL_HAND_OF_SACRIFICE = 6940,
|
||||
SPELL_DIVINE_SACRIFICE = 64205,
|
||||
SPELL_PALADIN_HAND_OF_SACRIFICE = 6940,
|
||||
SPELL_PALADIN_DIVINE_SACRIFICE = 64205,
|
||||
};
|
||||
|
||||
// 31850 - Ardent Defender
|
||||
@@ -129,6 +129,7 @@ enum PaladinSpells
|
||||
}
|
||||
};*/
|
||||
|
||||
// 37877 - Blessing of Faith
|
||||
class spell_pal_blessing_of_faith : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -138,9 +139,9 @@ class spell_pal_blessing_of_faith : public SpellScriptLoader
|
||||
{
|
||||
PrepareSpellScript(spell_pal_blessing_of_faith_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellEntry*/)
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_BLESSING_OF_LOWER_CITY_DRUID) || !sSpellMgr->GetSpellInfo(SPELL_BLESSING_OF_LOWER_CITY_PALADIN) || !sSpellMgr->GetSpellInfo(SPELL_BLESSING_OF_LOWER_CITY_PRIEST) || !sSpellMgr->GetSpellInfo(SPELL_BLESSING_OF_LOWER_CITY_SHAMAN))
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_BLESSING_OF_LOWER_CITY_DRUID) || !sSpellMgr->GetSpellInfo(SPELL_PALADIN_BLESSING_OF_LOWER_CITY_PALADIN) || !sSpellMgr->GetSpellInfo(SPELL_PALADIN_BLESSING_OF_LOWER_CITY_PRIEST) || !sSpellMgr->GetSpellInfo(SPELL_PALADIN_BLESSING_OF_LOWER_CITY_SHAMAN))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -152,11 +153,20 @@ class spell_pal_blessing_of_faith : public SpellScriptLoader
|
||||
uint32 spell_id = 0;
|
||||
switch (unitTarget->getClass())
|
||||
{
|
||||
case CLASS_DRUID: spell_id = SPELL_BLESSING_OF_LOWER_CITY_DRUID; break;
|
||||
case CLASS_PALADIN: spell_id = SPELL_BLESSING_OF_LOWER_CITY_PALADIN; break;
|
||||
case CLASS_PRIEST: spell_id = SPELL_BLESSING_OF_LOWER_CITY_PRIEST; break;
|
||||
case CLASS_SHAMAN: spell_id = SPELL_BLESSING_OF_LOWER_CITY_SHAMAN; break;
|
||||
default: return; // ignore for non-healing classes
|
||||
case CLASS_DRUID:
|
||||
spell_id = SPELL_PALADIN_BLESSING_OF_LOWER_CITY_DRUID;
|
||||
break;
|
||||
case CLASS_PALADIN:
|
||||
spell_id = SPELL_PALADIN_BLESSING_OF_LOWER_CITY_PALADIN;
|
||||
break;
|
||||
case CLASS_PRIEST:
|
||||
spell_id = SPELL_PALADIN_BLESSING_OF_LOWER_CITY_PRIEST;
|
||||
break;
|
||||
case CLASS_SHAMAN:
|
||||
spell_id = SPELL_PALADIN_BLESSING_OF_LOWER_CITY_SHAMAN;
|
||||
break;
|
||||
default:
|
||||
return; // ignore for non-healing classes
|
||||
}
|
||||
Unit* caster = GetCaster();
|
||||
caster->CastSpell(caster, spell_id, true);
|
||||
@@ -165,7 +175,6 @@ class spell_pal_blessing_of_faith : public SpellScriptLoader
|
||||
|
||||
void Register()
|
||||
{
|
||||
// add dummy effect spell handler to Blessing of Faith
|
||||
OnEffectHitTarget += SpellEffectFn(spell_pal_blessing_of_faith_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
@@ -187,9 +196,9 @@ class spell_pal_blessing_of_sanctuary : public SpellScriptLoader
|
||||
{
|
||||
PrepareAuraScript(spell_pal_blessing_of_sanctuary_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*entry*/)
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(PALADIN_SPELL_BLESSING_OF_SANCTUARY_BUFF))
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_BLESSING_OF_SANCTUARY_BUFF))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -198,13 +207,13 @@ class spell_pal_blessing_of_sanctuary : public SpellScriptLoader
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(target, PALADIN_SPELL_BLESSING_OF_SANCTUARY_BUFF, true);
|
||||
caster->CastSpell(target, SPELL_PALADIN_BLESSING_OF_SANCTUARY_BUFF, true);
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
target->RemoveAura(PALADIN_SPELL_BLESSING_OF_SANCTUARY_BUFF, GetCasterGUID());
|
||||
target->RemoveAura(SPELL_PALADIN_BLESSING_OF_SANCTUARY_BUFF, GetCasterGUID());
|
||||
}
|
||||
|
||||
void Register()
|
||||
@@ -220,399 +229,7 @@ class spell_pal_blessing_of_sanctuary : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 63521 Guarded by The Light
|
||||
class spell_pal_guarded_by_the_light : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pal_guarded_by_the_light() : SpellScriptLoader("spell_pal_guarded_by_the_light") { }
|
||||
|
||||
class spell_pal_guarded_by_the_light_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_pal_guarded_by_the_light_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellEntry*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(PALADIN_SPELL_DIVINE_PLEA))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
// Divine Plea
|
||||
if (Aura* aura = GetCaster()->GetAura(PALADIN_SPELL_DIVINE_PLEA))
|
||||
aura->RefreshDuration();
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_pal_guarded_by_the_light_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_pal_guarded_by_the_light_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_pal_holy_shock : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pal_holy_shock() : SpellScriptLoader("spell_pal_holy_shock") { }
|
||||
|
||||
class spell_pal_holy_shock_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_pal_holy_shock_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* spell)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(PALADIN_SPELL_HOLY_SHOCK_R1))
|
||||
return false;
|
||||
|
||||
// can't use other spell than holy shock due to spell_ranks dependency
|
||||
if (sSpellMgr->GetFirstSpellInChain(PALADIN_SPELL_HOLY_SHOCK_R1) != sSpellMgr->GetFirstSpellInChain(spell->Id))
|
||||
return false;
|
||||
|
||||
uint8 rank = sSpellMgr->GetSpellRank(spell->Id);
|
||||
if (!sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE, rank, true) || !sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_HEALING, rank, true))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (Unit* unitTarget = GetHitUnit())
|
||||
{
|
||||
uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id);
|
||||
if (caster->IsFriendlyTo(unitTarget))
|
||||
caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_HEALING, rank), true, 0);
|
||||
else
|
||||
caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE, rank), true, 0);
|
||||
}
|
||||
}
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (Unit* target = GetExplTargetUnit())
|
||||
{
|
||||
if (!caster->IsFriendlyTo(target))
|
||||
{
|
||||
if (!caster->IsValidAttackTarget(target))
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
if (!caster->isInFront(target))
|
||||
return SPELL_FAILED_UNIT_NOT_INFRONT;
|
||||
}
|
||||
}
|
||||
else
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
// add dummy effect spell handler to Holy Shock
|
||||
OnCheckCast += SpellCheckCastFn(spell_pal_holy_shock_SpellScript::CheckCast);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_pal_holy_shock_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_pal_holy_shock_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_pal_judgement_of_command : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pal_judgement_of_command() : SpellScriptLoader("spell_pal_judgement_of_command") { }
|
||||
|
||||
class spell_pal_judgement_of_command_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_pal_judgement_of_command_SpellScript)
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* unitTarget = GetHitUnit())
|
||||
if (SpellInfo const* spell_proto = sSpellMgr->GetSpellInfo(GetEffectValue()))
|
||||
GetCaster()->CastSpell(unitTarget, spell_proto, true, NULL);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
// add dummy effect spell handler to Judgement of Command
|
||||
OnEffectHitTarget += SpellEffectFn(spell_pal_judgement_of_command_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_pal_judgement_of_command_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_pal_divine_storm : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pal_divine_storm() : SpellScriptLoader("spell_pal_divine_storm") { }
|
||||
|
||||
class spell_pal_divine_storm_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_pal_divine_storm_SpellScript);
|
||||
|
||||
uint32 healPct;
|
||||
|
||||
bool Validate(SpellInfo const* /* spell */)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DIVINE_STORM_DUMMY))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Load()
|
||||
{
|
||||
healPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue(GetCaster());
|
||||
return true;
|
||||
}
|
||||
|
||||
void TriggerHeal()
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
caster->CastCustomSpell(SPELL_DIVINE_STORM_DUMMY, SPELLVALUE_BASE_POINT0, (GetHitDamage() * healPct) / 100, caster, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterHit += SpellHitFn(spell_pal_divine_storm_SpellScript::TriggerHeal);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_pal_divine_storm_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_pal_divine_storm_dummy : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pal_divine_storm_dummy() : SpellScriptLoader("spell_pal_divine_storm_dummy") { }
|
||||
|
||||
class spell_pal_divine_storm_dummy_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_pal_divine_storm_dummy_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /* spell */)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DIVINE_STORM_HEAL))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void CountTargets(std::list<WorldObject*>& targetList)
|
||||
{
|
||||
_targetCount = targetList.size();
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
{
|
||||
if (!_targetCount || ! GetHitUnit())
|
||||
return;
|
||||
|
||||
int32 heal = GetEffectValue() / _targetCount;
|
||||
GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_DIVINE_STORM_HEAL, &heal, NULL, NULL, true);
|
||||
}
|
||||
private:
|
||||
uint32 _targetCount;
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_pal_divine_storm_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pal_divine_storm_dummy_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_pal_divine_storm_dummy_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_pal_lay_on_hands : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pal_lay_on_hands() : SpellScriptLoader("spell_pal_lay_on_hands") { }
|
||||
|
||||
class spell_pal_lay_on_hands_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_pal_lay_on_hands_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_FORBEARANCE))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_AVENGING_WRATH_MARKER))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_IMMUNE_SHIELD_MARKER))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (Unit* target = GetExplTargetUnit())
|
||||
if (caster == target)
|
||||
if (target->HasAura(SPELL_FORBEARANCE) || target->HasAura(SPELL_AVENGING_WRATH_MARKER) || target->HasAura(SPELL_IMMUNE_SHIELD_MARKER))
|
||||
return SPELL_FAILED_TARGET_AURASTATE;
|
||||
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
void HandleScript()
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (caster == GetHitUnit())
|
||||
{
|
||||
caster->CastSpell(caster, SPELL_FORBEARANCE, true);
|
||||
caster->CastSpell(caster, SPELL_AVENGING_WRATH_MARKER, true);
|
||||
caster->CastSpell(caster, SPELL_IMMUNE_SHIELD_MARKER, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnCheckCast += SpellCheckCastFn(spell_pal_lay_on_hands_SpellScript::CheckCast);
|
||||
AfterHit += SpellHitFn(spell_pal_lay_on_hands_SpellScript::HandleScript);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_pal_lay_on_hands_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_pal_righteous_defense : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pal_righteous_defense() : SpellScriptLoader("spell_pal_righteous_defense") { }
|
||||
|
||||
class spell_pal_righteous_defense_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_pal_righteous_defense_SpellScript);
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return SPELL_FAILED_DONT_REPORT;
|
||||
|
||||
if (Unit* target = GetExplTargetUnit())
|
||||
{
|
||||
if (!target->IsFriendlyTo(caster) || target->getAttackers().empty())
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
}
|
||||
else
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnCheckCast += SpellCheckCastFn(spell_pal_righteous_defense_SpellScript::CheckCast);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_pal_righteous_defense_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_pal_exorcism_and_holy_wrath_damage : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pal_exorcism_and_holy_wrath_damage() : SpellScriptLoader("spell_pal_exorcism_and_holy_wrath_damage") { }
|
||||
|
||||
class spell_pal_exorcism_and_holy_wrath_damage_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_pal_exorcism_and_holy_wrath_damage_AuraScript);
|
||||
|
||||
void HandleEffectCalcSpellMod(AuraEffect const* aurEff, SpellModifier*& spellMod)
|
||||
{
|
||||
if (!spellMod)
|
||||
{
|
||||
spellMod = new SpellModifier(aurEff->GetBase());
|
||||
spellMod->op = SPELLMOD_DAMAGE;
|
||||
spellMod->type = SPELLMOD_FLAT;
|
||||
spellMod->spellId = GetId();
|
||||
spellMod->mask[1] = 0x200002;
|
||||
}
|
||||
|
||||
spellMod->value = aurEff->GetAmount();
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
DoEffectCalcSpellMod += AuraEffectCalcSpellModFn(spell_pal_exorcism_and_holy_wrath_damage_AuraScript::HandleEffectCalcSpellMod, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_pal_exorcism_and_holy_wrath_damage_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_pal_hand_of_sacrifice : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pal_hand_of_sacrifice() : SpellScriptLoader("spell_pal_hand_of_sacrifice") { }
|
||||
|
||||
class spell_pal_hand_of_sacrifice_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_pal_hand_of_sacrifice_AuraScript);
|
||||
|
||||
int32 remainingAmount;
|
||||
|
||||
bool Load()
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
remainingAmount = caster->GetMaxHealth();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Split(AuraEffect* /*aurEff*/, DamageInfo & /*dmgInfo*/, uint32 & splitAmount)
|
||||
{
|
||||
remainingAmount -= splitAmount;
|
||||
|
||||
if (remainingAmount <= 0)
|
||||
{
|
||||
GetTarget()->RemoveAura(SPELL_HAND_OF_SACRIFICE);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectSplit += AuraEffectSplitFn(spell_pal_hand_of_sacrifice_AuraScript::Split, EFFECT_0);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_pal_hand_of_sacrifice_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 64205 - Divine Sacrifice
|
||||
class spell_pal_divine_sacrifice : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -653,7 +270,7 @@ class spell_pal_divine_sacrifice : public SpellScriptLoader
|
||||
// break when absorbed everything it could, or if the casters hp drops below 20%
|
||||
if (Unit* caster = GetCaster())
|
||||
if (remainingAmount <= 0 || (caster->GetHealthPct() < minHpPct))
|
||||
caster->RemoveAura(SPELL_DIVINE_SACRIFICE);
|
||||
caster->RemoveAura(SPELL_PALADIN_DIVINE_SACRIFICE);
|
||||
}
|
||||
|
||||
void Register()
|
||||
@@ -668,6 +285,406 @@ class spell_pal_divine_sacrifice : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 53385 - Divine Storm
|
||||
class spell_pal_divine_storm : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pal_divine_storm() : SpellScriptLoader("spell_pal_divine_storm") { }
|
||||
|
||||
class spell_pal_divine_storm_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_pal_divine_storm_SpellScript);
|
||||
|
||||
uint32 healPct;
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_DIVINE_STORM_DUMMY))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Load()
|
||||
{
|
||||
healPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue(GetCaster());
|
||||
return true;
|
||||
}
|
||||
|
||||
void TriggerHeal()
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
caster->CastCustomSpell(SPELL_PALADIN_DIVINE_STORM_DUMMY, SPELLVALUE_BASE_POINT0, (GetHitDamage() * healPct) / 100, caster, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterHit += SpellHitFn(spell_pal_divine_storm_SpellScript::TriggerHeal);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_pal_divine_storm_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 54171 - Divine Storm (Dummy)
|
||||
class spell_pal_divine_storm_dummy : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pal_divine_storm_dummy() : SpellScriptLoader("spell_pal_divine_storm_dummy") { }
|
||||
|
||||
class spell_pal_divine_storm_dummy_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_pal_divine_storm_dummy_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_DIVINE_STORM_HEAL))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void CountTargets(std::list<WorldObject*>& targetList)
|
||||
{
|
||||
_targetCount = targetList.size();
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (!_targetCount || ! GetHitUnit())
|
||||
return;
|
||||
|
||||
int32 heal = GetEffectValue() / _targetCount;
|
||||
GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_PALADIN_DIVINE_STORM_HEAL, &heal, NULL, NULL, true);
|
||||
}
|
||||
private:
|
||||
uint32 _targetCount;
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_pal_divine_storm_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pal_divine_storm_dummy_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_pal_divine_storm_dummy_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 33695 - Exorcism and Holy Wrath Damage
|
||||
class spell_pal_exorcism_and_holy_wrath_damage : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pal_exorcism_and_holy_wrath_damage() : SpellScriptLoader("spell_pal_exorcism_and_holy_wrath_damage") { }
|
||||
|
||||
class spell_pal_exorcism_and_holy_wrath_damage_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_pal_exorcism_and_holy_wrath_damage_AuraScript);
|
||||
|
||||
void HandleEffectCalcSpellMod(AuraEffect const* aurEff, SpellModifier*& spellMod)
|
||||
{
|
||||
if (!spellMod)
|
||||
{
|
||||
spellMod = new SpellModifier(aurEff->GetBase());
|
||||
spellMod->op = SPELLMOD_DAMAGE;
|
||||
spellMod->type = SPELLMOD_FLAT;
|
||||
spellMod->spellId = GetId();
|
||||
spellMod->mask[1] = 0x200002;
|
||||
}
|
||||
|
||||
spellMod->value = aurEff->GetAmount();
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
DoEffectCalcSpellMod += AuraEffectCalcSpellModFn(spell_pal_exorcism_and_holy_wrath_damage_AuraScript::HandleEffectCalcSpellMod, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_pal_exorcism_and_holy_wrath_damage_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 63521 - Guarded by The Light
|
||||
class spell_pal_guarded_by_the_light : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pal_guarded_by_the_light() : SpellScriptLoader("spell_pal_guarded_by_the_light") { }
|
||||
|
||||
class spell_pal_guarded_by_the_light_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_pal_guarded_by_the_light_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_DIVINE_PLEA))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
// Divine Plea
|
||||
if (Aura* aura = GetCaster()->GetAura(SPELL_PALADIN_DIVINE_PLEA))
|
||||
aura->RefreshDuration();
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_pal_guarded_by_the_light_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_pal_guarded_by_the_light_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 6940 - Hand of Sacrifice
|
||||
class spell_pal_hand_of_sacrifice : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pal_hand_of_sacrifice() : SpellScriptLoader("spell_pal_hand_of_sacrifice") { }
|
||||
|
||||
class spell_pal_hand_of_sacrifice_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_pal_hand_of_sacrifice_AuraScript);
|
||||
|
||||
int32 remainingAmount;
|
||||
|
||||
bool Load()
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
remainingAmount = caster->GetMaxHealth();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Split(AuraEffect* /*aurEff*/, DamageInfo & /*dmgInfo*/, uint32 & splitAmount)
|
||||
{
|
||||
remainingAmount -= splitAmount;
|
||||
|
||||
if (remainingAmount <= 0)
|
||||
{
|
||||
GetTarget()->RemoveAura(SPELL_PALADIN_HAND_OF_SACRIFICE);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectSplit += AuraEffectSplitFn(spell_pal_hand_of_sacrifice_AuraScript::Split, EFFECT_0);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_pal_hand_of_sacrifice_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// -20473 - Holy Shock
|
||||
class spell_pal_holy_shock : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pal_holy_shock() : SpellScriptLoader("spell_pal_holy_shock") { }
|
||||
|
||||
class spell_pal_holy_shock_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_pal_holy_shock_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* spell)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_HOLY_SHOCK_R1))
|
||||
return false;
|
||||
|
||||
// can't use other spell than holy shock due to spell_ranks dependency
|
||||
if (sSpellMgr->GetFirstSpellInChain(SPELL_PALADIN_HOLY_SHOCK_R1) != sSpellMgr->GetFirstSpellInChain(spell->Id))
|
||||
return false;
|
||||
|
||||
uint8 rank = sSpellMgr->GetSpellRank(spell->Id);
|
||||
if (!sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1_DAMAGE, rank, true) || !sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1_HEALING, rank, true))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (Unit* unitTarget = GetHitUnit())
|
||||
{
|
||||
uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id);
|
||||
if (caster->IsFriendlyTo(unitTarget))
|
||||
caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1_HEALING, rank), true, 0);
|
||||
else
|
||||
caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1_DAMAGE, rank), true, 0);
|
||||
}
|
||||
}
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (Unit* target = GetExplTargetUnit())
|
||||
{
|
||||
if (!caster->IsFriendlyTo(target))
|
||||
{
|
||||
if (!caster->IsValidAttackTarget(target))
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
if (!caster->isInFront(target))
|
||||
return SPELL_FAILED_UNIT_NOT_INFRONT;
|
||||
}
|
||||
}
|
||||
else
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnCheckCast += SpellCheckCastFn(spell_pal_holy_shock_SpellScript::CheckCast);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_pal_holy_shock_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_pal_holy_shock_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 20425 - Judgement of Command
|
||||
class spell_pal_judgement_of_command : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pal_judgement_of_command() : SpellScriptLoader("spell_pal_judgement_of_command") { }
|
||||
|
||||
class spell_pal_judgement_of_command_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_pal_judgement_of_command_SpellScript);
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* unitTarget = GetHitUnit())
|
||||
if (SpellInfo const* spell_proto = sSpellMgr->GetSpellInfo(GetEffectValue()))
|
||||
GetCaster()->CastSpell(unitTarget, spell_proto, true, NULL);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_pal_judgement_of_command_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_pal_judgement_of_command_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
// -633 - Lay on Hands
|
||||
class spell_pal_lay_on_hands : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pal_lay_on_hands() : SpellScriptLoader("spell_pal_lay_on_hands") { }
|
||||
|
||||
class spell_pal_lay_on_hands_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_pal_lay_on_hands_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_FORBEARANCE))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_AVENGING_WRATH_MARKER))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_IMMUNE_SHIELD_MARKER))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (Unit* target = GetExplTargetUnit())
|
||||
if (caster == target)
|
||||
if (target->HasAura(SPELL_PALADIN_FORBEARANCE) || target->HasAura(SPELL_PALADIN_AVENGING_WRATH_MARKER) || target->HasAura(SPELL_PALADIN_IMMUNE_SHIELD_MARKER))
|
||||
return SPELL_FAILED_TARGET_AURASTATE;
|
||||
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
void HandleScript()
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (caster == GetHitUnit())
|
||||
{
|
||||
caster->CastSpell(caster, SPELL_PALADIN_FORBEARANCE, true);
|
||||
caster->CastSpell(caster, SPELL_PALADIN_AVENGING_WRATH_MARKER, true);
|
||||
caster->CastSpell(caster, SPELL_PALADIN_IMMUNE_SHIELD_MARKER, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnCheckCast += SpellCheckCastFn(spell_pal_lay_on_hands_SpellScript::CheckCast);
|
||||
AfterHit += SpellHitFn(spell_pal_lay_on_hands_SpellScript::HandleScript);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_pal_lay_on_hands_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 31789 - Righteous Defense
|
||||
class spell_pal_righteous_defense : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pal_righteous_defense() : SpellScriptLoader("spell_pal_righteous_defense") { }
|
||||
|
||||
class spell_pal_righteous_defense_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_pal_righteous_defense_SpellScript);
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return SPELL_FAILED_DONT_REPORT;
|
||||
|
||||
if (Unit* target = GetExplTargetUnit())
|
||||
{
|
||||
if (!target->IsFriendlyTo(caster) || target->getAttackers().empty())
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
}
|
||||
else
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnCheckCast += SpellCheckCastFn(spell_pal_righteous_defense_SpellScript::CheckCast);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_pal_righteous_defense_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_pal_sacred_shield : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -712,8 +729,6 @@ void AddSC_paladin_spell_scripts()
|
||||
new spell_pal_hand_of_sacrifice();
|
||||
new spell_pal_holy_shock();
|
||||
new spell_pal_judgement_of_command();
|
||||
new spell_pal_divine_storm();
|
||||
new spell_pal_divine_storm_dummy();
|
||||
new spell_pal_lay_on_hands();
|
||||
new spell_pal_righteous_defense();
|
||||
new spell_pal_sacred_shield();
|
||||
|
||||
@@ -1433,7 +1433,7 @@ public:
|
||||
if (pet->GetEntry() == ENTRY_ARMY_OF_THE_DEAD_GHOUL)
|
||||
amount = -90;
|
||||
// Night of the dead
|
||||
else if ( Aura * aur = owner->GetAuraOfRankedSpell(SPELL_NIGHT_OF_THE_DEAD))
|
||||
else if (Aura* aur = owner->GetAuraOfRankedSpell(SPELL_NIGHT_OF_THE_DEAD))
|
||||
amount = aur->GetSpellInfo()->Effects[EFFECT_2].CalcValue();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "Vehicle.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
@@ -1517,6 +1518,49 @@ class spell_q11010_q11102_q11023_q11008_check_fly_mount : public SpellScriptLoad
|
||||
}
|
||||
};
|
||||
|
||||
enum SpellZuldrakRat
|
||||
{
|
||||
SPELL_SUMMON_GORGED_LURKING_BASILISK = 50928
|
||||
};
|
||||
|
||||
class spell_q12527_zuldrak_rat : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_q12527_zuldrak_rat() : SpellScriptLoader("spell_q12527_zuldrak_rat") { }
|
||||
|
||||
class spell_q12527_zuldrak_rat_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_q12527_zuldrak_rat_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_GORGED_LURKING_BASILISK))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /* effIndex */)
|
||||
{
|
||||
if (GetHitAura() && GetHitAura()->GetStackAmount() >= GetSpellInfo()->StackAmount)
|
||||
{
|
||||
GetHitUnit()->CastSpell((Unit*) NULL, SPELL_SUMMON_GORGED_LURKING_BASILISK, true);
|
||||
if (Creature* basilisk = GetHitUnit()->ToCreature())
|
||||
basilisk->DespawnOrUnsummon();
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_q12527_zuldrak_rat_SpellScript::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_q12527_zuldrak_rat_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_quest_spell_scripts()
|
||||
{
|
||||
new spell_q55_sacred_cleansing();
|
||||
@@ -1554,4 +1598,5 @@ void AddSC_quest_spell_scripts()
|
||||
new spell_q11010_q11102_q11023_choose_loc();
|
||||
new spell_q11010_q11102_q11023_q11008_check_fly_mount();
|
||||
new spell_q12372_azure_on_death_force_whisper();
|
||||
new spell_q12527_zuldrak_rat();
|
||||
}
|
||||
@@ -30,285 +30,27 @@
|
||||
|
||||
enum ShamanSpells
|
||||
{
|
||||
SHAMAN_SPELL_FLAME_SHOCK = 8050,
|
||||
SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1 = 8349,
|
||||
SHAMAN_SPELL_SATED = 57724,
|
||||
SHAMAN_SPELL_EXHAUSTION = 57723,
|
||||
HUNTER_SPELL_INSANITY = 95809,
|
||||
MAGE_SPELL_TEMPORAL_DISPLACEMENT = 80354,
|
||||
|
||||
SHAMAN_SPELL_EARTH_GRASP = 51483,
|
||||
EARTHBIND_TOTEM_SPELL_EARTHGRAB = 64695,
|
||||
|
||||
// For Earthen Power
|
||||
SHAMAN_TOTEM_SPELL_EARTHBIND_TOTEM = 6474,
|
||||
SHAMAN_TOTEM_SPELL_EARTHEN_POWER = 59566,
|
||||
|
||||
SHAMAN_BIND_SIGHT = 6277,
|
||||
|
||||
ICON_ID_SHAMAN_LAVA_FLOW = 3087,
|
||||
SHAMAN_LAVA_FLOWS_R1 = 51480,
|
||||
SHAMAN_LAVA_FLOWS_TRIGGERED_R1 = 65264,
|
||||
SHAMAN_SPELL_ANCESTRAL_AWAKENING_PROC = 52752,
|
||||
|
||||
ICON_ID_SOOTHING_RAIN = 2011,
|
||||
SPELL_HEALING_STREAM_TOTEM_HEAL = 52042,
|
||||
SPELL_HUNTER_INSANITY = 95809,
|
||||
SPELL_MAGE_TEMPORAL_DISPLACEMENT = 80354,
|
||||
SPELL_SHAMAN_ANCESTRAL_AWAKENING_PROC = 52752,
|
||||
SPELL_SHAMAN_BIND_SIGHT = 6277,
|
||||
SPELL_SHAMAN_EXHAUSTION = 57723,
|
||||
SPELL_SHAMAN_FIRE_NOVA_TRIGGERED_R1 = 8349,
|
||||
SPELL_SHAMAN_FLAME_SHOCK = 8050,
|
||||
SPELL_SHAMAN_LAVA_FLOWS_R1 = 51480,
|
||||
SPELL_SHAMAN_LAVA_FLOWS_TRIGGERED_R1 = 65264,
|
||||
SPELL_SHAMAN_SATED = 57724,
|
||||
SPELL_SHAMAN_STORM_EARTH_AND_FIRE = 51483,
|
||||
SPELL_SHAMAN_TOTEM_EARTHBIND_EARTHGRAB = 64695,
|
||||
SPELL_SHAMAN_TOTEM_EARTHBIND_TOTEM = 6474,
|
||||
SPELL_SHAMAN_TOTEM_EARTHEN_POWER = 59566,
|
||||
SPELL_SHAMAN_TOTEM_HEALING_STREAM_HEAL = 52042
|
||||
};
|
||||
|
||||
// 1535 Fire Nova
|
||||
/// Updated 4.3.4
|
||||
class spell_sha_fire_nova : public SpellScriptLoader
|
||||
enum ShamanSpellIcons
|
||||
{
|
||||
public:
|
||||
spell_sha_fire_nova() : SpellScriptLoader("spell_sha_fire_nova") { }
|
||||
|
||||
class spell_sha_fire_nova_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_sha_fire_nova_SpellScript);
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
if (target->HasAura(SHAMAN_SPELL_FLAME_SHOCK))
|
||||
{
|
||||
caster->CastSpell(target, SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1, true);
|
||||
target->RemoveAurasDueToSpell(SHAMAN_SPELL_FLAME_SHOCK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_sha_fire_nova_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_sha_fire_nova_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 16191 Mana Tide
|
||||
/// Updated 4.3.4
|
||||
class spell_sha_mana_tide : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_sha_mana_tide() : SpellScriptLoader("spell_sha_mana_tide") { }
|
||||
|
||||
class spell_sha_mana_tide_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_sha_mana_tide_AuraScript);
|
||||
|
||||
void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
///@TODO: Exclude the "short term" buffs from the stat value
|
||||
if (Unit* caster = GetCaster())
|
||||
if (Unit* owner = caster->GetOwner())
|
||||
amount = CalculatePct(owner->GetStat(STAT_SPIRIT), aurEff->GetAmount());
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_sha_mana_tide_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_MOD_STAT);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_sha_mana_tide_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 6474 - Earthbind Totem - Fix Talent:Earthen Power, Earth's Grasp
|
||||
/// Updated 4.3.4
|
||||
class spell_sha_earthbind_totem : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_sha_earthbind_totem() : SpellScriptLoader("spell_sha_earthbind_totem") { }
|
||||
|
||||
class spell_sha_earthbind_totem_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_sha_earthbind_totem_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellEntry*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SHAMAN_TOTEM_SPELL_EARTHBIND_TOTEM) || !sSpellMgr->GetSpellInfo(SHAMAN_TOTEM_SPELL_EARTHEN_POWER))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
if (!GetCaster())
|
||||
return;
|
||||
if (Player* owner = GetCaster()->GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||
if (AuraEffect* aur = owner->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, 2289, 0))
|
||||
if (roll_chance_i(aur->GetBaseAmount()))
|
||||
GetTarget()->CastSpell((Unit*)NULL, SHAMAN_TOTEM_SPELL_EARTHEN_POWER, true);
|
||||
}
|
||||
|
||||
void Apply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (!GetCaster())
|
||||
return;
|
||||
Player* owner = GetCaster()->GetCharmerOrOwnerPlayerOrPlayerItself();
|
||||
if (!owner)
|
||||
return;
|
||||
// Earth's Grasp
|
||||
if (AuraEffect* aurEff = owner->GetAuraEffectOfRankedSpell(SHAMAN_SPELL_EARTH_GRASP, EFFECT_1))
|
||||
{
|
||||
if (roll_chance_i(aurEff->GetAmount()))
|
||||
GetCaster()->CastSpell(GetCaster(), EARTHBIND_TOTEM_SPELL_EARTHGRAB, false);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_sha_earthbind_totem_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
OnEffectApply += AuraEffectApplyFn(spell_sha_earthbind_totem_AuraScript::Apply, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_sha_earthbind_totem_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class EarthenPowerTargetSelector
|
||||
{
|
||||
public:
|
||||
EarthenPowerTargetSelector() { }
|
||||
|
||||
bool operator() (WorldObject* target)
|
||||
{
|
||||
if (!target->ToUnit())
|
||||
return true;
|
||||
|
||||
if (!target->ToUnit()->HasAuraWithMechanic(1 << MECHANIC_SNARE))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
class spell_sha_earthen_power : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_sha_earthen_power() : SpellScriptLoader("spell_sha_earthen_power") { }
|
||||
|
||||
class spell_sha_earthen_power_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_sha_earthen_power_SpellScript);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& unitList)
|
||||
{
|
||||
unitList.remove_if(EarthenPowerTargetSelector());
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_earthen_power_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_sha_earthen_power_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
/// Updated 4.3.4
|
||||
class spell_sha_bloodlust : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_sha_bloodlust() : SpellScriptLoader("spell_sha_bloodlust") { }
|
||||
|
||||
class spell_sha_bloodlust_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_sha_bloodlust_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellEntry*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_SATED))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void RemoveInvalidTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
targets.remove_if(Trinity::UnitAuraCheck(true, SHAMAN_SPELL_SATED));
|
||||
targets.remove_if(Trinity::UnitAuraCheck(true, HUNTER_SPELL_INSANITY));
|
||||
targets.remove_if(Trinity::UnitAuraCheck(true, MAGE_SPELL_TEMPORAL_DISPLACEMENT));
|
||||
}
|
||||
|
||||
void ApplyDebuff()
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->CastSpell(target, SHAMAN_SPELL_SATED, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID);
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_1, TARGET_UNIT_CASTER_AREA_RAID);
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_2, TARGET_UNIT_CASTER_AREA_RAID);
|
||||
AfterHit += SpellHitFn(spell_sha_bloodlust_SpellScript::ApplyDebuff);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_sha_bloodlust_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
/// Updated 4.3.4
|
||||
class spell_sha_heroism : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_sha_heroism() : SpellScriptLoader("spell_sha_heroism") { }
|
||||
|
||||
class spell_sha_heroism_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_sha_heroism_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellEntry*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_EXHAUSTION))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void RemoveInvalidTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
targets.remove_if(Trinity::UnitAuraCheck(true, SHAMAN_SPELL_EXHAUSTION));
|
||||
targets.remove_if(Trinity::UnitAuraCheck(true, HUNTER_SPELL_INSANITY));
|
||||
targets.remove_if(Trinity::UnitAuraCheck(true, MAGE_SPELL_TEMPORAL_DISPLACEMENT));
|
||||
}
|
||||
|
||||
void ApplyDebuff()
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->CastSpell(target, SHAMAN_SPELL_EXHAUSTION, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID);
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_1, TARGET_UNIT_CASTER_AREA_RAID);
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_2, TARGET_UNIT_CASTER_AREA_RAID);
|
||||
AfterHit += SpellHitFn(spell_sha_heroism_SpellScript::ApplyDebuff);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_sha_heroism_SpellScript();
|
||||
}
|
||||
SHAMAN_ICON_ID_SOOTHING_RAIN = 2011,
|
||||
SHAMAN_ICON_ID_SHAMAN_LAVA_FLOW = 3087
|
||||
};
|
||||
|
||||
/// Updated 4.3.4
|
||||
@@ -321,18 +63,18 @@ class spell_sha_ancestral_awakening_proc : public SpellScriptLoader
|
||||
{
|
||||
PrepareSpellScript(spell_sha_ancestral_awakening_proc_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*SpellEntry*/)
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_ANCESTRAL_AWAKENING_PROC))
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_ANCESTRAL_AWAKENING_PROC))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
int32 damage = GetEffectValue();
|
||||
if (GetCaster() && GetHitUnit())
|
||||
GetCaster()->CastCustomSpell(GetHitUnit(), SHAMAN_SPELL_ANCESTRAL_AWAKENING_PROC, &damage, NULL, NULL, true);
|
||||
GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_SHAMAN_ANCESTRAL_AWAKENING_PROC, &damage, NULL, NULL, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
@@ -348,95 +90,47 @@ class spell_sha_ancestral_awakening_proc : public SpellScriptLoader
|
||||
};
|
||||
|
||||
/// Updated 4.3.4
|
||||
class spell_sha_healing_stream_totem : public SpellScriptLoader
|
||||
class spell_sha_bloodlust : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_sha_healing_stream_totem() : SpellScriptLoader("spell_sha_healing_stream_totem") { }
|
||||
spell_sha_bloodlust() : SpellScriptLoader("spell_sha_bloodlust") { }
|
||||
|
||||
class spell_sha_healing_stream_totem_SpellScript : public SpellScript
|
||||
class spell_sha_bloodlust_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_sha_healing_stream_totem_SpellScript);
|
||||
PrepareSpellScript(spell_sha_bloodlust_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*SpellEntry*/)
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
return sSpellMgr->GetSpellInfo(SPELL_HEALING_STREAM_TOTEM_HEAL);
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_SATED))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
void RemoveInvalidTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
targets.remove_if(Trinity::UnitAuraCheck(true, SPELL_SHAMAN_SATED));
|
||||
targets.remove_if(Trinity::UnitAuraCheck(true, SPELL_HUNTER_INSANITY));
|
||||
targets.remove_if(Trinity::UnitAuraCheck(true, SPELL_MAGE_TEMPORAL_DISPLACEMENT));
|
||||
}
|
||||
|
||||
void ApplyDebuff()
|
||||
{
|
||||
int32 damage = GetEffectValue();
|
||||
SpellInfo const* triggeringSpell = GetTriggeringSpell();
|
||||
if (Unit* target = GetHitUnit())
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
if (Unit* owner = caster->GetOwner())
|
||||
{
|
||||
if (triggeringSpell)
|
||||
damage = int32(owner->SpellHealingBonusDone(target, triggeringSpell, damage, HEAL));
|
||||
|
||||
// Soothing Rains
|
||||
if (AuraEffect* dummy = owner->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, ICON_ID_SOOTHING_RAIN, EFFECT_0))
|
||||
AddPct(damage, dummy->GetAmount());
|
||||
|
||||
damage = int32(target->SpellHealingBonusTaken(owner, triggeringSpell, damage, HEAL));
|
||||
}
|
||||
caster->CastCustomSpell(target, SPELL_HEALING_STREAM_TOTEM_HEAL, &damage, 0, 0, true, 0, 0, GetOriginalCaster()->GetGUID());
|
||||
}
|
||||
target->CastSpell(target, SPELL_SHAMAN_SATED, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_sha_healing_stream_totem_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID);
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_1, TARGET_UNIT_CASTER_AREA_RAID);
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_2, TARGET_UNIT_CASTER_AREA_RAID);
|
||||
AfterHit += SpellHitFn(spell_sha_bloodlust_SpellScript::ApplyDebuff);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_sha_healing_stream_totem_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
/// Updated 4.3.4
|
||||
class spell_sha_lava_lash : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_sha_lava_lash() : SpellScriptLoader("spell_sha_lava_lash") { }
|
||||
|
||||
class spell_sha_lava_lash_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_sha_lava_lash_SpellScript)
|
||||
|
||||
bool Load()
|
||||
{
|
||||
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
{
|
||||
if (Player* caster = GetCaster()->ToPlayer())
|
||||
{
|
||||
int32 damage = GetEffectValue();
|
||||
int32 hitDamage = GetHitDamage();
|
||||
if (caster->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
|
||||
{
|
||||
// Damage is increased by 25% if your off-hand weapon is enchanted with Flametongue.
|
||||
if (caster->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, 0x200000, 0, 0))
|
||||
AddPct(hitDamage, damage);
|
||||
SetHitDamage(hitDamage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_sha_lava_lash_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_sha_lava_lash_SpellScript();
|
||||
return new spell_sha_bloodlust_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -497,6 +191,141 @@ class spell_sha_chain_heal : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 6474 - Earthbind Totem - Fix Talent:Earthen Power, Earth's Grasp
|
||||
/// Updated 4.3.4
|
||||
class spell_sha_earthbind_totem : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_sha_earthbind_totem() : SpellScriptLoader("spell_sha_earthbind_totem") { }
|
||||
|
||||
class spell_sha_earthbind_totem_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_sha_earthbind_totem_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_TOTEM_EARTHBIND_TOTEM) || !sSpellMgr->GetSpellInfo(SPELL_SHAMAN_TOTEM_EARTHEN_POWER))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
if (!GetCaster())
|
||||
return;
|
||||
if (Player* owner = GetCaster()->GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||
if (AuraEffect* aur = owner->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, 2289, 0))
|
||||
if (roll_chance_i(aur->GetBaseAmount()))
|
||||
GetTarget()->CastSpell((Unit*)NULL, SPELL_SHAMAN_TOTEM_EARTHEN_POWER, true);
|
||||
}
|
||||
|
||||
void Apply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (!GetCaster())
|
||||
return;
|
||||
Player* owner = GetCaster()->GetCharmerOrOwnerPlayerOrPlayerItself();
|
||||
if (!owner)
|
||||
return;
|
||||
// Earth's Grasp
|
||||
if (AuraEffect* aurEff = owner->GetAuraEffectOfRankedSpell(SPELL_SHAMAN_STORM_EARTH_AND_FIRE, EFFECT_1))
|
||||
{
|
||||
if (roll_chance_i(aurEff->GetAmount()))
|
||||
GetCaster()->CastSpell(GetCaster(), SPELL_SHAMAN_TOTEM_EARTHBIND_EARTHGRAB, false);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_sha_earthbind_totem_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
OnEffectApply += AuraEffectApplyFn(spell_sha_earthbind_totem_AuraScript::Apply, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_sha_earthbind_totem_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class EarthenPowerTargetSelector
|
||||
{
|
||||
public:
|
||||
EarthenPowerTargetSelector() { }
|
||||
|
||||
bool operator() (WorldObject* target)
|
||||
{
|
||||
if (!target->ToUnit())
|
||||
return true;
|
||||
|
||||
if (!target->ToUnit()->HasAuraWithMechanic(1 << MECHANIC_SNARE))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
class spell_sha_earthen_power : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_sha_earthen_power() : SpellScriptLoader("spell_sha_earthen_power") { }
|
||||
|
||||
class spell_sha_earthen_power_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_sha_earthen_power_SpellScript);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& unitList)
|
||||
{
|
||||
unitList.remove_if(EarthenPowerTargetSelector());
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_earthen_power_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_sha_earthen_power_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 1535 Fire Nova
|
||||
/// Updated 4.3.4
|
||||
class spell_sha_fire_nova : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_sha_fire_nova() : SpellScriptLoader("spell_sha_fire_nova") { }
|
||||
|
||||
class spell_sha_fire_nova_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_sha_fire_nova_SpellScript);
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
if (target->HasAura(SPELL_SHAMAN_FLAME_SHOCK))
|
||||
{
|
||||
caster->CastSpell(target, SPELL_SHAMAN_FIRE_NOVA_TRIGGERED_R1, true);
|
||||
target->RemoveAurasDueToSpell(SPELL_SHAMAN_FLAME_SHOCK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_sha_fire_nova_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_sha_fire_nova_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
/// Updated 4.3.4
|
||||
class spell_sha_flame_shock : public SpellScriptLoader
|
||||
{
|
||||
@@ -509,9 +338,9 @@ class spell_sha_flame_shock : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SHAMAN_LAVA_FLOWS_R1))
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_LAVA_FLOWS_R1))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SHAMAN_LAVA_FLOWS_TRIGGERED_R1))
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_LAVA_FLOWS_TRIGGERED_R1))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -521,13 +350,13 @@ class spell_sha_flame_shock : public SpellScriptLoader
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
// Lava Flows
|
||||
if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, ICON_ID_SHAMAN_LAVA_FLOW, EFFECT_0))
|
||||
if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, SHAMAN_ICON_ID_SHAMAN_LAVA_FLOW, EFFECT_0))
|
||||
{
|
||||
if (sSpellMgr->GetFirstSpellInChain(SHAMAN_LAVA_FLOWS_R1) != sSpellMgr->GetFirstSpellInChain(aurEff->GetId()))
|
||||
if (sSpellMgr->GetFirstSpellInChain(SPELL_SHAMAN_LAVA_FLOWS_R1) != sSpellMgr->GetFirstSpellInChain(aurEff->GetId()))
|
||||
return;
|
||||
|
||||
int32 basepoints = aurEff->GetAmount();
|
||||
caster->CastCustomSpell(caster, SHAMAN_LAVA_FLOWS_TRIGGERED_R1, &basepoints, NULL, NULL, true);
|
||||
caster->CastCustomSpell(caster, SPELL_SHAMAN_LAVA_FLOWS_TRIGGERED_R1, &basepoints, NULL, NULL, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -544,17 +373,186 @@ class spell_sha_flame_shock : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
/// Updated 4.3.4
|
||||
class spell_sha_healing_stream_totem : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_sha_healing_stream_totem() : SpellScriptLoader("spell_sha_healing_stream_totem") { }
|
||||
|
||||
class spell_sha_healing_stream_totem_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_sha_healing_stream_totem_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
return sSpellMgr->GetSpellInfo(SPELL_SHAMAN_TOTEM_HEALING_STREAM_HEAL);
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
{
|
||||
int32 damage = GetEffectValue();
|
||||
SpellInfo const* triggeringSpell = GetTriggeringSpell();
|
||||
if (Unit* target = GetHitUnit())
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
if (Unit* owner = caster->GetOwner())
|
||||
{
|
||||
if (triggeringSpell)
|
||||
damage = int32(owner->SpellHealingBonusDone(target, triggeringSpell, damage, HEAL));
|
||||
|
||||
// Soothing Rains
|
||||
if (AuraEffect* dummy = owner->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, SHAMAN_ICON_ID_SOOTHING_RAIN, EFFECT_0))
|
||||
AddPct(damage, dummy->GetAmount());
|
||||
|
||||
damage = int32(target->SpellHealingBonusTaken(owner, triggeringSpell, damage, HEAL));
|
||||
}
|
||||
caster->CastCustomSpell(target, SPELL_SHAMAN_TOTEM_HEALING_STREAM_HEAL, &damage, 0, 0, true, 0, 0, GetOriginalCaster()->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_sha_healing_stream_totem_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_sha_healing_stream_totem_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
/// Updated 4.3.4
|
||||
class spell_sha_heroism : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_sha_heroism() : SpellScriptLoader("spell_sha_heroism") { }
|
||||
|
||||
class spell_sha_heroism_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_sha_heroism_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_EXHAUSTION))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void RemoveInvalidTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
targets.remove_if(Trinity::UnitAuraCheck(true, SPELL_SHAMAN_EXHAUSTION));
|
||||
targets.remove_if(Trinity::UnitAuraCheck(true, SPELL_HUNTER_INSANITY));
|
||||
targets.remove_if(Trinity::UnitAuraCheck(true, SPELL_MAGE_TEMPORAL_DISPLACEMENT));
|
||||
}
|
||||
|
||||
void ApplyDebuff()
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->CastSpell(target, SPELL_SHAMAN_EXHAUSTION, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID);
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_1, TARGET_UNIT_CASTER_AREA_RAID);
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_2, TARGET_UNIT_CASTER_AREA_RAID);
|
||||
AfterHit += SpellHitFn(spell_sha_heroism_SpellScript::ApplyDebuff);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_sha_heroism_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
/// Updated 4.3.4
|
||||
class spell_sha_lava_lash : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_sha_lava_lash() : SpellScriptLoader("spell_sha_lava_lash") { }
|
||||
|
||||
class spell_sha_lava_lash_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_sha_lava_lash_SpellScript)
|
||||
|
||||
bool Load()
|
||||
{
|
||||
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Player* caster = GetCaster()->ToPlayer())
|
||||
{
|
||||
int32 damage = GetEffectValue();
|
||||
int32 hitDamage = GetHitDamage();
|
||||
if (caster->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
|
||||
{
|
||||
// Damage is increased by 25% if your off-hand weapon is enchanted with Flametongue.
|
||||
if (caster->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, 0x200000, 0, 0))
|
||||
AddPct(hitDamage, damage);
|
||||
SetHitDamage(hitDamage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_sha_lava_lash_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_sha_lava_lash_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 16191 Mana Tide
|
||||
/// Updated 4.3.4
|
||||
class spell_sha_mana_tide_totem : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_sha_mana_tide_totem() : SpellScriptLoader("spell_sha_mana_tide_totem") { }
|
||||
|
||||
class spell_sha_mana_tide_totem_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_sha_mana_tide_totem_AuraScript);
|
||||
|
||||
void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
///@TODO: Exclude the "short term" buffs from the stat value
|
||||
if (Unit* caster = GetCaster())
|
||||
if (Unit* owner = caster->GetOwner())
|
||||
amount = CalculatePct(owner->GetStat(STAT_SPIRIT), aurEff->GetAmount());
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_sha_mana_tide_totem_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_MOD_STAT);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_sha_mana_tide_totem_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_shaman_spell_scripts()
|
||||
{
|
||||
new spell_sha_fire_nova();
|
||||
new spell_sha_mana_tide();
|
||||
new spell_sha_ancestral_awakening_proc();
|
||||
new spell_sha_bloodlust();
|
||||
new spell_sha_chain_heal();
|
||||
new spell_sha_earthbind_totem();
|
||||
new spell_sha_earthen_power();
|
||||
new spell_sha_bloodlust();
|
||||
new spell_sha_heroism();
|
||||
new spell_sha_ancestral_awakening_proc();
|
||||
new spell_sha_healing_stream_totem();
|
||||
new spell_sha_lava_lash();
|
||||
new spell_sha_chain_heal();
|
||||
new spell_sha_fire_nova();
|
||||
new spell_sha_flame_shock();
|
||||
new spell_sha_healing_stream_totem();
|
||||
new spell_sha_heroism();
|
||||
new spell_sha_lava_lash();
|
||||
new spell_sha_mana_tide_totem();
|
||||
}
|
||||
@@ -28,145 +28,86 @@
|
||||
|
||||
enum WarlockSpells
|
||||
{
|
||||
WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS = 54435,
|
||||
WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER = 54443,
|
||||
WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD = 54508,
|
||||
WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER = 54509,
|
||||
WARLOCK_DEMONIC_EMPOWERMENT_IMP = 54444,
|
||||
WARLOCK_IMPROVED_HEALTHSTONE_R1 = 18692,
|
||||
WARLOCK_IMPROVED_HEALTHSTONE_R2 = 18693,
|
||||
WARLOCK_DEMONIC_CIRCLE_SUMMON = 48018,
|
||||
WARLOCK_DEMONIC_CIRCLE_TELEPORT = 48020,
|
||||
WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST = 62388,
|
||||
WARLOCK_HAUNT = 48181,
|
||||
WARLOCK_HAUNT_HEAL = 48210,
|
||||
WARLOCK_UNSTABLE_AFFLICTION_DISPEL = 31117,
|
||||
WARLOCK_BANE_OF_DOOM_EFFECT = 18662,
|
||||
WARLOCK_IMPROVED_HEALTH_FUNNEL_R1 = 18703,
|
||||
WARLOCK_IMPROVED_HEALTH_FUNNEL_R2 = 18704,
|
||||
WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1 = 60955,
|
||||
WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2 = 60956,
|
||||
WARLOCK_SOULSHATTER = 32835,
|
||||
WARLOCK_LIFE_TAP_ENERGIZE = 31818,
|
||||
WARLOCK_LIFE_TAP_ENERGIZE_2 = 32553,
|
||||
WARLOCK_IMPROVED_LIFE_TAP_ICON_ID = 208,
|
||||
WARLOCK_MANA_FEED_ICON_ID = 1982,
|
||||
SPELL_WARLOCK_BANE_OF_DOOM_EFFECT = 18662,
|
||||
SPELL_WARLOCK_DEMONIC_CIRCLE_SUMMON = 48018,
|
||||
SPELL_WARLOCK_DEMONIC_CIRCLE_TELEPORT = 48020,
|
||||
SPELL_WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST = 62388,
|
||||
SPELL_WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS = 54435,
|
||||
SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER = 54443,
|
||||
SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD = 54508,
|
||||
SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER = 54509,
|
||||
SPELL_WARLOCK_DEMONIC_EMPOWERMENT_IMP = 54444,
|
||||
SPELL_WARLOCK_IMPROVED_HEALTHSTONE_R1 = 18692,
|
||||
SPELL_WARLOCK_IMPROVED_HEALTHSTONE_R2 = 18693,
|
||||
SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_R1 = 18703,
|
||||
SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_R2 = 18704,
|
||||
SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1 = 60955,
|
||||
SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2 = 60956,
|
||||
SPELL_WARLOCK_HAUNT = 48181,
|
||||
SPELL_WARLOCK_HAUNT_HEAL = 48210,
|
||||
SPELL_WARLOCK_LIFE_TAP_ENERGIZE = 31818,
|
||||
SPELL_WARLOCK_LIFE_TAP_ENERGIZE_2 = 32553,
|
||||
SPELL_WARLOCK_SOULSHATTER = 32835,
|
||||
SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL = 31117
|
||||
};
|
||||
|
||||
enum WarlockSpellIcons
|
||||
{
|
||||
WARLOCK_ICON_ID_IMPROVED_LIFE_TAP = 208,
|
||||
WARLOCK_ICON_ID_MANA_FEED = 1982
|
||||
};
|
||||
|
||||
/// Updated 4.3.4
|
||||
class spell_warl_banish : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warl_banish() : SpellScriptLoader("spell_warl_banish") { }
|
||||
|
||||
class spell_warl_banish_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_warl_banish_SpellScript);
|
||||
|
||||
bool Load()
|
||||
{
|
||||
_removed = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleBanish()
|
||||
{
|
||||
/// Casting Banish on a banished target will cancel the effect
|
||||
/// Check if the target already has Banish, if so, do nothing.
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
if (target->GetAuraEffect(SPELL_AURA_SCHOOL_IMMUNITY, SPELLFAMILY_WARLOCK, 0, 0x08000000, 0))
|
||||
{
|
||||
// No need to remove old aura since its removed due to not stack by current Banish aura
|
||||
PreventHitDefaultEffect(EFFECT_0);
|
||||
PreventHitDefaultEffect(EFFECT_1);
|
||||
PreventHitDefaultEffect(EFFECT_2);
|
||||
_removed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RemoveAura()
|
||||
{
|
||||
if (_removed)
|
||||
PreventHitAura();
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
BeforeHit += SpellHitFn(spell_warl_banish_SpellScript::HandleBanish);
|
||||
AfterHit += SpellHitFn(spell_warl_banish_SpellScript::RemoveAura);
|
||||
}
|
||||
|
||||
bool _removed;
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_warl_banish_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 47193 Demonic Empowerment
|
||||
/// Updated 4.3.4
|
||||
class spell_warl_demonic_empowerment : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warl_demonic_empowerment() : SpellScriptLoader("spell_warl_demonic_empowerment") { }
|
||||
spell_warl_banish() : SpellScriptLoader("spell_warl_banish") { }
|
||||
|
||||
class spell_warl_demonic_empowerment_SpellScript : public SpellScript
|
||||
class spell_warl_banish_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_warl_demonic_empowerment_SpellScript);
|
||||
PrepareSpellScript(spell_warl_banish_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellEntry*/)
|
||||
bool Load()
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS) || !sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER) || !sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD) || !sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER) || !sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_IMP))
|
||||
return false;
|
||||
_removed = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
void HandleBanish()
|
||||
{
|
||||
if (Creature* targetCreature = GetHitCreature())
|
||||
/// Casting Banish on a banished target will cancel the effect
|
||||
/// Check if the target already has Banish, if so, do nothing.
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
if (targetCreature->isPet())
|
||||
if (target->GetAuraEffect(SPELL_AURA_SCHOOL_IMMUNITY, SPELLFAMILY_WARLOCK, 0, 0x08000000, 0))
|
||||
{
|
||||
CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(targetCreature->GetEntry());
|
||||
switch (ci->family)
|
||||
{
|
||||
case CREATURE_FAMILY_SUCCUBUS:
|
||||
targetCreature->CastSpell(targetCreature, WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS, true);
|
||||
break;
|
||||
case CREATURE_FAMILY_VOIDWALKER:
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER);
|
||||
int32 hp = int32(targetCreature->CountPctFromMaxHealth(GetCaster()->CalculateSpellDamage(targetCreature, spellInfo, 0)));
|
||||
targetCreature->CastCustomSpell(targetCreature, WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER, &hp, NULL, NULL, true);
|
||||
break;
|
||||
}
|
||||
case CREATURE_FAMILY_FELGUARD:
|
||||
targetCreature->CastSpell(targetCreature, WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD, true);
|
||||
break;
|
||||
case CREATURE_FAMILY_FELHUNTER:
|
||||
targetCreature->CastSpell(targetCreature, WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER, true);
|
||||
break;
|
||||
case CREATURE_FAMILY_IMP:
|
||||
targetCreature->CastSpell(targetCreature, WARLOCK_DEMONIC_EMPOWERMENT_IMP, true);
|
||||
break;
|
||||
}
|
||||
// No need to remove old aura since its removed due to not stack by current Banish aura
|
||||
PreventHitDefaultEffect(EFFECT_0);
|
||||
PreventHitDefaultEffect(EFFECT_1);
|
||||
PreventHitDefaultEffect(EFFECT_2);
|
||||
_removed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RemoveAura()
|
||||
{
|
||||
if (_removed)
|
||||
PreventHitAura();
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_warl_demonic_empowerment_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
BeforeHit += SpellHitFn(spell_warl_banish_SpellScript::HandleBanish);
|
||||
AfterHit += SpellHitFn(spell_warl_banish_SpellScript::RemoveAura);
|
||||
}
|
||||
|
||||
bool _removed;
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_warl_demonic_empowerment_SpellScript();
|
||||
return new spell_warl_banish_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -182,9 +123,9 @@ class spell_warl_create_healthstone : public SpellScriptLoader
|
||||
|
||||
static uint32 const iTypes[8][3];
|
||||
|
||||
bool Validate(SpellInfo const* /*spellEntry*/)
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(WARLOCK_IMPROVED_HEALTHSTONE_R1) || !sSpellMgr->GetSpellInfo(WARLOCK_IMPROVED_HEALTHSTONE_R2))
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_IMPROVED_HEALTHSTONE_R1) || !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_IMPROVED_HEALTHSTONE_R2))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -212,8 +153,12 @@ class spell_warl_create_healthstone : public SpellScriptLoader
|
||||
{
|
||||
switch (aurEff->GetId())
|
||||
{
|
||||
case WARLOCK_IMPROVED_HEALTHSTONE_R1: rank = 1; break;
|
||||
case WARLOCK_IMPROVED_HEALTHSTONE_R2: rank = 2; break;
|
||||
case SPELL_WARLOCK_IMPROVED_HEALTHSTONE_R1:
|
||||
rank = 1;
|
||||
break;
|
||||
case SPELL_WARLOCK_IMPROVED_HEALTHSTONE_R2:
|
||||
rank = 2;
|
||||
break;
|
||||
default:
|
||||
sLog->outError(LOG_FILTER_SPELLS_AURAS, "Unknown rank of Improved Healthstone id: %d", aurEff->GetId());
|
||||
break;
|
||||
@@ -249,6 +194,205 @@ uint32 const spell_warl_create_healthstone::spell_warl_create_healthstone_SpellS
|
||||
{36892, 36893, 36894} // Fel Healthstone
|
||||
};
|
||||
|
||||
// 603 Bane of Doom
|
||||
/// Updated 4.3.4
|
||||
class spell_warl_bane_of_doom : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warl_bane_of_doom() : SpellScriptLoader("spell_warl_bane_of_doom") { }
|
||||
|
||||
class spell_warl_curse_of_doom_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_warl_curse_of_doom_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_BANE_OF_DOOM_EFFECT))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Load()
|
||||
{
|
||||
return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER;
|
||||
}
|
||||
|
||||
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (!GetCaster())
|
||||
return;
|
||||
|
||||
AuraRemoveMode removeMode = GetTargetApplication()->GetRemoveMode();
|
||||
if (removeMode != AURA_REMOVE_BY_DEATH || !IsExpired())
|
||||
return;
|
||||
|
||||
if (GetCaster()->ToPlayer()->isHonorOrXPTarget(GetTarget()))
|
||||
GetCaster()->CastSpell(GetTarget(), SPELL_WARLOCK_BANE_OF_DOOM_EFFECT, true, NULL, aurEff);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_warl_curse_of_doom_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_warl_curse_of_doom_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 48018 Demonic Circle: Summon
|
||||
/// Updated 4.3.4
|
||||
class spell_warl_demonic_circle_summon : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warl_demonic_circle_summon() : SpellScriptLoader("spell_warl_demonic_circle_summon") { }
|
||||
|
||||
class spell_warl_demonic_circle_summon_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_warl_demonic_circle_summon_AuraScript);
|
||||
|
||||
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes mode)
|
||||
{
|
||||
// If effect is removed by expire remove the summoned demonic circle too.
|
||||
if (!(mode & AURA_EFFECT_HANDLE_REAPPLY))
|
||||
GetTarget()->RemoveGameObject(GetId(), true);
|
||||
|
||||
GetTarget()->RemoveAura(SPELL_WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST);
|
||||
}
|
||||
|
||||
void HandleDummyTick(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
if (GameObject* circle = GetTarget()->GetGameObject(GetId()))
|
||||
{
|
||||
// Here we check if player is in demonic circle teleport range, if so add
|
||||
// WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST; allowing him to cast the WARLOCK_DEMONIC_CIRCLE_TELEPORT.
|
||||
// If not in range remove the WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST.
|
||||
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMONIC_CIRCLE_TELEPORT);
|
||||
|
||||
if (GetTarget()->IsWithinDist(circle, spellInfo->GetMaxRange(true)))
|
||||
{
|
||||
if (!GetTarget()->HasAura(SPELL_WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST))
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST, true);
|
||||
}
|
||||
else
|
||||
GetTarget()->RemoveAura(SPELL_WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectRemove += AuraEffectApplyFn(spell_warl_demonic_circle_summon_AuraScript::HandleRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_warl_demonic_circle_summon_AuraScript::HandleDummyTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_warl_demonic_circle_summon_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 48020 Demonic Circle: Teleport
|
||||
/// Updated 4.3.4
|
||||
class spell_warl_demonic_circle_teleport : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warl_demonic_circle_teleport() : SpellScriptLoader("spell_warl_demonic_circle_teleport") { }
|
||||
|
||||
class spell_warl_demonic_circle_teleport_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_warl_demonic_circle_teleport_AuraScript);
|
||||
|
||||
void HandleTeleport(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Player* player = GetTarget()->ToPlayer())
|
||||
{
|
||||
if (GameObject* circle = player->GetGameObject(SPELL_WARLOCK_DEMONIC_CIRCLE_SUMMON))
|
||||
{
|
||||
player->NearTeleportTo(circle->GetPositionX(), circle->GetPositionY(), circle->GetPositionZ(), circle->GetOrientation());
|
||||
player->RemoveMovementImpairingAuras();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_warl_demonic_circle_teleport_AuraScript::HandleTeleport, EFFECT_0, SPELL_AURA_MECHANIC_IMMUNITY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_warl_demonic_circle_teleport_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 47193 Demonic Empowerment
|
||||
/// Updated 4.3.4
|
||||
class spell_warl_demonic_empowerment : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warl_demonic_empowerment() : SpellScriptLoader("spell_warl_demonic_empowerment") { }
|
||||
|
||||
class spell_warl_demonic_empowerment_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_warl_demonic_empowerment_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS) || !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER) || !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD) || !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER) || !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMONIC_EMPOWERMENT_IMP))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Creature* targetCreature = GetHitCreature())
|
||||
{
|
||||
if (targetCreature->isPet())
|
||||
{
|
||||
CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(targetCreature->GetEntry());
|
||||
switch (ci->family)
|
||||
{
|
||||
case CREATURE_FAMILY_SUCCUBUS:
|
||||
targetCreature->CastSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS, true);
|
||||
break;
|
||||
case CREATURE_FAMILY_VOIDWALKER:
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER);
|
||||
int32 hp = int32(targetCreature->CountPctFromMaxHealth(GetCaster()->CalculateSpellDamage(targetCreature, spellInfo, 0)));
|
||||
targetCreature->CastCustomSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER, &hp, NULL, NULL, true);
|
||||
break;
|
||||
}
|
||||
case CREATURE_FAMILY_FELGUARD:
|
||||
targetCreature->CastSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD, true);
|
||||
break;
|
||||
case CREATURE_FAMILY_FELHUNTER:
|
||||
targetCreature->CastSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER, true);
|
||||
break;
|
||||
case CREATURE_FAMILY_IMP:
|
||||
targetCreature->CastSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_IMP, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_warl_demonic_empowerment_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_warl_demonic_empowerment_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 47422 Everlasting Affliction
|
||||
/// Updated 4.3.4
|
||||
class spell_warl_everlasting_affliction : public SpellScriptLoader
|
||||
@@ -280,6 +424,181 @@ class spell_warl_everlasting_affliction : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 48181 Haunt
|
||||
/// Updated 4.3.4
|
||||
class spell_warl_haunt : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warl_haunt() : SpellScriptLoader("spell_warl_haunt") { }
|
||||
|
||||
class spell_warl_haunt_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_warl_haunt_SpellScript);
|
||||
|
||||
void HandleOnHit()
|
||||
{
|
||||
if (Aura* aura = GetHitAura())
|
||||
if (AuraEffect* aurEff = aura->GetEffect(EFFECT_1))
|
||||
aurEff->SetAmount(CalculatePct(aurEff->GetAmount(), GetHitDamage()));
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnHit += SpellHitFn(spell_warl_haunt_SpellScript::HandleOnHit);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_warl_haunt_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_warl_haunt_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_HAUNT_HEAL))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
int32 amount = aurEff->GetAmount();
|
||||
GetTarget()->CastCustomSpell(caster, SPELL_WARLOCK_HAUNT_HEAL, &amount, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectRemove += AuraEffectApplyFn(spell_warl_haunt_AuraScript::HandleRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_warl_haunt_SpellScript();
|
||||
}
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_warl_haunt_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 755 Health Funnel
|
||||
/// Updated 4.3.4
|
||||
class spell_warl_health_funnel : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warl_health_funnel() : SpellScriptLoader("spell_warl_health_funnel") { }
|
||||
|
||||
class spell_warl_health_funnel_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_warl_health_funnel_AuraScript);
|
||||
|
||||
void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
Unit* target = GetTarget();
|
||||
if (caster->HasAura(SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_R2))
|
||||
target->CastSpell(target, SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2, true);
|
||||
else if (caster->HasAura(SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_R1))
|
||||
target->CastSpell(target, SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1, true);
|
||||
}
|
||||
|
||||
void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
target->RemoveAurasDueToSpell(SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1);
|
||||
target->RemoveAurasDueToSpell(SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_warl_health_funnel_AuraScript::RemoveEffect, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectApply += AuraEffectApplyFn(spell_warl_health_funnel_AuraScript::ApplyEffect, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_warl_health_funnel_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 1454 Life Tap
|
||||
/// Updated 4.3.4
|
||||
class spell_warl_life_tap : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warl_life_tap() : SpellScriptLoader("spell_warl_life_tap") { }
|
||||
|
||||
class spell_warl_life_tap_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_warl_life_tap_SpellScript);
|
||||
|
||||
bool Load()
|
||||
{
|
||||
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
|
||||
}
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_LIFE_TAP_ENERGIZE) || !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_LIFE_TAP_ENERGIZE_2))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Player* caster = GetCaster()->ToPlayer();
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
int32 damage = caster->CountPctFromMaxHealth(GetSpellInfo()->Effects[EFFECT_2].CalcValue());
|
||||
int32 mana = CalculatePct(damage, GetSpellInfo()->Effects[EFFECT_1].CalcValue());
|
||||
|
||||
// Shouldn't Appear in Combat Log
|
||||
target->ModifyHealth(-damage);
|
||||
|
||||
// Improved Life Tap mod
|
||||
if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, WARLOCK_ICON_ID_IMPROVED_LIFE_TAP, 0))
|
||||
AddPct(mana, aurEff->GetAmount());
|
||||
|
||||
caster->CastCustomSpell(target, SPELL_WARLOCK_LIFE_TAP_ENERGIZE, &mana, NULL, NULL, false);
|
||||
|
||||
// Mana Feed
|
||||
if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_AURA_ADD_FLAT_MODIFIER, SPELLFAMILY_WARLOCK, WARLOCK_ICON_ID_MANA_FEED, 0))
|
||||
{
|
||||
int32 manaFeedVal = aurEff->GetAmount();
|
||||
ApplyPct(manaFeedVal, mana);
|
||||
caster->CastCustomSpell(caster, SPELL_WARLOCK_LIFE_TAP_ENERGIZE_2, &manaFeedVal, NULL, NULL, true, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
if (int32(GetCaster()->GetHealth()) > int32(GetCaster()->CountPctFromMaxHealth(GetSpellInfo()->Effects[EFFECT_2].CalcValue())))
|
||||
return SPELL_CAST_OK;
|
||||
return SPELL_FAILED_FIZZLE;
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_warl_life_tap_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
OnCheckCast += SpellCheckCastFn(spell_warl_life_tap_SpellScript::CheckCast);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_warl_life_tap_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 27285 Seed of Corruption
|
||||
/// Updated 4.3.4
|
||||
class spell_warl_seed_of_corruption : public SpellScriptLoader
|
||||
@@ -322,7 +641,7 @@ class spell_warl_soulshatter : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(WARLOCK_SOULSHATTER))
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_SOULSHATTER))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -332,7 +651,7 @@ class spell_warl_soulshatter : public SpellScriptLoader
|
||||
Unit* caster = GetCaster();
|
||||
if (Unit* target = GetHitUnit())
|
||||
if (target->CanHaveThreatList() && target->getThreatManager().getThreat(caster) > 0.0f)
|
||||
caster->CastSpell(target, WARLOCK_SOULSHATTER, true);
|
||||
caster->CastSpell(target, SPELL_WARLOCK_SOULSHATTER, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
@@ -347,225 +666,6 @@ class spell_warl_soulshatter : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 1454 Life Tap
|
||||
/// Updated 4.3.4
|
||||
class spell_warl_life_tap : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warl_life_tap() : SpellScriptLoader("spell_warl_life_tap") { }
|
||||
|
||||
class spell_warl_life_tap_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_warl_life_tap_SpellScript);
|
||||
|
||||
bool Load()
|
||||
{
|
||||
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
|
||||
}
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(WARLOCK_LIFE_TAP_ENERGIZE) || !sSpellMgr->GetSpellInfo(WARLOCK_LIFE_TAP_ENERGIZE_2))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Player* caster = GetCaster()->ToPlayer();
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
int32 damage = caster->CountPctFromMaxHealth(GetSpellInfo()->Effects[EFFECT_2].CalcValue());
|
||||
int32 mana = CalculatePct(damage, GetSpellInfo()->Effects[EFFECT_1].CalcValue());
|
||||
|
||||
// Shouldn't Appear in Combat Log
|
||||
target->ModifyHealth(-damage);
|
||||
|
||||
// Improved Life Tap mod
|
||||
if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, WARLOCK_IMPROVED_LIFE_TAP_ICON_ID, 0))
|
||||
AddPct(mana, aurEff->GetAmount());
|
||||
|
||||
caster->CastCustomSpell(target, WARLOCK_LIFE_TAP_ENERGIZE, &mana, NULL, NULL, false);
|
||||
|
||||
// Mana Feed
|
||||
if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_AURA_ADD_FLAT_MODIFIER, SPELLFAMILY_WARLOCK, WARLOCK_MANA_FEED_ICON_ID, 0))
|
||||
{
|
||||
int32 manaFeedVal = aurEff->GetAmount();
|
||||
ApplyPct(manaFeedVal, mana);
|
||||
caster->CastCustomSpell(caster, WARLOCK_LIFE_TAP_ENERGIZE_2, &manaFeedVal, NULL, NULL, true, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
if (int32(GetCaster()->GetHealth()) > int32(GetCaster()->CountPctFromMaxHealth(GetSpellInfo()->Effects[EFFECT_2].CalcValue())))
|
||||
return SPELL_CAST_OK;
|
||||
return SPELL_FAILED_FIZZLE;
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_warl_life_tap_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
OnCheckCast += SpellCheckCastFn(spell_warl_life_tap_SpellScript::CheckCast);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_warl_life_tap_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 48018 Demonic Circle: Summon
|
||||
/// Updated 4.3.4
|
||||
class spell_warl_demonic_circle_summon : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warl_demonic_circle_summon() : SpellScriptLoader("spell_warl_demonic_circle_summon") { }
|
||||
|
||||
class spell_warl_demonic_circle_summon_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_warl_demonic_circle_summon_AuraScript);
|
||||
|
||||
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes mode)
|
||||
{
|
||||
// If effect is removed by expire remove the summoned demonic circle too.
|
||||
if (!(mode & AURA_EFFECT_HANDLE_REAPPLY))
|
||||
GetTarget()->RemoveGameObject(GetId(), true);
|
||||
|
||||
GetTarget()->RemoveAura(WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST);
|
||||
}
|
||||
|
||||
void HandleDummyTick(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
if (GameObject* circle = GetTarget()->GetGameObject(GetId()))
|
||||
{
|
||||
// Here we check if player is in demonic circle teleport range, if so add
|
||||
// WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST; allowing him to cast the WARLOCK_DEMONIC_CIRCLE_TELEPORT.
|
||||
// If not in range remove the WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST.
|
||||
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_CIRCLE_TELEPORT);
|
||||
|
||||
if (GetTarget()->IsWithinDist(circle, spellInfo->GetMaxRange(true)))
|
||||
{
|
||||
if (!GetTarget()->HasAura(WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST))
|
||||
GetTarget()->CastSpell(GetTarget(), WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST, true);
|
||||
}
|
||||
else
|
||||
GetTarget()->RemoveAura(WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectRemove += AuraEffectApplyFn(spell_warl_demonic_circle_summon_AuraScript::HandleRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_warl_demonic_circle_summon_AuraScript::HandleDummyTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_warl_demonic_circle_summon_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 48020 Demonic Circle: Teleport
|
||||
/// Updated 4.3.4
|
||||
class spell_warl_demonic_circle_teleport : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warl_demonic_circle_teleport() : SpellScriptLoader("spell_warl_demonic_circle_teleport") { }
|
||||
|
||||
class spell_warl_demonic_circle_teleport_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_warl_demonic_circle_teleport_AuraScript);
|
||||
|
||||
void HandleTeleport(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Player* player = GetTarget()->ToPlayer())
|
||||
{
|
||||
if (GameObject* circle = player->GetGameObject(WARLOCK_DEMONIC_CIRCLE_SUMMON))
|
||||
{
|
||||
player->NearTeleportTo(circle->GetPositionX(), circle->GetPositionY(), circle->GetPositionZ(), circle->GetOrientation());
|
||||
player->RemoveMovementImpairingAuras();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_warl_demonic_circle_teleport_AuraScript::HandleTeleport, EFFECT_0, SPELL_AURA_MECHANIC_IMMUNITY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_warl_demonic_circle_teleport_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 48181 Haunt
|
||||
/// Updated 4.3.4
|
||||
class spell_warl_haunt : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warl_haunt() : SpellScriptLoader("spell_warl_haunt") { }
|
||||
|
||||
class spell_warl_haunt_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_warl_haunt_SpellScript);
|
||||
|
||||
void HandleOnHit()
|
||||
{
|
||||
if (Aura* aura = GetHitAura())
|
||||
if (AuraEffect* aurEff = aura->GetEffect(EFFECT_1))
|
||||
aurEff->SetAmount(CalculatePct(aurEff->GetAmount(), GetHitDamage()));
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnHit += SpellHitFn(spell_warl_haunt_SpellScript::HandleOnHit);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_warl_haunt_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_warl_haunt_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(WARLOCK_HAUNT_HEAL))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
int32 amount = aurEff->GetAmount();
|
||||
GetTarget()->CastCustomSpell(caster, WARLOCK_HAUNT_HEAL, &amount, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectRemove += AuraEffectApplyFn(spell_warl_haunt_AuraScript::HandleRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_warl_haunt_SpellScript();
|
||||
}
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_warl_haunt_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
/// Updated 4.3.4
|
||||
class spell_warl_unstable_affliction : public SpellScriptLoader
|
||||
{
|
||||
@@ -578,7 +678,7 @@ class spell_warl_unstable_affliction : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(WARLOCK_UNSTABLE_AFFLICTION_DISPEL))
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -590,7 +690,7 @@ class spell_warl_unstable_affliction : public SpellScriptLoader
|
||||
{
|
||||
int32 damage = aurEff->GetAmount() * 9;
|
||||
// backfire damage and silence
|
||||
caster->CastCustomSpell(dispelInfo->GetDispeller(), WARLOCK_UNSTABLE_AFFLICTION_DISPEL, &damage, NULL, NULL, true, NULL, aurEff);
|
||||
caster->CastCustomSpell(dispelInfo->GetDispeller(), SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL, &damage, NULL, NULL, true, NULL, aurEff);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -606,111 +706,19 @@ class spell_warl_unstable_affliction : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 603 Bane of Doom
|
||||
/// Updated 4.3.4
|
||||
class spell_warl_bane_of_doom : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warl_bane_of_doom() : SpellScriptLoader("spell_warl_bane_of_doom") { }
|
||||
|
||||
class spell_warl_curse_of_doom_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_warl_curse_of_doom_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(WARLOCK_BANE_OF_DOOM_EFFECT))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Load()
|
||||
{
|
||||
return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER;
|
||||
}
|
||||
|
||||
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (!GetCaster())
|
||||
return;
|
||||
|
||||
AuraRemoveMode removeMode = GetTargetApplication()->GetRemoveMode();
|
||||
if (removeMode != AURA_REMOVE_BY_DEATH || !IsExpired())
|
||||
return;
|
||||
|
||||
if (GetCaster()->ToPlayer()->isHonorOrXPTarget(GetTarget()))
|
||||
GetCaster()->CastSpell(GetTarget(), WARLOCK_BANE_OF_DOOM_EFFECT, true, NULL, aurEff);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_warl_curse_of_doom_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_warl_curse_of_doom_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 755 Health Funnel
|
||||
/// Updated 4.3.4
|
||||
class spell_warl_health_funnel : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warl_health_funnel() : SpellScriptLoader("spell_warl_health_funnel") { }
|
||||
|
||||
class spell_warl_health_funnel_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_warl_health_funnel_AuraScript);
|
||||
|
||||
void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
Unit* target = GetTarget();
|
||||
if (caster->HasAura(WARLOCK_IMPROVED_HEALTH_FUNNEL_R2))
|
||||
target->CastSpell(target, WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2, true);
|
||||
else if (caster->HasAura(WARLOCK_IMPROVED_HEALTH_FUNNEL_R1))
|
||||
target->CastSpell(target, WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1, true);
|
||||
}
|
||||
|
||||
void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
target->RemoveAurasDueToSpell(WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1);
|
||||
target->RemoveAurasDueToSpell(WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_warl_health_funnel_AuraScript::RemoveEffect, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectApply += AuraEffectApplyFn(spell_warl_health_funnel_AuraScript::ApplyEffect, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_warl_health_funnel_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_warlock_spell_scripts()
|
||||
{
|
||||
new spell_warl_bane_of_doom();
|
||||
new spell_warl_banish();
|
||||
new spell_warl_demonic_empowerment();
|
||||
new spell_warl_create_healthstone();
|
||||
new spell_warl_everlasting_affliction();
|
||||
new spell_warl_seed_of_corruption();
|
||||
new spell_warl_soulshatter();
|
||||
new spell_warl_life_tap();
|
||||
new spell_warl_demonic_circle_summon();
|
||||
new spell_warl_demonic_circle_teleport();
|
||||
new spell_warl_demonic_empowerment();
|
||||
new spell_warl_everlasting_affliction();
|
||||
new spell_warl_haunt();
|
||||
new spell_warl_unstable_affliction();
|
||||
new spell_warl_bane_of_doom();
|
||||
new spell_warl_health_funnel();
|
||||
new spell_warl_life_tap();
|
||||
new spell_warl_seed_of_corruption();
|
||||
new spell_warl_soulshatter();
|
||||
new spell_warl_unstable_affliction();
|
||||
}
|
||||
@@ -28,111 +28,91 @@
|
||||
|
||||
enum WarriorSpells
|
||||
{
|
||||
SPELL_LAST_STAND_TRIGGERED = 12976,
|
||||
SPELL_DEEP_WOUNDS_RANK_1 = 12162,
|
||||
SPELL_DEEP_WOUNDS_RANK_2 = 12850,
|
||||
SPELL_DEEP_WOUNDS_RANK_3 = 12868,
|
||||
SPELL_DEEP_WOUNDS_RANK_PERIODIC = 12721,
|
||||
SPELL_JUGGERNAUT_CRIT_BONUS_TALENT = 64976,
|
||||
SPELL_JUGGERNAUT_CRIT_BONUS_BUFF = 65156,
|
||||
SPELL_CHARGE = 34846,
|
||||
SPELL_SLAM = 50782,
|
||||
ICON_ID_SUDDEN_DEATH = 1989,
|
||||
SPELL_BLOODTHIRST_DAMAGE = 23881,
|
||||
SPELL_BLOODTHIRST = 23885,
|
||||
SPELL_WARRIOR_BLOODTHIRST = 23885,
|
||||
SPELL_WARRIOR_BLOODTHIRST_DAMAGE = 23881,
|
||||
SPELL_WARRIOR_CHARGE = 34846,
|
||||
SPELL_WARRIOR_DEEP_WOUNDS_RANK_1 = 12162,
|
||||
SPELL_WARRIOR_DEEP_WOUNDS_RANK_2 = 12850,
|
||||
SPELL_WARRIOR_DEEP_WOUNDS_RANK_3 = 12868,
|
||||
SPELL_WARRIOR_DEEP_WOUNDS_RANK_PERIODIC = 12721,
|
||||
SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_BUFF = 65156,
|
||||
SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_TALENT = 64976,
|
||||
SPELL_WARRIOR_LAST_STAND_TRIGGERED = 12976,
|
||||
SPELL_WARRIOR_SLAM = 50782
|
||||
};
|
||||
|
||||
enum WarriorSpellIcons
|
||||
{
|
||||
WARRIOR_ICON_ID_SUDDEN_DEATH = 1989,
|
||||
};
|
||||
|
||||
/// Updated 4.3.4
|
||||
class spell_warr_last_stand : public SpellScriptLoader
|
||||
class spell_warr_bloodthirst : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warr_last_stand() : SpellScriptLoader("spell_warr_last_stand") { }
|
||||
spell_warr_bloodthirst() : SpellScriptLoader("spell_warr_bloodthirst") { }
|
||||
|
||||
class spell_warr_last_stand_SpellScript : public SpellScript
|
||||
class spell_warr_bloodthirst_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_warr_last_stand_SpellScript);
|
||||
PrepareSpellScript(spell_warr_bloodthirst_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellEntry*/)
|
||||
void HandleDamage(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_LAST_STAND_TRIGGERED))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
int32 damage = GetEffectValue();
|
||||
ApplyPct(damage, GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK));
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
int32 healthModSpellBasePoints0 = int32(caster->CountPctFromMaxHealth(GetEffectValue()));
|
||||
caster->CastCustomSpell(caster, SPELL_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, NULL, NULL, true, NULL);
|
||||
damage = GetCaster()->SpellDamageBonusDone(target, GetSpellInfo(), uint32(damage), SPELL_DIRECT_DAMAGE);
|
||||
damage = target->SpellDamageBonusTaken(GetCaster(), GetSpellInfo(), uint32(damage), SPELL_DIRECT_DAMAGE);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
// add dummy effect spell handler to Last Stand
|
||||
OnEffectHit += SpellEffectFn(spell_warr_last_stand_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_warr_last_stand_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
/// Updated 4.3.4
|
||||
class spell_warr_deep_wounds : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warr_deep_wounds() : SpellScriptLoader("spell_warr_deep_wounds") { }
|
||||
|
||||
class spell_warr_deep_wounds_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_warr_deep_wounds_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*SpellEntry*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_1) || !sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_2) || !sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_3))
|
||||
return false;
|
||||
return true;
|
||||
SetHitDamage(damage);
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
int32 damage = GetEffectValue();
|
||||
Unit* caster = GetCaster();
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
// apply percent damage mods
|
||||
damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE);
|
||||
|
||||
ApplyPct(damage, 16 * sSpellMgr->GetSpellRank(GetSpellInfo()->Id));
|
||||
|
||||
damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE);
|
||||
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_PERIODIC);
|
||||
uint32 ticks = spellInfo->GetDuration() / spellInfo->Effects[EFFECT_0].Amplitude;
|
||||
|
||||
// Add remaining ticks to damage done
|
||||
if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_DEEP_WOUNDS_RANK_PERIODIC, EFFECT_0, caster->GetGUID()))
|
||||
damage += aurEff->GetAmount() * (ticks - aurEff->GetTickNumber());
|
||||
|
||||
damage = damage / ticks;
|
||||
|
||||
caster->CastCustomSpell(target, SPELL_DEEP_WOUNDS_RANK_PERIODIC, &damage, NULL, NULL, true);
|
||||
}
|
||||
GetCaster()->CastCustomSpell(GetCaster(), SPELL_WARRIOR_BLOODTHIRST, &damage, NULL, NULL, true, NULL);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_warr_deep_wounds_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_warr_bloodthirst_SpellScript::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
|
||||
OnEffectHit += SpellEffectFn(spell_warr_bloodthirst_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_warr_deep_wounds_SpellScript();
|
||||
return new spell_warr_bloodthirst_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
/// Updated 4.3.4
|
||||
class spell_warr_bloodthirst_heal : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warr_bloodthirst_heal() : SpellScriptLoader("spell_warr_bloodthirst_heal") { }
|
||||
|
||||
class spell_warr_bloodthirst_heal_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_warr_bloodthirst_heal_SpellScript);
|
||||
|
||||
void HandleHeal(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_WARRIOR_BLOODTHIRST_DAMAGE))
|
||||
SetHitHeal(GetCaster()->CountPctFromMaxHealth(spellInfo->Effects[EFFECT_1].CalcValue(GetCaster())) / 100);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_warr_bloodthirst_heal_SpellScript::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_warr_bloodthirst_heal_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -146,21 +126,22 @@ class spell_warr_charge : public SpellScriptLoader
|
||||
{
|
||||
PrepareSpellScript(spell_warr_charge_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*SpellEntry*/)
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_JUGGERNAUT_CRIT_BONUS_TALENT) || !sSpellMgr->GetSpellInfo(SPELL_JUGGERNAUT_CRIT_BONUS_BUFF) || !sSpellMgr->GetSpellInfo(SPELL_CHARGE))
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_TALENT) || !sSpellMgr->GetSpellInfo(SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_BUFF) || !sSpellMgr->GetSpellInfo(SPELL_WARRIOR_CHARGE))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
int32 chargeBasePoints0 = GetEffectValue();
|
||||
Unit* caster = GetCaster();
|
||||
caster->CastCustomSpell(caster, SPELL_CHARGE, &chargeBasePoints0, NULL, NULL, true);
|
||||
caster->CastCustomSpell(caster, SPELL_WARRIOR_CHARGE, &chargeBasePoints0, NULL, NULL, true);
|
||||
|
||||
//Juggernaut crit bonus
|
||||
if (caster->HasAura(SPELL_JUGGERNAUT_CRIT_BONUS_TALENT))
|
||||
caster->CastSpell(caster, SPELL_JUGGERNAUT_CRIT_BONUS_BUFF, true);
|
||||
// Juggernaut crit bonus
|
||||
if (caster->HasAura(SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_TALENT))
|
||||
caster->CastSpell(caster, SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_BUFF, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
@@ -175,89 +156,6 @@ class spell_warr_charge : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
/// Updated 4.3.4
|
||||
class spell_warr_slam : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warr_slam() : SpellScriptLoader("spell_warr_slam") { }
|
||||
|
||||
class spell_warr_slam_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_warr_slam_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*SpellEntry*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SLAM))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
int32 bp0 = GetEffectValue();
|
||||
if (GetHitUnit())
|
||||
GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_SLAM, &bp0, NULL, NULL, true, 0);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_warr_slam_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_warr_slam_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
/// Updated 4.3.4
|
||||
class spell_warr_execute : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warr_execute() : SpellScriptLoader("spell_warr_execute") { }
|
||||
|
||||
class spell_warr_execute_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_warr_execute_SpellScript);
|
||||
|
||||
void HandleEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (GetHitUnit())
|
||||
{
|
||||
SpellInfo const* spellInfo = GetSpellInfo();
|
||||
int32 rageUsed = std::min<int32>(200 - spellInfo->CalcPowerCost(caster, SpellSchoolMask(spellInfo->SchoolMask)), caster->GetPower(POWER_RAGE));
|
||||
int32 newRage = std::max<int32>(0, caster->GetPower(POWER_RAGE) - rageUsed);
|
||||
|
||||
// Sudden Death rage save
|
||||
if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_GENERIC, ICON_ID_SUDDEN_DEATH, EFFECT_0))
|
||||
{
|
||||
int32 ragesave = aurEff->GetSpellInfo()->Effects[EFFECT_0].CalcValue() * 10;
|
||||
newRage = std::max(newRage, ragesave);
|
||||
}
|
||||
|
||||
caster->SetPower(POWER_RAGE, uint32(newRage));
|
||||
|
||||
/// Formula taken from the DBC: "${10+$AP*0.437*$m1/100}"
|
||||
int32 baseDamage = int32(10 + caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.437f * GetEffectValue() / 100.0f);
|
||||
/// Formula taken from the DBC: "${$ap*0.874*$m1/100-1} = 20 rage"
|
||||
int32 moreDamage = int32(rageUsed * (caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.874f * GetEffectValue() / 100.0f - 1) / 200);
|
||||
SetHitDamage(baseDamage + moreDamage);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_warr_execute_SpellScript::HandleEffect, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_warr_execute_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
/// Updated 4.3.4
|
||||
class spell_warr_concussion_blow : public SpellScriptLoader
|
||||
{
|
||||
@@ -286,83 +184,191 @@ class spell_warr_concussion_blow : public SpellScriptLoader
|
||||
};
|
||||
|
||||
/// Updated 4.3.4
|
||||
class spell_warr_bloodthirst : public SpellScriptLoader
|
||||
class spell_warr_deep_wounds : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warr_bloodthirst() : SpellScriptLoader("spell_warr_bloodthirst") { }
|
||||
spell_warr_deep_wounds() : SpellScriptLoader("spell_warr_deep_wounds") { }
|
||||
|
||||
class spell_warr_bloodthirst_SpellScript : public SpellScript
|
||||
class spell_warr_deep_wounds_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_warr_bloodthirst_SpellScript);
|
||||
PrepareSpellScript(spell_warr_deep_wounds_SpellScript);
|
||||
|
||||
void HandleDamage(SpellEffIndex /*effIndex*/)
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
int32 damage = GetEffectValue();
|
||||
ApplyPct(damage, GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK));
|
||||
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
damage = GetCaster()->SpellDamageBonusDone(target, GetSpellInfo(), uint32(damage), SPELL_DIRECT_DAMAGE);
|
||||
damage = target->SpellDamageBonusTaken(GetCaster(), GetSpellInfo(), uint32(damage), SPELL_DIRECT_DAMAGE);
|
||||
}
|
||||
SetHitDamage(damage);
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_RANK_1) || !sSpellMgr->GetSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_RANK_2) || !sSpellMgr->GetSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_RANK_3))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
int32 damage = GetEffectValue();
|
||||
GetCaster()->CastCustomSpell(GetCaster(), SPELL_BLOODTHIRST, &damage, NULL, NULL, true, NULL);
|
||||
Unit* caster = GetCaster();
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
// apply percent damage mods
|
||||
damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE);
|
||||
|
||||
ApplyPct(damage, 16 * sSpellMgr->GetSpellRank(GetSpellInfo()->Id));
|
||||
|
||||
damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE);
|
||||
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_RANK_PERIODIC);
|
||||
uint32 ticks = spellInfo->GetDuration() / spellInfo->Effects[EFFECT_0].Amplitude;
|
||||
|
||||
// Add remaining ticks to damage done
|
||||
if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_WARRIOR_DEEP_WOUNDS_RANK_PERIODIC, EFFECT_0, caster->GetGUID()))
|
||||
damage += aurEff->GetAmount() * (ticks - aurEff->GetTickNumber());
|
||||
|
||||
damage /= ticks;
|
||||
|
||||
caster->CastCustomSpell(target, SPELL_WARRIOR_DEEP_WOUNDS_RANK_PERIODIC, &damage, NULL, NULL, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_warr_bloodthirst_SpellScript::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
|
||||
OnEffectHit += SpellEffectFn(spell_warr_bloodthirst_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_warr_deep_wounds_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_warr_bloodthirst_SpellScript();
|
||||
return new spell_warr_deep_wounds_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
/// Updated 4.3.4
|
||||
class spell_warr_bloodthirst_heal : public SpellScriptLoader
|
||||
class spell_warr_execute : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warr_bloodthirst_heal() : SpellScriptLoader("spell_warr_bloodthirst_heal") { }
|
||||
spell_warr_execute() : SpellScriptLoader("spell_warr_execute") { }
|
||||
|
||||
class spell_warr_bloodthirst_heal_SpellScript : public SpellScript
|
||||
class spell_warr_execute_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_warr_bloodthirst_heal_SpellScript);
|
||||
PrepareSpellScript(spell_warr_execute_SpellScript);
|
||||
|
||||
void HandleHeal(SpellEffIndex /*effIndex*/)
|
||||
void HandleEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_BLOODTHIRST_DAMAGE))
|
||||
SetHitHeal(GetCaster()->CountPctFromMaxHealth(spellInfo->Effects[EFFECT_1].CalcValue(GetCaster())) / 100);
|
||||
Unit* caster = GetCaster();
|
||||
if (GetHitUnit())
|
||||
{
|
||||
SpellInfo const* spellInfo = GetSpellInfo();
|
||||
int32 rageUsed = std::min<int32>(200 - spellInfo->CalcPowerCost(caster, SpellSchoolMask(spellInfo->SchoolMask)), caster->GetPower(POWER_RAGE));
|
||||
int32 newRage = std::max<int32>(0, caster->GetPower(POWER_RAGE) - rageUsed);
|
||||
|
||||
// Sudden Death rage save
|
||||
if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_GENERIC, WARRIOR_ICON_ID_SUDDEN_DEATH, EFFECT_0))
|
||||
{
|
||||
int32 ragesave = aurEff->GetSpellInfo()->Effects[EFFECT_0].CalcValue() * 10;
|
||||
newRage = std::max(newRage, ragesave);
|
||||
}
|
||||
|
||||
caster->SetPower(POWER_RAGE, uint32(newRage));
|
||||
|
||||
/// Formula taken from the DBC: "${10+$AP*0.437*$m1/100}"
|
||||
int32 baseDamage = int32(10 + caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.437f * GetEffectValue() / 100.0f);
|
||||
/// Formula taken from the DBC: "${$ap*0.874*$m1/100-1} = 20 rage"
|
||||
int32 moreDamage = int32(rageUsed * (caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.874f * GetEffectValue() / 100.0f - 1) / 200);
|
||||
SetHitDamage(baseDamage + moreDamage);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_warr_bloodthirst_heal_SpellScript::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_warr_execute_SpellScript::HandleEffect, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_warr_bloodthirst_heal_SpellScript();
|
||||
return new spell_warr_execute_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
/// Updated 4.3.4
|
||||
class spell_warr_last_stand : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warr_last_stand() : SpellScriptLoader("spell_warr_last_stand") { }
|
||||
|
||||
class spell_warr_last_stand_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_warr_last_stand_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellEntry*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_LAST_STAND_TRIGGERED))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
int32 healthModSpellBasePoints0 = int32(caster->CountPctFromMaxHealth(GetEffectValue()));
|
||||
caster->CastCustomSpell(caster, SPELL_WARRIOR_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, NULL, NULL, true, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
// add dummy effect spell handler to Last Stand
|
||||
OnEffectHit += SpellEffectFn(spell_warr_last_stand_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_warr_last_stand_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
/// Updated 4.3.4
|
||||
class spell_warr_slam : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warr_slam() : SpellScriptLoader("spell_warr_slam") { }
|
||||
|
||||
class spell_warr_slam_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_warr_slam_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_SLAM))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
int32 bp0 = GetEffectValue();
|
||||
if (GetHitUnit())
|
||||
GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_WARRIOR_SLAM, &bp0, NULL, NULL, true, 0);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_warr_slam_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_warr_slam_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_warrior_spell_scripts()
|
||||
{
|
||||
new spell_warr_last_stand();
|
||||
new spell_warr_deep_wounds();
|
||||
new spell_warr_charge();
|
||||
new spell_warr_slam();
|
||||
new spell_warr_execute();
|
||||
new spell_warr_concussion_blow();
|
||||
new spell_warr_bloodthirst();
|
||||
new spell_warr_bloodthirst_heal();
|
||||
new spell_warr_charge();
|
||||
new spell_warr_concussion_blow();
|
||||
new spell_warr_deep_wounds();
|
||||
new spell_warr_execute();
|
||||
new spell_warr_last_stand();
|
||||
new spell_warr_slam();
|
||||
}
|
||||
@@ -2509,11 +2509,11 @@ public:
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 8:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
player->AddItem(ITEM_KEY_TO_THE_FOCUSING_IRIS,1);
|
||||
player->AddItem(ITEM_KEY_TO_THE_FOCUSING_IRIS, 1);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 9:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
player->AddItem(ITEM_HC_KEY_TO_THE_FOCUSING_IRIS,1);
|
||||
player->AddItem(ITEM_HC_KEY_TO_THE_FOCUSING_IRIS, 1);
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
@@ -2828,7 +2828,7 @@ public:
|
||||
{
|
||||
if (!me->FindNearestCreature(NPC_OMEN, 100.0f, false) && me->GetDistance2d(omenSummonPos.GetPositionX(), omenSummonPos.GetPositionY()) <= 100.0f)
|
||||
{
|
||||
switch (urand(0,9))
|
||||
switch (urand(0, 9))
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
|
||||
Reference in new issue
Block a user