Scripts/Mechanar:
* cleanup for door system * Convert mechano lord capacitus in c++
This commit is contained in:
1 parent
4fb60031f8
commit
abe4b656c8
7 files changed
+192
-64
No files matched your search
@@ -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');
|
||||
@@ -52,7 +52,8 @@ enum Events
|
||||
|
||||
class boss_gatewatcher_gyrokill : public CreatureScript
|
||||
{
|
||||
public: boss_gatewatcher_gyrokill() : CreatureScript("boss_gatewatcher_gyrokill") {}
|
||||
public:
|
||||
boss_gatewatcher_gyrokill() : CreatureScript("boss_gatewatcher_gyrokill") {}
|
||||
|
||||
struct boss_gatewatcher_gyrokillAI : public BossAI
|
||||
{
|
||||
@@ -62,8 +63,6 @@ class boss_gatewatcher_gyrokill : public CreatureScript
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
if (GameObject* door = me->GetMap()->GetGameObject(instance->GetData64(GO_DOOR_MOARG_2)))
|
||||
door->SetGoState(GO_STATE_ACTIVE);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
|
||||
@@ -55,7 +55,8 @@ enum Events
|
||||
|
||||
class boss_gatewatcher_iron_hand : public CreatureScript
|
||||
{
|
||||
public: boss_gatewatcher_iron_hand(): CreatureScript("boss_gatewatcher_iron_hand") {}
|
||||
public:
|
||||
boss_gatewatcher_iron_hand(): CreatureScript("boss_gatewatcher_iron_hand") {}
|
||||
|
||||
struct boss_gatewatcher_iron_handAI : public BossAI
|
||||
{
|
||||
@@ -80,8 +81,6 @@ class boss_gatewatcher_iron_hand : public CreatureScript
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
if (GameObject* door = me->GetMap()->GetGameObject(instance->GetData64(GO_DOOR_MOARG_1)))
|
||||
door->SetGoState(GO_STATE_ACTIVE);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 const diff)
|
||||
@@ -93,7 +92,8 @@ class boss_gatewatcher_iron_hand : public CreatureScript
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
@@ -122,10 +122,10 @@ class boss_gatewatcher_iron_hand : public CreatureScript
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_gatewatcher_iron_handAI(creature);
|
||||
}
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_gatewatcher_iron_handAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_gatewatcher_iron_hand()
|
||||
|
||||
@@ -15,26 +15,150 @@
|
||||
* 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
|
||||
};
|
||||
|
||||
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
|
||||
{
|
||||
public: spell_capacitus_polarity_charge() : SpellScriptLoader("spell_capacitus_polarity_charge") { }
|
||||
public:
|
||||
spell_capacitus_polarity_charge() : SpellScriptLoader("spell_capacitus_polarity_charge") { }
|
||||
|
||||
class spell_capacitus_polarity_charge_SpellScript : public SpellScript
|
||||
{
|
||||
@@ -137,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();
|
||||
}
|
||||
@@ -89,8 +89,6 @@ class boss_nethermancer_sepethrea : public CreatureScript
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
if (GameObject* door = me->GetMap()->GetGameObject(instance->GetData64(GO_DOOR_NETHERMANCER)))
|
||||
door->SetGoState(GO_STATE_ACTIVE);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 const diff)
|
||||
|
||||
@@ -68,7 +68,8 @@ enum Creatures
|
||||
|
||||
class boss_pathaleon_the_calculator : public CreatureScript
|
||||
{
|
||||
public: boss_pathaleon_the_calculator(): CreatureScript("boss_pathaleon_the_calculator") {}
|
||||
public:
|
||||
boss_pathaleon_the_calculator(): CreatureScript("boss_pathaleon_the_calculator") {}
|
||||
|
||||
struct boss_pathaleon_the_calculatorAI : public BossAI
|
||||
{
|
||||
|
||||
@@ -16,82 +16,59 @@
|
||||
* 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"
|
||||
|
||||
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) { }
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_mechanar_InstanceMapScript(map);
|
||||
}
|
||||
public:
|
||||
instance_mechanar(): InstanceMapScript("instance_mechanar", 554) { }
|
||||
|
||||
struct instance_mechanar_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_mechanar_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
SetBossNumber(EncounterCount);
|
||||
DoorMoArg1GUID = 0;
|
||||
DoorMoArg2GUID = 0;
|
||||
DoorNethermancerGUID = 0;
|
||||
LoadDoorData(doorData);
|
||||
}
|
||||
|
||||
|
||||
void OnGameObjectCreate(GameObject* go)
|
||||
void OnGameObjectCreate(GameObject* gameObject)
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
switch (gameObject->GetEntry())
|
||||
{
|
||||
case GO_DOOR_MOARG_1:
|
||||
DoorMoArg1GUID = go->GetGUID();
|
||||
break;
|
||||
case GO_DOOR_MOARG_2:
|
||||
DoorMoArg2GUID = go->GetGUID();
|
||||
break;
|
||||
case GO_DOOR_NETHERMANCER:
|
||||
DoorNethermancerGUID = go->GetGUID();
|
||||
AddDoor(gameObject, true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
CheckInstanceStatus();
|
||||
}
|
||||
|
||||
void CheckInstanceStatus()
|
||||
void OnGameObjectRemove(GameObject* gameObject)
|
||||
{
|
||||
if (GetBossState(DATA_GATEWATCHER_IRON_HAND) == DONE)
|
||||
HandleGameObject(DoorMoArg1GUID, true);
|
||||
|
||||
if (GetBossState(DATA_GATEWATCHER_GYROKILL) == DONE)
|
||||
HandleGameObject(DoorMoArg2GUID, true);
|
||||
|
||||
if (GetBossState(DATA_NETHERMANCER_SEPRETHREA) == DONE)
|
||||
HandleGameObject(DoorNethermancerGUID, true);
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 type) const
|
||||
{
|
||||
switch (type)
|
||||
switch (gameObject->GetEntry())
|
||||
{
|
||||
case GO_DOOR_MOARG_1:
|
||||
return DoorMoArg1GUID;
|
||||
case GO_DOOR_MOARG_2:
|
||||
return DoorMoArg2GUID;
|
||||
case GO_DOOR_NETHERMANCER:
|
||||
return DoorNethermancerGUID;
|
||||
AddDoor(gameObject, false);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool SetBossState(uint32 type, EncounterState state)
|
||||
@@ -156,12 +133,12 @@ class instance_mechanar : public InstanceMapScript
|
||||
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
|
||||
protected:
|
||||
uint64 DoorMoArg1GUID;
|
||||
uint64 DoorMoArg2GUID;
|
||||
uint64 DoorNethermancerGUID;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_mechanar_InstanceMapScript(map);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_mechanar()
|
||||
|
||||
Reference in new issue
Block a user