Merge branch 'master' of github.com:TrinityCore/TrinityCore into mmaps

This commit is contained in:
Vincent_Michael
2013-01-13 01:25:56 +01:00
39 changed files with 1853 additions and 1507 deletions

View File

@@ -0,0 +1,13 @@
-- NPC talk text for Gatewatcher Gyro-Kill
DELETE FROM `creature_text` WHERE `entry`=19218;
INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
(19218,0,0, 'I predict a painful death.',14,0,100,0,0,11101, 'Gatewatcher Gyro-Kill - Aggro'),
(19218,1,0, 'Your strategy was flawed.',14,0,100,0,0,11102, 'Gatewatcher Gyro-Kill - On Kill'),
(19218,1,1, 'Yes, the only logical outcome.',12,0,100,0,0,11103, 'Gatewatcher Gyro-Kill - On Kill'),
(19218,2,0, 'Measure twice; cut once.',14,0,100,0,0,11104, 'Gatewatcher Gyro-Kill - Sawblades'),
(19218,2,1, 'If my division is correct you should be quite dead.',14,0,100,0,0,11105, 'Gatewatcher Gyro-Kill - Sawblades'),
(19218,3,0, 'An unforeseen... contingency.',14,0,100,0,0,11106, 'Gatewatcher Gyro-Kill - On Death');
DELETE FROM `creature_ai_scripts` WHERE `creature_id`=19218;
DELETE FROM `creature_ai_texts` WHERE `entry` BETWEEN -86 AND -81;
UPDATE `creature_template` SET `AIName`='', `ScriptName`= 'Boss_Gatewatcher_Gyrokill' WHERE `entry`=19218;

View File

@@ -0,0 +1,7 @@
-- Hulking Abomination
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=31140;
DELETE FROM `smart_scripts` WHERE `entryorguid`=31140 AND `source_type`=0;
INSERT INTO `smart_scripts`(`entryorguid`,`id`,`event_type`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`target_type`,`comment`) VALUES
(31140,0,6,0,0,0,0,0,11,58995,2,1,'Hulking Abomination - Just died - Cast Exploding Corpse'),
(31140,1,9,1,8,40,0,0,11,50335,0,7,'Hulking Abomination - Invoker in range of 8 to 40 yards - Cast Scourge Hook'),
(31140,2,0,0,3000,3000,7000,7000,11,40504,0,2,'Hulking Abomination - In combat - Cast Cleave');

View File

@@ -0,0 +1,3 @@
DELETE FROM `trinity_string` WHERE `entry`=2029;
INSERT INTO `trinity_string` (`entry`,`content_default`,`content_loc1`,`content_loc2`,`content_loc3`,`content_loc4`,`content_loc5`,`content_loc6`,`content_loc7`,`content_loc8`) VALUES
(2029,'|cff00ff00Ticket Response|r: [%s]|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);

View File

@@ -0,0 +1 @@
UPDATE `creature_template` SET `ScriptName`= 'boss_gatewatcher_gyrokill' WHERE `entry`=19218;

View File

@@ -0,0 +1,7 @@
-- Add missing doors to mechanar
SET @GUID := 6032;
DELETE FROM `gameobject` WHERE `guid` BETWEEN @GUID AND @GUID+2;
INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES
(@GUID,184632,554,3,1,236.4597,52.36356,1.653544,3.141593,0,0,-1,0,120,0,1),
(@GUID+1,184322,554,3,1,242.874,52.314810,1.596334,3.141593,0,0,-1,0,120,0,1),
(@GUID+2,184449,554,3,1,267.9281,52.31481,27.04254,3.141593,0,0,-1,0,120,0,1);

View File

@@ -0,0 +1,53 @@
-- Pathing for Mechano-Lord Capacitus Entry: 19219
SET @NPC := 83160;
SET @PATH := @NPC * 10;
UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=207.2308,`position_y`=-14.30226,`position_z`=-2.192125 WHERE `guid`=@NPC;
DELETE FROM `creature_addon` WHERE `guid`=@NPC;
INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, '');
DELETE FROM `waypoint_data` WHERE `id`=@PATH;
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
(@PATH,1,207.2308,-14.30226,-2.192125,0,7000,0,0,100,0),
(@PATH,2,204.4302,-15.78992,-2.192125,0,1000,0,0,100,0),
(@PATH,3,207.7613,-18.93377,-2.192125,0,0,0,0,100,0),
(@PATH,4,208.2819,-16.48228,-2.192125,0,1000,0,0,100,0),
(@PATH,5,228.1113,-0.829701,-0.8854336,0,0,0,0,100,0),
(@PATH,6,226.6032,19.45208,-1.726556,0,14000,0,0,100,0),
(@PATH,7,209.7744,-12.69758,-2.192125,0,1000,0,0,100,0),
(@PATH,8,209.7744,-12.69758,-2.192125,3.141593,1000,0,0,100,0),
(@PATH,9,228.1113,-0.829701,-0.8854336,0,0,0,0,100,0),
(@PATH,10,226.6032,19.45208,-1.726556,0,0,0,0,100,0),
(@PATH,11,204.9646,26.38312,-0.005853632,0,13000,0,0,100,0),
(@PATH,12,209.7744,-12.69758,-2.192125,0,1000,0,0,100,0),
(@PATH,13,209.7744,-12.69758,-2.192125,3.141593,1000,0,0,100,0),
(@PATH,14,224.3664,-23.35326,-2.192125,0,0,0,0,100,0),
(@PATH,15,231.1084,-38.22675,8.909556E-07,0,15000,0,0,100,0),
(@PATH,16,209.7744,-12.69758,-2.192125,0,0,0,0,100,0),
(@PATH,17,209.7744,-12.69758,-2.192125,3.141593,1000,0,0,100,0),
(@PATH,18,189.2316,-17.36449,-2.192126,0,0,0,0,100,0),
(@PATH,19,185.7177,-4.297129,-1.142366,0,0,0,0,100,0),
(@PATH,20,191.9589,6.435908,-0.7838742,0,0,0,0,100,0),
(@PATH,21,196.1359,21.01234,-1.426585,0,0,0,0,100,0),
(@PATH,22,207.8954,18.24695,-2.192125,0,0,0,0,100,0),
(@PATH,23,213.9077,10.01895,-2.192125,0,11000,0,0,100,0),
(@PATH,24,209.7744,-12.69758,-2.192125,0,0,0,0,100,0),
(@PATH,25,209.7744,-12.69758,-2.192125,3.141593,2000,0,0,100,0),
(@PATH,26,203.706,-11.63055,-2.192125,0,10000,0,0,100,0),
(@PATH,27,206.4484,-14.27736,-2.192125,0,0,0,0,100,0),
(@PATH,28,208.3172,-13.38252,-2.192125,0,0,0,0,100,0),
(@PATH,29,209.3133,-12.82924,-2.192125,0,7000,0,0,100,0),
(@PATH,30,204.3208,-10.91346,-2.192125,0,0,0,0,100,0),
(@PATH,31,207.38,-13.36442,-2.192125,0,0,0,0,100,0),
(@PATH,32,207.7303,-11.56095,-2.192125,0,7000,0,0,100,0),
(@PATH,33,195.6332,-15.0944,-2.192125,0,0,0,0,100,0),
(@PATH,34,195.4723,-29.45176,-2.192125,0,0,0,0,100,0),
(@PATH,35,202.765,-41.79265,-2.192125,0,7000,0,0,100,0),
(@PATH,36,209.7744,-12.69758,-2.192125,0,1000,0,0,100,0),
(@PATH,37,209.7744,-12.69758,-2.192125,3.141593,1000,0,0,100,0),
(@PATH,38,189.2316,-17.36449,-2.192126,0,0,0,0,100,0),
(@PATH,39,185.7177,-4.297129,-1.142366,0,0,0,0,100,0),
(@PATH,40,191.9589,6.435908,-0.7838742,0,0,0,0,100,0),
(@PATH,41,196.1359,21.01234,-1.426585,0,0,0,0,100,0),
(@PATH,42,207.8954,18.24695,-2.192125,0,0,0,0,100,0),
(@PATH,43,213.9077,10.01895,-2.192125,0,6000,0,0,100,0),
(@PATH,44,209.7744,-12.69758,-2.192125,0,20000,0,0,100,0),
(@PATH,45,210.4122,-9.19214,-2.192125,0,0,0,0,100,0);

View File

@@ -0,0 +1,28 @@
UPDATE `creature_template` SET `AIName` = '',`ScriptName` = 'boss_mechano_lord_capacitus' WHERE `entry` =19219;
UPDATE `creature_template` SET `unit_flags`=`unit_flags` |2 |33554432 WHERE `entry` IN (20405,21534); -- Nether Charge
DELETE FROM `creature_ai_scripts` WHERE `creature_id` IN (19219,20405);
DELETE FROM `creature_ai_texts` WHERE `entry` BETWEEN -92 AND -87;
DELETE FROM `creature_template_addon` WHERE `entry` IN (20405,21534);
INSERT INTO `creature_template_addon` (`entry`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
(20405,0,0,0,0,0,'37670 35150'), -- Nether Charge
(21534,0,0,0,0,0,'37670 35150'); -- Nether Charge (1)
SET @ENTRY := 20405; -- Nether Charge
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY;
UPDATE creature_template SET AIName="SmartAI" WHERE entry=@ENTRY LIMIT 1;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(@ENTRY,0,0,0,0,0,100,0,14000,14000,1000,1000,11,35151,0,0,0,0,0,0,0,0,0,0.0,0.0,0.0,0.0,"Nether Bomb - Nether Charge Pulse"),
(@ENTRY,0,1,0,0,0,100,0,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0,0.0,0.0,0.0,0.0,"Nether Charge - No Melee"),
(@ENTRY,0,2,0,0,0,100,0,0,0,14000,14000,21,0,0,0,0,0,0,0,0,0,0,0.0,0.0,0.0,0.0,"Nether Charge - Prevent Combat Movement When Start...");
DELETE FROM `creature_text` WHERE `entry` = 19219;
INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
(19219, 0, 0, 'You should split while you can.', 14, 0, 100, 0, 0, 11162, 'Mechano-Lord Capacitus - Aggro'),
(19219, 1, 0, 'Go ahead, gimme your best shot. I can take it!', 14, 0, 100, 0, 0, 11166, 'Mechano-Lord Capacitus - Yells'), -- Reflective Damage Shield
(19219, 2, 0, 'Think you can hurt me, huh? Think I''m afraid a'' you?', 14, 0, 100, 0, 0, 11165, 'Mechano-Lord Capacitus - Yells'), -- Reflective Magic Shield
(19219, 3, 0, 'Can''t say I didn''t warn you!', 14, 0, 100, 0, 0, 11163, 'Mechano-Lord Capacitus - Killing a player'),
(19219, 3, 1, 'Damn, I''m good!', 14, 0, 100, 0, 0, 11164, 'Mechano-Lord Capacitus - Killing a player'),
(19219, 4, 0, 'Bully!', 14, 0, 100, 0, 0, 11167, 'Mechano-Lord Capacitus - Death');

View File

@@ -172,7 +172,9 @@ void UnitAI::DoCast(Unit* victim, uint32 spellId, bool triggered)
void UnitAI::DoCastVictim(uint32 spellId, bool triggered)
{
// Why don't we check for casting unit_state and existing target as we do in DoCast(.. ?
if (!me->getVictim() || (me->HasUnitState(UNIT_STATE_CASTING) && !triggered))
return;
me->CastSpell(me->getVictim(), spellId, triggered);
}

View File

@@ -247,7 +247,7 @@ void BattlegroundEY::UpdatePointStatuses()
if (player)
{
this->UpdateWorldStateForPlayer(PROGRESS_BAR_STATUS, m_PointBarStatus[point], player);
//if point owner changed we must evoke event!
//if point owner changed we must evoke event!
if (pointOwnerTeamId != m_PointOwnedByTeam[point])
{
//point was uncontrolled and player is from team which captured point
@@ -258,6 +258,11 @@ void BattlegroundEY::UpdatePointStatuses()
if (m_PointState[point] == EY_POINT_UNDER_CONTROL && player->GetTeam() != m_PointOwnedByTeam[point])
this->EventTeamLostPoint(player, point);
}
if (point == FEL_REAVER && m_PointOwnedByTeam[point] == player->GetTeam())
if (m_FlagState && GetFlagPickerGUID() == player->GetGUID())
if (player->GetDistance2d(2044.0f, 1730.0f) < 2.0f)
EventPlayerCapturedFlag(player, BG_EY_OBJECT_FLAG_FEL_REAVER);
}
}
}

View File

@@ -928,6 +928,7 @@ enum TrinityStrings
LANG_COMMAND_TICKETSHOWESCALATEDLIST = 2026,
LANG_COMMAND_TICKETPENDING = 2027,
LANG_COMMAND_TICKETRESET = 2028,
LANG_COMMAND_TICKETLISTRESPONSE = 2029,
// Trinity strings 5000-9999
LANG_COMMAND_FREEZE = 5000,

View File

@@ -591,6 +591,7 @@ void AddSC_boss_high_astromancer_solarian();
void AddSC_instance_the_eye();
void AddSC_the_eye();
void AddSC_boss_gatewatcher_iron_hand(); //TK The Mechanar
void AddSC_boss_gatewatcher_gyrokill();
void AddSC_boss_nethermancer_sepethrea();
void AddSC_boss_pathaleon_the_calculator();
void AddSC_boss_mechano_lord_capacitus();
@@ -1075,6 +1076,7 @@ void AddOutlandScripts()
AddSC_instance_the_eye();
AddSC_the_eye();
AddSC_boss_gatewatcher_iron_hand(); //TK The Mechanar
AddSC_boss_gatewatcher_gyrokill();
AddSC_boss_nethermancer_sepethrea();
AddSC_boss_pathaleon_the_calculator();
AddSC_boss_mechano_lord_capacitus();

View File

@@ -182,6 +182,8 @@ std::string GmTicket::FormatMessageString(ChatHandler& handler, bool detailed) c
ss << handler.PGetParseString(LANG_COMMAND_TICKETLISTMESSAGE, _message.c_str());
if (!_comment.empty())
ss << handler.PGetParseString(LANG_COMMAND_TICKETLISTCOMMENT, _comment.c_str());
if (!_response.empty())
ss << handler.PGetParseString(LANG_COMMAND_TICKETLISTRESPONSE, _response.c_str());
}
return ss.str();
}

View File

@@ -1534,7 +1534,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();
@@ -1617,7 +1617,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();
}

View File

@@ -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());

View File

@@ -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();
}
};

View File

@@ -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;

View File

@@ -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);

View File

@@ -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);

View File

@@ -50,16 +50,9 @@ class boss_illucia_barov : public CreatureScript
{
boss_illuciabarovAI(Creature* creature) : BossAI(creature,DATA_LADYILLUCIABAROV) {}
void Reset() {}
void JustDied(Unit* /*killer*/)
{
if (instance)
instance->SetData(DATA_LADYILLUCIABAROV, DONE);
}
void EnterCombat(Unit* /*who*/)
{
_EnterCombat();
events.ScheduleEvent(EVENT_CURSEOFAGONY, 18000);
events.ScheduleEvent(EVENT_SHADOWSHOCK, 9000);
events.ScheduleEvent(EVENT_SILENCE, 5000);

View File

@@ -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);

View File

@@ -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()

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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);

View File

@@ -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()

View File

@@ -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

View File

@@ -221,7 +221,10 @@ class spell_gordunni_trap : public SpellScriptLoader
{
if (Unit* caster = GetCaster())
if (GameObject* chest = caster->SummonGameObject(GO_GORDUNNI_DIRT_MOUND, caster->GetPositionX(), caster->GetPositionY(), caster->GetPositionZ(), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0))
{
chest->SetSpellId(GetSpellInfo()->Id);
caster->RemoveGameObject(chest, false);
}
}
void Register()

View File

@@ -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();
}

View File

@@ -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()

View File

@@ -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();
}

View File

@@ -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();
}

View File

@@ -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
{

View File

@@ -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);
}
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;
}
}
bool IsEncounterInProgress() const
void OnGameObjectRemove(GameObject* gameObject)
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS)
return true;
return false;
switch (gameObject->GetEntry())
{
case GO_DOOR_MOARG_1:
case GO_DOOR_MOARG_2:
case GO_DOOR_NETHERMANCER:
AddDoor(gameObject, false);
break;
default:
break;
}
}
uint32 GetData(uint32 type) const
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();
}

View File

@@ -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

View File

@@ -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:
@@ -148,6 +150,7 @@ class spell_dru_insect_swarm : public SpellScriptLoader
}
};
// -33763 - Lifebloom
class spell_dru_lifebloom : public SpellScriptLoader
{
public:
@@ -159,9 +162,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;
}
@@ -180,15 +183,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)
@@ -203,15 +206,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());
}
}
}
@@ -273,6 +276,7 @@ class spell_dru_moonkin_form_passive : public SpellScriptLoader
}
};
// -16972 - Predatory Strikes
class spell_dru_predatory_strikes : public SpellScriptLoader
{
public:
@@ -388,6 +392,7 @@ class spell_dru_savage_defense : public SpellScriptLoader
}
};
// 52610 - Savage Roar
class spell_dru_savage_roar : public SpellScriptLoader
{
public:
@@ -418,7 +423,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;
}
@@ -426,12 +431,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()
@@ -452,6 +457,7 @@ class spell_dru_savage_roar : public SpellScriptLoader
}
};
// -50294 - Starfall (AOE)
class spell_dru_starfall_aoe : public SpellScriptLoader
{
public:
@@ -478,6 +484,7 @@ class spell_dru_starfall_aoe : public SpellScriptLoader
}
};
// -50286 - Starfall (Dummy)
class spell_dru_starfall_dummy : public SpellScriptLoader
{
public:
@@ -523,6 +530,7 @@ class spell_dru_starfall_dummy : public SpellScriptLoader
}
};
// 61336 - Survival Instincts
class spell_dru_survival_instincts : public SpellScriptLoader
{
public:
@@ -553,7 +561,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;
}
@@ -562,12 +570,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()
@@ -622,6 +630,7 @@ class spell_dru_swift_flight_passive : public SpellScriptLoader
}
};
// -5217 - Tiger's Fury
class spell_dru_tiger_s_fury : public SpellScriptLoader
{
public:
@@ -633,8 +642,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()
@@ -649,6 +658,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:

View File

@@ -29,6 +29,10 @@
enum MageSpells
{
SPELL_MAGE_COLD_SNAP = 11958,
SPELL_MAGE_FROST_WARDING_R1 = 28332,
SPELL_MAGE_FROST_WARDING_TRIGGERED = 57776,
SPELL_MAGE_INCANTERS_ABSORBTION_R1 = 44394,
SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED = 44413,
SPELL_MAGE_SQUIRREL_FORM = 32813,
SPELL_MAGE_GIRAFFE_FORM = 32816,
SPELL_MAGE_SERPENT_FORM = 32817,
@@ -41,6 +45,7 @@ enum MageSpells
SPELL_MAGE_GLYPH_OF_BLAST_WAVE = 62126,
};
// -11113 - Blast Wave
class spell_mage_blast_wave : public SpellScriptLoader
{
public:
@@ -50,7 +55,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_GLYPH_OF_BLAST_WAVE))
return false;
@@ -75,6 +80,7 @@ class spell_mage_blast_wave : public SpellScriptLoader
}
};
// 11958 - Cold Snap
class spell_mage_cold_snap : public SpellScriptLoader
{
public:
@@ -91,7 +97,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();
@@ -112,7 +117,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);
}
};
@@ -123,102 +127,7 @@ class spell_mage_cold_snap : public SpellScriptLoader
}
};
enum SilvermoonPolymorph
{
NPC_AUROSALIA = 18744,
};
// TODO: move out of here and rename - not a mage spell
class spell_mage_polymorph_cast_visual : public SpellScriptLoader
{
public:
spell_mage_polymorph_cast_visual() : SpellScriptLoader("spell_mage_polymorph_visual") { }
class spell_mage_polymorph_cast_visual_SpellScript : public SpellScript
{
PrepareSpellScript(spell_mage_polymorph_cast_visual_SpellScript);
static const uint32 PolymorhForms[6];
bool Validate(SpellInfo const* /*spellEntry*/)
{
// check if spell ids exist in dbc
for (uint32 i = 0; i < 6; i++)
if (!sSpellMgr->GetSpellInfo(PolymorhForms[i]))
return false;
return true;
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
if (Unit* target = GetCaster()->FindNearestCreature(NPC_AUROSALIA, 30.0f))
if (target->GetTypeId() == TYPEID_UNIT)
target->CastSpell(target, PolymorhForms[urand(0, 5)], true);
}
void Register()
{
// add dummy effect spell handler to Polymorph visual
OnEffectHitTarget += SpellEffectFn(spell_mage_polymorph_cast_visual_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_mage_polymorph_cast_visual_SpellScript();
}
};
const uint32 spell_mage_polymorph_cast_visual::spell_mage_polymorph_cast_visual_SpellScript::PolymorhForms[6] =
{
SPELL_MAGE_SQUIRREL_FORM,
SPELL_MAGE_GIRAFFE_FORM,
SPELL_MAGE_SERPENT_FORM,
SPELL_MAGE_DRAGONHAWK_FORM,
SPELL_MAGE_WORGEN_FORM,
SPELL_MAGE_SHEEP_FORM
};
class spell_mage_summon_water_elemental : public SpellScriptLoader
{
public:
spell_mage_summon_water_elemental() : SpellScriptLoader("spell_mage_summon_water_elemental") { }
class spell_mage_summon_water_elemental_SpellScript : public SpellScript
{
PrepareSpellScript(spell_mage_summon_water_elemental_SpellScript);
bool Validate(SpellInfo const* /*spellEntry*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_GLYPH_OF_ETERNAL_WATER) || !sSpellMgr->GetSpellInfo(SPELL_MAGE_SUMMON_WATER_ELEMENTAL_TEMPORARY) || !sSpellMgr->GetSpellInfo(SPELL_MAGE_SUMMON_WATER_ELEMENTAL_PERMANENT))
return false;
return true;
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
// Glyph of Eternal Water
if (caster->HasAura(SPELL_MAGE_GLYPH_OF_ETERNAL_WATER))
caster->CastSpell(caster, SPELL_MAGE_SUMMON_WATER_ELEMENTAL_PERMANENT, true);
else
caster->CastSpell(caster, SPELL_MAGE_SUMMON_WATER_ELEMENTAL_TEMPORARY, true);
}
void Register()
{
// add dummy effect spell handler to Summon Water Elemental
OnEffectHit += SpellEffectFn(spell_mage_summon_water_elemental_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_mage_summon_water_elemental_SpellScript();
}
};
// Frost Warding
// -543, -6143 - Frost Warding
class spell_mage_frost_warding_trigger : public SpellScriptLoader
{
public:
@@ -228,13 +137,7 @@ class spell_mage_frost_warding_trigger : public SpellScriptLoader
{
PrepareAuraScript(spell_mage_frost_warding_trigger_AuraScript);
enum Spells
{
SPELL_MAGE_FROST_WARDING_TRIGGERED = 57776,
SPELL_MAGE_FROST_WARDING_R1 = 28332,
};
bool Validate(SpellInfo const* /*spellEntry*/)
bool Validate(SpellInfo const* /*spellInfo*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_FROST_WARDING_TRIGGERED) || !sSpellMgr->GetSpellInfo(SPELL_MAGE_FROST_WARDING_R1))
return false;
@@ -274,13 +177,8 @@ class spell_mage_frost_warding_trigger : public SpellScriptLoader
class spell_mage_incanters_absorbtion_base_AuraScript : public AuraScript
{
public:
enum Spells
{
SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED = 44413,
SPELL_MAGE_INCANTERS_ABSORBTION_R1 = 44394,
};
bool Validate(SpellInfo const* /*spellEntry*/)
bool Validate(SpellInfo const* /*spellInfo*/)
{
return sSpellMgr->GetSpellInfo(SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED)
&& sSpellMgr->GetSpellInfo(SPELL_MAGE_INCANTERS_ABSORBTION_R1);
@@ -298,50 +196,51 @@ class spell_mage_incanters_absorbtion_base_AuraScript : public AuraScript
}
};
// Incanter's Absorption
// -543, -6143, -11426 - Incanter's Absorption
class spell_mage_incanters_absorbtion_absorb : public SpellScriptLoader
{
public:
spell_mage_incanters_absorbtion_absorb() : SpellScriptLoader("spell_mage_incanters_absorbtion_absorb") { }
public:
spell_mage_incanters_absorbtion_absorb() : SpellScriptLoader("spell_mage_incanters_absorbtion_absorb") { }
class spell_mage_incanters_absorbtion_absorb_AuraScript : public spell_mage_incanters_absorbtion_base_AuraScript
{
PrepareAuraScript(spell_mage_incanters_absorbtion_absorb_AuraScript);
void Register()
class spell_mage_incanters_absorbtion_absorb_AuraScript : public spell_mage_incanters_absorbtion_base_AuraScript
{
AfterEffectAbsorb += AuraEffectAbsorbFn(spell_mage_incanters_absorbtion_absorb_AuraScript::Trigger, EFFECT_0);
}
};
PrepareAuraScript(spell_mage_incanters_absorbtion_absorb_AuraScript);
AuraScript* GetAuraScript() const
{
return new spell_mage_incanters_absorbtion_absorb_AuraScript();
}
void Register()
{
AfterEffectAbsorb += AuraEffectAbsorbFn(spell_mage_incanters_absorbtion_absorb_AuraScript::Trigger, EFFECT_0);
}
};
AuraScript* GetAuraScript() const
{
return new spell_mage_incanters_absorbtion_absorb_AuraScript();
}
};
// Incanter's Absorption
// -1463 - Incanter's Absorption
class spell_mage_incanters_absorbtion_manashield : public SpellScriptLoader
{
public:
spell_mage_incanters_absorbtion_manashield() : SpellScriptLoader("spell_mage_incanters_absorbtion_manashield") { }
public:
spell_mage_incanters_absorbtion_manashield() : SpellScriptLoader("spell_mage_incanters_absorbtion_manashield") { }
class spell_mage_incanters_absorbtion_manashield_AuraScript : public spell_mage_incanters_absorbtion_base_AuraScript
{
PrepareAuraScript(spell_mage_incanters_absorbtion_manashield_AuraScript);
void Register()
class spell_mage_incanters_absorbtion_manashield_AuraScript : public spell_mage_incanters_absorbtion_base_AuraScript
{
AfterEffectManaShield += AuraEffectManaShieldFn(spell_mage_incanters_absorbtion_manashield_AuraScript::Trigger, EFFECT_0);
}
};
PrepareAuraScript(spell_mage_incanters_absorbtion_manashield_AuraScript);
AuraScript* GetAuraScript() const
{
return new spell_mage_incanters_absorbtion_manashield_AuraScript();
}
void Register()
{
AfterEffectManaShield += AuraEffectManaShieldFn(spell_mage_incanters_absorbtion_manashield_AuraScript::Trigger, EFFECT_0);
}
};
AuraScript* GetAuraScript() const
{
return new spell_mage_incanters_absorbtion_manashield_AuraScript();
}
};
// -44457 - Living Bomb
class spell_mage_living_bomb : public SpellScriptLoader
{
public:
@@ -380,6 +279,101 @@ class spell_mage_living_bomb : public SpellScriptLoader
}
};
enum SilvermoonPolymorph
{
NPC_AUROSALIA = 18744,
};
// TODO: move out of here and rename - not a mage spell
// 32826 - Polymorph (Visual)
class spell_mage_polymorph_cast_visual : public SpellScriptLoader
{
public:
spell_mage_polymorph_cast_visual() : SpellScriptLoader("spell_mage_polymorph_visual") { }
class spell_mage_polymorph_cast_visual_SpellScript : public SpellScript
{
PrepareSpellScript(spell_mage_polymorph_cast_visual_SpellScript);
static const uint32 PolymorhForms[6];
bool Validate(SpellInfo const* /*spellInfo*/)
{
// check if spell ids exist in dbc
for (uint32 i = 0; i < 6; ++i)
if (!sSpellMgr->GetSpellInfo(PolymorhForms[i]))
return false;
return true;
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
if (Unit* target = GetCaster()->FindNearestCreature(NPC_AUROSALIA, 30.0f))
if (target->GetTypeId() == TYPEID_UNIT)
target->CastSpell(target, PolymorhForms[urand(0, 5)], true);
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_mage_polymorph_cast_visual_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_mage_polymorph_cast_visual_SpellScript();
}
};
const uint32 spell_mage_polymorph_cast_visual::spell_mage_polymorph_cast_visual_SpellScript::PolymorhForms[6] =
{
SPELL_MAGE_SQUIRREL_FORM,
SPELL_MAGE_GIRAFFE_FORM,
SPELL_MAGE_SERPENT_FORM,
SPELL_MAGE_DRAGONHAWK_FORM,
SPELL_MAGE_WORGEN_FORM,
SPELL_MAGE_SHEEP_FORM
};
// 31687 - Summon Water Elemental
class spell_mage_summon_water_elemental : public SpellScriptLoader
{
public:
spell_mage_summon_water_elemental() : SpellScriptLoader("spell_mage_summon_water_elemental") { }
class spell_mage_summon_water_elemental_SpellScript : public SpellScript
{
PrepareSpellScript(spell_mage_summon_water_elemental_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_GLYPH_OF_ETERNAL_WATER) || !sSpellMgr->GetSpellInfo(SPELL_MAGE_SUMMON_WATER_ELEMENTAL_TEMPORARY) || !sSpellMgr->GetSpellInfo(SPELL_MAGE_SUMMON_WATER_ELEMENTAL_PERMANENT))
return false;
return true;
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
// Glyph of Eternal Water
if (caster->HasAura(SPELL_MAGE_GLYPH_OF_ETERNAL_WATER))
caster->CastSpell(caster, SPELL_MAGE_SUMMON_WATER_ELEMENTAL_PERMANENT, true);
else
caster->CastSpell(caster, SPELL_MAGE_SUMMON_WATER_ELEMENTAL_TEMPORARY, true);
}
void Register()
{
OnEffectHit += SpellEffectFn(spell_mage_summon_water_elemental_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_mage_summon_water_elemental_SpellScript();
}
};
void AddSC_mage_spell_scripts()
{
new spell_mage_blast_wave();
@@ -387,7 +381,7 @@ void AddSC_mage_spell_scripts()
new spell_mage_frost_warding_trigger();
new spell_mage_incanters_absorbtion_absorb();
new spell_mage_incanters_absorbtion_manashield();
new spell_mage_living_bomb();
new spell_mage_polymorph_cast_visual();
new spell_mage_summon_water_elemental();
new spell_mage_living_bomb();
}

View File

@@ -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 @@ class spell_pal_ardent_defender : public SpellScriptLoader
}
};
// 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,19 +285,419 @@ 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();
}
};
void AddSC_paladin_spell_scripts()
{
new spell_pal_ardent_defender();
new spell_pal_blessing_of_faith();
new spell_pal_blessing_of_sanctuary();
new spell_pal_guarded_by_the_light();
new spell_pal_holy_shock();
new spell_pal_judgement_of_command();
new spell_pal_divine_sacrifice();
new spell_pal_divine_storm();
new spell_pal_divine_storm_dummy();
new spell_pal_exorcism_and_holy_wrath_damage();
new spell_pal_guarded_by_the_light();
new spell_pal_hand_of_sacrifice();
new spell_pal_holy_shock();
new spell_pal_judgement_of_command();
new spell_pal_lay_on_hands();
new spell_pal_righteous_defense();
new spell_pal_exorcism_and_holy_wrath_damage();
new spell_pal_hand_of_sacrifice();
new spell_pal_divine_sacrifice();
}

View File

@@ -249,7 +249,6 @@ class spell_pri_penance : public SpellScriptLoader
void Register()
{
// add dummy effect spell handler to Penance
OnEffectHitTarget += SpellEffectFn(spell_pri_penance_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
OnCheckCast += SpellCheckCastFn(spell_pri_penance_SpellScript::CheckCast);
}
@@ -282,7 +281,6 @@ class spell_pri_prayer_of_mending_heal : public SpellScriptLoader
SetHitHeal(heal);
}
}
}
void Register()

View File

@@ -28,47 +28,284 @@
enum WarriorSpells
{
WARRIOR_SPELL_LAST_STAND_TRIGGERED = 12976,
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_EXECUTE = 20647,
SPELL_WARRIOR_GLYPH_OF_EXECUTION = 58367,
SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_BUFF = 65156,
SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_TALENT = 64976,
SPELL_WARRIOR_LAST_STAND_TRIGGERED = 12976,
SPELL_WARRIOR_SLAM = 50783,
SPELL_WARRIOR_UNRELENTING_ASSAULT_RANK_1 = 46859,
SPELL_WARRIOR_UNRELENTING_ASSAULT_RANK_2 = 46860,
SPELL_WARRIOR_UNRELENTING_ASSAULT_TRIGGER_1 = 64849,
SPELL_WARRIOR_UNRELENTING_ASSAULT_TRIGGER_2 = 64850,
SPELL_PALADIN_BLESSING_OF_SANCTUARY = 20911,
SPELL_PALADIN_GREATER_BLESSING_OF_SANCTUARY = 25899,
SPELL_PRIEST_RENEWED_HOPE = 63944,
SPELL_GEN_DAMAGE_REDUCTION_AURA = 68066,
};
class spell_warr_last_stand : public SpellScriptLoader
enum WarriorSpellIcons
{
WARRIOR_ICON_ID_SUDDEN_DEATH = 1989,
};
// 23881 - Bloodthirst
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(WARRIOR_SPELL_LAST_STAND_TRIGGERED))
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);
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
int32 damage = GetEffectValue();
GetCaster()->CastCustomSpell(GetCaster(), SPELL_WARRIOR_BLOODTHIRST, &damage, NULL, NULL, true, NULL);
}
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);
}
};
SpellScript* GetSpellScript() const
{
return new spell_warr_bloodthirst_SpellScript();
}
};
// 23880 - Bloodthirst (Heal)
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())));
}
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();
}
};
// -100 - Charge
class spell_warr_charge : public SpellScriptLoader
{
public:
spell_warr_charge() : SpellScriptLoader("spell_warr_charge") { }
class spell_warr_charge_SpellScript : public SpellScript
{
PrepareSpellScript(spell_warr_charge_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/)
{
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*/)
{
if (Unit* caster = GetCaster())
{
int32 healthModSpellBasePoints0 = int32(caster->CountPctFromMaxHealth(30));
caster->CastCustomSpell(caster, WARRIOR_SPELL_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, NULL, NULL, true, NULL);
}
int32 chargeBasePoints0 = GetEffectValue();
Unit* caster = GetCaster();
caster->CastCustomSpell(caster, SPELL_WARRIOR_CHARGE, &chargeBasePoints0, NULL, NULL, 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()
{
// add dummy effect spell handler to Last Stand
OnEffectHit += SpellEffectFn(spell_warr_last_stand_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
OnEffectHitTarget += SpellEffectFn(spell_warr_charge_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_warr_last_stand_SpellScript();
return new spell_warr_charge_SpellScript();
}
};
// 12809 - Concussion Blow
class spell_warr_concussion_blow : public SpellScriptLoader
{
public:
spell_warr_concussion_blow() : SpellScriptLoader("spell_warr_concussion_blow") { }
class spell_warr_concussion_blow_SpellScript : public SpellScript
{
PrepareSpellScript(spell_warr_concussion_blow_SpellScript);
void HandleDummy(SpellEffIndex /*effIndex*/)
{
SetHitDamage(CalculatePct(GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK), GetEffectValue()));
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_warr_concussion_blow_SpellScript::HandleDummy, EFFECT_2, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_warr_concussion_blow_SpellScript();
}
};
// -12162 - Deep Wounds
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* /*spellInfo*/)
{
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();
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_deep_wounds_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_warr_deep_wounds_SpellScript();
}
};
// -5308 - Execute
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);
bool Validate(SpellInfo const* /*spellInfo*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_EXECUTE) || !sSpellMgr->GetSpellInfo(SPELL_WARRIOR_GLYPH_OF_EXECUTION))
return false;
return true;
}
void HandleDummy(SpellEffIndex effIndex)
{
Unit* caster = GetCaster();
if (Unit* target = GetHitUnit())
{
SpellInfo const* spellInfo = GetSpellInfo();
int32 rageUsed = std::min<int32>(300 - 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_1].CalcValue() * 10;
newRage = std::max(newRage, ragesave);
}
caster->SetPower(POWER_RAGE, uint32(newRage));
// Glyph of Execution bonus
if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_WARRIOR_GLYPH_OF_EXECUTION, EFFECT_0))
rageUsed += aurEff->GetAmount() * 10;
int32 bp = GetEffectValue() + int32(rageUsed * spellInfo->Effects[effIndex].DamageMultiplier + caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.2f);
caster->CastCustomSpell(target, SPELL_WARRIOR_EXECUTE, &bp, NULL, NULL, true, NULL, NULL, GetOriginalCaster()->GetGUID());
}
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_warr_execute_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_warr_execute_SpellScript();
}
};
// 59725 - Improved Spell Reflection
class spell_warr_improved_spell_reflection : public SpellScriptLoader
{
public:
@@ -96,173 +333,83 @@ class spell_warr_improved_spell_reflection : public SpellScriptLoader
}
};
enum DamageReductionAura
{
SPELL_BLESSING_OF_SANCTUARY = 20911,
SPELL_GREATER_BLESSING_OF_SANCTUARY = 25899,
SPELL_RENEWED_HOPE = 63944,
SPELL_DAMAGE_REDUCTION_AURA = 68066,
};
class spell_warr_vigilance : public SpellScriptLoader
{
public:
spell_warr_vigilance() : SpellScriptLoader("spell_warr_vigilance") { }
class spell_warr_vigilance_AuraScript : public AuraScript
{
PrepareAuraScript(spell_warr_vigilance_AuraScript);
bool Validate(SpellInfo const* /*SpellEntry*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_DAMAGE_REDUCTION_AURA))
return false;
return true;
}
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (Unit* target = GetTarget())
target->CastSpell(target, SPELL_DAMAGE_REDUCTION_AURA, true);
}
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (Unit* target = GetTarget())
{
if (target->HasAura(SPELL_DAMAGE_REDUCTION_AURA) && !(target->HasAura(SPELL_BLESSING_OF_SANCTUARY) ||
target->HasAura(SPELL_GREATER_BLESSING_OF_SANCTUARY) ||
target->HasAura(SPELL_RENEWED_HOPE)))
target->RemoveAurasDueToSpell(SPELL_DAMAGE_REDUCTION_AURA);
}
}
void Register()
{
OnEffectApply += AuraEffectApplyFn(spell_warr_vigilance_AuraScript::OnApply, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
OnEffectRemove += AuraEffectRemoveFn(spell_warr_vigilance_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
}
};
AuraScript* GetAuraScript() const
{
return new spell_warr_vigilance_AuraScript();
}
};
enum DeepWounds
{
SPELL_DEEP_WOUNDS_RANK_1 = 12162,
SPELL_DEEP_WOUNDS_RANK_2 = 12850,
SPELL_DEEP_WOUNDS_RANK_3 = 12868,
SPELL_DEEP_WOUNDS_RANK_PERIODIC = 12721,
};
class spell_warr_deep_wounds : public SpellScriptLoader
// 12975 - Last Stand
class spell_warr_last_stand : public SpellScriptLoader
{
public:
spell_warr_deep_wounds() : SpellScriptLoader("spell_warr_deep_wounds") { }
spell_warr_last_stand() : SpellScriptLoader("spell_warr_last_stand") { }
class spell_warr_deep_wounds_SpellScript : public SpellScript
class spell_warr_last_stand_SpellScript : public SpellScript
{
PrepareSpellScript(spell_warr_deep_wounds_SpellScript);
PrepareSpellScript(spell_warr_last_stand_SpellScript);
bool Validate(SpellInfo const* /*SpellEntry*/)
bool Validate(SpellInfo const* /*spellInfo*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_1) || !sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_2) || !sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_3))
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_LAST_STAND_TRIGGERED))
return false;
return true;
}
void HandleDummy(SpellEffIndex /* effIndex */)
void HandleDummy(SpellEffIndex /*effIndex*/)
{
int32 damage = GetEffectValue();
Unit* caster = GetCaster();
if (Unit* target = GetHitUnit())
if (Unit* caster = GetCaster())
{
// 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);
int32 healthModSpellBasePoints0 = int32(caster->CountPctFromMaxHealth(30));
caster->CastCustomSpell(caster, SPELL_WARRIOR_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, NULL, NULL, true, NULL);
}
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_warr_deep_wounds_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
OnEffectHit += SpellEffectFn(spell_warr_last_stand_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_warr_deep_wounds_SpellScript();
return new spell_warr_last_stand_SpellScript();
}
};
enum Charge
{
SPELL_JUGGERNAUT_CRIT_BONUS_TALENT = 64976,
SPELL_JUGGERNAUT_CRIT_BONUS_BUFF = 65156,
SPELL_CHARGE = 34846,
};
class spell_warr_charge : public SpellScriptLoader
// 7384, 7887, 11584, 11585 - Overpower
class spell_warr_overpower : public SpellScriptLoader
{
public:
spell_warr_charge() : SpellScriptLoader("spell_warr_charge") { }
spell_warr_overpower() : SpellScriptLoader("spell_warr_overpower") { }
class spell_warr_charge_SpellScript : public SpellScript
class spell_warr_overpower_SpellScript : public SpellScript
{
PrepareSpellScript(spell_warr_charge_SpellScript);
PrepareSpellScript(spell_warr_overpower_SpellScript);
bool Validate(SpellInfo const* /*SpellEntry*/)
void HandleEffect(SpellEffIndex /*effIndex*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_JUGGERNAUT_CRIT_BONUS_TALENT) || !sSpellMgr->GetSpellInfo(SPELL_JUGGERNAUT_CRIT_BONUS_BUFF) || !sSpellMgr->GetSpellInfo(SPELL_CHARGE))
return false;
return true;
}
void HandleDummy(SpellEffIndex /* effIndex */)
{
int32 chargeBasePoints0 = GetEffectValue();
Unit* caster = GetCaster();
caster->CastCustomSpell(caster, SPELL_CHARGE, &chargeBasePoints0, NULL, NULL, true);
uint32 spellId = 0;
if (GetCaster()->HasAura(SPELL_WARRIOR_UNRELENTING_ASSAULT_RANK_1))
spellId = SPELL_WARRIOR_UNRELENTING_ASSAULT_TRIGGER_1;
else if (GetCaster()->HasAura(SPELL_WARRIOR_UNRELENTING_ASSAULT_RANK_2))
spellId = SPELL_WARRIOR_UNRELENTING_ASSAULT_TRIGGER_2;
//Juggernaut crit bonus
if (caster->HasAura(SPELL_JUGGERNAUT_CRIT_BONUS_TALENT))
caster->CastSpell(caster, SPELL_JUGGERNAUT_CRIT_BONUS_BUFF, true);
if (!spellId)
return;
if (Player* target = GetHitPlayer())
if (target->HasUnitState(UNIT_STATE_CASTING))
target->CastSpell(target, spellId, true);
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_warr_charge_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
OnEffectHitTarget += SpellEffectFn(spell_warr_overpower_SpellScript::HandleEffect, EFFECT_0, SPELL_EFFECT_ANY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_warr_charge_SpellScript();
return new spell_warr_overpower_SpellScript();
}
};
enum Slam
{
SPELL_SLAM = 50783,
};
// -1464 - Slam
class spell_warr_slam : public SpellScriptLoader
{
public:
@@ -272,17 +419,18 @@ class spell_warr_slam : public SpellScriptLoader
{
PrepareSpellScript(spell_warr_slam_SpellScript);
bool Validate(SpellInfo const* /*SpellEntry*/)
bool Validate(SpellInfo const* /*spellInfo*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_SLAM))
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_SLAM))
return false;
return true;
}
void HandleDummy(SpellEffIndex /* effIndex */)
void HandleDummy(SpellEffIndex /*effIndex*/)
{
int32 bp0 = GetEffectValue();
if (GetHitUnit())
GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_SLAM, &bp0, NULL, NULL, true, 0);
GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_WARRIOR_SLAM, &bp0, NULL, NULL, true, 0);
}
void Register()
@@ -297,227 +445,65 @@ class spell_warr_slam : public SpellScriptLoader
}
};
enum Execute
{
SPELL_EXECUTE = 20647,
SPELL_GLYPH_OF_EXECUTION = 58367,
ICON_ID_SUDDEN_DEATH = 1989,
};
class spell_warr_execute : public SpellScriptLoader
// 50720 - Vigilance
class spell_warr_vigilance : public SpellScriptLoader
{
public:
spell_warr_execute() : SpellScriptLoader("spell_warr_execute") { }
spell_warr_vigilance() : SpellScriptLoader("spell_warr_vigilance") { }
class spell_warr_execute_SpellScript : public SpellScript
class spell_warr_vigilance_AuraScript : public AuraScript
{
PrepareSpellScript(spell_warr_execute_SpellScript);
PrepareAuraScript(spell_warr_vigilance_AuraScript);
bool Validate(SpellInfo const* /*SpellEntry*/)
bool Validate(SpellInfo const* /*spellInfo*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_EXECUTE) || !sSpellMgr->GetSpellInfo(SPELL_GLYPH_OF_EXECUTION))
if (!sSpellMgr->GetSpellInfo(SPELL_GEN_DAMAGE_REDUCTION_AURA))
return false;
return true;
}
void HandleDummy(SpellEffIndex effIndex)
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* caster = GetCaster();
if (Unit* target = GetHitUnit())
if (Unit* target = GetTarget())
target->CastSpell(target, SPELL_GEN_DAMAGE_REDUCTION_AURA, true);
}
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (Unit* target = GetTarget())
{
SpellInfo const* spellInfo = GetSpellInfo();
int32 rageUsed = std::min<int32>(300 - 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_1].CalcValue() * 10;
newRage = std::max(newRage, ragesave);
}
caster->SetPower(POWER_RAGE, uint32(newRage));
// Glyph of Execution bonus
if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_GLYPH_OF_EXECUTION, EFFECT_0))
rageUsed += aurEff->GetAmount() * 10;
int32 bp = GetEffectValue() + int32(rageUsed * spellInfo->Effects[effIndex].DamageMultiplier + caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.2f);
caster->CastCustomSpell(target,SPELL_EXECUTE,&bp,0,0,true,0,0,GetOriginalCaster()->GetGUID());
if (target->HasAura(SPELL_GEN_DAMAGE_REDUCTION_AURA) && !(target->HasAura(SPELL_PALADIN_BLESSING_OF_SANCTUARY) ||
target->HasAura(SPELL_PALADIN_GREATER_BLESSING_OF_SANCTUARY) ||
target->HasAura(SPELL_PRIEST_RENEWED_HOPE)))
target->RemoveAurasDueToSpell(SPELL_GEN_DAMAGE_REDUCTION_AURA);
}
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_warr_execute_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
OnEffectApply += AuraEffectApplyFn(spell_warr_vigilance_AuraScript::OnApply, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
OnEffectRemove += AuraEffectRemoveFn(spell_warr_vigilance_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
}
};
SpellScript* GetSpellScript() const
AuraScript* GetAuraScript() const
{
return new spell_warr_execute_SpellScript();
return new spell_warr_vigilance_AuraScript();
}
};
class spell_warr_concussion_blow : public SpellScriptLoader
{
public:
spell_warr_concussion_blow() : SpellScriptLoader("spell_warr_concussion_blow") { }
class spell_warr_concussion_blow_SpellScript : public SpellScript
{
PrepareSpellScript(spell_warr_concussion_blow_SpellScript);
void HandleDummy(SpellEffIndex /* effIndex */)
{
SetHitDamage(CalculatePct(GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK), GetEffectValue()));
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_warr_concussion_blow_SpellScript::HandleDummy, EFFECT_2, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_warr_concussion_blow_SpellScript();
}
};
enum Bloodthirst
{
SPELL_BLOODTHIRST = 23885,
};
class spell_warr_bloodthirst : public SpellScriptLoader
{
public:
spell_warr_bloodthirst() : SpellScriptLoader("spell_warr_bloodthirst") { }
class spell_warr_bloodthirst_SpellScript : public SpellScript
{
PrepareSpellScript(spell_warr_bloodthirst_SpellScript);
void HandleDamage(SpellEffIndex /*effIndex*/)
{
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);
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
int32 damage = GetEffectValue();
GetCaster()->CastCustomSpell(GetCaster(), SPELL_BLOODTHIRST, &damage, NULL, NULL, true, NULL);
}
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);
}
};
SpellScript* GetSpellScript() const
{
return new spell_warr_bloodthirst_SpellScript();
}
};
enum BloodthirstHeal
{
SPELL_BLOODTHIRST_DAMAGE = 23881,
};
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_BLOODTHIRST_DAMAGE))
SetHitHeal(GetCaster()->CountPctFromMaxHealth(spellInfo->Effects[EFFECT_1].CalcValue(GetCaster())));
}
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();
}
};
enum Overpower
{
SPELL_UNRELENTING_ASSAULT_RANK_1 = 46859,
SPELL_UNRELENTING_ASSAULT_RANK_2 = 46860,
SPELL_UNRELENTING_ASSAULT_TRIGGER_1 = 64849,
SPELL_UNRELENTING_ASSAULT_TRIGGER_2 = 64850,
};
class spell_warr_overpower : public SpellScriptLoader
{
public:
spell_warr_overpower() : SpellScriptLoader("spell_warr_overpower") { }
class spell_warr_overpower_SpellScript : public SpellScript
{
PrepareSpellScript(spell_warr_overpower_SpellScript);
void HandleEffect(SpellEffIndex /* effIndex */)
{
uint32 spellId = 0;
if (GetCaster()->HasAura(SPELL_UNRELENTING_ASSAULT_RANK_1))
spellId = SPELL_UNRELENTING_ASSAULT_TRIGGER_1;
else if (GetCaster()->HasAura(SPELL_UNRELENTING_ASSAULT_RANK_2))
spellId = SPELL_UNRELENTING_ASSAULT_TRIGGER_2;
if (!spellId)
return;
if (Player* target = GetHitPlayer())
if (target->HasUnitState(UNIT_STATE_CASTING))
target->CastSpell(target, spellId, true);
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_warr_overpower_SpellScript::HandleEffect, EFFECT_0, SPELL_EFFECT_ANY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_warr_overpower_SpellScript();
}
};
void AddSC_warrior_spell_scripts()
{
new spell_warr_last_stand();
new spell_warr_improved_spell_reflection();
new spell_warr_vigilance();
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_improved_spell_reflection();
new spell_warr_last_stand();
new spell_warr_overpower();
new spell_warr_slam();
new spell_warr_vigilance();
}