From cc0842f46b21cbbcf18686648396fe26e9cf9aae Mon Sep 17 00:00:00 2001 From: Gacko Date: Sat, 10 Nov 2012 17:33:07 +0100 Subject: Core/DB: Utgarde Keep - Script areatrigger near Ingvar to activate the proto drake - Assign heroic spells - Mount proto drake rider to proto drake --- sql/updates/world/2012_09_22_00_world_utgarde.sql | 47 +++++++++++++++++++++-- 1 file changed, 44 insertions(+), 3 deletions(-) (limited to 'sql') diff --git a/sql/updates/world/2012_09_22_00_world_utgarde.sql b/sql/updates/world/2012_09_22_00_world_utgarde.sql index 83cc227f9cd..830734db247 100644 --- a/sql/updates/world/2012_09_22_00_world_utgarde.sql +++ b/sql/updates/world/2012_09_22_00_world_utgarde.sql @@ -48,7 +48,7 @@ INSERT INTO `smart_scripts`(`entryorguid`,`event_type`,`event_param1`,`event_par (28419,0,5000,5000,30000,30000,11,40414,5,'Frenzied geist - In combat - Cast Fixate'); -- Difficulty data for spells used in utgarde keep -DELETE FROM `spelldifficulty_dbc` WHERE `id` IN(42669,42708,42750,42723,42729,43667,42702) OR `spellid0` IN(42669,42708,42750,42723,42729,43667,42702); +DELETE FROM `spelldifficulty_dbc` WHERE `id` IN(42669,42708,42750,42723,42729,43667,42702,50653,43931) OR `spellid0` IN(42669,42708,42750,42723,42729,43667,42702,50653,43931); INSERT INTO `spelldifficulty_dbc`(`id`,`spellid0`,`spellid1`) VALUES (42669,42669,59706), -- Smash (42708,42708,59708), -- Staggering Roar @@ -56,7 +56,9 @@ INSERT INTO `spelldifficulty_dbc`(`id`,`spellid0`,`spellid1`) VALUES (42723,42723,59709), -- Dark Smash (42729,42729,59734), -- Dreadful Roar (43667,43667,59389), -- Shadow Bolt -(42702,42702,59397); -- Decrepify +(42702,42702,59397), -- Decrepify +(50653,50653,59692), -- Flame Breath +(43931,43931,59691); -- Rend -- Ticking Time Bomb, Fixate DELETE FROM `spell_script_names` WHERE `spell_id` IN(59686,40414); @@ -88,7 +90,7 @@ INSERT INTO `creature_addon`(`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`auras`) -- Waypoint data DELETE FROM `waypoint_data` WHERE `id` IN (1259400,1259340,1259150,1259200,1259140,1259360,1259370,1259220); -INSERT INTO `waypoint_data`(`id`,`point`,`position_x`,`position_y`,`position_z`) VALUES +INSERT INTO `waypoint_data`(`id`,`point`,`position_x`,`position_y`,`position_z`) VALUES (1259400,1,211.864,-352.629,196.144), (1259340,1,271.911,-318.506,185.049), (1259150,1,265.478,-199.246,186.812), @@ -100,3 +102,42 @@ INSERT INTO `waypoint_data`(`id`,`point`,`position_x`,`position_y`,`position_z`) INSERT INTO `waypoint_data`(`id`,`point`,`position_x`,`position_y`,`position_z`) SELECT `guid`*10,2,`position_x`,`position_y`,`position_z` FROM `creature` WHERE `guid` IN (125940,125934,125915,125920,125914,125936,125937,125922); + +-- Areatrigger script +DELETE FROM `areatrigger_scripts` WHERE `entry`=4838; +INSERT INTO `areatrigger_scripts`(`entry`,`ScriptName`) VALUES +(4838,'SmartTrigger'); + +DELETE FROM `smart_scripts` WHERE `entryorguid`=4838 AND `source_type`=2; +INSERT INTO `smart_scripts`(`entryorguid`,`source_type`,`event_type`,`event_param1`,`action_type`,`action_param1`,`action_param2`,`target_type`,`target_param1`,`comment`) VALUES +(4838,2,46,4838,45,28,6,10,125946,'Areatrigger in Utgarde Keep near Ingvar - On trigger - Set data of Enslaved Proto Drake'); + +-- Template updates for proto drake and rider +UPDATE `creature_template` SET `AIName`='',`ScriptName`='npc_enslaved_proto_drake' WHERE `entry`=24083; -- Proto drake non heroic +UPDATE `creature_template` SET `InhabitType`=3 WHERE `entry` IN (24849,31676); -- Proto drake rider + +-- Waypoints for core script +DELETE FROM `waypoint_data` WHERE `id`=125946; +INSERT INTO `waypoint_data`(`id`,`point`,`position_x`,`position_y`,`position_z`,`move_flag`) VALUES +(125946,1,210.92,-185.92,203.729,1), +(125946,2,215.397,-181.239,205.773,1), +(125946,3,219.674,-176.469,202.97,1), +(125946,4,223.183,-172.761,200.058,1), +(125946,5,228.007,-168.952,196.713,1), +(125946,6,230.514,-167.104,195.116,1), +(125946,7,235.687,-163.455,192.13,1), +(125946,8,239.569,-161.025,190.346,1); + +-- Mount the rider to the drake +DELETE FROM `vehicle_template_accessory` WHERE `entry`=24083; +INSERT INTO `vehicle_template_accessory`(`entry`,`accessory_entry`,`seat_id`,`minion`,`description`,`summontype`,`summontimer`) VALUES +(24083,24849,0,0,'Proto Drake Rider mounted to Enslaved Proto Drake',6,30000); + +-- Create required spellclick information +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=24083; +INSERT INTO `npc_spellclick_spells`(`npc_entry`,`spell_id`,`cast_flags`) VALUES +(24083,55074,1); + +-- Remove no longer needed data +DELETE FROM `creature` WHERE `guid`=125912 AND `map`=574 AND `id`=24849; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=24083; -- cgit v1.2.3 From a2748fde4b6b4ddb042264cd50f1f522a148daec Mon Sep 17 00:00:00 2001 From: Gacko Date: Sat, 10 Nov 2012 17:52:23 +0100 Subject: Core/DB: Utgarde Keep - Corrections --- sql/updates/world/2012_09_22_00_world_utgarde.sql | 39 ---------------------- sql/updates/world/2012_11_10_00_world_utgarde.sql | 38 +++++++++++++++++++++ .../UtgardeKeep/UtgardeKeep/utgarde_keep.cpp | 32 +++++++++--------- 3 files changed, 54 insertions(+), 55 deletions(-) create mode 100644 sql/updates/world/2012_11_10_00_world_utgarde.sql (limited to 'sql') diff --git a/sql/updates/world/2012_09_22_00_world_utgarde.sql b/sql/updates/world/2012_09_22_00_world_utgarde.sql index 830734db247..4b825636b9d 100644 --- a/sql/updates/world/2012_09_22_00_world_utgarde.sql +++ b/sql/updates/world/2012_09_22_00_world_utgarde.sql @@ -102,42 +102,3 @@ INSERT INTO `waypoint_data`(`id`,`point`,`position_x`,`position_y`,`position_z`) INSERT INTO `waypoint_data`(`id`,`point`,`position_x`,`position_y`,`position_z`) SELECT `guid`*10,2,`position_x`,`position_y`,`position_z` FROM `creature` WHERE `guid` IN (125940,125934,125915,125920,125914,125936,125937,125922); - --- Areatrigger script -DELETE FROM `areatrigger_scripts` WHERE `entry`=4838; -INSERT INTO `areatrigger_scripts`(`entry`,`ScriptName`) VALUES -(4838,'SmartTrigger'); - -DELETE FROM `smart_scripts` WHERE `entryorguid`=4838 AND `source_type`=2; -INSERT INTO `smart_scripts`(`entryorguid`,`source_type`,`event_type`,`event_param1`,`action_type`,`action_param1`,`action_param2`,`target_type`,`target_param1`,`comment`) VALUES -(4838,2,46,4838,45,28,6,10,125946,'Areatrigger in Utgarde Keep near Ingvar - On trigger - Set data of Enslaved Proto Drake'); - --- Template updates for proto drake and rider -UPDATE `creature_template` SET `AIName`='',`ScriptName`='npc_enslaved_proto_drake' WHERE `entry`=24083; -- Proto drake non heroic -UPDATE `creature_template` SET `InhabitType`=3 WHERE `entry` IN (24849,31676); -- Proto drake rider - --- Waypoints for core script -DELETE FROM `waypoint_data` WHERE `id`=125946; -INSERT INTO `waypoint_data`(`id`,`point`,`position_x`,`position_y`,`position_z`,`move_flag`) VALUES -(125946,1,210.92,-185.92,203.729,1), -(125946,2,215.397,-181.239,205.773,1), -(125946,3,219.674,-176.469,202.97,1), -(125946,4,223.183,-172.761,200.058,1), -(125946,5,228.007,-168.952,196.713,1), -(125946,6,230.514,-167.104,195.116,1), -(125946,7,235.687,-163.455,192.13,1), -(125946,8,239.569,-161.025,190.346,1); - --- Mount the rider to the drake -DELETE FROM `vehicle_template_accessory` WHERE `entry`=24083; -INSERT INTO `vehicle_template_accessory`(`entry`,`accessory_entry`,`seat_id`,`minion`,`description`,`summontype`,`summontimer`) VALUES -(24083,24849,0,0,'Proto Drake Rider mounted to Enslaved Proto Drake',6,30000); - --- Create required spellclick information -DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=24083; -INSERT INTO `npc_spellclick_spells`(`npc_entry`,`spell_id`,`cast_flags`) VALUES -(24083,55074,1); - --- Remove no longer needed data -DELETE FROM `creature` WHERE `guid`=125912 AND `map`=574 AND `id`=24849; -DELETE FROM `creature_ai_scripts` WHERE `creature_id`=24083; diff --git a/sql/updates/world/2012_11_10_00_world_utgarde.sql b/sql/updates/world/2012_11_10_00_world_utgarde.sql new file mode 100644 index 00000000000..3ff985cb50b --- /dev/null +++ b/sql/updates/world/2012_11_10_00_world_utgarde.sql @@ -0,0 +1,38 @@ +-- Areatrigger script +DELETE FROM `areatrigger_scripts` WHERE `entry`=4838; +INSERT INTO `areatrigger_scripts`(`entry`,`ScriptName`) VALUES +(4838,'SmartTrigger'); + +DELETE FROM `smart_scripts` WHERE `entryorguid`=4838 AND `source_type`=2; +INSERT INTO `smart_scripts`(`entryorguid`,`source_type`,`event_type`,`event_param1`,`action_type`,`action_param1`,`action_param2`,`target_type`,`target_param1`,`comment`) VALUES +(4838,2,46,4838,45,28,6,10,125946,'Areatrigger in Utgarde Keep near Ingvar - On trigger - Set data of Enslaved Proto Drake'); + +-- Template updates for proto drake and rider +UPDATE `creature_template` SET `AIName`='',`ScriptName`='npc_enslaved_proto_drake' WHERE `entry`=24083; -- Proto drake non heroic +UPDATE `creature_template` SET `InhabitType`=3 WHERE `entry` IN (24849,31676); -- Proto drake rider + +-- Waypoints for core script +DELETE FROM `waypoint_data` WHERE `id`=125946; +INSERT INTO `waypoint_data`(`id`,`point`,`position_x`,`position_y`,`position_z`,`move_flag`) VALUES +(125946,1,210.92,-185.92,203.729,1), +(125946,2,215.397,-181.239,205.773,1), +(125946,3,219.674,-176.469,202.97,1), +(125946,4,223.183,-172.761,200.058,1), +(125946,5,228.007,-168.952,196.713,1), +(125946,6,230.514,-167.104,195.116,1), +(125946,7,235.687,-163.455,192.13,1), +(125946,8,239.569,-161.025,190.346,1); + +-- Mount the rider to the drake +DELETE FROM `vehicle_template_accessory` WHERE `entry`=24083; +INSERT INTO `vehicle_template_accessory`(`entry`,`accessory_entry`,`seat_id`,`minion`,`description`,`summontype`,`summontimer`) VALUES +(24083,24849,0,0,'Proto Drake Rider mounted to Enslaved Proto Drake',6,30000); + +-- Create required spellclick information +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=24083; +INSERT INTO `npc_spellclick_spells`(`npc_entry`,`spell_id`,`cast_flags`) VALUES +(24083,55074,1); + +-- Remove no longer needed data +DELETE FROM `creature` WHERE `guid`=125912 AND `map`=574 AND `id`=24849; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=24083; diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp index 01913dd1cd0..885cf410032 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp @@ -146,7 +146,7 @@ public: return near_f > 0 && near_f < 4 ? near_f : 0; } - void UpdateAI(const uint32 /*diff*/) + void UpdateAI(uint32 const /* diff */) { if (fm_Type == 0) fm_Type = GetForgeMasterType(); @@ -259,51 +259,51 @@ public: { npc_enslaved_proto_drakeAI(Creature* creature) : ScriptedAI(creature) { - setData = false; + _setData = false; } void Reset() { - events.Reset(); - events.ScheduleEvent(EVENT_REND, urand(2000, 3000)); - events.ScheduleEvent(EVENT_FLAME_BREATH, urand(5500, 7000)); - events.ScheduleEvent(EVENT_KNOCKAWAY, urand(3500, 6000)); + _events.Reset(); + _events.ScheduleEvent(EVENT_REND, urand(2000, 3000)); + _events.ScheduleEvent(EVENT_FLAME_BREATH, urand(5500, 7000)); + _events.ScheduleEvent(EVENT_KNOCKAWAY, urand(3500, 6000)); } void SetData(uint32 type, uint32 data) { - if (type == TYPE_PROTODRAKE_AT && data == DATA_PROTODRAKE_MOVE && !setData && me->GetDistance(protodrakeCheckPos) < 5.0f) + if (type == TYPE_PROTODRAKE_AT && data == DATA_PROTODRAKE_MOVE && !_setData && me->GetDistance(protodrakeCheckPos) < 5.0f) { - setData = true; + _setData = true; me->GetMotionMaster()->MovePath(PATH_PROTODRAKE, false); } } - void UpdateAI(const uint32 diff) + void UpdateAI(uint32 const diff) { if (!UpdateVictim()) return; - events.Update(diff); + _events.Update(diff); if (me->HasUnitState(UNIT_STATE_CASTING)) return; - while (uint32 eventid = events.ExecuteEvent()) + while (uint32 eventid = _events.ExecuteEvent()) { switch (eventid) { case EVENT_REND: DoCast(SPELL_REND); - events.ScheduleEvent(EVENT_REND, urand(15000, 20000)); + _events.ScheduleEvent(EVENT_REND, urand(15000, 20000)); break; case EVENT_FLAME_BREATH: DoCast(SPELL_FLAME_BREATH); - events.ScheduleEvent(EVENT_FLAME_BREATH, urand(11000, 12000)); + _events.ScheduleEvent(EVENT_FLAME_BREATH, urand(11000, 12000)); break; case EVENT_KNOCKAWAY: DoCast(SPELL_KNOCK_AWAY); - events.ScheduleEvent(EVENT_KNOCKAWAY, urand(7000, 8500)); + _events.ScheduleEvent(EVENT_KNOCKAWAY, urand(7000, 8500)); break; default: break; @@ -314,8 +314,8 @@ public: } private: - bool setData; - EventMap events; + bool _setData; + EventMap _events; }; -- cgit v1.2.3 From 5126c0ad8ba2ba18866226ad7829f4301c90d4b6 Mon Sep 17 00:00:00 2001 From: Gacko Date: Sun, 11 Nov 2012 18:43:04 +0100 Subject: Core/DB: Utgarde Keep - Proto Drake --- sql/updates/world/2012_11_10_00_world_utgarde.sql | 2 +- .../Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'sql') diff --git a/sql/updates/world/2012_11_10_00_world_utgarde.sql b/sql/updates/world/2012_11_10_00_world_utgarde.sql index 3ff985cb50b..90c9cd80b83 100644 --- a/sql/updates/world/2012_11_10_00_world_utgarde.sql +++ b/sql/updates/world/2012_11_10_00_world_utgarde.sql @@ -9,7 +9,7 @@ INSERT INTO `smart_scripts`(`entryorguid`,`source_type`,`event_type`,`event_para -- Template updates for proto drake and rider UPDATE `creature_template` SET `AIName`='',`ScriptName`='npc_enslaved_proto_drake' WHERE `entry`=24083; -- Proto drake non heroic -UPDATE `creature_template` SET `InhabitType`=3 WHERE `entry` IN (24849,31676); -- Proto drake rider +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry` IN (24849,31676); -- Proto drake rider -- Waypoints for core script DELETE FROM `waypoint_data` WHERE `id`=125946; diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp index 885cf410032..a982032e0ee 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp @@ -246,6 +246,8 @@ enum EnslavedProtoDrake SPELL_REND = 43931, SPELL_FLAME_BREATH = 50653, SPELL_KNOCK_AWAY = 49722, + + POINT_LAST = 5, }; const Position protodrakeCheckPos = { 206.24f, -190.28f, 200.11f }; @@ -270,11 +272,20 @@ public: _events.ScheduleEvent(EVENT_KNOCKAWAY, urand(3500, 6000)); } + void MovementInform(uint32 type, uint32 id) + { + if (type == WAYPOINT_MOTION_TYPE && id == POINT_LAST) + { + me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER); + } + } + void SetData(uint32 type, uint32 data) { if (type == TYPE_PROTODRAKE_AT && data == DATA_PROTODRAKE_MOVE && !_setData && me->GetDistance(protodrakeCheckPos) < 5.0f) { _setData = true; + me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER); me->GetMotionMaster()->MovePath(PATH_PROTODRAKE, false); } } -- cgit v1.2.3