From e2c18bbb4e3c28ec6167d95a96df468b30ebdba4 Mon Sep 17 00:00:00 2001 From: Filip Date: Wed, 4 Sep 2013 12:23:48 +0200 Subject: DB/SAI: Putting Olakin Back Together Again (13220) --- sql/updates/world/2013_09_04_00_world_sai.sql | 52 +++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 sql/updates/world/2013_09_04_00_world_sai.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_04_00_world_sai.sql b/sql/updates/world/2013_09_04_00_world_sai.sql new file mode 100644 index 00000000000..a4614deca75 --- /dev/null +++ b/sql/updates/world/2013_09_04_00_world_sai.sql @@ -0,0 +1,52 @@ +-- Putting Olakin Back Together Again (13220) +SET @QUEST := 13220; +SET @NPC_OLAKIN := 31235; -- Crusader Olakin Sainrith +SET @GO_CLEAVER := 193092; -- The Doctor's Cleaver +SET @GO_SPOOL := 193091; -- Spool of Thread +SET @EVENT_SCRIPT := 20269; -- Event from 58856 Reanimate Crusader Olakin +SET @SPELL_FD := 35356; -- Feign Death +SET @SPELL_FAKE_BLOOD := 37692; -- Fake Blood Spurt +SET @SPELL_RESURRECTION := 58854; -- Resurrection + +DELETE FROM `gameobject` WHERE `id` IN (@GO_CLEAVER,@GO_SPOOL); +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +(16974,@GO_SPOOL,571,1,1,6668.17,3268.54,669.539,2.54818,0,0,0.956304,0.292373,120,255, 1), +(16976,@GO_CLEAVER,571,1,1,6601.1,3147.78,666.916,-2.77507,0,0,-0.983254,0.182238,120,255,1); + +DELETE FROM `event_scripts` WHERE `id`=@EVENT_SCRIPT; +INSERT INTO `event_scripts` (`id`,`delay`,`command`,`datalong`,`datalong2`,`dataint`,`x`,`y`,`z`,`o`) VALUES +(@EVENT_SCRIPT,0,10,@NPC_OLAKIN,60000,0,6636.792,3211.102,668.6439,0.8901179); + +DELETE FROM `creature_template_addon` WHERE `entry`=@NPC_OLAKIN; +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`auras`) VALUES +(@NPC_OLAKIN,0,0x0,0x1,'35356'); -- 31235 - 35356 + +DELETE FROM `creature_text` WHERE `entry`=@NPC_OLAKIN; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@NPC_OLAKIN,0,0,'Thank the Light for granting me another chance. And thank you, $N.',12,0,100,1,0,0,'Crusader Olakin Sainrith'), +(@NPC_OLAKIN,1,0,'Without your help, I would''ve been doomed to a life of undeath among the Lich King''s gruesome creations.', 12,0,100,1,0,0,'Crusader Olakin Sainrith'), +(@NPC_OLAKIN,2,0,'There will be time for a proper thanks later, but there is still a battle to be fought!', 12,0,100,25,0,0,'Crusader Olakin Sainrith'); + +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@NPC_OLAKIN; +DELETE FROM `smart_scripts` WHERE (`source_type`=0 AND `entryorguid`=@NPC_OLAKIN) OR (`source_type`=9 AND `entryorguid`=@NPC_OLAKIN*100); +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 +(@NPC_OLAKIN,0,0,0,54,0,100,0,0,0,0,0,80,@NPC_OLAKIN*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crusader Olakin Sainrith - On Just summoned - Run Script'), +(@NPC_OLAKIN,0,1,0,40,0,100,0,3,0,0,0,41,1000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crusader Olakin Sainrith - On WP Reached - Despawn'), +-- 17,26 +(@NPC_OLAKIN*100,9,0,0,0,0,100,0,2000,2000,0,0,11,@SPELL_FAKE_BLOOD,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crusader Olakin Sainrith - On Script - Cast Spell'), +(@NPC_OLAKIN*100,9,1,0,0,0,100,0,2000,2000,0,0,11,@SPELL_RESURRECTION,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crusader Olakin Sainrith - On Script - Cast Spell'), +(@NPC_OLAKIN*100,9,2,0,0,0,100,0,0,0,0,0,28,@SPELL_FD,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crusader Olakin Sainrith - On Script - Remove Aura'), +(@NPC_OLAKIN*100,9,3,0,0,0,100,0,0,0,0,0,96,32,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crusader Olakin Sainrith - On Script - Remove dynamic flag'), +(@NPC_OLAKIN*100,9,4,0,0,0,100,0,1000,1000,0,0,19,1,1,0,0,0,0,1,0,0,0,0,0,0,0,'Crusader Olakin Sainrith - On Script - Remove Unit Flag_2 1 {dead)'), +(@NPC_OLAKIN*100,9,5,0,0,0,100,0,4000,4000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crusader Olakin Sainrith - On Script - Say 0'), +(@NPC_OLAKIN*100,9,6,0,0,0,100,0,4000,4000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crusader Olakin Sainrith - On Script - Say 1'), +(@NPC_OLAKIN*100,9,7,0,0,0,100,0,4000,4000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crusader Olakin Sainrith - On Script - Say 2'), +(@NPC_OLAKIN*100,9,8,0,0,0,100,0,3000,3000,0,0,33,@NPC_OLAKIN,0,0,0,0,0,17,0,30,0,0,0,0,0,'Crusader Olakin Sainrith - On Script - Quest Credit'), +(@NPC_OLAKIN*100,9,9,0,0,0,100,0,0,0,0,0,53,1,@NPC_OLAKIN,0,0,0,0,1,0,0,0,0,0,0,0,'Crusader Olakin Sainrith - On Script -Start WP movement'); + +DELETE FROM `waypoints` WHERE entry =@NPC_OLAKIN; +INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES +(@NPC_OLAKIN, 1, 6632.227, 3223.6350, 666.7750,'Olakin'), +(@NPC_OLAKIN, 2, 6624.2558, 3230.2343, 666.857, 'Olakin'), +(@NPC_OLAKIN, 3, 6608.985, 3234.5588, 668.779, 'Olakin'); + -- cgit v1.2.3 From 825cda90015d15c421990991506b403ff3c3576b Mon Sep 17 00:00:00 2001 From: Filip Date: Wed, 4 Sep 2013 12:57:12 +0200 Subject: DB/SAI: A Cleansing Song AI --- sql/updates/world/2013_09_04_01_world_sai.sql | 41 +++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 sql/updates/world/2013_09_04_01_world_sai.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_04_01_world_sai.sql b/sql/updates/world/2013_09_04_01_world_sai.sql new file mode 100644 index 00000000000..9d9412b87e7 --- /dev/null +++ b/sql/updates/world/2013_09_04_01_world_sai.sql @@ -0,0 +1,41 @@ +-- A Cleansing Song (12735) +SET @KOOSU := 29034; +SET @HA_KHALAN := 29018; +SET @ATHA := 29033; + +-- Spirit of Koosu +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@KOOSU; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@KOOSU; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@KOOSU; +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 +(@KOOSU,0,0,0,4,0,100,1,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Spirit of Koosu - Set Phase 1 - on Aggro'), +(@KOOSU,0,1,0,4,1,100,1,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Spirit of Koosu - Stop Moving - on Aggro'), +(@KOOSU,0,2,0,4,1,100,1,0,0,0,0,11,21971,0,0,0,0,0,2,0,0,0,0,0,0,0,'Spirit of Koosu - Cast bolt - on Aggro'), +(@KOOSU,0,3,0,9,1,100,0,5,30,3500,4100,11,21971,0,0,0,0,0,2,0,0,0,0,0,0,0,'Spirit of Koosu - Cast bolt - In Range'), +(@KOOSU,0,4,0,9,1,100,0,30,100,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Spirit of Koosu - Start Moving - When not in bolt Range'), +(@KOOSU,0,5,0,9,1,100,0,9,15,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Spirit of Koosu - Stop Moving - 15 Yards'), +(@KOOSU,0,6,0,9,1,100,0,0,5,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Spirit of Koosu - Start Moving - when not in bolt Range'), +(@KOOSU,0,7,0,9,1,100,0,5,30,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Spirit of Koosu - Stop Moving - when in bolt Range'); + +-- Spirit of Ha-Khalan +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@HA_KHALAN; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@HA_KHALAN; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@HA_KHALAN; +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 +(@HA_KHALAN,0,0,0,0,0,100,0,1000,1000,125000,125000,11,50502,0,0,0,0,0,1,0,0,0,0,0,0,0,'Spirit of Ha-Khalan - IC - Cast Thick Hide'), +(@HA_KHALAN,0,1,0,0,0,100,0,5000,10000,12000,16000,11,34370,0,0,0,0,0,2,0,0,0,0,0,0,0,'Spirit of Ha-Khalan - IC - Cast Jagged Tooth Snap'), +(@HA_KHALAN,0,2,0,0,0,100,0,3000,5000,7000,11000,11,48287,0,0,0,0,0,2,0,0,0,0,0,0,0,'Spirit of Ha-Khalan - IC - Cast Powerful Bite'); + +-- Spirit of Atha +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ATHA; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ATHA; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ATHA; +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 +(@ATHA,0,0,0,0,0,100,0,8000,13000,12000,16000,11,21790,0,0,0,0,0,1,0,0,0,0,0,0,0,'Spirit of Atha - IC - Cast Aqua Jet'), +(@ATHA,0,1,0,0,0,100,0,2000,4000,5000,7000,11,3391,0,0,0,0,0,1,0,0,0,0,0,0,0,'Spirit of Atha - IC - Cast Thrash'); + +UPDATE `creature_template` SET `unit_flags`=`unit_flags`|8 WHERE `entry`=29018; -- Spirit of Ha-Khalan +-- Addon data for creature 29018 (Spirit of Ha-Khalan) +DELETE FROM `creature_template_addon` WHERE `entry`=29018; +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(29018,0,0,1,0,''); -- Spirit of Ha-Khalan -- cgit v1.2.3 From 0e80c9ea4867dd9c0ba2a00a771eab1bcdabd773 Mon Sep 17 00:00:00 2001 From: Filip Date: Wed, 4 Sep 2013 14:11:58 +0200 Subject: DB/Spawns: Spawns & AI for Corpulent Horrors --- .../world/2013_09_04_02_world_spawns_sai.sql | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 sql/updates/world/2013_09_04_02_world_spawns_sai.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_04_02_world_spawns_sai.sql b/sql/updates/world/2013_09_04_02_world_spawns_sai.sql new file mode 100644 index 00000000000..40e238d04a2 --- /dev/null +++ b/sql/updates/world/2013_09_04_02_world_spawns_sai.sql @@ -0,0 +1,38 @@ +-- Corpulen Horror spawns in area The Fleshwerks +SET @CGUID = 127272; + +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=30696; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=30696; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=30696; +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 +(30696,0,0,0,9,0,100,0,8,40,3500,4100,11,50335,0,0,0,0,0,2,0,0,0,0,0,0,0,'Corpulent Horror - Cast Scourge Hook - In Range'); + +DELETE FROM `creature_template_addon` WHERE `entry`=30696; +INSERT INTO `creature_template_addon` (`entry`, `mount`, `bytes1`, `bytes2`, `auras`) VALUES +(30696, 0, 0x0, 0x1, ''); -- Corpulent Horror + +UPDATE `creature_template` SET `faction_A`=2102, `faction_H`=2102, `speed_walk`=1.142857, `speed_run`=1, `rangeattacktime`=2000, `unit_flags`=32768, `dynamicflags`=0 WHERE `entry`=30696; -- Corpulent Horror +DELETE FROM `creature` WHERE `id` = 30696; +INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES +(@CGUID+0, 30696, 571, 1, 1, 0, 0, 6975.386, 3462.006, 710.9403, 6.126106, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks) +(@CGUID+1, 30696, 571, 1, 1, 0, 0, 6982.377, 3478.588, 710.9403, 5.811946, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks) +(@CGUID+2, 30696, 571, 1, 1, 0, 0, 6920.697, 3446.544, 710.2005, 3.097477, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks) +(@CGUID+3, 30696, 571, 1, 1, 0, 0, 6932.927, 3502.471, 705.0461, 3.281219, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks) +(@CGUID+4, 30696, 571, 1, 1, 0, 0, 6903.668, 3478.428, 700.0414, 3.093731, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks) +(@CGUID+5, 30696, 571, 1, 1, 0, 0, 6895.87, 3460.794, 700.7824, 1.592374, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks) +(@CGUID+6, 30696, 571, 1, 1, 0, 0, 6868.874, 3435.562, 705.6059, 1.542484, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks) +(@CGUID+7, 30696, 571, 1, 1, 0, 0, 6869.054, 3493.792, 695.7783, 5.440073, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks) +(@CGUID+8, 30696, 571, 1, 1, 0, 0, 6875.154, 3513.065, 698.8162, 3.944444, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks) +(@CGUID+9, 30696, 571, 1, 1, 0, 0, 6836.296, 3505.824, 690.3577, 0.5061455, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks) +(@CGUID+10, 30696, 571, 1, 1, 0, 0, 6823.636, 3484.259, 688.4615, 6.278303, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks) +(@CGUID+11, 30696, 571, 1, 1, 0, 0, 6729.185, 3433.822, 682.3103, 2.64319, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks) +(@CGUID+12, 30696, 571, 1, 1, 0, 0, 6676.063, 3349.062, 704.616, 2.582512, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks) +(@CGUID+13, 30696, 571, 1, 1, 0, 0, 6699.958, 3422.957, 679.4948, 3.363122, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks) +(@CGUID+14, 30696, 571, 1, 1, 0, 0, 6548.099, 3309.558, 665.8171, 2.951326, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks) +(@CGUID+15, 30696, 571, 1, 1, 0, 0, 6535.431, 3322.088, 664.9422, 5.877358, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks) +(@CGUID+16, 30696, 571, 1, 1, 0, 0, 6530.748, 3296.081, 664.9409, 3.446935, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks) +(@CGUID+17, 30696, 571, 1, 1, 0, 0, 6534.971, 3260.271, 666.9742, 0.2021571, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks) +(@CGUID+18, 30696, 571, 1, 1, 0, 0, 6477.204, 3257.901, 643.6331, 3.804818, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks) +(@CGUID+19, 30696, 571, 1, 1, 0, 0, 6488.242, 3194.719, 652.9039, 1.48353, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks) +(@CGUID+20, 30696, 571, 1, 1, 0, 0, 6412.273, 3236.912, 640.3326, 0.7460284, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks +(@CGUID+21, 30696, 571, 1, 1, 0, 0, 6413.427, 3218.029, 638.4678, 0.122173, 120, 0, 0, 0, 0, 0, 0, 0, 0); -- Corpulent Horror (Area: The Fleshwerks) -- cgit v1.2.3 From 7ef1f0738be5a063602ec75162626da34e4ecbcf Mon Sep 17 00:00:00 2001 From: joschiwald Date: Thu, 5 Sep 2013 00:59:22 +0200 Subject: Core/Battlegrounds/IoC: fix fortress teleport pads (and replace a hack with an other hack) Closes #5846 Closes #7993 Ref #8984 --- .../world/2013_09_04_03_world_isle_of_conquest.sql | 26 ++++++++++++++++++++++ src/server/game/Spells/SpellEffects.cpp | 23 ------------------- src/server/game/Spells/SpellMgr.cpp | 8 +++++++ src/server/scripts/Spells/spell_quest.cpp | 4 +--- 4 files changed, 35 insertions(+), 26 deletions(-) create mode 100644 sql/updates/world/2013_09_04_03_world_isle_of_conquest.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_04_03_world_isle_of_conquest.sql b/sql/updates/world/2013_09_04_03_world_isle_of_conquest.sql new file mode 100644 index 00000000000..471ee3adefb --- /dev/null +++ b/sql/updates/world/2013_09_04_03_world_isle_of_conquest.sql @@ -0,0 +1,26 @@ +DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (66548,66549,66550,66551); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (66550,66551); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,1,66550,0,0,31,0,3,22515,0,0,0,0,'','Isle of Conquest - Teleport Fortress Out'), +(13,1,66550,0,0,35,0,1,10,1,0,0,0,'','Isle of Conquest - Teleport Fortress Out'), +(13,1,66551,0,0,31,0,3,22515,0,0,0,0,'','Isle of Conquest - Teleport Fortress In'), +(13,1,66551,0,0,35,0,1,10,1,0,0,0,'','Isle of Conquest - Teleport Fortress In'); + +SET @CGUID := 90179; +DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+13; +INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `MovementType`) VALUES +(@CGUID+0, 22515, 628, 3, 1, 392.4965, -859.4583, 48.99871, 3.036873, 7200, 0, 0), -- A IN +(@CGUID+1, 22515, 628, 3, 1, 313.2344, -918.0452, 48.85597, 4.869469, 7200, 0, 0), -- A OUT +(@CGUID+2, 22515, 628, 3, 1, 279.8698, -832.8073, 51.55094, 0, 7200, 0, 0), -- A CENTER +(@CGUID+3, 22515, 628, 3, 1, 323.4965, -883.8021, 48.99959, 1.466077, 7200, 0, 0), -- A IN +(@CGUID+4, 22515, 628, 3, 1, 430.6007, -857.0052, 48.31177, 0.1396263, 7200, 0, 0), -- A OUT +(@CGUID+5, 22515, 628, 3, 1, 325.9167, -781.8993, 49.00521, 4.590216, 7200, 0, 0), -- A IN +(@CGUID+6, 22515, 628, 3, 1, 326.2135, -744.0243, 49.43576, 1.308997, 7200, 0, 0), -- A OUT +(@CGUID+7, 22515, 628, 3, 1, 1139.498, -779.4739, 48.73496, 3.001966, 7200, 0, 0), -- H OUT +(@CGUID+8, 22515, 628, 3, 1, 1162.913, -745.908, 48.71506, 0.1396263, 7200, 0, 0), -- H IN +(@CGUID+9, 22515, 628, 3, 1, 1234.304, -688.2986, 49.22296, 4.677482, 7200, 0, 0), -- H IN +(@CGUID+10, 22515, 628, 3, 1, 1232.524, -666.3246, 48.13402, 2.303835, 7200, 0, 0), -- H OUT +(@CGUID+11, 22515, 628, 3, 1, 1233.106, -838.316, 48.99958, 1.466077, 7200, 0, 0), -- H IN +(@CGUID+12, 22515, 628, 3, 1, 1232.387, -861.0243, 48.99959, 3.560472, 7200, 0, 0), -- H OUT +(@CGUID+13, 22515, 628, 3, 1, 1296.526, -766.1823, 50.70293, 3.089233, 7200, 0, 0); -- H CENTER diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 91a5c35955a..45a07fee945 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1133,29 +1133,6 @@ void Spell::EffectTeleportUnits(SpellEffIndex /*effIndex*/) if (!unitTarget || unitTarget->IsInFlight()) return; - // Pre effects - switch (m_spellInfo->Id) - { - case 66550: // teleports outside (Isle of Conquest) - if (Player* target = unitTarget->ToPlayer()) - { - if (target->GetTeamId() == TEAM_ALLIANCE) - m_targets.SetDst(442.24f, -835.25f, 44.30f, 0.06f, 628); - else - m_targets.SetDst(1120.43f, -762.11f, 47.92f, 2.94f, 628); - } - break; - case 66551: // teleports inside (Isle of Conquest) - if (Player* target = unitTarget->ToPlayer()) - { - if (target->GetTeamId() == TEAM_ALLIANCE) - m_targets.SetDst(389.57f, -832.38f, 48.65f, 3.00f, 628); - else - m_targets.SetDst(1174.85f, -763.24f, 48.72f, 6.26f, 628); - } - break; - } - // If not exist data for dest location - return if (!m_targets.HasDst()) { diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 5d471492553..bc5f8edc9ac 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -2975,6 +2975,7 @@ void SpellMgr::LoadSpellInfoCustomAttributes() spellInfo->AttributesCu |= SPELL_ATTR0_CU_NEGATIVE_EFF0; break; case 38729: // Rod of Purification + case 51858: // Siphon of Acherus spellInfo->AttributesCu |= SPELL_ATTR0_CU_TRIGGERED_BY_CASTER; break; default: @@ -3750,6 +3751,13 @@ void SpellMgr::LoadSpellInfoCorrections() // Crashes client on pressing ESC spellInfo->AttributesEx4 &= ~SPELL_ATTR4_TRIGGERED; break; + // ISLE OF CONQUEST SPELLS + // + case 66551: // Teleport + spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(13); // 50000yd + break; + // ENDOF ISLE OF CONQUEST SPELLS + // default: break; } diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 8804410d814..919046d3c38 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -2072,8 +2072,6 @@ class spell_q12641_death_comes_from_on_high : public SpellScriptLoader { uint32 spellId = 0; - TC_LOG_DEBUG(LOG_FILTER_SPELLS_AURAS, "spell_q12641_death_comes_from_on_high:: Caster: %s (GUID: %u) On Hit Target: Creature: %s (Entry: %u GUID: %u)", - GetOriginalCaster()->GetName().c_str(), GetOriginalCaster()->GetGUIDLow(), GetHitCreature()->GetName().c_str(), GetHitCreature()->GetEntry(), GetHitCreature()->GetGUIDLow()); switch (GetHitCreature()->GetEntry()) { case NPC_NEW_AVALON_FORGE: @@ -2092,7 +2090,7 @@ class spell_q12641_death_comes_from_on_high : public SpellScriptLoader return; } - GetOriginalCaster()->CastSpell((Unit*)NULL, spellId, true); + GetCaster()->CastSpell((Unit*)NULL, spellId, true); } void Register() OVERRIDE -- cgit v1.2.3 From b9347dc1f7d2bbd5e6224072de3f8ded9df33348 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Fri, 6 Sep 2013 11:29:46 +0200 Subject: DB/Misc: Fix few startup errors --- sql/updates/world/2013_09_06_00_world_misc.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/updates/world/2013_09_06_00_world_misc.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_06_00_world_misc.sql b/sql/updates/world/2013_09_06_00_world_misc.sql new file mode 100644 index 00000000000..872dc840a8b --- /dev/null +++ b/sql/updates/world/2013_09_06_00_world_misc.sql @@ -0,0 +1,4 @@ +-- Fix few startup errors +UPDATE `smart_scripts` SET `event_param3`=12555 WHERE `entryorguid`=27727 AND `source_type`=0 AND `id`=2 AND `link`=0; +DELETE FROM `creature_addon` WHERE `guid`=66177; +DELETE FROM `waypoint_data` WHERE `id`=661770; -- cgit v1.2.3 From adef15cd0f0b80d618fd7c0d9094f95940ab1c52 Mon Sep 17 00:00:00 2001 From: joschiwald Date: Fri, 6 Sep 2013 20:57:38 +0200 Subject: Core/Spells: add an other condition to SpellInfo::NeedsToBeTriggeredByCaster to correct spells with are wrongly triggered by target instead of caster - convert archavons rock shards to spellscript (now it works properly) - add a spellscript for one spell that can't be corrected by this (and delete the sai hack, now i uses the correct spell) --- sql/updates/world/2013_09_06_01_world_misc.sql | 13 +++++ src/server/game/Spells/Auras/SpellAuraEffects.cpp | 10 ++-- src/server/game/Spells/SpellEffects.cpp | 28 ++--------- src/server/game/Spells/SpellInfo.cpp | 20 ++++++-- src/server/game/Spells/SpellInfo.h | 3 +- src/server/game/Spells/SpellMgr.cpp | 4 -- .../Northrend/VaultOfArchavon/boss_archavon.cpp | 52 +++++++++++++++++++- src/server/scripts/Spells/spell_quest.cpp | 57 ++++++++++++++++++++++ 8 files changed, 147 insertions(+), 40 deletions(-) create mode 100644 sql/updates/world/2013_09_06_01_world_misc.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_06_01_world_misc.sql b/sql/updates/world/2013_09_06_01_world_misc.sql new file mode 100644 index 00000000000..10533e8354c --- /dev/null +++ b/sql/updates/world/2013_09_06_01_world_misc.sql @@ -0,0 +1,13 @@ +DELETE FROM `smart_scripts` WHERE `entryorguid`=28481 AND `source_type`=0; +UPDATE `creature_template` SET `AIName`='' WHERE `entry`=28481; + +DELETE FROM `spell_script_names` WHERE `spell_id` IN (51769,51770,58941); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(51769,'spell_q12619_emblazon_runeblade'), +(51770,'spell_q12619_emblazon_runeblade_effect'), +(58941,'spell_archavon_rock_shards'); + +DELETE FROM `spelldifficulty_dbc` WHERE `id` IN (58695,58696); +INSERT INTO `spelldifficulty_dbc`(`id`,`spellid0`,`spellid1`) VALUES +(58695,58695,60883), +(58696,58696,60884); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 3d55d9de16f..ff4a3b5ca71 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -5113,7 +5113,7 @@ void AuraEffect::HandleAuraLinked(AuraApplication const* aurApp, uint8 mode, boo { if (apply) { - Unit* caster = triggeredSpellInfo->NeedsToBeTriggeredByCaster() ? GetCaster() : target; + Unit* caster = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo) ? GetCaster() : target; if (!caster) return; @@ -5125,13 +5125,13 @@ void AuraEffect::HandleAuraLinked(AuraApplication const* aurApp, uint8 mode, boo } else { - uint64 casterGUID = triggeredSpellInfo->NeedsToBeTriggeredByCaster() ? GetCasterGUID() : target->GetGUID(); + uint64 casterGUID = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo) ? GetCasterGUID() : target->GetGUID(); target->RemoveAura(triggeredSpellId, casterGUID, 0, aurApp->GetRemoveMode()); } } else if (mode & AURA_EFFECT_HANDLE_REAPPLY && apply) { - uint64 casterGUID = triggeredSpellInfo->NeedsToBeTriggeredByCaster() ? GetCasterGUID() : target->GetGUID(); + uint64 casterGUID = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo) ? GetCasterGUID() : target->GetGUID(); // change the stack amount to be equal to stack amount of our aura if (Aura* triggeredAura = target->GetAura(triggeredSpellId, casterGUID)) triggeredAura->ModStackAmount(GetBase()->GetStackAmount() - triggeredAura->GetStackAmount()); @@ -5733,7 +5733,7 @@ void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster) if (triggeredSpellInfo) { - if (Unit* triggerCaster = triggeredSpellInfo->NeedsToBeTriggeredByCaster() ? caster : target) + if (Unit* triggerCaster = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo) ? caster : target) { triggerCaster->CastSpell(target, triggeredSpellInfo, true, NULL, this); TC_LOG_DEBUG(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandlePeriodicTriggerSpellAuraTick: Spell %u Trigger %u", GetId(), triggeredSpellInfo->Id); @@ -5753,7 +5753,7 @@ void AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick(Unit* target, Unit* uint32 triggerSpellId = GetSpellInfo()->Effects[m_effIndex].TriggerSpell; if (SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId)) { - if (Unit* triggerCaster = triggeredSpellInfo->NeedsToBeTriggeredByCaster() ? caster : target) + if (Unit* triggerCaster = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo) ? caster : target) { int32 basepoints = GetAmount(); triggerCaster->CastCustomSpell(target, triggerSpellId, &basepoints, &basepoints, &basepoints, true, 0, this); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 45a07fee945..edb2139bd46 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -917,13 +917,13 @@ void Spell::EffectTriggerSpell(SpellEffIndex effIndex) SpellCastTargets targets; if (effectHandleMode == SPELL_EFFECT_HANDLE_LAUNCH_TARGET) { - if (!spellInfo->NeedsToBeTriggeredByCaster()) + if (!spellInfo->NeedsToBeTriggeredByCaster(m_spellInfo)) return; targets.SetUnitTarget(unitTarget); } else //if (effectHandleMode == SPELL_EFFECT_HANDLE_LAUNCH) { - if (spellInfo->NeedsToBeTriggeredByCaster() && (m_spellInfo->Effects[effIndex].GetProvidedTargetMask() & TARGET_FLAG_UNIT_MASK)) + if (spellInfo->NeedsToBeTriggeredByCaster(m_spellInfo) && (m_spellInfo->Effects[effIndex].GetProvidedTargetMask() & TARGET_FLAG_UNIT_MASK)) return; if (spellInfo->GetExplicitTargetMask() & TARGET_FLAG_DEST_LOCATION) @@ -969,13 +969,13 @@ void Spell::EffectTriggerMissileSpell(SpellEffIndex effIndex) SpellCastTargets targets; if (effectHandleMode == SPELL_EFFECT_HANDLE_HIT_TARGET) { - if (!spellInfo->NeedsToBeTriggeredByCaster()) + if (!spellInfo->NeedsToBeTriggeredByCaster(m_spellInfo)) return; targets.SetUnitTarget(unitTarget); } else //if (effectHandleMode == SPELL_EFFECT_HANDLE_HIT) { - if (spellInfo->NeedsToBeTriggeredByCaster() && (m_spellInfo->Effects[effIndex].GetProvidedTargetMask() & TARGET_FLAG_UNIT_MASK)) + if (spellInfo->NeedsToBeTriggeredByCaster(m_spellInfo) && (m_spellInfo->Effects[effIndex].GetProvidedTargetMask() & TARGET_FLAG_UNIT_MASK)) return; if (spellInfo->GetExplicitTargetMask() & TARGET_FLAG_DEST_LOCATION) @@ -3962,26 +3962,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) return; } - case 58941: // Rock Shards - if (unitTarget && m_originalCaster) - { - for (uint32 i = 0; i < 3; ++i) - { - m_originalCaster->CastSpell(unitTarget, 58689, true); - m_originalCaster->CastSpell(unitTarget, 58692, true); - } - if (((InstanceMap*)m_originalCaster->GetMap())->GetDifficulty() == REGULAR_DIFFICULTY) - { - m_originalCaster->CastSpell(unitTarget, 58695, true); - m_originalCaster->CastSpell(unitTarget, 58696, true); - } - else - { - m_originalCaster->CastSpell(unitTarget, 60883, true); - m_originalCaster->CastSpell(unitTarget, 60884, true); - } - } - return; case 58983: // Big Blizzard Bear { if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 04437b82f2d..99242d622df 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1004,14 +1004,12 @@ bool SpellInfo::NeedsExplicitUnitTarget() const return GetExplicitTargetMask() & TARGET_FLAG_UNIT_MASK; } -bool SpellInfo::NeedsToBeTriggeredByCaster() const +bool SpellInfo::NeedsToBeTriggeredByCaster(SpellInfo const* triggeringSpell) const { - if (AttributesCu & SPELL_ATTR0_CU_TRIGGERED_BY_CASTER) - return true; - if (NeedsExplicitUnitTarget()) return true; + /* for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { if (Effects[i].IsEffect()) @@ -1021,6 +1019,20 @@ bool SpellInfo::NeedsToBeTriggeredByCaster() const return true; } } + */ + + if (triggeringSpell->IsChanneled()) + { + uint32 mask = 0; + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + { + if (Effects[i].TargetA.GetTarget() != TARGET_UNIT_CASTER && Effects[i].TargetA.GetTarget() != TARGET_DEST_CASTER) + mask |= Effects[i].GetProvidedTargetMask(); + } + + if (mask & TARGET_FLAG_UNIT_MASK) + return true; + } return false; } diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index 6acde5afa74..c2ca938d26f 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -176,7 +176,6 @@ enum SpellCustomAttributes SPELL_ATTR0_CU_CONE_LINE = 0x00000004, SPELL_ATTR0_CU_SHARE_DAMAGE = 0x00000008, SPELL_ATTR0_CU_NO_INITIAL_THREAT = 0x00000010, - SPELL_ATTR0_CU_TRIGGERED_BY_CASTER = 0x00000020, // @todo: need generic solution, some triggered spells will be casted by target instead of caster SPELL_ATTR0_CU_AURA_CC = 0x00000040, SPELL_ATTR0_CU_DIRECT_DAMAGE = 0x00000100, SPELL_ATTR0_CU_CHARGE = 0x00000200, @@ -386,7 +385,7 @@ public: bool IsAffectingArea() const; bool IsTargetingArea() const; bool NeedsExplicitUnitTarget() const; - bool NeedsToBeTriggeredByCaster() const; + bool NeedsToBeTriggeredByCaster(SpellInfo const* triggeringSpell) const; bool IsPassive() const; bool IsAutocastable() const; diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index bc5f8edc9ac..29a869cf458 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -2974,10 +2974,6 @@ void SpellMgr::LoadSpellInfoCustomAttributes() case 72293: // Mark of the Fallen Champion (Deathbringer Saurfang) spellInfo->AttributesCu |= SPELL_ATTR0_CU_NEGATIVE_EFF0; break; - case 38729: // Rod of Purification - case 51858: // Siphon of Acherus - spellInfo->AttributesCu |= SPELL_ATTR0_CU_TRIGGERED_BY_CASTER; - break; default: break; } diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp index e44e0ab0539..e57bc8659d9 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp @@ -27,9 +27,12 @@ enum Emotes enum Spells { - // Spells Archavon SPELL_ROCK_SHARDS = 58678, + SPELL_ROCK_SHARDS_VISUAL_L = 58689, + SPELL_ROCK_SHARDS_VISUAL_R = 58692, + SPELL_ROCK_SHARDS_DAMAGE_L = 58695, + SPELL_ROCK_SHARDS_DAMAGE_R = 58696, SPELL_CRUSHING_LEAP = 58960, SPELL_STOMP = 58663, SPELL_IMPALE = 58666, @@ -205,8 +208,55 @@ class npc_archavon_warder : public CreatureScript } }; +// 58941 - Rock Shards +class spell_archavon_rock_shards : public SpellScriptLoader +{ + public: + spell_archavon_rock_shards() : SpellScriptLoader("spell_archavon_rock_shards") { } + + class spell_archavon_rock_shards_SpellScript : public SpellScript + { + PrepareSpellScript(spell_archavon_rock_shards_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_ROCK_SHARDS_VISUAL_L) + || !sSpellMgr->GetSpellInfo(SPELL_ROCK_SHARDS_VISUAL_R) + || !sSpellMgr->GetSpellInfo(SPELL_ROCK_SHARDS_DAMAGE_L) + || !sSpellMgr->GetSpellInfo(SPELL_ROCK_SHARDS_DAMAGE_R)) + return false; + return true; + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + + for (uint8 i = 0; i < 3; ++i) + { + caster->CastSpell((Unit*)NULL, SPELL_ROCK_SHARDS_VISUAL_L, true); + caster->CastSpell((Unit*)NULL, SPELL_ROCK_SHARDS_VISUAL_R, true); + } + + caster->CastSpell((Unit*)NULL, SPELL_ROCK_SHARDS_DAMAGE_L, true); + caster->CastSpell((Unit*)NULL, SPELL_ROCK_SHARDS_DAMAGE_R, true); + } + + void Register() OVERRIDE + { + OnEffectHit += SpellEffectFn(spell_archavon_rock_shards_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const OVERRIDE + { + return new spell_archavon_rock_shards_SpellScript(); + } +}; + void AddSC_boss_archavon() { new boss_archavon(); new npc_archavon_warder(); + new spell_archavon_rock_shards(); } diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 919046d3c38..4c4fc366d64 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -2105,6 +2105,61 @@ class spell_q12641_death_comes_from_on_high : public SpellScriptLoader } }; +// 51769 - Emblazon Runeblade +class spell_q12619_emblazon_runeblade : public SpellScriptLoader +{ + public: + spell_q12619_emblazon_runeblade() : SpellScriptLoader("spell_q12619_emblazon_runeblade") { } + + class spell_q12619_emblazon_runeblade_AuraScript : public AuraScript + { + PrepareAuraScript(spell_q12619_emblazon_runeblade_AuraScript); + + void HandleEffectPeriodic(AuraEffect const* aurEff) + { + PreventDefaultAction(); + GetCaster()->CastSpell(GetCaster(), GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true); + } + + void Register() OVERRIDE + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_q12619_emblazon_runeblade_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_HEAL); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_q12619_emblazon_runeblade_AuraScript(); + } +}; + +// 51770 - Emblazon Runeblade +class spell_q12619_emblazon_runeblade_effect : public SpellScriptLoader +{ + public: + spell_q12619_emblazon_runeblade_effect() : SpellScriptLoader("spell_q12619_emblazon_runeblade_effect") { } + + class spell_q12619_emblazon_runeblade_effect_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q12619_emblazon_runeblade_effect_SpellScript); + + void HandleScript(SpellEffIndex /*effIndex*/) + { + GetCaster()->CastSpell(GetCaster(), uint32(GetEffectValue()), true); + } + + void Register() OVERRIDE + { + OnEffectHit += SpellEffectFn(spell_q12619_emblazon_runeblade_effect_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const OVERRIDE + { + return new spell_q12619_emblazon_runeblade_effect_SpellScript(); + } +}; + void AddSC_quest_spell_scripts() { new spell_q55_sacred_cleansing(); @@ -2155,4 +2210,6 @@ void AddSC_quest_spell_scripts() new spell_q12308_escape_from_silverbrook_summon_worgen(); new spell_q12308_escape_from_silverbrook(); new spell_q12641_death_comes_from_on_high(); + new spell_q12619_emblazon_runeblade(); + new spell_q12619_emblazon_runeblade_effect(); } -- cgit v1.2.3 From f66120060adf15d39c7a40fa9c4e501e024a6a21 Mon Sep 17 00:00:00 2001 From: joschiwald Date: Sat, 7 Sep 2013 01:21:36 +0200 Subject: Scripts/Spells: drop obsolete code --- sql/updates/world/2013_09_06_02_world_misc.sql | 4 ++++ src/server/game/Spells/SpellEffects.cpp | 9 --------- src/server/scripts/Spells/spell_quest.cpp | 7 ++++--- 3 files changed, 8 insertions(+), 12 deletions(-) create mode 100644 sql/updates/world/2013_09_06_02_world_misc.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_06_02_world_misc.sql b/sql/updates/world/2013_09_06_02_world_misc.sql new file mode 100644 index 00000000000..47ac870f977 --- /dev/null +++ b/sql/updates/world/2013_09_06_02_world_misc.sql @@ -0,0 +1,4 @@ +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=28481; +DELETE FROM `smart_scripts` WHERE `entryorguid`=28481 AND `source_type`=0; +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 +(28481, 0, 0, 0, 8, 0, 100, 0, 51769, 0, 0, 0, 11, 51738, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Runeforge (SE) - On Spellhit Emblazon Runeblade - Cast Shadow Storm'); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index edb2139bd46..98c188df08f 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -3879,15 +3879,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) npc->LoadEquipment(); return; } - // Emblazon Runeblade - case 51770: - { - if (!m_originalCaster) - return; - - m_originalCaster->CastSpell(m_originalCaster, damage, false); - break; - } // Deathbolt from Thalgran Blightbringer // reflected by Freya's Ward // Retribution by Sevenfold Retribution diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 85f655372c6..6b56c51d6e1 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -2118,12 +2118,13 @@ class spell_q12619_emblazon_runeblade : public SpellScriptLoader void HandleEffectPeriodic(AuraEffect const* aurEff) { PreventDefaultAction(); - GetCaster()->CastSpell(GetCaster(), GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true); + if (Unit* caster = GetCaster()) + caster->CastSpell(caster, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true, NULL, aurEff); } void Register() OVERRIDE { - OnEffectPeriodic += AuraEffectPeriodicFn(spell_q12619_emblazon_runeblade_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_HEAL); + OnEffectPeriodic += AuraEffectPeriodicFn(spell_q12619_emblazon_runeblade_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); } }; @@ -2145,7 +2146,7 @@ class spell_q12619_emblazon_runeblade_effect : public SpellScriptLoader void HandleScript(SpellEffIndex /*effIndex*/) { - GetCaster()->CastSpell(GetCaster(), uint32(GetEffectValue()), true); + GetCaster()->CastSpell(GetCaster(), uint32(GetEffectValue()), false); } void Register() OVERRIDE -- cgit v1.2.3 From 00f3e423a523ab306ca183f6500c56c19518ea7c Mon Sep 17 00:00:00 2001 From: Filip Date: Sat, 7 Sep 2013 19:03:12 +0200 Subject: DB/Updates: AI fixups By @Aokromes, fixes #10733 #10728 --- sql/updates/world/2013_09_07_00_world_updates.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 sql/updates/world/2013_09_07_00_world_updates.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_07_00_world_updates.sql b/sql/updates/world/2013_09_07_00_world_updates.sql new file mode 100644 index 00000000000..93999e6202a --- /dev/null +++ b/sql/updates/world/2013_09_07_00_world_updates.sql @@ -0,0 +1,6 @@ +-- Scourge Tactics +UPDATE `smart_scripts` SET `link`=1 WHERE `entryorguid`=30273 AND `id`=0; +UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=30273 AND `id`=1; +-- Abjurist Belmara & Conjurer Luminrath +UPDATE `smart_scripts` SET `target_type`=7 WHERE `entryorguid`=19546 AND `id`=2; +UPDATE `smart_scripts` SET `target_type`=7, `target_param1`=0 WHERE `entryorguid`=19580 AND `id`=2; -- cgit v1.2.3 From 7eddda990530d96fcee465fb0948cb238069a443 Mon Sep 17 00:00:00 2001 From: NaydSucks Date: Sat, 7 Sep 2013 21:22:22 +0200 Subject: DB/Sai: Teron Gorefiend, I am... Added horde version for the script also. --- sql/updates/world/2013_09_07_01_world_sai.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/updates/world/2013_09_07_01_world_sai.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_07_01_world_sai.sql b/sql/updates/world/2013_09_07_01_world_sai.sql new file mode 100644 index 00000000000..6afbe15f7b2 --- /dev/null +++ b/sql/updates/world/2013_09_07_01_world_sai.sql @@ -0,0 +1,4 @@ +-- Do not delete query id 0 +DELETE FROM `smart_scripts` WHERE `entryorguid` =21797 AND `source_type`=0 AND `id`>0; +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 +(21797, 0, 1, 0, 19, 0, 100, 0, 10645, 0, 0, 0, 80, 2179700, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ancient Shadowmoon Spirit - On Quest Accept - Run Script'); -- cgit v1.2.3 From 688a35e25dc70b000d87f128a631262768ed7cc9 Mon Sep 17 00:00:00 2001 From: Filip Date: Sun, 8 Sep 2013 17:57:12 +0200 Subject: DB/SAI: Trapping the Light Fantastic (10674) & Gather the Orbs (10859) Fixes #7202 Adds support for the Alliance quest also, and makes the orbs go in tandem with the horde version script. --- sql/updates/world/2013_09_08_00_world_sai.sql | 68 +++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 sql/updates/world/2013_09_08_00_world_sai.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_08_00_world_sai.sql b/sql/updates/world/2013_09_08_00_world_sai.sql new file mode 100644 index 00000000000..9a65ea92910 --- /dev/null +++ b/sql/updates/world/2013_09_08_00_world_sai.sql @@ -0,0 +1,68 @@ +-- Trapping the Light Fantastic (10674) & Gather the Orbs (10859) +SET @GOB_TRAP := 185011; -- Multi-Spectrum Light Trap +SET @NPC_BUNNY := 21926; -- Multi-Spectrum Light Trap Bunny +SET @ORB_TOTEM := 22333; -- Orb Collecting Totem +SET @NPC_CREDIT := 21929; -- Trapping the Light Kill Credit Trigger +SET @NPC_ORB1 := 20635; -- Razaani Light Orb +SET @NPC_ORB2 := 20771; -- Razaani Light Orb - Mini +SET @SPELL_PULL := 28337; -- Magnetic Pull +SET @ARC_EXPLOSION := 35426; -- Arcane Explosion + +DELETE FROM `creature_template_addon` WHERE `entry` IN (@NPC_ORB1,@NPC_ORB2); +INSERT INTO `creature_template_addon` (`entry`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(20635,0,0,0,4097,0,'32566'), +(20771,0,0,0,4097,0,'32566'); + +UPDATE `creature_template` SET `AIName`='SmartAI',`unit_flags`=unit_flags|0x02000000,`flags_extra`=130,`ScriptName`='' WHERE `entry` IN (@NPC_ORB1,@NPC_ORB2); +DELETE FROM `creature_ai_scripts` WHERE `creature_id` IN (@NPC_ORB1,@NPC_ORB2); +UPDATE `creature` SET `MovementType`=0 WHERE `id`=@NPC_ORB1; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@NPC_ORB1,@NPC_ORB1*100,@NPC_ORB1*101,@NPC_ORB2,@NPC_ORB2*100,@NPC_ORB2*101) AND `source_type` IN (0,9); +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 +-- Alliance Version +(@NPC_ORB1,0,0,0,8,0,100,0,@SPELL_PULL,0,0,0,80,@NPC_ORB1*100,2,0,0,0,0,1,0,0,0,0,0,0,0, 'Orb Bunny - On Spellhit - Start Action Script'), +(@NPC_ORB1*100,9,0,0,0,0,100,0,1000,1000,0,0,11,@ARC_EXPLOSION,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Orb Bunny - On Script - Cast Arcane Explosion'), +(@NPC_ORB1*100,9,1,0,0,0,100,0,500,500,0,0,45,1,1,0,0,0,0,19,@NPC_BUNNY,5,0,0,0,0,0, 'Orb Bunny - On Script - Cast Arcane Explosion'), +(@NPC_ORB1*100,9,2,0,0,0,100,0,0,0,0,0,41,100,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Orb Bunny - On Script - Despawn'), +-- Horde Version +(@NPC_ORB1,0,1,0,38,0,100,0,0,1,30000,30000,69,1,0,0,0,0,0,19,@ORB_TOTEM,20,0,0,0,0,0, 'Light Orb - On Data Set 0 1 - Move to totem'), +(@NPC_ORB1,0,2,3,34,0,100,1,8,1,0,0,11,@ARC_EXPLOSION,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Light Orb - On point 1 reached - Cast arcane explosion'), +(@NPC_ORB1,0,3,4,61,0,100,0,0,0,0,0,33,@NPC_CREDIT,0,0,0,0,0,12,1,0,0,0,0,0,0, 'Light Orb - On Link - Call kill credit'), +(@NPC_ORB1,0,4,0,61,0,100,0,0,0,0,0,80,@NPC_ORB1*101,2,0,0,0,0,1,0,0,0,0,0,0,0, 'Light Orb - On Link - Start action list to display arcase explosion'), +(@NPC_ORB1*101,9,0,0,0,0,100,0,0,0,0,0,47,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Light Orb - Action 0 - Set unseen'), +(@NPC_ORB1*101,9,1,0,0,0,100,0,0,0,0,0,41,100,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Light Orb - Action 1 - Despawn in 100 ms'), +-- Alliance Version +(@NPC_ORB2,0,0,0,8,0,100,0,@SPELL_PULL,0,0,0,80,@NPC_ORB2*100,2,0,0,0,0,1,0,0,0,0,0,0,0, 'Orb Bunny - On Spellhit - Start Action Script'), +(@NPC_ORB2*100,9,0,0,0,0,100,0,1000,1000,0,0,11,@ARC_EXPLOSION,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Orb Bunny - On Script - Cast Arcane Explosion'), +(@NPC_ORB2*100,9,1,0,0,0,100,0,500,500,0,0,45,1,1,0,0,0,0,19,@NPC_BUNNY,5,0,0,0,0,0, 'Orb Bunny - On Script - Cast Arcane Explosion'), +(@NPC_ORB2*100,9,2,0,0,0,100,0,0,0,0,0,41,100,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Orb Bunny - On Script - Despawn'), +-- Horde Version +(@NPC_ORB2,0,1,0,38,0,100,0,1,1,30000,30000,69,1,0,0,0,0,0,19,@ORB_TOTEM,20,0,0,0,0,0, 'Light Orb - On Data Set 0 1 - Move to totem'), +(@NPC_ORB2,0,2,3,34,0,100,1,8,1,0,0,11,@ARC_EXPLOSION,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Light Orb - On point 1 reached - Cast arcane explosion'), +(@NPC_ORB2,0,3,4,61,0,100,0,0,0,0,0,33,@NPC_CREDIT,0,0,0,0,0,12,1,0,0,0,0,0,0, 'Light Orb - On Link - Call kill credit'), +(@NPC_ORB2,0,4,0,61,0,100,0,0,0,0,0,80,@NPC_ORB2*101,2,0,0,0,0,1,0,0,0,0,0,0,0, 'Light Orb - On Link - Start action list to display arcase explosion'), +(@NPC_ORB2*101,9,0,0,0,0,100,0,0,0,0,0,47,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Light Orb - Action 0 - Set unseen'), +(@NPC_ORB2*101,9,1,0,0,0,100,0,0,0,0,0,41,100,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Light Orb - Action 1 - Despawn in 100 ms'); + +-- Alliance Multi-Spectrum Light Trap +UPDATE `creature_template` SET `AIName`='SmartAI',`flags_extra`=130,`ScriptName`='' WHERE `entry`=@NPC_BUNNY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@NPC_BUNNY; +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 +(@NPC_BUNNY,0,0,0,54,0,100,1,0,0,0,0,50,@GOB_TRAP,30000,0,0,0,0,1,0,0,0,0,0,0,0, 'Multi-Spectrum Light Trap - On spawn - Summon gob'), +(@NPC_BUNNY,0,1,0,1,0,100,1,0,0,0,0,9,0,0,0,0,0,0,15,@GOB_TRAP,0,0,0,0,0,0, 'Multi-Spectrum Light Trap - OOC - Activate gob'), +-- +(@NPC_BUNNY,0,2,0,1,0,100,1,3000,3000,3000,3000,11,@SPELL_PULL,0,0,0,0,0,19,@NPC_ORB1,20,0,0,0,0,0, 'Multi-Spectrum Light Trap - OOC 3 sec - Pull Razaani Light Orb'), +(@NPC_BUNNY,0,3,0,1,0,100,1,3000,3000,3000,3000,11,@SPELL_PULL,0,0,0,0,0,19,@NPC_ORB2,20,0,0,0,0,0, 'Multi-Spectrum Light Trap - OOC 3 sec - Pull Razaani Light Orb - Mini'), +(@NPC_BUNNY,0,4,5,38,0,100,1,1,1,0,0,33,@NPC_CREDIT,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Multi-Spectrum Light Trap - On Data Set - Give Quest Credit'), +(@NPC_BUNNY,0,5,0,61,0,100,1,0,0,0,0,9,0,0,0,0,0,0,15,@GOB_TRAP,0,0,0,0,0,0, 'Link - Activate gob - Gob'); + +-- Horde Totem +UPDATE `creature_template` SET `AIName`='SmartAI',`flags_extra`=0,`ScriptName`='' WHERE `entry`=@ORB_TOTEM; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ORB_TOTEM; +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 +(@ORB_TOTEM,0,0,1,54,0,100,0,0,0,0,0,45,0,1,0,0,0,0,19,@NPC_ORB1,20,0,0,0,0,0, 'Orb collecting totem - On spawned - Set Data 0 1'), +(@ORB_TOTEM,0,1,2,61,0,100,0,0,0,0,0,64,1,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Orb collecting totem - On Link - Store invoker'), +(@ORB_TOTEM,0,2,0,61,0,100,0,0,0,0,0,100,1,0,0,0,0,0,19,@NPC_ORB1,20,0,0,0,0,0, 'Orb collecting totem - On Link - Send stored target list 1'), +-- +(@ORB_TOTEM,0,3,4,54,0,100,0,0,0,0,0,45,1,1,0,0,0,0,19,@NPC_ORB2,20,0,0,0,0,0, 'Orb collecting totem - On spawned - Set Data 0 1'), +(@ORB_TOTEM,0,4,5,61,0,100,0,0,0,0,0,64,1,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Orb collecting totem - On Link - Store invoker'), +(@ORB_TOTEM,0,5,0,61,0,100,0,0,0,0,0,100,1,0,0,0,0,0,19,@NPC_ORB2,20,0,0,0,0,0, 'Orb collecting totem - On Link - Send stored target list 1'); -- cgit v1.2.3 From 79307bc884e69e9f8dd60bd5a592a2a6b0a32e4a Mon Sep 17 00:00:00 2001 From: Filip Date: Sun, 8 Sep 2013 18:10:08 +0200 Subject: DB/Update: Needs null spawndist --- sql/updates/world/2013_09_08_01_world_update.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2013_09_08_01_world_update.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_08_01_world_update.sql b/sql/updates/world/2013_09_08_01_world_update.sql new file mode 100644 index 00000000000..e2046f0267d --- /dev/null +++ b/sql/updates/world/2013_09_08_01_world_update.sql @@ -0,0 +1,2 @@ +-- -.- >.> <.< -_- ._. +UPDATE `creature` SET `spawndist`=0 WHERE`id`=20635; -- cgit v1.2.3 From ddca805378340cc18870649c38bdb4ee3fd562d9 Mon Sep 17 00:00:00 2001 From: Filip Date: Mon, 9 Sep 2013 18:53:12 +0200 Subject: DB/SAI: Blowing Hodir's Horn (12977) Fixes #10749 --- sql/updates/world/2013_09_09_00_world_sai.sql | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 sql/updates/world/2013_09_09_00_world_sai.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_09_00_world_sai.sql b/sql/updates/world/2013_09_09_00_world_sai.sql new file mode 100644 index 00000000000..b2491651bbf --- /dev/null +++ b/sql/updates/world/2013_09_09_00_world_sai.sql @@ -0,0 +1,15 @@ +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry` IN (30135,30144,29974); +DELETE FROM `smart_scripts` WHERE entryorguid IN (30135,30144,29974); +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 +-- Niffelem Forefather +(29974, 0, 0, 0, 0, 0, 100, 0, 1000, 5000, 8000, 13000, 11, 57454, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Niffelem Forefather - IC - Cast Ice Spike'), +(29974, 0, 1, 2, 8, 0, 100, 0, 55983, 0, 0, 0, 33, 30138, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Niffelem Forefather - On Spellhit - Give Kill Credit'), +(29974, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Niffelem Forefather - Linked with Previous Event Despawn'), +-- Restless Frostborn Warrior +(30135, 0, 0, 0, 0, 0, 100, 0, 1000, 5000, 8000, 13000, 11, 57456, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Restless Frostborn Warrior - IC - Cast Frostbite'), +(30135, 0, 1, 2, 8, 0, 100, 0, 55983, 0, 0, 0, 33, 30139, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Restless Frostborn Warrior - On Spellhit - Give Kill Credit'), +(30135, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Restless Frostborn Warrior - Linked with Previous Event Despawn'), +-- Restless Frostborn Ghost +(30144, 0, 0, 0, 0, 0, 100, 0, 1000, 5000, 8000, 13000, 11, 57456, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Restless Frostborn Ghost - IC - Cast Frostbite'), +(30144, 0, 1, 2, 8, 0, 100, 0, 55983, 0, 0, 0, 33, 30139, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Restless Frostborn Ghost - On Spellhit - Give Kill Credit'), +(30144, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Restless Frostborn Ghost - Linked with Previous Event Despawn'); -- cgit v1.2.3 From f2121b12c03d90d666c08f5998262af5523e2ffc Mon Sep 17 00:00:00 2001 From: Filip Date: Tue, 10 Sep 2013 09:04:26 +0200 Subject: DB/Cond: Conditions for Hodir's Horn --- sql/updates/world/2013_09_10_00_world_conditions.sql | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 sql/updates/world/2013_09_10_00_world_conditions.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_10_00_world_conditions.sql b/sql/updates/world/2013_09_10_00_world_conditions.sql new file mode 100644 index 00000000000..b18a660563a --- /dev/null +++ b/sql/updates/world/2013_09_10_00_world_conditions.sql @@ -0,0 +1,8 @@ +DELETE FROM `conditions` WHERE `SourceEntry` = 55983; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(17, 0, 55983, 0, 0, 31, 1, 3, 29974, 0, 0, 0, 0, '', 'Blow Hodir''s Horn can hit Niffelem Forefather'), +(17, 0, 55983, 0, 0, 36, 1, 0, 0, 0, 1, 0, 0, '', 'Blow Hodir''s Horn can only hit dead Niffelem Forefather'), +(17, 0, 55983, 0, 1, 31, 1, 3, 30144, 0, 0, 0, 0, '', 'Blow Hodir''s Horn can hit Restless Frostborn Ghost'), +(17, 0, 55983, 0, 1, 36, 1, 0, 0, 0, 1, 0, 0, '', 'Blow Hodir''s Horn can only hit dead Restless Frostborn Ghost'), +(17, 0, 55983, 0, 2, 31, 1, 3, 30135, 0, 0, 0, 0, '', 'Blow Hodir''s Horn can hit Restless Frostborn Warrior'), +(17, 0, 55983, 0, 2, 36, 1, 0, 0, 0, 1, 0, 0, '', 'Blow Hodir''s Horn can only hit dead Restless Frostborn Warrior'); -- cgit v1.2.3 From 1eee42433b429db690d1fd90513e021d9431c49e Mon Sep 17 00:00:00 2001 From: Spp Date: Tue, 10 Sep 2013 11:45:59 +0200 Subject: Core/RBAC: Move group commands to RBAC (using individual permissions) - group commands moved from cs_misc.cpp to own file - renamed groupsummon to "group summon" --- sql/updates/auth/2013_09_10_00_auth_misc.sql | 25 ++ sql/updates/world/2013_09_10_01_world_command.sql | 15 + src/server/game/Accounts/RBAC.h | 14 +- src/server/game/Scripting/ScriptLoader.cpp | 2 + src/server/scripts/Commands/CMakeLists.txt | 104 +------ src/server/scripts/Commands/cs_group.cpp | 338 ++++++++++++++++++++++ src/server/scripts/Commands/cs_misc.cpp | 273 ----------------- 7 files changed, 394 insertions(+), 377 deletions(-) create mode 100644 sql/updates/auth/2013_09_10_00_auth_misc.sql create mode 100644 sql/updates/world/2013_09_10_01_world_command.sql create mode 100644 src/server/scripts/Commands/cs_group.cpp (limited to 'sql') diff --git a/sql/updates/auth/2013_09_10_00_auth_misc.sql b/sql/updates/auth/2013_09_10_00_auth_misc.sql new file mode 100644 index 00000000000..f62ecd83cab --- /dev/null +++ b/sql/updates/auth/2013_09_10_00_auth_misc.sql @@ -0,0 +1,25 @@ +/* cs_group.cpp */ + +SET @id = 472; + +-- Add new permissions +DELETE FROM `rbac_permissions` WHERE `id` BETWEEN @id AND @id+6; +INSERT INTO `rbac_permissions` (`id`, `name`) VALUES +(@id+0 , 'group'), +(@id+1 , 'group leader'), +(@id+2 , 'group disband'), +(@id+3 , 'group remove'), +(@id+4 , 'group join'), +(@id+5 , 'group list'), +(@id+6 , 'group summon'); + +-- Add permissions to "corresponding Commands Role" +DELETE FROM `rbac_role_permissions` WHERE `permissionId` BETWEEN @id AND @id+6; +INSERT INTO `rbac_role_permissions` (`roleId`, `permissionId`) VALUES +(4, @id+0), +(4, @id+1), +(4, @id+2), +(4, @id+3), +(4, @id+4), +(4, @id+5), +(4, @id+6); diff --git a/sql/updates/world/2013_09_10_01_world_command.sql b/sql/updates/world/2013_09_10_01_world_command.sql new file mode 100644 index 00000000000..3c287422cac --- /dev/null +++ b/sql/updates/world/2013_09_10_01_world_command.sql @@ -0,0 +1,15 @@ +/* cs_group.cpp */ + +SET @id = 472; + +-- Update command table with new RBAC permissions +UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'group'; +UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'group leader'; +UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'group disband'; +UPDATE `command` SET `permission` = @id+3 WHERE `name` = 'group remove'; +UPDATE `command` SET `permission` = @id+4 WHERE `name` = 'group join'; +UPDATE `command` SET `permission` = @id+5 WHERE `name` = 'group list'; + +UPDATE `command` SET `permission` = @id+6, `name` = 'group summon', `help` = +'Syntax: .group summon [$charactername]\r\n\r\nTeleport the given character and his group to you. Teleported only online characters but original selected group member can be offline.' +WHERE `name` = 'groupsummon'; diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h index 492a7197cfe..e03daba50bd 100644 --- a/src/server/game/Accounts/RBAC.h +++ b/src/server/game/Accounts/RBAC.h @@ -177,11 +177,11 @@ enum RBACPermissions RBAC_PERM_COMMAND_CHARACTER_CHANGEFACTION = 275, RBAC_PERM_COMMAND_CHARACTER_CHANGERACE = 276, RBAC_PERM_COMMAND_CHARACTER_DELETED = 277, - RBAC_PERM_COMMAND_CHARACTER_DELETED_DELETE = 278, // Not in DB - console + RBAC_PERM_COMMAND_CHARACTER_DELETED_DELETE = 278, RBAC_PERM_COMMAND_CHARACTER_DELETED_LIST = 279, RBAC_PERM_COMMAND_CHARACTER_DELETED_RESTORE = 280, - RBAC_PERM_COMMAND_CHARACTER_DELETED_OLD = 281, // Not in DB - console - RBAC_PERM_COMMAND_CHARACTER_ERASE = 282, // Not in DB - console + RBAC_PERM_COMMAND_CHARACTER_DELETED_OLD = 281, + RBAC_PERM_COMMAND_CHARACTER_ERASE = 282, RBAC_PERM_COMMAND_CHARACTER_LEVEL = 283, RBAC_PERM_COMMAND_CHARACTER_RENAME = 284, RBAC_PERM_COMMAND_CHARACTER_REPUTATION = 285, @@ -299,6 +299,7 @@ enum RBACPermissions RBAC_PERM_COMMAND_GOBJECT_SET_STATE = 397, RBAC_PERM_COMMAND_GOBJECT_TARGET = 398, RBAC_PERM_COMMAND_GOBJECT_TURN = 399, + // 400 - reuse RBAC_PERM_COMMAND_GUILD = 401, RBAC_PERM_COMMAND_GUILD_CREATE = 402, RBAC_PERM_COMMAND_GUILD_DELETE = 403, @@ -370,6 +371,13 @@ enum RBACPermissions RBAC_PERM_COMMAND_NAMEANNOUNCE = 469, RBAC_PERM_COMMAND_NOTIFY = 470, RBAC_PERM_COMMAND_WHISPERS = 471, + RBAC_PERM_COMMAND_GROUP = 472, + RBAC_PERM_COMMAND_GROUP_LEADER = 473, + RBAC_PERM_COMMAND_GROUP_DISBAND = 474, + RBAC_PERM_COMMAND_GROUP_REMOVE = 475, + RBAC_PERM_COMMAND_GROUP_JOIN = 476, + RBAC_PERM_COMMAND_GROUP_LIST = 477, + RBAC_PERM_COMMAND_GROUP_SUMMON = 478, // custom permissions 1000+ RBAC_PERM_MAX diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 3456041ddb2..c3b2b2038a3 100644 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -59,6 +59,7 @@ void AddSC_event_commandscript(); void AddSC_gm_commandscript(); void AddSC_go_commandscript(); void AddSC_gobject_commandscript(); +void AddSC_group_commandscript(); void AddSC_guild_commandscript(); void AddSC_honor_commandscript(); void AddSC_instance_commandscript(); @@ -740,6 +741,7 @@ void AddCommandScripts() AddSC_gm_commandscript(); AddSC_go_commandscript(); AddSC_gobject_commandscript(); + AddSC_group_commandscript(); AddSC_guild_commandscript(); AddSC_honor_commandscript(); AddSC_instance_commandscript(); diff --git a/src/server/scripts/Commands/CMakeLists.txt b/src/server/scripts/Commands/CMakeLists.txt index ce31fa1f4d3..c38789ed90a 100644 --- a/src/server/scripts/Commands/CMakeLists.txt +++ b/src/server/scripts/Commands/CMakeLists.txt @@ -8,109 +8,11 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +file(GLOB_RECURSE sources_Commands Commands/*.cpp Commands/*.h) + set(scripts_STAT_SRCS ${scripts_STAT_SRCS} - Commands/cs_account.cpp - Commands/cs_achievement.cpp - Commands/cs_arena.cpp - Commands/cs_ban.cpp - Commands/cs_bf.cpp - Commands/cs_cast.cpp - Commands/cs_character.cpp - Commands/cs_cheat.cpp - Commands/cs_debug.cpp - Commands/cs_deserter.cpp - Commands/cs_disable.cpp - Commands/cs_event.cpp - Commands/cs_gm.cpp - Commands/cs_go.cpp - Commands/cs_gobject.cpp - Commands/cs_guild.cpp - Commands/cs_honor.cpp - Commands/cs_instance.cpp - Commands/cs_learn.cpp - Commands/cs_lfg.cpp - Commands/cs_list.cpp - Commands/cs_lookup.cpp - Commands/cs_message.cpp - Commands/cs_misc.cpp - Commands/cs_modify.cpp - Commands/cs_npc.cpp - Commands/cs_quest.cpp - Commands/cs_rbac.cpp - Commands/cs_reload.cpp - Commands/cs_reset.cpp - Commands/cs_tele.cpp - Commands/cs_ticket.cpp - Commands/cs_server.cpp - Commands/cs_titles.cpp - Commands/cs_wp.cpp - Commands/cs_mmaps.cpp -# Commands/cs_pdump.cpp -# Commands/cs_channel.cpp -# Commands/cs_pet.cpp -# Commands/cs_aura.cpp -# Commands/cs_unaura.cpp -# Commands/cs_nameannounce.cpp -# Commands/cs_gmnameannounce.cpp -# Commands/cs_announce.cpp -# Commands/cs_gmannounce.cpp -# Commands/cs_notify.cpp -# Commands/cs_gmnotify.cpp -# Commands/cs_appear.cpp -# Commands/cs_summon.cpp -# Commands/cs_groupsummon.cpp -# Commands/cs_commands.cpp -# Commands/cs_demorph.cpp -# Commands/cs_die.cpp -# Commands/cs_revive.cpp -# Commands/cs_dismount.cpp -# Commands/cs_guid.cpp -# Commands/cs_help.cpp -# Commands/cs_itemmove.cpp -# Commands/cs_cooldown.cpp -# Commands/cs_unlearn.cpp -# Commands/cs_distance.cpp -# Commands/cs_recall.cpp -# Commands/cs_save.cpp -# Commands/cs_saveall.cpp -# Commands/cs_kick.cpp -# Commands/cs_start.cpp -# Commands/cs_taxicheat.cpp -# Commands/cs_linkgrave.cpp -# Commands/cs_neargrave.cpp -# Commands/cs_explorecheat.cpp -# Commands/cs_hover.cpp -# Commands/cs_levelup.cpp -# Commands/cs_showarea.cpp -# Commands/cs_hidearea.cpp -# Commands/cs_additem.cpp -# Commands/cs_additemset.cpp -# Commands/cs_bank.cpp -# Commands/cs_wchange.cpp -# Commands/cs_maxskill.cpp -# Commands/cs_setskill.cpp -# Commands/cs_whispers.cpp -# Commands/cs_pinfo.cpp -# Commands/cs_respawn.cpp -# Commands/cs_send.cpp -# Commands/cs_mute.cpp -# Commands/cs_unmute.cpp -# Commands/cs_movegens.cpp -# Commands/cs_cometome.cpp -# Commands/cs_damage.cpp -# Commands/cs_combatstop.cpp -# Commands/cs_flusharenapoints.cpp -# Commands/cs_repairitems.cpp -# Commands/cs_waterwalk.cpp -# Commands/cs_freeze.cpp -# Commands/cs_unfreeze.cpp -# Commands/cs_listfreeze.cpp -# Commands/cs_possess.cpp -# Commands/cs_unpossess.cpp -# Commands/cs_bindsight.cpp -# Commands/cs_unbindsight.cpp -# Commands/cs_playall.cpp + ${sources_Commands} ) message(" -> Prepared: Commands") diff --git a/src/server/scripts/Commands/cs_group.cpp b/src/server/scripts/Commands/cs_group.cpp new file mode 100644 index 00000000000..784ff216c41 --- /dev/null +++ b/src/server/scripts/Commands/cs_group.cpp @@ -0,0 +1,338 @@ +/* + * Copyright (C) 2008-2013 TrinityCore + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#include "Chat.h" +#include "Language.h" +#include "LFG.h" +#include "Player.h" +#include "ObjectMgr.h" +#include "GroupMgr.h" +#include "ScriptMgr.h" + +class group_commandscript : public CommandScript +{ +public: + group_commandscript() : CommandScript("group_commandscript") { } + + ChatCommand* GetCommands() const OVERRIDE + { + static ChatCommand groupCommandTable[] = + { + { "leader", RBAC_PERM_COMMAND_GROUP_LEADER, false, &HandleGroupLeaderCommand, "", NULL }, + { "disband", RBAC_PERM_COMMAND_GROUP_DISBAND, false, &HandleGroupDisbandCommand, "", NULL }, + { "remove", RBAC_PERM_COMMAND_GROUP_REMOVE, false, &HandleGroupRemoveCommand, "", NULL }, + { "join", RBAC_PERM_COMMAND_GROUP_JOIN, false, &HandleGroupJoinCommand, "", NULL }, + { "list", RBAC_PERM_COMMAND_GROUP_LIST, false, &HandleGroupListCommand, "", NULL }, + { "summon", RBAC_PERM_COMMAND_GROUP_SUMMON, false, &HandleGroupSummonCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; + + static ChatCommand commandTable[] = + { + { "group", RBAC_PERM_COMMAND_GROUP, false, NULL, "", groupCommandTable }, + { NULL, 0, false, NULL, "", NULL } + }; + return commandTable; + } + + // Summon group of player + static bool HandleGroupSummonCommand(ChatHandler* handler, char const* args) + { + Player* target; + if (!handler->extractPlayerTarget((char*)args, &target)) + return false; + + // check online security + if (handler->HasLowerSecurity(target, 0)) + return false; + + Group* group = target->GetGroup(); + + std::string nameLink = handler->GetNameLink(target); + + if (!group) + { + handler->PSendSysMessage(LANG_NOT_IN_GROUP, nameLink.c_str()); + handler->SetSentErrorMessage(true); + return false; + } + + Player* gmPlayer = handler->GetSession()->GetPlayer(); + Group* gmGroup = gmPlayer->GetGroup(); + Map* gmMap = gmPlayer->GetMap(); + bool toInstance = gmMap->Instanceable(); + + // we are in instance, and can summon only player in our group with us as lead + if (toInstance && ( + !gmGroup || group->GetLeaderGUID() != gmPlayer->GetGUID() || + gmGroup->GetLeaderGUID() != gmPlayer->GetGUID())) + // the last check is a bit excessive, but let it be, just in case + { + handler->SendSysMessage(LANG_CANNOT_SUMMON_TO_INST); + handler->SetSentErrorMessage(true); + return false; + } + + for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) + { + Player* player = itr->GetSource(); + + if (!player || player == gmPlayer || !player->GetSession()) + continue; + + // check online security + if (handler->HasLowerSecurity(player, 0)) + return false; + + std::string plNameLink = handler->GetNameLink(player); + + if (player->IsBeingTeleported()) + { + handler->PSendSysMessage(LANG_IS_TELEPORTED, plNameLink.c_str()); + handler->SetSentErrorMessage(true); + return false; + } + + if (toInstance) + { + Map* playerMap = player->GetMap(); + + if (playerMap->Instanceable() && playerMap->GetInstanceId() != gmMap->GetInstanceId()) + { + // cannot summon from instance to instance + handler->PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST, plNameLink.c_str()); + handler->SetSentErrorMessage(true); + return false; + } + } + + handler->PSendSysMessage(LANG_SUMMONING, plNameLink.c_str(), ""); + if (handler->needReportToTarget(player)) + ChatHandler(player->GetSession()).PSendSysMessage(LANG_SUMMONED_BY, handler->GetNameLink().c_str()); + + // stop flight if need + if (player->IsInFlight()) + { + player->GetMotionMaster()->MovementExpired(); + player->CleanupAfterTaxiFlight(); + } + // save only in non-flight case + else + player->SaveRecallPosition(); + + // before GM + float x, y, z; + gmPlayer->GetClosePoint(x, y, z, player->GetObjectSize()); + player->TeleportTo(gmPlayer->GetMapId(), x, y, z, player->GetOrientation()); + } + + return true; + } + + static bool HandleGroupLeaderCommand(ChatHandler* handler, char const* args) + { + Player* player = NULL; + Group* group = NULL; + uint64 guid = 0; + char* nameStr = strtok((char*)args, " "); + + if (!handler->GetPlayerGroupAndGUIDByName(nameStr, player, group, guid)) + return false; + + if (!group) + { + handler->PSendSysMessage(LANG_GROUP_NOT_IN_GROUP, player->GetName().c_str()); + handler->SetSentErrorMessage(true); + return false; + } + + if (group->GetLeaderGUID() != guid) + { + group->ChangeLeader(guid); + group->SendUpdate(); + } + + return true; + } + + static bool HandleGroupDisbandCommand(ChatHandler* handler, char const* args) + { + Player* player = NULL; + Group* group = NULL; + uint64 guid = 0; + char* nameStr = strtok((char*)args, " "); + + if (!handler->GetPlayerGroupAndGUIDByName(nameStr, player, group, guid)) + return false; + + if (!group) + { + handler->PSendSysMessage(LANG_GROUP_NOT_IN_GROUP, player->GetName().c_str()); + handler->SetSentErrorMessage(true); + return false; + } + + group->Disband(); + return true; + } + + static bool HandleGroupRemoveCommand(ChatHandler* handler, char const* args) + { + Player* player = NULL; + Group* group = NULL; + uint64 guid = 0; + char* nameStr = strtok((char*)args, " "); + + if (!handler->GetPlayerGroupAndGUIDByName(nameStr, player, group, guid)) + return false; + + if (!group) + { + handler->PSendSysMessage(LANG_GROUP_NOT_IN_GROUP, player->GetName().c_str()); + handler->SetSentErrorMessage(true); + return false; + } + + group->RemoveMember(guid); + return true; + } + + static bool HandleGroupJoinCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + Player* playerSource = NULL; + Player* playerTarget = NULL; + Group* groupSource = NULL; + Group* groupTarget = NULL; + uint64 guidSource = 0; + uint64 guidTarget = 0; + char* nameplgrStr = strtok((char*)args, " "); + char* nameplStr = strtok(NULL, " "); + + if (!handler->GetPlayerGroupAndGUIDByName(nameplgrStr, playerSource, groupSource, guidSource, true)) + return false; + + if (!groupSource) + { + handler->PSendSysMessage(LANG_GROUP_NOT_IN_GROUP, playerSource->GetName().c_str()); + handler->SetSentErrorMessage(true); + return false; + } + + if (!handler->GetPlayerGroupAndGUIDByName(nameplStr, playerTarget, groupTarget, guidTarget, true)) + return false; + + if (groupTarget || playerTarget->GetGroup() == groupSource) + { + handler->PSendSysMessage(LANG_GROUP_ALREADY_IN_GROUP, playerTarget->GetName().c_str()); + handler->SetSentErrorMessage(true); + return false; + } + + if (!groupSource->IsFull()) + { + handler->PSendSysMessage(LANG_GROUP_FULL); + handler->SetSentErrorMessage(true); + return false; + } + + groupSource->AddMember(playerTarget); + groupSource->BroadcastGroupUpdate(); + handler->PSendSysMessage(LANG_GROUP_PLAYER_JOINED, playerTarget->GetName().c_str(), playerSource->GetName().c_str()); + return true; + } + + static bool HandleGroupListCommand(ChatHandler* handler, char const* args) + { + Player* playerTarget; + uint64 guidTarget; + std::string nameTarget; + + uint32 parseGUID = MAKE_NEW_GUID(atol((char*)args), 0, HIGHGUID_PLAYER); + + if (sObjectMgr->GetPlayerNameByGUID(parseGUID, nameTarget)) + { + playerTarget = sObjectMgr->GetPlayerByLowGUID(parseGUID); + guidTarget = parseGUID; + } + else if (!handler->extractPlayerTarget((char*)args, &playerTarget, &guidTarget, &nameTarget)) + return false; + + Group* groupTarget = NULL; + if (playerTarget) + groupTarget = playerTarget->GetGroup(); + + if (!groupTarget) + { + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GROUP_MEMBER); + stmt->setUInt32(0, guidTarget); + PreparedQueryResult resultGroup = CharacterDatabase.Query(stmt); + if (resultGroup) + groupTarget = sGroupMgr->GetGroupByDbStoreId((*resultGroup)[0].GetUInt32()); + } + + if (!groupTarget) + { + handler->PSendSysMessage(LANG_GROUP_NOT_IN_GROUP, nameTarget.c_str()); + handler->SetSentErrorMessage(true); + return false; + } + + handler->PSendSysMessage(LANG_GROUP_TYPE, (groupTarget->isRaidGroup() ? "raid" : "party")); + Group::MemberSlotList const& members = groupTarget->GetMemberSlots(); + for (Group::MemberSlotList::const_iterator itr = members.begin(); itr != members.end(); ++itr) + { + Group::MemberSlot const& slot = *itr; + + std::string flags; + if (slot.flags & MEMBER_FLAG_ASSISTANT) + flags = "Assistant"; + + if (slot.flags & MEMBER_FLAG_MAINTANK) + { + if (!flags.empty()) + flags.append(", "); + flags.append("MainTank"); + } + + if (slot.flags & MEMBER_FLAG_MAINASSIST) + { + if (!flags.empty()) + flags.append(", "); + flags.append("MainAssist"); + } + + if (flags.empty()) + flags = "None"; + + Player* p = ObjectAccessor::FindPlayer((*itr).guid); + const char* onlineState = (p && p->IsInWorld()) ? "online" : "offline"; + + handler->PSendSysMessage(LANG_GROUP_PLAYER_NAME_GUID, slot.name.c_str(), onlineState, + GUID_LOPART(slot.guid), flags.c_str(), lfg::GetRolesString(slot.roles).c_str()); + } + + return true; + } +}; + +void AddSC_group_commandscript() +{ + new group_commandscript(); +} diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 9c29e31af96..ce7c3e0f3a1 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -44,15 +44,6 @@ public: ChatCommand* GetCommands() const OVERRIDE { - static ChatCommand groupCommandTable[] = - { - { "leader", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleGroupLeaderCommand, "", NULL }, - { "disband", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleGroupDisbandCommand, "", NULL }, - { "remove", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleGroupRemoveCommand, "", NULL }, - { "join", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleGroupJoinCommand, "", NULL }, - { "list", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleGroupListCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; static ChatCommand petCommandTable[] = { { "create", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleCreatePetCommand, "", NULL }, @@ -76,7 +67,6 @@ public: { "unaura", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleUnAuraCommand, "", NULL }, { "appear", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleAppearCommand, "", NULL }, { "summon", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleSummonCommand, "", NULL }, - { "groupsummon", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleGroupSummonCommand, "", NULL }, { "commands", RBAC_PERM_PLAYER_COMMANDS, true, &HandleCommandsCommand, "", NULL }, { "die", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleDieCommand, "", NULL }, { "revive", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReviveCommand, "", NULL }, @@ -116,7 +106,6 @@ public: { "freeze", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleFreezeCommand, "", NULL }, { "unfreeze", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleUnFreezeCommand, "", NULL }, { "listfreeze", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleListFreezeCommand, "", NULL }, - { "group", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, NULL, "", groupCommandTable }, { "possess", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, HandlePossessCommand, "", NULL }, { "unpossess", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, HandleUnPossessCommand, "", NULL }, { "bindsight", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, HandleBindSightCommand, "", NULL }, @@ -546,97 +535,6 @@ public: return true; } - // Summon group of player - static bool HandleGroupSummonCommand(ChatHandler* handler, char const* args) - { - Player* target; - if (!handler->extractPlayerTarget((char*)args, &target)) - return false; - - // check online security - if (handler->HasLowerSecurity(target, 0)) - return false; - - Group* group = target->GetGroup(); - - std::string nameLink = handler->GetNameLink(target); - - if (!group) - { - handler->PSendSysMessage(LANG_NOT_IN_GROUP, nameLink.c_str()); - handler->SetSentErrorMessage(true); - return false; - } - - Map* gmMap = handler->GetSession()->GetPlayer()->GetMap(); - bool toInstance = gmMap->Instanceable(); - - // we are in instance, and can summon only player in our group with us as lead - if (toInstance && ( - !handler->GetSession()->GetPlayer()->GetGroup() || (group->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID()) || - (handler->GetSession()->GetPlayer()->GetGroup()->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID()))) - // the last check is a bit excessive, but let it be, just in case - { - handler->SendSysMessage(LANG_CANNOT_SUMMON_TO_INST); - handler->SetSentErrorMessage(true); - return false; - } - - for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) - { - Player* player = itr->GetSource(); - - if (!player || player == handler->GetSession()->GetPlayer() || !player->GetSession()) - continue; - - // check online security - if (handler->HasLowerSecurity(player, 0)) - return false; - - std::string plNameLink = handler->GetNameLink(player); - - if (player->IsBeingTeleported() == true) - { - handler->PSendSysMessage(LANG_IS_TELEPORTED, plNameLink.c_str()); - handler->SetSentErrorMessage(true); - return false; - } - - if (toInstance) - { - Map* playerMap = player->GetMap(); - - if (playerMap->Instanceable() && playerMap->GetInstanceId() != gmMap->GetInstanceId()) - { - // cannot summon from instance to instance - handler->PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST, plNameLink.c_str()); - handler->SetSentErrorMessage(true); - return false; - } - } - - handler->PSendSysMessage(LANG_SUMMONING, plNameLink.c_str(), ""); - if (handler->needReportToTarget(player)) - ChatHandler(player->GetSession()).PSendSysMessage(LANG_SUMMONED_BY, handler->GetNameLink().c_str()); - - // stop flight if need - if (player->IsInFlight()) - { - player->GetMotionMaster()->MovementExpired(); - player->CleanupAfterTaxiFlight(); - } - // save only in non-flight case - else - player->SaveRecallPosition(); - - // before GM - float x, y, z; - handler->GetSession()->GetPlayer()->GetClosePoint(x, y, z, player->GetObjectSize()); - player->TeleportTo(handler->GetSession()->GetPlayer()->GetMapId(), x, y, z, player->GetOrientation()); - } - - return true; - } static bool HandleCommandsCommand(ChatHandler* handler, char const* /*args*/) { @@ -2894,177 +2792,6 @@ public: return true; } - static bool HandleGroupLeaderCommand(ChatHandler* handler, char const* args) - { - Player* player = NULL; - Group* group = NULL; - uint64 guid = 0; - char* nameStr = strtok((char*)args, " "); - - if (handler->GetPlayerGroupAndGUIDByName(nameStr, player, group, guid)) - if (group && group->GetLeaderGUID() != guid) - { - group->ChangeLeader(guid); - group->SendUpdate(); - } - - return true; - } - - static bool HandleGroupDisbandCommand(ChatHandler* handler, char const* args) - { - Player* player = NULL; - Group* group = NULL; - uint64 guid = 0; - char* nameStr = strtok((char*)args, " "); - - if (handler->GetPlayerGroupAndGUIDByName(nameStr, player, group, guid)) - if (group) - group->Disband(); - - return true; - } - - static bool HandleGroupRemoveCommand(ChatHandler* handler, char const* args) - { - Player* player = NULL; - Group* group = NULL; - uint64 guid = 0; - char* nameStr = strtok((char*)args, " "); - - if (handler->GetPlayerGroupAndGUIDByName(nameStr, player, group, guid, true)) - if (group) - group->RemoveMember(guid); - - return true; - } - - static bool HandleGroupJoinCommand(ChatHandler* handler, char const* args) - { - if (!*args) - return false; - - Player* playerSource = NULL; - Player* playerTarget = NULL; - Group* groupSource = NULL; - Group* groupTarget = NULL; - uint64 guidSource = 0; - uint64 guidTarget = 0; - char* nameplgrStr = strtok((char*)args, " "); - char* nameplStr = strtok(NULL, " "); - - if (handler->GetPlayerGroupAndGUIDByName(nameplgrStr, playerSource, groupSource, guidSource, true)) - { - if (groupSource) - { - if (handler->GetPlayerGroupAndGUIDByName(nameplStr, playerTarget, groupTarget, guidTarget, true)) - { - if (!groupTarget && playerTarget->GetGroup() != groupSource) - { - if (!groupSource->IsFull()) - { - groupSource->AddMember(playerTarget); - groupSource->BroadcastGroupUpdate(); - handler->PSendSysMessage(LANG_GROUP_PLAYER_JOINED, playerTarget->GetName().c_str(), playerSource->GetName().c_str()); - return true; - } - else - { - // group is full - handler->PSendSysMessage(LANG_GROUP_FULL); - return true; - } - } - else - { - // group is full or target player already in a group - handler->PSendSysMessage(LANG_GROUP_ALREADY_IN_GROUP, playerTarget->GetName().c_str()); - return true; - } - } - } - else - { - // specified source player is not in a group - handler->PSendSysMessage(LANG_GROUP_NOT_IN_GROUP, playerSource->GetName().c_str()); - return true; - } - } - - return true; - } - - static bool HandleGroupListCommand(ChatHandler* handler, char const* args) - { - Player* playerTarget; - uint64 guidTarget; - std::string nameTarget; - - uint32 parseGUID = MAKE_NEW_GUID(atol((char*)args), 0, HIGHGUID_PLAYER); - - if (sObjectMgr->GetPlayerNameByGUID(parseGUID, nameTarget)) - { - playerTarget = sObjectMgr->GetPlayerByLowGUID(parseGUID); - guidTarget = parseGUID; - } - else if (!handler->extractPlayerTarget((char*)args, &playerTarget, &guidTarget, &nameTarget)) - return false; - - Group* groupTarget = NULL; - if (playerTarget) - groupTarget = playerTarget->GetGroup(); - - if (!groupTarget) - { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GROUP_MEMBER); - stmt->setUInt32(0, guidTarget); - PreparedQueryResult resultGroup = CharacterDatabase.Query(stmt); - if (resultGroup) - groupTarget = sGroupMgr->GetGroupByDbStoreId((*resultGroup)[0].GetUInt32()); - } - - if (groupTarget) - { - handler->PSendSysMessage(LANG_GROUP_TYPE, (groupTarget->isRaidGroup() ? "raid" : "party")); - Group::MemberSlotList const& members = groupTarget->GetMemberSlots(); - for (Group::MemberSlotList::const_iterator itr = members.begin(); itr != members.end(); ++itr) - { - Group::MemberSlot const& slot = *itr; - - std::string flags; - if (slot.flags & MEMBER_FLAG_ASSISTANT) - flags = "Assistant"; - - if (slot.flags & MEMBER_FLAG_MAINTANK) - { - if (!flags.empty()) - flags.append(", "); - flags.append("MainTank"); - } - - if (slot.flags & MEMBER_FLAG_MAINASSIST) - { - if (!flags.empty()) - flags.append(", "); - flags.append("MainAssist"); - } - - if (flags.empty()) - flags = "None"; - - Player* p = ObjectAccessor::FindPlayer((*itr).guid); - const char* onlineState = (p && p->IsInWorld()) ? "online" : "offline"; - - handler->PSendSysMessage(LANG_GROUP_PLAYER_NAME_GUID, slot.name.c_str(), onlineState, - GUID_LOPART(slot.guid), flags.c_str(), lfg::GetRolesString(slot.roles).c_str()); - } - } - else - handler->PSendSysMessage(LANG_GROUP_NOT_IN_GROUP, nameTarget.c_str()); - - return true; - } - static bool HandlePlayAllCommand(ChatHandler* handler, char const* args) { if (!*args) -- cgit v1.2.3 From 83cb44d79f9fb266d426b251a96dd7053da0187f Mon Sep 17 00:00:00 2001 From: Spp Date: Tue, 10 Sep 2013 12:07:03 +0200 Subject: Core/RBAC: Move pet commands to RBAC (using individual permissions) - Pet commands moved from cs_misc.cpp to own file --- sql/updates/auth/2013_09_10_01_auth_misc.sql | 19 +++ sql/updates/world/2013_09_10_02_world_command.sql | 9 + src/server/game/Accounts/RBAC.h | 4 + src/server/game/Scripting/ScriptLoader.cpp | 2 + src/server/scripts/Commands/cs_misc.cpp | 147 ----------------- src/server/scripts/Commands/cs_pet.cpp | 190 ++++++++++++++++++++++ 6 files changed, 224 insertions(+), 147 deletions(-) create mode 100644 sql/updates/auth/2013_09_10_01_auth_misc.sql create mode 100644 sql/updates/world/2013_09_10_02_world_command.sql create mode 100644 src/server/scripts/Commands/cs_pet.cpp (limited to 'sql') diff --git a/sql/updates/auth/2013_09_10_01_auth_misc.sql b/sql/updates/auth/2013_09_10_01_auth_misc.sql new file mode 100644 index 00000000000..92d68874b4b --- /dev/null +++ b/sql/updates/auth/2013_09_10_01_auth_misc.sql @@ -0,0 +1,19 @@ +/* cs_pet.cpp */ + +SET @id = 472; + +-- Add new permissions +DELETE FROM `rbac_permissions` WHERE `id` BETWEEN @id AND @id+3; +INSERT INTO `rbac_permissions` (`id`, `name`) VALUES +(@id+0 , 'pet'), +(@id+1 , 'pet create'), +(@id+2 , 'pet learn'), +(@id+3 , 'pet unlearn'); + +-- Add permissions to "corresponding Commands Role" +DELETE FROM `rbac_role_permissions` WHERE `permissionId` BETWEEN @id AND @id+3; +INSERT INTO `rbac_role_permissions` (`roleId`, `permissionId`) VALUES +(2, @id+0), +(2, @id+1), +(2, @id+2), +(2, @id+3); diff --git a/sql/updates/world/2013_09_10_02_world_command.sql b/sql/updates/world/2013_09_10_02_world_command.sql new file mode 100644 index 00000000000..b3eaff43691 --- /dev/null +++ b/sql/updates/world/2013_09_10_02_world_command.sql @@ -0,0 +1,9 @@ +/* cs_pet.cpp */ + +SET @id = 479; + +-- Update command table with new RBAC permissions +UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'pet'; +UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'pet create'; +UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'pet learn'; +UPDATE `command` SET `permission` = @id+3 WHERE `name` = 'pet unlearn'; diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h index e03daba50bd..f42c985100e 100644 --- a/src/server/game/Accounts/RBAC.h +++ b/src/server/game/Accounts/RBAC.h @@ -378,6 +378,10 @@ enum RBACPermissions RBAC_PERM_COMMAND_GROUP_JOIN = 476, RBAC_PERM_COMMAND_GROUP_LIST = 477, RBAC_PERM_COMMAND_GROUP_SUMMON = 478, + RBAC_PERM_COMMAND_PET = 479, + RBAC_PERM_COMMAND_PET_CREATE = 480, + RBAC_PERM_COMMAND_PET_LEARN = 481, + RBAC_PERM_COMMAND_PET_UNLEARN = 482, // custom permissions 1000+ RBAC_PERM_MAX diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index c3b2b2038a3..8d7c807c9f2 100644 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -72,6 +72,7 @@ void AddSC_misc_commandscript(); void AddSC_mmaps_commandscript(); void AddSC_modify_commandscript(); void AddSC_npc_commandscript(); +void AddSC_pet_commandscript(); void AddSC_quest_commandscript(); void AddSC_rbac_commandscript(); void AddSC_reload_commandscript(); @@ -755,6 +756,7 @@ void AddCommandScripts() AddSC_modify_commandscript(); AddSC_npc_commandscript(); AddSC_quest_commandscript(); + AddSC_pet_commandscript(); AddSC_rbac_commandscript(); AddSC_reload_commandscript(); AddSC_reset_commandscript(); diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index ce7c3e0f3a1..87fa24a4c35 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -44,13 +44,6 @@ public: ChatCommand* GetCommands() const OVERRIDE { - static ChatCommand petCommandTable[] = - { - { "create", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleCreatePetCommand, "", NULL }, - { "learn", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandlePetLearnCommand, "", NULL }, - { "unlearn", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandlePetUnlearnCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; static ChatCommand sendCommandTable[] = { { "items", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleSendItemsCommand, "", NULL }, @@ -94,7 +87,6 @@ public: { "pinfo", RBAC_PERM_GAMEMASTER_COMMANDS, true, &HandlePInfoCommand, "", NULL }, { "respawn", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleRespawnCommand, "", NULL }, { "send", RBAC_PERM_MODERATOR_COMMANDS, true, NULL, "", sendCommandTable }, - { "pet", RBAC_PERM_GAMEMASTER_COMMANDS, false, NULL, "", petCommandTable }, { "mute", RBAC_PERM_MODERATOR_COMMANDS, true, &HandleMuteCommand, "", NULL }, { "unmute", RBAC_PERM_MODERATOR_COMMANDS, true, &HandleUnmuteCommand, "", NULL }, { "movegens", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleMovegensCommand, "", NULL }, @@ -2491,145 +2483,6 @@ public: return true; } - static bool HandleCreatePetCommand(ChatHandler* handler, char const* /*args*/) - { - Player* player = handler->GetSession()->GetPlayer(); - Creature* creatureTarget = handler->getSelectedCreature(); - - if (!creatureTarget || creatureTarget->IsPet() || creatureTarget->GetTypeId() == TYPEID_PLAYER) - { - handler->PSendSysMessage(LANG_SELECT_CREATURE); - handler->SetSentErrorMessage(true); - return false; - } - - CreatureTemplate const* creatrueTemplate = sObjectMgr->GetCreatureTemplate(creatureTarget->GetEntry()); - // Creatures with family 0 crashes the server - if (!creatrueTemplate->family) - { - handler->PSendSysMessage("This creature cannot be tamed. (family id: 0)."); - handler->SetSentErrorMessage(true); - return false; - } - - if (player->GetPetGUID()) - { - handler->PSendSysMessage("You already have a pet"); - handler->SetSentErrorMessage(true); - return false; - } - - // Everything looks OK, create new pet - Pet* pet = new Pet(player, HUNTER_PET); - if (!pet->CreateBaseAtCreature(creatureTarget)) - { - delete pet; - handler->PSendSysMessage("Error 1"); - return false; - } - - creatureTarget->setDeathState(JUST_DIED); - creatureTarget->RemoveCorpse(); - creatureTarget->SetHealth(0); // just for nice GM-mode view - - pet->SetUInt64Value(UNIT_FIELD_CREATEDBY, player->GetGUID()); - pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, player->getFaction()); - - if (!pet->InitStatsForLevel(creatureTarget->getLevel())) - { - TC_LOG_ERROR(LOG_FILTER_GENERAL, "InitStatsForLevel() in EffectTameCreature failed! Pet deleted."); - handler->PSendSysMessage("Error 2"); - delete pet; - return false; - } - - // prepare visual effect for levelup - pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->getLevel()-1); - - pet->GetCharmInfo()->SetPetNumber(sObjectMgr->GeneratePetNumber(), true); - // this enables pet details window (Shift+P) - pet->InitPetCreateSpells(); - pet->SetFullHealth(); - - pet->GetMap()->AddToMap(pet->ToCreature()); - - // visual effect for levelup - pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->getLevel()); - - player->SetMinion(pet, true); - pet->SavePetToDB(PET_SAVE_AS_CURRENT); - player->PetSpellInitialize(); - - return true; - } - - static bool HandlePetLearnCommand(ChatHandler* handler, char const* args) - { - if (!*args) - return false; - - Player* player = handler->GetSession()->GetPlayer(); - Pet* pet = player->GetPet(); - - if (!pet) - { - handler->PSendSysMessage("You have no pet"); - handler->SetSentErrorMessage(true); - return false; - } - - uint32 spellId = handler->extractSpellIdFromLink((char*)args); - - if (!spellId || !sSpellMgr->GetSpellInfo(spellId)) - return false; - - // Check if pet already has it - if (pet->HasSpell(spellId)) - { - handler->PSendSysMessage("Pet already has spell: %u", spellId); - handler->SetSentErrorMessage(true); - return false; - } - - // Check if spell is valid - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); - if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo)) - { - handler->PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spellId); - handler->SetSentErrorMessage(true); - return false; - } - - pet->learnSpell(spellId); - - handler->PSendSysMessage("Pet has learned spell %u", spellId); - return true; - } - - static bool HandlePetUnlearnCommand(ChatHandler* handler, char const* args) - { - if (!*args) - return false; - - Player* player = handler->GetSession()->GetPlayer(); - Pet* pet = player->GetPet(); - if (!pet) - { - handler->PSendSysMessage("You have no pet"); - handler->SetSentErrorMessage(true); - return false; - } - - uint32 spellId = handler->extractSpellIdFromLink((char*)args); - - if (pet->HasSpell(spellId)) - pet->removeSpell(spellId, false); - else - handler->PSendSysMessage("Pet doesn't have that spell"); - - return true; - } - static bool HandleFreezeCommand(ChatHandler* handler, char const* args) { std::string name; diff --git a/src/server/scripts/Commands/cs_pet.cpp b/src/server/scripts/Commands/cs_pet.cpp new file mode 100644 index 00000000000..237b25634c1 --- /dev/null +++ b/src/server/scripts/Commands/cs_pet.cpp @@ -0,0 +1,190 @@ +/* + * Copyright (C) 2008-2013 TrinityCore + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#include "Chat.h" +#include "Language.h" +#include "Pet.h" +#include "Player.h" +#include "ObjectMgr.h" +#include "ScriptMgr.h" + +class pet_commandscript : public CommandScript +{ +public: + pet_commandscript() : CommandScript("pet_commandscript") { } + + ChatCommand* GetCommands() const OVERRIDE + { + static ChatCommand petCommandTable[] = + { + { "create", RBAC_PERM_COMMAND_PET_CREATE, false, &HandlePetCreateCommand, "", NULL }, + { "learn", RBAC_PERM_COMMAND_PET_LEARN, false, &HandlePetLearnCommand, "", NULL }, + { "unlearn", RBAC_PERM_COMMAND_PET_UNLEARN, false, &HandlePetUnlearnCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; + + static ChatCommand commandTable[] = + { + { "pet", RBAC_PERM_COMMAND_PET, false, NULL, "", petCommandTable }, + { NULL, 0, false, NULL, "", NULL } + }; + return commandTable; + } + static bool HandlePetCreateCommand(ChatHandler* handler, char const* /*args*/) + { + Player* player = handler->GetSession()->GetPlayer(); + Creature* creatureTarget = handler->getSelectedCreature(); + + if (!creatureTarget || creatureTarget->IsPet() || creatureTarget->GetTypeId() == TYPEID_PLAYER) + { + handler->PSendSysMessage(LANG_SELECT_CREATURE); + handler->SetSentErrorMessage(true); + return false; + } + + CreatureTemplate const* creatrueTemplate = sObjectMgr->GetCreatureTemplate(creatureTarget->GetEntry()); + // Creatures with family 0 crashes the server + if (!creatrueTemplate->family) + { + handler->PSendSysMessage("This creature cannot be tamed. (family id: 0)."); + handler->SetSentErrorMessage(true); + return false; + } + + if (player->GetPetGUID()) + { + handler->PSendSysMessage("You already have a pet"); + handler->SetSentErrorMessage(true); + return false; + } + + // Everything looks OK, create new pet + Pet* pet = new Pet(player, HUNTER_PET); + if (!pet->CreateBaseAtCreature(creatureTarget)) + { + delete pet; + handler->PSendSysMessage("Error 1"); + return false; + } + + creatureTarget->setDeathState(JUST_DIED); + creatureTarget->RemoveCorpse(); + creatureTarget->SetHealth(0); // just for nice GM-mode view + + pet->SetUInt64Value(UNIT_FIELD_CREATEDBY, player->GetGUID()); + pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, player->getFaction()); + + if (!pet->InitStatsForLevel(creatureTarget->getLevel())) + { + TC_LOG_ERROR(LOG_FILTER_GENERAL, "InitStatsForLevel() in EffectTameCreature failed! Pet deleted."); + handler->PSendSysMessage("Error 2"); + delete pet; + return false; + } + + // prepare visual effect for levelup + pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->getLevel()-1); + + pet->GetCharmInfo()->SetPetNumber(sObjectMgr->GeneratePetNumber(), true); + // this enables pet details window (Shift+P) + pet->InitPetCreateSpells(); + pet->SetFullHealth(); + + pet->GetMap()->AddToMap(pet->ToCreature()); + + // visual effect for levelup + pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->getLevel()); + + player->SetMinion(pet, true); + pet->SavePetToDB(PET_SAVE_AS_CURRENT); + player->PetSpellInitialize(); + + return true; + } + + static bool HandlePetLearnCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + Player* player = handler->GetSession()->GetPlayer(); + Pet* pet = player->GetPet(); + + if (!pet) + { + handler->PSendSysMessage("You have no pet"); + handler->SetSentErrorMessage(true); + return false; + } + + uint32 spellId = handler->extractSpellIdFromLink((char*)args); + + if (!spellId || !sSpellMgr->GetSpellInfo(spellId)) + return false; + + // Check if pet already has it + if (pet->HasSpell(spellId)) + { + handler->PSendSysMessage("Pet already has spell: %u", spellId); + handler->SetSentErrorMessage(true); + return false; + } + + // Check if spell is valid + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); + if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo)) + { + handler->PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spellId); + handler->SetSentErrorMessage(true); + return false; + } + + pet->learnSpell(spellId); + + handler->PSendSysMessage("Pet has learned spell %u", spellId); + return true; + } + + static bool HandlePetUnlearnCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + Player* player = handler->GetSession()->GetPlayer(); + Pet* pet = player->GetPet(); + if (!pet) + { + handler->PSendSysMessage("You have no pet"); + handler->SetSentErrorMessage(true); + return false; + } + + uint32 spellId = handler->extractSpellIdFromLink((char*)args); + + if (pet->HasSpell(spellId)) + pet->removeSpell(spellId, false); + else + handler->PSendSysMessage("Pet doesn't have that spell"); + + return true; + } +}; + +void AddSC_pet_commandscript() +{ + new pet_commandscript(); +} -- cgit v1.2.3 From 356ba1e0ce29c12815d927e3c87193f3f877071f Mon Sep 17 00:00:00 2001 From: Filip Date: Tue, 10 Sep 2013 12:10:26 +0200 Subject: DB/SAI: The Zephyrium Capacitorium(part 1), The Singing Ridge(part 2), Razaan's Landing, Ruuan Weald Fixes #6322 Fixes #6323 Fixes #6324 --- sql/updates/world/2013_09_10_03_world_sai.sql | 136 ++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 sql/updates/world/2013_09_10_03_world_sai.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_10_03_world_sai.sql b/sql/updates/world/2013_09_10_03_world_sai.sql new file mode 100644 index 00000000000..f2243983707 --- /dev/null +++ b/sql/updates/world/2013_09_10_03_world_sai.sql @@ -0,0 +1,136 @@ +-- Test Flight Quests +-- 10557 - The Zephyrium Capacitorium(part 1) +-- 10710 - The Singing Ridge(part 2) +-- 10711 - Razaan's Landing +-- 10712 - Ruuan Weald +SET @ENTRY := 21461; -- Rally Zapnabber +SET @ENTRY2 := 21393; -- Cannon Channeler Dummy npc +SET @BEAM := 36795; -- Cannon Channel(dnd) - Visual cannon beam +SET @MENUID := 8304; -- Gossip +SET @A_MENU := 8454; -- Action Gossip +SET @A_MENU2 := 8455; -- Action Gossip 2 +SET @OPTION := 0; +SET @SPEACH := 10360; -- Text 1 +SET @SPEACH2 := 10561; -- Text 2 + +-- Disable obsolete quest +DELETE FROM `disables` WHERE `entry`=10716; +INSERT INTO `disables` (`sourceType`, `entry`, `flags`, `params_0`, `params_1`, `comment`) VALUES +(1,10716,0,'','','Deprecated quest Test Flight: Raven''s Wood'); +-- Make Canon Channeler float & Update position to match cannon +UPDATE `creature_template` SET `InhabitType`=4, `modelid1`= 11686 ,`modelid2`=0 WHERE `entry`=@ENTRY2; +UPDATE `creature` SET `position_x`=1924.6457, `position_y`= 5575.660, `position_z`=272.1429 WHERE `guid`=74872;-- Gossip & menus 1924.1457, 5575.647, 272.1429 + +UPDATE `creature_template` SET `gossip_menu_id`=@MENUID, `AIName`= 'SmartAI' WHERE `entry`=@ENTRY; +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRY2; +DELETE FROM `gossip_menu` WHERE `entry` IN (@MENUID,@A_MENU); +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(@MENUID,@SPEACH), +(@A_MENU,@SPEACH2); + +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (@MENUID,@A_MENU2,@A_MENU); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`) VALUES +(@MENUID,@OPTION+0,0,'I''m ready for my test flight!',1,1,0,0,0,0,''), -- Test Flight: The Zephyrium Capacitorium +(@MENUID,@OPTION+1,0,'Take me to Singing Ridge!',1,1,@A_MENU,0,0,0,''), -- Test Flight: The Singing Ridge +(@MENUID,@OPTION+2,0,'Take me to Razaan''s Landing!',1,1,0,0,0,0,''), -- Test Flight: Razaan's Landing +(@MENUID,@OPTION+3,0,'Take me to Ruuan Weald!',1,1,0,0,0,0,''), -- Test Flight: Ruuan Weald +(@MENUID,@OPTION+4,0,'I want to fly to an old location!',1,1,@A_MENU2,0,0,0,''), -- Old locations from completed quests +(@A_MENU2,@OPTION+1,0,'Take me to Singing Ridge.',1,1,0,0,0,0,''), +(@A_MENU2,@OPTION+2,0,'Take me to Razaan''s Landing.',1,1,0,0,0,0,''), +(@A_MENU2,@OPTION+3,0,'Take me to Ruuan Weald.',1,1,0,0,0,0,''), +(@A_MENU,@OPTION+0,0,'I have the signed Waiver! Fire me into The Singing Ridge!',1,1,0,0,0,0,''); + +-- Fix teleport spell position +DELETE FROM `spell_target_position` WHERE `Id` IN(37908,24831); +INSERT INTO `spell_target_position` (`id`, `effIndex`, `target_map`, `target_position_x`, `target_position_y`, `target_position_z`, `target_orientation`) VALUES +(24831, 0, 530, 1920.07, 5582.04, 269.222, 5.1846); + +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`= 37908; +INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES +(37908, 24831, 0, 'Aura Visual Teleport - teleport'); + +-- SAI +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY,@ENTRY*100,@ENTRY*101,@ENTRY*102,@ENTRY*103,@ENTRY2); +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,1,62,0,100,0,@MENUID,@OPTION+0,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Rally Zapnabber - On gossip option select - Run script'), +(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Rally Zapnabber - On gossip option select - Close gossip'), +(@ENTRY,0,2,3,62,0,100,0,@A_MENU,@OPTION+0,0,0,80,@ENTRY*101,0,0,0,0,0,1,0,0,0,0,0,0,0,'Rally Zapnabber - On gossip option select - Run script'), +(@ENTRY,0,3,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Rally Zapnabber - On gossip option select - Close gossip'), +(@ENTRY,0,4,5,62,0,100,0,@MENUID,@OPTION+2,0,0,80,@ENTRY*102,0,0,0,0,0,1,0,0,0,0,0,0,0,'Rally Zapnabber - On gossip option select - Run script'), +(@ENTRY,0,5,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Rally Zapnabber - On gossip option select - Close gossip'), +(@ENTRY,0,6,7,62,0,100,0,@MENUID,@OPTION+3,0,0,80,@ENTRY*103,0,0,0,0,0,1,0,0,0,0,0,0,0,'Rally Zapnabber - On gossip option select - Run script'), +(@ENTRY,0,7,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Rally Zapnabber - On gossip option select - Close gossip'), + +(@ENTRY,0,8,9,62,0,100,0,@A_MENU2,@OPTION+1,0,0,80,@ENTRY*101,0,0,0,0,0,1,0,0,0,0,0,0,0,'Rally Zapnabber - On gossip option select - Run script'), +(@ENTRY,0,9,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Rally Zapnabber - On gossip option select - Close gossip'), +(@ENTRY,0,10,11,62,0,100,0,@A_MENU2,@OPTION+2,0,0,80,@ENTRY*102,0,0,0,0,0,1,0,0,0,0,0,0,0,'Rally Zapnabber - On gossip option select - Run script'), +(@ENTRY,0,11,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Rally Zapnabber - On gossip option select - Close gossip'), +(@ENTRY,0,12,13,62,0,100,0,@A_MENU2,@OPTION+3,0,0,80,@ENTRY*103,0,0,0,0,0,1,0,0,0,0,0,0,0,'Rally Zapnabber - On gossip option select - Run script'), +(@ENTRY,0,13,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Rally Zapnabber - On gossip option select - Close gossip'), +-- +(@ENTRY*100,9,0,0,1,0,100,0,2000,2000,2000,2000,85,37908,0,0,0,0,0,7,0,0,0,0,0,0,0,'The Zephyrium Capacitorium - After 2 seconds - Port visual'), +(@ENTRY*100,9,1,0,1,0,100,0,2000,2000,2000,2000,45,1,1,0,0,0,0,10,74872,@ENTRY2,0,0,0,0,0,'The Zephyrium Capacitorium - After 2 seconds - Port visual'), +(@ENTRY*100,9,2,0,1,0,100,0,3000,3000,3000,3000,85,36790,0,0,0,0,0,7,0,0,0,0,0,0,0,'The Zephyrium Capacitorium - OOC Update - Invoker,cast charge state 2'), +(@ENTRY*100,9,3,0,1,0,100,0,3000,3000,3000,3000,85,36792,0,0,0,0,0,7,0,0,0,0,0,0,0,'The Zephyrium Capacitorium - OOC Update - Invoker,cast charge state 3'), +(@ENTRY*100,9,4,0,1,0,100,0,3000,3000,3000,3000,85,36800,0,0,0,0,0,7,0,0,0,0,0,0,0,'The Zephyrium Capacitorium - OOC Update - Invoker,cast charge state 4'), +(@ENTRY*100,9,5,0,1,0,100,0,3000,3000,3000,3000,85,37910,0,0,0,0,0,7,0,0,0,0,0,0,0,'The Zephyrium Capacitorium - OOC Update - Invoker,cast Soar&Credit'), +(@ENTRY*100,9,6,0,1,0,100,0,0,0,0,0,85,37108,0,0,0,0,0,7,0,0,0,0,0,0,0,'The Zephyrium Capacitorium - OOC Update - Invoker,cast Debuff'), +-- +(@ENTRY*101,9,0,0,1,0,100,0,2000,2000,2000,2000,85,37908,0,0,0,0,0,7,0,0,0,0,0,0,0,'The Singing Ridge - After 2 seconds - Port visual'), +(@ENTRY*101,9,1,0,1,0,100,0,2000,2000,2000,2000,45,1,1,0,0,0,0,10,74872,@ENTRY2,0,0,0,0,0,'The Zephyrium Capacitorium - After 2 seconds - Set Data on Channeler'), +(@ENTRY*101,9,2,0,1,0,100,0,3000,3000,3000,3000,85,36790,0,0,0,0,0,7,0,0,0,0,0,0,0,'The Singing Ridge - OOC Update - Invoker,cast charge state 2'), +(@ENTRY*101,9,3,0,1,0,100,0,3000,3000,3000,3000,85,36792,0,0,0,0,0,7,0,0,0,0,0,0,0,'The Singing Ridge - OOC Update - Invoker,cast charge state 3'), +(@ENTRY*101,9,4,0,1,0,100,0,3000,3000,3000,3000,85,36800,0,0,0,0,0,7,0,0,0,0,0,0,0,'The Singing Ridge - OOC Update - Invoker,cast charge state 4'), +(@ENTRY*101,9,5,0,1,0,100,0,3000,3000,3000,3000,85,37962,0,0,0,0,0,7,0,0,0,0,0,0,0,'The Singing Ridge - OOC Update - Invoker,cast Soar&Credit'), +(@ENTRY*101,9,6,0,1,0,100,0,0,0,0,0,85,37108,0,0,0,0,0,7,0,0,0,0,0,0,0,'The Singing Ridge - OOC Update - Invoker,cast Debuff'), +-- +(@ENTRY*102,9,0,0,1,0,100,0,2000,2000,2000,2000,85,37908,0,0,0,0,0,7,0,0,0,0,0,0,0,'Razaan''s Landing - After 2 seconds - Port visual'), +(@ENTRY*102,9,1,0,1,0,100,0,2000,2000,2000,2000,45,1,1,0,0,0,0,10,74872,@ENTRY2,0,0,0,0,0,'The Zephyrium Capacitorium - After 2 seconds - Set Data on Channeler'), +(@ENTRY*102,9,2,0,1,0,100,0,3000,3000,3000,3000,85,36790,0,0,0,0,0,7,0,0,0,0,0,0,0,'Razaan''s Landing - OOC Update - Invoker,cast charge state 2'), +(@ENTRY*102,9,3,0,1,0,100,0,3000,3000,3000,3000,85,36792,0,0,0,0,0,7,0,0,0,0,0,0,0,'Razaan''s Landing - OOC Update - Invoker,cast charge state 3'), +(@ENTRY*102,9,4,0,1,0,100,0,3000,3000,3000,3000,85,36800,0,0,0,0,0,7,0,0,0,0,0,0,0,'Razaan''s Landing - OOC Update - Invoker,cast charge state 4'), +(@ENTRY*102,9,5,0,1,0,100,0,3000,3000,3000,3000,85,36812,0,0,0,0,0,7,0,0,0,0,0,0,0,'Razaan''s Landing - OOC Update - Invoker,cast Soar&Credit'), +(@ENTRY*102,9,6,0,1,0,100,0,0,0,0,0,85,37108,0,0,0,0,0,7,0,0,0,0,0,0,0,'Razaan''s Landing - OOC Update - Invoker,cast Debuff'), +-- +(@ENTRY*103,9,0,0,1,0,100,0,2000,2000,2000,2000,85,37908,0,0,0,0,0,7,0,0,0,0,0,0,0,'Ruuan Weald - After 2 seconds - Port visual'), +(@ENTRY*103,9,1,0,1,0,100,0,2000,2000,2000,2000,45,1,1,0,0,0,0,10,74872,@ENTRY2,0,0,0,0,0,'The Zephyrium Capacitorium - After 2 seconds - Set Data on Channeler'), +(@ENTRY*103,9,2,0,1,0,100,0,3000,3000,3000,3000,85,36790,0,0,0,0,0,7,0,0,0,0,0,0,0,'Ruuan Weald - OOC Update - Invoker,cast charge state 2'), +(@ENTRY*103,9,3,0,1,0,100,0,3000,3000,3000,3000,85,36792,0,0,0,0,0,7,0,0,0,0,0,0,0,'Ruuan Weald - OOC Update - Invoker,cast charge state 3'), +(@ENTRY*103,9,4,0,1,0,100,0,3000,3000,3000,3000,85,36800,0,0,0,0,0,7,0,0,0,0,0,0,0,'Ruuan Weald - OOC Update - Invoker,cast charge state 4'), +(@ENTRY*103,9,5,0,1,0,100,0,3000,3000,3000,3000,85,37968,0,0,0,0,0,7,0,0,0,0,0,0,0,'Ruuan Weald - OOC Update - Invoker,cast Soar&Credit'), +(@ENTRY*103,9,6,0,1,0,100,0,0,0,0,0,85,37108,0,0,0,0,0,7,0,0,0,0,0,0,0,'Ruuan Weald - OOC Update - Invoker,cast Debuff'), +-- +(@ENTRY2,0,0,0,38,0,100,0,1,1,0,0,11,36795,0,0,0,0,0,1,0,0,0,0,0,0,0,'Beam Channel Bunny - On Data Set - Cast Cannon Beam'); + +DELETE FROM `conditions` WHERE `SourceEntry`=@BEAM OR `SourceGroup` IN (@MENUID,@A_MENU2,@A_MENU); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(15, @A_MENU2, 3, 0, 0, 1, 0, 37108, 0, 0, 1, 0, 0, '', 'Show gossip option 3 if player does not have aura Zephyrium Charged'), +(15, @A_MENU2, 3, 0, 0, 8, 0, 10712, 0, 0, 0, 0, 0, '', 'Show gossip option 3 if player has quest Ruuan Weald marked as rewarded'), +(15, @A_MENU2, 2, 0, 0, 8, 0, 10711, 0, 0, 0, 0, 0, '', 'Show gossip option 2 if player has quest Razaan''s Landing marked as rewarded'), +(15, @A_MENU2, 2, 0, 0, 1, 0, 37108, 0, 0, 1, 0, 0, '', 'Show gossip option 2 if player does not have aura Zephyrium Charged'), +(15, @A_MENU2, 1, 0, 0, 1, 0, 37108, 0, 0, 1, 0, 0, '', 'Show gossip option 1 if player does not have aura Zephyrium Charged'), +(15, @A_MENU2, 1, 0, 0, 8, 0, 10710, 0, 0, 0, 0, 0, '', 'Show gossip option 1 if player has quest The Singing Ridge marked as rewarded'), +(15, @A_MENU2, 4, 0, 0, 8, 0, 10557, 0, 0, 0, 0, 0, '', 'Show gossip option 4 if player has quest The Zephyrium Capacitorium marked as rewarded'), +(15, @A_MENU, 0, 0, 0, 2, 0, 30539, 1, 0, 0, 0, 0, '', 'Show gossip option 0 if player has item Tally''s Waiver (Signed)'), +(15, @MENUID, 3, 0, 0, 9, 0, 10712, 0, 0, 0, 0, 0, '', 'Show gossip option 3 if player has quest Ruuan Weald marked as taken'), +(15, @MENUID, 3, 0, 0, 1, 0, 37108, 0, 0, 1, 0, 0, '', 'Show gossip option 3 if player does not have aura Zephyrium Charged'), +(15, @MENUID, 2, 0, 0, 9, 0, 10711, 0, 0, 0, 0, 0, '', 'Show gossip option 2 if player has quest Razaan''s Landing marked as taken'), +(15, @MENUID, 2, 0, 0, 1, 0, 37108, 0, 0, 1, 0, 0, '', 'Show gossip option 2 if player does not have aura Zephyrium Charged'), +(15, @MENUID, 1, 0, 0, 9, 0, 10710, 0, 0, 0, 0, 0, '', 'Show gossip option 1 if player has quest The Singing Ridge marked as taken'), +(15, @MENUID, 1, 0, 0, 1, 0, 37108, 0, 0, 1, 0, 0, '', 'Show gossip option 1 if player does not have aura Zephyrium Charged'), +(15, @MENUID, 0, 0, 0, 9, 0, 10557, 0, 0, 0, 0, 0, '', 'Show gossip option 0 if player has quest The Zephyrium Capacitorium marked as taken'), +(15, @MENUID, 0, 0, 0, 1, 0, 37108, 0, 0, 1, 0, 0, '', 'Show gossip option 0 if player does not have aura Zephyrium Charged'), +-- +(13, 1, 36795, 0, 0, 31, 0, 4, 0, 0, 0, 0, 0, '', 'Spell Cannon Channel(dnd) target player'); + +-- SAI for Rally (Questgiver) +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=21460; +DELETE FROM `smart_scripts` WHERE `entryorguid`=21460; +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 +(21460,0,0,1,62,0,100,0,8303,0,0,0,56,30540,1,0,0,0,0,7,0,0,0,0,0,0,0,'Rally Zapnabber - On gossip option select - Give Item '), +(21460,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Rally Zapnabber - On gossip option select - Close gossip'); + +DELETE FROM `conditions` WHERE `SourceGroup` = 8303; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(15, 8303, 0, 0, 0, 2, 0, 30540, 1, 1, 1, 0, 0, '', 'Only allow gossip option to be visible if player doesn''t have item'), +(15, 8303, 0, 0, 0, 9, 0, 10710, 0, 0, 0, 0, 0, '', 'Only allow gossip option to be visible if player has quest taken'); -- cgit v1.2.3 From 62a4d53fe7b787e1ef4aa5cbe35710ad3c6fc95d Mon Sep 17 00:00:00 2001 From: Filip Date: Tue, 10 Sep 2013 12:14:01 +0200 Subject: Because I hate tabs --- sql/updates/world/2013_09_10_03_world_sai.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sql') diff --git a/sql/updates/world/2013_09_10_03_world_sai.sql b/sql/updates/world/2013_09_10_03_world_sai.sql index f2243983707..26816b6f72f 100644 --- a/sql/updates/world/2013_09_10_03_world_sai.sql +++ b/sql/updates/world/2013_09_10_03_world_sai.sql @@ -7,8 +7,8 @@ SET @ENTRY := 21461; -- Rally Zapnabber SET @ENTRY2 := 21393; -- Cannon Channeler Dummy npc SET @BEAM := 36795; -- Cannon Channel(dnd) - Visual cannon beam SET @MENUID := 8304; -- Gossip -SET @A_MENU := 8454; -- Action Gossip -SET @A_MENU2 := 8455; -- Action Gossip 2 +SET @A_MENU := 8454; -- Action Gossip +SET @A_MENU2 := 8455; -- Action Gossip 2 SET @OPTION := 0; SET @SPEACH := 10360; -- Text 1 SET @SPEACH2 := 10561; -- Text 2 -- cgit v1.2.3 From ec1e88d888a7a2ef16b814e505fba24be47a93e5 Mon Sep 17 00:00:00 2001 From: Spp Date: Tue, 10 Sep 2013 12:16:28 +0200 Subject: Core/RBAC: Move send commands to RBAC (using individual permissions) --- sql/updates/auth/2013_09_10_01_auth_misc.sql | 10 +- sql/updates/auth/2013_09_10_02_auth_misc.sql | 21 ++ sql/updates/world/2013_09_10_04_world_command.sql | 10 + src/server/game/Accounts/RBAC.h | 5 + src/server/game/Scripting/ScriptLoader.cpp | 2 + src/server/scripts/Commands/cs_misc.cpp | 244 ------------------ src/server/scripts/Commands/cs_send.cpp | 289 ++++++++++++++++++++++ 7 files changed, 332 insertions(+), 249 deletions(-) create mode 100644 sql/updates/auth/2013_09_10_02_auth_misc.sql create mode 100644 sql/updates/world/2013_09_10_04_world_command.sql create mode 100644 src/server/scripts/Commands/cs_send.cpp (limited to 'sql') diff --git a/sql/updates/auth/2013_09_10_01_auth_misc.sql b/sql/updates/auth/2013_09_10_01_auth_misc.sql index 92d68874b4b..2dbfbcaaf46 100644 --- a/sql/updates/auth/2013_09_10_01_auth_misc.sql +++ b/sql/updates/auth/2013_09_10_01_auth_misc.sql @@ -1,6 +1,6 @@ /* cs_pet.cpp */ -SET @id = 472; +SET @id = 479; -- Add new permissions DELETE FROM `rbac_permissions` WHERE `id` BETWEEN @id AND @id+3; @@ -13,7 +13,7 @@ INSERT INTO `rbac_permissions` (`id`, `name`) VALUES -- Add permissions to "corresponding Commands Role" DELETE FROM `rbac_role_permissions` WHERE `permissionId` BETWEEN @id AND @id+3; INSERT INTO `rbac_role_permissions` (`roleId`, `permissionId`) VALUES -(2, @id+0), -(2, @id+1), -(2, @id+2), -(2, @id+3); +(3, @id+0), +(3, @id+1), +(3, @id+2), +(3, @id+3); diff --git a/sql/updates/auth/2013_09_10_02_auth_misc.sql b/sql/updates/auth/2013_09_10_02_auth_misc.sql new file mode 100644 index 00000000000..2049cda2ffc --- /dev/null +++ b/sql/updates/auth/2013_09_10_02_auth_misc.sql @@ -0,0 +1,21 @@ +/* cs_send.cpp */ + +SET @id = 483; + +-- Add new permissions +DELETE FROM `rbac_permissions` WHERE `id` BETWEEN @id AND @id+4; +INSERT INTO `rbac_permissions` (`id`, `name`) VALUES +(@id+0 , 'send'), +(@id+1 , 'send items'), +(@id+2 , 'send mail'), +(@id+3 , 'send message'), +(@id+4 , 'send money'); + +-- Add permissions to "corresponding Commands Role" +DELETE FROM `rbac_role_permissions` WHERE `permissionId` BETWEEN @id AND @id+4; +INSERT INTO `rbac_role_permissions` (`roleId`, `permissionId`) VALUES +(2, @id+0), +(2, @id+1), +(3, @id+2), +(3, @id+3), +(3, @id+4); diff --git a/sql/updates/world/2013_09_10_04_world_command.sql b/sql/updates/world/2013_09_10_04_world_command.sql new file mode 100644 index 00000000000..a49c65fe9e5 --- /dev/null +++ b/sql/updates/world/2013_09_10_04_world_command.sql @@ -0,0 +1,10 @@ +/* cs_send.cpp */ + +SET @id = 483; + +-- Update command table with new RBAC permissions +UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'send'; +UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'send items'; +UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'send mail'; +UPDATE `command` SET `permission` = @id+3 WHERE `name` = 'send message'; +UPDATE `command` SET `permission` = @id+4 WHERE `name` = 'send money'; diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h index f42c985100e..57b47565f5d 100644 --- a/src/server/game/Accounts/RBAC.h +++ b/src/server/game/Accounts/RBAC.h @@ -382,6 +382,11 @@ enum RBACPermissions RBAC_PERM_COMMAND_PET_CREATE = 480, RBAC_PERM_COMMAND_PET_LEARN = 481, RBAC_PERM_COMMAND_PET_UNLEARN = 482, + RBAC_PERM_COMMAND_SEND = 483, + RBAC_PERM_COMMAND_SEND_ITEMS = 484, + RBAC_PERM_COMMAND_SEND_MAIL = 485, + RBAC_PERM_COMMAND_SEND_MESSAGE = 486, + RBAC_PERM_COMMAND_SEND_MONEY = 487, // custom permissions 1000+ RBAC_PERM_MAX diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 8d7c807c9f2..31323a66ba9 100644 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -77,6 +77,7 @@ void AddSC_quest_commandscript(); void AddSC_rbac_commandscript(); void AddSC_reload_commandscript(); void AddSC_reset_commandscript(); +void AddSC_send_commandscript(); void AddSC_server_commandscript(); void AddSC_tele_commandscript(); void AddSC_ticket_commandscript(); @@ -760,6 +761,7 @@ void AddCommandScripts() AddSC_rbac_commandscript(); AddSC_reload_commandscript(); AddSC_reset_commandscript(); + AddSC_send_commandscript(); AddSC_server_commandscript(); AddSC_tele_commandscript(); AddSC_ticket_commandscript(); diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 87fa24a4c35..24d9aefcda7 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -44,14 +44,6 @@ public: ChatCommand* GetCommands() const OVERRIDE { - static ChatCommand sendCommandTable[] = - { - { "items", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleSendItemsCommand, "", NULL }, - { "mail", RBAC_PERM_MODERATOR_COMMANDS, true, &HandleSendMailCommand, "", NULL }, - { "message", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleSendMessageCommand, "", NULL }, - { "money", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleSendMoneyCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; static ChatCommand commandTable[] = { { "dev", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleDevCommand, "", NULL }, @@ -86,7 +78,6 @@ public: { "setskill", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleSetSkillCommand, "", NULL }, { "pinfo", RBAC_PERM_GAMEMASTER_COMMANDS, true, &HandlePInfoCommand, "", NULL }, { "respawn", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleRespawnCommand, "", NULL }, - { "send", RBAC_PERM_MODERATOR_COMMANDS, true, NULL, "", sendCommandTable }, { "mute", RBAC_PERM_MODERATOR_COMMANDS, true, &HandleMuteCommand, "", NULL }, { "unmute", RBAC_PERM_MODERATOR_COMMANDS, true, &HandleUnmuteCommand, "", NULL }, { "movegens", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleMovegensCommand, "", NULL }, @@ -2248,241 +2239,6 @@ public: return true; } - // Send mail by command - static bool HandleSendMailCommand(ChatHandler* handler, char const* args) - { - // format: name "subject text" "mail text" - Player* target; - uint64 targetGuid; - std::string targetName; - if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) - return false; - - char* tail1 = strtok(NULL, ""); - if (!tail1) - return false; - - char const* msgSubject = handler->extractQuotedArg(tail1); - if (!msgSubject) - return false; - - char* tail2 = strtok(NULL, ""); - if (!tail2) - return false; - - char const* msgText = handler->extractQuotedArg(tail2); - if (!msgText) - return false; - - // msgSubject, msgText isn't NUL after prev. check - std::string subject = msgSubject; - std::string text = msgText; - - // from console show not existed sender - MailSender sender(MAIL_NORMAL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM); - - /// @todo Fix poor design - SQLTransaction trans = CharacterDatabase.BeginTransaction(); - MailDraft(subject, text) - .SendMailTo(trans, MailReceiver(target, GUID_LOPART(targetGuid)), sender); - - CharacterDatabase.CommitTransaction(trans); - - std::string nameLink = handler->playerLink(targetName); - handler->PSendSysMessage(LANG_MAIL_SENT, nameLink.c_str()); - return true; - } - // Send items by mail - static bool HandleSendItemsCommand(ChatHandler* handler, char const* args) - { - // format: name "subject text" "mail text" item1[:count1] item2[:count2] ... item12[:count12] - Player* receiver; - uint64 receiverGuid; - std::string receiverName; - if (!handler->extractPlayerTarget((char*)args, &receiver, &receiverGuid, &receiverName)) - return false; - - char* tail1 = strtok(NULL, ""); - if (!tail1) - return false; - - char const* msgSubject = handler->extractQuotedArg(tail1); - if (!msgSubject) - return false; - - char* tail2 = strtok(NULL, ""); - if (!tail2) - return false; - - char const* msgText = handler->extractQuotedArg(tail2); - if (!msgText) - return false; - - // msgSubject, msgText isn't NUL after prev. check - std::string subject = msgSubject; - std::string text = msgText; - - // extract items - typedef std::pair ItemPair; - typedef std::list< ItemPair > ItemPairs; - ItemPairs items; - - // get all tail string - char* tail = strtok(NULL, ""); - - // get from tail next item str - while (char* itemStr = strtok(tail, " ")) - { - // and get new tail - tail = strtok(NULL, ""); - - // parse item str - char const* itemIdStr = strtok(itemStr, ":"); - char const* itemCountStr = strtok(NULL, " "); - - uint32 itemId = atoi(itemIdStr); - if (!itemId) - return false; - - ItemTemplate const* item_proto = sObjectMgr->GetItemTemplate(itemId); - if (!item_proto) - { - handler->PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, itemId); - handler->SetSentErrorMessage(true); - return false; - } - - uint32 itemCount = itemCountStr ? atoi(itemCountStr) : 1; - if (itemCount < 1 || (item_proto->MaxCount > 0 && itemCount > uint32(item_proto->MaxCount))) - { - handler->PSendSysMessage(LANG_COMMAND_INVALID_ITEM_COUNT, itemCount, itemId); - handler->SetSentErrorMessage(true); - return false; - } - - while (itemCount > item_proto->GetMaxStackSize()) - { - items.push_back(ItemPair(itemId, item_proto->GetMaxStackSize())); - itemCount -= item_proto->GetMaxStackSize(); - } - - items.push_back(ItemPair(itemId, itemCount)); - - if (items.size() > MAX_MAIL_ITEMS) - { - handler->PSendSysMessage(LANG_COMMAND_MAIL_ITEMS_LIMIT, MAX_MAIL_ITEMS); - handler->SetSentErrorMessage(true); - return false; - } - } - - // from console show not existed sender - MailSender sender(MAIL_NORMAL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM); - - // fill mail - MailDraft draft(subject, text); - - SQLTransaction trans = CharacterDatabase.BeginTransaction(); - - for (ItemPairs::const_iterator itr = items.begin(); itr != items.end(); ++itr) - { - if (Item* item = Item::CreateItem(itr->first, itr->second, handler->GetSession() ? handler->GetSession()->GetPlayer() : 0)) - { - item->SaveToDB(trans); // save for prevent lost at next mail load, if send fail then item will deleted - draft.AddItem(item); - } - } - - draft.SendMailTo(trans, MailReceiver(receiver, GUID_LOPART(receiverGuid)), sender); - CharacterDatabase.CommitTransaction(trans); - - std::string nameLink = handler->playerLink(receiverName); - handler->PSendSysMessage(LANG_MAIL_SENT, nameLink.c_str()); - return true; - } - /// Send money by mail - static bool HandleSendMoneyCommand(ChatHandler* handler, char const* args) - { - /// format: name "subject text" "mail text" money - - Player* receiver; - uint64 receiverGuid; - std::string receiverName; - if (!handler->extractPlayerTarget((char*)args, &receiver, &receiverGuid, &receiverName)) - return false; - - char* tail1 = strtok(NULL, ""); - if (!tail1) - return false; - - char* msgSubject = handler->extractQuotedArg(tail1); - if (!msgSubject) - return false; - - char* tail2 = strtok(NULL, ""); - if (!tail2) - return false; - - char* msgText = handler->extractQuotedArg(tail2); - if (!msgText) - return false; - - char* moneyStr = strtok(NULL, ""); - int32 money = moneyStr ? atoi(moneyStr) : 0; - if (money <= 0) - return false; - - // msgSubject, msgText isn't NUL after prev. check - std::string subject = msgSubject; - std::string text = msgText; - - // from console show not existed sender - MailSender sender(MAIL_NORMAL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM); - - SQLTransaction trans = CharacterDatabase.BeginTransaction(); - - MailDraft(subject, text) - .AddMoney(money) - .SendMailTo(trans, MailReceiver(receiver, GUID_LOPART(receiverGuid)), sender); - - CharacterDatabase.CommitTransaction(trans); - - std::string nameLink = handler->playerLink(receiverName); - handler->PSendSysMessage(LANG_MAIL_SENT, nameLink.c_str()); - return true; - } - /// Send a message to a player in game - static bool HandleSendMessageCommand(ChatHandler* handler, char const* args) - { - /// - Find the player - Player* player; - if (!handler->extractPlayerTarget((char*)args, &player)) - return false; - - char* msgStr = strtok(NULL, ""); - if (!msgStr) - return false; - - ///- Check that he is not logging out. - if (player->GetSession()->isLogingOut()) - { - handler->SendSysMessage(LANG_PLAYER_NOT_FOUND); - handler->SetSentErrorMessage(true); - return false; - } - - /// - Send the message - // Use SendAreaTriggerMessage for fastest delivery. - player->GetSession()->SendAreaTriggerMessage("%s", msgStr); - player->GetSession()->SendAreaTriggerMessage("|cffff0000[Message from administrator]:|r"); - - // Confirmation message - std::string nameLink = handler->GetNameLink(player); - handler->PSendSysMessage(LANG_SENDMESSAGE, nameLink.c_str(), msgStr); - - return true; - } - static bool HandleFreezeCommand(ChatHandler* handler, char const* args) { std::string name; diff --git a/src/server/scripts/Commands/cs_send.cpp b/src/server/scripts/Commands/cs_send.cpp new file mode 100644 index 00000000000..5d50113249a --- /dev/null +++ b/src/server/scripts/Commands/cs_send.cpp @@ -0,0 +1,289 @@ +/* + * Copyright (C) 2008-2013 TrinityCore + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#include "Chat.h" +#include "Language.h" +#include "Pet.h" +#include "Player.h" +#include "ObjectMgr.h" +#include "ScriptMgr.h" + +class send_commandscript : public CommandScript +{ +public: + send_commandscript() : CommandScript("send_commandscript") { } + + ChatCommand* GetCommands() const OVERRIDE + { + static ChatCommand sendCommandTable[] = + { + { "items", RBAC_PERM_COMMAND_SEND_ITEMS, true, &HandleSendItemsCommand, "", NULL }, + { "mail", RBAC_PERM_COMMAND_SEND_MAIL, true, &HandleSendMailCommand, "", NULL }, + { "message", RBAC_PERM_COMMAND_SEND_MESSAGE, true, &HandleSendMessageCommand, "", NULL }, + { "money", RBAC_PERM_COMMAND_SEND_MONEY, true, &HandleSendMoneyCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; + + static ChatCommand commandTable[] = + { + { "send", RBAC_PERM_COMMAND_SEND, false, NULL, "", sendCommandTable }, + { NULL, 0, false, NULL, "", NULL } + }; + return commandTable; + } + + // Send mail by command + static bool HandleSendMailCommand(ChatHandler* handler, char const* args) + { + // format: name "subject text" "mail text" + Player* target; + uint64 targetGuid; + std::string targetName; + if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) + return false; + + char* tail1 = strtok(NULL, ""); + if (!tail1) + return false; + + char const* msgSubject = handler->extractQuotedArg(tail1); + if (!msgSubject) + return false; + + char* tail2 = strtok(NULL, ""); + if (!tail2) + return false; + + char const* msgText = handler->extractQuotedArg(tail2); + if (!msgText) + return false; + + // msgSubject, msgText isn't NUL after prev. check + std::string subject = msgSubject; + std::string text = msgText; + + // from console show not existed sender + MailSender sender(MAIL_NORMAL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM); + + /// @todo Fix poor design + SQLTransaction trans = CharacterDatabase.BeginTransaction(); + MailDraft(subject, text) + .SendMailTo(trans, MailReceiver(target, GUID_LOPART(targetGuid)), sender); + + CharacterDatabase.CommitTransaction(trans); + + std::string nameLink = handler->playerLink(targetName); + handler->PSendSysMessage(LANG_MAIL_SENT, nameLink.c_str()); + return true; + } + + // Send items by mail + static bool HandleSendItemsCommand(ChatHandler* handler, char const* args) + { + // format: name "subject text" "mail text" item1[:count1] item2[:count2] ... item12[:count12] + Player* receiver; + uint64 receiverGuid; + std::string receiverName; + if (!handler->extractPlayerTarget((char*)args, &receiver, &receiverGuid, &receiverName)) + return false; + + char* tail1 = strtok(NULL, ""); + if (!tail1) + return false; + + char const* msgSubject = handler->extractQuotedArg(tail1); + if (!msgSubject) + return false; + + char* tail2 = strtok(NULL, ""); + if (!tail2) + return false; + + char const* msgText = handler->extractQuotedArg(tail2); + if (!msgText) + return false; + + // msgSubject, msgText isn't NUL after prev. check + std::string subject = msgSubject; + std::string text = msgText; + + // extract items + typedef std::pair ItemPair; + typedef std::list< ItemPair > ItemPairs; + ItemPairs items; + + // get all tail string + char* tail = strtok(NULL, ""); + + // get from tail next item str + while (char* itemStr = strtok(tail, " ")) + { + // and get new tail + tail = strtok(NULL, ""); + + // parse item str + char const* itemIdStr = strtok(itemStr, ":"); + char const* itemCountStr = strtok(NULL, " "); + + uint32 itemId = atoi(itemIdStr); + if (!itemId) + return false; + + ItemTemplate const* item_proto = sObjectMgr->GetItemTemplate(itemId); + if (!item_proto) + { + handler->PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, itemId); + handler->SetSentErrorMessage(true); + return false; + } + + uint32 itemCount = itemCountStr ? atoi(itemCountStr) : 1; + if (itemCount < 1 || (item_proto->MaxCount > 0 && itemCount > uint32(item_proto->MaxCount))) + { + handler->PSendSysMessage(LANG_COMMAND_INVALID_ITEM_COUNT, itemCount, itemId); + handler->SetSentErrorMessage(true); + return false; + } + + while (itemCount > item_proto->GetMaxStackSize()) + { + items.push_back(ItemPair(itemId, item_proto->GetMaxStackSize())); + itemCount -= item_proto->GetMaxStackSize(); + } + + items.push_back(ItemPair(itemId, itemCount)); + + if (items.size() > MAX_MAIL_ITEMS) + { + handler->PSendSysMessage(LANG_COMMAND_MAIL_ITEMS_LIMIT, MAX_MAIL_ITEMS); + handler->SetSentErrorMessage(true); + return false; + } + } + + // from console show not existed sender + MailSender sender(MAIL_NORMAL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM); + + // fill mail + MailDraft draft(subject, text); + + SQLTransaction trans = CharacterDatabase.BeginTransaction(); + + for (ItemPairs::const_iterator itr = items.begin(); itr != items.end(); ++itr) + { + if (Item* item = Item::CreateItem(itr->first, itr->second, handler->GetSession() ? handler->GetSession()->GetPlayer() : 0)) + { + item->SaveToDB(trans); // save for prevent lost at next mail load, if send fail then item will deleted + draft.AddItem(item); + } + } + + draft.SendMailTo(trans, MailReceiver(receiver, GUID_LOPART(receiverGuid)), sender); + CharacterDatabase.CommitTransaction(trans); + + std::string nameLink = handler->playerLink(receiverName); + handler->PSendSysMessage(LANG_MAIL_SENT, nameLink.c_str()); + return true; + } + /// Send money by mail + static bool HandleSendMoneyCommand(ChatHandler* handler, char const* args) + { + /// format: name "subject text" "mail text" money + + Player* receiver; + uint64 receiverGuid; + std::string receiverName; + if (!handler->extractPlayerTarget((char*)args, &receiver, &receiverGuid, &receiverName)) + return false; + + char* tail1 = strtok(NULL, ""); + if (!tail1) + return false; + + char* msgSubject = handler->extractQuotedArg(tail1); + if (!msgSubject) + return false; + + char* tail2 = strtok(NULL, ""); + if (!tail2) + return false; + + char* msgText = handler->extractQuotedArg(tail2); + if (!msgText) + return false; + + char* moneyStr = strtok(NULL, ""); + int32 money = moneyStr ? atoi(moneyStr) : 0; + if (money <= 0) + return false; + + // msgSubject, msgText isn't NUL after prev. check + std::string subject = msgSubject; + std::string text = msgText; + + // from console show not existed sender + MailSender sender(MAIL_NORMAL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM); + + SQLTransaction trans = CharacterDatabase.BeginTransaction(); + + MailDraft(subject, text) + .AddMoney(money) + .SendMailTo(trans, MailReceiver(receiver, GUID_LOPART(receiverGuid)), sender); + + CharacterDatabase.CommitTransaction(trans); + + std::string nameLink = handler->playerLink(receiverName); + handler->PSendSysMessage(LANG_MAIL_SENT, nameLink.c_str()); + return true; + } + /// Send a message to a player in game + static bool HandleSendMessageCommand(ChatHandler* handler, char const* args) + { + /// - Find the player + Player* player; + if (!handler->extractPlayerTarget((char*)args, &player)) + return false; + + char* msgStr = strtok(NULL, ""); + if (!msgStr) + return false; + + ///- Check that he is not logging out. + if (player->GetSession()->isLogingOut()) + { + handler->SendSysMessage(LANG_PLAYER_NOT_FOUND); + handler->SetSentErrorMessage(true); + return false; + } + + /// - Send the message + // Use SendAreaTriggerMessage for fastest delivery. + player->GetSession()->SendAreaTriggerMessage("%s", msgStr); + player->GetSession()->SendAreaTriggerMessage("|cffff0000[Message from administrator]:|r"); + + // Confirmation message + std::string nameLink = handler->GetNameLink(player); + handler->PSendSysMessage(LANG_SENDMESSAGE, nameLink.c_str(), msgStr); + + return true; + } +}; + +void AddSC_send_commandscript() +{ + new send_commandscript(); +} -- cgit v1.2.3 From 10384462782fe9d198eb5e94fbc8437f7b5727d1 Mon Sep 17 00:00:00 2001 From: Spp Date: Tue, 10 Sep 2013 12:59:25 +0200 Subject: Core/RBAC: Move misc commands to RBAC (using individual permissions) --- sql/updates/auth/2013_09_10_03_auth_misc.sql | 107 ++++++++++++++++++++++ sql/updates/world/2013_09_10_05_world_command.sql | 53 +++++++++++ src/server/game/Accounts/RBAC.h | 48 ++++++++++ src/server/scripts/Commands/cs_misc.cpp | 98 ++++++++++---------- src/server/scripts/Commands/cs_rbac.cpp | 4 +- 5 files changed, 259 insertions(+), 51 deletions(-) create mode 100644 sql/updates/auth/2013_09_10_03_auth_misc.sql create mode 100644 sql/updates/world/2013_09_10_05_world_command.sql (limited to 'sql') diff --git a/sql/updates/auth/2013_09_10_03_auth_misc.sql b/sql/updates/auth/2013_09_10_03_auth_misc.sql new file mode 100644 index 00000000000..553830f6ecb --- /dev/null +++ b/sql/updates/auth/2013_09_10_03_auth_misc.sql @@ -0,0 +1,107 @@ +/* cs_misc.cpp */ + +SET @id = 488; + +-- Add new permissions +DELETE FROM `rbac_permissions` WHERE `id` BETWEEN @id AND @id+47; +INSERT INTO `rbac_permissions` (`id`, `name`) VALUES +(@id+0, 'additem'), +(@id+1, 'additemset'), +(@id+2, 'appear'), +(@id+3, 'aura'), +(@id+4, 'bank'), +(@id+5, 'bindsight'), +(@id+6, 'combatstop'), +(@id+7, 'cometome'), +(@id+8, 'commands'), +(@id+9, 'cooldown'), +(@id+10, 'damage'), +(@id+11, 'dev'), +(@id+12, 'die'), +(@id+13, 'dismount'), +(@id+14, 'distance'), +(@id+15, 'flusharenapoints'), +(@id+16, 'freeze'), +(@id+17, 'gps'), +(@id+18, 'guid'), +(@id+19, 'help'), +(@id+20, 'hidearea'), +(@id+21, 'itemmove'), +(@id+22, 'kick'), +(@id+23, 'linkgrave'), +(@id+24, 'listfreeze'), +(@id+25, 'maxskill'), +(@id+26, 'movegens'), +(@id+27, 'mute'), +(@id+28, 'neargrave'), +(@id+29, 'pinfo'), +(@id+30, 'playall'), +(@id+31, 'possess'), +(@id+32, 'recall'), +(@id+33, 'repairitems'), +(@id+34, 'respawn'), +(@id+35, 'revive'), +(@id+36, 'saveall'), +(@id+37, 'save'), +(@id+38, 'setskill'), +(@id+39, 'showarea'), +(@id+40, 'summon'), +(@id+41, 'unaura'), +(@id+42, 'unbindsight'), +(@id+43, 'unfreeze'), +(@id+44, 'unmute'), +(@id+45, 'unpossess'), +(@id+46, 'unstuck'), +(@id+47, 'wchange'); + +-- Add permissions to "corresponding Commands Role" +DELETE FROM `rbac_role_permissions` WHERE `permissionId` BETWEEN @id AND @id+47; +INSERT INTO `rbac_role_permissions` (`roleId`, `permissionId`) VALUES +(4, @id+0), +(4, @id+1), +(2, @id+2), +(4, @id+3), +(4, @id+4), +(4, @id+5), +(3, @id+6), +(4, @id+7), +(1, @id+8), +(4, @id+9), +(4, @id+10), +(4, @id+11), +(4, @id+12), +(1, @id+13), +(4, @id+14), +(4, @id+15), +(2, @id+16), +(4, @id+17), +(3, @id+18), +(1, @id+19), +(4, @id+20), +(3, @id+21), +(3, @id+22), +(4, @id+23), +(2, @id+24), +(4, @id+25), +(4, @id+26), +(2, @id+27), +(4, @id+28), +(3, @id+29), +(3, @id+30), +(4, @id+31), +(2, @id+32), +(3, @id+33), +(4, @id+34), +(4, @id+35), +(2, @id+36), +(1, @id+37), +(4, @id+38), +(4, @id+39), +(2, @id+40), +(4, @id+41), +(4, @id+42), +(2, @id+43), +(2, @id+44), +(4, @id+45), +(1, @id+46), +(4, @id+47); diff --git a/sql/updates/world/2013_09_10_05_world_command.sql b/sql/updates/world/2013_09_10_05_world_command.sql new file mode 100644 index 00000000000..3cb64e7c02d --- /dev/null +++ b/sql/updates/world/2013_09_10_05_world_command.sql @@ -0,0 +1,53 @@ +/* cs_misc.cpp */ + +SET @id = 488; + +-- Update command table with new RBAC permissions +UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'additem'; +UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'additemset'; +UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'appear'; +UPDATE `command` SET `permission` = @id+3 WHERE `name` = 'aura'; +UPDATE `command` SET `permission` = @id+4 WHERE `name` = 'bank'; +UPDATE `command` SET `permission` = @id+5 WHERE `name` = 'bindsight'; +UPDATE `command` SET `permission` = @id+6 WHERE `name` = 'combatstop'; +UPDATE `command` SET `permission` = @id+7 WHERE `name` = 'cometome'; +UPDATE `command` SET `permission` = @id+8 WHERE `name` = 'commands'; +UPDATE `command` SET `permission` = @id+9 WHERE `name` = 'cooldown'; +UPDATE `command` SET `permission` = @id+10 WHERE `name` = 'damage'; +UPDATE `command` SET `permission` = @id+11 WHERE `name` = 'dev'; +UPDATE `command` SET `permission` = @id+12 WHERE `name` = 'die'; +UPDATE `command` SET `permission` = @id+13 WHERE `name` = 'dismount'; +UPDATE `command` SET `permission` = @id+14 WHERE `name` = 'distance'; +UPDATE `command` SET `permission` = @id+15 WHERE `name` = 'flusharenapoints'; +UPDATE `command` SET `permission` = @id+16 WHERE `name` = 'freeze'; +UPDATE `command` SET `permission` = @id+17 WHERE `name` = 'gps'; +UPDATE `command` SET `permission` = @id+18 WHERE `name` = 'guid'; +UPDATE `command` SET `permission` = @id+19 WHERE `name` = 'help'; +UPDATE `command` SET `permission` = @id+20 WHERE `name` = 'hidearea'; +UPDATE `command` SET `permission` = @id+21 WHERE `name` = 'itemmove'; +UPDATE `command` SET `permission` = @id+22 WHERE `name` = 'kick'; +UPDATE `command` SET `permission` = @id+23 WHERE `name` = 'linkgrave'; +UPDATE `command` SET `permission` = @id+24 WHERE `name` = 'listfreeze'; +UPDATE `command` SET `permission` = @id+25 WHERE `name` = 'maxskill'; +UPDATE `command` SET `permission` = @id+26 WHERE `name` = 'movegens'; +UPDATE `command` SET `permission` = @id+27 WHERE `name` = 'mute'; +UPDATE `command` SET `permission` = @id+28 WHERE `name` = 'neargrave'; +UPDATE `command` SET `permission` = @id+29 WHERE `name` = 'pinfo'; +UPDATE `command` SET `permission` = @id+30 WHERE `name` = 'playall'; +UPDATE `command` SET `permission` = @id+31 WHERE `name` = 'possess'; +UPDATE `command` SET `permission` = @id+32 WHERE `name` = 'recall'; +UPDATE `command` SET `permission` = @id+33 WHERE `name` = 'repairitems'; +UPDATE `command` SET `permission` = @id+34 WHERE `name` = 'respawn'; +UPDATE `command` SET `permission` = @id+35 WHERE `name` = 'revive'; +UPDATE `command` SET `permission` = @id+36 WHERE `name` = 'saveall'; +UPDATE `command` SET `permission` = @id+37 WHERE `name` = 'save'; +UPDATE `command` SET `permission` = @id+38 WHERE `name` = 'setskill'; +UPDATE `command` SET `permission` = @id+39 WHERE `name` = 'showarea'; +UPDATE `command` SET `permission` = @id+40 WHERE `name` = 'summon'; +UPDATE `command` SET `permission` = @id+41 WHERE `name` = 'unaura'; +UPDATE `command` SET `permission` = @id+42 WHERE `name` = 'unbindsight'; +UPDATE `command` SET `permission` = @id+43 WHERE `name` = 'unfreeze'; +UPDATE `command` SET `permission` = @id+44 WHERE `name` = 'unmute'; +UPDATE `command` SET `permission` = @id+45 WHERE `name` = 'unpossess'; +UPDATE `command` SET `permission` = @id+46 WHERE `name` = 'unstuck'; +UPDATE `command` SET `permission` = @id+47 WHERE `name` = 'wchange'; diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h index 57b47565f5d..a758062ee8a 100644 --- a/src/server/game/Accounts/RBAC.h +++ b/src/server/game/Accounts/RBAC.h @@ -387,6 +387,54 @@ enum RBACPermissions RBAC_PERM_COMMAND_SEND_MAIL = 485, RBAC_PERM_COMMAND_SEND_MESSAGE = 486, RBAC_PERM_COMMAND_SEND_MONEY = 487, + RBAC_PERM_COMMAND_ADDITEM = 488, + RBAC_PERM_COMMAND_ADDITEMSET = 489, + RBAC_PERM_COMMAND_APPEAR = 490, + RBAC_PERM_COMMAND_AURA = 491, + RBAC_PERM_COMMAND_BANK = 492, + RBAC_PERM_COMMAND_BINDSIGHT = 493, + RBAC_PERM_COMMAND_COMBATSTOP = 494, + RBAC_PERM_COMMAND_COMETOME = 495, + RBAC_PERM_COMMAND_COMMANDS = 496, + RBAC_PERM_COMMAND_COOLDOWN = 497, + RBAC_PERM_COMMAND_DAMAGE = 498, + RBAC_PERM_COMMAND_DEV = 499, + RBAC_PERM_COMMAND_DIE = 500, + RBAC_PERM_COMMAND_DISMOUNT = 501, + RBAC_PERM_COMMAND_DISTANCE = 502, + RBAC_PERM_COMMAND_FLUSHARENAPOINTS = 503, + RBAC_PERM_COMMAND_FREEZE = 504, + RBAC_PERM_COMMAND_GPS = 505, + RBAC_PERM_COMMAND_GUID = 506, + RBAC_PERM_COMMAND_HELP = 507, + RBAC_PERM_COMMAND_HIDEAREA = 508, + RBAC_PERM_COMMAND_ITEMMOVE = 509, + RBAC_PERM_COMMAND_KICK = 510, + RBAC_PERM_COMMAND_LINKGRAVE = 511, + RBAC_PERM_COMMAND_LISTFREEZE = 512, + RBAC_PERM_COMMAND_MAXSKILL = 513, + RBAC_PERM_COMMAND_MOVEGENS = 514, + RBAC_PERM_COMMAND_MUTE = 515, + RBAC_PERM_COMMAND_NEARGRAVE = 516, + RBAC_PERM_COMMAND_PINFO = 517, + RBAC_PERM_COMMAND_PLAYALL = 518, + RBAC_PERM_COMMAND_POSSESS = 519, + RBAC_PERM_COMMAND_RECALL = 520, + RBAC_PERM_COMMAND_REPAIRITEMS = 521, + RBAC_PERM_COMMAND_RESPAWN = 522, + RBAC_PERM_COMMAND_REVIVE = 523, + RBAC_PERM_COMMAND_SAVE = 524, + RBAC_PERM_COMMAND_SAVEALL = 525, + RBAC_PERM_COMMAND_SETSKILL = 526, + RBAC_PERM_COMMAND_SHOWAREA = 527, + RBAC_PERM_COMMAND_SUMMON = 528, + RBAC_PERM_COMMAND_UNAURA = 529, + RBAC_PERM_COMMAND_UNBINDSIGHT = 530, + RBAC_PERM_COMMAND_UNFREEZE = 531, + RBAC_PERM_COMMAND_UNMUTE = 532, + RBAC_PERM_COMMAND_UNPOSSESS = 533, + RBAC_PERM_COMMAND_UNSTUCK = 534, + RBAC_PERM_COMMAND_WCHANGE = 535, // custom permissions 1000+ RBAC_PERM_MAX diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 24d9aefcda7..96244c19036 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -46,55 +46,55 @@ public: { static ChatCommand commandTable[] = { - { "dev", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleDevCommand, "", NULL }, - { "gps", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleGPSCommand, "", NULL }, - { "aura", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleAuraCommand, "", NULL }, - { "unaura", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleUnAuraCommand, "", NULL }, - { "appear", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleAppearCommand, "", NULL }, - { "summon", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleSummonCommand, "", NULL }, - { "commands", RBAC_PERM_PLAYER_COMMANDS, true, &HandleCommandsCommand, "", NULL }, - { "die", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleDieCommand, "", NULL }, - { "revive", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReviveCommand, "", NULL }, - { "dismount", RBAC_PERM_PLAYER_COMMANDS, false, &HandleDismountCommand, "", NULL }, - { "guid", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleGUIDCommand, "", NULL }, - { "help", RBAC_PERM_PLAYER_COMMANDS, true, &HandleHelpCommand, "", NULL }, - { "itemmove", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleItemMoveCommand, "", NULL }, - { "cooldown", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleCooldownCommand, "", NULL }, - { "distance", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleGetDistanceCommand, "", NULL }, - { "recall", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleRecallCommand, "", NULL }, - { "save", RBAC_PERM_PLAYER_COMMANDS, false, &HandleSaveCommand, "", NULL }, - { "saveall", RBAC_PERM_MODERATOR_COMMANDS, true, &HandleSaveAllCommand, "", NULL }, - { "kick", RBAC_PERM_GAMEMASTER_COMMANDS, true, &HandleKickPlayerCommand, "", NULL }, - { "unstuck", RBAC_PERM_PLAYER_COMMANDS, true, &HandleUnstuckCommand, "", NULL }, - { "linkgrave", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleLinkGraveCommand, "", NULL }, - { "neargrave", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleNearGraveCommand, "", NULL }, - { "showarea", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleShowAreaCommand, "", NULL }, - { "hidearea", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleHideAreaCommand, "", NULL }, - { "additem", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleAddItemCommand, "", NULL }, - { "additemset", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleAddItemSetCommand, "", NULL }, - { "bank", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleBankCommand, "", NULL }, - { "wchange", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleChangeWeather, "", NULL }, - { "maxskill", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleMaxSkillCommand, "", NULL }, - { "setskill", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleSetSkillCommand, "", NULL }, - { "pinfo", RBAC_PERM_GAMEMASTER_COMMANDS, true, &HandlePInfoCommand, "", NULL }, - { "respawn", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleRespawnCommand, "", NULL }, - { "mute", RBAC_PERM_MODERATOR_COMMANDS, true, &HandleMuteCommand, "", NULL }, - { "unmute", RBAC_PERM_MODERATOR_COMMANDS, true, &HandleUnmuteCommand, "", NULL }, - { "movegens", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleMovegensCommand, "", NULL }, - { "cometome", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleComeToMeCommand, "", NULL }, - { "damage", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleDamageCommand, "", NULL }, - { "combatstop", RBAC_PERM_GAMEMASTER_COMMANDS, true, &HandleCombatStopCommand, "", NULL }, - { "flusharenapoints", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleFlushArenaPointsCommand, "", NULL }, - { "repairitems", RBAC_PERM_GAMEMASTER_COMMANDS, true, &HandleRepairitemsCommand, "", NULL }, - { "freeze", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleFreezeCommand, "", NULL }, - { "unfreeze", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleUnFreezeCommand, "", NULL }, - { "listfreeze", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleListFreezeCommand, "", NULL }, - { "possess", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, HandlePossessCommand, "", NULL }, - { "unpossess", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, HandleUnPossessCommand, "", NULL }, - { "bindsight", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, HandleBindSightCommand, "", NULL }, - { "unbindsight", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, HandleUnbindSightCommand, "", NULL }, - { "playall", RBAC_PERM_GAMEMASTER_COMMANDS, false, HandlePlayAllCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "additem", RBAC_PERM_COMMAND_ADDITEM, false, &HandleAddItemCommand, "", NULL }, + { "additemset", RBAC_PERM_COMMAND_ADDITEMSET, false, &HandleAddItemSetCommand, "", NULL }, + { "appear", RBAC_PERM_COMMAND_APPEAR, false, &HandleAppearCommand, "", NULL }, + { "aura", RBAC_PERM_COMMAND_AURA, false, &HandleAuraCommand, "", NULL }, + { "bank", RBAC_PERM_COMMAND_BANK, false, &HandleBankCommand, "", NULL }, + { "bindsight", RBAC_PERM_COMMAND_BINDSIGHT, false, &HandleBindSightCommand, "", NULL }, + { "combatstop", RBAC_PERM_COMMAND_COMBATSTOP, true, &HandleCombatStopCommand, "", NULL }, + { "cometome", RBAC_PERM_COMMAND_COMETOME, false, &HandleComeToMeCommand, "", NULL }, + { "commands", RBAC_PERM_COMMAND_COMMANDS, true, &HandleCommandsCommand, "", NULL }, + { "cooldown", RBAC_PERM_COMMAND_COOLDOWN, false, &HandleCooldownCommand, "", NULL }, + { "damage", RBAC_PERM_COMMAND_DAMAGE, false, &HandleDamageCommand, "", NULL }, + { "dev", RBAC_PERM_COMMAND_DEV, false, &HandleDevCommand, "", NULL }, + { "die", RBAC_PERM_COMMAND_DIE, false, &HandleDieCommand, "", NULL }, + { "dismount", RBAC_PERM_COMMAND_DISMOUNT, false, &HandleDismountCommand, "", NULL }, + { "distance", RBAC_PERM_COMMAND_DISTANCE, false, &HandleGetDistanceCommand, "", NULL }, + { "flusharenapoints", RBAC_PERM_COMMAND_FLUSHARENAPOINTS, false, &HandleFlushArenaPointsCommand, "", NULL }, + { "freeze", RBAC_PERM_COMMAND_FREEZE, false, &HandleFreezeCommand, "", NULL }, + { "gps", RBAC_PERM_COMMAND_GPS, false, &HandleGPSCommand, "", NULL }, + { "guid", RBAC_PERM_COMMAND_GUID, false, &HandleGUIDCommand, "", NULL }, + { "help", RBAC_PERM_COMMAND_HELP, true, &HandleHelpCommand, "", NULL }, + { "hidearea", RBAC_PERM_COMMAND_HIDEAREA, false, &HandleHideAreaCommand, "", NULL }, + { "itemmove", RBAC_PERM_COMMAND_ITEMMOVE, false, &HandleItemMoveCommand, "", NULL }, + { "kick", RBAC_PERM_COMMAND_KICK, true, &HandleKickPlayerCommand, "", NULL }, + { "linkgrave", RBAC_PERM_COMMAND_LINKGRAVE, false, &HandleLinkGraveCommand, "", NULL }, + { "listfreeze", RBAC_PERM_COMMAND_LISTFREEZE, false, &HandleListFreezeCommand, "", NULL }, + { "maxskill", RBAC_PERM_COMMAND_MAXSKILL, false, &HandleMaxSkillCommand, "", NULL }, + { "movegens", RBAC_PERM_COMMAND_MOVEGENS, false, &HandleMovegensCommand, "", NULL }, + { "mute", RBAC_PERM_COMMAND_MUTE, true, &HandleMuteCommand, "", NULL }, + { "neargrave", RBAC_PERM_COMMAND_NEARGRAVE, false, &HandleNearGraveCommand, "", NULL }, + { "pinfo", RBAC_PERM_COMMAND_PINFO, true, &HandlePInfoCommand, "", NULL }, + { "playall", RBAC_PERM_COMMAND_PLAYALL, false, &HandlePlayAllCommand, "", NULL }, + { "possess", RBAC_PERM_COMMAND_POSSESS, false, &HandlePossessCommand, "", NULL }, + { "recall", RBAC_PERM_COMMAND_RECALL, false, &HandleRecallCommand, "", NULL }, + { "repairitems", RBAC_PERM_COMMAND_REPAIRITEMS, true, &HandleRepairitemsCommand, "", NULL }, + { "respawn", RBAC_PERM_COMMAND_RESPAWN, false, &HandleRespawnCommand, "", NULL }, + { "revive", RBAC_PERM_COMMAND_REVIVE, true, &HandleReviveCommand, "", NULL }, + { "saveall", RBAC_PERM_COMMAND_SAVEALL, true, &HandleSaveAllCommand, "", NULL }, + { "save", RBAC_PERM_COMMAND_SAVE, false, &HandleSaveCommand, "", NULL }, + { "setskill", RBAC_PERM_COMMAND_SETSKILL, false, &HandleSetSkillCommand, "", NULL }, + { "showarea", RBAC_PERM_COMMAND_SHOWAREA, false, &HandleShowAreaCommand, "", NULL }, + { "summon", RBAC_PERM_COMMAND_SUMMON, false, &HandleSummonCommand, "", NULL }, + { "unaura", RBAC_PERM_COMMAND_UNAURA, false, &HandleUnAuraCommand, "", NULL }, + { "unbindsight", RBAC_PERM_COMMAND_UNBINDSIGHT, false, HandleUnbindSightCommand, "", NULL }, + { "unfreeze", RBAC_PERM_COMMAND_UNFREEZE, false, &HandleUnFreezeCommand, "", NULL }, + { "unmute", RBAC_PERM_COMMAND_UNMUTE, true, &HandleUnmuteCommand, "", NULL }, + { "unpossess", RBAC_PERM_COMMAND_UNPOSSESS, false, &HandleUnPossessCommand, "", NULL }, + { "unstuck", RBAC_PERM_COMMAND_UNSTUCK, true, &HandleUnstuckCommand, "", NULL }, + { "wchange", RBAC_PERM_COMMAND_WCHANGE, false, &HandleChangeWeather, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; return commandTable; } diff --git a/src/server/scripts/Commands/cs_rbac.cpp b/src/server/scripts/Commands/cs_rbac.cpp index 9c682acb224..ba899fee077 100644 --- a/src/server/scripts/Commands/cs_rbac.cpp +++ b/src/server/scripts/Commands/cs_rbac.cpp @@ -64,7 +64,7 @@ public: { "grant", RBAC_PERM_COMMAND_RBAC_ACC_ROLE_GRANT, true, &HandleRBACRoleGrantCommand, "", NULL }, { "deny", RBAC_PERM_COMMAND_RBAC_ACC_ROLE_DENY, true, &HandleRBACRoleDenyCommand, "", NULL }, { "revoke", RBAC_PERM_COMMAND_RBAC_ACC_ROLE_REVOKE, true, &HandleRBACRoleRevokeCommand, "", NULL }, - { "", RBAC_PERM_COMMAND_RBAC_ACC_ROLE, true, &HandleRBACRoleListCommand, "", NULL }, + { "", RBAC_PERM_COMMAND_RBAC_ACC_ROLE, true, &HandleRBACRoleListCommand, "", NULL }, { NULL, 0, false, NULL, "", NULL } }; @@ -73,7 +73,7 @@ public: { "grant", RBAC_PERM_COMMAND_RBAC_ACC_PERM_GRANT, true, &HandleRBACPermGrantCommand, "", NULL }, { "deny", RBAC_PERM_COMMAND_RBAC_ACC_PERM_DENY, true, &HandleRBACPermDenyCommand, "", NULL }, { "revoke", RBAC_PERM_COMMAND_RBAC_ACC_PERM_REVOKE, true, &HandleRBACPermRevokeCommand, "", NULL }, - { "", RBAC_PERM_COMMAND_RBAC_ACC_PERM, true, &HandleRBACPermListCommand, "", NULL }, + { "", RBAC_PERM_COMMAND_RBAC_ACC_PERM, true, &HandleRBACPermListCommand, "", NULL }, { NULL, 0, false, NULL, "", NULL } }; -- cgit v1.2.3 From 4d36ce7405d6cc5e29d1fe10b0ffd35d91722d93 Mon Sep 17 00:00:00 2001 From: Spp Date: Tue, 10 Sep 2013 13:08:39 +0200 Subject: Core/RBAC: Move mmap commands to RBAC (using individual permissions) --- sql/updates/auth/2013_09_10_04_auth_misc.sql | 23 +++++++++++++++++++++++ sql/updates/world/2013_09_10_06_world_command.sql | 11 +++++++++++ src/server/game/Accounts/RBAC.h | 6 ++++++ src/server/scripts/Commands/cs_mmaps.cpp | 16 ++++++++-------- 4 files changed, 48 insertions(+), 8 deletions(-) create mode 100644 sql/updates/auth/2013_09_10_04_auth_misc.sql create mode 100644 sql/updates/world/2013_09_10_06_world_command.sql (limited to 'sql') diff --git a/sql/updates/auth/2013_09_10_04_auth_misc.sql b/sql/updates/auth/2013_09_10_04_auth_misc.sql new file mode 100644 index 00000000000..9b1f48f2914 --- /dev/null +++ b/sql/updates/auth/2013_09_10_04_auth_misc.sql @@ -0,0 +1,23 @@ +/* cs_mmaps.cpp */ + +SET @id = 536; + +-- Add new permissions +DELETE FROM `rbac_permissions` WHERE `id` BETWEEN @id AND @id+5; +INSERT INTO `rbac_permissions` (`id`, `name`) VALUES +(@id+0, 'mmap'), +(@id+1, 'mmap loadedtiles'), +(@id+2, 'mmap loc'), +(@id+3, 'mmap path'), +(@id+4, 'mmap stats'), +(@id+5, 'mmap testarea'); + +-- Add permissions to "corresponding Commands Role" +DELETE FROM `rbac_role_permissions` WHERE `permissionId` BETWEEN @id AND @id+5; +INSERT INTO `rbac_role_permissions` (`roleId`, `permissionId`) VALUES +(4, @id+0), +(4, @id+1), +(4, @id+2), +(4, @id+3), +(4, @id+4), +(4, @id+5); diff --git a/sql/updates/world/2013_09_10_06_world_command.sql b/sql/updates/world/2013_09_10_06_world_command.sql new file mode 100644 index 00000000000..57aba9eadaa --- /dev/null +++ b/sql/updates/world/2013_09_10_06_world_command.sql @@ -0,0 +1,11 @@ +/* cs_mmaps.cpp */ + +SET @id = 536; + +-- Update command table with new RBAC permissions +UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'mmap'; +UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'mmap loadedtiles'; +UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'mmap loc'; +UPDATE `command` SET `permission` = @id+3 WHERE `name` = 'mmap path'; +UPDATE `command` SET `permission` = @id+4 WHERE `name` = 'mmap stats'; +UPDATE `command` SET `permission` = @id+5 WHERE `name` = 'mmap testarea'; diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h index a758062ee8a..926b2769842 100644 --- a/src/server/game/Accounts/RBAC.h +++ b/src/server/game/Accounts/RBAC.h @@ -435,6 +435,12 @@ enum RBACPermissions RBAC_PERM_COMMAND_UNPOSSESS = 533, RBAC_PERM_COMMAND_UNSTUCK = 534, RBAC_PERM_COMMAND_WCHANGE = 535, + RBAC_PERM_COMMAND_MMAP = 536, + RBAC_PERM_COMMAND_MMAP_LOADEDTILES = 537, + RBAC_PERM_COMMAND_MMAP_LOC = 538, + RBAC_PERM_COMMAND_MMAP_PATH = 539, + RBAC_PERM_COMMAND_MMAP_STATS = 540, + RBAC_PERM_COMMAND_MMAP_TESTAREA = 541, // custom permissions 1000+ RBAC_PERM_MAX diff --git a/src/server/scripts/Commands/cs_mmaps.cpp b/src/server/scripts/Commands/cs_mmaps.cpp index 6667499af58..caefcceb886 100644 --- a/src/server/scripts/Commands/cs_mmaps.cpp +++ b/src/server/scripts/Commands/cs_mmaps.cpp @@ -45,18 +45,18 @@ public: { static ChatCommand mmapCommandTable[] = { - { "path", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleMmapPathCommand, "", NULL }, - { "loc", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleMmapLocCommand, "", NULL }, - { "loadedtiles", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleMmapLoadedTilesCommand, "", NULL }, - { "stats", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleMmapStatsCommand, "", NULL }, - { "testarea", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleMmapTestArea, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "loadedtiles", RBAC_PERM_COMMAND_MMAP_LOADEDTILES, false, &HandleMmapLoadedTilesCommand, "", NULL }, + { "loc", RBAC_PERM_COMMAND_MMAP_LOC, false, &HandleMmapLocCommand, "", NULL }, + { "path", RBAC_PERM_COMMAND_MMAP_PATH, false, &HandleMmapPathCommand, "", NULL }, + { "stats", RBAC_PERM_COMMAND_MMAP_STATS, false, &HandleMmapStatsCommand, "", NULL }, + { "testarea", RBAC_PERM_COMMAND_MMAP_TESTAREA, false, &HandleMmapTestArea, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand commandTable[] = { - { "mmap", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, NULL, "", mmapCommandTable }, - { NULL, 0, false, NULL, "", NULL } + { "mmap", RBAC_PERM_COMMAND_MMAP, true, NULL, "", mmapCommandTable }, + { NULL, 0, false, NULL, "", NULL } }; return commandTable; } -- cgit v1.2.3 From 04b313557ed3fbeec17530bc581459a6226e3da5 Mon Sep 17 00:00:00 2001 From: Spp Date: Tue, 10 Sep 2013 13:28:32 +0200 Subject: Core/RBAC: Move modify commands to RBAC (using individual permissions) --- sql/updates/auth/2013_09_10_05_auth_misc.sql | 68 +++++++++++++++++++++++ sql/updates/world/2013_09_10_07_world_command.sql | 33 +++++++++++ src/server/game/Accounts/RBAC.h | 28 ++++++++++ src/server/scripts/Commands/cs_modify.cpp | 64 ++++++++++----------- 4 files changed, 161 insertions(+), 32 deletions(-) create mode 100644 sql/updates/auth/2013_09_10_05_auth_misc.sql create mode 100644 sql/updates/world/2013_09_10_07_world_command.sql (limited to 'sql') diff --git a/sql/updates/auth/2013_09_10_05_auth_misc.sql b/sql/updates/auth/2013_09_10_05_auth_misc.sql new file mode 100644 index 00000000000..607821854d3 --- /dev/null +++ b/sql/updates/auth/2013_09_10_05_auth_misc.sql @@ -0,0 +1,68 @@ +/* cs_modify.cpp */ + +SET @id = 542; + +-- Add new permissions +DELETE FROM `rbac_permissions` WHERE `id` BETWEEN @id AND @id+27; +INSERT INTO `rbac_permissions` (`id`, `name`) VALUES +(@id+0, 'morph'), +(@id+1, 'demorph'), +(@id+2, 'modify'), +(@id+3, 'modify arenapoints'), +(@id+4, 'modify bit'), +(@id+5, 'modify drunk'), +(@id+6, 'modify energy'), +(@id+7, 'modify faction'), +(@id+8, 'modify gender'), +(@id+9, 'modify honor'), +(@id+10, 'modify hp'), +(@id+11, 'modify mana'), +(@id+12, 'modify money'), +(@id+13, 'modify mount'), +(@id+14, 'modify phase'), +(@id+15, 'modify rage'), +(@id+16, 'modify reputation'), +(@id+17, 'modify runicpower'), +(@id+18, 'modify scale'), +(@id+19, 'modify speed'), +(@id+20, 'modify speed all'), +(@id+21, 'modify speed backwalk'), +(@id+22, 'modify speed fly'), +(@id+23, 'modify speed walk'), +(@id+24, 'modify speed swim'), +(@id+25, 'modify spell'), +(@id+26, 'modify standstate'), +(@id+27, 'modify talentpoints'); + + +-- Add permissions to "corresponding Commands Role" +DELETE FROM `rbac_role_permissions` WHERE `permissionId` BETWEEN @id AND @id+27; +INSERT INTO `rbac_role_permissions` (`roleId`, `permissionId`) VALUES +(3, @id+0), +(3, @id+1), +(2, @id+2), +(2, @id+3), +(2, @id+4), +(2, @id+5), +(2, @id+6), +(2, @id+7), +(3, @id+8), +(2, @id+9), +(2, @id+10), +(2, @id+11), +(2, @id+12), +(2, @id+13), +(4, @id+14), +(2, @id+15), +(3, @id+16), +(2, @id+17), +(2, @id+18), +(2, @id+19), +(2, @id+20), +(2, @id+21), +(2, @id+22), +(2, @id+23), +(2, @id+24), +(2, @id+25), +(3, @id+26), +(2, @id+27); diff --git a/sql/updates/world/2013_09_10_07_world_command.sql b/sql/updates/world/2013_09_10_07_world_command.sql new file mode 100644 index 00000000000..b07da9730d1 --- /dev/null +++ b/sql/updates/world/2013_09_10_07_world_command.sql @@ -0,0 +1,33 @@ +/* cs_modify.cpp */ + +SET @id = 542; + +-- Update command table with new RBAC permissions +UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'morph'; +UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'demorph'; +UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'modify'; +UPDATE `command` SET `permission` = @id+3 WHERE `name` = 'modify arenapoints'; +UPDATE `command` SET `permission` = @id+4 WHERE `name` = 'modify bit'; +UPDATE `command` SET `permission` = @id+5 WHERE `name` = 'modify drunk'; +UPDATE `command` SET `permission` = @id+6 WHERE `name` = 'modify energy'; +UPDATE `command` SET `permission` = @id+7 WHERE `name` = 'modify faction'; +UPDATE `command` SET `permission` = @id+8 WHERE `name` = 'modify gender'; +UPDATE `command` SET `permission` = @id+9 WHERE `name` = 'modify honor'; +UPDATE `command` SET `permission` = @id+10 WHERE `name` = 'modify hp'; +UPDATE `command` SET `permission` = @id+11 WHERE `name` = 'modify mana'; +UPDATE `command` SET `permission` = @id+12 WHERE `name` = 'modify money'; +UPDATE `command` SET `permission` = @id+13 WHERE `name` = 'modify mount'; +UPDATE `command` SET `permission` = @id+14 WHERE `name` = 'modify phase'; +UPDATE `command` SET `permission` = @id+15 WHERE `name` = 'modify rage'; +UPDATE `command` SET `permission` = @id+16 WHERE `name` = 'modify reputation'; +UPDATE `command` SET `permission` = @id+17 WHERE `name` = 'modify runicpower'; +UPDATE `command` SET `permission` = @id+18 WHERE `name` = 'modify scale'; +UPDATE `command` SET `permission` = @id+19 WHERE `name` = 'modify speed'; +UPDATE `command` SET `permission` = @id+20 WHERE `name` = 'modify speed all'; +UPDATE `command` SET `permission` = @id+21 WHERE `name` = 'modify speed backwalk'; +UPDATE `command` SET `permission` = @id+22 WHERE `name` = 'modify speed fly'; +UPDATE `command` SET `permission` = @id+23 WHERE `name` = 'modify speed walk'; +UPDATE `command` SET `permission` = @id+24 WHERE `name` = 'modify speed swim'; +UPDATE `command` SET `permission` = @id+25 WHERE `name` = 'modify spell'; +UPDATE `command` SET `permission` = @id+26 WHERE `name` = 'modify standstate'; +UPDATE `command` SET `permission` = @id+27 WHERE `name` = 'modify talentpoints'; diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h index 926b2769842..1d4a86107ec 100644 --- a/src/server/game/Accounts/RBAC.h +++ b/src/server/game/Accounts/RBAC.h @@ -441,6 +441,34 @@ enum RBACPermissions RBAC_PERM_COMMAND_MMAP_PATH = 539, RBAC_PERM_COMMAND_MMAP_STATS = 540, RBAC_PERM_COMMAND_MMAP_TESTAREA = 541, + RBAC_PERM_COMMAND_MORPH = 542, + RBAC_PERM_COMMAND_DEMORPH = 543, + RBAC_PERM_COMMAND_MODIFY = 544, + RBAC_PERM_COMMAND_MODIFY_ARENAPOINTS = 545, + RBAC_PERM_COMMAND_MODIFY_BIT = 546, + RBAC_PERM_COMMAND_MODIFY_DRUNK = 547, + RBAC_PERM_COMMAND_MODIFY_ENERGY = 548, + RBAC_PERM_COMMAND_MODIFY_FACTION = 549, + RBAC_PERM_COMMAND_MODIFY_GENDER = 550, + RBAC_PERM_COMMAND_MODIFY_HONOR = 551, + RBAC_PERM_COMMAND_MODIFY_HP = 552, + RBAC_PERM_COMMAND_MODIFY_MANA = 553, + RBAC_PERM_COMMAND_MODIFY_MONEY = 554, + RBAC_PERM_COMMAND_MODIFY_MOUNT = 555, + RBAC_PERM_COMMAND_MODIFY_PHASE = 556, + RBAC_PERM_COMMAND_MODIFY_RAGE = 557, + RBAC_PERM_COMMAND_MODIFY_REPUTATION = 558, + RBAC_PERM_COMMAND_MODIFY_RUNICPOWER = 559, + RBAC_PERM_COMMAND_MODIFY_SCALE = 560, + RBAC_PERM_COMMAND_MODIFY_SPEED = 561, + RBAC_PERM_COMMAND_MODIFY_SPEED_ALL = 562, + RBAC_PERM_COMMAND_MODIFY_SPEED_BACKWALK = 563, + RBAC_PERM_COMMAND_MODIFY_SPEED_FLY = 564, + RBAC_PERM_COMMAND_MODIFY_SPEED_WALK = 565, + RBAC_PERM_COMMAND_MODIFY_SPEED_SWIM = 566, + RBAC_PERM_COMMAND_MODIFY_SPELL = 567, + RBAC_PERM_COMMAND_MODIFY_STANDSTATE = 568, + RBAC_PERM_COMMAND_MODIFY_TALENTPOINTS = 569, // custom permissions 1000+ RBAC_PERM_MAX diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index c3d461f6170..ddd2522c8be 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -40,44 +40,44 @@ public: { static ChatCommand modifyspeedCommandTable[] = { - { "fly", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleModifyFlyCommand, "", NULL }, - { "all", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleModifyASpeedCommand, "", NULL }, - { "walk", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleModifySpeedCommand, "", NULL }, - { "backwalk", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleModifyBWalkCommand, "", NULL }, - { "swim", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleModifySwimCommand, "", NULL }, - { "", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleModifyASpeedCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "all", RBAC_PERM_COMMAND_MODIFY_SPEED_ALL, false, &HandleModifyASpeedCommand, "", NULL }, + { "backwalk", RBAC_PERM_COMMAND_MODIFY_SPEED_BACKWALK, false, &HandleModifyBWalkCommand, "", NULL }, + { "fly", RBAC_PERM_COMMAND_MODIFY_SPEED_FLY, false, &HandleModifyFlyCommand, "", NULL }, + { "walk", RBAC_PERM_COMMAND_MODIFY_SPEED_WALK, false, &HandleModifySpeedCommand, "", NULL }, + { "swim", RBAC_PERM_COMMAND_MODIFY_SPEED_SWIM, false, &HandleModifySwimCommand, "", NULL }, + { "", RBAC_PERM_COMMAND_MODIFY_SPEED, false, &HandleModifyASpeedCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand modifyCommandTable[] = { - { "hp", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleModifyHPCommand, "", NULL }, - { "mana", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleModifyManaCommand, "", NULL }, - { "rage", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleModifyRageCommand, "", NULL }, - { "runicpower", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleModifyRunicPowerCommand, "", NULL }, - { "energy", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleModifyEnergyCommand, "", NULL }, - { "money", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleModifyMoneyCommand, "", NULL }, - { "scale", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleModifyScaleCommand, "", NULL }, - { "bit", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleModifyBitCommand, "", NULL }, - { "faction", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleModifyFactionCommand, "", NULL }, - { "spell", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleModifySpellCommand, "", NULL }, - { "talentpoints", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleModifyTalentCommand, "", NULL }, - { "mount", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleModifyMountCommand, "", NULL }, - { "honor", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleModifyHonorCommand, "", NULL }, - { "reputation", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleModifyRepCommand, "", NULL }, - { "arenapoints", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleModifyArenaCommand, "", NULL }, - { "drunk", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleModifyDrunkCommand, "", NULL }, - { "standstate", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleModifyStandStateCommand, "", NULL }, - { "phase", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleModifyPhaseCommand, "", NULL }, - { "gender", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleModifyGenderCommand, "", NULL }, - { "speed", RBAC_PERM_MODERATOR_COMMANDS, false, NULL, "", modifyspeedCommandTable }, - { NULL, 0, false, NULL, "", NULL } + { "arenapoints", RBAC_PERM_COMMAND_MODIFY_ARENAPOINTS, false, &HandleModifyArenaCommand, "", NULL }, + { "bit", RBAC_PERM_COMMAND_MODIFY_BIT, false, &HandleModifyBitCommand, "", NULL }, + { "drunk", RBAC_PERM_COMMAND_MODIFY_DRUNK, false, &HandleModifyDrunkCommand, "", NULL }, + { "energy", RBAC_PERM_COMMAND_MODIFY_ENERGY, false, &HandleModifyEnergyCommand, "", NULL }, + { "faction", RBAC_PERM_COMMAND_MODIFY_FACTION, false, &HandleModifyFactionCommand, "", NULL }, + { "gender", RBAC_PERM_COMMAND_MODIFY_GENDER, false, &HandleModifyGenderCommand, "", NULL }, + { "honor", RBAC_PERM_COMMAND_MODIFY_HONOR, false, &HandleModifyHonorCommand, "", NULL }, + { "hp", RBAC_PERM_COMMAND_MODIFY_HP, false, &HandleModifyHPCommand, "", NULL }, + { "mana", RBAC_PERM_COMMAND_MODIFY_MANA, false, &HandleModifyManaCommand, "", NULL }, + { "money", RBAC_PERM_COMMAND_MODIFY_MONEY, false, &HandleModifyMoneyCommand, "", NULL }, + { "mount", RBAC_PERM_COMMAND_MODIFY_MOUNT, false, &HandleModifyMountCommand, "", NULL }, + { "phase", RBAC_PERM_COMMAND_MODIFY_PHASE, false, &HandleModifyPhaseCommand, "", NULL }, + { "rage", RBAC_PERM_COMMAND_MODIFY_RAGE, false, &HandleModifyRageCommand, "", NULL }, + { "reputation", RBAC_PERM_COMMAND_MODIFY_REPUTATION, false, &HandleModifyRepCommand, "", NULL }, + { "runicpower", RBAC_PERM_COMMAND_MODIFY_RUNICPOWER, false, &HandleModifyRunicPowerCommand, "", NULL }, + { "scale", RBAC_PERM_COMMAND_MODIFY_SCALE, false, &HandleModifyScaleCommand, "", NULL }, + { "speed", RBAC_PERM_COMMAND_MODIFY_SPEED, false, NULL, "", modifyspeedCommandTable }, + { "spell", RBAC_PERM_COMMAND_MODIFY_SPELL, false, &HandleModifySpellCommand, "", NULL }, + { "standstate", RBAC_PERM_COMMAND_MODIFY_STANDSTATE, false, &HandleModifyStandStateCommand, "", NULL }, + { "talentpoints", RBAC_PERM_COMMAND_MODIFY_TALENTPOINTS, false, &HandleModifyTalentCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand commandTable[] = { - { "morph", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleModifyMorphCommand, "", NULL }, - { "demorph", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleDeMorphCommand, "", NULL }, - { "modify", RBAC_PERM_MODERATOR_COMMANDS, false, NULL, "", modifyCommandTable }, - { NULL, 0, false, NULL, "", NULL } + { "morph", RBAC_PERM_COMMAND_MORPH, false, &HandleModifyMorphCommand, "", NULL }, + { "demorph", RBAC_PERM_COMMAND_DEMORPH, false, &HandleDeMorphCommand, "", NULL }, + { "modify", RBAC_PERM_COMMAND_MODIFY, false, NULL, "", modifyCommandTable }, + { NULL, 0, false, NULL, "", NULL } }; return commandTable; } -- cgit v1.2.3 From efa194a7ce68cadfffdfbd7b091fb381bd058b9f Mon Sep 17 00:00:00 2001 From: Spp Date: Tue, 10 Sep 2013 13:48:57 +0200 Subject: Core/RBAC: Move npc commands to RBAC (using individual permissions) --- sql/updates/auth/2013_09_10_06_auth_misc.sql | 75 ++++++++++++++++++ sql/updates/world/2013_09_10_08_world_command.sql | 37 +++++++++ src/server/game/Accounts/RBAC.h | 32 ++++++++ src/server/scripts/Commands/cs_npc.cpp | 92 +++++++++++------------ 4 files changed, 188 insertions(+), 48 deletions(-) create mode 100644 sql/updates/auth/2013_09_10_06_auth_misc.sql create mode 100644 sql/updates/world/2013_09_10_08_world_command.sql (limited to 'sql') diff --git a/sql/updates/auth/2013_09_10_06_auth_misc.sql b/sql/updates/auth/2013_09_10_06_auth_misc.sql new file mode 100644 index 00000000000..e83e5e3cdf4 --- /dev/null +++ b/sql/updates/auth/2013_09_10_06_auth_misc.sql @@ -0,0 +1,75 @@ +/* cs_npc.cpp */ + +SET @id = 570; + +-- Add new permissions +DELETE FROM `rbac_permissions` WHERE `id` BETWEEN @id AND @id+31; +INSERT INTO `rbac_permissions` (`id`, `name`) VALUES +(@id+0, 'npc'), +(@id+1, 'npc add'), +(@id+2, 'npc add formation'), +(@id+3, 'npc add item'), +(@id+4, 'npc add move'), +(@id+5, 'npc add temp'), +(@id+6, 'npc add delete'), +(@id+7, 'npc add delete item'), +(@id+8, 'npc add follow'), +(@id+9, 'npc add follow stop'), +(@id+10, 'npc set'), +(@id+11, 'npc set allowmove'), +(@id+12, 'npc set entry'), +(@id+13, 'npc set factionid'), +(@id+14, 'npc set flag'), +(@id+15, 'npc set level'), +(@id+16, 'npc set link'), +(@id+17, 'npc set model'), +(@id+18, 'npc set movetype'), +(@id+19, 'npc set phase'), +(@id+20, 'npc set spawndist'), +(@id+21, 'npc set spawntime'), +(@id+22, 'npc set data'), +(@id+23, 'npc info'), +(@id+24, 'npc near'), +(@id+25, 'npc move'), +(@id+26, 'npc playemote'), +(@id+27, 'npc say'), +(@id+28, 'npc textemote'), +(@id+29, 'npc whisper'), +(@id+30, 'npc yell'), +(@id+31, 'npc tame'); + +-- Add permissions to "corresponding Commands Role" +DELETE FROM `rbac_role_permissions` WHERE `permissionId` BETWEEN @id AND @id+31; +INSERT INTO `rbac_role_permissions` (`roleId`, `permissionId`) VALUES +(2, @id+0), +(3, @id+1), +(3, @id+2), +(3, @id+3), +(3, @id+4), +(3, @id+5), +(3, @id+6), +(3, @id+7), +(3, @id+8), +(3, @id+9), +(3, @id+10), +(4, @id+11), +(4, @id+12), +(3, @id+13), +(3, @id+14), +(3, @id+15), +(3, @id+16), +(3, @id+17), +(3, @id+18), +(3, @id+19), +(3, @id+20), +(3, @id+21), +(4, @id+22), +(4, @id+23), +(3, @id+24), +(3, @id+25), +(4, @id+26), +(2, @id+27), +(2, @id+28), +(2, @id+29), +(2, @id+30), +(3, @id+31); diff --git a/sql/updates/world/2013_09_10_08_world_command.sql b/sql/updates/world/2013_09_10_08_world_command.sql new file mode 100644 index 00000000000..5567a5fd248 --- /dev/null +++ b/sql/updates/world/2013_09_10_08_world_command.sql @@ -0,0 +1,37 @@ +/* cs_npc.cpp */ + +SET @id = 570; + +-- Update command table with new RBAC permissions +UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'npc'; +UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'npc add'; +UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'npc add formation'; +UPDATE `command` SET `permission` = @id+3 WHERE `name` = 'npc add item'; +UPDATE `command` SET `permission` = @id+4 WHERE `name` = 'npc add move'; +UPDATE `command` SET `permission` = @id+5 WHERE `name` = 'npc add temp'; +UPDATE `command` SET `permission` = @id+6 WHERE `name` = 'npc add delete'; +UPDATE `command` SET `permission` = @id+7 WHERE `name` = 'npc add delete item'; +UPDATE `command` SET `permission` = @id+8 WHERE `name` = 'npc add follow'; +UPDATE `command` SET `permission` = @id+9 WHERE `name` = 'npc add follow stop'; +UPDATE `command` SET `permission` = @id+10 WHERE `name` = 'npc set'; +UPDATE `command` SET `permission` = @id+11 WHERE `name` = 'npc set allowmove'; +UPDATE `command` SET `permission` = @id+12 WHERE `name` = 'npc set entry'; +UPDATE `command` SET `permission` = @id+13 WHERE `name` = 'npc set factionid'; +UPDATE `command` SET `permission` = @id+14 WHERE `name` = 'npc set flag'; +UPDATE `command` SET `permission` = @id+15 WHERE `name` = 'npc set level'; +UPDATE `command` SET `permission` = @id+16 WHERE `name` = 'npc set link'; +UPDATE `command` SET `permission` = @id+17 WHERE `name` = 'npc set model'; +UPDATE `command` SET `permission` = @id+18 WHERE `name` = 'npc set movetype'; +UPDATE `command` SET `permission` = @id+19 WHERE `name` = 'npc set phase'; +UPDATE `command` SET `permission` = @id+20 WHERE `name` = 'npc set spawndist'; +UPDATE `command` SET `permission` = @id+21 WHERE `name` = 'npc set spawntime'; +UPDATE `command` SET `permission` = @id+22 WHERE `name` = 'npc set data'; +UPDATE `command` SET `permission` = @id+23 WHERE `name` = 'npc info'; +UPDATE `command` SET `permission` = @id+24 WHERE `name` = 'npc near'; +UPDATE `command` SET `permission` = @id+25 WHERE `name` = 'npc move'; +UPDATE `command` SET `permission` = @id+26 WHERE `name` = 'npc playemote'; +UPDATE `command` SET `permission` = @id+27 WHERE `name` = 'npc say'; +UPDATE `command` SET `permission` = @id+28 WHERE `name` = 'npc textemote'; +UPDATE `command` SET `permission` = @id+29 WHERE `name` = 'npc whisper'; +UPDATE `command` SET `permission` = @id+30 WHERE `name` = 'npc yell'; +UPDATE `command` SET `permission` = @id+31 WHERE `name` = 'npc tame'; diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h index 1d4a86107ec..3bdb8392656 100644 --- a/src/server/game/Accounts/RBAC.h +++ b/src/server/game/Accounts/RBAC.h @@ -469,6 +469,38 @@ enum RBACPermissions RBAC_PERM_COMMAND_MODIFY_SPELL = 567, RBAC_PERM_COMMAND_MODIFY_STANDSTATE = 568, RBAC_PERM_COMMAND_MODIFY_TALENTPOINTS = 569, + RBAC_PERM_COMMAND_NPC = 570, + RBAC_PERM_COMMAND_NPC_ADD = 571, + RBAC_PERM_COMMAND_NPC_ADD_FORMATION = 572, + RBAC_PERM_COMMAND_NPC_ADD_ITEM = 573, + RBAC_PERM_COMMAND_NPC_ADD_MOVE = 574, + RBAC_PERM_COMMAND_NPC_ADD_TEMP = 575, + RBAC_PERM_COMMAND_NPC_DELETE = 576, + RBAC_PERM_COMMAND_NPC_DELETE_ITEM = 577, + RBAC_PERM_COMMAND_NPC_FOLLOW = 578, + RBAC_PERM_COMMAND_NPC_FOLLOW_STOP = 579, + RBAC_PERM_COMMAND_NPC_SET = 580, + RBAC_PERM_COMMAND_NPC_SET_ALLOWMOVE = 581, + RBAC_PERM_COMMAND_NPC_SET_ENTRY = 582, + RBAC_PERM_COMMAND_NPC_SET_FACTIONID = 583, + RBAC_PERM_COMMAND_NPC_SET_FLAG = 584, + RBAC_PERM_COMMAND_NPC_SET_LEVEL = 585, + RBAC_PERM_COMMAND_NPC_SET_LINK = 586, + RBAC_PERM_COMMAND_NPC_SET_MODEL = 587, + RBAC_PERM_COMMAND_NPC_SET_MOVETYPE = 588, + RBAC_PERM_COMMAND_NPC_SET_PHASE = 589, + RBAC_PERM_COMMAND_NPC_SET_SPAWNDIST = 590, + RBAC_PERM_COMMAND_NPC_SET_SPAWNTIME = 591, + RBAC_PERM_COMMAND_NPC_SET_DATA = 592, + RBAC_PERM_COMMAND_NPC_INFO = 593, + RBAC_PERM_COMMAND_NPC_NEAR = 594, + RBAC_PERM_COMMAND_NPC_MOVE = 595, + RBAC_PERM_COMMAND_NPC_PLAYEMOTE = 596, + RBAC_PERM_COMMAND_NPC_SAY = 597, + RBAC_PERM_COMMAND_NPC_TEXTEMOTE = 598, + RBAC_PERM_COMMAND_NPC_WHISPER = 599, + RBAC_PERM_COMMAND_NPC_YELL = 600, + RBAC_PERM_COMMAND_NPC_TAME = 601, // custom permissions 1000+ RBAC_PERM_MAX diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 0dfb7181fef..fc68036aa01 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -153,69 +153,65 @@ public: { static ChatCommand npcAddCommandTable[] = { - { "formation", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleNpcAddFormationCommand, "", NULL }, - { "item", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleNpcAddVendorItemCommand, "", NULL }, - { "move", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleNpcAddMoveCommand, "", NULL }, - { "temp", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleNpcAddTempSpawnCommand, "", NULL }, - //{@todo fix or remove this command - { "weapon", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleNpcAddWeaponCommand, "", NULL }, - //} - { "", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleNpcAddCommand, "", NULL }, - { NULL, RBAC_PERM_PLAYER_COMMANDS, false, NULL, "", NULL } + { "formation", RBAC_PERM_COMMAND_NPC_ADD_FORMATION, false, &HandleNpcAddFormationCommand, "", NULL }, + { "item", RBAC_PERM_COMMAND_NPC_ADD_ITEM, false, &HandleNpcAddVendorItemCommand, "", NULL }, + { "move", RBAC_PERM_COMMAND_NPC_ADD_MOVE, false, &HandleNpcAddMoveCommand, "", NULL }, + { "temp", RBAC_PERM_COMMAND_NPC_ADD_TEMP, false, &HandleNpcAddTempSpawnCommand, "", NULL }, + //{ "weapon", RBAC_PERM_COMMAND_NPC_ADD_WEAPON, false, &HandleNpcAddWeaponCommand, "", NULL }, + { "", RBAC_PERM_COMMAND_NPC_ADD, false, &HandleNpcAddCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand npcDeleteCommandTable[] = { - { "item", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleNpcDeleteVendorItemCommand, "", NULL }, - { "", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleNpcDeleteCommand, "", NULL }, - { NULL, RBAC_PERM_PLAYER_COMMANDS, false, NULL, "", NULL } + { "item", RBAC_PERM_COMMAND_NPC_DELETE_ITEM, false, &HandleNpcDeleteVendorItemCommand, "", NULL }, + { "", RBAC_PERM_COMMAND_NPC_DELETE, false, &HandleNpcDeleteCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand npcFollowCommandTable[] = { - { "stop", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleNpcUnFollowCommand, "", NULL }, - { "", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleNpcFollowCommand, "", NULL }, - { NULL, RBAC_PERM_PLAYER_COMMANDS, false, NULL, "", NULL } + { "stop", RBAC_PERM_COMMAND_NPC_FOLLOW_STOP, false, &HandleNpcUnFollowCommand, "", NULL }, + { "", RBAC_PERM_COMMAND_NPC_FOLLOW, false, &HandleNpcFollowCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand npcSetCommandTable[] = { - { "allowmove", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleNpcSetAllowMovementCommand, "", NULL }, - { "entry", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleNpcSetEntryCommand, "", NULL }, - { "factionid", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleNpcSetFactionIdCommand, "", NULL }, - { "flag", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleNpcSetFlagCommand, "", NULL }, - { "level", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleNpcSetLevelCommand, "", NULL }, - { "link", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleNpcSetLinkCommand, "", NULL }, - { "model", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleNpcSetModelCommand, "", NULL }, - { "movetype", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleNpcSetMoveTypeCommand, "", NULL }, - { "phase", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleNpcSetPhaseCommand, "", NULL }, - { "spawndist", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleNpcSetSpawnDistCommand, "", NULL }, - { "spawntime", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleNpcSetSpawnTimeCommand, "", NULL }, - { "data", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleNpcSetDataCommand, "", NULL }, - //{ @todo fix or remove these commands - { "name", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleNpcSetNameCommand, "", NULL }, - { "subname", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleNpcSetSubNameCommand, "", NULL }, - //} - { NULL, RBAC_PERM_PLAYER_COMMANDS, false, NULL, "", NULL } + { "allowmove", RBAC_PERM_COMMAND_NPC_SET_ALLOWMOVE, false, &HandleNpcSetAllowMovementCommand, "", NULL }, + { "entry", RBAC_PERM_COMMAND_NPC_SET_ENTRY, false, &HandleNpcSetEntryCommand, "", NULL }, + { "factionid", RBAC_PERM_COMMAND_NPC_SET_FACTIONID, false, &HandleNpcSetFactionIdCommand, "", NULL }, + { "flag", RBAC_PERM_COMMAND_NPC_SET_FLAG, false, &HandleNpcSetFlagCommand, "", NULL }, + { "level", RBAC_PERM_COMMAND_NPC_SET_LEVEL, false, &HandleNpcSetLevelCommand, "", NULL }, + { "link", RBAC_PERM_COMMAND_NPC_SET_LINK, false, &HandleNpcSetLinkCommand, "", NULL }, + { "model", RBAC_PERM_COMMAND_NPC_SET_MODEL, false, &HandleNpcSetModelCommand, "", NULL }, + { "movetype", RBAC_PERM_COMMAND_NPC_SET_MOVETYPE, false, &HandleNpcSetMoveTypeCommand, "", NULL }, + { "phase", RBAC_PERM_COMMAND_NPC_SET_PHASE, false, &HandleNpcSetPhaseCommand, "", NULL }, + { "spawndist", RBAC_PERM_COMMAND_NPC_SET_SPAWNDIST, false, &HandleNpcSetSpawnDistCommand, "", NULL }, + { "spawntime", RBAC_PERM_COMMAND_NPC_SET_SPAWNTIME, false, &HandleNpcSetSpawnTimeCommand, "", NULL }, + { "data", RBAC_PERM_COMMAND_NPC_SET_DATA, false, &HandleNpcSetDataCommand, "", NULL }, + //{ "name", RBAC_PERM_COMMAND_NPC_SET_NAME, false, &HandleNpcSetNameCommand, "", NULL }, + //{ "subname", RBAC_PERM_COMMAND_NPC_SET_SUBNAME, false, &HandleNpcSetSubNameCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand npcCommandTable[] = { - { "info", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleNpcInfoCommand, "", NULL }, - { "near", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleNpcNearCommand, "", NULL }, - { "move", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleNpcMoveCommand, "", NULL }, - { "playemote", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleNpcPlayEmoteCommand, "", NULL }, - { "say", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleNpcSayCommand, "", NULL }, - { "textemote", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleNpcTextEmoteCommand, "", NULL }, - { "whisper", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleNpcWhisperCommand, "", NULL }, - { "yell", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleNpcYellCommand, "", NULL }, - { "tame", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleNpcTameCommand, "", NULL }, - { "add", RBAC_PERM_GAMEMASTER_COMMANDS, false, NULL, "", npcAddCommandTable }, - { "delete", RBAC_PERM_GAMEMASTER_COMMANDS, false, NULL, "", npcDeleteCommandTable }, - { "follow", RBAC_PERM_GAMEMASTER_COMMANDS, false, NULL, "", npcFollowCommandTable }, - { "set", RBAC_PERM_GAMEMASTER_COMMANDS, false, NULL, "", npcSetCommandTable }, - { NULL, RBAC_PERM_PLAYER_COMMANDS, false, NULL, "", NULL } + { "info", RBAC_PERM_COMMAND_NPC_INFO, false, &HandleNpcInfoCommand, "", NULL }, + { "near", RBAC_PERM_COMMAND_NPC_NEAR, false, &HandleNpcNearCommand, "", NULL }, + { "move", RBAC_PERM_COMMAND_NPC_MOVE, false, &HandleNpcMoveCommand, "", NULL }, + { "playemote", RBAC_PERM_COMMAND_NPC_PLAYEMOTE, false, &HandleNpcPlayEmoteCommand, "", NULL }, + { "say", RBAC_PERM_COMMAND_NPC_SAY, false, &HandleNpcSayCommand, "", NULL }, + { "textemote", RBAC_PERM_COMMAND_NPC_TEXTEMOTE, false, &HandleNpcTextEmoteCommand, "", NULL }, + { "whisper", RBAC_PERM_COMMAND_NPC_WHISPER, false, &HandleNpcWhisperCommand, "", NULL }, + { "yell", RBAC_PERM_COMMAND_NPC_YELL, false, &HandleNpcYellCommand, "", NULL }, + { "tame", RBAC_PERM_COMMAND_NPC_TAME, false, &HandleNpcTameCommand, "", NULL }, + { "add", RBAC_PERM_COMMAND_NPC_ADD, false, NULL, "", npcAddCommandTable }, + { "delete", RBAC_PERM_COMMAND_NPC_DELETE, false, NULL, "", npcDeleteCommandTable }, + { "follow", RBAC_PERM_COMMAND_NPC_FOLLOW, false, NULL, "", npcFollowCommandTable }, + { "set", RBAC_PERM_COMMAND_NPC_SET, false, NULL, "", npcSetCommandTable }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand commandTable[] = { - { "npc", RBAC_PERM_MODERATOR_COMMANDS, false, NULL, "", npcCommandTable }, - { NULL, RBAC_PERM_PLAYER_COMMANDS, false, NULL, "", NULL } + { "npc", RBAC_PERM_COMMAND_NPC, false, NULL, "", npcCommandTable }, + { NULL, 0, false, NULL, "", NULL } }; return commandTable; } -- cgit v1.2.3 From 4f632ee3ffd10ab667b349ae3394a90fe73d89be Mon Sep 17 00:00:00 2001 From: Spp Date: Tue, 10 Sep 2013 13:57:30 +0200 Subject: Core/RBAC: Move quest commands to RBAC (using individual permissions) --- sql/updates/auth/2013_09_10_07_auth_misc.sql | 21 +++++++++++++++++++++ sql/updates/world/2013_09_10_09_world_command.sql | 10 ++++++++++ src/server/game/Accounts/RBAC.h | 5 +++++ src/server/scripts/Commands/cs_quest.cpp | 14 +++++++------- 4 files changed, 43 insertions(+), 7 deletions(-) create mode 100644 sql/updates/auth/2013_09_10_07_auth_misc.sql create mode 100644 sql/updates/world/2013_09_10_09_world_command.sql (limited to 'sql') diff --git a/sql/updates/auth/2013_09_10_07_auth_misc.sql b/sql/updates/auth/2013_09_10_07_auth_misc.sql new file mode 100644 index 00000000000..9988220d878 --- /dev/null +++ b/sql/updates/auth/2013_09_10_07_auth_misc.sql @@ -0,0 +1,21 @@ +/* cs_quest.cpp */ + +SET @id = 602; + +-- Add new permissions +DELETE FROM `rbac_permissions` WHERE `id` BETWEEN @id AND @id+4; +INSERT INTO `rbac_permissions` (`id`, `name`) VALUES +(@id+0, 'quest'), +(@id+1, 'quest add'), +(@id+2, 'quest complete'), +(@id+3, 'quest remove'), +(@id+4, 'quest reward'); + +-- Add permissions to "corresponding Commands Role" +DELETE FROM `rbac_role_permissions` WHERE `permissionId` BETWEEN @id AND @id+4; +INSERT INTO `rbac_role_permissions` (`roleId`, `permissionId`) VALUES +(4, @id+0), +(4, @id+1), +(4, @id+2), +(4, @id+3), +(4, @id+4); diff --git a/sql/updates/world/2013_09_10_09_world_command.sql b/sql/updates/world/2013_09_10_09_world_command.sql new file mode 100644 index 00000000000..6523202aa24 --- /dev/null +++ b/sql/updates/world/2013_09_10_09_world_command.sql @@ -0,0 +1,10 @@ +/* cs_npc.cpp */ + +SET @id = 602; + +-- Update command table with new RBAC permissions +UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'quest'; +UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'quest add'; +UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'quest complete'; +UPDATE `command` SET `permission` = @id+3 WHERE `name` = 'quest remove'; +UPDATE `command` SET `permission` = @id+4 WHERE `name` = 'quest reward'; diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h index 3bdb8392656..8d739554d46 100644 --- a/src/server/game/Accounts/RBAC.h +++ b/src/server/game/Accounts/RBAC.h @@ -501,6 +501,11 @@ enum RBACPermissions RBAC_PERM_COMMAND_NPC_WHISPER = 599, RBAC_PERM_COMMAND_NPC_YELL = 600, RBAC_PERM_COMMAND_NPC_TAME = 601, + RBAC_PERM_COMMAND_QUEST = 602, + RBAC_PERM_COMMAND_QUEST_ADD = 603, + RBAC_PERM_COMMAND_QUEST_COMPLETE = 604, + RBAC_PERM_COMMAND_QUEST_REMOVE = 605, + RBAC_PERM_COMMAND_QUEST_REWARD = 606, // custom permissions 1000+ RBAC_PERM_MAX diff --git a/src/server/scripts/Commands/cs_quest.cpp b/src/server/scripts/Commands/cs_quest.cpp index 20515eb0921..3ad1fea74a2 100644 --- a/src/server/scripts/Commands/cs_quest.cpp +++ b/src/server/scripts/Commands/cs_quest.cpp @@ -37,16 +37,16 @@ public: { static ChatCommand questCommandTable[] = { - { "add", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleQuestAdd, "", NULL }, - { "complete", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleQuestComplete, "", NULL }, - { "remove", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleQuestRemove, "", NULL }, - { "reward", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleQuestReward, "", NULL }, - { NULL, RBAC_PERM_PLAYER_COMMANDS, false, NULL, "", NULL } + { "add", RBAC_PERM_COMMAND_QUEST_ADD, false, &HandleQuestAdd, "", NULL }, + { "complete", RBAC_PERM_COMMAND_QUEST_COMPLETE, false, &HandleQuestComplete, "", NULL }, + { "remove", RBAC_PERM_COMMAND_QUEST_REMOVE, false, &HandleQuestRemove, "", NULL }, + { "reward", RBAC_PERM_COMMAND_QUEST_REWARD, false, &HandleQuestReward, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand commandTable[] = { - { "quest", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, NULL, "", questCommandTable }, - { NULL, RBAC_PERM_PLAYER_COMMANDS, false, NULL, "", NULL } + { "quest", RBAC_PERM_COMMAND_QUEST, false, NULL, "", questCommandTable }, + { NULL, 0, false, NULL, "", NULL } }; return commandTable; } -- cgit v1.2.3 From 1f95f0b0b801496f7901c52e8407b1b3610d6ab1 Mon Sep 17 00:00:00 2001 From: Spp Date: Tue, 10 Sep 2013 14:25:07 +0200 Subject: Core/RBAC: Move reload command to RBAC (using individual permissions) --- sql/updates/auth/2013_09_10_08_auth_misc.sql | 217 ++++++++++++++++++++++ sql/updates/world/2013_09_10_10_world_command.sql | 108 +++++++++++ src/server/game/Accounts/RBAC.h | 103 ++++++++++ src/server/scripts/Commands/cs_reload.cpp | 216 ++++++++++----------- 4 files changed, 536 insertions(+), 108 deletions(-) create mode 100644 sql/updates/auth/2013_09_10_08_auth_misc.sql create mode 100644 sql/updates/world/2013_09_10_10_world_command.sql (limited to 'sql') diff --git a/sql/updates/auth/2013_09_10_08_auth_misc.sql b/sql/updates/auth/2013_09_10_08_auth_misc.sql new file mode 100644 index 00000000000..c735009b7da --- /dev/null +++ b/sql/updates/auth/2013_09_10_08_auth_misc.sql @@ -0,0 +1,217 @@ +/* cs_reload.cpp */ + +SET @id = 607; + +-- Add new permissions +DELETE FROM `rbac_permissions` WHERE `id` BETWEEN @id AND @id+102; +INSERT INTO `rbac_permissions` (`id`, `name`) VALUES +(@id+0, 'reload'), +(@id+1, 'reload access_requirement'), +(@id+2, 'reload achievement_criteria_data'), +(@id+3, 'reload achievement_reward'), +(@id+4, 'reload all'), +(@id+5, 'reload all achievement'), +(@id+6, 'reload all area'), +(@id+7, 'reload all eventai'), +(@id+8, 'reload all gossips'), +(@id+9, 'reload all item'), +(@id+10, 'reload all locales'), +(@id+11, 'reload all loot'), +(@id+12, 'reload all npc'), +(@id+13, 'reload all quest'), +(@id+14, 'reload all scripts'), +(@id+15, 'reload all spell'), +(@id+16, 'reload areatrigger_involvedrelation'), +(@id+17, 'reload areatrigger_tavern'), +(@id+18, 'reload areatrigger_teleport'), +(@id+19, 'reload auctions'), +(@id+20, 'reload autobroadcast'), +(@id+21, 'reload command'), +(@id+22, 'reload conditions'), +(@id+23, 'reload config'), +(@id+24, 'reload creature_text'), +(@id+25, 'reload creature_ai_scripts'), +(@id+26, 'reload creature_ai_texts'), +(@id+27, 'reload creature_questender'), +(@id+28, 'reload creature_linked_respawn'), +(@id+29, 'reload creature_loot_template'), +(@id+30, 'reload creature_onkill_reputation'), +(@id+31, 'reload creature_queststarter'), +(@id+32, 'reload creature_summon_groups'), +(@id+33, 'reload creature_template'), +(@id+34, 'reload disables'), +(@id+35, 'reload disenchant_loot_template'), +(@id+36, 'reload event_scripts'), +(@id+37, 'reload fishing_loot_template'), +(@id+38, 'reload game_graveyard_zone'), +(@id+39, 'reload game_tele'), +(@id+40, 'reload gameobject_questender'), +(@id+41, 'reload gameobject_loot_template'), +(@id+42, 'reload gameobject_queststarter'), +(@id+43, 'reload gm_tickets'), +(@id+44, 'reload gossip_menu'), +(@id+45, 'reload gossip_menu_option'), +(@id+46, 'reload item_enchantment_template'), +(@id+47, 'reload item_loot_template'), +(@id+48, 'reload item_set_names'), +(@id+49, 'reload lfg_dungeon_rewards'), +(@id+50, 'reload locales_achievement_reward'), +(@id+51, 'reload locales_creature'), +(@id+52, 'reload locales_creature_text'), +(@id+53, 'reload locales_gameobject'), +(@id+54, 'reload locales_gossip_menu_option'), +(@id+55, 'reload locales_item'), +(@id+56, 'reload locales_item_set_name'), +(@id+57, 'reload locales_npc_text'), +(@id+58, 'reload locales_page_text'), +(@id+59, 'reload locales_points_of_interest'), +(@id+60, 'reload locales_quest'), +(@id+61, 'reload mail_level_reward'), +(@id+62, 'reload mail_loot_template'), +(@id+63, 'reload milling_loot_template'), +(@id+64, 'reload npc_spellclick_spells'), +(@id+65, 'reload npc_trainer'), +(@id+66, 'reload npc_vendor'), +(@id+67, 'reload page_text'), +(@id+68, 'reload pickpocketing_loot_template'), +(@id+69, 'reload points_of_interest'), +(@id+70, 'reload prospecting_loot_template'), +(@id+71, 'reload quest_poi'), +(@id+72, 'reload quest_template'), +(@id+73, 'reload rbac'), +(@id+74, 'reload reference_loot_template'), +(@id+75, 'reload reserved_name'), +(@id+76, 'reload reputation_reward_rate'), +(@id+77, 'reload reputation_spillover_template'), +(@id+78, 'reload skill_discovery_template'), +(@id+79, 'reload skill_extra_item_template'), +(@id+80, 'reload skill_fishing_base_level'), +(@id+81, 'reload skinning_loot_template'), +(@id+82, 'reload smart_scripts'), +(@id+83, 'reload spell_required'), +(@id+84, 'reload spell_area'), +(@id+85, 'reload spell_bonus_data'), +(@id+86, 'reload spell_group'), +(@id+87, 'reload spell_learn_spell'), +(@id+88, 'reload spell_loot_template'), +(@id+89, 'reload spell_linked_spell'), +(@id+90, 'reload spell_pet_auras'), +(@id+91, 'reload spell_proc_event'), +(@id+92, 'reload spell_proc'), +(@id+93, 'reload spell_scripts'), +(@id+94, 'reload spell_target_position'), +(@id+95, 'reload spell_threats'), +(@id+96, 'reload spell_group_stack_rules'), +(@id+97, 'reload trinity_string'), +(@id+98, 'reload warden_action'), +(@id+99, 'reload waypoint_scripts'), +(@id+100, 'reload waypoint_data'), +(@id+101, 'reload vehicle_accessory'), +(@id+102, 'reload vehicle_template_accessory'); + +-- Add permissions to "corresponding Commands Role" +DELETE FROM `rbac_role_permissions` WHERE `permissionId` BETWEEN @id AND @id+102; +INSERT INTO `rbac_role_permissions` (`roleId`, `permissionId`) VALUES +(4, @id+0), +(4, @id+1), +(4, @id+2), +(4, @id+3), +(4, @id+4), +(4, @id+5), +(4, @id+6), +(4, @id+7), +(4, @id+8), +(4, @id+9), +(4, @id+10), +(4, @id+11), +(4, @id+12), +(4, @id+13), +(4, @id+14), +(4, @id+15), +(4, @id+16), +(4, @id+17), +(4, @id+18), +(4, @id+19), +(4, @id+20), +(4, @id+21), +(4, @id+22), +(4, @id+23), +(4, @id+24), +(4, @id+25), +(4, @id+26), +(4, @id+27), +(4, @id+28), +(4, @id+29), +(4, @id+30), +(4, @id+31), +(4, @id+32), +(4, @id+33), +(4, @id+34), +(4, @id+35), +(4, @id+36), +(4, @id+37), +(4, @id+38), +(4, @id+39), +(4, @id+40), +(4, @id+41), +(4, @id+42), +(4, @id+43), +(4, @id+44), +(4, @id+45), +(4, @id+46), +(4, @id+47), +(4, @id+48), +(4, @id+49), +(4, @id+50), +(4, @id+51), +(4, @id+52), +(4, @id+53), +(4, @id+54), +(4, @id+55), +(4, @id+56), +(4, @id+57), +(4, @id+58), +(4, @id+59), +(4, @id+60), +(4, @id+61), +(4, @id+62), +(4, @id+63), +(4, @id+64), +(4, @id+65), +(4, @id+66), +(4, @id+67), +(4, @id+68), +(4, @id+69), +(4, @id+70), +(4, @id+71), +(4, @id+72), +(4, @id+73), +(4, @id+74), +(4, @id+75), +(4, @id+76), +(4, @id+77), +(4, @id+78), +(4, @id+79), +(4, @id+80), +(4, @id+81), +(4, @id+82), +(4, @id+83), +(4, @id+84), +(4, @id+85), +(4, @id+86), +(4, @id+87), +(4, @id+88), +(4, @id+89), +(4, @id+90), +(4, @id+91), +(4, @id+92), +(4, @id+93), +(4, @id+94), +(4, @id+95), +(4, @id+96), +(4, @id+97), +(4, @id+98), +(4, @id+99), +(4, @id+100), +(4, @id+101), +(4, @id+102); diff --git a/sql/updates/world/2013_09_10_10_world_command.sql b/sql/updates/world/2013_09_10_10_world_command.sql new file mode 100644 index 00000000000..4249ff1ad5b --- /dev/null +++ b/sql/updates/world/2013_09_10_10_world_command.sql @@ -0,0 +1,108 @@ +/* cs_npc.cpp */ + +SET @id = 607; + +-- Update command table with new RBAC permissions +UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'reload'; +UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'reload access_requirement'; +UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'reload achievement_criteria_data'; +UPDATE `command` SET `permission` = @id+3 WHERE `name` = 'reload achievement_reward'; +UPDATE `command` SET `permission` = @id+4 WHERE `name` = 'reload all'; +UPDATE `command` SET `permission` = @id+5 WHERE `name` = 'reload all achievement'; +UPDATE `command` SET `permission` = @id+6 WHERE `name` = 'reload all area'; +UPDATE `command` SET `permission` = @id+7 WHERE `name` = 'reload all eventai'; +UPDATE `command` SET `permission` = @id+8 WHERE `name` = 'reload all gossips'; +UPDATE `command` SET `permission` = @id+9 WHERE `name` = 'reload all item'; +UPDATE `command` SET `permission` = @id+10 WHERE `name` = 'reload all locales'; +UPDATE `command` SET `permission` = @id+11 WHERE `name` = 'reload all loot'; +UPDATE `command` SET `permission` = @id+12 WHERE `name` = 'reload all npc'; +UPDATE `command` SET `permission` = @id+13 WHERE `name` = 'reload all quest'; +UPDATE `command` SET `permission` = @id+14 WHERE `name` = 'reload all scripts'; +UPDATE `command` SET `permission` = @id+15 WHERE `name` = 'reload all spell'; +UPDATE `command` SET `permission` = @id+16 WHERE `name` = 'reload areatrigger_involvedrelation'; +UPDATE `command` SET `permission` = @id+17 WHERE `name` = 'reload areatrigger_tavern'; +UPDATE `command` SET `permission` = @id+18 WHERE `name` = 'reload areatrigger_teleport'; +UPDATE `command` SET `permission` = @id+19 WHERE `name` = 'reload auctions'; +UPDATE `command` SET `permission` = @id+20 WHERE `name` = 'reload autobroadcast'; +UPDATE `command` SET `permission` = @id+21 WHERE `name` = 'reload command'; +UPDATE `command` SET `permission` = @id+22 WHERE `name` = 'reload conditions'; +UPDATE `command` SET `permission` = @id+23 WHERE `name` = 'reload config'; +UPDATE `command` SET `permission` = @id+24 WHERE `name` = 'reload creature_text'; +UPDATE `command` SET `permission` = @id+25 WHERE `name` = 'reload creature_ai_scripts'; +UPDATE `command` SET `permission` = @id+26 WHERE `name` = 'reload creature_ai_texts'; +UPDATE `command` SET `permission` = @id+27 WHERE `name` = 'reload creature_questender'; +UPDATE `command` SET `permission` = @id+28 WHERE `name` = 'reload creature_linked_respawn'; +UPDATE `command` SET `permission` = @id+29 WHERE `name` = 'reload creature_loot_template'; +UPDATE `command` SET `permission` = @id+30 WHERE `name` = 'reload creature_onkill_reputation'; +UPDATE `command` SET `permission` = @id+31 WHERE `name` = 'reload creature_queststarter'; +UPDATE `command` SET `permission` = @id+32 WHERE `name` = 'reload creature_summon_groups'; +UPDATE `command` SET `permission` = @id+33 WHERE `name` = 'reload creature_template'; +UPDATE `command` SET `permission` = @id+34 WHERE `name` = 'reload disables'; +UPDATE `command` SET `permission` = @id+35 WHERE `name` = 'reload disenchant_loot_template'; +UPDATE `command` SET `permission` = @id+36 WHERE `name` = 'reload event_scripts'; +UPDATE `command` SET `permission` = @id+37 WHERE `name` = 'reload fishing_loot_template'; +UPDATE `command` SET `permission` = @id+38 WHERE `name` = 'reload game_graveyard_zone'; +UPDATE `command` SET `permission` = @id+39 WHERE `name` = 'reload game_tele'; +UPDATE `command` SET `permission` = @id+40 WHERE `name` = 'reload gameobject_questender'; +UPDATE `command` SET `permission` = @id+41 WHERE `name` = 'reload gameobject_loot_template'; +UPDATE `command` SET `permission` = @id+42 WHERE `name` = 'reload gameobject_queststarter'; +UPDATE `command` SET `permission` = @id+43 WHERE `name` = 'reload gm_tickets'; +UPDATE `command` SET `permission` = @id+44 WHERE `name` = 'reload gossip_menu'; +UPDATE `command` SET `permission` = @id+45 WHERE `name` = 'reload gossip_menu_option'; +UPDATE `command` SET `permission` = @id+46 WHERE `name` = 'reload item_enchantment_template'; +UPDATE `command` SET `permission` = @id+47 WHERE `name` = 'reload item_loot_template'; +UPDATE `command` SET `permission` = @id+48 WHERE `name` = 'reload item_set_names'; +UPDATE `command` SET `permission` = @id+49 WHERE `name` = 'reload lfg_dungeon_rewards'; +UPDATE `command` SET `permission` = @id+50 WHERE `name` = 'reload locales_achievement_reward'; +UPDATE `command` SET `permission` = @id+51 WHERE `name` = 'reload locales_creature'; +UPDATE `command` SET `permission` = @id+52 WHERE `name` = 'reload locales_creature_text'; +UPDATE `command` SET `permission` = @id+53 WHERE `name` = 'reload locales_gameobject'; +UPDATE `command` SET `permission` = @id+54 WHERE `name` = 'reload locales_gossip_menu_option'; +UPDATE `command` SET `permission` = @id+55 WHERE `name` = 'reload locales_item'; +UPDATE `command` SET `permission` = @id+56 WHERE `name` = 'reload locales_item_set_name'; +UPDATE `command` SET `permission` = @id+57 WHERE `name` = 'reload locales_npc_text'; +UPDATE `command` SET `permission` = @id+58 WHERE `name` = 'reload locales_page_text'; +UPDATE `command` SET `permission` = @id+59 WHERE `name` = 'reload locales_points_of_interest'; +UPDATE `command` SET `permission` = @id+60 WHERE `name` = 'reload locales_quest'; +UPDATE `command` SET `permission` = @id+61 WHERE `name` = 'reload mail_level_reward'; +UPDATE `command` SET `permission` = @id+62 WHERE `name` = 'reload mail_loot_template'; +UPDATE `command` SET `permission` = @id+63 WHERE `name` = 'reload milling_loot_template'; +UPDATE `command` SET `permission` = @id+64 WHERE `name` = 'reload npc_spellclick_spells'; +UPDATE `command` SET `permission` = @id+65 WHERE `name` = 'reload npc_trainer'; +UPDATE `command` SET `permission` = @id+66 WHERE `name` = 'reload npc_vendor'; +UPDATE `command` SET `permission` = @id+67 WHERE `name` = 'reload page_text'; +UPDATE `command` SET `permission` = @id+68 WHERE `name` = 'reload pickpocketing_loot_template'; +UPDATE `command` SET `permission` = @id+69 WHERE `name` = 'reload points_of_interest'; +UPDATE `command` SET `permission` = @id+70 WHERE `name` = 'reload prospecting_loot_template'; +UPDATE `command` SET `permission` = @id+71 WHERE `name` = 'reload quest_poi'; +UPDATE `command` SET `permission` = @id+72 WHERE `name` = 'reload quest_template'; +UPDATE `command` SET `permission` = @id+73 WHERE `name` = 'reload rbac'; +UPDATE `command` SET `permission` = @id+74 WHERE `name` = 'reload reference_loot_template'; +UPDATE `command` SET `permission` = @id+75 WHERE `name` = 'reload reserved_name'; +UPDATE `command` SET `permission` = @id+76 WHERE `name` = 'reload reputation_reward_rate'; +UPDATE `command` SET `permission` = @id+77 WHERE `name` = 'reload reputation_spillover_template'; +UPDATE `command` SET `permission` = @id+78 WHERE `name` = 'reload skill_discovery_template'; +UPDATE `command` SET `permission` = @id+79 WHERE `name` = 'reload skill_extra_item_template'; +UPDATE `command` SET `permission` = @id+80 WHERE `name` = 'reload skill_fishing_base_level'; +UPDATE `command` SET `permission` = @id+81 WHERE `name` = 'reload skinning_loot_template'; +UPDATE `command` SET `permission` = @id+82 WHERE `name` = 'reload smart_scripts'; +UPDATE `command` SET `permission` = @id+83 WHERE `name` = 'reload spell_required'; +UPDATE `command` SET `permission` = @id+84 WHERE `name` = 'reload spell_area'; +UPDATE `command` SET `permission` = @id+85 WHERE `name` = 'reload spell_bonus_data'; +UPDATE `command` SET `permission` = @id+86 WHERE `name` = 'reload spell_group'; +UPDATE `command` SET `permission` = @id+87 WHERE `name` = 'reload spell_learn_spell'; +UPDATE `command` SET `permission` = @id+88 WHERE `name` = 'reload spell_loot_template'; +UPDATE `command` SET `permission` = @id+89 WHERE `name` = 'reload spell_linked_spell'; +UPDATE `command` SET `permission` = @id+90 WHERE `name` = 'reload spell_pet_auras'; +UPDATE `command` SET `permission` = @id+91 WHERE `name` = 'reload spell_proc_event'; +UPDATE `command` SET `permission` = @id+92 WHERE `name` = 'reload spell_proc'; +UPDATE `command` SET `permission` = @id+93 WHERE `name` = 'reload spell_scripts'; +UPDATE `command` SET `permission` = @id+94 WHERE `name` = 'reload spell_target_position'; +UPDATE `command` SET `permission` = @id+95 WHERE `name` = 'reload spell_threats'; +UPDATE `command` SET `permission` = @id+96 WHERE `name` = 'reload spell_group_stack_rules'; +UPDATE `command` SET `permission` = @id+97 WHERE `name` = 'reload trinity_string'; +UPDATE `command` SET `permission` = @id+98 WHERE `name` = 'reload warden_action'; +UPDATE `command` SET `permission` = @id+99 WHERE `name` = 'reload waypoint_scripts'; +UPDATE `command` SET `permission` = @id+100 WHERE `name` = 'reload waypoint_data'; +UPDATE `command` SET `permission` = @id+101 WHERE `name` = 'reload vehicle_accessory'; +UPDATE `command` SET `permission` = @id+102 WHERE `name` = 'reload vehicle_template_accessory'; diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h index 8d739554d46..6d6e483a874 100644 --- a/src/server/game/Accounts/RBAC.h +++ b/src/server/game/Accounts/RBAC.h @@ -506,6 +506,109 @@ enum RBACPermissions RBAC_PERM_COMMAND_QUEST_COMPLETE = 604, RBAC_PERM_COMMAND_QUEST_REMOVE = 605, RBAC_PERM_COMMAND_QUEST_REWARD = 606, + RBAC_PERM_COMMANDS_RELOAD = 607, + RBAC_PERM_COMMANDS_RELOAD_ACCESS_REQUIREMENT = 608, + RBAC_PERM_COMMANDS_RELOAD_ACHIEVEMENT_CRITERIA_DATA = 609, + RBAC_PERM_COMMANDS_RELOAD_ACHIEVEMENT_REWARD = 610, + RBAC_PERM_COMMANDS_RELOAD_ALL = 611, + RBAC_PERM_COMMANDS_RELOAD_ALL_ACHIEVEMENT = 612, + RBAC_PERM_COMMANDS_RELOAD_ALL_AREA = 613, + RBAC_PERM_COMMANDS_RELOAD_ALL_EVENTAI = 614, + RBAC_PERM_COMMANDS_RELOAD_ALL_GOSSIP = 615, + RBAC_PERM_COMMANDS_RELOAD_ALL_ITEM = 616, + RBAC_PERM_COMMANDS_RELOAD_ALL_LOCALES = 617, + RBAC_PERM_COMMANDS_RELOAD_ALL_LOOT = 618, + RBAC_PERM_COMMANDS_RELOAD_ALL_NPC = 619, + RBAC_PERM_COMMANDS_RELOAD_ALL_QUEST = 620, + RBAC_PERM_COMMANDS_RELOAD_ALL_SCRIPTS = 621, + RBAC_PERM_COMMANDS_RELOAD_ALL_SPELL = 622, + RBAC_PERM_COMMANDS_RELOAD_AREATRIGGER_INVOLVEDRELATION = 623, + RBAC_PERM_COMMANDS_RELOAD_AREATRIGGER_TAVERN = 624, + RBAC_PERM_COMMANDS_RELOAD_AREATRIGGER_TELEPORT = 625, + RBAC_PERM_COMMANDS_RELOAD_AUCTIONS = 626, + RBAC_PERM_COMMANDS_RELOAD_AUTOBROADCAST = 627, + RBAC_PERM_COMMANDS_RELOAD_COMMAND = 628, + RBAC_PERM_COMMANDS_RELOAD_CONDITIONS = 629, + RBAC_PERM_COMMANDS_RELOAD_CONFIG = 630, + RBAC_PERM_COMMANDS_RELOAD_CREATURE_AI_SCRIPTS = 631, + RBAC_PERM_COMMANDS_RELOAD_CREATURE_AI_TEXTS = 632, + RBAC_PERM_COMMANDS_RELOAD_CREATURE_LINKED_RESPAWN = 633, + RBAC_PERM_COMMANDS_RELOAD_CREATURE_LOOT_TEMPLATE = 634, + RBAC_PERM_COMMANDS_RELOAD_CREATURE_ONKILL_REPUTATION = 635, + RBAC_PERM_COMMANDS_RELOAD_CREATURE_QUESTENDER = 636, + RBAC_PERM_COMMANDS_RELOAD_CREATURE_QUESTSTARTER = 637, + RBAC_PERM_COMMANDS_RELOAD_CREATURE_SUMMON_GROUPS = 638, + RBAC_PERM_COMMANDS_RELOAD_CREATURE_TEMPLATE = 639, + RBAC_PERM_COMMANDS_RELOAD_CREATURE_TEXT = 640, + RBAC_PERM_COMMANDS_RELOAD_DISABLES = 641, + RBAC_PERM_COMMANDS_RELOAD_DISENCHANT_LOOT_TEMPLATE = 642, + RBAC_PERM_COMMANDS_RELOAD_EVENT_SCRIPTS = 643, + RBAC_PERM_COMMANDS_RELOAD_FISHING_LOOT_TEMPLATE = 644, + RBAC_PERM_COMMANDS_RELOAD_GAME_GRAVEYARD_ZONE = 645, + RBAC_PERM_COMMANDS_RELOAD_GAMEOBJECT_QUESTENDER = 646, + RBAC_PERM_COMMANDS_RELOAD_GAMEOBJECT_QUEST_LOOT_TEMPLATE = 647, + RBAC_PERM_COMMANDS_RELOAD_GAMEOBJECT_QUESTSTARTER = 648, + RBAC_PERM_COMMANDS_RELOAD_GAME_TELE = 649, + RBAC_PERM_COMMANDS_RELOAD_GM_TICKETS = 650, + RBAC_PERM_COMMANDS_RELOAD_GOSSIP_MENU = 651, + RBAC_PERM_COMMANDS_RELOAD_GOSSIP_MENU_OPTION = 652, + RBAC_PERM_COMMANDS_RELOAD_ITEM_ENCHANTMENT_TEMPLATE = 653, + RBAC_PERM_COMMANDS_RELOAD_ITEM_LOOT_TEMPLATE = 654, + RBAC_PERM_COMMANDS_RELOAD_ITEM_SET_NAMES = 655, + RBAC_PERM_COMMANDS_RELOAD_LFG_DUNGEON_REWARDS = 656, + RBAC_PERM_COMMANDS_RELOAD_LOCALES_ACHIEVEMENT_REWARD = 657, + RBAC_PERM_COMMANDS_RELOAD_LOCALES_CRETURE = 658, + RBAC_PERM_COMMANDS_RELOAD_LOCALES_CRETURE_TEXT = 659, + RBAC_PERM_COMMANDS_RELOAD_LOCALES_GAMEOBJECT = 660, + RBAC_PERM_COMMANDS_RELOAD_LOCALES_GOSSIP_MENU_OPTION = 661, + RBAC_PERM_COMMANDS_RELOAD_LOCALES_ITEM = 662, + RBAC_PERM_COMMANDS_RELOAD_LOCALES_ITEM_SET_NAME = 663, + RBAC_PERM_COMMANDS_RELOAD_LOCALES_NPC_TEXT = 664, + RBAC_PERM_COMMANDS_RELOAD_LOCALES_PAGE_TEXT = 665, + RBAC_PERM_COMMANDS_RELOAD_LOCALES_POINTS_OF_INTEREST = 666, + RBAC_PERM_COMMANDS_RELOAD_LOCALES_QUEST = 667, + RBAC_PERM_COMMANDS_RELOAD_MAIL_LEVEL_REWARD = 668, + RBAC_PERM_COMMANDS_RELOAD_MAIL_LOOT_TEMPLATE = 669, + RBAC_PERM_COMMANDS_RELOAD_MILLING_LOOT_TEMPLATE = 670, + RBAC_PERM_COMMANDS_RELOAD_NPC_SPELLCLICK_SPELLS = 671, + RBAC_PERM_COMMANDS_RELOAD_NPC_TRAINER = 672, + RBAC_PERM_COMMANDS_RELOAD_NPC_VENDOR = 673, + RBAC_PERM_COMMANDS_RELOAD_PAGE_TEXT = 674, + RBAC_PERM_COMMANDS_RELOAD_PICKPOCKETING_LOOT_TEMPLATE = 675, + RBAC_PERM_COMMANDS_RELOAD_POINTS_OF_INTEREST = 676, + RBAC_PERM_COMMANDS_RELOAD_PROSPECTING_LOOT_TEMPLATE = 677, + RBAC_PERM_COMMANDS_RELOAD_QUEST_POI = 678, + RBAC_PERM_COMMANDS_RELOAD_QUEST_TEMPLATE = 679, + RBAC_PERM_COMMANDS_RELOAD_RBAC = 680, + RBAC_PERM_COMMANDS_RELOAD_REFERENCE_LOOT_TEMPLATE = 681, + RBAC_PERM_COMMANDS_RELOAD_REPUTATION_REWARD_RATE = 682, + RBAC_PERM_COMMANDS_RELOAD_RESERVED_NAME = 683, + RBAC_PERM_COMMANDS_RELOAD_SKILL_DISCOVERY_TEMPLATE = 684, + RBAC_PERM_COMMANDS_RELOAD_SKILL_EXTRA_ITEM_TEMPLATE = 685, + RBAC_PERM_COMMANDS_RELOAD_SKILL_FISHING_BASE_LEVEL = 686, + RBAC_PERM_COMMANDS_RELOAD_SKINNING_LOOT_TEMPLATE = 687, + RBAC_PERM_COMMANDS_RELOAD_SMART_SCRIPTS = 688, + RBAC_PERM_COMMANDS_RELOAD_SPELL_AREA = 689, + RBAC_PERM_COMMANDS_RELOAD_SPELL_BONUS_DATA = 690, + RBAC_PERM_COMMANDS_RELOAD_SPELL_GROUP = 691, + RBAC_PERM_COMMANDS_RELOAD_SPELL_GROUP_STACK_RULES = 692, + RBAC_PERM_COMMANDS_RELOAD_SPELL_LEARN_SPELL = 693, + RBAC_PERM_COMMANDS_RELOAD_SPELL_LINKED_SPELL = 694, + RBAC_PERM_COMMANDS_RELOAD_SPELL_LOOT_TEMPLATE = 695, + RBAC_PERM_COMMANDS_RELOAD_SPELL_PET_AURAS = 696, + RBAC_PERM_COMMANDS_RELOAD_SPELL_PROC = 697, + RBAC_PERM_COMMANDS_RELOAD_SPELL_PROC_EVENT = 698, + RBAC_PERM_COMMANDS_RELOAD_SPELL_REQUIRED = 699, + RBAC_PERM_COMMANDS_RELOAD_SPELL_SCRIPTS = 700, + RBAC_PERM_COMMANDS_RELOAD_SPELL_TARGET_POSITION = 701, + RBAC_PERM_COMMANDS_RELOAD_SPELL_THREATS = 702, + RBAC_PERM_COMMANDS_RELOAD_SPILLOVER_TEMPLATE = 703, + RBAC_PERM_COMMANDS_RELOAD_TRINITY_STRING = 704, + RBAC_PERM_COMMANDS_RELOAD_VEHICLE_ACCESORY = 705, + RBAC_PERM_COMMANDS_RELOAD_VEHICLE_TEMPLATE_ACCESSORY = 706, + RBAC_PERM_COMMANDS_RELOAD_WARDEN_ACTION = 707, + RBAC_PERM_COMMANDS_RELOAD_WAYPOINT_DATA = 708, + RBAC_PERM_COMMANDS_RELOAD_WAYPOINT_SCRIPTS = 709, // custom permissions 1000+ RBAC_PERM_MAX diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index 36b1c76110d..901a331b4b4 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -51,120 +51,120 @@ public: { static ChatCommand reloadAllCommandTable[] = { - { "achievement", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadAllAchievementCommand, "", NULL }, - { "area", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadAllAreaCommand, "", NULL }, - { "eventai", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadAllEventAICommand, "", NULL }, - { "gossips", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadAllGossipsCommand, "", NULL }, - { "item", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadAllItemCommand, "", NULL }, - { "locales", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadAllLocalesCommand, "", NULL }, - { "loot", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadAllLootCommand, "", NULL }, - { "npc", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadAllNpcCommand, "", NULL }, - { "quest", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadAllQuestCommand, "", NULL }, - { "scripts", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadAllScriptsCommand, "", NULL }, - { "spell", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadAllSpellCommand, "", NULL }, - { "", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadAllCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "achievement", RBAC_PERM_COMMANDS_RELOAD_ALL_ACHIEVEMENT, true, &HandleReloadAllAchievementCommand, "", NULL }, + { "area", RBAC_PERM_COMMANDS_RELOAD_ALL_AREA, true, &HandleReloadAllAreaCommand, "", NULL }, + { "eventai", RBAC_PERM_COMMANDS_RELOAD_ALL_EVENTAI, true, &HandleReloadAllEventAICommand, "", NULL }, + { "gossips", RBAC_PERM_COMMANDS_RELOAD_ALL_GOSSIP, true, &HandleReloadAllGossipsCommand, "", NULL }, + { "item", RBAC_PERM_COMMANDS_RELOAD_ALL_ITEM, true, &HandleReloadAllItemCommand, "", NULL }, + { "locales", RBAC_PERM_COMMANDS_RELOAD_ALL_LOCALES, true, &HandleReloadAllLocalesCommand, "", NULL }, + { "loot", RBAC_PERM_COMMANDS_RELOAD_ALL_LOOT, true, &HandleReloadAllLootCommand, "", NULL }, + { "npc", RBAC_PERM_COMMANDS_RELOAD_ALL_NPC, true, &HandleReloadAllNpcCommand, "", NULL }, + { "quest", RBAC_PERM_COMMANDS_RELOAD_ALL_QUEST, true, &HandleReloadAllQuestCommand, "", NULL }, + { "scripts", RBAC_PERM_COMMANDS_RELOAD_ALL_SCRIPTS, true, &HandleReloadAllScriptsCommand, "", NULL }, + { "spell", RBAC_PERM_COMMANDS_RELOAD_ALL_SPELL, true, &HandleReloadAllSpellCommand, "", NULL }, + { "", RBAC_PERM_COMMANDS_RELOAD_ALL, true, &HandleReloadAllCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand reloadCommandTable[] = { - { "auctions", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadAuctionsCommand, "", NULL }, - { "access_requirement", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadAccessRequirementCommand, "", NULL }, - { "achievement_criteria_data", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadAchievementCriteriaDataCommand, "", NULL }, - { "achievement_reward", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadAchievementRewardCommand, "", NULL }, - { "all", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, NULL, "", reloadAllCommandTable }, - { "areatrigger_involvedrelation", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadQuestAreaTriggersCommand, "", NULL }, - { "areatrigger_tavern", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadAreaTriggerTavernCommand, "", NULL }, - { "areatrigger_teleport", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadAreaTriggerTeleportCommand, "", NULL }, - { "autobroadcast", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadAutobroadcastCommand, "", NULL }, - { "command", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadCommandCommand, "", NULL }, - { "conditions", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadConditions, "", NULL }, - { "config", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadConfigCommand, "", NULL }, - { "creature_text", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadCreatureText, "", NULL }, - { "creature_ai_scripts", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadEventAIScriptsCommand, "", NULL }, - { "creature_ai_texts", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadEventAITextsCommand, "", NULL }, - { "creature_questender", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadCreatureQuestEnderCommand, "", NULL }, - { "creature_linked_respawn", RBAC_PERM_GAMEMASTER_COMMANDS, true, &HandleReloadLinkedRespawnCommand, "", NULL }, - { "creature_loot_template", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadLootTemplatesCreatureCommand, "", NULL }, - { "creature_onkill_reputation", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadOnKillReputationCommand, "", NULL }, - { "creature_queststarter", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadCreatureQuestStarterCommand, "", NULL }, - { "creature_summon_groups", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadCreatureSummonGroupsCommand, "", NULL }, - { "creature_template", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadCreatureTemplateCommand, "", NULL }, - //{ "db_script_string", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadDbScriptStringCommand, "", NULL }, - { "disables", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadDisablesCommand, "", NULL }, - { "disenchant_loot_template", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadLootTemplatesDisenchantCommand, "", NULL }, - { "event_scripts", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadEventScriptsCommand, "", NULL }, - { "fishing_loot_template", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadLootTemplatesFishingCommand, "", NULL }, - { "game_graveyard_zone", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadGameGraveyardZoneCommand, "", NULL }, - { "game_tele", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadGameTeleCommand, "", NULL }, - { "gameobject_questender", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadGOQuestEnderCommand, "", NULL }, - { "gameobject_loot_template", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadLootTemplatesGameobjectCommand, "", NULL }, - { "gameobject_queststarter", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadGOQuestStarterCommand, "", NULL }, - { "gm_tickets", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadGMTicketsCommand, "", NULL }, - { "gossip_menu", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadGossipMenuCommand, "", NULL }, - { "gossip_menu_option", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadGossipMenuOptionCommand, "", NULL }, - { "item_enchantment_template", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadItemEnchantementsCommand, "", NULL }, - { "item_loot_template", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadLootTemplatesItemCommand, "", NULL }, - { "item_set_names", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadItemSetNamesCommand, "", NULL }, - { "lfg_dungeon_rewards", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadLfgRewardsCommand, "", NULL }, - { "locales_achievement_reward", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadLocalesAchievementRewardCommand, "", NULL }, - { "locales_creature", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadLocalesCreatureCommand, "", NULL }, - { "locales_creature_text", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadLocalesCreatureTextCommand, "", NULL }, - { "locales_gameobject", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadLocalesGameobjectCommand, "", NULL }, - { "locales_gossip_menu_option", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadLocalesGossipMenuOptionCommand, "", NULL }, - { "locales_item", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadLocalesItemCommand, "", NULL }, - { "locales_item_set_name", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadLocalesItemSetNameCommand, "", NULL }, - { "locales_npc_text", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadLocalesNpcTextCommand, "", NULL }, - { "locales_page_text", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadLocalesPageTextCommand, "", NULL }, - { "locales_points_of_interest", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadLocalesPointsOfInterestCommand, "", NULL }, - { "locales_quest", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadLocalesQuestCommand, "", NULL }, - { "mail_level_reward", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadMailLevelRewardCommand, "", NULL }, - { "mail_loot_template", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadLootTemplatesMailCommand, "", NULL }, - { "milling_loot_template", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadLootTemplatesMillingCommand, "", NULL }, - { "npc_spellclick_spells", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadSpellClickSpellsCommand, "", NULL}, - { "npc_trainer", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadNpcTrainerCommand, "", NULL }, - { "npc_vendor", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadNpcVendorCommand, "", NULL }, - { "page_text", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadPageTextsCommand, "", NULL }, - { "pickpocketing_loot_template", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadLootTemplatesPickpocketingCommand, "", NULL}, - { "points_of_interest", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadPointsOfInterestCommand, "", NULL }, - { "prospecting_loot_template", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadLootTemplatesProspectingCommand, "", NULL }, - { "quest_poi", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadQuestPOICommand, "", NULL }, - { "quest_template", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadQuestTemplateCommand, "", NULL }, - { "rbac", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadRBACCommand, "", NULL }, - { "reference_loot_template", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadLootTemplatesReferenceCommand, "", NULL }, - { "reserved_name", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadReservedNameCommand, "", NULL }, - { "reputation_reward_rate", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadReputationRewardRateCommand, "", NULL }, - { "reputation_spillover_template", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadReputationRewardRateCommand, "", NULL }, - { "skill_discovery_template", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadSkillDiscoveryTemplateCommand, "", NULL }, - { "skill_extra_item_template", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadSkillExtraItemTemplateCommand, "", NULL }, - { "skill_fishing_base_level", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadSkillFishingBaseLevelCommand, "", NULL }, - { "skinning_loot_template", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadLootTemplatesSkinningCommand, "", NULL }, - { "smart_scripts", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadSmartScripts, "", NULL }, - { "spell_required", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadSpellRequiredCommand, "", NULL }, - { "spell_area", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadSpellAreaCommand, "", NULL }, - { "spell_bonus_data", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadSpellBonusesCommand, "", NULL }, - { "spell_group", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadSpellGroupsCommand, "", NULL }, - { "spell_learn_spell", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadSpellLearnSpellCommand, "", NULL }, - { "spell_loot_template", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadLootTemplatesSpellCommand, "", NULL }, - { "spell_linked_spell", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadSpellLinkedSpellCommand, "", NULL }, - { "spell_pet_auras", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadSpellPetAurasCommand, "", NULL }, - { "spell_proc_event", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadSpellProcEventCommand, "", NULL }, - { "spell_proc", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadSpellProcsCommand, "", NULL }, - { "spell_scripts", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadSpellScriptsCommand, "", NULL }, - { "spell_target_position", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadSpellTargetPositionCommand, "", NULL }, - { "spell_threats", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadSpellThreatsCommand, "", NULL }, - { "spell_group_stack_rules", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadSpellGroupStackRulesCommand, "", NULL }, - { "trinity_string", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadTrinityStringCommand, "", NULL }, - { "warden_action", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadWardenactionCommand, "", NULL }, - { "waypoint_scripts", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadWpScriptsCommand, "", NULL }, - { "waypoint_data", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadWpCommand, "", NULL }, - { "vehicle_accessory", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadVehicleAccessoryCommand, "", NULL }, - { "vehicle_template_accessory", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleReloadVehicleTemplateAccessoryCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "auctions", RBAC_PERM_COMMANDS_RELOAD_AUCTIONS, true, &HandleReloadAuctionsCommand, "", NULL }, + { "access_requirement", RBAC_PERM_COMMANDS_RELOAD_ACCESS_REQUIREMENT, true, &HandleReloadAccessRequirementCommand, "", NULL }, + { "achievement_criteria_data", RBAC_PERM_COMMANDS_RELOAD_ACHIEVEMENT_CRITERIA_DATA, true, &HandleReloadAchievementCriteriaDataCommand, "", NULL }, + { "achievement_reward", RBAC_PERM_COMMANDS_RELOAD_ACHIEVEMENT_REWARD, true, &HandleReloadAchievementRewardCommand, "", NULL }, + { "all", RBAC_PERM_COMMANDS_RELOAD_ALL, true, NULL, "", reloadAllCommandTable }, + { "areatrigger_involvedrelation", RBAC_PERM_COMMANDS_RELOAD_AREATRIGGER_INVOLVEDRELATION, true, &HandleReloadQuestAreaTriggersCommand, "", NULL }, + { "areatrigger_tavern", RBAC_PERM_COMMANDS_RELOAD_AREATRIGGER_TAVERN, true, &HandleReloadAreaTriggerTavernCommand, "", NULL }, + { "areatrigger_teleport", RBAC_PERM_COMMANDS_RELOAD_AREATRIGGER_TELEPORT, true, &HandleReloadAreaTriggerTeleportCommand, "", NULL }, + { "autobroadcast", RBAC_PERM_COMMANDS_RELOAD_AUTOBROADCAST, true, &HandleReloadAutobroadcastCommand, "", NULL }, + { "command", RBAC_PERM_COMMANDS_RELOAD_COMMAND, true, &HandleReloadCommandCommand, "", NULL }, + { "conditions", RBAC_PERM_COMMANDS_RELOAD_CONDITIONS, true, &HandleReloadConditions, "", NULL }, + { "config", RBAC_PERM_COMMANDS_RELOAD_CONFIG, true, &HandleReloadConfigCommand, "", NULL }, + { "creature_text", RBAC_PERM_COMMANDS_RELOAD_CREATURE_TEXT, true, &HandleReloadCreatureText, "", NULL }, + { "creature_ai_scripts", RBAC_PERM_COMMANDS_RELOAD_CREATURE_AI_SCRIPTS, true, &HandleReloadEventAIScriptsCommand, "", NULL }, + { "creature_ai_texts", RBAC_PERM_COMMANDS_RELOAD_CREATURE_AI_TEXTS, true, &HandleReloadEventAITextsCommand, "", NULL }, + { "creature_questender", RBAC_PERM_COMMANDS_RELOAD_CREATURE_QUESTENDER, true, &HandleReloadCreatureQuestEnderCommand, "", NULL }, + { "creature_linked_respawn", RBAC_PERM_COMMANDS_RELOAD_CREATURE_LINKED_RESPAWN, true, &HandleReloadLinkedRespawnCommand, "", NULL }, + { "creature_loot_template", RBAC_PERM_COMMANDS_RELOAD_CREATURE_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesCreatureCommand, "", NULL }, + { "creature_onkill_reputation", RBAC_PERM_COMMANDS_RELOAD_CREATURE_ONKILL_REPUTATION, true, &HandleReloadOnKillReputationCommand, "", NULL }, + { "creature_queststarter", RBAC_PERM_COMMANDS_RELOAD_CREATURE_QUESTSTARTER, true, &HandleReloadCreatureQuestStarterCommand, "", NULL }, + { "creature_summon_groups", RBAC_PERM_COMMANDS_RELOAD_CREATURE_SUMMON_GROUPS, true, &HandleReloadCreatureSummonGroupsCommand, "", NULL }, + { "creature_template", RBAC_PERM_COMMANDS_RELOAD_CREATURE_TEMPLATE, true, &HandleReloadCreatureTemplateCommand, "", NULL }, + //{ "db_script_string", RBAC_PERM_COMMANDS_RELOAD_, true, &HandleReloadDbScriptStringCommand, "", NULL }, + { "disables", RBAC_PERM_COMMANDS_RELOAD_DISABLES, true, &HandleReloadDisablesCommand, "", NULL }, + { "disenchant_loot_template", RBAC_PERM_COMMANDS_RELOAD_DISENCHANT_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesDisenchantCommand, "", NULL }, + { "event_scripts", RBAC_PERM_COMMANDS_RELOAD_EVENT_SCRIPTS, true, &HandleReloadEventScriptsCommand, "", NULL }, + { "fishing_loot_template", RBAC_PERM_COMMANDS_RELOAD_FISHING_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesFishingCommand, "", NULL }, + { "game_graveyard_zone", RBAC_PERM_COMMANDS_RELOAD_GAME_GRAVEYARD_ZONE, true, &HandleReloadGameGraveyardZoneCommand, "", NULL }, + { "game_tele", RBAC_PERM_COMMANDS_RELOAD_GAME_TELE, true, &HandleReloadGameTeleCommand, "", NULL }, + { "gameobject_questender", RBAC_PERM_COMMANDS_RELOAD_GAMEOBJECT_QUESTENDER, true, &HandleReloadGOQuestEnderCommand, "", NULL }, + { "gameobject_loot_template", RBAC_PERM_COMMANDS_RELOAD_GAMEOBJECT_QUEST_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesGameobjectCommand, "", NULL }, + { "gameobject_queststarter", RBAC_PERM_COMMANDS_RELOAD_GAMEOBJECT_QUESTSTARTER, true, &HandleReloadGOQuestStarterCommand, "", NULL }, + { "gm_tickets", RBAC_PERM_COMMANDS_RELOAD_GM_TICKETS, true, &HandleReloadGMTicketsCommand, "", NULL }, + { "gossip_menu", RBAC_PERM_COMMANDS_RELOAD_GOSSIP_MENU, true, &HandleReloadGossipMenuCommand, "", NULL }, + { "gossip_menu_option", RBAC_PERM_COMMANDS_RELOAD_GOSSIP_MENU_OPTION, true, &HandleReloadGossipMenuOptionCommand, "", NULL }, + { "item_enchantment_template", RBAC_PERM_COMMANDS_RELOAD_ITEM_ENCHANTMENT_TEMPLATE, true, &HandleReloadItemEnchantementsCommand, "", NULL }, + { "item_loot_template", RBAC_PERM_COMMANDS_RELOAD_ITEM_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesItemCommand, "", NULL }, + { "item_set_names", RBAC_PERM_COMMANDS_RELOAD_ITEM_SET_NAMES, true, &HandleReloadItemSetNamesCommand, "", NULL }, + { "lfg_dungeon_rewards", RBAC_PERM_COMMANDS_RELOAD_LFG_DUNGEON_REWARDS, true, &HandleReloadLfgRewardsCommand, "", NULL }, + { "locales_achievement_reward", RBAC_PERM_COMMANDS_RELOAD_LOCALES_ACHIEVEMENT_REWARD, true, &HandleReloadLocalesAchievementRewardCommand, "", NULL }, + { "locales_creature", RBAC_PERM_COMMANDS_RELOAD_LOCALES_CRETURE, true, &HandleReloadLocalesCreatureCommand, "", NULL }, + { "locales_creature_text", RBAC_PERM_COMMANDS_RELOAD_LOCALES_CRETURE_TEXT, true, &HandleReloadLocalesCreatureTextCommand, "", NULL }, + { "locales_gameobject", RBAC_PERM_COMMANDS_RELOAD_LOCALES_GAMEOBJECT, true, &HandleReloadLocalesGameobjectCommand, "", NULL }, + { "locales_gossip_menu_option", RBAC_PERM_COMMANDS_RELOAD_LOCALES_GOSSIP_MENU_OPTION, true, &HandleReloadLocalesGossipMenuOptionCommand, "", NULL }, + { "locales_item", RBAC_PERM_COMMANDS_RELOAD_LOCALES_ITEM, true, &HandleReloadLocalesItemCommand, "", NULL }, + { "locales_item_set_name", RBAC_PERM_COMMANDS_RELOAD_LOCALES_ITEM_SET_NAME, true, &HandleReloadLocalesItemSetNameCommand, "", NULL }, + { "locales_npc_text", RBAC_PERM_COMMANDS_RELOAD_LOCALES_NPC_TEXT, true, &HandleReloadLocalesNpcTextCommand, "", NULL }, + { "locales_page_text", RBAC_PERM_COMMANDS_RELOAD_LOCALES_PAGE_TEXT, true, &HandleReloadLocalesPageTextCommand, "", NULL }, + { "locales_points_of_interest", RBAC_PERM_COMMANDS_RELOAD_LOCALES_POINTS_OF_INTEREST, true, &HandleReloadLocalesPointsOfInterestCommand, "", NULL }, + { "locales_quest", RBAC_PERM_COMMANDS_RELOAD_LOCALES_QUEST, true, &HandleReloadLocalesQuestCommand, "", NULL }, + { "mail_level_reward", RBAC_PERM_COMMANDS_RELOAD_MAIL_LEVEL_REWARD, true, &HandleReloadMailLevelRewardCommand, "", NULL }, + { "mail_loot_template", RBAC_PERM_COMMANDS_RELOAD_MAIL_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesMailCommand, "", NULL }, + { "milling_loot_template", RBAC_PERM_COMMANDS_RELOAD_MILLING_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesMillingCommand, "", NULL }, + { "npc_spellclick_spells", RBAC_PERM_COMMANDS_RELOAD_NPC_SPELLCLICK_SPELLS, true, &HandleReloadSpellClickSpellsCommand, "", NULL}, + { "npc_trainer", RBAC_PERM_COMMANDS_RELOAD_NPC_TRAINER, true, &HandleReloadNpcTrainerCommand, "", NULL }, + { "npc_vendor", RBAC_PERM_COMMANDS_RELOAD_NPC_VENDOR, true, &HandleReloadNpcVendorCommand, "", NULL }, + { "page_text", RBAC_PERM_COMMANDS_RELOAD_PAGE_TEXT, true, &HandleReloadPageTextsCommand, "", NULL }, + { "pickpocketing_loot_template", RBAC_PERM_COMMANDS_RELOAD_PICKPOCKETING_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesPickpocketingCommand, "", NULL}, + { "points_of_interest", RBAC_PERM_COMMANDS_RELOAD_POINTS_OF_INTEREST, true, &HandleReloadPointsOfInterestCommand, "", NULL }, + { "prospecting_loot_template", RBAC_PERM_COMMANDS_RELOAD_PROSPECTING_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesProspectingCommand, "", NULL }, + { "quest_poi", RBAC_PERM_COMMANDS_RELOAD_QUEST_POI, true, &HandleReloadQuestPOICommand, "", NULL }, + { "quest_template", RBAC_PERM_COMMANDS_RELOAD_QUEST_TEMPLATE, true, &HandleReloadQuestTemplateCommand, "", NULL }, + { "rbac", RBAC_PERM_COMMANDS_RELOAD_RBAC, true, &HandleReloadRBACCommand, "", NULL }, + { "reference_loot_template", RBAC_PERM_COMMANDS_RELOAD_REFERENCE_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesReferenceCommand, "", NULL }, + { "reserved_name", RBAC_PERM_COMMANDS_RELOAD_RESERVED_NAME, true, &HandleReloadReservedNameCommand, "", NULL }, + { "reputation_reward_rate", RBAC_PERM_COMMANDS_RELOAD_REPUTATION_REWARD_RATE, true, &HandleReloadReputationRewardRateCommand, "", NULL }, + { "reputation_spillover_template", RBAC_PERM_COMMANDS_RELOAD_SPILLOVER_TEMPLATE, true, &HandleReloadReputationRewardRateCommand, "", NULL }, + { "skill_discovery_template", RBAC_PERM_COMMANDS_RELOAD_SKILL_DISCOVERY_TEMPLATE, true, &HandleReloadSkillDiscoveryTemplateCommand, "", NULL }, + { "skill_extra_item_template", RBAC_PERM_COMMANDS_RELOAD_SKILL_EXTRA_ITEM_TEMPLATE, true, &HandleReloadSkillExtraItemTemplateCommand, "", NULL }, + { "skill_fishing_base_level", RBAC_PERM_COMMANDS_RELOAD_SKILL_FISHING_BASE_LEVEL, true, &HandleReloadSkillFishingBaseLevelCommand, "", NULL }, + { "skinning_loot_template", RBAC_PERM_COMMANDS_RELOAD_SKINNING_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesSkinningCommand, "", NULL }, + { "smart_scripts", RBAC_PERM_COMMANDS_RELOAD_SMART_SCRIPTS, true, &HandleReloadSmartScripts, "", NULL }, + { "spell_required", RBAC_PERM_COMMANDS_RELOAD_SPELL_REQUIRED, true, &HandleReloadSpellRequiredCommand, "", NULL }, + { "spell_area", RBAC_PERM_COMMANDS_RELOAD_SPELL_AREA, true, &HandleReloadSpellAreaCommand, "", NULL }, + { "spell_bonus_data", RBAC_PERM_COMMANDS_RELOAD_SPELL_BONUS_DATA, true, &HandleReloadSpellBonusesCommand, "", NULL }, + { "spell_group", RBAC_PERM_COMMANDS_RELOAD_SPELL_GROUP, true, &HandleReloadSpellGroupsCommand, "", NULL }, + { "spell_learn_spell", RBAC_PERM_COMMANDS_RELOAD_SPELL_LEARN_SPELL, true, &HandleReloadSpellLearnSpellCommand, "", NULL }, + { "spell_loot_template", RBAC_PERM_COMMANDS_RELOAD_SPELL_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesSpellCommand, "", NULL }, + { "spell_linked_spell", RBAC_PERM_COMMANDS_RELOAD_SPELL_LINKED_SPELL, true, &HandleReloadSpellLinkedSpellCommand, "", NULL }, + { "spell_pet_auras", RBAC_PERM_COMMANDS_RELOAD_SPELL_PET_AURAS, true, &HandleReloadSpellPetAurasCommand, "", NULL }, + { "spell_proc_event", RBAC_PERM_COMMANDS_RELOAD_SPELL_PROC_EVENT, true, &HandleReloadSpellProcEventCommand, "", NULL }, + { "spell_proc", RBAC_PERM_COMMANDS_RELOAD_SPELL_PROC, true, &HandleReloadSpellProcsCommand, "", NULL }, + { "spell_scripts", RBAC_PERM_COMMANDS_RELOAD_SPELL_SCRIPTS, true, &HandleReloadSpellScriptsCommand, "", NULL }, + { "spell_target_position", RBAC_PERM_COMMANDS_RELOAD_SPELL_TARGET_POSITION, true, &HandleReloadSpellTargetPositionCommand, "", NULL }, + { "spell_threats", RBAC_PERM_COMMANDS_RELOAD_SPELL_THREATS, true, &HandleReloadSpellThreatsCommand, "", NULL }, + { "spell_group_stack_rules", RBAC_PERM_COMMANDS_RELOAD_SPELL_GROUP_STACK_RULES, true, &HandleReloadSpellGroupStackRulesCommand, "", NULL }, + { "trinity_string", RBAC_PERM_COMMANDS_RELOAD_TRINITY_STRING, true, &HandleReloadTrinityStringCommand, "", NULL }, + { "warden_action", RBAC_PERM_COMMANDS_RELOAD_WARDEN_ACTION, true, &HandleReloadWardenactionCommand, "", NULL }, + { "waypoint_scripts", RBAC_PERM_COMMANDS_RELOAD_WAYPOINT_SCRIPTS, true, &HandleReloadWpScriptsCommand, "", NULL }, + { "waypoint_data", RBAC_PERM_COMMANDS_RELOAD_WAYPOINT_DATA, true, &HandleReloadWpCommand, "", NULL }, + { "vehicle_accessory", RBAC_PERM_COMMANDS_RELOAD_VEHICLE_ACCESORY, true, &HandleReloadVehicleAccessoryCommand, "", NULL }, + { "vehicle_template_accessory", RBAC_PERM_COMMANDS_RELOAD_VEHICLE_TEMPLATE_ACCESSORY, true, &HandleReloadVehicleTemplateAccessoryCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand commandTable[] = { - { "reload", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, NULL, "", reloadCommandTable }, - { NULL, 0, false, NULL, "", NULL } + { "reload", RBAC_PERM_COMMANDS_RELOAD, true, NULL, "", reloadCommandTable }, + { NULL, 0, false, NULL, "", NULL } }; return commandTable; } -- cgit v1.2.3 From 7183a355d2d894f2444559f837709f615f1a5b5a Mon Sep 17 00:00:00 2001 From: Spp Date: Tue, 10 Sep 2013 14:33:27 +0200 Subject: Core/RBAC: Move reset commands to RBAC (using individual permissions) --- sql/updates/auth/2013_09_10_09_auth_misc.sql | 27 +++++++++++++++++++++++ sql/updates/world/2013_09_10_09_world_command.sql | 2 +- sql/updates/world/2013_09_10_10_world_command.sql | 2 +- sql/updates/world/2013_09_10_11_world_command.sql | 13 +++++++++++ src/server/game/Accounts/RBAC.h | 8 +++++++ src/server/scripts/Commands/cs_reset.cpp | 20 ++++++++--------- 6 files changed, 60 insertions(+), 12 deletions(-) create mode 100644 sql/updates/auth/2013_09_10_09_auth_misc.sql create mode 100644 sql/updates/world/2013_09_10_11_world_command.sql (limited to 'sql') diff --git a/sql/updates/auth/2013_09_10_09_auth_misc.sql b/sql/updates/auth/2013_09_10_09_auth_misc.sql new file mode 100644 index 00000000000..8e0e340bfec --- /dev/null +++ b/sql/updates/auth/2013_09_10_09_auth_misc.sql @@ -0,0 +1,27 @@ +/* cs_reset.cpp */ + +SET @id = 710; + +-- Add new permissions +DELETE FROM `rbac_permissions` WHERE `id` BETWEEN @id AND @id+7; +INSERT INTO `rbac_permissions` (`id`, `name`) VALUES +(@id+0, 'reset'), +(@id+1, 'reset achievements'), +(@id+2, 'reset honor'), +(@id+3, 'reset level'), +(@id+4, 'reset spells'), +(@id+5, 'reset stats'), +(@id+6, 'reset talents'), +(@id+7, 'reset all'); + +-- Add permissions to "corresponding Commands Role" +DELETE FROM `rbac_role_permissions` WHERE `permissionId` BETWEEN @id AND @id+7; +INSERT INTO `rbac_role_permissions` (`roleId`, `permissionId`) VALUES +(4, @id+0), +(4, @id+1), +(4, @id+2), +(4, @id+3), +(4, @id+4), +(4, @id+5), +(4, @id+6), +(4, @id+7); diff --git a/sql/updates/world/2013_09_10_09_world_command.sql b/sql/updates/world/2013_09_10_09_world_command.sql index 6523202aa24..6f4070ed588 100644 --- a/sql/updates/world/2013_09_10_09_world_command.sql +++ b/sql/updates/world/2013_09_10_09_world_command.sql @@ -1,4 +1,4 @@ -/* cs_npc.cpp */ +/* cs_quest.cpp */ SET @id = 602; diff --git a/sql/updates/world/2013_09_10_10_world_command.sql b/sql/updates/world/2013_09_10_10_world_command.sql index 4249ff1ad5b..f7c74f01537 100644 --- a/sql/updates/world/2013_09_10_10_world_command.sql +++ b/sql/updates/world/2013_09_10_10_world_command.sql @@ -1,4 +1,4 @@ -/* cs_npc.cpp */ +/* cs_reload.cpp */ SET @id = 607; diff --git a/sql/updates/world/2013_09_10_11_world_command.sql b/sql/updates/world/2013_09_10_11_world_command.sql new file mode 100644 index 00000000000..b6e1ca651c2 --- /dev/null +++ b/sql/updates/world/2013_09_10_11_world_command.sql @@ -0,0 +1,13 @@ +/* cs_reset.cpp */ + +SET @id = 710; + +-- Update command table with new RBAC permissions +UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'reload'; +UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'reload achievements'; +UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'reload honor'; +UPDATE `command` SET `permission` = @id+3 WHERE `name` = 'reload level'; +UPDATE `command` SET `permission` = @id+4 WHERE `name` = 'reload spells'; +UPDATE `command` SET `permission` = @id+5 WHERE `name` = 'reload stats'; +UPDATE `command` SET `permission` = @id+6 WHERE `name` = 'reload talents'; +UPDATE `command` SET `permission` = @id+7 WHERE `name` = 'reload all'; diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h index 6d6e483a874..d6d778df40c 100644 --- a/src/server/game/Accounts/RBAC.h +++ b/src/server/game/Accounts/RBAC.h @@ -609,6 +609,14 @@ enum RBACPermissions RBAC_PERM_COMMANDS_RELOAD_WARDEN_ACTION = 707, RBAC_PERM_COMMANDS_RELOAD_WAYPOINT_DATA = 708, RBAC_PERM_COMMANDS_RELOAD_WAYPOINT_SCRIPTS = 709, + RBAC_PERM_COMMAND_RESET = 710, + RBAC_PERM_COMMAND_RESET_ACHIEVEMENTS = 711, + RBAC_PERM_COMMAND_RESET_HONOR = 712, + RBAC_PERM_COMMAND_RESET_LEVEL = 713, + RBAC_PERM_COMMAND_RESET_SPELLS = 714, + RBAC_PERM_COMMAND_RESET_STATS = 715, + RBAC_PERM_COMMAND_RESET_TALENTS = 716, + RBAC_PERM_COMMAND_RESET_ALL = 717, // custom permissions 1000+ RBAC_PERM_MAX diff --git a/src/server/scripts/Commands/cs_reset.cpp b/src/server/scripts/Commands/cs_reset.cpp index 3c95ceae4be..9b0b19bc51c 100644 --- a/src/server/scripts/Commands/cs_reset.cpp +++ b/src/server/scripts/Commands/cs_reset.cpp @@ -39,19 +39,19 @@ public: { static ChatCommand resetCommandTable[] = { - { "achievements", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleResetAchievementsCommand, "", NULL }, - { "honor", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleResetHonorCommand, "", NULL }, - { "level", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleResetLevelCommand, "", NULL }, - { "spells", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleResetSpellsCommand, "", NULL }, - { "stats", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleResetStatsCommand, "", NULL }, - { "talents", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleResetTalentsCommand, "", NULL }, - { "all", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleResetAllCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "achievements", RBAC_PERM_COMMAND_RESET_ACHIEVEMENTS, true, &HandleResetAchievementsCommand, "", NULL }, + { "honor", RBAC_PERM_COMMAND_RESET_HONOR, true, &HandleResetHonorCommand, "", NULL }, + { "level", RBAC_PERM_COMMAND_RESET_LEVEL, true, &HandleResetLevelCommand, "", NULL }, + { "spells", RBAC_PERM_COMMAND_RESET_SPELLS, true, &HandleResetSpellsCommand, "", NULL }, + { "stats", RBAC_PERM_COMMAND_RESET_STATS, true, &HandleResetStatsCommand, "", NULL }, + { "talents", RBAC_PERM_COMMAND_RESET_TALENTS, true, &HandleResetTalentsCommand, "", NULL }, + { "all", RBAC_PERM_COMMAND_RESET_ALL, true, &HandleResetAllCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand commandTable[] = { - { "reset", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, NULL, "", resetCommandTable }, - { NULL, 0, false, NULL, "", NULL } + { "reset", RBAC_PERM_COMMAND_RESET, true, NULL, "", resetCommandTable }, + { NULL, 0, false, NULL, "", NULL } }; return commandTable; } -- cgit v1.2.3 From abbc6b2760a0f8117761e303c999f375c9ab4317 Mon Sep 17 00:00:00 2001 From: Spp Date: Tue, 10 Sep 2013 14:57:01 +0200 Subject: Core/RBAC: Move server commands to RBAC (using individual permissions) --- sql/updates/auth/2013_09_10_10_auth_misc.sql | 46 + sql/updates/world/2013_09_10_11_world_command.sql | 16 +- sql/updates/world/2013_09_10_12_world_command.sql | 24 + src/server/game/Accounts/RBAC.h | 1965 +++++++++++---------- src/server/scripts/Commands/cs_server.cpp | 60 +- 5 files changed, 1100 insertions(+), 1011 deletions(-) create mode 100644 sql/updates/auth/2013_09_10_10_auth_misc.sql create mode 100644 sql/updates/world/2013_09_10_12_world_command.sql (limited to 'sql') diff --git a/sql/updates/auth/2013_09_10_10_auth_misc.sql b/sql/updates/auth/2013_09_10_10_auth_misc.sql new file mode 100644 index 00000000000..a0587f75bf4 --- /dev/null +++ b/sql/updates/auth/2013_09_10_10_auth_misc.sql @@ -0,0 +1,46 @@ +/* cs_server.cpp */ + +SET @id = 718; + +-- Add new permissions +DELETE FROM `rbac_permissions` WHERE `id` BETWEEN @id AND @id+18; +INSERT INTO `rbac_permissions` (`id`, `name`) VALUES +(@id+0, 'server'), +(@id+1, 'server corpses'), +(@id+2, 'server exit'), +(@id+3, 'server idlerestart'), +(@id+4, 'server idlerestart cancel'), +(@id+5, 'server idleshutdown'), +(@id+6, 'server idleshutdown cancel'), +(@id+7, 'server info'), +(@id+8, 'server plimit'), +(@id+9, 'server restart'), +(@id+10, 'server restart cancel'), +(@id+11, 'server set'), +(@id+12, 'server set closed'), +(@id+13, 'server set difftime'), +(@id+14, 'server set loglevel'), +(@id+15, 'server set motd'), +(@id+16, 'server shutdown'), +(@id+17, 'server shutdown cancel'), +(@id+18, 'server motd'); + +-- Add permissions to "corresponding Commands Role" +DELETE FROM `rbac_role_permissions` WHERE `permissionId` BETWEEN @id AND @id+18; +INSERT INTO `rbac_role_permissions` (`roleId`, `permissionId`) VALUES +(4, @id+0), +(4, @id+1), +(4, @id+3), +(4, @id+4), +(4, @id+5), +(4, @id+6), +(4, @id+7), +(4, @id+8), +(4, @id+9), +(4, @id+10), +(4, @id+11), +(4, @id+12), +(4, @id+15), +(4, @id+16), +(4, @id+17), +(4, @id+18); diff --git a/sql/updates/world/2013_09_10_11_world_command.sql b/sql/updates/world/2013_09_10_11_world_command.sql index b6e1ca651c2..3a0dc18e804 100644 --- a/sql/updates/world/2013_09_10_11_world_command.sql +++ b/sql/updates/world/2013_09_10_11_world_command.sql @@ -3,11 +3,11 @@ SET @id = 710; -- Update command table with new RBAC permissions -UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'reload'; -UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'reload achievements'; -UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'reload honor'; -UPDATE `command` SET `permission` = @id+3 WHERE `name` = 'reload level'; -UPDATE `command` SET `permission` = @id+4 WHERE `name` = 'reload spells'; -UPDATE `command` SET `permission` = @id+5 WHERE `name` = 'reload stats'; -UPDATE `command` SET `permission` = @id+6 WHERE `name` = 'reload talents'; -UPDATE `command` SET `permission` = @id+7 WHERE `name` = 'reload all'; +UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'reset'; +UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'reset achievements'; +UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'reset honor'; +UPDATE `command` SET `permission` = @id+3 WHERE `name` = 'reset level'; +UPDATE `command` SET `permission` = @id+4 WHERE `name` = 'reset spells'; +UPDATE `command` SET `permission` = @id+5 WHERE `name` = 'reset stats'; +UPDATE `command` SET `permission` = @id+6 WHERE `name` = 'reset talents'; +UPDATE `command` SET `permission` = @id+7 WHERE `name` = 'reset all'; diff --git a/sql/updates/world/2013_09_10_12_world_command.sql b/sql/updates/world/2013_09_10_12_world_command.sql new file mode 100644 index 00000000000..58542e5a10b --- /dev/null +++ b/sql/updates/world/2013_09_10_12_world_command.sql @@ -0,0 +1,24 @@ +/* cs_server.cpp */ + +SET @id = 718; + +-- Update command table with new RBAC permissions +UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'server'; +UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'server corpses'; +UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'server exit'; +UPDATE `command` SET `permission` = @id+3 WHERE `name` = 'server idlerestart'; +UPDATE `command` SET `permission` = @id+4 WHERE `name` = 'server idlerestart cancel'; +UPDATE `command` SET `permission` = @id+5 WHERE `name` = 'server idleshutdown'; +UPDATE `command` SET `permission` = @id+6 WHERE `name` = 'server idleshutdown cancel'; +UPDATE `command` SET `permission` = @id+7 WHERE `name` = 'server info'; +UPDATE `command` SET `permission` = @id+8 WHERE `name` = 'server plimit'; +UPDATE `command` SET `permission` = @id+9 WHERE `name` = 'server restart'; +UPDATE `command` SET `permission` = @id+10 WHERE `name` = 'server restart cancel'; +UPDATE `command` SET `permission` = @id+11 WHERE `name` = 'server set'; +UPDATE `command` SET `permission` = @id+12 WHERE `name` = 'server set closed'; +UPDATE `command` SET `permission` = @id+13 WHERE `name` = 'server set difftime'; +UPDATE `command` SET `permission` = @id+14 WHERE `name` = 'server set loglevel'; +UPDATE `command` SET `permission` = @id+15 WHERE `name` = 'server set motd'; +UPDATE `command` SET `permission` = @id+16 WHERE `name` = 'server shutdown'; +UPDATE `command` SET `permission` = @id+17 WHERE `name` = 'server shutdown cancel'; +UPDATE `command` SET `permission` = @id+18 WHERE `name` = 'server motd'; diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h index d6d778df40c..6fa8f2c600a 100644 --- a/src/server/game/Accounts/RBAC.h +++ b/src/server/game/Accounts/RBAC.h @@ -1,973 +1,992 @@ -/* - * Copyright (C) 2008-2013 TrinityCore - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -/** -* @file RBAC.h -* @brief Role Based Access Control related classes definition -* -* This file contains all the classes and enums used to implement -* Role Based Access Control -* -* RBAC Rules: -* - Pemission: Defines an autorization to perform certain operation. -* - Role: Set of permissions. -* - Group: Set of roles. -* - An Account can have multiple groups, roles and permissions. -* - Account Groups can only be granted or revoked -* - Account Roles and Permissions can be granted, denied or revoked -* - Grant: Assignment of the object (role/permission) and allow it -* - Deny: Assignment of the object (role/permission) and deny it -* - Revoke: Removal of the object (role/permission) no matter if it was granted or denied -* - Global Permissions are computed as: -* Group Grants + Role Grants + User Grans - Role Grants - User Grants -* - Groups, Roles and Permissions can be assigned by realm -*/ - -#ifndef _RBAC_H -#define _RBAC_H - -#include "Define.h" -#include -#include -#include -#include - -enum RBACPermissions -{ - RBAC_PERM_INSTANT_LOGOUT = 1, - RBAC_PERM_SKIP_QUEUE = 2, - RBAC_PERM_JOIN_NORMAL_BG = 3, - RBAC_PERM_JOIN_RANDOM_BG = 4, - RBAC_PERM_JOIN_ARENAS = 5, - RBAC_PERM_JOIN_DUNGEON_FINDER = 6, - RBAC_PERM_PLAYER_COMMANDS = 7, - RBAC_PERM_MODERATOR_COMMANDS = 8, - RBAC_PERM_GAMEMASTER_COMMANDS = 9, - RBAC_PERM_ADMINISTRATOR_COMMANDS = 10, - RBAC_PERM_LOG_GM_TRADE = 11, - RBAC_PERM_CONSOLE_COMMANDS = 12, // Not pressent in DB - RBAC_PERM_SKIP_CHECK_INSTANCE_REQUIRED_BOSSES = 13, - RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_TEAMMASK = 14, - RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_CLASSMASK = 15, - RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_RACEMASK = 16, - RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_RESERVEDNAME = 17, - RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_HEROIC_CHARACTER = 18, - RBAC_PERM_SKIP_CHECK_CHAT_CHANNEL_REQ = 19, - RBAC_PERM_SKIP_CHECK_DISABLE_MAP = 20, - RBAC_PERM_SKIP_CHECK_MORE_TALENTS_THAN_ALLOWED = 21, - RBAC_PERM_SKIP_CHECK_CHAT_SPAM = 22, - RBAC_PERM_SKIP_CHECK_OVERSPEED_PING = 23, - RBAC_PERM_TWO_SIDE_CHARACTER_CREATION = 24, - RBAC_PERM_TWO_SIDE_INTERACTION_CHAT = 25, - RBAC_PERM_TWO_SIDE_INTERACTION_CHANNEL = 26, - RBAC_PERM_TWO_SIDE_INTERACTION_MAIL = 27, - RBAC_PERM_TWO_SIDE_WHO_LIST = 28, - RBAC_PERM_TWO_SIDE_ADD_FRIEND = 29, - RBAC_PERM_COMMANDS_SAVE_WITHOUT_DELAY = 30, - RBAC_PERM_COMMANDS_USE_UNSTUCK_WITH_ARGS = 31, - RBAC_PERM_COMMANDS_BE_ASSIGNED_TICKET = 32, - RBAC_PERM_COMMANDS_NOTIFY_COMMAND_NOT_FOUND_ERROR = 33, - RBAC_PERM_COMMANDS_APPEAR_IN_GM_LIST = 34, - RBAC_PERM_WHO_SEE_ALL_SEC_LEVELS = 35, - RBAC_PERM_CAN_FILTER_WHISPERS = 36, - RBAC_PERM_CHAT_USE_STAFF_BADGE = 37, - RBAC_PERM_RESURRECT_WITH_FULL_HPS = 38, - RBAC_PERM_RESTORE_SAVED_GM_STATE = 39, - RBAC_PERM_ALLOW_GM_FRIEND = 40, - RBAC_PERM_USE_START_GM_LEVEL = 41, - RBAC_PERM_OPCODE_WORLD_TELEPORT = 42, - RBAC_PERM_OPCODE_WHOIS = 43, - RBAC_PERM_RECEIVE_GLOBAL_GM_TEXTMESSAGE = 44, - RBAC_PERM_SILENTLY_JOIN_CHANNEL = 45, - RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR = 46, - RBAC_PERM_CHECK_FOR_LOWER_SECURITY = 47, - RBAC_PERM_COMMANDS_PINFO_CHECK_PERSONAL_DATA = 48, - RBAC_PERM_EMAIL_CONFIRM_FOR_PASS_CHANGE = 49, - RBAC_PERM_MAY_CHECK_OWN_EMAIL = 50, - // Leave some space for core permissions - RBAC_PERM_COMMAND_RBAC = 200, - RBAC_PERM_COMMAND_RBAC_ACC = 201, - RBAC_PERM_COMMAND_RBAC_ACC_GROUP = 202, - RBAC_PERM_COMMAND_RBAC_ACC_GROUP_ADD = 203, - RBAC_PERM_COMMAND_RBAC_ACC_GROUP_DEL = 204, - RBAC_PERM_COMMAND_RBAC_ACC_ROLE = 205, - RBAC_PERM_COMMAND_RBAC_ACC_ROLE_GRANT = 206, - RBAC_PERM_COMMAND_RBAC_ACC_ROLE_DENY = 207, - RBAC_PERM_COMMAND_RBAC_ACC_ROLE_REVOKE = 208, - RBAC_PERM_COMMAND_RBAC_ACC_PERM = 209, - RBAC_PERM_COMMAND_RBAC_ACC_PERM_GRANT = 210, - RBAC_PERM_COMMAND_RBAC_ACC_PERM_DENY = 211, - RBAC_PERM_COMMAND_RBAC_ACC_PERM_REVOKE = 212, - RBAC_PERM_COMMAND_RBAC_LIST = 213, - RBAC_PERM_COMMAND_RBAC_LIST_GROUPS = 214, - RBAC_PERM_COMMAND_RBAC_LIST_ROLES = 215, - RBAC_PERM_COMMAND_RBAC_LIST_PERMS = 216, - RBAC_PERM_COMMAND_ACCOUNT = 217, - RBAC_PERM_COMMAND_ACCOUNT_ADDON = 218, - RBAC_PERM_COMMAND_ACCOUNT_CREATE = 219, - RBAC_PERM_COMMAND_ACCOUNT_DELETE = 220, - RBAC_PERM_COMMAND_ACCOUNT_LOCK = 221, - RBAC_PERM_COMMAND_ACCOUNT_LOCK_COUNTRY = 222, - RBAC_PERM_COMMAND_ACCOUNT_LOCK_IP = 223, - RBAC_PERM_COMMAND_ACCOUNT_ONLINE_LIST = 224, - RBAC_PERM_COMMAND_ACCOUNT_PASSWORD = 225, - RBAC_PERM_COMMAND_ACCOUNT_SET = 226, - RBAC_PERM_COMMAND_ACCOUNT_SET_ADDON = 227, - RBAC_PERM_COMMAND_ACCOUNT_SET_GMLEVEL = 228, - RBAC_PERM_COMMAND_ACCOUNT_SET_PASSWORD = 229, - RBAC_PERM_COMMAND_ACHIEVEMENT = 230, - RBAC_PERM_COMMAND_ACHIEVEMENT_ADD = 231, - RBAC_PERM_COMMAND_ARENA = 232, - RBAC_PERM_COMMAND_ARENA_CAPTAIN = 233, - RBAC_PERM_COMMAND_ARENA_CREATE = 234, - RBAC_PERM_COMMAND_ARENA_DISBAND = 235, - RBAC_PERM_COMMAND_ARENA_INFO = 236, - RBAC_PERM_COMMAND_ARENA_LOOKUP = 237, - RBAC_PERM_COMMAND_ARENA_RENAME = 238, - RBAC_PERM_COMMAND_BAN = 239, - RBAC_PERM_COMMAND_BAN_ACCOUNT = 240, - RBAC_PERM_COMMAND_BAN_CHARACTER = 241, - RBAC_PERM_COMMAND_BAN_IP = 242, - RBAC_PERM_COMMAND_BAN_PLAYERACCOUNT = 243, - RBAC_PERM_COMMAND_BANINFO = 244, - RBAC_PERM_COMMAND_BANINFO_ACCOUNT = 245, - RBAC_PERM_COMMAND_BANINFO_CHARACTER = 246, - RBAC_PERM_COMMAND_BANINFO_IP = 247, - RBAC_PERM_COMMAND_BANLIST = 248, - RBAC_PERM_COMMAND_BANLIST_ACCOUNT = 249, - RBAC_PERM_COMMAND_BANLIST_CHARACTER = 250, - RBAC_PERM_COMMAND_BANLIST_IP = 251, - RBAC_PERM_COMMAND_UNBAN = 252, - RBAC_PERM_COMMAND_UNBAN_ACCOUNT = 253, - RBAC_PERM_COMMAND_UNBAN_CHARACTER = 254, - RBAC_PERM_COMMAND_UNBAN_IP = 255, - RBAC_PERM_COMMAND_UNBAN_PLAYERACCOUNT = 256, - RBAC_PERM_COMMAND_BF = 257, - RBAC_PERM_COMMAND_BF_START = 258, - RBAC_PERM_COMMAND_BF_STOP = 259, - RBAC_PERM_COMMAND_BF_SWITCH = 260, - RBAC_PERM_COMMAND_BF_TIMER = 261, - RBAC_PERM_COMMAND_BF_ENABLE = 262, - RBAC_PERM_COMMAND_ACCOUNT_EMAIL = 263, - RBAC_PERM_COMMAND_ACCOUNT_SET_SEC = 264, - RBAC_PERM_COMMAND_ACCOUNT_SET_SEC_EMAIL = 265, - RBAC_PERM_COMMAND_ACCOUNT_SET_SEC_REGMAIL = 266, - RBAC_PERM_COMMAND_CAST = 267, - RBAC_PERM_COMMAND_CAST_BACK = 268, - RBAC_PERM_COMMAND_CAST_DIST = 269, - RBAC_PERM_COMMAND_CAST_SELF = 270, - RBAC_PERM_COMMAND_CAST_TARGET = 271, - RBAC_PERM_COMMAND_CAST_DEST = 272, - RBAC_PERM_COMMAND_CHARACTER = 273, - RBAC_PERM_COMMAND_CHARACTER_CUSTOMIZE = 274, - RBAC_PERM_COMMAND_CHARACTER_CHANGEFACTION = 275, - RBAC_PERM_COMMAND_CHARACTER_CHANGERACE = 276, - RBAC_PERM_COMMAND_CHARACTER_DELETED = 277, - RBAC_PERM_COMMAND_CHARACTER_DELETED_DELETE = 278, - RBAC_PERM_COMMAND_CHARACTER_DELETED_LIST = 279, - RBAC_PERM_COMMAND_CHARACTER_DELETED_RESTORE = 280, - RBAC_PERM_COMMAND_CHARACTER_DELETED_OLD = 281, - RBAC_PERM_COMMAND_CHARACTER_ERASE = 282, - RBAC_PERM_COMMAND_CHARACTER_LEVEL = 283, - RBAC_PERM_COMMAND_CHARACTER_RENAME = 284, - RBAC_PERM_COMMAND_CHARACTER_REPUTATION = 285, - RBAC_PERM_COMMAND_CHARACTER_TITLES = 286, - RBAC_PERM_COMMAND_LEVELUP = 287, - RBAC_PERM_COMMAND_PDUMP = 288, - RBAC_PERM_COMMAND_PDUMP_LOAD = 289, - RBAC_PERM_COMMAND_PDUMP_WRITE = 290, - RBAC_PERM_COMMAND_CHEAT = 291, - RBAC_PERM_COMMAND_CHEAT_CASTTIME = 292, - RBAC_PERM_COMMAND_CHEAT_COOLDOWN = 293, - RBAC_PERM_COMMAND_CHEAT_EXPLORE = 294, - RBAC_PERM_COMMAND_CHEAT_GOD = 295, - RBAC_PERM_COMMAND_CHEAT_POWER = 296, - RBAC_PERM_COMMAND_CHEAT_STATUS = 297, - RBAC_PERM_COMMAND_CHEAT_TAXI = 298, - RBAC_PERM_COMMAND_CHEAT_WATERWALK = 299, - RBAC_PERM_COMMAND_DEBUG = 300, - RBAC_PERM_COMMAND_DEBUG_ANIM = 301, - RBAC_PERM_COMMAND_DEBUG_AREATRIGGERS = 302, - RBAC_PERM_COMMAND_DEBUG_ARENA = 303, - RBAC_PERM_COMMAND_DEBUG_BG = 304, - RBAC_PERM_COMMAND_DEBUG_ENTERVEHICLE = 305, - RBAC_PERM_COMMAND_DEBUG_GETITEMSTATE = 306, - RBAC_PERM_COMMAND_DEBUG_GETITEMVALUE = 307, - RBAC_PERM_COMMAND_DEBUG_GETVALUE = 308, - RBAC_PERM_COMMAND_DEBUG_HOSTIL = 309, - RBAC_PERM_COMMAND_DEBUG_ITEMEXPIRE = 310, - RBAC_PERM_COMMAND_DEBUG_LOOTRECIPIENT = 311, - RBAC_PERM_COMMAND_DEBUG_LOS = 312, - RBAC_PERM_COMMAND_DEBUG_MOD32VALUE = 313, - RBAC_PERM_COMMAND_DEBUG_MOVEFLAGS = 314, - RBAC_PERM_COMMAND_DEBUG_PLAY = 315, - RBAC_PERM_COMMAND_DEBUG_PLAY_CINEMATIC = 316, - RBAC_PERM_COMMAND_DEBUG_PLAY_MOVIE = 317, - RBAC_PERM_COMMAND_DEBUG_PLAY_SOUND = 318, - RBAC_PERM_COMMAND_DEBUG_SEND = 319, - RBAC_PERM_COMMAND_DEBUG_SEND_BUYERROR = 320, - RBAC_PERM_COMMAND_DEBUG_SEND_CHANNELNOTIFY = 321, - RBAC_PERM_COMMAND_DEBUG_SEND_CHATMESSAGE = 322, - RBAC_PERM_COMMAND_DEBUG_SEND_EQUIPERROR = 323, - RBAC_PERM_COMMAND_DEBUG_SEND_LARGEPACKET = 324, - RBAC_PERM_COMMAND_DEBUG_SEND_OPCODE = 325, - RBAC_PERM_COMMAND_DEBUG_SEND_QINVALIDMSG = 326, - RBAC_PERM_COMMAND_DEBUG_SEND_QPARTYMSG = 327, - RBAC_PERM_COMMAND_DEBUG_SEND_SELLERROR = 328, - RBAC_PERM_COMMAND_DEBUG_SEND_SETPHASESHIFT = 329, - RBAC_PERM_COMMAND_DEBUG_SEND_SPELLFAIL = 330, - RBAC_PERM_COMMAND_DEBUG_SETAURASTATE = 331, - RBAC_PERM_COMMAND_DEBUG_SETBIT = 332, - RBAC_PERM_COMMAND_DEBUG_SETITEMVALUE = 333, - RBAC_PERM_COMMAND_DEBUG_SETVALUE = 334, - RBAC_PERM_COMMAND_DEBUG_SETVID = 335, - RBAC_PERM_COMMAND_DEBUG_SPAWNVEHICLE = 336, - RBAC_PERM_COMMAND_DEBUG_THREAT = 337, - RBAC_PERM_COMMAND_DEBUG_UPDATE = 338, - RBAC_PERM_COMMAND_DEBUG_UWS = 339, - RBAC_PERM_COMMAND_WPGPS = 340, - RBAC_PERM_COMMAND_DESERTER = 341, - RBAC_PERM_COMMAND_DESERTER_BG = 342, - RBAC_PERM_COMMAND_DESERTER_BG_ADD = 343, - RBAC_PERM_COMMAND_DESERTER_BG_REMOVE = 344, - RBAC_PERM_COMMAND_DESERTER_INSTANCE = 345, - RBAC_PERM_COMMAND_DESERTER_INSTANCE_ADD = 346, - RBAC_PERM_COMMAND_DESERTER_INSTANCE_REMOVE = 347, - RBAC_PERM_COMMAND_DISABLE = 348, - RBAC_PERM_COMMAND_DISABLE_ADD = 349, - RBAC_PERM_COMMAND_DISABLE_ADD_ACHIEVEMENT_CRITERIA = 350, - RBAC_PERM_COMMAND_DISABLE_ADD_BATTLEGROUND = 351, - RBAC_PERM_COMMAND_DISABLE_ADD_MAP = 352, - RBAC_PERM_COMMAND_DISABLE_ADD_MMAP = 353, - RBAC_PERM_COMMAND_DISABLE_ADD_OUTDOORPVP = 354, - RBAC_PERM_COMMAND_DISABLE_ADD_QUEST = 355, - RBAC_PERM_COMMAND_DISABLE_ADD_SPELL = 356, - RBAC_PERM_COMMAND_DISABLE_ADD_VMAP = 357, - RBAC_PERM_COMMAND_DISABLE_REMOVE = 358, - RBAC_PERM_COMMAND_DISABLE_REMOVE_ACHIEVEMENT_CRITERIA = 359, - RBAC_PERM_COMMAND_DISABLE_REMOVE_BATTLEGROUND = 360, - RBAC_PERM_COMMAND_DISABLE_REMOVE_MAP = 361, - RBAC_PERM_COMMAND_DISABLE_REMOVE_MMAP = 362, - RBAC_PERM_COMMAND_DISABLE_REMOVE_OUTDOORPVP = 363, - RBAC_PERM_COMMAND_DISABLE_REMOVE_QUEST = 364, - RBAC_PERM_COMMAND_DISABLE_REMOVE_SPELL = 365, - RBAC_PERM_COMMAND_DISABLE_REMOVE_VMAP = 366, - RBAC_PERM_COMMAND_EVENT = 367, - RBAC_PERM_COMMAND_EVENT_ACTIVELIST = 368, - RBAC_PERM_COMMAND_EVENT_START = 369, - RBAC_PERM_COMMAND_EVENT_STOP = 370, - RBAC_PERM_COMMAND_GM = 371, - RBAC_PERM_COMMAND_GM_CHAT = 372, - RBAC_PERM_COMMAND_GM_FLY = 373, - RBAC_PERM_COMMAND_GM_INGAME = 374, - RBAC_PERM_COMMAND_GM_LIST = 375, - RBAC_PERM_COMMAND_GM_VISIBLE = 376, - RBAC_PERM_COMMAND_GO = 377, - RBAC_PERM_COMMAND_GO_CREATURE = 378, - RBAC_PERM_COMMAND_GO_GRAVEYARD = 379, - RBAC_PERM_COMMAND_GO_GRID = 380, - RBAC_PERM_COMMAND_GO_OBJECT = 381, - RBAC_PERM_COMMAND_GO_TAXINODE = 382, - RBAC_PERM_COMMAND_GO_TICKET = 383, - RBAC_PERM_COMMAND_GO_TRIGGER = 384, - RBAC_PERM_COMMAND_GO_XYZ = 385, - RBAC_PERM_COMMAND_GO_ZONEXY = 386, - RBAC_PERM_COMMAND_GOBJECT = 387, - RBAC_PERM_COMMAND_GOBJECT_ACTIVATE = 388, - RBAC_PERM_COMMAND_GOBJECT_ADD = 389, - RBAC_PERM_COMMAND_GOBJECT_ADD_TEMP = 390, - RBAC_PERM_COMMAND_GOBJECT_DELETE = 391, - RBAC_PERM_COMMAND_GOBJECT_INFO = 392, - RBAC_PERM_COMMAND_GOBJECT_MOVE = 393, - RBAC_PERM_COMMAND_GOBJECT_NEAR = 394, - RBAC_PERM_COMMAND_GOBJECT_SET = 395, - RBAC_PERM_COMMAND_GOBJECT_SET_PHASE = 396, - RBAC_PERM_COMMAND_GOBJECT_SET_STATE = 397, - RBAC_PERM_COMMAND_GOBJECT_TARGET = 398, - RBAC_PERM_COMMAND_GOBJECT_TURN = 399, - // 400 - reuse - RBAC_PERM_COMMAND_GUILD = 401, - RBAC_PERM_COMMAND_GUILD_CREATE = 402, - RBAC_PERM_COMMAND_GUILD_DELETE = 403, - RBAC_PERM_COMMAND_GUILD_INVITE = 404, - RBAC_PERM_COMMAND_GUILD_UNINVITE = 405, - RBAC_PERM_COMMAND_GUILD_RANK = 406, - RBAC_PERM_COMMAND_GUILD_RENAME = 407, - RBAC_PERM_COMMAND_HONOR = 408, - RBAC_PERM_COMMAND_HONOR_ADD = 409, - RBAC_PERM_COMMAND_HONOR_ADD_KILL = 410, - RBAC_PERM_COMMAND_HONOR_UPDATE = 411, - RBAC_PERM_COMMAND_INSTANCE = 412, - RBAC_PERM_COMMAND_INSTANCE_LISTBINDS = 413, - RBAC_PERM_COMMAND_INSTANCE_UNBIND = 414, - RBAC_PERM_COMMAND_INSTANCE_STATS = 415, - RBAC_PERM_COMMAND_INSTANCE_SAVEDATA = 416, - RBAC_PERM_COMMAND_LEARN = 417, - RBAC_PERM_COMMAND_LEARN_ALL = 418, - RBAC_PERM_COMMAND_LEARN_ALL_MY = 419, - RBAC_PERM_COMMAND_LEARN_ALL_MY_CLASS = 420, - RBAC_PERM_COMMAND_LEARN_ALL_MY_PETTALENTS = 421, - RBAC_PERM_COMMAND_LEARN_ALL_MY_SPELLS = 422, - RBAC_PERM_COMMAND_LEARN_ALL_MY_TALENTS = 423, - RBAC_PERM_COMMAND_LEARN_ALL_GM = 424, - RBAC_PERM_COMMAND_LEARN_ALL_CRAFTS = 425, - RBAC_PERM_COMMAND_LEARN_ALL_DEFAULT = 426, - RBAC_PERM_COMMAND_LEARN_ALL_LANG = 427, - RBAC_PERM_COMMAND_LEARN_ALL_RECIPES = 428, - RBAC_PERM_COMMAND_UNLEARN = 429, - RBAC_PERM_COMMAND_LFG = 430, - RBAC_PERM_COMMAND_LFG_PLAYER = 431, - RBAC_PERM_COMMAND_LFG_GROUP = 432, - RBAC_PERM_COMMAND_LFG_QUEUE = 433, - RBAC_PERM_COMMAND_LFG_CLEAN = 434, - RBAC_PERM_COMMAND_LFG_OPTIONS = 435, - RBAC_PERM_COMMAND_LIST = 436, - RBAC_PERM_COMMAND_LIST_CREATURE = 437, - RBAC_PERM_COMMAND_LIST_ITEM = 438, - RBAC_PERM_COMMAND_LIST_OBJECT = 439, - RBAC_PERM_COMMAND_LIST_AURAS = 440, - RBAC_PERM_COMMAND_LIST_MAIL = 441, - RBAC_PERM_COMMAND_LOOKUP = 442, - RBAC_PERM_COMMAND_LOOKUP_AREA = 443, - RBAC_PERM_COMMAND_LOOKUP_CREATURE = 444, - RBAC_PERM_COMMAND_LOOKUP_EVENT = 445, - RBAC_PERM_COMMAND_LOOKUP_FACTION = 446, - RBAC_PERM_COMMAND_LOOKUP_ITEM = 447, - RBAC_PERM_COMMAND_LOOKUP_ITEMSET = 448, - RBAC_PERM_COMMAND_LOOKUP_OBJECT = 449, - RBAC_PERM_COMMAND_LOOKUP_QUEST = 450, - RBAC_PERM_COMMAND_LOOKUP_PLAYER = 451, - RBAC_PERM_COMMAND_LOOKUP_PLAYER_IP = 452, - RBAC_PERM_COMMAND_LOOKUP_PLAYER_ACCOUNT = 453, - RBAC_PERM_COMMAND_LOOKUP_PLAYER_EMAIL = 454, - RBAC_PERM_COMMAND_LOOKUP_SKILL = 455, - RBAC_PERM_COMMAND_LOOKUP_SPELL = 456, - RBAC_PERM_COMMAND_LOOKUP_SPELL_ID = 457, - RBAC_PERM_COMMAND_LOOKUP_TAXINODE = 458, - RBAC_PERM_COMMAND_LOOKUP_TELE = 459, - RBAC_PERM_COMMAND_LOOKUP_TITLE = 460, - RBAC_PERM_COMMAND_LOOKUP_MAP = 461, - RBAC_PERM_COMMAND_ANNOUNCE = 462, - RBAC_PERM_COMMAND_CHANNEL = 463, - RBAC_PERM_COMMAND_CHANNEL_SET = 464, - RBAC_PERM_COMMAND_CHANNEL_SET_OWNERSHIP = 465, - RBAC_PERM_COMMAND_GMANNOUNCE = 466, - RBAC_PERM_COMMAND_GMNAMEANNOUNCE = 467, - RBAC_PERM_COMMAND_GMNOTIFY = 468, - RBAC_PERM_COMMAND_NAMEANNOUNCE = 469, - RBAC_PERM_COMMAND_NOTIFY = 470, - RBAC_PERM_COMMAND_WHISPERS = 471, - RBAC_PERM_COMMAND_GROUP = 472, - RBAC_PERM_COMMAND_GROUP_LEADER = 473, - RBAC_PERM_COMMAND_GROUP_DISBAND = 474, - RBAC_PERM_COMMAND_GROUP_REMOVE = 475, - RBAC_PERM_COMMAND_GROUP_JOIN = 476, - RBAC_PERM_COMMAND_GROUP_LIST = 477, - RBAC_PERM_COMMAND_GROUP_SUMMON = 478, - RBAC_PERM_COMMAND_PET = 479, - RBAC_PERM_COMMAND_PET_CREATE = 480, - RBAC_PERM_COMMAND_PET_LEARN = 481, - RBAC_PERM_COMMAND_PET_UNLEARN = 482, - RBAC_PERM_COMMAND_SEND = 483, - RBAC_PERM_COMMAND_SEND_ITEMS = 484, - RBAC_PERM_COMMAND_SEND_MAIL = 485, - RBAC_PERM_COMMAND_SEND_MESSAGE = 486, - RBAC_PERM_COMMAND_SEND_MONEY = 487, - RBAC_PERM_COMMAND_ADDITEM = 488, - RBAC_PERM_COMMAND_ADDITEMSET = 489, - RBAC_PERM_COMMAND_APPEAR = 490, - RBAC_PERM_COMMAND_AURA = 491, - RBAC_PERM_COMMAND_BANK = 492, - RBAC_PERM_COMMAND_BINDSIGHT = 493, - RBAC_PERM_COMMAND_COMBATSTOP = 494, - RBAC_PERM_COMMAND_COMETOME = 495, - RBAC_PERM_COMMAND_COMMANDS = 496, - RBAC_PERM_COMMAND_COOLDOWN = 497, - RBAC_PERM_COMMAND_DAMAGE = 498, - RBAC_PERM_COMMAND_DEV = 499, - RBAC_PERM_COMMAND_DIE = 500, - RBAC_PERM_COMMAND_DISMOUNT = 501, - RBAC_PERM_COMMAND_DISTANCE = 502, - RBAC_PERM_COMMAND_FLUSHARENAPOINTS = 503, - RBAC_PERM_COMMAND_FREEZE = 504, - RBAC_PERM_COMMAND_GPS = 505, - RBAC_PERM_COMMAND_GUID = 506, - RBAC_PERM_COMMAND_HELP = 507, - RBAC_PERM_COMMAND_HIDEAREA = 508, - RBAC_PERM_COMMAND_ITEMMOVE = 509, - RBAC_PERM_COMMAND_KICK = 510, - RBAC_PERM_COMMAND_LINKGRAVE = 511, - RBAC_PERM_COMMAND_LISTFREEZE = 512, - RBAC_PERM_COMMAND_MAXSKILL = 513, - RBAC_PERM_COMMAND_MOVEGENS = 514, - RBAC_PERM_COMMAND_MUTE = 515, - RBAC_PERM_COMMAND_NEARGRAVE = 516, - RBAC_PERM_COMMAND_PINFO = 517, - RBAC_PERM_COMMAND_PLAYALL = 518, - RBAC_PERM_COMMAND_POSSESS = 519, - RBAC_PERM_COMMAND_RECALL = 520, - RBAC_PERM_COMMAND_REPAIRITEMS = 521, - RBAC_PERM_COMMAND_RESPAWN = 522, - RBAC_PERM_COMMAND_REVIVE = 523, - RBAC_PERM_COMMAND_SAVE = 524, - RBAC_PERM_COMMAND_SAVEALL = 525, - RBAC_PERM_COMMAND_SETSKILL = 526, - RBAC_PERM_COMMAND_SHOWAREA = 527, - RBAC_PERM_COMMAND_SUMMON = 528, - RBAC_PERM_COMMAND_UNAURA = 529, - RBAC_PERM_COMMAND_UNBINDSIGHT = 530, - RBAC_PERM_COMMAND_UNFREEZE = 531, - RBAC_PERM_COMMAND_UNMUTE = 532, - RBAC_PERM_COMMAND_UNPOSSESS = 533, - RBAC_PERM_COMMAND_UNSTUCK = 534, - RBAC_PERM_COMMAND_WCHANGE = 535, - RBAC_PERM_COMMAND_MMAP = 536, - RBAC_PERM_COMMAND_MMAP_LOADEDTILES = 537, - RBAC_PERM_COMMAND_MMAP_LOC = 538, - RBAC_PERM_COMMAND_MMAP_PATH = 539, - RBAC_PERM_COMMAND_MMAP_STATS = 540, - RBAC_PERM_COMMAND_MMAP_TESTAREA = 541, - RBAC_PERM_COMMAND_MORPH = 542, - RBAC_PERM_COMMAND_DEMORPH = 543, - RBAC_PERM_COMMAND_MODIFY = 544, - RBAC_PERM_COMMAND_MODIFY_ARENAPOINTS = 545, - RBAC_PERM_COMMAND_MODIFY_BIT = 546, - RBAC_PERM_COMMAND_MODIFY_DRUNK = 547, - RBAC_PERM_COMMAND_MODIFY_ENERGY = 548, - RBAC_PERM_COMMAND_MODIFY_FACTION = 549, - RBAC_PERM_COMMAND_MODIFY_GENDER = 550, - RBAC_PERM_COMMAND_MODIFY_HONOR = 551, - RBAC_PERM_COMMAND_MODIFY_HP = 552, - RBAC_PERM_COMMAND_MODIFY_MANA = 553, - RBAC_PERM_COMMAND_MODIFY_MONEY = 554, - RBAC_PERM_COMMAND_MODIFY_MOUNT = 555, - RBAC_PERM_COMMAND_MODIFY_PHASE = 556, - RBAC_PERM_COMMAND_MODIFY_RAGE = 557, - RBAC_PERM_COMMAND_MODIFY_REPUTATION = 558, - RBAC_PERM_COMMAND_MODIFY_RUNICPOWER = 559, - RBAC_PERM_COMMAND_MODIFY_SCALE = 560, - RBAC_PERM_COMMAND_MODIFY_SPEED = 561, - RBAC_PERM_COMMAND_MODIFY_SPEED_ALL = 562, - RBAC_PERM_COMMAND_MODIFY_SPEED_BACKWALK = 563, - RBAC_PERM_COMMAND_MODIFY_SPEED_FLY = 564, - RBAC_PERM_COMMAND_MODIFY_SPEED_WALK = 565, - RBAC_PERM_COMMAND_MODIFY_SPEED_SWIM = 566, - RBAC_PERM_COMMAND_MODIFY_SPELL = 567, - RBAC_PERM_COMMAND_MODIFY_STANDSTATE = 568, - RBAC_PERM_COMMAND_MODIFY_TALENTPOINTS = 569, - RBAC_PERM_COMMAND_NPC = 570, - RBAC_PERM_COMMAND_NPC_ADD = 571, - RBAC_PERM_COMMAND_NPC_ADD_FORMATION = 572, - RBAC_PERM_COMMAND_NPC_ADD_ITEM = 573, - RBAC_PERM_COMMAND_NPC_ADD_MOVE = 574, - RBAC_PERM_COMMAND_NPC_ADD_TEMP = 575, - RBAC_PERM_COMMAND_NPC_DELETE = 576, - RBAC_PERM_COMMAND_NPC_DELETE_ITEM = 577, - RBAC_PERM_COMMAND_NPC_FOLLOW = 578, - RBAC_PERM_COMMAND_NPC_FOLLOW_STOP = 579, - RBAC_PERM_COMMAND_NPC_SET = 580, - RBAC_PERM_COMMAND_NPC_SET_ALLOWMOVE = 581, - RBAC_PERM_COMMAND_NPC_SET_ENTRY = 582, - RBAC_PERM_COMMAND_NPC_SET_FACTIONID = 583, - RBAC_PERM_COMMAND_NPC_SET_FLAG = 584, - RBAC_PERM_COMMAND_NPC_SET_LEVEL = 585, - RBAC_PERM_COMMAND_NPC_SET_LINK = 586, - RBAC_PERM_COMMAND_NPC_SET_MODEL = 587, - RBAC_PERM_COMMAND_NPC_SET_MOVETYPE = 588, - RBAC_PERM_COMMAND_NPC_SET_PHASE = 589, - RBAC_PERM_COMMAND_NPC_SET_SPAWNDIST = 590, - RBAC_PERM_COMMAND_NPC_SET_SPAWNTIME = 591, - RBAC_PERM_COMMAND_NPC_SET_DATA = 592, - RBAC_PERM_COMMAND_NPC_INFO = 593, - RBAC_PERM_COMMAND_NPC_NEAR = 594, - RBAC_PERM_COMMAND_NPC_MOVE = 595, - RBAC_PERM_COMMAND_NPC_PLAYEMOTE = 596, - RBAC_PERM_COMMAND_NPC_SAY = 597, - RBAC_PERM_COMMAND_NPC_TEXTEMOTE = 598, - RBAC_PERM_COMMAND_NPC_WHISPER = 599, - RBAC_PERM_COMMAND_NPC_YELL = 600, - RBAC_PERM_COMMAND_NPC_TAME = 601, - RBAC_PERM_COMMAND_QUEST = 602, - RBAC_PERM_COMMAND_QUEST_ADD = 603, - RBAC_PERM_COMMAND_QUEST_COMPLETE = 604, - RBAC_PERM_COMMAND_QUEST_REMOVE = 605, - RBAC_PERM_COMMAND_QUEST_REWARD = 606, - RBAC_PERM_COMMANDS_RELOAD = 607, - RBAC_PERM_COMMANDS_RELOAD_ACCESS_REQUIREMENT = 608, - RBAC_PERM_COMMANDS_RELOAD_ACHIEVEMENT_CRITERIA_DATA = 609, - RBAC_PERM_COMMANDS_RELOAD_ACHIEVEMENT_REWARD = 610, - RBAC_PERM_COMMANDS_RELOAD_ALL = 611, - RBAC_PERM_COMMANDS_RELOAD_ALL_ACHIEVEMENT = 612, - RBAC_PERM_COMMANDS_RELOAD_ALL_AREA = 613, - RBAC_PERM_COMMANDS_RELOAD_ALL_EVENTAI = 614, - RBAC_PERM_COMMANDS_RELOAD_ALL_GOSSIP = 615, - RBAC_PERM_COMMANDS_RELOAD_ALL_ITEM = 616, - RBAC_PERM_COMMANDS_RELOAD_ALL_LOCALES = 617, - RBAC_PERM_COMMANDS_RELOAD_ALL_LOOT = 618, - RBAC_PERM_COMMANDS_RELOAD_ALL_NPC = 619, - RBAC_PERM_COMMANDS_RELOAD_ALL_QUEST = 620, - RBAC_PERM_COMMANDS_RELOAD_ALL_SCRIPTS = 621, - RBAC_PERM_COMMANDS_RELOAD_ALL_SPELL = 622, - RBAC_PERM_COMMANDS_RELOAD_AREATRIGGER_INVOLVEDRELATION = 623, - RBAC_PERM_COMMANDS_RELOAD_AREATRIGGER_TAVERN = 624, - RBAC_PERM_COMMANDS_RELOAD_AREATRIGGER_TELEPORT = 625, - RBAC_PERM_COMMANDS_RELOAD_AUCTIONS = 626, - RBAC_PERM_COMMANDS_RELOAD_AUTOBROADCAST = 627, - RBAC_PERM_COMMANDS_RELOAD_COMMAND = 628, - RBAC_PERM_COMMANDS_RELOAD_CONDITIONS = 629, - RBAC_PERM_COMMANDS_RELOAD_CONFIG = 630, - RBAC_PERM_COMMANDS_RELOAD_CREATURE_AI_SCRIPTS = 631, - RBAC_PERM_COMMANDS_RELOAD_CREATURE_AI_TEXTS = 632, - RBAC_PERM_COMMANDS_RELOAD_CREATURE_LINKED_RESPAWN = 633, - RBAC_PERM_COMMANDS_RELOAD_CREATURE_LOOT_TEMPLATE = 634, - RBAC_PERM_COMMANDS_RELOAD_CREATURE_ONKILL_REPUTATION = 635, - RBAC_PERM_COMMANDS_RELOAD_CREATURE_QUESTENDER = 636, - RBAC_PERM_COMMANDS_RELOAD_CREATURE_QUESTSTARTER = 637, - RBAC_PERM_COMMANDS_RELOAD_CREATURE_SUMMON_GROUPS = 638, - RBAC_PERM_COMMANDS_RELOAD_CREATURE_TEMPLATE = 639, - RBAC_PERM_COMMANDS_RELOAD_CREATURE_TEXT = 640, - RBAC_PERM_COMMANDS_RELOAD_DISABLES = 641, - RBAC_PERM_COMMANDS_RELOAD_DISENCHANT_LOOT_TEMPLATE = 642, - RBAC_PERM_COMMANDS_RELOAD_EVENT_SCRIPTS = 643, - RBAC_PERM_COMMANDS_RELOAD_FISHING_LOOT_TEMPLATE = 644, - RBAC_PERM_COMMANDS_RELOAD_GAME_GRAVEYARD_ZONE = 645, - RBAC_PERM_COMMANDS_RELOAD_GAMEOBJECT_QUESTENDER = 646, - RBAC_PERM_COMMANDS_RELOAD_GAMEOBJECT_QUEST_LOOT_TEMPLATE = 647, - RBAC_PERM_COMMANDS_RELOAD_GAMEOBJECT_QUESTSTARTER = 648, - RBAC_PERM_COMMANDS_RELOAD_GAME_TELE = 649, - RBAC_PERM_COMMANDS_RELOAD_GM_TICKETS = 650, - RBAC_PERM_COMMANDS_RELOAD_GOSSIP_MENU = 651, - RBAC_PERM_COMMANDS_RELOAD_GOSSIP_MENU_OPTION = 652, - RBAC_PERM_COMMANDS_RELOAD_ITEM_ENCHANTMENT_TEMPLATE = 653, - RBAC_PERM_COMMANDS_RELOAD_ITEM_LOOT_TEMPLATE = 654, - RBAC_PERM_COMMANDS_RELOAD_ITEM_SET_NAMES = 655, - RBAC_PERM_COMMANDS_RELOAD_LFG_DUNGEON_REWARDS = 656, - RBAC_PERM_COMMANDS_RELOAD_LOCALES_ACHIEVEMENT_REWARD = 657, - RBAC_PERM_COMMANDS_RELOAD_LOCALES_CRETURE = 658, - RBAC_PERM_COMMANDS_RELOAD_LOCALES_CRETURE_TEXT = 659, - RBAC_PERM_COMMANDS_RELOAD_LOCALES_GAMEOBJECT = 660, - RBAC_PERM_COMMANDS_RELOAD_LOCALES_GOSSIP_MENU_OPTION = 661, - RBAC_PERM_COMMANDS_RELOAD_LOCALES_ITEM = 662, - RBAC_PERM_COMMANDS_RELOAD_LOCALES_ITEM_SET_NAME = 663, - RBAC_PERM_COMMANDS_RELOAD_LOCALES_NPC_TEXT = 664, - RBAC_PERM_COMMANDS_RELOAD_LOCALES_PAGE_TEXT = 665, - RBAC_PERM_COMMANDS_RELOAD_LOCALES_POINTS_OF_INTEREST = 666, - RBAC_PERM_COMMANDS_RELOAD_LOCALES_QUEST = 667, - RBAC_PERM_COMMANDS_RELOAD_MAIL_LEVEL_REWARD = 668, - RBAC_PERM_COMMANDS_RELOAD_MAIL_LOOT_TEMPLATE = 669, - RBAC_PERM_COMMANDS_RELOAD_MILLING_LOOT_TEMPLATE = 670, - RBAC_PERM_COMMANDS_RELOAD_NPC_SPELLCLICK_SPELLS = 671, - RBAC_PERM_COMMANDS_RELOAD_NPC_TRAINER = 672, - RBAC_PERM_COMMANDS_RELOAD_NPC_VENDOR = 673, - RBAC_PERM_COMMANDS_RELOAD_PAGE_TEXT = 674, - RBAC_PERM_COMMANDS_RELOAD_PICKPOCKETING_LOOT_TEMPLATE = 675, - RBAC_PERM_COMMANDS_RELOAD_POINTS_OF_INTEREST = 676, - RBAC_PERM_COMMANDS_RELOAD_PROSPECTING_LOOT_TEMPLATE = 677, - RBAC_PERM_COMMANDS_RELOAD_QUEST_POI = 678, - RBAC_PERM_COMMANDS_RELOAD_QUEST_TEMPLATE = 679, - RBAC_PERM_COMMANDS_RELOAD_RBAC = 680, - RBAC_PERM_COMMANDS_RELOAD_REFERENCE_LOOT_TEMPLATE = 681, - RBAC_PERM_COMMANDS_RELOAD_REPUTATION_REWARD_RATE = 682, - RBAC_PERM_COMMANDS_RELOAD_RESERVED_NAME = 683, - RBAC_PERM_COMMANDS_RELOAD_SKILL_DISCOVERY_TEMPLATE = 684, - RBAC_PERM_COMMANDS_RELOAD_SKILL_EXTRA_ITEM_TEMPLATE = 685, - RBAC_PERM_COMMANDS_RELOAD_SKILL_FISHING_BASE_LEVEL = 686, - RBAC_PERM_COMMANDS_RELOAD_SKINNING_LOOT_TEMPLATE = 687, - RBAC_PERM_COMMANDS_RELOAD_SMART_SCRIPTS = 688, - RBAC_PERM_COMMANDS_RELOAD_SPELL_AREA = 689, - RBAC_PERM_COMMANDS_RELOAD_SPELL_BONUS_DATA = 690, - RBAC_PERM_COMMANDS_RELOAD_SPELL_GROUP = 691, - RBAC_PERM_COMMANDS_RELOAD_SPELL_GROUP_STACK_RULES = 692, - RBAC_PERM_COMMANDS_RELOAD_SPELL_LEARN_SPELL = 693, - RBAC_PERM_COMMANDS_RELOAD_SPELL_LINKED_SPELL = 694, - RBAC_PERM_COMMANDS_RELOAD_SPELL_LOOT_TEMPLATE = 695, - RBAC_PERM_COMMANDS_RELOAD_SPELL_PET_AURAS = 696, - RBAC_PERM_COMMANDS_RELOAD_SPELL_PROC = 697, - RBAC_PERM_COMMANDS_RELOAD_SPELL_PROC_EVENT = 698, - RBAC_PERM_COMMANDS_RELOAD_SPELL_REQUIRED = 699, - RBAC_PERM_COMMANDS_RELOAD_SPELL_SCRIPTS = 700, - RBAC_PERM_COMMANDS_RELOAD_SPELL_TARGET_POSITION = 701, - RBAC_PERM_COMMANDS_RELOAD_SPELL_THREATS = 702, - RBAC_PERM_COMMANDS_RELOAD_SPILLOVER_TEMPLATE = 703, - RBAC_PERM_COMMANDS_RELOAD_TRINITY_STRING = 704, - RBAC_PERM_COMMANDS_RELOAD_VEHICLE_ACCESORY = 705, - RBAC_PERM_COMMANDS_RELOAD_VEHICLE_TEMPLATE_ACCESSORY = 706, - RBAC_PERM_COMMANDS_RELOAD_WARDEN_ACTION = 707, - RBAC_PERM_COMMANDS_RELOAD_WAYPOINT_DATA = 708, - RBAC_PERM_COMMANDS_RELOAD_WAYPOINT_SCRIPTS = 709, - RBAC_PERM_COMMAND_RESET = 710, - RBAC_PERM_COMMAND_RESET_ACHIEVEMENTS = 711, - RBAC_PERM_COMMAND_RESET_HONOR = 712, - RBAC_PERM_COMMAND_RESET_LEVEL = 713, - RBAC_PERM_COMMAND_RESET_SPELLS = 714, - RBAC_PERM_COMMAND_RESET_STATS = 715, - RBAC_PERM_COMMAND_RESET_TALENTS = 716, - RBAC_PERM_COMMAND_RESET_ALL = 717, - - // custom permissions 1000+ - RBAC_PERM_MAX -}; - -enum RBACCommandResult -{ - RBAC_OK, - RBAC_CANT_ADD_ALREADY_ADDED, - RBAC_CANT_REVOKE_NOT_IN_LIST, - RBAC_IN_GRANTED_LIST, - RBAC_IN_DENIED_LIST, - RBAC_ID_DOES_NOT_EXISTS -}; - -typedef std::bitset RBACPermissionContainer; -typedef std::set RBACRoleContainer; -typedef std::set RBACGroupContainer; - -class RBACObject -{ - public: - RBACObject(uint32 id = 0, std::string const& name = ""): - _id(id), _name(name) { } - - virtual ~RBACObject() { } - - /// Gets the Name of the Object - std::string const& GetName() const { return _name; } - /// Gets the Id of the Object - uint32 GetId() const { return _id; } - - private: - uint32 _id; ///> id of the object - std::string _name; ///> name of the object -}; - -/// Permission: Defines an autorization to perform certain operation -class RBACPermission: public RBACObject -{ - public: - RBACPermission(uint32 id = 0, std::string const& name = ""): - RBACObject(id, name) { } -}; - -/// Set of Permissions -class RBACRole: public RBACObject -{ - public: - RBACRole(uint32 id = 0, std::string const& name = ""): - RBACObject(id, name) { } - - /// Gets the Permissions assigned to this role - RBACPermissionContainer const& GetPermissions() const { return _perms; } - /// Grants a Permission (Adds) - void GrantPermission(uint32 id); - /// Revokes a Permission (Removes) - void RevokePermission(uint32 id); - - private: - RBACPermissionContainer _perms; ///> Set of permissions -}; - -/// Set of Roles -class RBACGroup: public RBACObject -{ - public: - RBACGroup(uint32 id = 0, std::string const& name = ""): - RBACObject(id, name) { } - - /// Gets the Roles assigned to this group - RBACRoleContainer const& GetRoles() const { return _roles; } - /// Grants a Role (Adds) - void GrantRole(uint32 role); - /// Revokes a Role (Removes) - void RevokeRole(uint32 role); - - private: - RBACRoleContainer _roles; ///> Set of Roles -}; - -/** - * @name RBACData - * @brief Contains all needed information about the acccount - * - * This class contains all the data needed to calculate the account permissions. - * RBACDAta is formed by group permissions and user permissions through: - * - Granted Groups, which contains roles, which contains permissions: Set of granted permissions - * - Granted Roles, which contains permissions: Set of granted permissions - * - Denied Roles, which contains permissions: Set of denied permissions - * - Granted Permissions - * - Denied Permissions - * - * Calculation of current Permissions: Granted permissions - Denied permissions - * - Granted permissions: through groups, through roles and directly assigned - * - Denied permissions: through roles and directly assigned - */ -class RBACData: public RBACObject -{ - public: - RBACData(uint32 id, std::string const& name, int32 realmId): - RBACObject(id, name), _realmId(realmId) { } - - /** - * @name HasPermission - * @brief Checks if certain action is allowed - * - * Checks if certain action can be performed. - * - * @return grant or deny action - * - * Example Usage: - * @code - * bool Player::CanJoinArena(Battleground* bg) - * { - * return bg->isArena() && HasPermission(RBAC_PERM_JOIN_ARENA); - * } - * @endcode - */ - bool HasPermission(uint32 permission) const { return _globalPerms.test(permission); } - - // Functions enabled to be used by command system - /// Returns all the granted permissions (after computation) - RBACPermissionContainer const& GetPermissions() const { return _globalPerms; } - /// Returns all the granted permissions - RBACPermissionContainer const& GetGrantedPermissions() const { return _grantedPerms; } - /// Returns all the denied permissions - RBACPermissionContainer const& GetDeniedPermissions() const { return _deniedPerms; } - /// Returns all the granted roles - RBACRoleContainer const& GetGrantedRoles() const { return _grantedRoles; } - /// Returns all the denied roles - RBACRoleContainer const& GetDeniedRoles() const { return _deniedRoles; } - /// Returns all the granted groups - RBACGroupContainer const& GetGroups() const { return _groups; } - - /** - * @name AddGroup - * @brief Adds new group - * - * Add a new group to the account. If realm is 0 or the group can not be added - * No save to db action will be performed. - * - * Fails if group Id does not exists or group already present - * - * @param groupId group to be added - * @param realmId realm affected - * - * @return Success or failure (with reason) to add the group - * - * Example Usage: - * @code - * // previously defined "RBACData* rbac" with proper initialization - * uint32 groupId = 2; - * if (rbac->AddGroup(groupId) == RBAC_OK) - * TC_LOG_DEBUG(LOG_FILTER_PLAYER, "Group %u succesfully added", groupId); - * @endcode - */ - RBACCommandResult AddGroup(uint32 groupId, int32 realmId = 0); - - /** - * @name RemoveGroup - * @brief Removes a group - * - * Removes a group from the account. If realm is 0 or the group can not be removed - * No save to db action will be performed. Any delete operation will always affect - * "all realms (-1)" in addition to the realm specified - * - * Fails if group not present - * - * @param groupId group to be removed - * @param realmId realm affected - * - * @return Success or failure (with reason) to remove the group - * - * Example Usage: - * // previously defined "RBACData* rbac" with proper initialization - * uint32 groupId = 2; - * if (rbac->RemoveGroup(groupId) == RBAC_OK) - * TC_LOG_DEBUG(LOG_FILTER_PLAYER, "Group %u succesfully removed", groupId); - * @endcode - */ - RBACCommandResult RemoveGroup(uint32 groupId, int32 realmId = 0); - - /** - * @name GrantRole - * @brief Grants a role - * - * Grants a role to the account. If realm is 0 or the role can not be added - * No save to db action will be performed. - * - * Fails if role Id does not exists or role already granted or denied - * - * @param roleId role to be granted - * @param realmId realm affected - * - * @return Success or failure (with reason) to grant the role - * - * Example Usage: - * // previously defined "RBACData* rbac" with proper initialization - * uint32 roleId = 2; - * if (rbac->GrantRole(roleId) == RBAC_IN_DENIED_LIST) - * TC_LOG_DEBUG(LOG_FILTER_PLAYER, "Failed to grant role %u, already denied", roleId); - * @endcode - */ - RBACCommandResult GrantRole(uint32 roleId, int32 realmId = 0); - - /** - * @name DenyRole - * @brief Denies a role - * - * Denied a role to the account. If realm is 0 or the role can not be added - * No save to db action will be performed. - * - * Fails if role Id does not exists or role already granted or denied - * - * @param roleId role to be denied - * @param realmId realm affected - * - * @return Success or failure (with reason) to deny the role - * - * Example Usage: - * // previously defined "RBACData* rbac" with proper initialization - * uint32 roleId = 2; - * if (rbac->DenyRole(roleId) == RBAC_ID_DOES_NOT_EXISTS) - * TC_LOG_DEBUG(LOG_FILTER_PLAYER, "Role Id %u does not exists", roleId); - * @endcode - */ - RBACCommandResult DenyRole(uint32 roleId, int32 realmId = 0); - - /** - * @name RevokeRole - * @brief Removes a role - * - * Removes a role from the account. If realm is 0 or the role can not be removed - * No save to db action will be performed. Any delete operation will always affect - * "all realms (-1)" in addition to the realm specified - * - * Fails if role not present - * - * @param roleId role to be removed - * @param realmId realm affected - * - * @return Success or failure (with reason) to remove the role - * - * Example Usage: - * // previously defined "RBACData* rbac" with proper initialization - * uint32 roleId = 2; - * if (rbac->RevokeRole(roleId) == RBAC_OK) - * TC_LOG_DEBUG(LOG_FILTER_PLAYER, "Role %u succesfully removed", roleId); - * @endcode - */ - RBACCommandResult RevokeRole(uint32 roleId, int32 realmId = 0); - - /** - * @name GrantRole - * @brief Grants a permission - * - * Grants a permission to the account. If realm is 0 or the permission can not be added - * No save to db action will be performed. - * - * Fails if permission Id does not exists or permission already granted or denied - * - * @param permissionId permission to be granted - * @param realmId realm affected - * - * @return Success or failure (with reason) to grant the permission - * - * Example Usage: - * // previously defined "RBACData* rbac" with proper initialization - * uint32 permissionId = 2; - * if (rbac->GrantRole(permissionId) == RBAC_IN_DENIED_LIST) - * TC_LOG_DEBUG(LOG_FILTER_PLAYER, "Failed to grant permission %u, already denied", permissionId); - * @endcode - */ - RBACCommandResult GrantPermission(uint32 permissionId, int32 realmId = 0); - - /** - * @name DenyPermission - * @brief Denies a permission - * - * Denied a permission to the account. If realm is 0 or the permission can not be added - * No save to db action will be performed. - * - * Fails if permission Id does not exists or permission already granted or denied - * - * @param permissionId permission to be denied - * @param realmId realm affected - * - * @return Success or failure (with reason) to deny the permission - * - * Example Usage: - * // previously defined "RBACData* rbac" with proper initialization - * uint32 permissionId = 2; - * if (rbac->DenyRole(permissionId) == RBAC_ID_DOES_NOT_EXISTS) - * TC_LOG_DEBUG(LOG_FILTER_PLAYER, "Role Id %u does not exists", permissionId); - * @endcode - */ - RBACCommandResult DenyPermission(uint32 permissionId, int32 realmId = 0); - - /** - * @name RevokePermission - * @brief Removes a permission - * - * Removes a permission from the account. If realm is 0 or the permission can not be removed - * No save to db action will be performed. Any delete operation will always affect - * "all realms (-1)" in addition to the realm specified - * - * Fails if permission not present - * - * @param permissionId permission to be removed - * @param realmId realm affected - * - * @return Success or failure (with reason) to remove the permission - * - * Example Usage: - * // previously defined "RBACData* rbac" with proper initialization - * uint32 permissionId = 2; - * if (rbac->RevokeRole(permissionId) == RBAC_OK) - * TC_LOG_DEBUG(LOG_FILTER_PLAYER, "Permission %u succesfully removed", permissionId); - * @endcode - */ - RBACCommandResult RevokePermission(uint32 permissionId, int32 realmId = 0); - - /// Loads all permissions, groups and roles assigned to current account - void LoadFromDB(); - private: - /// Saves a role to DB, Granted or Denied - void SaveRole(uint32 role, bool granted, int32 realm); - /// Saves a permission to DB, Granted or Denied - void SavePermission(uint32 role, bool granted, int32 realm); - - /** - * @name CalculateNewPermissions - * @brief Calculates new permissions - * - * Calculates new permissions after some change in groups, roles or permissions. - * The calculation is done Granted - Denied: - * - Granted permissions: through groups, through roles and directly assigned - * - Denied permissions: through roles and directly assigned - */ - void CalculateNewPermissions(); - - int32 GetRealmId() { return _realmId; } - - int32 _realmId; ///> RealmId Affected - RBACGroupContainer _groups; ///> Granted groups - RBACRoleContainer _grantedRoles; ///> Granted roles - RBACRoleContainer _deniedRoles; ///> Denied roles - RBACPermissionContainer _grantedPerms; ///> Granted permissions - RBACPermissionContainer _deniedPerms; ///> Denied permissions - RBACPermissionContainer _globalPerms; ///> Calculated permissions -}; - -#endif +/* + * Copyright (C) 2008-2013 TrinityCore + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +/** +* @file RBAC.h +* @brief Role Based Access Control related classes definition +* +* This file contains all the classes and enums used to implement +* Role Based Access Control +* +* RBAC Rules: +* - Pemission: Defines an autorization to perform certain operation. +* - Role: Set of permissions. +* - Group: Set of roles. +* - An Account can have multiple groups, roles and permissions. +* - Account Groups can only be granted or revoked +* - Account Roles and Permissions can be granted, denied or revoked +* - Grant: Assignment of the object (role/permission) and allow it +* - Deny: Assignment of the object (role/permission) and deny it +* - Revoke: Removal of the object (role/permission) no matter if it was granted or denied +* - Global Permissions are computed as: +* Group Grants + Role Grants + User Grans - Role Grants - User Grants +* - Groups, Roles and Permissions can be assigned by realm +*/ + +#ifndef _RBAC_H +#define _RBAC_H + +#include "Define.h" +#include +#include +#include +#include + +enum RBACPermissions +{ + RBAC_PERM_INSTANT_LOGOUT = 1, + RBAC_PERM_SKIP_QUEUE = 2, + RBAC_PERM_JOIN_NORMAL_BG = 3, + RBAC_PERM_JOIN_RANDOM_BG = 4, + RBAC_PERM_JOIN_ARENAS = 5, + RBAC_PERM_JOIN_DUNGEON_FINDER = 6, + RBAC_PERM_PLAYER_COMMANDS = 7, + RBAC_PERM_MODERATOR_COMMANDS = 8, + RBAC_PERM_GAMEMASTER_COMMANDS = 9, + RBAC_PERM_ADMINISTRATOR_COMMANDS = 10, + RBAC_PERM_LOG_GM_TRADE = 11, + RBAC_PERM_CONSOLE_COMMANDS = 12, // Not pressent in DB + RBAC_PERM_SKIP_CHECK_INSTANCE_REQUIRED_BOSSES = 13, + RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_TEAMMASK = 14, + RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_CLASSMASK = 15, + RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_RACEMASK = 16, + RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_RESERVEDNAME = 17, + RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_HEROIC_CHARACTER = 18, + RBAC_PERM_SKIP_CHECK_CHAT_CHANNEL_REQ = 19, + RBAC_PERM_SKIP_CHECK_DISABLE_MAP = 20, + RBAC_PERM_SKIP_CHECK_MORE_TALENTS_THAN_ALLOWED = 21, + RBAC_PERM_SKIP_CHECK_CHAT_SPAM = 22, + RBAC_PERM_SKIP_CHECK_OVERSPEED_PING = 23, + RBAC_PERM_TWO_SIDE_CHARACTER_CREATION = 24, + RBAC_PERM_TWO_SIDE_INTERACTION_CHAT = 25, + RBAC_PERM_TWO_SIDE_INTERACTION_CHANNEL = 26, + RBAC_PERM_TWO_SIDE_INTERACTION_MAIL = 27, + RBAC_PERM_TWO_SIDE_WHO_LIST = 28, + RBAC_PERM_TWO_SIDE_ADD_FRIEND = 29, + RBAC_PERM_COMMANDS_SAVE_WITHOUT_DELAY = 30, + RBAC_PERM_COMMANDS_USE_UNSTUCK_WITH_ARGS = 31, + RBAC_PERM_COMMANDS_BE_ASSIGNED_TICKET = 32, + RBAC_PERM_COMMANDS_NOTIFY_COMMAND_NOT_FOUND_ERROR = 33, + RBAC_PERM_COMMANDS_APPEAR_IN_GM_LIST = 34, + RBAC_PERM_WHO_SEE_ALL_SEC_LEVELS = 35, + RBAC_PERM_CAN_FILTER_WHISPERS = 36, + RBAC_PERM_CHAT_USE_STAFF_BADGE = 37, + RBAC_PERM_RESURRECT_WITH_FULL_HPS = 38, + RBAC_PERM_RESTORE_SAVED_GM_STATE = 39, + RBAC_PERM_ALLOW_GM_FRIEND = 40, + RBAC_PERM_USE_START_GM_LEVEL = 41, + RBAC_PERM_OPCODE_WORLD_TELEPORT = 42, + RBAC_PERM_OPCODE_WHOIS = 43, + RBAC_PERM_RECEIVE_GLOBAL_GM_TEXTMESSAGE = 44, + RBAC_PERM_SILENTLY_JOIN_CHANNEL = 45, + RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR = 46, + RBAC_PERM_CHECK_FOR_LOWER_SECURITY = 47, + RBAC_PERM_COMMANDS_PINFO_CHECK_PERSONAL_DATA = 48, + RBAC_PERM_EMAIL_CONFIRM_FOR_PASS_CHANGE = 49, + RBAC_PERM_MAY_CHECK_OWN_EMAIL = 50, + // Leave some space for core permissions + RBAC_PERM_COMMAND_RBAC = 200, + RBAC_PERM_COMMAND_RBAC_ACC = 201, + RBAC_PERM_COMMAND_RBAC_ACC_GROUP = 202, + RBAC_PERM_COMMAND_RBAC_ACC_GROUP_ADD = 203, + RBAC_PERM_COMMAND_RBAC_ACC_GROUP_DEL = 204, + RBAC_PERM_COMMAND_RBAC_ACC_ROLE = 205, + RBAC_PERM_COMMAND_RBAC_ACC_ROLE_GRANT = 206, + RBAC_PERM_COMMAND_RBAC_ACC_ROLE_DENY = 207, + RBAC_PERM_COMMAND_RBAC_ACC_ROLE_REVOKE = 208, + RBAC_PERM_COMMAND_RBAC_ACC_PERM = 209, + RBAC_PERM_COMMAND_RBAC_ACC_PERM_GRANT = 210, + RBAC_PERM_COMMAND_RBAC_ACC_PERM_DENY = 211, + RBAC_PERM_COMMAND_RBAC_ACC_PERM_REVOKE = 212, + RBAC_PERM_COMMAND_RBAC_LIST = 213, + RBAC_PERM_COMMAND_RBAC_LIST_GROUPS = 214, + RBAC_PERM_COMMAND_RBAC_LIST_ROLES = 215, + RBAC_PERM_COMMAND_RBAC_LIST_PERMS = 216, + RBAC_PERM_COMMAND_ACCOUNT = 217, + RBAC_PERM_COMMAND_ACCOUNT_ADDON = 218, + RBAC_PERM_COMMAND_ACCOUNT_CREATE = 219, + RBAC_PERM_COMMAND_ACCOUNT_DELETE = 220, + RBAC_PERM_COMMAND_ACCOUNT_LOCK = 221, + RBAC_PERM_COMMAND_ACCOUNT_LOCK_COUNTRY = 222, + RBAC_PERM_COMMAND_ACCOUNT_LOCK_IP = 223, + RBAC_PERM_COMMAND_ACCOUNT_ONLINE_LIST = 224, + RBAC_PERM_COMMAND_ACCOUNT_PASSWORD = 225, + RBAC_PERM_COMMAND_ACCOUNT_SET = 226, + RBAC_PERM_COMMAND_ACCOUNT_SET_ADDON = 227, + RBAC_PERM_COMMAND_ACCOUNT_SET_GMLEVEL = 228, + RBAC_PERM_COMMAND_ACCOUNT_SET_PASSWORD = 229, + RBAC_PERM_COMMAND_ACHIEVEMENT = 230, + RBAC_PERM_COMMAND_ACHIEVEMENT_ADD = 231, + RBAC_PERM_COMMAND_ARENA = 232, + RBAC_PERM_COMMAND_ARENA_CAPTAIN = 233, + RBAC_PERM_COMMAND_ARENA_CREATE = 234, + RBAC_PERM_COMMAND_ARENA_DISBAND = 235, + RBAC_PERM_COMMAND_ARENA_INFO = 236, + RBAC_PERM_COMMAND_ARENA_LOOKUP = 237, + RBAC_PERM_COMMAND_ARENA_RENAME = 238, + RBAC_PERM_COMMAND_BAN = 239, + RBAC_PERM_COMMAND_BAN_ACCOUNT = 240, + RBAC_PERM_COMMAND_BAN_CHARACTER = 241, + RBAC_PERM_COMMAND_BAN_IP = 242, + RBAC_PERM_COMMAND_BAN_PLAYERACCOUNT = 243, + RBAC_PERM_COMMAND_BANINFO = 244, + RBAC_PERM_COMMAND_BANINFO_ACCOUNT = 245, + RBAC_PERM_COMMAND_BANINFO_CHARACTER = 246, + RBAC_PERM_COMMAND_BANINFO_IP = 247, + RBAC_PERM_COMMAND_BANLIST = 248, + RBAC_PERM_COMMAND_BANLIST_ACCOUNT = 249, + RBAC_PERM_COMMAND_BANLIST_CHARACTER = 250, + RBAC_PERM_COMMAND_BANLIST_IP = 251, + RBAC_PERM_COMMAND_UNBAN = 252, + RBAC_PERM_COMMAND_UNBAN_ACCOUNT = 253, + RBAC_PERM_COMMAND_UNBAN_CHARACTER = 254, + RBAC_PERM_COMMAND_UNBAN_IP = 255, + RBAC_PERM_COMMAND_UNBAN_PLAYERACCOUNT = 256, + RBAC_PERM_COMMAND_BF = 257, + RBAC_PERM_COMMAND_BF_START = 258, + RBAC_PERM_COMMAND_BF_STOP = 259, + RBAC_PERM_COMMAND_BF_SWITCH = 260, + RBAC_PERM_COMMAND_BF_TIMER = 261, + RBAC_PERM_COMMAND_BF_ENABLE = 262, + RBAC_PERM_COMMAND_ACCOUNT_EMAIL = 263, + RBAC_PERM_COMMAND_ACCOUNT_SET_SEC = 264, + RBAC_PERM_COMMAND_ACCOUNT_SET_SEC_EMAIL = 265, + RBAC_PERM_COMMAND_ACCOUNT_SET_SEC_REGMAIL = 266, + RBAC_PERM_COMMAND_CAST = 267, + RBAC_PERM_COMMAND_CAST_BACK = 268, + RBAC_PERM_COMMAND_CAST_DIST = 269, + RBAC_PERM_COMMAND_CAST_SELF = 270, + RBAC_PERM_COMMAND_CAST_TARGET = 271, + RBAC_PERM_COMMAND_CAST_DEST = 272, + RBAC_PERM_COMMAND_CHARACTER = 273, + RBAC_PERM_COMMAND_CHARACTER_CUSTOMIZE = 274, + RBAC_PERM_COMMAND_CHARACTER_CHANGEFACTION = 275, + RBAC_PERM_COMMAND_CHARACTER_CHANGERACE = 276, + RBAC_PERM_COMMAND_CHARACTER_DELETED = 277, + RBAC_PERM_COMMAND_CHARACTER_DELETED_DELETE = 278, + RBAC_PERM_COMMAND_CHARACTER_DELETED_LIST = 279, + RBAC_PERM_COMMAND_CHARACTER_DELETED_RESTORE = 280, + RBAC_PERM_COMMAND_CHARACTER_DELETED_OLD = 281, + RBAC_PERM_COMMAND_CHARACTER_ERASE = 282, + RBAC_PERM_COMMAND_CHARACTER_LEVEL = 283, + RBAC_PERM_COMMAND_CHARACTER_RENAME = 284, + RBAC_PERM_COMMAND_CHARACTER_REPUTATION = 285, + RBAC_PERM_COMMAND_CHARACTER_TITLES = 286, + RBAC_PERM_COMMAND_LEVELUP = 287, + RBAC_PERM_COMMAND_PDUMP = 288, + RBAC_PERM_COMMAND_PDUMP_LOAD = 289, + RBAC_PERM_COMMAND_PDUMP_WRITE = 290, + RBAC_PERM_COMMAND_CHEAT = 291, + RBAC_PERM_COMMAND_CHEAT_CASTTIME = 292, + RBAC_PERM_COMMAND_CHEAT_COOLDOWN = 293, + RBAC_PERM_COMMAND_CHEAT_EXPLORE = 294, + RBAC_PERM_COMMAND_CHEAT_GOD = 295, + RBAC_PERM_COMMAND_CHEAT_POWER = 296, + RBAC_PERM_COMMAND_CHEAT_STATUS = 297, + RBAC_PERM_COMMAND_CHEAT_TAXI = 298, + RBAC_PERM_COMMAND_CHEAT_WATERWALK = 299, + RBAC_PERM_COMMAND_DEBUG = 300, + RBAC_PERM_COMMAND_DEBUG_ANIM = 301, + RBAC_PERM_COMMAND_DEBUG_AREATRIGGERS = 302, + RBAC_PERM_COMMAND_DEBUG_ARENA = 303, + RBAC_PERM_COMMAND_DEBUG_BG = 304, + RBAC_PERM_COMMAND_DEBUG_ENTERVEHICLE = 305, + RBAC_PERM_COMMAND_DEBUG_GETITEMSTATE = 306, + RBAC_PERM_COMMAND_DEBUG_GETITEMVALUE = 307, + RBAC_PERM_COMMAND_DEBUG_GETVALUE = 308, + RBAC_PERM_COMMAND_DEBUG_HOSTIL = 309, + RBAC_PERM_COMMAND_DEBUG_ITEMEXPIRE = 310, + RBAC_PERM_COMMAND_DEBUG_LOOTRECIPIENT = 311, + RBAC_PERM_COMMAND_DEBUG_LOS = 312, + RBAC_PERM_COMMAND_DEBUG_MOD32VALUE = 313, + RBAC_PERM_COMMAND_DEBUG_MOVEFLAGS = 314, + RBAC_PERM_COMMAND_DEBUG_PLAY = 315, + RBAC_PERM_COMMAND_DEBUG_PLAY_CINEMATIC = 316, + RBAC_PERM_COMMAND_DEBUG_PLAY_MOVIE = 317, + RBAC_PERM_COMMAND_DEBUG_PLAY_SOUND = 318, + RBAC_PERM_COMMAND_DEBUG_SEND = 319, + RBAC_PERM_COMMAND_DEBUG_SEND_BUYERROR = 320, + RBAC_PERM_COMMAND_DEBUG_SEND_CHANNELNOTIFY = 321, + RBAC_PERM_COMMAND_DEBUG_SEND_CHATMESSAGE = 322, + RBAC_PERM_COMMAND_DEBUG_SEND_EQUIPERROR = 323, + RBAC_PERM_COMMAND_DEBUG_SEND_LARGEPACKET = 324, + RBAC_PERM_COMMAND_DEBUG_SEND_OPCODE = 325, + RBAC_PERM_COMMAND_DEBUG_SEND_QINVALIDMSG = 326, + RBAC_PERM_COMMAND_DEBUG_SEND_QPARTYMSG = 327, + RBAC_PERM_COMMAND_DEBUG_SEND_SELLERROR = 328, + RBAC_PERM_COMMAND_DEBUG_SEND_SETPHASESHIFT = 329, + RBAC_PERM_COMMAND_DEBUG_SEND_SPELLFAIL = 330, + RBAC_PERM_COMMAND_DEBUG_SETAURASTATE = 331, + RBAC_PERM_COMMAND_DEBUG_SETBIT = 332, + RBAC_PERM_COMMAND_DEBUG_SETITEMVALUE = 333, + RBAC_PERM_COMMAND_DEBUG_SETVALUE = 334, + RBAC_PERM_COMMAND_DEBUG_SETVID = 335, + RBAC_PERM_COMMAND_DEBUG_SPAWNVEHICLE = 336, + RBAC_PERM_COMMAND_DEBUG_THREAT = 337, + RBAC_PERM_COMMAND_DEBUG_UPDATE = 338, + RBAC_PERM_COMMAND_DEBUG_UWS = 339, + RBAC_PERM_COMMAND_WPGPS = 340, + RBAC_PERM_COMMAND_DESERTER = 341, + RBAC_PERM_COMMAND_DESERTER_BG = 342, + RBAC_PERM_COMMAND_DESERTER_BG_ADD = 343, + RBAC_PERM_COMMAND_DESERTER_BG_REMOVE = 344, + RBAC_PERM_COMMAND_DESERTER_INSTANCE = 345, + RBAC_PERM_COMMAND_DESERTER_INSTANCE_ADD = 346, + RBAC_PERM_COMMAND_DESERTER_INSTANCE_REMOVE = 347, + RBAC_PERM_COMMAND_DISABLE = 348, + RBAC_PERM_COMMAND_DISABLE_ADD = 349, + RBAC_PERM_COMMAND_DISABLE_ADD_ACHIEVEMENT_CRITERIA = 350, + RBAC_PERM_COMMAND_DISABLE_ADD_BATTLEGROUND = 351, + RBAC_PERM_COMMAND_DISABLE_ADD_MAP = 352, + RBAC_PERM_COMMAND_DISABLE_ADD_MMAP = 353, + RBAC_PERM_COMMAND_DISABLE_ADD_OUTDOORPVP = 354, + RBAC_PERM_COMMAND_DISABLE_ADD_QUEST = 355, + RBAC_PERM_COMMAND_DISABLE_ADD_SPELL = 356, + RBAC_PERM_COMMAND_DISABLE_ADD_VMAP = 357, + RBAC_PERM_COMMAND_DISABLE_REMOVE = 358, + RBAC_PERM_COMMAND_DISABLE_REMOVE_ACHIEVEMENT_CRITERIA = 359, + RBAC_PERM_COMMAND_DISABLE_REMOVE_BATTLEGROUND = 360, + RBAC_PERM_COMMAND_DISABLE_REMOVE_MAP = 361, + RBAC_PERM_COMMAND_DISABLE_REMOVE_MMAP = 362, + RBAC_PERM_COMMAND_DISABLE_REMOVE_OUTDOORPVP = 363, + RBAC_PERM_COMMAND_DISABLE_REMOVE_QUEST = 364, + RBAC_PERM_COMMAND_DISABLE_REMOVE_SPELL = 365, + RBAC_PERM_COMMAND_DISABLE_REMOVE_VMAP = 366, + RBAC_PERM_COMMAND_EVENT = 367, + RBAC_PERM_COMMAND_EVENT_ACTIVELIST = 368, + RBAC_PERM_COMMAND_EVENT_START = 369, + RBAC_PERM_COMMAND_EVENT_STOP = 370, + RBAC_PERM_COMMAND_GM = 371, + RBAC_PERM_COMMAND_GM_CHAT = 372, + RBAC_PERM_COMMAND_GM_FLY = 373, + RBAC_PERM_COMMAND_GM_INGAME = 374, + RBAC_PERM_COMMAND_GM_LIST = 375, + RBAC_PERM_COMMAND_GM_VISIBLE = 376, + RBAC_PERM_COMMAND_GO = 377, + RBAC_PERM_COMMAND_GO_CREATURE = 378, + RBAC_PERM_COMMAND_GO_GRAVEYARD = 379, + RBAC_PERM_COMMAND_GO_GRID = 380, + RBAC_PERM_COMMAND_GO_OBJECT = 381, + RBAC_PERM_COMMAND_GO_TAXINODE = 382, + RBAC_PERM_COMMAND_GO_TICKET = 383, + RBAC_PERM_COMMAND_GO_TRIGGER = 384, + RBAC_PERM_COMMAND_GO_XYZ = 385, + RBAC_PERM_COMMAND_GO_ZONEXY = 386, + RBAC_PERM_COMMAND_GOBJECT = 387, + RBAC_PERM_COMMAND_GOBJECT_ACTIVATE = 388, + RBAC_PERM_COMMAND_GOBJECT_ADD = 389, + RBAC_PERM_COMMAND_GOBJECT_ADD_TEMP = 390, + RBAC_PERM_COMMAND_GOBJECT_DELETE = 391, + RBAC_PERM_COMMAND_GOBJECT_INFO = 392, + RBAC_PERM_COMMAND_GOBJECT_MOVE = 393, + RBAC_PERM_COMMAND_GOBJECT_NEAR = 394, + RBAC_PERM_COMMAND_GOBJECT_SET = 395, + RBAC_PERM_COMMAND_GOBJECT_SET_PHASE = 396, + RBAC_PERM_COMMAND_GOBJECT_SET_STATE = 397, + RBAC_PERM_COMMAND_GOBJECT_TARGET = 398, + RBAC_PERM_COMMAND_GOBJECT_TURN = 399, + // 400 - reuse + RBAC_PERM_COMMAND_GUILD = 401, + RBAC_PERM_COMMAND_GUILD_CREATE = 402, + RBAC_PERM_COMMAND_GUILD_DELETE = 403, + RBAC_PERM_COMMAND_GUILD_INVITE = 404, + RBAC_PERM_COMMAND_GUILD_UNINVITE = 405, + RBAC_PERM_COMMAND_GUILD_RANK = 406, + RBAC_PERM_COMMAND_GUILD_RENAME = 407, + RBAC_PERM_COMMAND_HONOR = 408, + RBAC_PERM_COMMAND_HONOR_ADD = 409, + RBAC_PERM_COMMAND_HONOR_ADD_KILL = 410, + RBAC_PERM_COMMAND_HONOR_UPDATE = 411, + RBAC_PERM_COMMAND_INSTANCE = 412, + RBAC_PERM_COMMAND_INSTANCE_LISTBINDS = 413, + RBAC_PERM_COMMAND_INSTANCE_UNBIND = 414, + RBAC_PERM_COMMAND_INSTANCE_STATS = 415, + RBAC_PERM_COMMAND_INSTANCE_SAVEDATA = 416, + RBAC_PERM_COMMAND_LEARN = 417, + RBAC_PERM_COMMAND_LEARN_ALL = 418, + RBAC_PERM_COMMAND_LEARN_ALL_MY = 419, + RBAC_PERM_COMMAND_LEARN_ALL_MY_CLASS = 420, + RBAC_PERM_COMMAND_LEARN_ALL_MY_PETTALENTS = 421, + RBAC_PERM_COMMAND_LEARN_ALL_MY_SPELLS = 422, + RBAC_PERM_COMMAND_LEARN_ALL_MY_TALENTS = 423, + RBAC_PERM_COMMAND_LEARN_ALL_GM = 424, + RBAC_PERM_COMMAND_LEARN_ALL_CRAFTS = 425, + RBAC_PERM_COMMAND_LEARN_ALL_DEFAULT = 426, + RBAC_PERM_COMMAND_LEARN_ALL_LANG = 427, + RBAC_PERM_COMMAND_LEARN_ALL_RECIPES = 428, + RBAC_PERM_COMMAND_UNLEARN = 429, + RBAC_PERM_COMMAND_LFG = 430, + RBAC_PERM_COMMAND_LFG_PLAYER = 431, + RBAC_PERM_COMMAND_LFG_GROUP = 432, + RBAC_PERM_COMMAND_LFG_QUEUE = 433, + RBAC_PERM_COMMAND_LFG_CLEAN = 434, + RBAC_PERM_COMMAND_LFG_OPTIONS = 435, + RBAC_PERM_COMMAND_LIST = 436, + RBAC_PERM_COMMAND_LIST_CREATURE = 437, + RBAC_PERM_COMMAND_LIST_ITEM = 438, + RBAC_PERM_COMMAND_LIST_OBJECT = 439, + RBAC_PERM_COMMAND_LIST_AURAS = 440, + RBAC_PERM_COMMAND_LIST_MAIL = 441, + RBAC_PERM_COMMAND_LOOKUP = 442, + RBAC_PERM_COMMAND_LOOKUP_AREA = 443, + RBAC_PERM_COMMAND_LOOKUP_CREATURE = 444, + RBAC_PERM_COMMAND_LOOKUP_EVENT = 445, + RBAC_PERM_COMMAND_LOOKUP_FACTION = 446, + RBAC_PERM_COMMAND_LOOKUP_ITEM = 447, + RBAC_PERM_COMMAND_LOOKUP_ITEMSET = 448, + RBAC_PERM_COMMAND_LOOKUP_OBJECT = 449, + RBAC_PERM_COMMAND_LOOKUP_QUEST = 450, + RBAC_PERM_COMMAND_LOOKUP_PLAYER = 451, + RBAC_PERM_COMMAND_LOOKUP_PLAYER_IP = 452, + RBAC_PERM_COMMAND_LOOKUP_PLAYER_ACCOUNT = 453, + RBAC_PERM_COMMAND_LOOKUP_PLAYER_EMAIL = 454, + RBAC_PERM_COMMAND_LOOKUP_SKILL = 455, + RBAC_PERM_COMMAND_LOOKUP_SPELL = 456, + RBAC_PERM_COMMAND_LOOKUP_SPELL_ID = 457, + RBAC_PERM_COMMAND_LOOKUP_TAXINODE = 458, + RBAC_PERM_COMMAND_LOOKUP_TELE = 459, + RBAC_PERM_COMMAND_LOOKUP_TITLE = 460, + RBAC_PERM_COMMAND_LOOKUP_MAP = 461, + RBAC_PERM_COMMAND_ANNOUNCE = 462, + RBAC_PERM_COMMAND_CHANNEL = 463, + RBAC_PERM_COMMAND_CHANNEL_SET = 464, + RBAC_PERM_COMMAND_CHANNEL_SET_OWNERSHIP = 465, + RBAC_PERM_COMMAND_GMANNOUNCE = 466, + RBAC_PERM_COMMAND_GMNAMEANNOUNCE = 467, + RBAC_PERM_COMMAND_GMNOTIFY = 468, + RBAC_PERM_COMMAND_NAMEANNOUNCE = 469, + RBAC_PERM_COMMAND_NOTIFY = 470, + RBAC_PERM_COMMAND_WHISPERS = 471, + RBAC_PERM_COMMAND_GROUP = 472, + RBAC_PERM_COMMAND_GROUP_LEADER = 473, + RBAC_PERM_COMMAND_GROUP_DISBAND = 474, + RBAC_PERM_COMMAND_GROUP_REMOVE = 475, + RBAC_PERM_COMMAND_GROUP_JOIN = 476, + RBAC_PERM_COMMAND_GROUP_LIST = 477, + RBAC_PERM_COMMAND_GROUP_SUMMON = 478, + RBAC_PERM_COMMAND_PET = 479, + RBAC_PERM_COMMAND_PET_CREATE = 480, + RBAC_PERM_COMMAND_PET_LEARN = 481, + RBAC_PERM_COMMAND_PET_UNLEARN = 482, + RBAC_PERM_COMMAND_SEND = 483, + RBAC_PERM_COMMAND_SEND_ITEMS = 484, + RBAC_PERM_COMMAND_SEND_MAIL = 485, + RBAC_PERM_COMMAND_SEND_MESSAGE = 486, + RBAC_PERM_COMMAND_SEND_MONEY = 487, + RBAC_PERM_COMMAND_ADDITEM = 488, + RBAC_PERM_COMMAND_ADDITEMSET = 489, + RBAC_PERM_COMMAND_APPEAR = 490, + RBAC_PERM_COMMAND_AURA = 491, + RBAC_PERM_COMMAND_BANK = 492, + RBAC_PERM_COMMAND_BINDSIGHT = 493, + RBAC_PERM_COMMAND_COMBATSTOP = 494, + RBAC_PERM_COMMAND_COMETOME = 495, + RBAC_PERM_COMMAND_COMMANDS = 496, + RBAC_PERM_COMMAND_COOLDOWN = 497, + RBAC_PERM_COMMAND_DAMAGE = 498, + RBAC_PERM_COMMAND_DEV = 499, + RBAC_PERM_COMMAND_DIE = 500, + RBAC_PERM_COMMAND_DISMOUNT = 501, + RBAC_PERM_COMMAND_DISTANCE = 502, + RBAC_PERM_COMMAND_FLUSHARENAPOINTS = 503, + RBAC_PERM_COMMAND_FREEZE = 504, + RBAC_PERM_COMMAND_GPS = 505, + RBAC_PERM_COMMAND_GUID = 506, + RBAC_PERM_COMMAND_HELP = 507, + RBAC_PERM_COMMAND_HIDEAREA = 508, + RBAC_PERM_COMMAND_ITEMMOVE = 509, + RBAC_PERM_COMMAND_KICK = 510, + RBAC_PERM_COMMAND_LINKGRAVE = 511, + RBAC_PERM_COMMAND_LISTFREEZE = 512, + RBAC_PERM_COMMAND_MAXSKILL = 513, + RBAC_PERM_COMMAND_MOVEGENS = 514, + RBAC_PERM_COMMAND_MUTE = 515, + RBAC_PERM_COMMAND_NEARGRAVE = 516, + RBAC_PERM_COMMAND_PINFO = 517, + RBAC_PERM_COMMAND_PLAYALL = 518, + RBAC_PERM_COMMAND_POSSESS = 519, + RBAC_PERM_COMMAND_RECALL = 520, + RBAC_PERM_COMMAND_REPAIRITEMS = 521, + RBAC_PERM_COMMAND_RESPAWN = 522, + RBAC_PERM_COMMAND_REVIVE = 523, + RBAC_PERM_COMMAND_SAVE = 524, + RBAC_PERM_COMMAND_SAVEALL = 525, + RBAC_PERM_COMMAND_SETSKILL = 526, + RBAC_PERM_COMMAND_SHOWAREA = 527, + RBAC_PERM_COMMAND_SUMMON = 528, + RBAC_PERM_COMMAND_UNAURA = 529, + RBAC_PERM_COMMAND_UNBINDSIGHT = 530, + RBAC_PERM_COMMAND_UNFREEZE = 531, + RBAC_PERM_COMMAND_UNMUTE = 532, + RBAC_PERM_COMMAND_UNPOSSESS = 533, + RBAC_PERM_COMMAND_UNSTUCK = 534, + RBAC_PERM_COMMAND_WCHANGE = 535, + RBAC_PERM_COMMAND_MMAP = 536, + RBAC_PERM_COMMAND_MMAP_LOADEDTILES = 537, + RBAC_PERM_COMMAND_MMAP_LOC = 538, + RBAC_PERM_COMMAND_MMAP_PATH = 539, + RBAC_PERM_COMMAND_MMAP_STATS = 540, + RBAC_PERM_COMMAND_MMAP_TESTAREA = 541, + RBAC_PERM_COMMAND_MORPH = 542, + RBAC_PERM_COMMAND_DEMORPH = 543, + RBAC_PERM_COMMAND_MODIFY = 544, + RBAC_PERM_COMMAND_MODIFY_ARENAPOINTS = 545, + RBAC_PERM_COMMAND_MODIFY_BIT = 546, + RBAC_PERM_COMMAND_MODIFY_DRUNK = 547, + RBAC_PERM_COMMAND_MODIFY_ENERGY = 548, + RBAC_PERM_COMMAND_MODIFY_FACTION = 549, + RBAC_PERM_COMMAND_MODIFY_GENDER = 550, + RBAC_PERM_COMMAND_MODIFY_HONOR = 551, + RBAC_PERM_COMMAND_MODIFY_HP = 552, + RBAC_PERM_COMMAND_MODIFY_MANA = 553, + RBAC_PERM_COMMAND_MODIFY_MONEY = 554, + RBAC_PERM_COMMAND_MODIFY_MOUNT = 555, + RBAC_PERM_COMMAND_MODIFY_PHASE = 556, + RBAC_PERM_COMMAND_MODIFY_RAGE = 557, + RBAC_PERM_COMMAND_MODIFY_REPUTATION = 558, + RBAC_PERM_COMMAND_MODIFY_RUNICPOWER = 559, + RBAC_PERM_COMMAND_MODIFY_SCALE = 560, + RBAC_PERM_COMMAND_MODIFY_SPEED = 561, + RBAC_PERM_COMMAND_MODIFY_SPEED_ALL = 562, + RBAC_PERM_COMMAND_MODIFY_SPEED_BACKWALK = 563, + RBAC_PERM_COMMAND_MODIFY_SPEED_FLY = 564, + RBAC_PERM_COMMAND_MODIFY_SPEED_WALK = 565, + RBAC_PERM_COMMAND_MODIFY_SPEED_SWIM = 566, + RBAC_PERM_COMMAND_MODIFY_SPELL = 567, + RBAC_PERM_COMMAND_MODIFY_STANDSTATE = 568, + RBAC_PERM_COMMAND_MODIFY_TALENTPOINTS = 569, + RBAC_PERM_COMMAND_NPC = 570, + RBAC_PERM_COMMAND_NPC_ADD = 571, + RBAC_PERM_COMMAND_NPC_ADD_FORMATION = 572, + RBAC_PERM_COMMAND_NPC_ADD_ITEM = 573, + RBAC_PERM_COMMAND_NPC_ADD_MOVE = 574, + RBAC_PERM_COMMAND_NPC_ADD_TEMP = 575, + RBAC_PERM_COMMAND_NPC_DELETE = 576, + RBAC_PERM_COMMAND_NPC_DELETE_ITEM = 577, + RBAC_PERM_COMMAND_NPC_FOLLOW = 578, + RBAC_PERM_COMMAND_NPC_FOLLOW_STOP = 579, + RBAC_PERM_COMMAND_NPC_SET = 580, + RBAC_PERM_COMMAND_NPC_SET_ALLOWMOVE = 581, + RBAC_PERM_COMMAND_NPC_SET_ENTRY = 582, + RBAC_PERM_COMMAND_NPC_SET_FACTIONID = 583, + RBAC_PERM_COMMAND_NPC_SET_FLAG = 584, + RBAC_PERM_COMMAND_NPC_SET_LEVEL = 585, + RBAC_PERM_COMMAND_NPC_SET_LINK = 586, + RBAC_PERM_COMMAND_NPC_SET_MODEL = 587, + RBAC_PERM_COMMAND_NPC_SET_MOVETYPE = 588, + RBAC_PERM_COMMAND_NPC_SET_PHASE = 589, + RBAC_PERM_COMMAND_NPC_SET_SPAWNDIST = 590, + RBAC_PERM_COMMAND_NPC_SET_SPAWNTIME = 591, + RBAC_PERM_COMMAND_NPC_SET_DATA = 592, + RBAC_PERM_COMMAND_NPC_INFO = 593, + RBAC_PERM_COMMAND_NPC_NEAR = 594, + RBAC_PERM_COMMAND_NPC_MOVE = 595, + RBAC_PERM_COMMAND_NPC_PLAYEMOTE = 596, + RBAC_PERM_COMMAND_NPC_SAY = 597, + RBAC_PERM_COMMAND_NPC_TEXTEMOTE = 598, + RBAC_PERM_COMMAND_NPC_WHISPER = 599, + RBAC_PERM_COMMAND_NPC_YELL = 600, + RBAC_PERM_COMMAND_NPC_TAME = 601, + RBAC_PERM_COMMAND_QUEST = 602, + RBAC_PERM_COMMAND_QUEST_ADD = 603, + RBAC_PERM_COMMAND_QUEST_COMPLETE = 604, + RBAC_PERM_COMMAND_QUEST_REMOVE = 605, + RBAC_PERM_COMMAND_QUEST_REWARD = 606, + RBAC_PERM_COMMANDS_RELOAD = 607, + RBAC_PERM_COMMANDS_RELOAD_ACCESS_REQUIREMENT = 608, + RBAC_PERM_COMMANDS_RELOAD_ACHIEVEMENT_CRITERIA_DATA = 609, + RBAC_PERM_COMMANDS_RELOAD_ACHIEVEMENT_REWARD = 610, + RBAC_PERM_COMMANDS_RELOAD_ALL = 611, + RBAC_PERM_COMMANDS_RELOAD_ALL_ACHIEVEMENT = 612, + RBAC_PERM_COMMANDS_RELOAD_ALL_AREA = 613, + RBAC_PERM_COMMANDS_RELOAD_ALL_EVENTAI = 614, + RBAC_PERM_COMMANDS_RELOAD_ALL_GOSSIP = 615, + RBAC_PERM_COMMANDS_RELOAD_ALL_ITEM = 616, + RBAC_PERM_COMMANDS_RELOAD_ALL_LOCALES = 617, + RBAC_PERM_COMMANDS_RELOAD_ALL_LOOT = 618, + RBAC_PERM_COMMANDS_RELOAD_ALL_NPC = 619, + RBAC_PERM_COMMANDS_RELOAD_ALL_QUEST = 620, + RBAC_PERM_COMMANDS_RELOAD_ALL_SCRIPTS = 621, + RBAC_PERM_COMMANDS_RELOAD_ALL_SPELL = 622, + RBAC_PERM_COMMANDS_RELOAD_AREATRIGGER_INVOLVEDRELATION = 623, + RBAC_PERM_COMMANDS_RELOAD_AREATRIGGER_TAVERN = 624, + RBAC_PERM_COMMANDS_RELOAD_AREATRIGGER_TELEPORT = 625, + RBAC_PERM_COMMANDS_RELOAD_AUCTIONS = 626, + RBAC_PERM_COMMANDS_RELOAD_AUTOBROADCAST = 627, + RBAC_PERM_COMMANDS_RELOAD_COMMAND = 628, + RBAC_PERM_COMMANDS_RELOAD_CONDITIONS = 629, + RBAC_PERM_COMMANDS_RELOAD_CONFIG = 630, + RBAC_PERM_COMMANDS_RELOAD_CREATURE_AI_SCRIPTS = 631, + RBAC_PERM_COMMANDS_RELOAD_CREATURE_AI_TEXTS = 632, + RBAC_PERM_COMMANDS_RELOAD_CREATURE_LINKED_RESPAWN = 633, + RBAC_PERM_COMMANDS_RELOAD_CREATURE_LOOT_TEMPLATE = 634, + RBAC_PERM_COMMANDS_RELOAD_CREATURE_ONKILL_REPUTATION = 635, + RBAC_PERM_COMMANDS_RELOAD_CREATURE_QUESTENDER = 636, + RBAC_PERM_COMMANDS_RELOAD_CREATURE_QUESTSTARTER = 637, + RBAC_PERM_COMMANDS_RELOAD_CREATURE_SUMMON_GROUPS = 638, + RBAC_PERM_COMMANDS_RELOAD_CREATURE_TEMPLATE = 639, + RBAC_PERM_COMMANDS_RELOAD_CREATURE_TEXT = 640, + RBAC_PERM_COMMANDS_RELOAD_DISABLES = 641, + RBAC_PERM_COMMANDS_RELOAD_DISENCHANT_LOOT_TEMPLATE = 642, + RBAC_PERM_COMMANDS_RELOAD_EVENT_SCRIPTS = 643, + RBAC_PERM_COMMANDS_RELOAD_FISHING_LOOT_TEMPLATE = 644, + RBAC_PERM_COMMANDS_RELOAD_GAME_GRAVEYARD_ZONE = 645, + RBAC_PERM_COMMANDS_RELOAD_GAMEOBJECT_QUESTENDER = 646, + RBAC_PERM_COMMANDS_RELOAD_GAMEOBJECT_QUEST_LOOT_TEMPLATE = 647, + RBAC_PERM_COMMANDS_RELOAD_GAMEOBJECT_QUESTSTARTER = 648, + RBAC_PERM_COMMANDS_RELOAD_GAME_TELE = 649, + RBAC_PERM_COMMANDS_RELOAD_GM_TICKETS = 650, + RBAC_PERM_COMMANDS_RELOAD_GOSSIP_MENU = 651, + RBAC_PERM_COMMANDS_RELOAD_GOSSIP_MENU_OPTION = 652, + RBAC_PERM_COMMANDS_RELOAD_ITEM_ENCHANTMENT_TEMPLATE = 653, + RBAC_PERM_COMMANDS_RELOAD_ITEM_LOOT_TEMPLATE = 654, + RBAC_PERM_COMMANDS_RELOAD_ITEM_SET_NAMES = 655, + RBAC_PERM_COMMANDS_RELOAD_LFG_DUNGEON_REWARDS = 656, + RBAC_PERM_COMMANDS_RELOAD_LOCALES_ACHIEVEMENT_REWARD = 657, + RBAC_PERM_COMMANDS_RELOAD_LOCALES_CRETURE = 658, + RBAC_PERM_COMMANDS_RELOAD_LOCALES_CRETURE_TEXT = 659, + RBAC_PERM_COMMANDS_RELOAD_LOCALES_GAMEOBJECT = 660, + RBAC_PERM_COMMANDS_RELOAD_LOCALES_GOSSIP_MENU_OPTION = 661, + RBAC_PERM_COMMANDS_RELOAD_LOCALES_ITEM = 662, + RBAC_PERM_COMMANDS_RELOAD_LOCALES_ITEM_SET_NAME = 663, + RBAC_PERM_COMMANDS_RELOAD_LOCALES_NPC_TEXT = 664, + RBAC_PERM_COMMANDS_RELOAD_LOCALES_PAGE_TEXT = 665, + RBAC_PERM_COMMANDS_RELOAD_LOCALES_POINTS_OF_INTEREST = 666, + RBAC_PERM_COMMANDS_RELOAD_LOCALES_QUEST = 667, + RBAC_PERM_COMMANDS_RELOAD_MAIL_LEVEL_REWARD = 668, + RBAC_PERM_COMMANDS_RELOAD_MAIL_LOOT_TEMPLATE = 669, + RBAC_PERM_COMMANDS_RELOAD_MILLING_LOOT_TEMPLATE = 670, + RBAC_PERM_COMMANDS_RELOAD_NPC_SPELLCLICK_SPELLS = 671, + RBAC_PERM_COMMANDS_RELOAD_NPC_TRAINER = 672, + RBAC_PERM_COMMANDS_RELOAD_NPC_VENDOR = 673, + RBAC_PERM_COMMANDS_RELOAD_PAGE_TEXT = 674, + RBAC_PERM_COMMANDS_RELOAD_PICKPOCKETING_LOOT_TEMPLATE = 675, + RBAC_PERM_COMMANDS_RELOAD_POINTS_OF_INTEREST = 676, + RBAC_PERM_COMMANDS_RELOAD_PROSPECTING_LOOT_TEMPLATE = 677, + RBAC_PERM_COMMANDS_RELOAD_QUEST_POI = 678, + RBAC_PERM_COMMANDS_RELOAD_QUEST_TEMPLATE = 679, + RBAC_PERM_COMMANDS_RELOAD_RBAC = 680, + RBAC_PERM_COMMANDS_RELOAD_REFERENCE_LOOT_TEMPLATE = 681, + RBAC_PERM_COMMANDS_RELOAD_REPUTATION_REWARD_RATE = 682, + RBAC_PERM_COMMANDS_RELOAD_RESERVED_NAME = 683, + RBAC_PERM_COMMANDS_RELOAD_SKILL_DISCOVERY_TEMPLATE = 684, + RBAC_PERM_COMMANDS_RELOAD_SKILL_EXTRA_ITEM_TEMPLATE = 685, + RBAC_PERM_COMMANDS_RELOAD_SKILL_FISHING_BASE_LEVEL = 686, + RBAC_PERM_COMMANDS_RELOAD_SKINNING_LOOT_TEMPLATE = 687, + RBAC_PERM_COMMANDS_RELOAD_SMART_SCRIPTS = 688, + RBAC_PERM_COMMANDS_RELOAD_SPELL_AREA = 689, + RBAC_PERM_COMMANDS_RELOAD_SPELL_BONUS_DATA = 690, + RBAC_PERM_COMMANDS_RELOAD_SPELL_GROUP = 691, + RBAC_PERM_COMMANDS_RELOAD_SPELL_GROUP_STACK_RULES = 692, + RBAC_PERM_COMMANDS_RELOAD_SPELL_LEARN_SPELL = 693, + RBAC_PERM_COMMANDS_RELOAD_SPELL_LINKED_SPELL = 694, + RBAC_PERM_COMMANDS_RELOAD_SPELL_LOOT_TEMPLATE = 695, + RBAC_PERM_COMMANDS_RELOAD_SPELL_PET_AURAS = 696, + RBAC_PERM_COMMANDS_RELOAD_SPELL_PROC = 697, + RBAC_PERM_COMMANDS_RELOAD_SPELL_PROC_EVENT = 698, + RBAC_PERM_COMMANDS_RELOAD_SPELL_REQUIRED = 699, + RBAC_PERM_COMMANDS_RELOAD_SPELL_SCRIPTS = 700, + RBAC_PERM_COMMANDS_RELOAD_SPELL_TARGET_POSITION = 701, + RBAC_PERM_COMMANDS_RELOAD_SPELL_THREATS = 702, + RBAC_PERM_COMMANDS_RELOAD_SPILLOVER_TEMPLATE = 703, + RBAC_PERM_COMMANDS_RELOAD_TRINITY_STRING = 704, + RBAC_PERM_COMMANDS_RELOAD_VEHICLE_ACCESORY = 705, + RBAC_PERM_COMMANDS_RELOAD_VEHICLE_TEMPLATE_ACCESSORY = 706, + RBAC_PERM_COMMANDS_RELOAD_WARDEN_ACTION = 707, + RBAC_PERM_COMMANDS_RELOAD_WAYPOINT_DATA = 708, + RBAC_PERM_COMMANDS_RELOAD_WAYPOINT_SCRIPTS = 709, + RBAC_PERM_COMMAND_RESET = 710, + RBAC_PERM_COMMAND_RESET_ACHIEVEMENTS = 711, + RBAC_PERM_COMMAND_RESET_HONOR = 712, + RBAC_PERM_COMMAND_RESET_LEVEL = 713, + RBAC_PERM_COMMAND_RESET_SPELLS = 714, + RBAC_PERM_COMMAND_RESET_STATS = 715, + RBAC_PERM_COMMAND_RESET_TALENTS = 716, + RBAC_PERM_COMMAND_RESET_ALL = 717, + RBAC_PERM_COMMAND_SERVER = 718, + RBAC_PERM_COMMAND_SERVER_CORPSES = 719, + RBAC_PERM_COMMAND_SERVER_EXIT = 720, + RBAC_PERM_COMMAND_SERVER_IDLERESTART = 721, + RBAC_PERM_COMMAND_SERVER_IDLERESTART_CANCEL = 722, + RBAC_PERM_COMMAND_SERVER_IDLESHUTDOWN = 723, + RBAC_PERM_COMMAND_SERVER_IDLESHUTDOWN_CANCEL = 724, + RBAC_PERM_COMMAND_SERVER_INFO = 725, + RBAC_PERM_COMMAND_SERVER_PLIMIT = 726, + RBAC_PERM_COMMAND_SERVER_RESTART = 727, + RBAC_PERM_COMMAND_SERVER_RESTART_CANCEL = 728, + RBAC_PERM_COMMAND_SERVER_SET = 729, + RBAC_PERM_COMMAND_SERVER_SET_CLOSED = 730, + RBAC_PERM_COMMAND_SERVER_SET_DIFFTIME = 731, + RBAC_PERM_COMMAND_SERVER_SET_LOGLEVEL = 732, + RBAC_PERM_COMMAND_SERVER_SET_MOTD = 733, + RBAC_PERM_COMMAND_SERVER_SHUTDOWN = 734, + RBAC_PERM_COMMAND_SERVER_SHUTDOWN_CANCEL = 735, + RBAC_PERM_COMMAND_SERVER_MOTD = 736, + + // custom permissions 1000+ + RBAC_PERM_MAX +}; + +enum RBACCommandResult +{ + RBAC_OK, + RBAC_CANT_ADD_ALREADY_ADDED, + RBAC_CANT_REVOKE_NOT_IN_LIST, + RBAC_IN_GRANTED_LIST, + RBAC_IN_DENIED_LIST, + RBAC_ID_DOES_NOT_EXISTS +}; + +typedef std::bitset RBACPermissionContainer; +typedef std::set RBACRoleContainer; +typedef std::set RBACGroupContainer; + +class RBACObject +{ + public: + RBACObject(uint32 id = 0, std::string const& name = ""): + _id(id), _name(name) { } + + virtual ~RBACObject() { } + + /// Gets the Name of the Object + std::string const& GetName() const { return _name; } + /// Gets the Id of the Object + uint32 GetId() const { return _id; } + + private: + uint32 _id; ///> id of the object + std::string _name; ///> name of the object +}; + +/// Permission: Defines an autorization to perform certain operation +class RBACPermission: public RBACObject +{ + public: + RBACPermission(uint32 id = 0, std::string const& name = ""): + RBACObject(id, name) { } +}; + +/// Set of Permissions +class RBACRole: public RBACObject +{ + public: + RBACRole(uint32 id = 0, std::string const& name = ""): + RBACObject(id, name) { } + + /// Gets the Permissions assigned to this role + RBACPermissionContainer const& GetPermissions() const { return _perms; } + /// Grants a Permission (Adds) + void GrantPermission(uint32 id); + /// Revokes a Permission (Removes) + void RevokePermission(uint32 id); + + private: + RBACPermissionContainer _perms; ///> Set of permissions +}; + +/// Set of Roles +class RBACGroup: public RBACObject +{ + public: + RBACGroup(uint32 id = 0, std::string const& name = ""): + RBACObject(id, name) { } + + /// Gets the Roles assigned to this group + RBACRoleContainer const& GetRoles() const { return _roles; } + /// Grants a Role (Adds) + void GrantRole(uint32 role); + /// Revokes a Role (Removes) + void RevokeRole(uint32 role); + + private: + RBACRoleContainer _roles; ///> Set of Roles +}; + +/** + * @name RBACData + * @brief Contains all needed information about the acccount + * + * This class contains all the data needed to calculate the account permissions. + * RBACDAta is formed by group permissions and user permissions through: + * - Granted Groups, which contains roles, which contains permissions: Set of granted permissions + * - Granted Roles, which contains permissions: Set of granted permissions + * - Denied Roles, which contains permissions: Set of denied permissions + * - Granted Permissions + * - Denied Permissions + * + * Calculation of current Permissions: Granted permissions - Denied permissions + * - Granted permissions: through groups, through roles and directly assigned + * - Denied permissions: through roles and directly assigned + */ +class RBACData: public RBACObject +{ + public: + RBACData(uint32 id, std::string const& name, int32 realmId): + RBACObject(id, name), _realmId(realmId) { } + + /** + * @name HasPermission + * @brief Checks if certain action is allowed + * + * Checks if certain action can be performed. + * + * @return grant or deny action + * + * Example Usage: + * @code + * bool Player::CanJoinArena(Battleground* bg) + * { + * return bg->isArena() && HasPermission(RBAC_PERM_JOIN_ARENA); + * } + * @endcode + */ + bool HasPermission(uint32 permission) const { return _globalPerms.test(permission); } + + // Functions enabled to be used by command system + /// Returns all the granted permissions (after computation) + RBACPermissionContainer const& GetPermissions() const { return _globalPerms; } + /// Returns all the granted permissions + RBACPermissionContainer const& GetGrantedPermissions() const { return _grantedPerms; } + /// Returns all the denied permissions + RBACPermissionContainer const& GetDeniedPermissions() const { return _deniedPerms; } + /// Returns all the granted roles + RBACRoleContainer const& GetGrantedRoles() const { return _grantedRoles; } + /// Returns all the denied roles + RBACRoleContainer const& GetDeniedRoles() const { return _deniedRoles; } + /// Returns all the granted groups + RBACGroupContainer const& GetGroups() const { return _groups; } + + /** + * @name AddGroup + * @brief Adds new group + * + * Add a new group to the account. If realm is 0 or the group can not be added + * No save to db action will be performed. + * + * Fails if group Id does not exists or group already present + * + * @param groupId group to be added + * @param realmId realm affected + * + * @return Success or failure (with reason) to add the group + * + * Example Usage: + * @code + * // previously defined "RBACData* rbac" with proper initialization + * uint32 groupId = 2; + * if (rbac->AddGroup(groupId) == RBAC_OK) + * TC_LOG_DEBUG(LOG_FILTER_PLAYER, "Group %u succesfully added", groupId); + * @endcode + */ + RBACCommandResult AddGroup(uint32 groupId, int32 realmId = 0); + + /** + * @name RemoveGroup + * @brief Removes a group + * + * Removes a group from the account. If realm is 0 or the group can not be removed + * No save to db action will be performed. Any delete operation will always affect + * "all realms (-1)" in addition to the realm specified + * + * Fails if group not present + * + * @param groupId group to be removed + * @param realmId realm affected + * + * @return Success or failure (with reason) to remove the group + * + * Example Usage: + * // previously defined "RBACData* rbac" with proper initialization + * uint32 groupId = 2; + * if (rbac->RemoveGroup(groupId) == RBAC_OK) + * TC_LOG_DEBUG(LOG_FILTER_PLAYER, "Group %u succesfully removed", groupId); + * @endcode + */ + RBACCommandResult RemoveGroup(uint32 groupId, int32 realmId = 0); + + /** + * @name GrantRole + * @brief Grants a role + * + * Grants a role to the account. If realm is 0 or the role can not be added + * No save to db action will be performed. + * + * Fails if role Id does not exists or role already granted or denied + * + * @param roleId role to be granted + * @param realmId realm affected + * + * @return Success or failure (with reason) to grant the role + * + * Example Usage: + * // previously defined "RBACData* rbac" with proper initialization + * uint32 roleId = 2; + * if (rbac->GrantRole(roleId) == RBAC_IN_DENIED_LIST) + * TC_LOG_DEBUG(LOG_FILTER_PLAYER, "Failed to grant role %u, already denied", roleId); + * @endcode + */ + RBACCommandResult GrantRole(uint32 roleId, int32 realmId = 0); + + /** + * @name DenyRole + * @brief Denies a role + * + * Denied a role to the account. If realm is 0 or the role can not be added + * No save to db action will be performed. + * + * Fails if role Id does not exists or role already granted or denied + * + * @param roleId role to be denied + * @param realmId realm affected + * + * @return Success or failure (with reason) to deny the role + * + * Example Usage: + * // previously defined "RBACData* rbac" with proper initialization + * uint32 roleId = 2; + * if (rbac->DenyRole(roleId) == RBAC_ID_DOES_NOT_EXISTS) + * TC_LOG_DEBUG(LOG_FILTER_PLAYER, "Role Id %u does not exists", roleId); + * @endcode + */ + RBACCommandResult DenyRole(uint32 roleId, int32 realmId = 0); + + /** + * @name RevokeRole + * @brief Removes a role + * + * Removes a role from the account. If realm is 0 or the role can not be removed + * No save to db action will be performed. Any delete operation will always affect + * "all realms (-1)" in addition to the realm specified + * + * Fails if role not present + * + * @param roleId role to be removed + * @param realmId realm affected + * + * @return Success or failure (with reason) to remove the role + * + * Example Usage: + * // previously defined "RBACData* rbac" with proper initialization + * uint32 roleId = 2; + * if (rbac->RevokeRole(roleId) == RBAC_OK) + * TC_LOG_DEBUG(LOG_FILTER_PLAYER, "Role %u succesfully removed", roleId); + * @endcode + */ + RBACCommandResult RevokeRole(uint32 roleId, int32 realmId = 0); + + /** + * @name GrantRole + * @brief Grants a permission + * + * Grants a permission to the account. If realm is 0 or the permission can not be added + * No save to db action will be performed. + * + * Fails if permission Id does not exists or permission already granted or denied + * + * @param permissionId permission to be granted + * @param realmId realm affected + * + * @return Success or failure (with reason) to grant the permission + * + * Example Usage: + * // previously defined "RBACData* rbac" with proper initialization + * uint32 permissionId = 2; + * if (rbac->GrantRole(permissionId) == RBAC_IN_DENIED_LIST) + * TC_LOG_DEBUG(LOG_FILTER_PLAYER, "Failed to grant permission %u, already denied", permissionId); + * @endcode + */ + RBACCommandResult GrantPermission(uint32 permissionId, int32 realmId = 0); + + /** + * @name DenyPermission + * @brief Denies a permission + * + * Denied a permission to the account. If realm is 0 or the permission can not be added + * No save to db action will be performed. + * + * Fails if permission Id does not exists or permission already granted or denied + * + * @param permissionId permission to be denied + * @param realmId realm affected + * + * @return Success or failure (with reason) to deny the permission + * + * Example Usage: + * // previously defined "RBACData* rbac" with proper initialization + * uint32 permissionId = 2; + * if (rbac->DenyRole(permissionId) == RBAC_ID_DOES_NOT_EXISTS) + * TC_LOG_DEBUG(LOG_FILTER_PLAYER, "Role Id %u does not exists", permissionId); + * @endcode + */ + RBACCommandResult DenyPermission(uint32 permissionId, int32 realmId = 0); + + /** + * @name RevokePermission + * @brief Removes a permission + * + * Removes a permission from the account. If realm is 0 or the permission can not be removed + * No save to db action will be performed. Any delete operation will always affect + * "all realms (-1)" in addition to the realm specified + * + * Fails if permission not present + * + * @param permissionId permission to be removed + * @param realmId realm affected + * + * @return Success or failure (with reason) to remove the permission + * + * Example Usage: + * // previously defined "RBACData* rbac" with proper initialization + * uint32 permissionId = 2; + * if (rbac->RevokeRole(permissionId) == RBAC_OK) + * TC_LOG_DEBUG(LOG_FILTER_PLAYER, "Permission %u succesfully removed", permissionId); + * @endcode + */ + RBACCommandResult RevokePermission(uint32 permissionId, int32 realmId = 0); + + /// Loads all permissions, groups and roles assigned to current account + void LoadFromDB(); + private: + /// Saves a role to DB, Granted or Denied + void SaveRole(uint32 role, bool granted, int32 realm); + /// Saves a permission to DB, Granted or Denied + void SavePermission(uint32 role, bool granted, int32 realm); + + /** + * @name CalculateNewPermissions + * @brief Calculates new permissions + * + * Calculates new permissions after some change in groups, roles or permissions. + * The calculation is done Granted - Denied: + * - Granted permissions: through groups, through roles and directly assigned + * - Denied permissions: through roles and directly assigned + */ + void CalculateNewPermissions(); + + int32 GetRealmId() { return _realmId; } + + int32 _realmId; ///> RealmId Affected + RBACGroupContainer _groups; ///> Granted groups + RBACRoleContainer _grantedRoles; ///> Granted roles + RBACRoleContainer _deniedRoles; ///> Denied roles + RBACPermissionContainer _grantedPerms; ///> Granted permissions + RBACPermissionContainer _deniedPerms; ///> Denied permissions + RBACPermissionContainer _globalPerms; ///> Calculated permissions +}; + +#endif diff --git a/src/server/scripts/Commands/cs_server.cpp b/src/server/scripts/Commands/cs_server.cpp index 34543a1a4a5..71f232d33a6 100644 --- a/src/server/scripts/Commands/cs_server.cpp +++ b/src/server/scripts/Commands/cs_server.cpp @@ -39,60 +39,60 @@ public: { static ChatCommand serverIdleRestartCommandTable[] = { - { "cancel", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleServerShutDownCancelCommand, "", NULL }, - { "" , RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleServerIdleRestartCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "cancel", RBAC_PERM_COMMAND_SERVER_IDLERESTART_CANCEL, true, &HandleServerShutDownCancelCommand, "", NULL }, + { "" , RBAC_PERM_COMMAND_SERVER_IDLERESTART, true, &HandleServerIdleRestartCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand serverIdleShutdownCommandTable[] = { - { "cancel", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleServerShutDownCancelCommand, "", NULL }, - { "" , RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleServerIdleShutDownCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "cancel", RBAC_PERM_COMMAND_SERVER_IDLESHUTDOWN_CANCEL, true, &HandleServerShutDownCancelCommand, "", NULL }, + { "" , RBAC_PERM_COMMAND_SERVER_IDLESHUTDOWN, true, &HandleServerIdleShutDownCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand serverRestartCommandTable[] = { - { "cancel", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleServerShutDownCancelCommand, "", NULL }, - { "" , RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleServerRestartCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "cancel", RBAC_PERM_COMMAND_SERVER_RESTART_CANCEL, true, &HandleServerShutDownCancelCommand, "", NULL }, + { "" , RBAC_PERM_COMMAND_SERVER_RESTART, true, &HandleServerRestartCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand serverShutdownCommandTable[] = { - { "cancel", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleServerShutDownCancelCommand, "", NULL }, - { "" , RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleServerShutDownCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "cancel", RBAC_PERM_COMMAND_SERVER_SHUTDOWN_CANCEL, true, &HandleServerShutDownCancelCommand, "", NULL }, + { "" , RBAC_PERM_COMMAND_SERVER_SHUTDOWN, true, &HandleServerShutDownCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand serverSetCommandTable[] = { - { "difftime", RBAC_PERM_CONSOLE_COMMANDS, true, &HandleServerSetDiffTimeCommand, "", NULL }, - { "loglevel", RBAC_PERM_CONSOLE_COMMANDS, true, &HandleServerSetLogLevelCommand, "", NULL }, - { "motd", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleServerSetMotdCommand, "", NULL }, - { "closed", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleServerSetClosedCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "difftime", RBAC_PERM_COMMAND_SERVER_SET_DIFFTIME, true, &HandleServerSetDiffTimeCommand, "", NULL }, + { "loglevel", RBAC_PERM_COMMAND_SERVER_SET_LOGLEVEL, true, &HandleServerSetLogLevelCommand, "", NULL }, + { "motd", RBAC_PERM_COMMAND_SERVER_SET_MOTD, true, &HandleServerSetMotdCommand, "", NULL }, + { "closed", RBAC_PERM_COMMAND_SERVER_SET_CLOSED, true, &HandleServerSetClosedCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand serverCommandTable[] = { - { "corpses", RBAC_PERM_GAMEMASTER_COMMANDS, true, &HandleServerCorpsesCommand, "", NULL }, - { "exit", RBAC_PERM_CONSOLE_COMMANDS, true, &HandleServerExitCommand, "", NULL }, - { "idlerestart", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, NULL, "", serverIdleRestartCommandTable }, - { "idleshutdown", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, NULL, "", serverIdleShutdownCommandTable }, - { "info", RBAC_PERM_PLAYER_COMMANDS, true, &HandleServerInfoCommand, "", NULL }, - { "motd", RBAC_PERM_PLAYER_COMMANDS, true, &HandleServerMotdCommand, "", NULL }, - { "plimit", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleServerPLimitCommand, "", NULL }, - { "restart", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, NULL, "", serverRestartCommandTable }, - { "shutdown", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, NULL, "", serverShutdownCommandTable }, - { "set", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, NULL, "", serverSetCommandTable }, - { NULL, 0, false, NULL, "", NULL } + { "corpses", RBAC_PERM_COMMAND_SERVER_CORPSES, true, &HandleServerCorpsesCommand, "", NULL }, + { "exit", RBAC_PERM_COMMAND_SERVER_EXIT, true, &HandleServerExitCommand, "", NULL }, + { "idlerestart", RBAC_PERM_COMMAND_SERVER_IDLERESTART, true, NULL, "", serverIdleRestartCommandTable }, + { "idleshutdown", RBAC_PERM_COMMAND_SERVER_IDLESHUTDOWN, true, NULL, "", serverIdleShutdownCommandTable }, + { "info", RBAC_PERM_COMMAND_SERVER_INFO, true, &HandleServerInfoCommand, "", NULL }, + { "motd", RBAC_PERM_COMMAND_SERVER_MOTD, true, &HandleServerMotdCommand, "", NULL }, + { "plimit", RBAC_PERM_COMMAND_SERVER_PLIMIT, true, &HandleServerPLimitCommand, "", NULL }, + { "restart", RBAC_PERM_COMMAND_SERVER_RESTART, true, NULL, "", serverRestartCommandTable }, + { "shutdown", RBAC_PERM_COMMAND_SERVER_SHUTDOWN, true, NULL, "", serverShutdownCommandTable }, + { "set", RBAC_PERM_COMMAND_SERVER_SET, true, NULL, "", serverSetCommandTable }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand commandTable[] = { - { "server", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, NULL, "", serverCommandTable }, - { NULL, 0, false, NULL, "", NULL } + { "server", RBAC_PERM_COMMAND_SERVER, true, NULL, "", serverCommandTable }, + { NULL, 0, false, NULL, "", NULL } }; return commandTable; } -- cgit v1.2.3 From 68ab10ccd4b3358ddff4644a2350906d598b2424 Mon Sep 17 00:00:00 2001 From: Spp Date: Tue, 10 Sep 2013 15:01:39 +0200 Subject: Core/RBAC: Move tele commands to RBAC (using individual permissions) --- sql/updates/auth/2013_09_10_11_auth_misc.sql | 20 ++++++++++++++++++++ sql/updates/world/2013_09_10_13_world_command.sql | 10 ++++++++++ src/server/game/Accounts/RBAC.h | 5 +++++ src/server/scripts/Commands/cs_tele.cpp | 16 ++++++++-------- 4 files changed, 43 insertions(+), 8 deletions(-) create mode 100644 sql/updates/auth/2013_09_10_11_auth_misc.sql create mode 100644 sql/updates/world/2013_09_10_13_world_command.sql (limited to 'sql') diff --git a/sql/updates/auth/2013_09_10_11_auth_misc.sql b/sql/updates/auth/2013_09_10_11_auth_misc.sql new file mode 100644 index 00000000000..011f1219547 --- /dev/null +++ b/sql/updates/auth/2013_09_10_11_auth_misc.sql @@ -0,0 +1,20 @@ +/* cs_tele.cpp */ + +SET @id = 737; + +-- Add new permissions +DELETE FROM `rbac_permissions` WHERE `id` BETWEEN @id AND @id+4; +INSERT INTO `rbac_permissions` (`id`, `name`) VALUES +(@id+0, 'tele'), +(@id+1, 'tele add'), +(@id+2, 'tele del'), +(@id+3, 'tele name'), +(@id+4, 'tele group'); + +-- Add permissions to "corresponding Commands Role" +DELETE FROM `rbac_role_permissions` WHERE `permissionId` BETWEEN @id AND @id+4; +INSERT INTO `rbac_role_permissions` (`roleId`, `permissionId`) VALUES +(4, @id+0), +(4, @id+1), +(4, @id+3), +(4, @id+4); diff --git a/sql/updates/world/2013_09_10_13_world_command.sql b/sql/updates/world/2013_09_10_13_world_command.sql new file mode 100644 index 00000000000..a81b90f21bb --- /dev/null +++ b/sql/updates/world/2013_09_10_13_world_command.sql @@ -0,0 +1,10 @@ +/* cs_tele.cpp */ + +SET @id = 737; + +-- Update command table with new RBAC permissions +UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'tele'; +UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'tele add'; +UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'tele del'; +UPDATE `command` SET `permission` = @id+3 WHERE `name` = 'tele name'; +UPDATE `command` SET `permission` = @id+4 WHERE `name` = 'tele group'; diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h index 6fa8f2c600a..bee4606ebe0 100644 --- a/src/server/game/Accounts/RBAC.h +++ b/src/server/game/Accounts/RBAC.h @@ -636,6 +636,11 @@ enum RBACPermissions RBAC_PERM_COMMAND_SERVER_SHUTDOWN = 734, RBAC_PERM_COMMAND_SERVER_SHUTDOWN_CANCEL = 735, RBAC_PERM_COMMAND_SERVER_MOTD = 736, + RBAC_PERM_COMMAND_TELE = 737, + RBAC_PERM_COMMAND_TELE_ADD = 738, + RBAC_PERM_COMMAND_TELE_DEL = 739, + RBAC_PERM_COMMAND_TELE_NAME = 740, + RBAC_PERM_COMMAND_TELE_GROUP = 741, // custom permissions 1000+ RBAC_PERM_MAX diff --git a/src/server/scripts/Commands/cs_tele.cpp b/src/server/scripts/Commands/cs_tele.cpp index 9dc013a995f..dec9895af26 100644 --- a/src/server/scripts/Commands/cs_tele.cpp +++ b/src/server/scripts/Commands/cs_tele.cpp @@ -39,17 +39,17 @@ public: { static ChatCommand teleCommandTable[] = { - { "add", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleTeleAddCommand, "", NULL }, - { "del", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleTeleDelCommand, "", NULL }, - { "name", RBAC_PERM_MODERATOR_COMMANDS, true, &HandleTeleNameCommand, "", NULL }, - { "group", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleTeleGroupCommand, "", NULL }, - { "", RBAC_PERM_MODERATOR_COMMANDS, false, &HandleTeleCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "add", RBAC_PERM_COMMAND_TELE_ADD, false, &HandleTeleAddCommand, "", NULL }, + { "del", RBAC_PERM_COMMAND_TELE_DEL, true, &HandleTeleDelCommand, "", NULL }, + { "name", RBAC_PERM_COMMAND_TELE_NAME, true, &HandleTeleNameCommand, "", NULL }, + { "group", RBAC_PERM_COMMAND_TELE_GROUP, false, &HandleTeleGroupCommand, "", NULL }, + { "", RBAC_PERM_COMMAND_TELE, false, &HandleTeleCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand commandTable[] = { - { "tele", RBAC_PERM_MODERATOR_COMMANDS, false, NULL, "", teleCommandTable }, - { NULL, 0, false, NULL, "", NULL } + { "tele", RBAC_PERM_COMMAND_TELE, false, NULL, "", teleCommandTable }, + { NULL, 0, false, NULL, "", NULL } }; return commandTable; } -- cgit v1.2.3 From b10241876e6c9d45fb1582bdcf553bcb24262df7 Mon Sep 17 00:00:00 2001 From: Spp Date: Tue, 10 Sep 2013 15:13:08 +0200 Subject: Core/RBAC: Move ticket commands to RBAC (using individual permissions) --- sql/updates/auth/2013_09_10_11_auth_misc.sql | 7 ++-- sql/updates/auth/2013_09_10_12_auth_misc.sql | 49 +++++++++++++++++++++++ sql/updates/world/2013_09_10_14_world_command.sql | 25 ++++++++++++ src/server/game/Accounts/RBAC.h | 19 +++++++++ src/server/scripts/Commands/cs_ticket.cpp | 44 ++++++++++---------- 5 files changed, 119 insertions(+), 25 deletions(-) create mode 100644 sql/updates/auth/2013_09_10_12_auth_misc.sql create mode 100644 sql/updates/world/2013_09_10_14_world_command.sql (limited to 'sql') diff --git a/sql/updates/auth/2013_09_10_11_auth_misc.sql b/sql/updates/auth/2013_09_10_11_auth_misc.sql index 011f1219547..e92c1cb3fae 100644 --- a/sql/updates/auth/2013_09_10_11_auth_misc.sql +++ b/sql/updates/auth/2013_09_10_11_auth_misc.sql @@ -14,7 +14,8 @@ INSERT INTO `rbac_permissions` (`id`, `name`) VALUES -- Add permissions to "corresponding Commands Role" DELETE FROM `rbac_role_permissions` WHERE `permissionId` BETWEEN @id AND @id+4; INSERT INTO `rbac_role_permissions` (`roleId`, `permissionId`) VALUES -(4, @id+0), +(2, @id+0), (4, @id+1), -(4, @id+3), -(4, @id+4); +(4, @id+2), +(2, @id+3), +(2, @id+4); diff --git a/sql/updates/auth/2013_09_10_12_auth_misc.sql b/sql/updates/auth/2013_09_10_12_auth_misc.sql new file mode 100644 index 00000000000..fbf78e175c6 --- /dev/null +++ b/sql/updates/auth/2013_09_10_12_auth_misc.sql @@ -0,0 +1,49 @@ +/* cs_ticket.cpp */ + +SET @id = 742; + +-- Add new permissions +DELETE FROM `rbac_permissions` WHERE `id` BETWEEN @id AND @id+18; +INSERT INTO `rbac_permissions` (`id`, `name`) VALUES +(@id+0, 'ticket'), +(@id+1, 'ticket assign'), +(@id+2, 'ticket close'), +(@id+3, 'ticket closedlist'), +(@id+4, 'ticket comment'), +(@id+5, 'ticket complete'), +(@id+6, 'ticket delete'), +(@id+7, 'ticket escalate'), +(@id+8, 'ticket escalatedlist'), +(@id+9, 'ticket list'), +(@id+10, 'ticket onlinelist'), +(@id+11, 'ticket reset'), +(@id+12, 'ticket response'), +(@id+13, 'ticket response append'), +(@id+14, 'ticket response appendln'), +(@id+15, 'ticket togglesystem'), +(@id+16, 'ticket unassign'), +(@id+17, 'ticket viewid'), +(@id+18, 'ticket viewname'); + +-- Add permissions to "corresponding Commands Role" +DELETE FROM `rbac_role_permissions` WHERE `permissionId` BETWEEN @id AND @id+18; +INSERT INTO `rbac_role_permissions` (`roleId`, `permissionId`) VALUES +(2, @id+0), +(3, @id+1), +(2, @id+2), +(2, @id+3), +(2, @id+4), +(2, @id+5), +(4, @id+6), +(2, @id+7), +(3, @id+8), +(2, @id+9), +(2, @id+10), +(4, @id+11), +(2, @id+12), +(2, @id+13), +(2, @id+14), +(4, @id+15), +(3, @id+16), +(2, @id+17), +(2, @id+18); diff --git a/sql/updates/world/2013_09_10_14_world_command.sql b/sql/updates/world/2013_09_10_14_world_command.sql new file mode 100644 index 00000000000..853dcc77fe0 --- /dev/null +++ b/sql/updates/world/2013_09_10_14_world_command.sql @@ -0,0 +1,25 @@ +/* cs_ticket.cpp */ + +SET @id = 742; + +-- Update command table with new RBAC permissions +UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'tele'; +UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'ticket'; +UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'ticket assign'; +UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'ticket close'; +UPDATE `command` SET `permission` = @id+3 WHERE `name` = 'ticket closedlist'; +UPDATE `command` SET `permission` = @id+4 WHERE `name` = 'ticket comment'; +UPDATE `command` SET `permission` = @id+5 WHERE `name` = 'ticket complete'; +UPDATE `command` SET `permission` = @id+6 WHERE `name` = 'ticket delete'; +UPDATE `command` SET `permission` = @id+7 WHERE `name` = 'ticket escalate'; +UPDATE `command` SET `permission` = @id+8 WHERE `name` = 'ticket escalatedlist'; +UPDATE `command` SET `permission` = @id+9 WHERE `name` = 'ticket list'; +UPDATE `command` SET `permission` = @id+10 WHERE `name` = 'ticket onlinelist'; +UPDATE `command` SET `permission` = @id+11 WHERE `name` = 'ticket reset'; +UPDATE `command` SET `permission` = @id+12 WHERE `name` = 'ticket response'; +UPDATE `command` SET `permission` = @id+13 WHERE `name` = 'ticket response append'; +UPDATE `command` SET `permission` = @id+14 WHERE `name` = 'ticket response appendln'; +UPDATE `command` SET `permission` = @id+15 WHERE `name` = 'ticket togglesystem'; +UPDATE `command` SET `permission` = @id+16 WHERE `name` = 'ticket unassign'; +UPDATE `command` SET `permission` = @id+17 WHERE `name` = 'ticket viewid'; +UPDATE `command` SET `permission` = @id+18 WHERE `name` = 'ticket viewname'; diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h index bee4606ebe0..f2a96145957 100644 --- a/src/server/game/Accounts/RBAC.h +++ b/src/server/game/Accounts/RBAC.h @@ -641,6 +641,25 @@ enum RBACPermissions RBAC_PERM_COMMAND_TELE_DEL = 739, RBAC_PERM_COMMAND_TELE_NAME = 740, RBAC_PERM_COMMAND_TELE_GROUP = 741, + RBAC_PERM_COMMAND_TICKET = 742, + RBAC_PERM_COMMAND_TICKET_ASSIGN = 743, + RBAC_PERM_COMMAND_TICKET_CLOSE = 744, + RBAC_PERM_COMMAND_TICKET_CLOSEDLIST = 745, + RBAC_PERM_COMMAND_TICKET_COMMENT = 746, + RBAC_PERM_COMMAND_TICKET_COMPLETE = 747, + RBAC_PERM_COMMAND_TICKET_DELETE = 748, + RBAC_PERM_COMMAND_TICKET_ESCALATE = 749, + RBAC_PERM_COMMAND_TICKET_ESCALATEDLIST = 750, + RBAC_PERM_COMMAND_TICKET_LIST = 751, + RBAC_PERM_COMMAND_TICKET_ONLINELIST = 752, + RBAC_PERM_COMMAND_TICKET_RESET = 753, + RBAC_PERM_COMMAND_TICKET_RESPONSE = 754, + RBAC_PERM_COMMAND_TICKET_RESPONSE_APPEND = 755, + RBAC_PERM_COMMAND_TICKET_RESPONSE_APPENDLN = 756, + RBAC_PERM_COMMAND_TICKET_TOGGLESYSTEM = 757, + RBAC_PERM_COMMAND_TICKET_UNASSIGN = 758, + RBAC_PERM_COMMAND_TICKET_VIEWID = 759, + RBAC_PERM_COMMAND_TICKET_VIEWNAME = 760, // custom permissions 1000+ RBAC_PERM_MAX diff --git a/src/server/scripts/Commands/cs_ticket.cpp b/src/server/scripts/Commands/cs_ticket.cpp index 5c1ce304723..1c60a8143b4 100644 --- a/src/server/scripts/Commands/cs_ticket.cpp +++ b/src/server/scripts/Commands/cs_ticket.cpp @@ -40,34 +40,34 @@ public: { static ChatCommand ticketResponseCommandTable[] = { - { "append", RBAC_PERM_MODERATOR_COMMANDS, true, &HandleGMTicketResponseAppendCommand, "", NULL }, - { "appendln", RBAC_PERM_MODERATOR_COMMANDS, true, &HandleGMTicketResponseAppendLnCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "append", RBAC_PERM_COMMAND_TICKET_RESPONSE_APPEND, true, &HandleGMTicketResponseAppendCommand, "", NULL }, + { "appendln", RBAC_PERM_COMMAND_TICKET_RESPONSE_APPENDLN, true, &HandleGMTicketResponseAppendLnCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand ticketCommandTable[] = { - { "assign", RBAC_PERM_GAMEMASTER_COMMANDS, true, &HandleGMTicketAssignToCommand, "", NULL }, - { "close", RBAC_PERM_MODERATOR_COMMANDS, true, &HandleGMTicketCloseByIdCommand, "", NULL }, - { "closedlist", RBAC_PERM_MODERATOR_COMMANDS, true, &HandleGMTicketListClosedCommand, "", NULL }, - { "comment", RBAC_PERM_MODERATOR_COMMANDS, true, &HandleGMTicketCommentCommand, "", NULL }, - { "complete", RBAC_PERM_MODERATOR_COMMANDS, true, &HandleGMTicketCompleteCommand, "", NULL }, - { "delete", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleGMTicketDeleteByIdCommand, "", NULL }, - { "escalate", RBAC_PERM_MODERATOR_COMMANDS, true, &HandleGMTicketEscalateCommand, "", NULL }, - { "escalatedlist", RBAC_PERM_GAMEMASTER_COMMANDS, true, &HandleGMTicketListEscalatedCommand, "", NULL }, - { "list", RBAC_PERM_MODERATOR_COMMANDS, true, &HandleGMTicketListCommand, "", NULL }, - { "onlinelist", RBAC_PERM_MODERATOR_COMMANDS, true, &HandleGMTicketListOnlineCommand, "", NULL }, - { "reset", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleGMTicketResetCommand, "", NULL }, - { "response", RBAC_PERM_MODERATOR_COMMANDS, true, NULL, "", ticketResponseCommandTable }, - { "togglesystem", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleToggleGMTicketSystem, "", NULL }, - { "unassign", RBAC_PERM_GAMEMASTER_COMMANDS, true, &HandleGMTicketUnAssignCommand, "", NULL }, - { "viewid", RBAC_PERM_MODERATOR_COMMANDS, true, &HandleGMTicketGetByIdCommand, "", NULL }, - { "viewname", RBAC_PERM_MODERATOR_COMMANDS, true, &HandleGMTicketGetByNameCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "assign", RBAC_PERM_COMMAND_TICKET_ASSIGN, true, &HandleGMTicketAssignToCommand, "", NULL }, + { "close", RBAC_PERM_COMMAND_TICKET_CLOSE, true, &HandleGMTicketCloseByIdCommand, "", NULL }, + { "closedlist", RBAC_PERM_COMMAND_TICKET_CLOSEDLIST, true, &HandleGMTicketListClosedCommand, "", NULL }, + { "comment", RBAC_PERM_COMMAND_TICKET_COMMENT, true, &HandleGMTicketCommentCommand, "", NULL }, + { "complete", RBAC_PERM_COMMAND_TICKET_COMPLETE, true, &HandleGMTicketCompleteCommand, "", NULL }, + { "delete", RBAC_PERM_COMMAND_TICKET_DELETE, true, &HandleGMTicketDeleteByIdCommand, "", NULL }, + { "escalate", RBAC_PERM_COMMAND_TICKET_ESCALATE, true, &HandleGMTicketEscalateCommand, "", NULL }, + { "escalatedlist", RBAC_PERM_COMMAND_TICKET_ESCALATEDLIST, true, &HandleGMTicketListEscalatedCommand, "", NULL }, + { "list", RBAC_PERM_COMMAND_TICKET_LIST, true, &HandleGMTicketListCommand, "", NULL }, + { "onlinelist", RBAC_PERM_COMMAND_TICKET_ONLINELIST, true, &HandleGMTicketListOnlineCommand, "", NULL }, + { "reset", RBAC_PERM_COMMAND_TICKET_RESET, true, &HandleGMTicketResetCommand, "", NULL }, + { "response", RBAC_PERM_COMMAND_TICKET_RESPONSE, true, NULL, "", ticketResponseCommandTable }, + { "togglesystem", RBAC_PERM_COMMAND_TICKET_TOGGLESYSTEM, true, &HandleToggleGMTicketSystem, "", NULL }, + { "unassign", RBAC_PERM_COMMAND_TICKET_UNASSIGN, true, &HandleGMTicketUnAssignCommand, "", NULL }, + { "viewid", RBAC_PERM_COMMAND_TICKET_VIEWID, true, &HandleGMTicketGetByIdCommand, "", NULL }, + { "viewname", RBAC_PERM_COMMAND_TICKET_VIEWNAME, true, &HandleGMTicketGetByNameCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand commandTable[] = { - { "ticket", RBAC_PERM_MODERATOR_COMMANDS, false, NULL, "", ticketCommandTable }, - { NULL, 0, false, NULL, "", NULL } + { "ticket", RBAC_PERM_COMMAND_TICKET, false, NULL, "", ticketCommandTable }, + { NULL, 0, false, NULL, "", NULL } }; return commandTable; } -- cgit v1.2.3 From 78363e11b51c42c7f1d7a9598629531bb353a8ad Mon Sep 17 00:00:00 2001 From: Spp Date: Tue, 10 Sep 2013 15:26:48 +0200 Subject: Core/RBAC: Move titles and wp commands to RBAC (using individual permissions) --- sql/updates/auth/2013_09_10_13_auth_misc.sql | 39 +++++++++++++++++++++++ sql/updates/world/2013_09_10_15_world_command.sql | 25 +++++++++++++++ src/server/game/Accounts/RBAC.h | 14 ++++++++ src/server/scripts/Commands/cs_titles.cpp | 18 +++++------ src/server/scripts/Commands/cs_wp.cpp | 20 ++++++------ 5 files changed, 97 insertions(+), 19 deletions(-) create mode 100644 sql/updates/auth/2013_09_10_13_auth_misc.sql create mode 100644 sql/updates/world/2013_09_10_15_world_command.sql (limited to 'sql') diff --git a/sql/updates/auth/2013_09_10_13_auth_misc.sql b/sql/updates/auth/2013_09_10_13_auth_misc.sql new file mode 100644 index 00000000000..825028dcb5a --- /dev/null +++ b/sql/updates/auth/2013_09_10_13_auth_misc.sql @@ -0,0 +1,39 @@ +/* cs_titles.cpp & cs_wp.cpp */ + +SET @id = 761; + +-- Add new permissions +DELETE FROM `rbac_permissions` WHERE `id` BETWEEN @id AND @id+13; +INSERT INTO `rbac_permissions` (`id`, `name`) VALUES +(@id+0, 'titles'), +(@id+1, 'titles add'), +(@id+2, 'titles current'), +(@id+3, 'titles remove'), +(@id+4, 'titles set'), +(@id+5, 'titles set mask'), +(@id+6, 'titles wp'), +(@id+7, 'titles wp add'), +(@id+8, 'titles wp event'), +(@id+9, 'titles wp load'), +(@id+10, 'titles wp modify'), +(@id+11, 'titles wp unload'), +(@id+12, 'titles wp reload'), +(@id+13, 'titles wp show'); + +-- Add permissions to "corresponding Commands Role" +DELETE FROM `rbac_role_permissions` WHERE `permissionId` BETWEEN @id AND @id+13; +INSERT INTO `rbac_role_permissions` (`roleId`, `permissionId`) VALUES +(3, @id+0), +(3, @id+1), +(3, @id+2), +(3, @id+3), +(3, @id+4), +(3, @id+5), +(3, @id+6), +(3, @id+7), +(3, @id+8), +(3, @id+9), +(3, @id+10), +(3, @id+11), +(4, @id+12), +(3, @id+13); diff --git a/sql/updates/world/2013_09_10_15_world_command.sql b/sql/updates/world/2013_09_10_15_world_command.sql new file mode 100644 index 00000000000..f3601a3041b --- /dev/null +++ b/sql/updates/world/2013_09_10_15_world_command.sql @@ -0,0 +1,25 @@ +/* cs_titles.cpp & cs_wp.cpp */ + +SET @id = 761; + +-- Update command table with new RBAC permissions +UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'tele'; +UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'ticket'; +UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'ticket assign'; +UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'ticket close'; +UPDATE `command` SET `permission` = @id+3 WHERE `name` = 'ticket closedlist'; +UPDATE `command` SET `permission` = @id+4 WHERE `name` = 'ticket comment'; +UPDATE `command` SET `permission` = @id+5 WHERE `name` = 'ticket complete'; +UPDATE `command` SET `permission` = @id+6 WHERE `name` = 'ticket delete'; +UPDATE `command` SET `permission` = @id+7 WHERE `name` = 'ticket escalate'; +UPDATE `command` SET `permission` = @id+8 WHERE `name` = 'ticket escalatedlist'; +UPDATE `command` SET `permission` = @id+9 WHERE `name` = 'ticket list'; +UPDATE `command` SET `permission` = @id+10 WHERE `name` = 'ticket onlinelist'; +UPDATE `command` SET `permission` = @id+11 WHERE `name` = 'ticket reset'; +UPDATE `command` SET `permission` = @id+12 WHERE `name` = 'ticket response'; +UPDATE `command` SET `permission` = @id+13 WHERE `name` = 'ticket response append'; +UPDATE `command` SET `permission` = @id+14 WHERE `name` = 'ticket response appendln'; +UPDATE `command` SET `permission` = @id+15 WHERE `name` = 'ticket togglesystem'; +UPDATE `command` SET `permission` = @id+16 WHERE `name` = 'ticket unassign'; +UPDATE `command` SET `permission` = @id+17 WHERE `name` = 'ticket viewid'; +UPDATE `command` SET `permission` = @id+18 WHERE `name` = 'ticket viewname'; diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h index f2a96145957..3d28ccca9da 100644 --- a/src/server/game/Accounts/RBAC.h +++ b/src/server/game/Accounts/RBAC.h @@ -660,6 +660,20 @@ enum RBACPermissions RBAC_PERM_COMMAND_TICKET_UNASSIGN = 758, RBAC_PERM_COMMAND_TICKET_VIEWID = 759, RBAC_PERM_COMMAND_TICKET_VIEWNAME = 760, + RBAC_PERM_COMMAND_TITLES = 761, + RBAC_PERM_COMMAND_TITLES_ADD = 762, + RBAC_PERM_COMMAND_TITLES_CURRENT = 763, + RBAC_PERM_COMMAND_TITLES_REMOVE = 764, + RBAC_PERM_COMMAND_TITLES_SET = 765, + RBAC_PERM_COMMAND_TITLES_SET_MASK = 766, + RBAC_PERM_COMMAND_WP = 767, + RBAC_PERM_COMMAND_WP_ADD = 768, + RBAC_PERM_COMMAND_WP_EVENT = 769, + RBAC_PERM_COMMAND_WP_LOAD = 770, + RBAC_PERM_COMMAND_WP_MODIFY = 771, + RBAC_PERM_COMMAND_WP_UNLOAD = 772, + RBAC_PERM_COMMAND_WP_RELOAD = 773, + RBAC_PERM_COMMAND_WP_SHOW = 774, // custom permissions 1000+ RBAC_PERM_MAX diff --git a/src/server/scripts/Commands/cs_titles.cpp b/src/server/scripts/Commands/cs_titles.cpp index 1ffb7206f68..f6fd3170bbc 100644 --- a/src/server/scripts/Commands/cs_titles.cpp +++ b/src/server/scripts/Commands/cs_titles.cpp @@ -37,21 +37,21 @@ public: { static ChatCommand titlesSetCommandTable[] = { - { "mask", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleTitlesSetMaskCommand, "", NULL }, - { NULL, RBAC_PERM_PLAYER_COMMANDS, false, NULL, "", NULL } + { "mask", RBAC_PERM_COMMAND_TITLES_SET_MASK, false, &HandleTitlesSetMaskCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand titlesCommandTable[] = { - { "add", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleTitlesAddCommand, "", NULL }, - { "current", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleTitlesCurrentCommand, "", NULL }, - { "remove", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleTitlesRemoveCommand, "", NULL }, - { "set", RBAC_PERM_GAMEMASTER_COMMANDS, false, NULL, "", titlesSetCommandTable }, - { NULL, RBAC_PERM_PLAYER_COMMANDS, false, NULL, "", NULL } + { "add", RBAC_PERM_COMMAND_TITLES_ADD, false, &HandleTitlesAddCommand, "", NULL }, + { "current", RBAC_PERM_COMMAND_TITLES_CURRENT, false, &HandleTitlesCurrentCommand, "", NULL }, + { "remove", RBAC_PERM_COMMAND_TITLES_REMOVE, false, &HandleTitlesRemoveCommand, "", NULL }, + { "set", RBAC_PERM_COMMAND_TITLES_SET, false, NULL, "", titlesSetCommandTable }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand commandTable[] = { - { "titles", RBAC_PERM_GAMEMASTER_COMMANDS, false, NULL, "", titlesCommandTable }, - { NULL, RBAC_PERM_PLAYER_COMMANDS, false, NULL, "", NULL } + { "titles", RBAC_PERM_COMMAND_TITLES, false, NULL, "", titlesCommandTable }, + { NULL, 0, false, NULL, "", NULL } }; return commandTable; } diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp index 834c0e1b266..b1b6030a892 100644 --- a/src/server/scripts/Commands/cs_wp.cpp +++ b/src/server/scripts/Commands/cs_wp.cpp @@ -38,19 +38,19 @@ public: { static ChatCommand wpCommandTable[] = { - { "add", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleWpAddCommand, "", NULL }, - { "event", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleWpEventCommand, "", NULL }, - { "load", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleWpLoadCommand, "", NULL }, - { "modify", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleWpModifyCommand, "", NULL }, - { "unload", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleWpUnLoadCommand, "", NULL }, - { "reload", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleWpReloadCommand, "", NULL }, - { "show", RBAC_PERM_GAMEMASTER_COMMANDS, false, &HandleWpShowCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "add", RBAC_PERM_COMMAND_WP_ADD, false, &HandleWpAddCommand, "", NULL }, + { "event", RBAC_PERM_COMMAND_WP_EVENT, false, &HandleWpEventCommand, "", NULL }, + { "load", RBAC_PERM_COMMAND_WP_LOAD, false, &HandleWpLoadCommand, "", NULL }, + { "modify", RBAC_PERM_COMMAND_WP_MODIFY, false, &HandleWpModifyCommand, "", NULL }, + { "unload", RBAC_PERM_COMMAND_WP_UNLOAD, false, &HandleWpUnLoadCommand, "", NULL }, + { "reload", RBAC_PERM_COMMAND_WP_RELOAD, false, &HandleWpReloadCommand, "", NULL }, + { "show", RBAC_PERM_COMMAND_WP_SHOW, false, &HandleWpShowCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand commandTable[] = { - { "wp", RBAC_PERM_GAMEMASTER_COMMANDS, false, NULL, "", wpCommandTable }, - { NULL, 0, false, NULL, "", NULL } + { "wp", RBAC_PERM_COMMAND_WP, false, NULL, "", wpCommandTable }, + { NULL, 0, false, NULL, "", NULL } }; return commandTable; } -- cgit v1.2.3 From 953575abfa631b9c58d8a8acc1fc8a37359f6fa6 Mon Sep 17 00:00:00 2001 From: Spp Date: Tue, 10 Sep 2013 15:35:10 +0200 Subject: Core/RBAC: Remove obsolete generic command permissions Note: If you have any custom command, CHECK THE SQLS BEFORE APPLYING --- sql/updates/auth/2013_09_10_14_auth_misc.sql | 4 ++++ sql/updates/world/2013_09_10_15_world_command.sql | 1 - sql/updates/world/2013_09_10_16_world_command.sql | 2 ++ src/server/game/Accounts/RBAC.h | 11 ++++++----- 4 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 sql/updates/auth/2013_09_10_14_auth_misc.sql create mode 100644 sql/updates/world/2013_09_10_16_world_command.sql (limited to 'sql') diff --git a/sql/updates/auth/2013_09_10_14_auth_misc.sql b/sql/updates/auth/2013_09_10_14_auth_misc.sql new file mode 100644 index 00000000000..0f24f96ca99 --- /dev/null +++ b/sql/updates/auth/2013_09_10_14_auth_misc.sql @@ -0,0 +1,4 @@ +-- Remove obsolete permissions + +DELETE FROM `rbac_role_permissions` WHERE `permissionId` IN (7, 8, 9, 10, 12); +DELETE FROM `rbac_permissions` WHERE `id` IN (7, 8, 9, 10, 12); diff --git a/sql/updates/world/2013_09_10_15_world_command.sql b/sql/updates/world/2013_09_10_15_world_command.sql index f3601a3041b..ff70ba9b18d 100644 --- a/sql/updates/world/2013_09_10_15_world_command.sql +++ b/sql/updates/world/2013_09_10_15_world_command.sql @@ -3,7 +3,6 @@ SET @id = 761; -- Update command table with new RBAC permissions -UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'tele'; UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'ticket'; UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'ticket assign'; UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'ticket close'; diff --git a/sql/updates/world/2013_09_10_16_world_command.sql b/sql/updates/world/2013_09_10_16_world_command.sql new file mode 100644 index 00000000000..3a3baf206b8 --- /dev/null +++ b/sql/updates/world/2013_09_10_16_world_command.sql @@ -0,0 +1,2 @@ +-- Update command table and remove obsolete permissions (0 = non existent permission) +UPDATE `command` SET `permission` = 0 WHERE `permission` IN (7, 8, 9, 10, 12); diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h index 3d28ccca9da..c97bb391022 100644 --- a/src/server/game/Accounts/RBAC.h +++ b/src/server/game/Accounts/RBAC.h @@ -54,12 +54,12 @@ enum RBACPermissions RBAC_PERM_JOIN_RANDOM_BG = 4, RBAC_PERM_JOIN_ARENAS = 5, RBAC_PERM_JOIN_DUNGEON_FINDER = 6, - RBAC_PERM_PLAYER_COMMANDS = 7, - RBAC_PERM_MODERATOR_COMMANDS = 8, - RBAC_PERM_GAMEMASTER_COMMANDS = 9, - RBAC_PERM_ADMINISTRATOR_COMMANDS = 10, + // 7 - reuse + // 8 - reuse + // 9 - reuse + // 10 - reuse RBAC_PERM_LOG_GM_TRADE = 11, - RBAC_PERM_CONSOLE_COMMANDS = 12, // Not pressent in DB + // 12 - reuse RBAC_PERM_SKIP_CHECK_INSTANCE_REQUIRED_BOSSES = 13, RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_TEAMMASK = 14, RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_CLASSMASK = 15, @@ -99,6 +99,7 @@ enum RBACPermissions RBAC_PERM_EMAIL_CONFIRM_FOR_PASS_CHANGE = 49, RBAC_PERM_MAY_CHECK_OWN_EMAIL = 50, // Leave some space for core permissions + RBAC_PERM_COMMAND_RBAC = 200, RBAC_PERM_COMMAND_RBAC_ACC = 201, RBAC_PERM_COMMAND_RBAC_ACC_GROUP = 202, -- cgit v1.2.3 From 0ed83024e0c4771f82096dcb9da032c7adcdad53 Mon Sep 17 00:00:00 2001 From: Spp Date: Tue, 10 Sep 2013 15:47:17 +0200 Subject: Core/RBAC: Fix typos in recent SQL files --- sql/updates/auth/2013_09_10_13_auth_misc.sql | 16 +++++------ sql/updates/world/2013_09_10_14_world_command.sql | 1 - sql/updates/world/2013_09_10_15_world_command.sql | 33 ++++++++++------------- 3 files changed, 22 insertions(+), 28 deletions(-) (limited to 'sql') diff --git a/sql/updates/auth/2013_09_10_13_auth_misc.sql b/sql/updates/auth/2013_09_10_13_auth_misc.sql index 825028dcb5a..becedad564d 100644 --- a/sql/updates/auth/2013_09_10_13_auth_misc.sql +++ b/sql/updates/auth/2013_09_10_13_auth_misc.sql @@ -11,14 +11,14 @@ INSERT INTO `rbac_permissions` (`id`, `name`) VALUES (@id+3, 'titles remove'), (@id+4, 'titles set'), (@id+5, 'titles set mask'), -(@id+6, 'titles wp'), -(@id+7, 'titles wp add'), -(@id+8, 'titles wp event'), -(@id+9, 'titles wp load'), -(@id+10, 'titles wp modify'), -(@id+11, 'titles wp unload'), -(@id+12, 'titles wp reload'), -(@id+13, 'titles wp show'); +(@id+6, 'wp'), +(@id+7, 'wp add'), +(@id+8, 'wp event'), +(@id+9, 'wp load'), +(@id+10, 'wp modify'), +(@id+11, 'wp unload'), +(@id+12, 'wp reload'), +(@id+13, 'wp show'); -- Add permissions to "corresponding Commands Role" DELETE FROM `rbac_role_permissions` WHERE `permissionId` BETWEEN @id AND @id+13; diff --git a/sql/updates/world/2013_09_10_14_world_command.sql b/sql/updates/world/2013_09_10_14_world_command.sql index 853dcc77fe0..36723992ed0 100644 --- a/sql/updates/world/2013_09_10_14_world_command.sql +++ b/sql/updates/world/2013_09_10_14_world_command.sql @@ -3,7 +3,6 @@ SET @id = 742; -- Update command table with new RBAC permissions -UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'tele'; UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'ticket'; UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'ticket assign'; UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'ticket close'; diff --git a/sql/updates/world/2013_09_10_15_world_command.sql b/sql/updates/world/2013_09_10_15_world_command.sql index ff70ba9b18d..1f90dfdf2a4 100644 --- a/sql/updates/world/2013_09_10_15_world_command.sql +++ b/sql/updates/world/2013_09_10_15_world_command.sql @@ -3,22 +3,17 @@ SET @id = 761; -- Update command table with new RBAC permissions -UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'ticket'; -UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'ticket assign'; -UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'ticket close'; -UPDATE `command` SET `permission` = @id+3 WHERE `name` = 'ticket closedlist'; -UPDATE `command` SET `permission` = @id+4 WHERE `name` = 'ticket comment'; -UPDATE `command` SET `permission` = @id+5 WHERE `name` = 'ticket complete'; -UPDATE `command` SET `permission` = @id+6 WHERE `name` = 'ticket delete'; -UPDATE `command` SET `permission` = @id+7 WHERE `name` = 'ticket escalate'; -UPDATE `command` SET `permission` = @id+8 WHERE `name` = 'ticket escalatedlist'; -UPDATE `command` SET `permission` = @id+9 WHERE `name` = 'ticket list'; -UPDATE `command` SET `permission` = @id+10 WHERE `name` = 'ticket onlinelist'; -UPDATE `command` SET `permission` = @id+11 WHERE `name` = 'ticket reset'; -UPDATE `command` SET `permission` = @id+12 WHERE `name` = 'ticket response'; -UPDATE `command` SET `permission` = @id+13 WHERE `name` = 'ticket response append'; -UPDATE `command` SET `permission` = @id+14 WHERE `name` = 'ticket response appendln'; -UPDATE `command` SET `permission` = @id+15 WHERE `name` = 'ticket togglesystem'; -UPDATE `command` SET `permission` = @id+16 WHERE `name` = 'ticket unassign'; -UPDATE `command` SET `permission` = @id+17 WHERE `name` = 'ticket viewid'; -UPDATE `command` SET `permission` = @id+18 WHERE `name` = 'ticket viewname'; +UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'titles'; +UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'titles add'; +UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'titles current'; +UPDATE `command` SET `permission` = @id+3 WHERE `name` = 'titles remove'; +UPDATE `command` SET `permission` = @id+4 WHERE `name` = 'titles set'; +UPDATE `command` SET `permission` = @id+5 WHERE `name` = 'titles set mask'; +UPDATE `command` SET `permission` = @id+6 WHERE `name` = 'wp'; +UPDATE `command` SET `permission` = @id+7 WHERE `name` = 'wp add'; +UPDATE `command` SET `permission` = @id+8 WHERE `name` = 'wp event'; +UPDATE `command` SET `permission` = @id+9 WHERE `name` = 'wp load'; +UPDATE `command` SET `permission` = @id+10 WHERE `name` = 'wp modify'; +UPDATE `command` SET `permission` = @id+11 WHERE `name` = 'wp unload'; +UPDATE `command` SET `permission` = @id+12 WHERE `name` = 'wp reload'; +UPDATE `command` SET `permission` = @id+13 WHERE `name` = 'wp show'; -- cgit v1.2.3 From c70eda3234186bce389fece833b600d1f3141557 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Tue, 10 Sep 2013 16:17:47 +0200 Subject: Core/RBAC: Fix typos in recent SQL files --- sql/updates/world/2013_08_30_02_world_command.sql | 30 +++++++++++------------ 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'sql') diff --git a/sql/updates/world/2013_08_30_02_world_command.sql b/sql/updates/world/2013_08_30_02_world_command.sql index 7cf91342101..b6d859d5b45 100644 --- a/sql/updates/world/2013_08_30_02_world_command.sql +++ b/sql/updates/world/2013_08_30_02_world_command.sql @@ -1,16 +1,16 @@ -- Update command table with new RBAC permissions -UPDATE `command` SET `permission` = 201 WHERE `name` = '.rbac account'; -UPDATE `command` SET `permission` = 202 WHERE `name` = '.rbac account group'; -UPDATE `command` SET `permission` = 203 WHERE `name` = '.rbac account group add'; -UPDATE `command` SET `permission` = 204 WHERE `name` = '.rbac account group remove'; -UPDATE `command` SET `permission` = 205 WHERE `name` = '.rbac account role'; -UPDATE `command` SET `permission` = 206 WHERE `name` = '.rbac account role grant'; -UPDATE `command` SET `permission` = 207 WHERE `name` = '.rbac account role deny'; -UPDATE `command` SET `permission` = 208 WHERE `name` = '.rbac account role revoke'; -UPDATE `command` SET `permission` = 209 WHERE `name` = '.rbac account permission'; -UPDATE `command` SET `permission` = 210 WHERE `name` = '.rbac account permission grant'; -UPDATE `command` SET `permission` = 211 WHERE `name` = '.rbac account permission deny'; -UPDATE `command` SET `permission` = 212 WHERE `name` = '.rbac account permission revoke'; -UPDATE `command` SET `permission` = 214 WHERE `name` = '.rbac account list groups'; -UPDATE `command` SET `permission` = 215 WHERE `name` = '.rbac account list roles'; -UPDATE `command` SET `permission` = 216 WHERE `name` = '.rbac account list permissions'; +UPDATE `command` SET `permission` = 201 WHERE `name` = 'rbac account'; +UPDATE `command` SET `permission` = 202 WHERE `name` = 'rbac account group'; +UPDATE `command` SET `permission` = 203 WHERE `name` = 'rbac account group add'; +UPDATE `command` SET `permission` = 204 WHERE `name` = 'rbac account group remove'; +UPDATE `command` SET `permission` = 205 WHERE `name` = 'rbac account role'; +UPDATE `command` SET `permission` = 206 WHERE `name` = 'rbac account role grant'; +UPDATE `command` SET `permission` = 207 WHERE `name` = 'rbac account role deny'; +UPDATE `command` SET `permission` = 208 WHERE `name` = 'rbac account role revoke'; +UPDATE `command` SET `permission` = 209 WHERE `name` = 'rbac account permission'; +UPDATE `command` SET `permission` = 210 WHERE `name` = 'rbac account permission grant'; +UPDATE `command` SET `permission` = 211 WHERE `name` = 'rbac account permission deny'; +UPDATE `command` SET `permission` = 212 WHERE `name` = 'rbac account permission revoke'; +UPDATE `command` SET `permission` = 214 WHERE `name` = 'rbac account list groups'; +UPDATE `command` SET `permission` = 215 WHERE `name` = 'rbac account list roles'; +UPDATE `command` SET `permission` = 216 WHERE `name` = 'rbac account list permissions'; -- cgit v1.2.3 From 6ec94e41777df3a2f018011785fd13e187013a61 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Tue, 10 Sep 2013 16:20:10 +0200 Subject: Core/RBAC: Fix typos in recent SQL files --- sql/updates/world/2013_09_10_17_world_command.sql | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 sql/updates/world/2013_09_10_17_world_command.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_10_17_world_command.sql b/sql/updates/world/2013_09_10_17_world_command.sql new file mode 100644 index 00000000000..b6d859d5b45 --- /dev/null +++ b/sql/updates/world/2013_09_10_17_world_command.sql @@ -0,0 +1,16 @@ +-- Update command table with new RBAC permissions +UPDATE `command` SET `permission` = 201 WHERE `name` = 'rbac account'; +UPDATE `command` SET `permission` = 202 WHERE `name` = 'rbac account group'; +UPDATE `command` SET `permission` = 203 WHERE `name` = 'rbac account group add'; +UPDATE `command` SET `permission` = 204 WHERE `name` = 'rbac account group remove'; +UPDATE `command` SET `permission` = 205 WHERE `name` = 'rbac account role'; +UPDATE `command` SET `permission` = 206 WHERE `name` = 'rbac account role grant'; +UPDATE `command` SET `permission` = 207 WHERE `name` = 'rbac account role deny'; +UPDATE `command` SET `permission` = 208 WHERE `name` = 'rbac account role revoke'; +UPDATE `command` SET `permission` = 209 WHERE `name` = 'rbac account permission'; +UPDATE `command` SET `permission` = 210 WHERE `name` = 'rbac account permission grant'; +UPDATE `command` SET `permission` = 211 WHERE `name` = 'rbac account permission deny'; +UPDATE `command` SET `permission` = 212 WHERE `name` = 'rbac account permission revoke'; +UPDATE `command` SET `permission` = 214 WHERE `name` = 'rbac account list groups'; +UPDATE `command` SET `permission` = 215 WHERE `name` = 'rbac account list roles'; +UPDATE `command` SET `permission` = 216 WHERE `name` = 'rbac account list permissions'; -- cgit v1.2.3 From f65be0d30da1679496de1d2f8f8c4e14b6980371 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Tue, 10 Sep 2013 16:38:04 +0200 Subject: Core/RBAC: Fix typos in recent SQL files --- sql/updates/world/2013_09_10_18_world_command.sql | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 sql/updates/world/2013_09_10_18_world_command.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_10_18_world_command.sql b/sql/updates/world/2013_09_10_18_world_command.sql new file mode 100644 index 00000000000..8fa30cc3851 --- /dev/null +++ b/sql/updates/world/2013_09_10_18_world_command.sql @@ -0,0 +1,9 @@ +UPDATE `command` SET `permission`=214 WHERE `name`='rbac list groups'; +UPDATE `command` SET `permission`=215 WHERE `name`='rbac list roles'; +UPDATE `command` SET `permission`=216 WHERE `name`='rbac list permissions'; +UPDATE `command` SET `permission`=262 WHERE `name`='bf enable'; +UPDATE `command` SET `permission`=576 WHERE `name`='npc delete'; +UPDATE `command` SET `permission`=577 WHERE `name`='npc delete item'; +UPDATE `command` SET `permission`=578 WHERE `name`='npc follow'; +UPDATE `command` SET `permission`=579 WHERE `name`='npc follow stop'; +UPDATE `command` SET `permission`=316 WHERE `name`='debug play cinematic'; -- cgit v1.2.3 From 4d6adbbb1b8768d1031b46aa9e5cb158b5e50128 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Tue, 10 Sep 2013 18:20:36 +0200 Subject: Core/RBAC: Fix typos in recent SQL files --- sql/updates/world/2013_09_10_19_world_command.sql | 66 +++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 sql/updates/world/2013_09_10_19_world_command.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_10_19_world_command.sql b/sql/updates/world/2013_09_10_19_world_command.sql new file mode 100644 index 00000000000..8efdbd3353f --- /dev/null +++ b/sql/updates/world/2013_09_10_19_world_command.sql @@ -0,0 +1,66 @@ +DELETE FROM `command` WHERE `name` = 'account email'; +DELETE FROM `command` WHERE `name` = 'account set sec email'; +DELETE FROM `command` WHERE `name` = 'account set sec regmail'; + +INSERT INTO `command` (`name`, `permission`, `help`) VALUES +('account email', 263, 'Syntax: .account email $oldemail $currentpassword $newemail $newemailconfirmation\r\n\r\n Change your account email. You may need to check the actual security mode to see if email input is necessary for password change'), +('account set sec email', 265, 'Syntax: .account set sec email $accountname $email $emailconfirmation\r\n\r\nSet the email for entered player account.'), +('account set sec regmail', 266, 'Syntax: .account set sec regmail $account $regmail $regmailconfirmation\r\n\r\nSets the regmail for entered player account.'); + +/* cs_cast.cpp */ + +SET @id = 267; + +-- Update command table with new RBAC permissions +UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'cast'; +UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'cast back'; +UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'cast dist'; +UPDATE `command` SET `permission` = @id+3 WHERE `name` = 'cast self'; +UPDATE `command` SET `permission` = @id+4 WHERE `name` = 'cast target'; +UPDATE `command` SET `permission` = @id+5 WHERE `name` = 'cast dest'; + +/* cs_go.cpp */ + +SET @id = 377; + +-- Update command table with new RBAC permissions +UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'go'; +UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'go creature'; +UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'go graveyard'; +UPDATE `command` SET `permission` = @id+3 WHERE `name` = 'go grid'; +UPDATE `command` SET `permission` = @id+4 WHERE `name` = 'go object'; +UPDATE `command` SET `permission` = @id+5 WHERE `name` = 'go taxinode'; +UPDATE `command` SET `permission` = @id+6 WHERE `name` = 'go ticket'; +UPDATE `command` SET `permission` = @id+7 WHERE `name` = 'go trigger'; +UPDATE `command` SET `permission` = @id+8 WHERE `name` = 'go xyz'; +UPDATE `command` SET `permission` = @id+9 WHERE `name` = 'go zonexy'; + +/* cs_gobject.cpp */ + +SET @id = 387; + +-- Update command table with new RBAC permissions +UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'gobject'; +UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'gobject activate'; +UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'gobject add'; +UPDATE `command` SET `permission` = @id+3 WHERE `name` = 'gobject add temp'; +UPDATE `command` SET `permission` = @id+4 WHERE `name` = 'gobject delete'; +UPDATE `command` SET `permission` = @id+5 WHERE `name` = 'gobject info'; +UPDATE `command` SET `permission` = @id+6 WHERE `name` = 'gobject move'; +UPDATE `command` SET `permission` = @id+7 WHERE `name` = 'gobject near'; +UPDATE `command` SET `permission` = @id+8 WHERE `name` = 'gobject set'; +UPDATE `command` SET `permission` = @id+9 WHERE `name` = 'gobject set phase'; +UPDATE `command` SET `permission` = @id+10 WHERE `name` = 'gobject set state'; +UPDATE `command` SET `permission` = @id+11 WHERE `name` = 'gobject target'; +UPDATE `command` SET `permission` = @id+12 WHERE `name` = 'gobject turn'; + +/* cs_instance.cpp */ + +SET @id = 412; + +-- Update command table with new RBAC permissions +UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'instance'; +UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'instance listbinds'; +UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'instance unbind'; +UPDATE `command` SET `permission` = @id+3 WHERE `name` = 'instance stats'; +UPDATE `command` SET `permission` = @id+4 WHERE `name` = 'instance savedata'; -- cgit v1.2.3 From d617969d22547b74f674c529f7301bd764990e91 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Tue, 10 Sep 2013 18:21:32 +0200 Subject: Core/RBAC: Fix typos in recent SQL files I hope this is final one.... --- sql/updates/auth/2013_09_10_15_auth_misc.sql | 92 ++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 sql/updates/auth/2013_09_10_15_auth_misc.sql (limited to 'sql') diff --git a/sql/updates/auth/2013_09_10_15_auth_misc.sql b/sql/updates/auth/2013_09_10_15_auth_misc.sql new file mode 100644 index 00000000000..8280024f74c --- /dev/null +++ b/sql/updates/auth/2013_09_10_15_auth_misc.sql @@ -0,0 +1,92 @@ +/* account email */ +SET @amail = 263; + +-- Add new permissions for account mail +DELETE FROM `rbac_permissions` WHERE `id` = @amail; +INSERT INTO `rbac_permissions` (`id`, `name`) VALUES +(@amail, 'account email'); + +-- Add permissions to "corresponding Commands Role" +DELETE FROM `rbac_role_permissions` WHERE `permissionId` = @amail; +INSERT INTO `rbac_role_permissions` (`roleId`, `permissionId`) VALUES +(1, @amail), +(2, @amail), +(3, @amail), +(4, @amail); + + +/* account set sec email + account set sec regmail */ +SET @setsec = 264; + +-- Add new permissions for account set sec +DELETE FROM `rbac_permissions` WHERE `id` BETWEEN @setsec AND @setsec+2; +INSERT INTO `rbac_permissions` (`id`, `name`) VALUES +(@setsec+0, 'account set sec'), +(@setsec+1, 'account set sec email'), +(@setsec+2, 'account set sec regmail'); + +-- Add permissions to "corresponding Commands Role" +DELETE FROM `rbac_role_permissions` WHERE `permissionId` BETWEEN @setsec AND @setsec+2; +INSERT INTO `rbac_role_permissions` (`roleId`, `permissionId`) VALUES +(4, @setsec+0), +(4, @setsec+1), +(4, @setsec+2); + +/* cs_cast.cpp */ + +SET @id = 267; + +-- Add new permissions +DELETE FROM `rbac_permissions` WHERE `id` BETWEEN @id AND @id+5; +INSERT INTO `rbac_permissions` (`id`, `name`) VALUES +(@id+0, 'cast'), +(@id+1, 'cast back'), +(@id+2, 'cast dist'), +(@id+3, 'cast self'), +(@id+4, 'cast target'), +(@id+5, 'cast dest'); + +-- Add permissions to "corresponding Commands Role" +DELETE FROM `rbac_role_permissions` WHERE `permissionId` BETWEEN @id AND @id+5; +INSERT INTO `rbac_role_permissions` (`roleId`, `permissionId`) VALUES +(4, @id+0), +(4, @id+1), +(4, @id+2), +(4, @id+3), +(4, @id+4), +(4, @id+5); + +/* cs_go.cpp */ + +SET @id = 377; + +-- Add new permissions +DELETE FROM `rbac_permissions` WHERE `id` BETWEEN @id AND @id+9; +INSERT INTO `rbac_permissions` (`id`, `name`) VALUES +(@id+0, 'go'), +(@id+1, 'go creature'), +(@id+2, 'go graveyard'), +(@id+3, 'go grid'), +(@id+4, 'go object'), +(@id+5, 'go taxinode'), +(@id+6, 'go ticket'), +(@id+7, 'go trigger'), +(@id+8, 'go xyz'), +(@id+9, 'go zonexy'); + +-- Add permissions to "corresponding Commands Role" +DELETE FROM `rbac_role_permissions` WHERE `permissionId` BETWEEN @id AND @id+9; +INSERT INTO `rbac_role_permissions` (`roleId`, `permissionId`) VALUES +(2, @id+0), +(2, @id+1), +(2, @id+2), +(2, @id+3), +(2, @id+4), +(2, @id+5), +(2, @id+6), +(2, @id+7), +(2, @id+8), +(2, @id+9); + +UPDATE `rbac_permissions` SET `name`='bf enable' WHERE `id`=262; -- cgit v1.2.3 From a5bcab16a90e57ad786ba5331fb8fb0d490ed0e5 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Tue, 10 Sep 2013 18:55:03 +0200 Subject: DB/Creature: Removed hack in 356ba1e0ce29c12815d927e3c87193f3f877071f --- sql/updates/world/2013_09_10_20_world_creature_template.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 sql/updates/world/2013_09_10_20_world_creature_template.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_10_20_world_creature_template.sql b/sql/updates/world/2013_09_10_20_world_creature_template.sql new file mode 100644 index 00000000000..e4f1cc77e09 --- /dev/null +++ b/sql/updates/world/2013_09_10_20_world_creature_template.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `modelid1`=1126,`modelid2`=16925 WHERE `entry`=21393; -- cgit v1.2.3 From 937981325101dae35ed07b214de4c32c53304ef1 Mon Sep 17 00:00:00 2001 From: Filip Date: Tue, 10 Sep 2013 20:53:24 +0200 Subject: DB/Update: Few updates Fixes #10758 --- sql/updates/world/2013_09_10_21_world_updates.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 sql/updates/world/2013_09_10_21_world_updates.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_10_21_world_updates.sql b/sql/updates/world/2013_09_10_21_world_updates.sql new file mode 100644 index 00000000000..1ee4261624c --- /dev/null +++ b/sql/updates/world/2013_09_10_21_world_updates.sql @@ -0,0 +1,7 @@ +-- Update for Forgotten npcs to award credit. +UPDATE `smart_scripts` SET `action_type`=85 WHERE `entryorguid`=27224 AND `source_type`=0 AND `id`=0 AND `link`=1; +UPDATE `smart_scripts` SET `action_type`=85 WHERE `entryorguid`=27225 AND `source_type`=0 AND `id`=0 AND `link`=1; +UPDATE `smart_scripts` SET `action_type`=85 WHERE `entryorguid`=27229 AND `source_type`=0 AND `id`=0 AND `link`=1; +UPDATE `smart_scripts` SET `action_type`=85 WHERE `entryorguid`=27226 AND `source_type`=0 AND `id`=0 AND `link`=1; +-- Forced model for Channel Bunny... should've used that earlier. +UPDATE `creature` SET `modelid`=16925, `position_x`=1924.63, `position_y`=5574.76, `position_z`=273.122 WHERE `guid`=74872; -- cgit v1.2.3 From 6d3ebe925f79bf59777dd98c9c45ba50b0c182c3 Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 10 Sep 2013 23:21:27 +0100 Subject: SQL: Update sql/base/auth_database.sql --- sql/base/auth_database.sql | 81 +++++++++++++++++++++++++++++++++------------- 1 file changed, 59 insertions(+), 22 deletions(-) (limited to 'sql') diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql index 2f52b5f33f2..c9e0f874457 100644 --- a/sql/base/auth_database.sql +++ b/sql/base/auth_database.sql @@ -112,11 +112,12 @@ LOCK TABLES `account_banned` WRITE; UNLOCK TABLES; -- --- Dumping data for table `autobroadcast` +-- Table structure for table `autobroadcast` -- DROP TABLE IF EXISTS `autobroadcast`; - +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `autobroadcast` ( `realmid` int(11) NOT NULL DEFAULT '-1', `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, @@ -124,38 +125,47 @@ CREATE TABLE `autobroadcast` ( `text` longtext NOT NULL, PRIMARY KEY (`id`,`realmid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; -- --- Table structure for table `ip_banned` +-- Dumping data for table `autobroadcast` -- -DROP TABLE IF EXISTS `ip_banned`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `ip_banned` ( - `ip` varchar(15) NOT NULL DEFAULT '127.0.0.1', - `bandate` int(10) unsigned NOT NULL, - `unbandate` int(10) unsigned NOT NULL, - `bannedby` varchar(50) NOT NULL DEFAULT '[Console]', - `banreason` varchar(255) NOT NULL DEFAULT 'no reason', - PRIMARY KEY (`ip`,`bandate`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Banned IPs'; -/*!40101 SET character_set_client = @saved_cs_client */; +LOCK TABLES `autobroadcast` WRITE; +/*!40000 ALTER TABLE `autobroadcast` DISABLE KEYS */; +/*!40000 ALTER TABLE `autobroadcast` ENABLE KEYS */; +UNLOCK TABLES; -/*Table structure for table `ip2nation` */ +-- +-- Table structure for table `ip2nation` +-- DROP TABLE IF EXISTS `ip2nation`; - +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `ip2nation` ( `ip` int(11) unsigned NOT NULL DEFAULT '0', `country` char(2) NOT NULL DEFAULT '', KEY `ip` (`ip`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; -/*Table structure for table `ip2nationCountries` */ +-- +-- Dumping data for table `ip2nation` +-- -DROP TABLE IF EXISTS `ip2nationCountries`; +LOCK TABLES `ip2nation` WRITE; +/*!40000 ALTER TABLE `ip2nation` DISABLE KEYS */; +/*!40000 ALTER TABLE `ip2nation` ENABLE KEYS */; +UNLOCK TABLES; +-- +-- Table structure for table `ip2nationCountries` +-- + +DROP TABLE IF EXISTS `ip2nationCountries`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `ip2nationCountries` ( `code` varchar(4) NOT NULL DEFAULT '', `iso_code_2` varchar(2) NOT NULL DEFAULT '', @@ -167,6 +177,33 @@ CREATE TABLE `ip2nationCountries` ( PRIMARY KEY (`code`), KEY `code` (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ip2nationCountries` +-- + +LOCK TABLES `ip2nationCountries` WRITE; +/*!40000 ALTER TABLE `ip2nationCountries` DISABLE KEYS */; +/*!40000 ALTER TABLE `ip2nationCountries` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ip_banned` +-- + +DROP TABLE IF EXISTS `ip_banned`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ip_banned` ( + `ip` varchar(15) NOT NULL DEFAULT '127.0.0.1', + `bandate` int(10) unsigned NOT NULL, + `unbandate` int(10) unsigned NOT NULL, + `bannedby` varchar(50) NOT NULL DEFAULT '[Console]', + `banreason` varchar(255) NOT NULL DEFAULT 'no reason', + PRIMARY KEY (`ip`,`bandate`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Banned IPs'; +/*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `ip_banned` @@ -356,7 +393,7 @@ CREATE TABLE `rbac_permissions` ( LOCK TABLES `rbac_permissions` WRITE; /*!40000 ALTER TABLE `rbac_permissions` DISABLE KEYS */; -INSERT INTO `rbac_permissions` VALUES (1,'Instant logout'),(2,'Skip Queue'),(3,'Join Normal Battleground'),(4,'Join Random Battleground'),(5,'Join Arenas'),(6,'Join Dungeon Finder'),(7,'Player Commands (Temporal till commands moved to rbac)'),(8,'Moderator Commands (Temporal till commands moved to rbac)'),(9,'GameMaster Commands (Temporal till commands moved to rbac)'),(10,'Administrator Commands (Temporal till commands moved to rbac)'),(11,'Log GM trades'),(13,'Skip Instance required bosses check'),(14,'Skip character creation team mask check'),(15,'Skip character creation class mask check'),(16,'Skip character creation race mask check'),(17,'Skip character creation reserved name check'),(18,'Skip character creation heroic min level check'),(19,'Skip needed requirements to use channel check'),(20,'Skip disable map check'),(21,'Skip reset talents when used more than allowed check'),(22,'Skip spam chat check'),(23,'Skip over-speed ping check'),(24,'Two side faction characters on the same account'),(25,'Allow say chat between factions'),(26,'Allow channel chat between factions'),(27,'Two side mail interaction'),(28,'See two side who list'),(29,'Add friends of other faction'),(30,'Save character without delay with .save command'),(31,'Use params with .unstuck command'),(32,'Can be assigned tickets with .assign ticket command'),(33,'Notify if a command was not found'),(34,'Check if should appear in list using .gm ingame command'),(35,'See all security levels with who command'),(36,'Filter whispers'),(37,'Use staff badge in chat'),(38,'Resurrect with full Health Points'),(39,'Restore saved gm setting states'),(40,'Allows to add a gm to friend list'),(41,'Use Config option START_GM_LEVEL to assign new character level'),(42,'Allows to use CMSG_WORLD_TELEPORT opcode'),(43,'Allows to use CMSG_WHOIS opcode'),(44,'Receive global GM messages/texts'),(45,'Join channels without announce'),(46,'Change channel settings without being channel moderator'),(47,'Enables lower security than target check'),(48,'Enable IP, Last Login and EMail output in pinfo'),(49,'Forces to enter the email for confirmation on password change'),(50,'Allow user to check his own email with .account'); +INSERT INTO `rbac_permissions` VALUES (1,'Instant logout'),(2,'Skip Queue'),(3,'Join Normal Battleground'),(4,'Join Random Battleground'),(5,'Join Arenas'),(6,'Join Dungeon Finder'),(11,'Log GM trades'),(13,'Skip Instance required bosses check'),(14,'Skip character creation team mask check'),(15,'Skip character creation class mask check'),(16,'Skip character creation race mask check'),(17,'Skip character creation reserved name check'),(18,'Skip character creation heroic min level check'),(19,'Skip needed requirements to use channel check'),(20,'Skip disable map check'),(21,'Skip reset talents when used more than allowed check'),(22,'Skip spam chat check'),(23,'Skip over-speed ping check'),(24,'Two side faction characters on the same account'),(25,'Allow say chat between factions'),(26,'Allow channel chat between factions'),(27,'Two side mail interaction'),(28,'See two side who list'),(29,'Add friends of other faction'),(30,'Save character without delay with .save command'),(31,'Use params with .unstuck command'),(32,'Can be assigned tickets with .assign ticket command'),(33,'Notify if a command was not found'),(34,'Check if should appear in list using .gm ingame command'),(35,'See all security levels with who command'),(36,'Filter whispers'),(37,'Use staff badge in chat'),(38,'Resurrect with full Health Points'),(39,'Restore saved gm setting states'),(40,'Allows to add a gm to friend list'),(41,'Use Config option START_GM_LEVEL to assign new character level'),(42,'Allows to use CMSG_WORLD_TELEPORT opcode'),(43,'Allows to use CMSG_WHOIS opcode'),(44,'Receive global GM messages/texts'),(45,'Join channels without announce'),(46,'Change channel settings without being channel moderator'),(47,'Enables lower security than target check'),(48,'Enable IP, Last Login and EMail output in pinfo'),(49,'Forces to enter the email for confirmation on password change'),(50,'Allow user to check his own email with .account'),(200,'Command: .rbac'),(201,'Command: .rbac account'),(202,'Command: .rbac account group'),(203,'Command: .rbac account group add'),(204,'Command: .rbac account group remove'),(205,'Command: .rbac account role'),(206,'Command: .rbac account role grant'),(207,'Command: .rbac account role deny'),(208,'Command: .rbac account role revoke'),(209,'Command: .rbac account permission'),(210,'Command: .rbac account permission grant'),(211,'Command: .rbac account permission deny'),(212,'Command: .rbac account permission revoke'),(213,'Command: .rbac list'),(214,'Command: .rbac list groups'),(215,'Command: .rbac list roles'),(216,'Command: .rbac list permissions'),(217,'Command: .account'),(218,'Command: .account addon'),(219,'Command: .account create'),(220,'Command: .account delete'),(221,'Command: .account lock'),(222,'Command: .account lock country'),(223,'Command: .account lock ip'),(224,'Command: .account onlinelist'),(225,'Command: .account password'),(226,'Command: .account set'),(227,'Command: .account set addon'),(228,'Command: .account set gmlevel'),(229,'Command: .account set password'),(230,'achievement'),(231,'achievement add'),(232,'arena'),(233,'arena captain'),(234,'arena create'),(235,'arena disband'),(236,'arena info'),(237,'arena lookup'),(238,'arena rename'),(239,'ban'),(240,'ban account'),(241,'ban character'),(242,'ban ip'),(243,'ban playeraccount'),(244,'baninfo'),(245,'baninfo account'),(246,'baninfo character'),(247,'baninfo ip'),(248,'banlist'),(249,'banlist account'),(250,'banlist character'),(251,'banlist ip'),(252,'unban'),(253,'unban account'),(254,'unban character'),(255,'unban ip'),(256,'unban playeraccount'),(257,'bf'),(258,'bf start'),(259,'bf stop'),(260,'bf switch'),(261,'bf timer'),(262,'bf enable'),(263,'account email'),(264,'account set sec'),(265,'account set sec email'),(266,'account set sec regmail'),(267,'cast'),(268,'cast back'),(269,'cast dist'),(270,'cast self'),(271,'cast target'),(272,'cast dest'),(273,'character'),(274,'character customize'),(275,'character changefaction'),(276,'character changerace'),(277,'character deleted'),(279,'character deleted list'),(280,'character deleted restore'),(283,'character level'),(284,'character rename'),(285,'character reputation'),(286,'character titles'),(287,'levelup'),(288,'pdump'),(289,'pdump load'),(290,'pdump write'),(291,'cheat'),(292,'cheat casttime'),(293,'cheat cooldown'),(294,'cheat explore'),(295,'cheat god'),(296,'cheat power'),(297,'cheat status'),(298,'cheat taxi'),(299,'cheat waterwalk'),(300,'debug'),(301,'debug anim'),(302,'debug areatriggers'),(303,'debug arena'),(304,'debug bg'),(305,'debug entervehicle'),(306,'debug getitemstate'),(307,'debug getitemvalue'),(308,'debug getvalue'),(309,'debug hostil'),(310,'debug itemexpire'),(311,'debug lootrecipient'),(312,'debug los'),(313,'debug mod32value'),(314,'debug moveflags'),(315,'debug play'),(316,'debug play cinematics'),(317,'debug play movie'),(318,'debug play sound'),(319,'debug send'),(320,'debug send buyerror'),(321,'debug send channelnotify'),(322,'debug send chatmessage'),(323,'debug send equiperror'),(324,'debug send largepacket'),(325,'debug send opcode'),(326,'debug send qinvalidmsg'),(327,'debug send qpartymsg'),(328,'debug send sellerror'),(329,'debug send setphaseshift'),(330,'debug send spellfail'),(331,'debug setaurastate'),(332,'debug setbit'),(333,'debug setitemvalue'),(334,'debug setvalue'),(335,'debug setvid'),(336,'debug spawnvehicle'),(337,'debug threat'),(338,'debug update'),(339,'debug uws'),(340,'wpgps'),(341,'deserter'),(342,'deserter bg'),(343,'deserter bg add'),(344,'deserter bg remove'),(345,'deserter instance'),(346,'deserter instance add'),(347,'deserter instance remove'),(348,'disable'),(349,'disable add'),(350,'disable add achievement_criteria'),(351,'disable add battleground'),(352,'disable add map'),(353,'disable add mmap'),(354,'disable add outdoorpvp'),(355,'disable add quest'),(356,'disable add spell'),(357,'disable add vmap'),(358,'disable remove'),(359,'disable remove achievement_criteria'),(360,'disable remove battleground'),(361,'disable remove map'),(362,'disable remove mmap'),(363,'disable remove outdoorpvp'),(364,'disable remove quest'),(365,'disable remove spell'),(366,'disable remove vmap'),(367,'event'),(368,'event activelist'),(369,'event start'),(370,'event stop'),(371,'gm'),(372,'gm chat'),(373,'gm fly'),(374,'gm ingame'),(375,'gm list'),(376,'gm visible'),(377,'go'),(378,'go creature'),(379,'go graveyard'),(380,'go grid'),(381,'go object'),(382,'go taxinode'),(383,'go ticket'),(384,'go trigger'),(385,'go xyz'),(386,'go zonexy'),(387,'gobject'),(388,'gobject activate'),(389,'gobject add'),(390,'gobject add temp'),(391,'gobject delete'),(392,'gobject info'),(393,'gobject move'),(394,'gobject near'),(395,'gobject set'),(396,'gobject set phase'),(397,'gobject set state'),(398,'gobject target'),(399,'gobject turn'),(401,'guild'),(402,'guild create'),(403,'guild delete'),(404,'guild invite'),(405,'guild uninvite'),(406,'guild rank'),(407,'guild rename'),(408,'honor'),(409,'honor add'),(410,'honor add kill'),(411,'honor update'),(412,'instance'),(413,'instance listbinds'),(414,'instance unbind'),(415,'instance stats'),(416,'instance savedata'),(417,'learn'),(418,'learn all'),(419,'learn all my'),(420,'learn all my class'),(421,'learn all my pettalents'),(422,'learn all my spells'),(423,'learn all my talents'),(424,'learn all gm'),(425,'learn all crafts'),(426,'learn all default'),(427,'learn all lang'),(428,'learn all recipes'),(429,'unlearn'),(430,'lfg'),(431,'lfg player'),(432,'lfg group'),(433,'lfg queue'),(434,'lfg clean'),(435,'lfg options'),(436,'list'),(437,'list creature'),(438,'list item'),(439,'list object'),(440,'list auras'),(441,'list mail'),(442,'lookup'),(443,'lookup area'),(444,'lookup creature'),(445,'lookup event'),(446,'lookup faction'),(447,'lookup item'),(448,'lookup itemset'),(449,'lookup object'),(450,'lookup quest'),(451,'lookup player'),(452,'lookup player ip'),(453,'lookup player account'),(454,'lookup player email'),(455,'lookup skill'),(456,'lookup spell'),(457,'lookup spell id'),(458,'lookup taxinode'),(459,'lookup tele'),(460,'lookup title'),(461,'lookup map'),(462,'announce'),(463,'channel'),(464,'channel set'),(465,'channel set ownership'),(466,'gmannounce'),(467,'gmnameannounce'),(468,'gmnotify'),(469,'nameannounce'),(470,'notify'),(471,'whispers'),(472,'group'),(473,'group leader'),(474,'group disband'),(475,'group remove'),(476,'group join'),(477,'group list'),(478,'group summon'),(479,'pet'),(480,'pet create'),(481,'pet learn'),(482,'pet unlearn'),(483,'send'),(484,'send items'),(485,'send mail'),(486,'send message'),(487,'send money'),(488,'additem'),(489,'additemset'),(490,'appear'),(491,'aura'),(492,'bank'),(493,'bindsight'),(494,'combatstop'),(495,'cometome'),(496,'commands'),(497,'cooldown'),(498,'damage'),(499,'dev'),(500,'die'),(501,'dismount'),(502,'distance'),(503,'flusharenapoints'),(504,'freeze'),(505,'gps'),(506,'guid'),(507,'help'),(508,'hidearea'),(509,'itemmove'),(510,'kick'),(511,'linkgrave'),(512,'listfreeze'),(513,'maxskill'),(514,'movegens'),(515,'mute'),(516,'neargrave'),(517,'pinfo'),(518,'playall'),(519,'possess'),(520,'recall'),(521,'repairitems'),(522,'respawn'),(523,'revive'),(524,'saveall'),(525,'save'),(526,'setskill'),(527,'showarea'),(528,'summon'),(529,'unaura'),(530,'unbindsight'),(531,'unfreeze'),(532,'unmute'),(533,'unpossess'),(534,'unstuck'),(535,'wchange'),(536,'mmap'),(537,'mmap loadedtiles'),(538,'mmap loc'),(539,'mmap path'),(540,'mmap stats'),(541,'mmap testarea'),(542,'morph'),(543,'demorph'),(544,'modify'),(545,'modify arenapoints'),(546,'modify bit'),(547,'modify drunk'),(548,'modify energy'),(549,'modify faction'),(550,'modify gender'),(551,'modify honor'),(552,'modify hp'),(553,'modify mana'),(554,'modify money'),(555,'modify mount'),(556,'modify phase'),(557,'modify rage'),(558,'modify reputation'),(559,'modify runicpower'),(560,'modify scale'),(561,'modify speed'),(562,'modify speed all'),(563,'modify speed backwalk'),(564,'modify speed fly'),(565,'modify speed walk'),(566,'modify speed swim'),(567,'modify spell'),(568,'modify standstate'),(569,'modify talentpoints'),(570,'npc'),(571,'npc add'),(572,'npc add formation'),(573,'npc add item'),(574,'npc add move'),(575,'npc add temp'),(576,'npc add delete'),(577,'npc add delete item'),(578,'npc add follow'),(579,'npc add follow stop'),(580,'npc set'),(581,'npc set allowmove'),(582,'npc set entry'),(583,'npc set factionid'),(584,'npc set flag'),(585,'npc set level'),(586,'npc set link'),(587,'npc set model'),(588,'npc set movetype'),(589,'npc set phase'),(590,'npc set spawndist'),(591,'npc set spawntime'),(592,'npc set data'),(593,'npc info'),(594,'npc near'),(595,'npc move'),(596,'npc playemote'),(597,'npc say'),(598,'npc textemote'),(599,'npc whisper'),(600,'npc yell'),(601,'npc tame'),(602,'quest'),(603,'quest add'),(604,'quest complete'),(605,'quest remove'),(606,'quest reward'),(607,'reload'),(608,'reload access_requirement'),(609,'reload achievement_criteria_data'),(610,'reload achievement_reward'),(611,'reload all'),(612,'reload all achievement'),(613,'reload all area'),(614,'reload all eventai'),(615,'reload all gossips'),(616,'reload all item'),(617,'reload all locales'),(618,'reload all loot'),(619,'reload all npc'),(620,'reload all quest'),(621,'reload all scripts'),(622,'reload all spell'),(623,'reload areatrigger_involvedrelation'),(624,'reload areatrigger_tavern'),(625,'reload areatrigger_teleport'),(626,'reload auctions'),(627,'reload autobroadcast'),(628,'reload command'),(629,'reload conditions'),(630,'reload config'),(631,'reload creature_text'),(632,'reload creature_ai_scripts'),(633,'reload creature_ai_texts'),(634,'reload creature_questender'),(635,'reload creature_linked_respawn'),(636,'reload creature_loot_template'),(637,'reload creature_onkill_reputation'),(638,'reload creature_queststarter'),(639,'reload creature_summon_groups'),(640,'reload creature_template'),(641,'reload disables'),(642,'reload disenchant_loot_template'),(643,'reload event_scripts'),(644,'reload fishing_loot_template'),(645,'reload game_graveyard_zone'),(646,'reload game_tele'),(647,'reload gameobject_questender'),(648,'reload gameobject_loot_template'),(649,'reload gameobject_queststarter'),(650,'reload gm_tickets'),(651,'reload gossip_menu'),(652,'reload gossip_menu_option'),(653,'reload item_enchantment_template'),(654,'reload item_loot_template'),(655,'reload item_set_names'),(656,'reload lfg_dungeon_rewards'),(657,'reload locales_achievement_reward'),(658,'reload locales_creature'),(659,'reload locales_creature_text'),(660,'reload locales_gameobject'),(661,'reload locales_gossip_menu_option'),(662,'reload locales_item'),(663,'reload locales_item_set_name'),(664,'reload locales_npc_text'),(665,'reload locales_page_text'),(666,'reload locales_points_of_interest'),(667,'reload locales_quest'),(668,'reload mail_level_reward'),(669,'reload mail_loot_template'),(670,'reload milling_loot_template'),(671,'reload npc_spellclick_spells'),(672,'reload npc_trainer'),(673,'reload npc_vendor'),(674,'reload page_text'),(675,'reload pickpocketing_loot_template'),(676,'reload points_of_interest'),(677,'reload prospecting_loot_template'),(678,'reload quest_poi'),(679,'reload quest_template'),(680,'reload rbac'),(681,'reload reference_loot_template'),(682,'reload reserved_name'),(683,'reload reputation_reward_rate'),(684,'reload reputation_spillover_template'),(685,'reload skill_discovery_template'),(686,'reload skill_extra_item_template'),(687,'reload skill_fishing_base_level'),(688,'reload skinning_loot_template'),(689,'reload smart_scripts'),(690,'reload spell_required'),(691,'reload spell_area'),(692,'reload spell_bonus_data'),(693,'reload spell_group'),(694,'reload spell_learn_spell'),(695,'reload spell_loot_template'),(696,'reload spell_linked_spell'),(697,'reload spell_pet_auras'),(698,'reload spell_proc_event'),(699,'reload spell_proc'),(700,'reload spell_scripts'),(701,'reload spell_target_position'),(702,'reload spell_threats'),(703,'reload spell_group_stack_rules'),(704,'reload trinity_string'),(705,'reload warden_action'),(706,'reload waypoint_scripts'),(707,'reload waypoint_data'),(708,'reload vehicle_accessory'),(709,'reload vehicle_template_accessory'),(710,'reset'),(711,'reset achievements'),(712,'reset honor'),(713,'reset level'),(714,'reset spells'),(715,'reset stats'),(716,'reset talents'),(717,'reset all'),(718,'server'),(719,'server corpses'),(720,'server exit'),(721,'server idlerestart'),(722,'server idlerestart cancel'),(723,'server idleshutdown'),(724,'server idleshutdown cancel'),(725,'server info'),(726,'server plimit'),(727,'server restart'),(728,'server restart cancel'),(729,'server set'),(730,'server set closed'),(731,'server set difftime'),(732,'server set loglevel'),(733,'server set motd'),(734,'server shutdown'),(735,'server shutdown cancel'),(736,'server motd'),(737,'tele'),(738,'tele add'),(739,'tele del'),(740,'tele name'),(741,'tele group'),(742,'ticket'),(743,'ticket assign'),(744,'ticket close'),(745,'ticket closedlist'),(746,'ticket comment'),(747,'ticket complete'),(748,'ticket delete'),(749,'ticket escalate'),(750,'ticket escalatedlist'),(751,'ticket list'),(752,'ticket onlinelist'),(753,'ticket reset'),(754,'ticket response'),(755,'ticket response append'),(756,'ticket response appendln'),(757,'ticket togglesystem'),(758,'ticket unassign'),(759,'ticket viewid'),(760,'ticket viewname'),(761,'titles'),(762,'titles add'),(763,'titles current'),(764,'titles remove'),(765,'titles set'),(766,'titles set mask'),(767,'wp'),(768,'wp add'),(769,'wp event'),(770,'wp load'),(771,'wp modify'),(772,'wp unload'),(773,'wp reload'),(774,'wp show'); /*!40000 ALTER TABLE `rbac_permissions` ENABLE KEYS */; UNLOCK TABLES; @@ -383,7 +420,7 @@ CREATE TABLE `rbac_role_permissions` ( LOCK TABLES `rbac_role_permissions` WRITE; /*!40000 ALTER TABLE `rbac_role_permissions` DISABLE KEYS */; -INSERT INTO `rbac_role_permissions` VALUES (5,1),(5,2),(6,3),(6,4),(6,5),(7,6),(1,7),(2,8),(3,9),(4,10),(8,11),(9,13),(33,14),(33,15),(33,16),(33,17),(33,18),(27,19),(22,20),(23,21),(24,22),(17,23),(34,24),(28,25),(30,26),(19,27),(35,28),(36,29),(11,30),(12,31),(10,32),(20,33),(14,34),(37,35),(29,36),(15,37),(13,38),(25,39),(38,40),(26,41),(18,42),(18,43),(16,44),(31,45),(32,46),(21,47),(39,48),(40,49), (41,50); +INSERT INTO `rbac_role_permissions` VALUES (5,1),(5,2),(6,3),(6,4),(6,5),(7,6),(8,11),(9,13),(33,14),(33,15),(33,16),(33,17),(33,18),(27,19),(22,20),(23,21),(24,22),(17,23),(34,24),(28,25),(30,26),(19,27),(35,28),(36,29),(11,30),(12,31),(10,32),(20,33),(14,34),(37,35),(29,36),(15,37),(13,38),(25,39),(38,40),(26,41),(18,42),(18,43),(16,44),(31,45),(32,46),(21,47),(39,48),(40,49),(41,50),(4,200),(4,201),(4,202),(4,203),(4,204),(4,205),(4,206),(4,207),(4,208),(4,209),(4,210),(4,211),(4,212),(4,213),(4,214),(4,215),(4,216),(1,217),(2,218),(1,221),(1,222),(1,223),(1,225),(4,226),(4,227),(4,230),(4,231),(3,232),(4,233),(4,234),(4,235),(3,236),(3,237),(4,238),(4,239),(4,240),(4,241),(4,242),(4,243),(4,244),(4,245),(4,246),(4,247),(4,248),(4,249),(4,250),(4,251),(4,252),(4,253),(4,254),(4,255),(4,256),(4,257),(4,258),(4,259),(4,260),(4,261),(4,262),(1,263),(2,263),(3,263),(4,263),(4,264),(4,265),(4,266),(4,267),(4,268),(4,269),(4,270),(4,271),(4,272),(3,273),(3,274),(3,275),(3,276),(3,277),(4,279),(4,280),(4,283),(3,284),(3,285),(3,286),(4,287),(4,288),(4,289),(4,290),(4,291),(4,292),(4,293),(4,294),(4,295),(4,296),(4,297),(4,298),(4,299),(2,300),(3,301),(4,302),(4,303),(4,304),(4,305),(4,306),(4,307),(4,308),(4,309),(4,310),(3,311),(2,312),(4,313),(4,314),(2,315),(2,316),(2,317),(2,318),(4,319),(4,320),(4,321),(4,322),(4,323),(4,324),(4,325),(4,326),(4,327),(4,328),(4,329),(4,330),(4,331),(4,332),(4,333),(4,334),(4,335),(4,336),(4,337),(4,338),(4,339),(4,340),(4,341),(4,342),(4,343),(4,344),(4,345),(4,346),(4,347),(4,348),(4,349),(4,350),(4,351),(4,352),(4,353),(4,354),(4,355),(4,356),(4,357),(4,358),(4,359),(4,360),(4,361),(4,362),(4,363),(4,364),(4,365),(4,366),(2,367),(2,368),(2,369),(2,370),(2,371),(2,372),(4,373),(2,374),(4,375),(2,376),(2,377),(2,378),(2,379),(2,380),(2,381),(2,382),(2,383),(2,384),(2,385),(2,386),(3,387),(3,388),(3,389),(3,390),(3,391),(3,392),(3,393),(3,394),(3,395),(3,396),(3,397),(3,398),(3,399),(4,401),(4,402),(4,403),(4,404),(4,405),(4,406),(4,407),(2,408),(2,409),(2,410),(2,411),(2,412),(2,413),(2,414),(2,415),(2,416),(4,417),(4,418),(4,419),(4,420),(4,421),(4,422),(4,423),(4,424),(4,425),(4,426),(4,427),(4,428),(4,429),(2,430),(2,431),(2,432),(2,433),(4,434),(4,435),(4,436),(4,437),(4,438),(4,439),(4,440),(4,441),(4,442),(4,443),(4,444),(4,445),(4,446),(4,447),(4,448),(4,449),(4,450),(4,451),(4,452),(4,453),(4,454),(4,455),(4,456),(4,457),(4,458),(4,459),(4,461),(2,462),(4,463),(4,464),(4,465),(2,466),(2,467),(2,468),(2,469),(2,470),(2,471),(4,472),(4,473),(4,474),(4,475),(4,476),(4,477),(4,478),(3,479),(3,480),(3,481),(3,482),(2,483),(2,484),(3,485),(3,486),(3,487),(4,488),(4,489),(2,490),(4,491),(4,492),(4,493),(3,494),(4,495),(1,496),(4,497),(4,498),(4,499),(4,500),(1,501),(4,502),(4,503),(2,504),(4,505),(3,506),(1,507),(4,508),(3,509),(3,510),(4,511),(2,512),(4,513),(4,514),(2,515),(4,516),(3,517),(3,518),(4,519),(2,520),(3,521),(4,522),(4,523),(2,524),(1,525),(4,526),(4,527),(2,528),(4,529),(4,530),(2,531),(2,532),(4,533),(1,534),(4,535),(4,536),(4,537),(4,538),(4,539),(4,540),(4,541),(3,542),(3,543),(2,544),(2,545),(2,546),(2,547),(2,548),(2,549),(3,550),(2,551),(2,552),(2,553),(2,554),(2,555),(4,556),(2,557),(3,558),(2,559),(2,560),(2,561),(2,562),(2,563),(2,564),(2,565),(2,566),(2,567),(3,568),(2,569),(2,570),(3,571),(3,572),(3,573),(3,574),(3,575),(3,576),(3,577),(3,578),(3,579),(3,580),(4,581),(4,582),(3,583),(3,584),(3,585),(3,586),(3,587),(3,588),(3,589),(3,590),(3,591),(4,592),(4,593),(3,594),(3,595),(4,596),(2,597),(2,598),(2,599),(2,600),(3,601),(4,602),(4,603),(4,604),(4,605),(4,606),(4,607),(4,608),(4,609),(4,610),(4,611),(4,612),(4,613),(4,614),(4,615),(4,616),(4,617),(4,618),(4,619),(4,620),(4,621),(4,622),(4,623),(4,624),(4,625),(4,626),(4,627),(4,628),(4,629),(4,630),(4,631),(4,632),(4,633),(4,634),(4,635),(4,636),(4,637),(4,638),(4,639),(4,640),(4,641),(4,642),(4,643),(4,644),(4,645),(4,646),(4,647),(4,648),(4,649),(4,650),(4,651),(4,652),(4,653),(4,654),(4,655),(4,656),(4,657),(4,658),(4,659),(4,660),(4,661),(4,662),(4,663),(4,664),(4,665),(4,666),(4,667),(4,668),(4,669),(4,670),(4,671),(4,672),(4,673),(4,674),(4,675),(4,676),(4,677),(4,678),(4,679),(4,680),(4,681),(4,682),(4,683),(4,684),(4,685),(4,686),(4,687),(4,688),(4,689),(4,690),(4,691),(4,692),(4,693),(4,694),(4,695),(4,696),(4,697),(4,698),(4,699),(4,700),(4,701),(4,702),(4,703),(4,704),(4,705),(4,706),(4,707),(4,708),(4,709),(4,710),(4,711),(4,712),(4,713),(4,714),(4,715),(4,716),(4,717),(4,718),(4,719),(4,721),(4,722),(4,723),(4,724),(4,725),(4,726),(4,727),(4,728),(4,729),(4,730),(4,733),(4,734),(4,735),(4,736),(2,737),(4,738),(4,739),(2,740),(2,741),(2,742),(3,743),(2,744),(2,745),(2,746),(2,747),(4,748),(2,749),(3,750),(2,751),(2,752),(4,753),(2,754),(2,755),(2,756),(4,757),(3,758),(2,759),(2,760),(3,761),(3,762),(3,763),(3,764),(3,765),(3,766),(3,767),(3,768),(3,769),(3,770),(3,771),(3,772),(4,773),(3,774); /*!40000 ALTER TABLE `rbac_role_permissions` ENABLE KEYS */; UNLOCK TABLES; @@ -532,4 +569,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2013-03-09 17:57:13 +-- Dump completed on 2013-09-10 23:18:53 -- cgit v1.2.3 From 97db57703f29228293c1e6e57f6a791693a00a28 Mon Sep 17 00:00:00 2001 From: Filip Date: Wed, 11 Sep 2013 08:59:41 +0200 Subject: DB/Cond: Error fix-up --- sql/updates/world/2013_09_11_00_world_cond.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 sql/updates/world/2013_09_11_00_world_cond.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_11_00_world_cond.sql b/sql/updates/world/2013_09_11_00_world_cond.sql new file mode 100644 index 00000000000..4b0f307ef44 --- /dev/null +++ b/sql/updates/world/2013_09_11_00_world_cond.sql @@ -0,0 +1 @@ +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=8455 AND `SourceEntry`=4; -- cgit v1.2.3 From 0e2129289226b317f7c3dd01409adc81f934af01 Mon Sep 17 00:00:00 2001 From: Filip Date: Wed, 11 Sep 2013 20:59:27 +0200 Subject: DB/SAI: Strengthen the Ancients addition Fixes #10778 --- sql/updates/world/2013_09_11_01_world_sai.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 sql/updates/world/2013_09_11_01_world_sai.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_11_01_world_sai.sql b/sql/updates/world/2013_09_11_01_world_sai.sql new file mode 100644 index 00000000000..cb65806b29e --- /dev/null +++ b/sql/updates/world/2013_09_11_01_world_sai.sql @@ -0,0 +1,5 @@ +UPDATE `creature_template` SET`AIName`='SmartAI' WHERE `entry`=26321; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=26321; +DELETE FROM `smart_scripts` WHERE `entryorguid`=26321; +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 +(26321,0,0,0,8,0,100,1,47530,0,0,0,33,26321,0,0,0,0,0,7,0,0,0,0,0,0,0,'Lothalor Ancient - On Spellhit - Give Credit to Invoker'); -- cgit v1.2.3 From ca4d53a8443d91dc3b5e593008a3a72451f68c0e Mon Sep 17 00:00:00 2001 From: Filip Date: Thu, 12 Sep 2013 09:14:20 +0200 Subject: DB/SAI: War is Hell Fixes #3915, By Vincent_Michael --- sql/updates/world/2013_09_12_00_world_sai.sql | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 sql/updates/world/2013_09_12_00_world_sai.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_12_00_world_sai.sql b/sql/updates/world/2013_09_12_00_world_sai.sql new file mode 100644 index 00000000000..449eebbc258 --- /dev/null +++ b/sql/updates/world/2013_09_12_00_world_sai.sql @@ -0,0 +1,17 @@ +-- [QUEST] War Is Hell +UPDATE `creature` SET `spawntimesecs`=60 WHERE `id` IN (24009,24010); + +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (24009,24010); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (24009,24010) AND `source_type`=0; +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 +-- Alliance Corpse +(24009, 0, 0, 1, 8, 0, 100, 1, 42793, 0, 0, 0, 11, 43297, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Alliance Corpse - SMART_EVENT_SPELLHIT - SMART_ACTION_CAST'), +(24009, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 41, 20000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Alliance Corpse - SMART_EVENT_LINK - SMART_ACTION_FORCE_DESPAWN'), +-- Forsaken Corpse +(24010, 0, 0, 1, 8, 0, 100, 1, 42793, 0, 0, 0, 11, 43297, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Forsaken Corpse - SMART_EVENT_SPELLHIT - SMART_ACTION_CAST'), +(24010, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 41, 20000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Forsaken Corpse - SMART_EVENT_LINK - SMART_ACTION_FORCE_DESPAWN'); + +DELETE FROM `conditions` WHERE `SourceEntry`=42793 AND `SourceTypeOrReferenceId`=17; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(17, 0, 42793, 0, 0, 31, 1, 3, 24009, 0, 0, 0, 0, '', ''), +(17, 0, 42793, 0, 1, 31, 1, 3, 24010, 0, 0, 0, 0, '', ''); -- cgit v1.2.3 From cb4bf1fd97029d7bc163759b185505944f3947a3 Mon Sep 17 00:00:00 2001 From: Warpten Date: Fri, 13 Sep 2013 19:15:39 +0200 Subject: Scripts/Ruby Sanctum: (Possibly) fixed Twilight Mending. I don't have the computer to even compile a core, please report back. My logics shouldn't be wrong here from what I can read on the wiki. Ref #10016. --- sql/updates/world/2013_09_13_00_world_conditions.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 sql/updates/world/2013_09_13_00_world_conditions.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_13_00_world_conditions.sql b/sql/updates/world/2013_09_13_00_world_conditions.sql new file mode 100644 index 00000000000..8f8dc774e54 --- /dev/null +++ b/sql/updates/world/2013_09_13_00_world_conditions.sql @@ -0,0 +1 @@ +UPDATE `conditions` SET `ElseGroup`=2 WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=75509; -- cgit v1.2.3 From 042df135067b9f18d4ffe0e54ff54f31ee45dd10 Mon Sep 17 00:00:00 2001 From: Filip Date: Sat, 14 Sep 2013 00:44:10 +0200 Subject: DB/Update: Warm Up - credit update Fixes #10804 --- sql/updates/world/2013_09_14_00_world_update.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 sql/updates/world/2013_09_14_00_world_update.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_14_00_world_update.sql b/sql/updates/world/2013_09_14_00_world_update.sql new file mode 100644 index 00000000000..03a7515e6b3 --- /dev/null +++ b/sql/updates/world/2013_09_14_00_world_update.sql @@ -0,0 +1 @@ +UPDATE `smart_scripts` SET `target_type`=24 WHERE `entryorguid`=2935200 AND `source_type`=9 AND `id`=0 AND `link`=0; -- cgit v1.2.3 From 9c7de29e9340c7273f9aeb05a3f697e042f0530b Mon Sep 17 00:00:00 2001 From: Filip Date: Sat, 14 Sep 2013 14:20:41 +0200 Subject: DB/GO: Spell Focus for Trial of the Lake Closes #10807 --- sql/updates/world/2013_09_14_01_world_gobject.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 sql/updates/world/2013_09_14_01_world_gobject.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_14_01_world_gobject.sql b/sql/updates/world/2013_09_14_01_world_gobject.sql new file mode 100644 index 00000000000..b2b59b0d794 --- /dev/null +++ b/sql/updates/world/2013_09_14_01_world_gobject.sql @@ -0,0 +1,3 @@ +DELETE FROM `gameobject` WHERE `id`= 15885; +INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES +(99849, 15885, 1, 1, 1, 7853.95, -2212.3, 456.397, 0, 0, 0, 0, 0, 0, 0, 1); -- cgit v1.2.3 From ef09e8bc7d16b203152cb602b6fb80f94a2a7c8c Mon Sep 17 00:00:00 2001 From: Filip Date: Mon, 16 Sep 2013 16:24:38 +0200 Subject: DB/SAI: Fate of the Titans --- sql/updates/world/2013_09_16_00_world_sai.sql | 132 ++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 sql/updates/world/2013_09_16_00_world_sai.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_16_00_world_sai.sql b/sql/updates/world/2013_09_16_00_world_sai.sql new file mode 100644 index 00000000000..a254f55e691 --- /dev/null +++ b/sql/updates/world/2013_09_16_00_world_sai.sql @@ -0,0 +1,132 @@ +-- Fate of the Titans (12986) +-- http://www.youtube.com/watch?v=H6HED6PaxIs + +SET @NPC_DISK := 30313; -- Mobile Databank +SET @NPC_BUNNY_INVENTION := 30315; -- Temple of Invention Bunny +SET @NPC_BUNNY_LIFE := 30316; -- Temple of Life Bunny +SET @NPC_BUNNY_WINTER := 30317; -- Temple of Winter Bunny +SET @NPC_BUNNY_ORDER := 30318; -- Temple of Order Bunny +SET @NPC_BUNNY_DATASCAN := 30889; -- Data Scan Target Bunny +SET @SPELL_DATASCAN := 56523; -- Data Scan +SET @SPELL_INVENTION_KC := 56532; -- Temple of Invention Kill Credit +SET @SPELL_LIFE_KC := 56534; -- Temple of Life Kill Credit +SET @SPELL_WINTER_KC := 56533; -- Temple of Winter Kill Credit +SET @SPELL_ORDER_KC := 56535; -- Temple of Order Kill Credit +SET @GUID := 127294; + +UPDATE `creature_template` SET `AIName`='SmartAI',`speed_walk`=3.14286, `InhabitType`=4 WHERE `entry`=@NPC_DISK; +UPDATE `creature_template` SET `AIName`='SmartAI',`unit_flags`=`unit_flags`|33554432,`InhabitType`=7,`flags_extra`=`flags_extra`|128 WHERE `entry` IN (@NPC_BUNNY_INVENTION,@NPC_BUNNY_LIFE,@NPC_BUNNY_WINTER,@NPC_BUNNY_ORDER,@NPC_BUNNY_DATASCAN); + +-- Sniffed +DELETE FROM `creature` WHERE `id` IN (@NPC_BUNNY_INVENTION,@NPC_BUNNY_LIFE,@NPC_BUNNY_WINTER,@NPC_BUNNY_ORDER,@NPC_BUNNY_DATASCAN); +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES +-- Databank should go from one to another and say text +(@GUID+0,@NPC_BUNNY_INVENTION,571,1,1,0,0,7865.214,-1397.313,1534.143,3.752458,300,0,0,1,0,0,0,0,0), +(@GUID+1,@NPC_BUNNY_LIFE,571,1,1,0,0,7994.017,-2734.839,1133.662,0.3316126,300,0,0,1,0,0,0,0,0), +(@GUID+2,@NPC_BUNNY_WINTER,571,1,1,0,0,7498.68,-1899.41,1473.61,0.132902,300,0,0,1,0,0,0,0,0), +(@GUID+3,@NPC_BUNNY_ORDER,571,1,1,0,0,8194.199,-1963.597,1738.56,1.954769,300,0,0,1,0,0,0,0,0), +-- At the Temple of Order: +(@GUID+4,@NPC_BUNNY_DATASCAN,571,1,1,0,0,8130.811,-1995.321,1781.117,0.05235988,300,0,0,1,0,0,0,0,0), +(@GUID+5,@NPC_BUNNY_DATASCAN,571,1,1,0,0,8213.646,-1901.764,1744.02,0.5759587,300,0,0,1,0,0,0,0,0), +(@GUID+6,@NPC_BUNNY_DATASCAN,571,1,1,0,0,8255.328,-1982.391,1742.117,4.031711,300,0,0,1,0,0,0,0,0), +-- At the Temple of Invention: +(@GUID+7,@NPC_BUNNY_DATASCAN,571,1,1,0,0,7868.994,-1375.799,1541.754,4.712389,300,0,0,1,0,0,0,0,0), +(@GUID+8,@NPC_BUNNY_DATASCAN,571,1,1,0,0,7924.429,-1385.165,1534.788,6.038839,300,0,0,1,0,0,0,0,0), +(@GUID+9,@NPC_BUNNY_DATASCAN,571,1,1,0,0,7903.273, -1424.807, 1539.821,2.048841,300,0,0,1,0,0,0,0,0), +(@GUID+10,@NPC_BUNNY_DATASCAN,571,1,1,0,0,7863.330, -1434.625, 1537.565,3.072831,300,0,0,1,0,0,0,0,0), +-- At the Temple of Life: +(@GUID+11,@NPC_BUNNY_DATASCAN,571,1,1,0,0,7924.706,-2748.963,1151.056,4.520403,300,0,0,1,0,0,0,0,0), +(@GUID+12,@NPC_BUNNY_DATASCAN,571,1,1,0,0,8010.217,-2750.608,1151.104,0.418879,300,0,0,1,0,0,0,0,0), +(@GUID+13,@NPC_BUNNY_DATASCAN,571,1,1,0,0,8027.505,-2728.616,1139.939,3.944444,300,0,0,1,0,0,0,0,0), +(@GUID+14,@NPC_BUNNY_DATASCAN,571,1,1,0,0,7978.187,-2714.357,1137.354,2.643541,300,0,0,1,0,0,0,0,0), +-- At the Temple of Winter: +(@GUID+15,@NPC_BUNNY_DATASCAN,571,1,1,0,0,7520.712,-1929.840,1482.500,4.520403,300,0,0,1,0,0,0,0,0), +(@GUID+16,@NPC_BUNNY_DATASCAN,571,1,1,0,0,7478.601, -1917.123, 1473.615,0.418879,300,0,0,1,0,0,0,0,0), +(@GUID+17,@NPC_BUNNY_DATASCAN,571,1,1,0,0,7473.774, -1875.455, 1473.614,3.944444,300,0,0,1,0,0,0,0,0); + +-- Databank only executes SAI near Temple Bunnies +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=@NPC_DISK; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(22,1,@NPC_DISK,0,0,29,0,@NPC_BUNNY_INVENTION,15,0,0,0,'','Execute sai if near dummy npc'), +(22,2,@NPC_DISK,0,0,29,0,@NPC_BUNNY_WINTER,15,0,0,0,'','Execute sai if near dummy npc'), +(22,3,@NPC_DISK,0,0,29,0,@NPC_BUNNY_LIFE,15,0,0,0,'','Execute sai if near dummy npc'), +(22,4,@NPC_DISK,0,0,29,0,@NPC_BUNNY_ORDER,15,0,0,0,'','Execute sai if near dummy npc'); + +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (@NPC_DISK,@NPC_BUNNY_INVENTION); +DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid` IN (@NPC_DISK*100+0,@NPC_DISK*100+1,@NPC_DISK*100+2,@NPC_DISK*100+3); +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 +(@NPC_DISK,0,0,0,10,0,100,1,500,1000,500,1000,80,@NPC_DISK*100+0,2,0,0,0,0,1,0,0,0,0,0,0,0,'Mobile Databank - OOC near npc - Run script'), +-- +(@NPC_DISK,0,1,0,10,0,100,1,500,1000,500,1000,80,@NPC_DISK*100+1,2,0,0,0,0,1,0,0,0,0,0,0,0,'Mobile Databank - OOC near npc - Run script'), +-- +(@NPC_DISK,0,2,0,10,0,100,1,500,1000,500,1000,80,@NPC_DISK*100+2,2,0,0,0,0,1,0,0,0,0,0,0,0,'Mobile Databank - OOC near npc - Run script'), +-- +(@NPC_DISK,0,3,0,10,0,100,1,500,1000,500,1000,80,@NPC_DISK*100+3,2,0,0,0,0,1,0,0,0,0,0,0,0,'Mobile Databank - OOC near npc - Run script'), +-- +(@NPC_DISK*100+0,9,0,0,0,0,100,0,5000,5000,5000,5000,69,1,0,0,0,0,0,10,@GUID+7,@NPC_BUNNY_DATASCAN,0,0,0,0,0,'Mobile Databank - On Script - Move to Pos'), +(@NPC_DISK*100+0,9,1,0,0,0,100,0,3000,3000,3000,3000,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Mobile Databank - On Script - Say'), +(@NPC_DISK*100+0,9,2,0,0,0,100,0,2000,2000,2000,2000,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Mobile Databank - On Script - Say'), +(@NPC_DISK*100+0,9,3,0,0,0,100,0,8000,8000,8000,8000,69,1,0,0,0,0,0,10,@GUID+8,@NPC_BUNNY_DATASCAN,0,0,0,0,0,'Mobile Databank - On Script - Move to Pos'), +(@NPC_DISK*100+0,9,4,0,0,0,100,0,7000,7000,7000,7000,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Mobile Databank - On Script - Say'), +(@NPC_DISK*100+0,9,5,0,0,0,100,0,9000,9000,9000,9000,69,1,0,0,0,0,0,10,@GUID+9,@NPC_BUNNY_DATASCAN,0,0,0,0,0,'Mobile Databank - On Script - Move to Pos'), +(@NPC_DISK*100+0,9,6,0,0,0,100,0,3000,3000,3000,3000,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Mobile Databank - On Script - Say'), +(@NPC_DISK*100+0,9,7,0,0,0,100,0,9000,9000,9000,9000,69,1,0,0,0,0,0,10,@GUID+10,@NPC_BUNNY_DATASCAN,0,0,0,0,0,'Mobile Databank - On Script - Move to Pos'), +(@NPC_DISK*100+0,9,8,0,0,0,100,0,3000,3000,3000,3000,1,4,0,0,0,0,0,1,0,0,0,0,0,0,0,'Mobile Databank - On Script - Say'), +(@NPC_DISK*100+0,9,9,0,0,0,100,0,0,0,0,0,11,@SPELL_INVENTION_KC,0,0,0,0,0,1,0,0,0,0,0,0,0,'Mobile Databank - On script - Cast Credit'), +-- +(@NPC_DISK*100+1,9,0,0,0,0,100,0,5000,5000,5000,5000,69,1,0,0,0,0,0,10,@GUID+15,@NPC_BUNNY_DATASCAN,0,0,0,0,0,'Mobile Databank - On Script - Move to Pos'), +(@NPC_DISK*100+1,9,1,0,0,0,100,0,3000,3000,3000,3000,1,5,0,0,0,0,0,1,0,0,0,0,0,0,0,'Mobile Databank - On Script - Say'), +(@NPC_DISK*100+1,9,2,0,0,0,100,0,2000,2000,2000,2000,1,6,0,0,0,0,0,1,0,0,0,0,0,0,0,'Mobile Databank - On Script - Say'), +(@NPC_DISK*100+1,9,3,0,0,0,100,0,8000,8000,8000,8000,69,1,0,0,0,0,0,10,@GUID+16,@NPC_BUNNY_DATASCAN,0,0,0,0,0,'Mobile Databank - On Script - Move to Pos'), +(@NPC_DISK*100+1,9,4,0,0,0,100,0,7000,7000,7000,7000,1,7,0,0,0,0,0,1,0,0,0,0,0,0,0,'Mobile Databank - On Script - Say'), +(@NPC_DISK*100+1,9,5,0,0,0,100,0,9000,9000,9000,9000,69,1,0,0,0,0,0,10,@GUID+17,@NPC_BUNNY_DATASCAN,0,0,0,0,0,'Mobile Databank - On Script - Move to Pos'), +(@NPC_DISK*100+1,9,6,0,0,0,100,0,3000,3000,3000,3000,1,8,0,0,0,0,0,1,0,0,0,0,0,0,0,'Mobile Databank - On Script - Say'), +(@NPC_DISK*100+1,9,7,0,0,0,100,0,3000,3000,3000,3000,1,9,0,0,0,0,0,1,0,0,0,0,0,0,0,'Mobile Databank - On Script - Say'), +(@NPC_DISK*100+1,9,8,0,0,0,100,0,0,0,0,0,11,@SPELL_WINTER_KC,0,0,0,0,0,7,0,0,0,0,0,0,0,'Mobile Databank - On script - Cast Credit'), +-- +(@NPC_DISK*100+2,9,0,0,0,0,100,0,5000,5000,5000,5000,69,1,0,0,0,0,0,10,@GUID+11,@NPC_BUNNY_DATASCAN,0,0,0,0,0,'Mobile Databank - On Script - Move to Pos'), +(@NPC_DISK*100+2,9,1,0,0,0,100,0,3000,3000,3000,3000,1,10,0,0,0,0,0,1,0,0,0,0,0,0,0,'Mobile Databank - On Script - Say'), +(@NPC_DISK*100+2,9,2,0,0,0,100,0,2000,2000,2000,2000,1,11,0,0,0,0,0,1,0,0,0,0,0,0,0,'Mobile Databank - On Script - Say'), +(@NPC_DISK*100+2,9,3,0,0,0,100,0,8000,8000,8000,8000,69,1,0,0,0,0,0,10,@GUID+12,@NPC_BUNNY_DATASCAN,0,0,0,0,0,'Mobile Databank - On Script - Move to Pos'), +(@NPC_DISK*100+2,9,4,0,0,0,100,0,7000,7000,7000,7000,1,12,0,0,0,0,0,1,0,0,0,0,0,0,0,'Mobile Databank - On Script - Say'), +(@NPC_DISK*100+2,9,5,0,0,0,100,0,9000,9000,9000,9000,69,1,0,0,0,0,0,10,@GUID+13,@NPC_BUNNY_DATASCAN,0,0,0,0,0,'Mobile Databank - On Script - Move to Pos'), +(@NPC_DISK*100+2,9,6,0,0,0,100,0,3000,3000,3000,3000,1,13,0,0,0,0,0,1,0,0,0,0,0,0,0,'Mobile Databank - On Script - Say'), +(@NPC_DISK*100+2,9,7,0,0,0,100,0,9000,9000,9000,9000,69,1,0,0,0,0,0,10,@GUID+14,@NPC_BUNNY_DATASCAN,0,0,0,0,0,'Mobile Databank - On Script - Move to Pos'), +(@NPC_DISK*100+2,9,8,0,0,0,100,0,3000,3000,3000,3000,1,14,0,0,0,0,0,1,0,0,0,0,0,0,0,'MMobile Databank - On Script - Say'), +(@NPC_DISK*100+2,9,9,0,0,0,100,0,0,0,0,0,11,@SPELL_LIFE_KC,0,0,0,0,0,7,0,0,0,0,0,0,0,'Mobile Databank - On script - Cast Credit'), +-- +(@NPC_DISK*100+3,9,0,0,0,0,100,0,5000,5000,5000,5000,69,1,0,0,0,0,0,10,@GUID+4,@NPC_BUNNY_DATASCAN,0,0,0,0,0,'Mobile Databank - On Script - Move to Pos'), +(@NPC_DISK*100+3,9,1,0,0,0,100,0,3000,3000,3000,3000,1,15,0,0,0,0,0,1,0,0,0,0,0,0,0,'Mobile Databank - On Script - Say'), +(@NPC_DISK*100+3,9,2,0,0,0,100,0,2000,2000,2000,2000,1,16,0,0,0,0,0,1,0,0,0,0,0,0,0,'Mobile Databank - On Script - Say'), +(@NPC_DISK*100+3,9,3,0,0,0,100,0,8000,8000,8000,8000,69,1,0,0,0,0,0,10,@GUID+5,@NPC_BUNNY_DATASCAN,0,0,0,0,0,'Mobile Databank - On Script - Move to Pos'), +(@NPC_DISK*100+3,9,4,0,0,0,100,0,7000,7000,7000,7000,1,17,0,0,0,0,0,1,0,0,0,0,0,0,0,'Mobile Databank - On Script - Say'), +(@NPC_DISK*100+3,9,5,0,0,0,100,0,9000,9000,9000,9000,69,1,0,0,0,0,0,10,@GUID+6,@NPC_BUNNY_DATASCAN,0,0,0,0,0,'Mobile Databank - On Script - Move to Pos'), +(@NPC_DISK*100+3,9,6,0,0,0,100,0,3000,3000,3000,3000,1,18,0,0,0,0,0,1,0,0,0,0,0,0,0,'Mobile Databank - On Script - Say'), +(@NPC_DISK*100+3,9,7,0,0,0,100,0,0,0,0,0,11,@SPELL_ORDER_KC,0,0,0,0,0,7,0,0,0,0,0,0,0,'Mobile Databank - On script - Cast Credit'); + + +DELETE FROM `creature_text` WHERE `entry`=@NPC_DISK; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +-- At the Temple of Invention: +(@NPC_DISK,0,0,'Temple of Invention analysis commencing.',12,0,100,15,0,0,'Mobile Databank'), +(@NPC_DISK,1,0,'Temple of Invention verified to be in-tact.',12,0,100,15,0,0,'Mobile Databank'), +(@NPC_DISK,2,0,'Mechanical servants appear to have turned against each other. Several attendants have been piled together in an unorganized manner.',12,0,100,15,0,0,'Mobile Databank'), +(@NPC_DISK,3,0,'Remaining mechagnome guardians corrupted by unknown source.',12,0,100,15,0,0,'Mobile Databank'), +(@NPC_DISK,4,0,'Watcher Mimir verified to no longer be present. Analysis complete.',12,0,100,15,0,0,'Mobile Databank'), +-- At the Temple of Winter: +(@NPC_DISK,5,0,'Temple of Winter analysis commencing.',12,0,100,15,0,0,'Mobile Databank'), +(@NPC_DISK,6,0,'Temple of Winter verified to be in-tact.',12,0,100,15,0,0,'Mobile Databank'), +(@NPC_DISK,7,0,'Temple guardians verified to be deceased. Sulfurous odor suggests that death resulted from a fire-base entity.',12,0,100,15,0,0,'Mobile Databank'), +(@NPC_DISK,8,0,'Previously established cold weather patterns at the temple have ceased.',12,0,100,15,0,0,'Mobile Databank'), +(@NPC_DISK,9,0,'Watcher Hodir verified to no longer be present. Analysis complete.',12,0,100,15,0,0,'Mobile Databank'), +-- At the Temple of Life: +(@NPC_DISK,10,0,'Temple of Life analysis commencing.',12,0,100,15,0,0,'Mobile Databank'), +(@NPC_DISK,11,0,'Temple of Life verified to be damaged beyond repair.',12,0,100,15,0,0,'Mobile Databank'), +(@NPC_DISK,12,0,'Evidence indicates a significant battle. The opponent of Watcher Freya estimated to be of similar size and strength to Watcher Freya.',12,0,100,15,0,0,'Mobile Databank'), +(@NPC_DISK,13,0,'Temple guardians are no longer present. Plant forms associated with temple are deceased.',12,0,100,15,0,0,'Mobile Databank'), +(@NPC_DISK,14,0,'Watcher Freya verified to no longer be present. Analysis complete.',12,0,100,15,0,0,'Mobile Databank'), +-- At the Temple of Order: +(@NPC_DISK,15,0,'Temple of Order analysis commencing.',12,0,100,15,0,0,'Mobile Databank'), +(@NPC_DISK,16,0,'Temple of Order verified to be in-tact.',12,0,100,15,0,0,'Mobile Databank'), +(@NPC_DISK,17,0,'No indications of struggle are present. No guardians are present.',12,0,100,15,0,0,'Mobile Databank'), +(@NPC_DISK,18,0,'Watcher Tyr verified to no longer be present. Analysis complete.',12,0,100,15,0,0,'Mobile Databank'); -- cgit v1.2.3 From 1427302afa1f3f47fb1c8acbb1be5290e5dff356 Mon Sep 17 00:00:00 2001 From: Filip Date: Mon, 16 Sep 2013 18:12:40 +0200 Subject: DB/SAI: So Far, So Bad --- sql/updates/world/2013_09_16_01_world_sai.sql | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 sql/updates/world/2013_09_16_01_world_sai.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_16_01_world_sai.sql b/sql/updates/world/2013_09_16_01_world_sai.sql new file mode 100644 index 00000000000..c9f8024c2f3 --- /dev/null +++ b/sql/updates/world/2013_09_16_01_world_sai.sql @@ -0,0 +1,13 @@ +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceGroup`=1 AND `SourceEntry`=28739 AND `SourceId`=0; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(22,1,28739,0,0,1,1,52231,0,0,1,0,0,'','Execute sai only if aura is not presented'); +DELETE FROM `disables` WHERE `entry` IN (52227,52228) AND `sourcetype`=0; +INSERT INTO `disables` (`sourceType`, `entry`, `flags`, `params_0`, `params_1`, `comment`) VALUES +(0,52227,64,'','','Disable LOS check for Dilute Blight Cauldron'), +(0,52228,64,'','','Disable LOS check for Kill Credit (quest 12669)'); +UPDATE `creature_template` SET `ainame`='SmartAI' WHERE `entry`=28739; +DELETE FROM `smart_scripts` WHERE `entryorguid`=28739 AND `source_type`=0; +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 +(28739,0,0,1,8,0,100,0,52227,0,0,0,11,52228,0,0,0,0,0,7,0,0,0,0,0,0,0,'Blight Cauldron Bunny 00 - On Spell Hit - Give Quest Credit'), +(28739,0,1,0,61,0,100,0,0,0,0,0,11,52231,0,0,0,0,0,1,0,0,0,0,0,0,0,'Blight Cauldron Bunny 00 - Link With Previous Event - Cast Cauldron Diluted Effect'), +(28739,0,2,0,1,0,100,0,30000,30000,30000,30000,28,52231,0,0,0,0,0,1,0,0,0,0,0,0,0,'Blight Cauldron Bunny 00 - OOC - Remove Aura From Cauldron Diluted Effect'); -- cgit v1.2.3 From 0c7e27535f842de8ab182ed39f514d808f9cfbe8 Mon Sep 17 00:00:00 2001 From: w1sht0l1v3 Date: Mon, 16 Sep 2013 23:22:05 +0300 Subject: DB/SAI: The Murketh and Shaadraz Gateways. --- sql/updates/world/2013_09_16_02_world_sai.sql | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 sql/updates/world/2013_09_16_02_world_sai.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_16_02_world_sai.sql b/sql/updates/world/2013_09_16_02_world_sai.sql new file mode 100644 index 00000000000..859f85f26e0 --- /dev/null +++ b/sql/updates/world/2013_09_16_02_world_sai.sql @@ -0,0 +1,8 @@ +-- 10146 - [Mission: The Murketh and Shaadraz Gateways] +-- 10129 - [Mission: Gateways Murketh and Shaadraz] +DELETE FROM `creature_ai_scripts` WHERE `creature_id` in (19291,19292); +UPDATE `creature_template` SET `AIName`='SmartAI',`flags_extra`=130 WHERE `entry` IN (19291,19292); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (19291,19292) AND `source_type`=0; +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 +(19291,0,0,0,8,0,100,0,33655,0,0,0,33,19291,0,0,0,0,0,7,0,0,0,0,0,0,0,'Legion Transporter: Alpha - Quest Credit on Dropping The Nether Modulator Spellhit'), +(19292,0,0,0,8,0,100,0,33655,0,0,0,33,19292,0,0,0,0,0,7,0,0,0,0,0,0,0,'Legion Transporter: Beta - Quest Credit on Dropping The Nether Modulator Spellhit'); -- cgit v1.2.3 From d80d36b1dac42db49e8b687670fe475a1c742021 Mon Sep 17 00:00:00 2001 From: Filip Date: Tue, 17 Sep 2013 08:44:17 +0200 Subject: DB/Error: Delete empty guid addon --- sql/updates/world/2013_09_17_00_world_error.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 sql/updates/world/2013_09_17_00_world_error.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_17_00_world_error.sql b/sql/updates/world/2013_09_17_00_world_error.sql new file mode 100644 index 00000000000..7b859a99745 --- /dev/null +++ b/sql/updates/world/2013_09_17_00_world_error.sql @@ -0,0 +1 @@ +DELETE FROM `creature_addon` WHERE `guid`=105665; -- cgit v1.2.3 From 173a2478aa678fe3152c165dee4ff18ec254c954 Mon Sep 17 00:00:00 2001 From: Filip Date: Tue, 17 Sep 2013 20:35:13 +0200 Subject: DB/SAI: Misc Fixes Authors @untaught @dr-j @MitchesD Fixes #10847 Fixes #10844 Fixes #10830 Fixes #10829 Fixes #10830 --- sql/updates/world/2013_09_17_01_world_sai_comp.sql | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 sql/updates/world/2013_09_17_01_world_sai_comp.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_17_01_world_sai_comp.sql b/sql/updates/world/2013_09_17_01_world_sai_comp.sql new file mode 100644 index 00000000000..e08e9caa74a --- /dev/null +++ b/sql/updates/world/2013_09_17_01_world_sai_comp.sql @@ -0,0 +1,49 @@ +-- Deep in the bowels of the Underhalls +UPDATE `smart_scripts` SET `target_type`=24 WHERE `entryorguid`=30409 AND `source_type`=0 AND `id`=4 AND `link`=0; +-- Guide our sights +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry` IN(23957,23972); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (23957,23972); +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 +(23957, 0, 0, 0, 8, 0, 100, 0, 43076, 0, 0, 0, 33, 23957 , 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Westguard Cannon Credit Trigger East - On Spellhit - Kill Credit'), +(23972, 0, 0, 0, 8, 0, 100, 0, 43076, 0, 0, 0, 33, 23972 , 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Westguard Cannon Credit Trigger West - On Spellhit - Kill Credit'); +-- Baleheim Must Burn +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry` IN(24182,24183,24184,24185); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (24182,24183,24184,24185); +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 +(24182, 0, 0, 0, 8, 0, 100, 0, 43233, 0, 0, 0, 33, 24182 , 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Winterskorn Dwelling Credit - On Spellhit - Kill Credit'), +(24183, 0, 0, 0, 8, 0, 100, 0, 43233, 0, 0, 0, 33, 24183 , 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Winterskorn Watchtower Credit - On Spellhit - Kill Credit'), +(24184, 0, 0, 0, 8, 0, 100, 0, 43233, 0, 0, 0, 33, 24184 , 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Winterskorn Barracks Credit - On Spellhit - Kill Credit'), +(24185, 0, 0, 0, 8, 0, 100, 0, 43233, 0, 0, 0, 33, 24185 , 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Winterskorn Bridge Credit - On Spellhit - Kill Credit'); +-- Forge Camp: Annihilated +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry` IN(17998,17999,18000,18002); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (17998,17999,18000,18002); +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 +(17998, 0, 0, 0, 8, 0, 100, 0, 31736, 0, 0, 0, 33, 17998 , 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Umbrafen Steam Pump Credit Marker - On Spellhit - Kill Credit'), +(17999, 0, 0, 0, 8, 0, 100, 0, 31736, 0, 0, 0, 33, 17999 , 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Lagoon Steam Pump Credit Marker - On Spellhit - Kill Credit'), +(18000, 0, 0, 0, 8, 0, 100, 0, 31736, 0, 0, 0, 33, 18000 , 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Serpent Steam Pump Credit Marker - On Spellhit - Kill Credit'), +(18002, 0, 0, 0, 8, 0, 100, 0, 31736, 0, 0, 0, 33, 18002 , 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Marshlight Steam Pump Credit Marker - On Spellhit - Kill Credit'); +-- Balance Must Be Preserved +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry` IN(17998,17999,18000,18002); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (17998,17999,18000,18002); +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 +(17998, 0, 0, 0, 8, 0, 100, 0, 31736, 0, 0, 0, 33, 17998 , 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Umbrafen Steam Pump Credit Marker - On Spellhit - Kill Credit'), +(17999, 0, 0, 0, 8, 0, 100, 0, 31736, 0, 0, 0, 33, 17999 , 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Lagoon Steam Pump Credit Marker - On Spellhit - Kill Credit'), +(18000, 0, 0, 0, 8, 0, 100, 0, 31736, 0, 0, 0, 33, 18000 , 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Serpent Steam Pump Credit Marker - On Spellhit - Kill Credit'), +(18002, 0, 0, 0, 8, 0, 100, 0, 31736, 0, 0, 0, 33, 18002 , 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Marshlight Steam Pump Credit Marker - On Spellhit - Kill Credit'); +-- Burn in Effigy +UPDATE `smart_scripts` SET `event_flags`=0 WHERE `entryorguid` BETWEEN 25510 AND 25513 AND `source_type`=0; +-- A Necessary Distraction +UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` IN (21506); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (21506); +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 +(21506, 0, 0, 0, 8, 0, 100, 0, 37834, 0, 0, 0, 33, 21892, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Azaloth - On Spellhit - Kill Credit'); +-- Monitoring the Rift: Sundered Chasm 3.3.5 +UPDATE `creature_template` SET `ainame`='SmartAI' WHERE `entry`=25308; +DELETE FROM `smart_scripts` WHERE `entryorguid`=25308 AND `source_type`=0; +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 +(25308,0,0,0,8,0,100,0,45414,0,0,0,33,25308,0,0,0,0,0,7,0,0,0,0,0,0,0,'Borean - Westrift Chasm Anomaly - On Spell Hit - Give Quest Credit'); + +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=25309; +DELETE FROM `smart_scripts` WHERE `entryorguid`=25309 AND `source_type`=0; +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 +(25309,0,0,0,8,0,100,0,45414,0,0,0,33,25309,0,0,0,0,0,7,0,0,0,0,0,0,0,'Borean - Westrift Cavern Anomaly - On Spell Hit - Give Quest Credit'); -- cgit v1.2.3 From aa6736cfcc23447995a71635d6c3b852e7277aba Mon Sep 17 00:00:00 2001 From: Filip Date: Wed, 18 Sep 2013 09:05:33 +0200 Subject: DB/SAI: Missing addition --- sql/updates/world/2013_09_18_00_world_sai.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 sql/updates/world/2013_09_18_00_world_sai.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_18_00_world_sai.sql b/sql/updates/world/2013_09_18_00_world_sai.sql new file mode 100644 index 00000000000..5485e4ed506 --- /dev/null +++ b/sql/updates/world/2013_09_18_00_world_sai.sql @@ -0,0 +1,5 @@ +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry` IN(19067,19210); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (19067,19210); +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 +(19067, 0, 0, 0, 8, 0, 100, 0, 33531, 0, 0, 0, 33, 19067 , 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 'Fel Cannon: Hate - On Spellhit - Kill Credit'), +(19210, 0, 0, 0, 8, 0, 100, 0, 33532, 0, 0, 0, 33, 19210 , 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 'Fel Cannot: Fear - On Spellhit - Kill Credit'); -- cgit v1.2.3 From 05e72b4906a90ff347ee56e9f2ad6d7f56eb2d3a Mon Sep 17 00:00:00 2001 From: joschiwald Date: Wed, 18 Sep 2013 22:24:05 +0200 Subject: Core/Achievements: Implemented ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE --- ...13_09_18_01_world_achievement_criteria_data.sql | 18 ++++++++++++ src/server/game/Achievements/AchievementMgr.cpp | 29 +++++++++++++++++--- src/server/game/Achievements/AchievementMgr.h | 3 +- src/server/game/Conditions/ConditionMgr.cpp | 2 +- src/server/game/Conditions/ConditionMgr.h | 31 --------------------- src/server/game/Entities/Player/Player.cpp | 7 +++-- src/server/scripts/World/achievement_scripts.cpp | 12 ++++++++ src/server/shared/Utilities/Util.h | 32 ++++++++++++++++++++++ 8 files changed, 95 insertions(+), 39 deletions(-) create mode 100644 sql/updates/world/2013_09_18_01_world_achievement_criteria_data.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_18_01_world_achievement_criteria_data.sql b/sql/updates/world/2013_09_18_01_world_achievement_criteria_data.sql new file mode 100644 index 00000000000..ffb99be70f7 --- /dev/null +++ b/sql/updates/world/2013_09_18_01_world_achievement_criteria_data.sql @@ -0,0 +1,18 @@ +UPDATE `achievement_criteria_data` SET `value2` = 3 WHERE `type`=8 AND `criteria_id` IN (2358, 2412, 3384); +UPDATE `achievement_criteria_data` SET `type` = 0 WHERE `type`=8 AND `criteria_id` IN (12066, 12067, 12132); + +DELETE FROM `achievement_criteria_data` WHERE `criteria_id` IN (4944,4946,4948,4949,4950,4951,4952,4953,4954,4955,4956,4957,4958); +INSERT INTO `achievement_criteria_data` (`criteria_id`, `type`, `value1`, `value2`, `ScriptName`) VALUES +(4944, 0, 0, 0, ''), -- no criteria data +(4946,11, 0, 0, 'achievement_killed_exp_or_honor_target'), +(4948, 8, 1, 0, ''), -- Beast +(4949, 8, 3, 0, ''), -- Dragonkin +(4950, 8, 2, 0, ''), -- drachkin +(4951, 8, 4, 0, ''), -- Elemental +(4952, 8, 5, 0, ''), -- Giant +(4953, 8, 7, 0, ''), -- Humanoid +(4954, 8, 9, 0, ''), -- Mechanical +(4955, 8, 6, 0, ''), -- Undead +(4956, 8, 10, 0, ''), -- Not specified +(4957, 8, 11, 0, ''), -- Totem +(4958, 8, 12, 0, ''); -- Non-Combat Pet diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 1fe9a08bfdc..186b2a75196 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -82,6 +82,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) switch (criteria->requiredType) { case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE: + case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE: case ACHIEVEMENT_CRITERIA_TYPE_WIN_BG: case ACHIEVEMENT_CRITERIA_TYPE_FALL_WITHOUT_DYING: case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST: // only hardcoded list @@ -116,7 +117,6 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) switch (dataType) { case ACHIEVEMENT_CRITERIA_DATA_TYPE_NONE: - case ACHIEVEMENT_CRITERIA_DATA_TYPE_VALUE: case ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT: return true; case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_CREATURE: @@ -189,6 +189,13 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) return false; } return true; + case ACHIEVEMENT_CRITERIA_DATA_TYPE_VALUE: + if (value.compType >= COMP_TYPE_MAX) + { + TC_LOG_ERROR(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_VALUE (%u) has wrong ComparisionType in value2 (%u), ignored.", value.compType); + return false; + } + return true; case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_LEVEL: if (level.minlevel > STRONG_MAX_LEVEL) { @@ -345,7 +352,7 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA: return target && target->HasAuraEffect(aura.spell_id, aura.effect_idx); case ACHIEVEMENT_CRITERIA_DATA_TYPE_VALUE: - return miscvalue1 >= value.minvalue; + return CompareValues(ComparisionType(value.compType), miscvalue1, value.value); case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_LEVEL: if (!target) return false; @@ -829,6 +836,20 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui SetCriteriaProgress(achievementCriteria, miscValue2, PROGRESS_ACCUMULATE); break; } + case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE: + { + // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case + if (!miscValue2) + continue; + + // those requirements couldn't be found in the dbc + AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); + if (!data || !data->Meets(GetPlayer(), unit, miscValue1)) + continue; + + SetCriteriaProgress(achievementCriteria, miscValue2, PROGRESS_ACCUMULATE); + break; + } case ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL: if (AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria)) if (!data->Meets(GetPlayer(), unit)) @@ -1248,7 +1269,6 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui SetCriteriaProgress(achievementCriteria, 1); break; } - case ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED_ON_LOOT: case ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT: { @@ -1563,7 +1583,6 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui case ACHIEVEMENT_CRITERIA_TYPE_PLAY_ARENA: case ACHIEVEMENT_CRITERIA_TYPE_OWN_RANK: case ACHIEVEMENT_CRITERIA_TYPE_EARNED_PVP_TITLE: - case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE: break; // Not implemented yet :( } @@ -1721,6 +1740,7 @@ bool AchievementMgr::IsCompletedCriteria(AchievementCriteriaEntry const* achieve case ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_AT_BARBER: case ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_MAIL: case ACHIEVEMENT_CRITERIA_TYPE_LOSE_DUEL: + case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE: case ACHIEVEMENT_CRITERIA_TYPE_GOLD_EARNED_BY_AUCTIONS: case ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION: case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID: @@ -2278,6 +2298,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData() case ACHIEVEMENT_CRITERIA_TYPE_WIN_BG: // any cases break; case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE: + case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE: break; // any cases case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST: { diff --git a/src/server/game/Achievements/AchievementMgr.h b/src/server/game/Achievements/AchievementMgr.h index ce6ab9cd29b..f57c05a2769 100644 --- a/src/server/game/Achievements/AchievementMgr.h +++ b/src/server/game/Achievements/AchievementMgr.h @@ -116,7 +116,8 @@ struct AchievementCriteriaData // ACHIEVEMENT_CRITERIA_DATA_TYPE_VALUE = 8 struct { - uint32 minvalue; + uint32 value; + uint32 compType; } value; // ACHIEVEMENT_CRITERIA_DATA_TYPE_T_LEVEL = 9 struct diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 5e4ca1de73a..933d77cc2e8 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -1768,7 +1768,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) { if (cond->ConditionValue2 >= COMP_TYPE_MAX) { - TC_LOG_ERROR(LOG_FILTER_SQL, "Level condition has invalid option (%u), skipped", cond->ConditionValue2); + TC_LOG_ERROR(LOG_FILTER_SQL, "Level condition has invalid ComparisionType (%u), skipped", cond->ConditionValue2); return false; } if (cond->ConditionValue3) diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h index 4e3225ca8a2..cc2db10e437 100644 --- a/src/server/game/Conditions/ConditionMgr.h +++ b/src/server/game/Conditions/ConditionMgr.h @@ -133,16 +133,6 @@ enum ConditionSourceType CONDITION_SOURCE_TYPE_MAX = 26 // MAX }; -enum ComparisionType -{ - COMP_TYPE_EQ = 0, - COMP_TYPE_HIGH, - COMP_TYPE_LOW, - COMP_TYPE_HIGH_EQ, - COMP_TYPE_LOW_EQ, - COMP_TYPE_MAX -}; - enum RelationType { RELATION_SELF = 0, @@ -274,27 +264,6 @@ class ConditionMgr SmartEventConditionContainer SmartEventConditionStore; }; -template bool CompareValues(ComparisionType type, T val1, T val2) -{ - switch (type) - { - case COMP_TYPE_EQ: - return val1 == val2; - case COMP_TYPE_HIGH: - return val1 > val2; - case COMP_TYPE_LOW: - return val1 < val2; - case COMP_TYPE_HIGH_EQ: - return val1 >= val2; - case COMP_TYPE_LOW_EQ: - return val1 <= val2; - default: - // incorrect parameter - ASSERT(false); - return false; - } -} - #define sConditionMgr ACE_Singleton::instance() #endif diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 75bdce22ddf..68d30cd1dde 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -539,8 +539,11 @@ inline void KillRewarder::_RewardKillCredit(Player* player) { // 4.4. Give kill credit (player must not be in group, or he must be alive or without corpse). if (!_group || player->IsAlive() || !player->GetCorpse()) - if (_victim->GetTypeId() == TYPEID_UNIT) - player->KilledMonster(_victim->ToCreature()->GetCreatureTemplate(), _victim->GetGUID()); + if (Creature* target = _victim->ToCreature()) + { + player->KilledMonster(target->GetCreatureTemplate(), target->GetGUID()); + player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE, target->GetCreatureType(), 1, target); + } } void KillRewarder::_RewardPlayer(Player* player, bool isDungeon) diff --git a/src/server/scripts/World/achievement_scripts.cpp b/src/server/scripts/World/achievement_scripts.cpp index 94e448bd9bc..6cd5e962c02 100644 --- a/src/server/scripts/World/achievement_scripts.cpp +++ b/src/server/scripts/World/achievement_scripts.cpp @@ -279,6 +279,17 @@ class achievement_flirt_with_disaster_perf_check : public AchievementCriteriaScr } }; +class achievement_killed_exp_or_honor_target : public AchievementCriteriaScript +{ + public: + achievement_killed_exp_or_honor_target() : AchievementCriteriaScript("achievement_killed_exp_or_honor_target") { } + + bool OnCheck(Player* player, Unit* target) OVERRIDE + { + return target && player->isHonorOrXPTarget(target); + } +}; + void AddSC_achievement_scripts() { new achievement_resilient_victory(); @@ -298,4 +309,5 @@ void AddSC_achievement_scripts() new achievement_tilted(); new achievement_not_even_a_scratch(); new achievement_flirt_with_disaster_perf_check(); + new achievement_killed_exp_or_honor_target(); } diff --git a/src/server/shared/Utilities/Util.h b/src/server/shared/Utilities/Util.h index 6d0216225da..937cf4c9fd6 100644 --- a/src/server/shared/Utilities/Util.h +++ b/src/server/shared/Utilities/Util.h @@ -532,4 +532,36 @@ public: } }; +enum ComparisionType +{ + COMP_TYPE_EQ = 0, + COMP_TYPE_HIGH, + COMP_TYPE_LOW, + COMP_TYPE_HIGH_EQ, + COMP_TYPE_LOW_EQ, + COMP_TYPE_MAX +}; + +template +bool CompareValues(ComparisionType type, T val1, T val2) +{ + switch (type) + { + case COMP_TYPE_EQ: + return val1 == val2; + case COMP_TYPE_HIGH: + return val1 > val2; + case COMP_TYPE_LOW: + return val1 < val2; + case COMP_TYPE_HIGH_EQ: + return val1 >= val2; + case COMP_TYPE_LOW_EQ: + return val1 <= val2; + default: + // incorrect parameter + ASSERT(false); + return false; + } +} + #endif -- cgit v1.2.3 From 7be7eb2b36ba2599908df8f1d064d3884f090542 Mon Sep 17 00:00:00 2001 From: Filip Date: Thu, 19 Sep 2013 11:56:09 +0200 Subject: DB/Errors: Misc db error fixes Db errors fixed by @untaught PrevQuest fixes by @dr-j and @Crysicle Fixes #10370 Fixes #5064 Partially takes care of #10747 - more to come. --- .../world/2013_09_19_00_world_db_errors.sql | 65 ++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 sql/updates/world/2013_09_19_00_world_db_errors.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_19_00_world_db_errors.sql b/sql/updates/world/2013_09_19_00_world_db_errors.sql new file mode 100644 index 00000000000..f629b8ba78f --- /dev/null +++ b/sql/updates/world/2013_09_19_00_world_db_errors.sql @@ -0,0 +1,65 @@ +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=41427 WHERE `entryorguid`=23219 AND `id`=6 AND `source_type`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=43384 WHERE `entryorguid`=23652 AND `id`=0 AND `source_type`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=43341 WHERE `entryorguid`=23678 AND `id`=6 AND `source_type`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=43174 WHERE `entryorguid`=23689 AND `id`=2 AND `source_type`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=43174 WHERE `entryorguid`=24170 AND `id`=1 AND `source_type`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=43806 WHERE `entryorguid`=24439 AND `id`=3 AND `source_type`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=45627 WHERE `entryorguid`=25471 AND `id`=0 AND `source_type`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=45628 WHERE `entryorguid`=25472 AND `id`=0 AND `source_type`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=45629 WHERE `entryorguid`=25473 AND `id`=0 AND `source_type`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=46443 WHERE `entryorguid`=25752 AND `id`=2 AND `source_type`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=46445 WHERE `entryorguid`=25752 AND `id`=2 AND `source_type`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=47009 WHERE `entryorguid`=26270 AND `id`=0 AND `source_type`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=47665 WHERE `entryorguid`=26482 AND `id`=1 AND `source_type`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=47664 WHERE `entryorguid`=26615 AND `id`=2 AND `source_type`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=50473 WHERE `entryorguid`=27409 AND `id`=5 AND `source_type`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=48813 WHERE `entryorguid`=27482 AND `id`=4 AND `source_type`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=50290 WHERE `entryorguid`=28013 AND `id`=0 AND `source_type`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=51279 WHERE `entryorguid`=28156 AND `id`=1 AND `source_type`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=56940 WHERE `entryorguid`=29445 AND `id`=0 AND `source_type`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=55289 WHERE `entryorguid`=29747 AND `id`=1 AND `source_type`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=58599 WHERE `entryorguid`=31048 AND `id`=2 AND `source_type`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=58955 WHERE `entryorguid`=31304 AND `id`=7 AND `source_type`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=61748 WHERE `entryorguid`=32588 AND `id`=5 AND `source_type`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=65374 WHERE `entryorguid`=34365 AND `id`=1 AND `source_type`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=40347 WHERE `entryorguid`=2061000 AND `id`=1 AND `source_type`=9; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=40347 WHERE `entryorguid`=2077700 AND `id`=2 AND `source_type`=9; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=47683 WHERE `entryorguid`=2642000 AND `id`=5 AND `source_type`=9; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=47685 WHERE `entryorguid`=2648400 AND `id`=5 AND `source_type`=9; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=59876 WHERE `entryorguid`=3244501 AND `id`=0 AND `source_type`=9; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=75197 WHERE `entryorguid`=4032900 AND `id`=7 AND `source_type`=9; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=11024,`action_param2`=0,`action_param3`=0,`target_type`=1,`target_x`=0,`target_y`=0,`target_z`=0,`target_o`=0 WHERE `entryorguid`=7572 AND `source_type`=0 AND `id`=3 AND `link`=4; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=43160,`action_param2`=0,`action_param3`=0 WHERE `entryorguid`=23777 AND `source_type`=0 AND `id`=2 AND `link`=3; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=43326,`action_param2`=0,`target_type`=1,`target_x`=0,`target_y`=0,`target_z`=0,`target_o`=0 WHERE `entryorguid`=23931 AND `source_type`=0 AND `id`=5 AND `link`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=43289,`action_param2`=0,`action_param3`=0 WHERE `entryorguid`=24210 AND `source_type`=0 AND `id`=0 AND `link`=1; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=43787,`action_param2`=0,`action_param3`=0,`target_type`=1,`target_x`=0,`target_y`=0,`target_z`=0 WHERE `entryorguid`=24399 AND `source_type`=0 AND `id`=5 AND `link`=0; +UPDATE `smart_scripts` SET `event_param3`=0,`event_param4`=0 WHERE `entryorguid`=12900 AND `source_type`=0 AND `id` IN (0,1) AND `link`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=48550,`action_param2`=0,`action_param3`=0 WHERE `entryorguid`=26633 AND `source_type`=0 AND `id`=4 AND `link`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=47315,`action_param2`=0 WHERE `entryorguid`=26699 AND `source_type`=0 AND `id`=0 AND `link`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=52030 WHERE `entryorguid`=28565 AND `source_type`=0 AND `id`=1 AND `link`=2; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=52220 WHERE `entryorguid`=28669 AND `source_type`=0 AND `id`=2 AND `link`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=57911,`action_param2`=0,`action_param3`=0 WHERE `entryorguid`=30829 AND `source_type`=0 AND `id`=1 AND `link`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=57892,`action_param2`=0,`action_param3`=0 WHERE `entryorguid`=30830 AND `source_type`=0 AND `id`=1 AND `link`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=57917,`action_param2`=0,`action_param3`=0 WHERE `entryorguid`=30831 AND `source_type`=0 AND `id`=1 AND `link`=0; +-- Remove SPELL_AURA_CONTROL_VEHICLE from addon template +UPDATE `creature_template_addon` SET `auras`='50494' WHERE `entry`=28006; +UPDATE `creature_template_addon` SET `auras`='' WHERE `entry` IN (27661,28093,29838); +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=74154 WHERE `entryorguid`=1268 AND `id`=4 AND `source_type`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=42337 WHERE `entryorguid`=4351 AND `id`=0 AND `source_type`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=42337 WHERE `entryorguid`=4352 AND `id`=0 AND `source_type`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=42486 WHERE `entryorguid`=4393 AND `id`=0 AND `source_type`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=42486 WHERE `entryorguid`=4394 AND `id`=0 AND `source_type`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=60111 WHERE `entryorguid`=5284 AND `id`=0 AND `source_type`=2; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=60112 WHERE `entryorguid`=5285 AND `id`=0 AND `source_type`=2; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=60115 WHERE `entryorguid`=5286 AND `id`=0 AND `source_type`=2; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=60117 WHERE `entryorguid`=5287 AND `id`=0 AND `source_type`=2; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=74156 WHERE `entryorguid`=6119 AND `id`=4 AND `source_type`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=74155 WHERE `entryorguid`=7955 AND `id`=3 AND `source_type`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=61314 WHERE `entryorguid` IN (15273,15274,15294,15298) AND `id` IN (0,1) AND `source_type`=0; + + +-- Meeting the Warchief prevquest +UPDATE `quest_template` SET `PrevQuestId`=9812 WHERE `Id`=9813; + +-- Report to Orgnil prevquest +UPDATE `quest_template` SET `PrevQuestId`=805 WHERE `Id`=82 -- cgit v1.2.3 From 1ede593d4140dde73279add004f5ee7a787b0307 Mon Sep 17 00:00:00 2001 From: Filip Date: Thu, 19 Sep 2013 11:59:35 +0200 Subject: Just because.... --- sql/updates/world/2013_09_19_00_world_db_errors.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql') diff --git a/sql/updates/world/2013_09_19_00_world_db_errors.sql b/sql/updates/world/2013_09_19_00_world_db_errors.sql index f629b8ba78f..cdf189c38fe 100644 --- a/sql/updates/world/2013_09_19_00_world_db_errors.sql +++ b/sql/updates/world/2013_09_19_00_world_db_errors.sql @@ -62,4 +62,4 @@ UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=61314 WHERE `entryor UPDATE `quest_template` SET `PrevQuestId`=9812 WHERE `Id`=9813; -- Report to Orgnil prevquest -UPDATE `quest_template` SET `PrevQuestId`=805 WHERE `Id`=82 +UPDATE `quest_template` SET `PrevQuestId`=805 WHERE `Id`=823; -- cgit v1.2.3 From 001f62deb4bc1bbd5224106c957a3f941d380f4f Mon Sep 17 00:00:00 2001 From: Filip Date: Thu, 19 Sep 2013 18:54:29 +0200 Subject: DB/Errors: Leftoever fixes Work done by @untaught fixes #10747 --- sql/updates/world/2013_09_19_01_world_db_errors.sql | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 sql/updates/world/2013_09_19_01_world_db_errors.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_19_01_world_db_errors.sql b/sql/updates/world/2013_09_19_01_world_db_errors.sql new file mode 100644 index 00000000000..ed6040a9558 --- /dev/null +++ b/sql/updates/world/2013_09_19_01_world_db_errors.sql @@ -0,0 +1,14 @@ +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=57910,`action_param2`=0,`action_param3`=0 WHERE `entryorguid`=30838 AND `source_type`=0 AND `id`=1 AND `link`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=57890,`action_param2`=0,`action_param3`=0,`target_type`=1,`target_x`=0,`target_y`=0,`target_z`=0,`target_o`=0 WHERE `entryorguid`=30838 AND `source_type`=0 AND `id`=7 AND `link`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=57916,`action_param2`=0,`action_param3`=0 WHERE `entryorguid`=30839 AND `source_type`=0 AND `id`=1 AND `link`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=57916,`action_param2`=0,`action_param3`=0,`target_type`=1,`target_x`=0,`target_y`=0,`target_z`=0,`target_o`=0 WHERE `entryorguid`=30839 AND `source_type`=0 AND `id`=7 AND `link`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=57910,`action_param2`=0,`action_param3`=0 WHERE `entryorguid`=30840 AND `source_type`=0 AND `id`=1 AND `link`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=57913,`action_param2`=0,`action_param3`=0 WHERE `entryorguid`=30840 AND `source_type`=0 AND `id`=4 AND `link`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=57910,`action_param2`=0,`action_param3`=0,`target_type`=1,`target_x`=0,`target_y`=0,`target_z`=0,`target_o`=0 WHERE `entryorguid`=30840 AND `source_type`=0 AND `id`=9 AND `link`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=34539,`action_param2`=0 WHERE `entryorguid` IN (1972300,1972400) AND `source_type`=9 AND `id`=0 AND `link`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=39217,`action_param2`=0,`action_param3`=0,`target_type`=1,`target_x`=0,`target_y`=0,`target_z`=0 WHERE `entryorguid`=2245801 AND `source_type`=9 AND `id`=7 AND `link`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=47303,`action_param2`=0,`action_param3`=0 WHERE `entryorguid`=2667800 AND `source_type`=9 AND `id` IN (0,1,2,3,4); +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=55383,`action_param2`=0,`action_param3`=0,`target_type`=0,`target_x`=0,`target_y`=0,`target_z`=0,`target_o`=0 WHERE `entryorguid`=2986100 AND `source_type`=9 AND `id`=0 AND `link`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=56243,`action_param2`=0,`action_param3`=0,`action_param5`=0 WHERE `entryorguid`=2991401 AND `source_type`=9 AND `id`=0 AND `link`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=46443 WHERE `entryorguid` IN (25753,25758) AND `source_type`=0 AND `id`=4 AND `link`=0; +UPDATE `smart_scripts` SET `action_type`=11,`action_param1`=46443 WHERE `entryorguid`=25792 AND `source_type`=0 AND `id`=2 AND `link`=0; -- cgit v1.2.3 From 2b9b2a7388703c6424aa8a9f00b10bffbc5fdc96 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Fri, 20 Sep 2013 13:16:04 +0200 Subject: DB/GameObject: Added gameobject "Dark Iron Mole Machine (Minion Summoner Trap)" --- sql/updates/world/2013_09_20_00_world_gameobject_template.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 sql/updates/world/2013_09_20_00_world_gameobject_template.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_20_00_world_gameobject_template.sql b/sql/updates/world/2013_09_20_00_world_gameobject_template.sql new file mode 100644 index 00000000000..7e1f1672f0c --- /dev/null +++ b/sql/updates/world/2013_09_20_00_world_gameobject_template.sql @@ -0,0 +1,3 @@ +DELETE FROM `gameobject_template` WHERE `entry`=188509; +INSERT INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`, `IconName`, `castBarCaption`, `unk1`, `faction`, `flags`, `size`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `data0`, `data1`, `data2`, `data3`, `data4`, `data5`, `data6`, `data7`, `data8`, `data9`, `data10`, `data11`, `data12`, `data13`, `data14`, `data15`, `data16`, `data17`, `data18`, `data19`, `data20`, `data21`, `data22`, `data23`, `AIName`, `ScriptName`, `WDBVerified`) VALUES +(188509, 6, 2770, 'Dark Iron Mole Machine (Minion Summoner Trap)', '', '', '', 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47375, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', '', 17371); -- cgit v1.2.3 From 4ddad6ec60835266e0078da9f73a32892e117963 Mon Sep 17 00:00:00 2001 From: Filip Date: Fri, 20 Sep 2013 22:59:10 +0200 Subject: DB/SAI: The Battle of Valhalas Quest Chain Fixes #8377 Consists of: 1) Battle at Valhalas: Fallen Heroes (13214) 2) Battle at Valhalas: Khit'rix the Dark Master (13215) 3) Battle at Valhalas: The Return of Sigrid Iceborn (13216) 4) Battle at Valhalas: Carnage! (13217) 5) Battle at Valhalas: Thane Deathblow (13218) 6) Battle at Valhalas: Final Challenge (13219) --- sql/updates/world/2013_09_20_01_world_sai.sql | 538 ++++++++++++++++++++++++++ 1 file changed, 538 insertions(+) create mode 100644 sql/updates/world/2013_09_20_01_world_sai.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_20_01_world_sai.sql b/sql/updates/world/2013_09_20_01_world_sai.sql new file mode 100644 index 00000000000..d6a0524cf00 --- /dev/null +++ b/sql/updates/world/2013_09_20_01_world_sai.sql @@ -0,0 +1,538 @@ +-- Quest Chain: http://www.wowhead.com/quest=13213/battle-at-valhalas#see-also +-- Battle at Valhalas: Fallen Heroes +-- Battle at Valhalas: Khit'rix the Dark Master +-- Battle at Valhalas: The Return of Sigrid Iceborn +-- Battle at Valhalas: Carnage! +-- Battle at Valhalas: Thane Deathblow +-- Battle at Valhalas: Final Challenge +SET @NPC_GEIRRVIF := 31135; +SET @QUEST_FALLENHEROES := 13214; +SET @NPC_ELDRETH_13214 := 31195; +SET @NPC_GENESS_13214 := 31193; +SET @NPC_JHADRAS_13214 := 31191; +SET @NPC_MASUD_13214 := 31192; +SET @NPC_RITH_13214 := 31196; +SET @NPC_TALLA_13214 := 31194; +SET @QUEST_KDARKMASTER := 13215; +SET @NPC_KHITRIX_13215 := 31222; +SET @NPC_BONESPIDER_13215 := 32484; +SET @QUEST_SIGRIDICEBORN := 13216; +SET @NPC_SIGRID_13216 := 31242; +SET @NPC_SIGRID_MOUNT := 30159; +SET @QUEST_CARNAGE := 13217; +SET @NPC_CARNAGE_13217 := 31271; +SET @QUEST_THANE := 13218; +SET @NPC_THANE_13218 := 31277; +SET @QUEST_FINCHAL := 13219; +SET @NPC_PRINCESAND_13219 := 14688; +SET @NPC_GENERIC_BUNNY := 24110; +SET @CHEER_SOUND := 14998; +SET @KILL_13214 := 20; +SET @WIPE_13214 := 19; +SET @CREDIT_13214 := 1; +SET @CREDIT_13215 := 2; +SET @CREDIT_13216 := 3; +SET @CREDIT_13217 := 4; +SET @CREDIT_13218 := 5; +SET @CREDIT_13219 := 6; +SET @DESPAWN_13219 := 7; +-- Quest Progression +UPDATE `creature_template` SET `InhabitType` = 4 WHERE `entry` = 31135; +UPDATE `quest_template` SET `PrevQuestId`=13213 WHERE `Id`=13214; +UPDATE `quest_template` SET `PrevQuestId`=13214 WHERE `Id`=13215; +UPDATE `quest_template` SET `PrevQuestId`=13215 WHERE `Id`=13216; +UPDATE `quest_template` SET `PrevQuestId`=13216 WHERE `Id`=13217; +UPDATE `quest_template` SET `PrevQuestId`=13217 WHERE `Id`=13218; +UPDATE `quest_template` SET `PrevQuestId`=13218 WHERE `Id`=13219; +-- Proper template data +UPDATE `creature_template` SET `minlevel`=80, `maxlevel`=80, `mindmg`=311, `maxdmg`=474, `attackpower`=478, `minrangedmg`=344, `maxrangedmg`=490, `rangedattackpower`=80 WHERE `entry`=31242; +UPDATE `creature_template` SET `minlevel`=80, `maxlevel`=80, `mindmg`=417, `maxdmg`=582, `attackpower`=608, `minrangedmg`=341, `maxrangedmg`=506, `rangedattackpower`=80 WHERE `entry`=31271; +UPDATE `creature_template` SET `minlevel`=80, `maxlevel`=80, `mindmg`=445, `maxdmg`=621, `attackpower`=642, `minrangedmg`=289, `maxrangedmg`=381, `rangedattackpower`=69 WHERE `entry`=31277; +UPDATE `creature_template` SET `mindmg`=217, `maxdmg`=389, `attackpower`=357, `minrangedmg`=211, `maxrangedmg`=378, `rangedattackpower`=80 WHERE `entry`=31192; +UPDATE `creature_template` SET `mindmg`=299, `maxdmg`=411, `attackpower`=394, `minrangedmg`=373, `maxrangedmg`=541, `rangedattackpower`=69 WHERE `entry`=31193; +UPDATE `creature_template` SET `mindmg`=254, `maxdmg`=371, `attackpower`=294, `minrangedmg`=344, `maxrangedmg`=490, `rangedattackpower`=80 WHERE `entry`=31194; +UPDATE `creature_template` SET `mindmg`=417, `maxdmg`=682, `attackpower`=608, `minrangedmg`=341, `maxrangedmg`=506, `rangedattackpower`=80 WHERE `entry`=31196; + -- Template updates for creature 31191 (Father Jhadras) +UPDATE `creature_template` SET `faction_A`=21,`faction_H`=21,`unit_flags`=`unit_flags`|32768 WHERE `entry`=31191; -- Father Jhadras +-- Equipment of 31191 (Father Jhadras) +DELETE FROM `creature_equip_template` WHERE `entry`=31191; +INSERT INTO `creature_equip_template` (`entry`,`id`,`itemEntry1`,`itemEntry2`,`itemEntry3`) VALUES +(31191,1,13220,0,0); +-- Model data 27584 (creature 31191 (Father Jhadras)) +UPDATE `creature_model_info` SET `bounding_radius`=0.173611,`combat_reach`=0.75,`gender`=0 WHERE `modelid`=27584; -- Father Jhadras +-- Addon data for creature 31191 (Father Jhadras) +DELETE FROM `creature_template_addon` WHERE `entry`=31191; +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(31191,0,0,1,0, NULL); -- Father Jhadras +-- Template updates for creature 31193 (Geness Half-Soul) +UPDATE `creature_template` SET `faction_A`=21,`faction_H`=21,`unit_flags`=`unit_flags`|32768 WHERE `entry`=31193; -- Geness Half-Soul +-- Model data 27580 (creature 31193 (Geness Half-Soul)) +UPDATE `creature_model_info` SET `bounding_radius`=0.1909721,`combat_reach`=0.825,`gender`=0 WHERE `modelid`=27580; -- Geness Half-Soul +-- Addon data for creature 31193 (Geness Half-Soul) +DELETE FROM `creature_template_addon` WHERE `entry`=31193; +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(31193,0,0,1,0, NULL); -- Geness Half-Soul +-- Template updates for creature 31192 (Masud) +UPDATE `creature_template` SET `faction_A`=21,`faction_H`=21,`unit_flags`=`unit_flags`|32768 WHERE `entry`=31192; -- Masud +-- Equipment of 31192 (Masud) +DELETE FROM `creature_equip_template` WHERE `entry`=31192; +INSERT INTO `creature_equip_template` (`entry`,`id`,`itemEntry1`,`itemEntry2`,`itemEntry3`) VALUES +(31192,1,30388,0,0); +-- Model data 27582 (creature 31192 (Masud)) +UPDATE `creature_model_info` SET `bounding_radius`=0.2951387,`combat_reach`=1.275,`gender`=0 WHERE `modelid`=27582; -- Masud +-- Addon data for creature 31192 (Masud) +DELETE FROM `creature_template_addon` WHERE `entry`=31192; +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(31192,0,0,1,0, NULL); -- Masud +-- Template updates for creature 31196 (Rith) +UPDATE `creature_template` SET `faction_A`=21,`faction_H`=21,`unit_flags`=`unit_flags`|32768 WHERE `entry`=31196; -- Rith +-- Equipment of 31196 (Rith) +DELETE FROM `creature_equip_template` WHERE `entry`=31196; +INSERT INTO `creature_equip_template` (`entry`,`id`,`itemEntry1`,`itemEntry2`,`itemEntry3`) VALUES +(31196,1,29631,0,0); +-- Model data 27583 (creature 31196 (Rith)) +UPDATE `creature_model_info` SET `bounding_radius`=0.2083332,`combat_reach`=0.9,`gender`=0 WHERE `modelid`=27583; -- Rith +-- Addon data for creature 31196 (Rith) +DELETE FROM `creature_template_addon` WHERE `entry`=31196; +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(31196,0,0,1,0, NULL); -- Rith +-- Template updates for creature 31194 (Talla) +UPDATE `creature_template` SET `faction_A`=21,`faction_H`=21,`unit_flags`=`unit_flags`|32768,`unit_class`=4 WHERE `entry`=31194; -- Talla +-- Equipment of 31194 (Talla) +DELETE FROM `creature_equip_template` WHERE `entry`=31194; +INSERT INTO `creature_equip_template` (`entry`,`id`,`itemEntry1`,`itemEntry2`,`itemEntry3`) VALUES +(31194,1,34283,0,0); +-- Model data 27906 (creature 31194 (Talla)) +UPDATE `creature_model_info` SET `bounding_radius`=0.1562499,`combat_reach`=0.675,`gender`=0 WHERE `modelid`=27906; -- Talla +-- Addon data for creature 31194 (Talla) +DELETE FROM `creature_template_addon` WHERE `entry`=31194; +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(31194,0,0,1,0, NULL); -- Talla +-- Template updates for creature 31222 (Khit'rix the Dark Master) +UPDATE `creature_template` SET `faction_A`=21,`faction_H`=21,`unit_flags`=`unit_flags`|33600 WHERE `entry`=31222; +-- Khit'rix the Dark Master +-- Model data 25269 (creature 31222 (Khit'rix the Dark Master)) +UPDATE `creature_model_info` SET `bounding_radius`=1.24,`combat_reach`=4,`gender`=0 WHERE `modelid`=25269; -- Khit'rix the Dark Master +-- Addon data for creature 31222 (Khit'rix the Dark Master) +DELETE FROM `creature_template_addon` WHERE `entry`=31222; +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(31222,0,0,1,0, NULL); -- Khit'rix the Dark Master +-- Template updates for creature 31242 (Sigrid Iceborn) +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`exp`=2,`minlevel`=80,`maxlevel`=80,`unit_flags`=`unit_flags`|33600 WHERE `entry`=31242; -- Sigrid Iceborn +-- Equipment of 31242 (Sigrid Iceborn) +DELETE FROM `creature_equip_template` WHERE `entry`=31242; +INSERT INTO `creature_equip_template` (`entry`,`id`,`itemEntry1`,`itemEntry2`,`itemEntry3`) VALUES +(31242,1,40436,0,0); +-- Model data 27528 (creature 31242 (Sigrid Iceborn)) +UPDATE `creature_model_info` SET `bounding_radius`=0.465,`combat_reach`=1.5,`gender`=1 WHERE `modelid`=27528; +-- Sigrid Iceborn +-- Addon data for creature 31242 (Sigrid Iceborn) +DELETE FROM `creature_template_addon` WHERE `entry`=31242; +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(31242,0,0,1,0, ''); +-- Sigrid Iceborn +UPDATE `creature_template` SET `speed_run`=3.14286 WHERE `entry`=30159; +-- Sigrid Iceborn's Proto Drake +DELETE FROM `creature_template_addon` WHERE `entry`=30159; +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(30159,0,33554432,1,0, ''); -- Addon data for creature 30159 (Sigrid Iceborn's Proto Drake) +-- Template updates for creature 31271 (Carnage) +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`exp`=2,`minlevel`=80,`maxlevel`=80,`unit_flags`=`unit_flags`|33600 WHERE `entry`=31271; -- Carnage +-- Model data 24301 (creature 31271 (Carnage)) +UPDATE `creature_model_info` SET `bounding_radius`=0.62,`combat_reach`=9,`gender`=0 WHERE `modelid`=24301; -- Carnage +-- Addon data for creature 31271 (Carnage) +DELETE FROM `creature_template_addon` WHERE `entry`=31271; +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(31271,0,0,1,0, NULL); -- Carnage +-- Template updates for creature 31277 (Thane Banahogg) +UPDATE `creature_template` SET `faction_A`=2116,`faction_H`=2116,`exp`=2,`minlevel`=80,`maxlevel`=80,`unit_flags`=`unit_flags`|33600,`speed_walk`=1.6,`speed_run`=1.71429 WHERE `entry`=31277; -- Thane Banahogg +-- Equipment of 31277 (Thane Banahogg) +DELETE FROM `creature_equip_template` WHERE `entry`=31277; +INSERT INTO `creature_equip_template` (`entry`,`id`,`itemEntry1`,`itemEntry2`,`itemEntry3`) VALUES +(31277,1,43578,0,0); +-- Model data 27551 (creature 31277 (Thane Banahogg)) +UPDATE `creature_model_info` SET `bounding_radius`=0.6076385,`combat_reach`=2.625,`gender`=0 WHERE `modelid`=27551; -- Thane Banahogg +-- Addon data for creature 31277 (Thane Banahogg) +DELETE FROM `creature_template_addon` WHERE `entry`=31277; +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(31277,0,0,1,0, NULL); -- Thane Banahogg +-- Template updates for creature 14688 (Prince Sandoval) +UPDATE `creature_template` SET `faction_A`=21,`faction_H`=21,`unit_flags`=`unit_flags`|33600,`speed_walk`=2,`speed_run`=2.14286 WHERE `entry`=14688; -- Prince Sandoval +-- Equipment of 14688 (Prince Sandoval) +DELETE FROM `creature_equip_template` WHERE `entry`=14688; +INSERT INTO `creature_equip_template` (`entry`,`id`,`itemEntry1`,`itemEntry2`,`itemEntry3`) VALUES +(14688,1,31311,0,0); +-- Model data 27555 (creature 14688 (Prince Sandoval)) +UPDATE `creature_model_info` SET `bounding_radius`=0.62,`combat_reach`=2,`gender`=0 WHERE `modelid`=27555; -- Prince Sandoval +-- Addon data for creature 14688 (Prince Sandoval) +DELETE FROM `creature_template_addon` WHERE `entry`=14688; +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(14688,0,0,0,0, NULL); -- Prince Sandoval + +UPDATE `creature_template` SET `faction_A`=16, `faction_H`=16, `AIName`='SmartAI' WHERE `entry` IN (@NPC_ELDRETH_13214, @NPC_GENESS_13214, @NPC_JHADRAS_13214, @NPC_MASUD_13214, @NPC_TALLA_13214, @NPC_RITH_13214); +DELETE FROM `smart_scripts` WHERE `entryorguid`=@NPC_ELDRETH_13214 AND `source_type`=0; +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 +(@NPC_ELDRETH_13214, 0, 0, 0, 0, 0, 80, 0, 0, 0, 6000, 12000, 11, 34829, 2, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 'Eldreth - IC - Cast Arcane Shot'), +(@NPC_ELDRETH_13214, 0, 1, 0, 0, 0, 80, 0, 10000, 20000, 10000, 20000, 11, 44475, 2, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 'Eldreth - IC - Cast Magic Dampening Field'), +(@NPC_ELDRETH_13214, 0, 2, 0, 9, 0, 80, 0, 5, 30, 3000, 6000, 11, 15620, 2, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 'Eldreth - On range - Cast Shoot'), +(@NPC_ELDRETH_13214, 0, 3, 0, 6, 0, 100, 1, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 11, @NPC_GENERIC_BUNNY, 100, 0, 0, 0, 0, 0, 'Eldreth - On death - Set Data'), +(@NPC_ELDRETH_13214, 0, 4, 0, 21, 0, 100, 0, 0, 0, 0, 0, 41, 1000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Eldreth - On reach home - Despawn self'), +(@NPC_ELDRETH_13214, 0, 5, 0, 21, 0, 100, 0, 0, 0, 0, 0, 45, @WIPE_13214, @WIPE_13214, 0, 0, 0, 0, 11, @NPC_GEIRRVIF, 100, 0, 0, 0, 0, 0, 'Eldreth - On reach home - Set Data'), +(@NPC_ELDRETH_13214, 0, 6, 0, 5, 0, 100, 0, 0, 0, 0, 0, 45, @KILL_13214, @KILL_13214, 0, 0, 0, 0, 11, @NPC_GEIRRVIF, 100, 0, 0,0, 0, 0, 'Eldreth - On kill target - Set Data'); + +DELETE FROM `smart_scripts` WHERE `entryorguid`=@NPC_GENESS_13214 AND `source_type`=0; +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 +(@NPC_GENESS_13214, 0, 0, 0, 0, 0, 80, 0, 2000, 6000, 3000, 7000, 11, 61041, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Geness Half-Soul - IC - Cast Brutal Fist'), +(@NPC_GENESS_13214, 0, 1, 0, 13, 0, 80, 0, 10000, 15000, 0, 0, 11, 46182, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Geness Half-Soul - On target Cast - Cast Snap Kick'), +(@NPC_GENESS_13214, 0, 2, 0, 6, 0, 100, 1, 0, 0, 0, 0, 45, 2, 2, 0, 0, 0, 0, 11, @NPC_GENERIC_BUNNY, 100, 0, 0, 0, 0, 0, 'Geness Half-Soul - On death - Set Data'), +(@NPC_GENESS_13214, 0, 3, 0, 21, 0, 100, 0, 0, 0, 0, 0, 41, 1000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Geness Half-Soul - On reach home - Despawn self'), +(@NPC_GENESS_13214, 0, 4, 0, 5, 0, 100, 0, 0, 0, 0, 0, 45, @KILL_13214, @KILL_13214, 0, 0, 0, 0, 11, @NPC_GEIRRVIF, 100, 0, 0, 0, 0, 0, 'Geness Half-Soul - On kill target - Set Data'), +(@NPC_GENESS_13214, 0, 5, 0, 21, 0, 100, 0, 0, 0, 0, 0, 45, @WIPE_13214, @WIPE_13214, 0, 0, 0, 0, 11, @NPC_GEIRRVIF, 100, 0, 0, 0, 0, 0, 'Geness Half-Soul - On reach home - Set Data'); + +DELETE FROM `smart_scripts` WHERE `entryorguid`=@NPC_JHADRAS_13214 AND `source_type`=0; +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 +(@NPC_JHADRAS_13214, 0, 0, 0, 14, 0, 80, 0, 50, 40, 10000, 30000, 11, 15586, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Father Jhadras - On friendly hp deficit - Cast Heal'), +(@NPC_JHADRAS_13214, 0, 1, 0, 0, 0, 80, 0, 0, 3000, 8000, 12000, 11, 25054, 0, 0, 0, 0, 0, 5, 0, 0, 40, 0, 0, 0, 0, 'Father Jhadras - IC - Cast Holy Smite'), +(@NPC_JHADRAS_13214, 0, 2, 0, 6, 0, 100, 1, 0, 0, 0, 0, 45, 3, 3, 0, 0, 0, 0, 11, @NPC_GENERIC_BUNNY, 100, 0, 0, 0, 0, 0, 'Father Jhadras - On death - Set Data'), +(@NPC_JHADRAS_13214, 0, 3, 0, 21, 0, 100, 0, 0, 0, 0, 0, 41, 5000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Father Jhadras - On reach home - Despawn self'), +(@NPC_JHADRAS_13214, 0, 4, 0, 5, 0, 100, 0, 0, 0, 0, 0, 45, @KILL_13214, @KILL_13214, 0, 0, 0, 0, 11, @NPC_GEIRRVIF, 100, 0, 0, 0, 0, 0, 'Father Jhadras - On kill target - Set Data'), +(@NPC_JHADRAS_13214, 0, 5, 0, 21, 0, 100, 0, 0, 0, 0, 0, 45, @WIPE_13214, @WIPE_13214, 0, 0, 0, 0, 11, @NPC_GEIRRVIF, 100, 0, 0, 0, 0,0, 'Father Jhadras - On reach home - Set Data'); + +DELETE FROM `smart_scripts` WHERE `entryorguid`=@NPC_MASUD_13214 AND `source_type`=0; +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 +(@NPC_MASUD_13214, 0, 0, 0, 0, 0, 80, 0, 0, 0, 15000, 25000, 11, 41056, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Masud - IC - Cast Whirlwind'), +(@NPC_MASUD_13214, 0, 1, 0, 0, 0, 80, 0, 0, 0, 10000, 20000, 11, 15496, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Masud - IC - Cast Cleave'), +(@NPC_MASUD_13214, 0, 2, 0, 6, 0, 100, 1, 0, 0, 0, 0, 45, 4, 4, 0, 0, 0, 0, 11, @NPC_GENERIC_BUNNY, 100, 0, 0, 0, 0, 0, 'Masud - On death - Set Data'), +(@NPC_MASUD_13214, 0, 3, 0, 21, 0, 100, 0, 0, 0, 0, 0, 41, 1000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Masud - On reach home - Despawn self'), +(@NPC_MASUD_13214, 0, 4, 0, 5, 0, 100, 0, 0, 0, 0, 0, 45, @KILL_13214, @KILL_13214, 0, 0, 0, 0, 11, @NPC_GEIRRVIF, 100, 0, 0, 0, 0, 0, 'Masud - On kill target - Set Data'), +(@NPC_MASUD_13214, 0, 5, 0, 21, 0, 100, 0, 0, 0, 0, 0, 45, @WIPE_13214, @WIPE_13214, 0, 0, 0, 0, 11, @NPC_GEIRRVIF, 100, 0, 0, 0, 0,0, 'Masud - On reach home - Set Data'); + +DELETE FROM `smart_scripts` WHERE `entryorguid`=@NPC_RITH_13214 AND `source_type`=0; +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 +(@NPC_RITH_13214, 0, 0, 0, 0, 0, 80, 0, 0, 0, 10000, 20000, 11, 61044, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Rith - IC - Cast Demoralizing Shout'), +(@NPC_RITH_13214, 0, 1, 0, 0, 0, 80, 0, 0, 0, 20000, 30000, 11, 58461, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Rith - IC - Cast Sunder Armor'), +(@NPC_RITH_13214, 0, 2, 0, 6, 0, 100, 1, 0, 0, 0, 0, 45, 5, 5, 0, 0, 0, 0, 11, @NPC_GENERIC_BUNNY, 100, 0, 0, 0, 0, 0, 'Rith - On death - Set Data'), +(@NPC_RITH_13214, 0, 3, 0, 21, 0, 100, 0, 0, 0, 0, 0, 41, 1000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rith - On reach home - Despawn self'), +(@NPC_RITH_13214, 0, 4, 0, 5, 0, 100, 0, 0, 0, 0, 0, 45, @KILL_13214, @KILL_13214, 0, 0, 0, 0, 11, @NPC_GEIRRVIF, 100, 0, 0, 0, 0, 0, 'Rith - On kill target - Set Data'), +(@NPC_RITH_13214, 0, 5, 0, 21, 0, 100, 0, 0, 0, 0, 0, 45, @WIPE_13214, @WIPE_13214, 0, 0, 0, 0, 11, @NPC_GEIRRVIF, 100, 0, 0, 0, 0,0, 'Rith - On reach home - Set Data'); + +DELETE FROM `smart_scripts` WHERE `entryorguid`=@NPC_TALLA_13214 AND `source_type`=0; +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 +(@NPC_TALLA_13214, 0, 0, 0, 0, 0, 80, 0, 0, 0, 5000, 15000, 11, 14873, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Talla - IC - Cast Sinister Strike '), +(@NPC_TALLA_13214, 0, 1, 0, 0, 0, 80, 0, 0, 0, 20000, 25000, 11, 30981, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Talla - IC - Cast Crippling PoisOn '), +(@NPC_TALLA_13214, 0, 2, 0, 6, 0, 100, 1, 0, 0, 0, 0, 45, 6, 6, 0, 0, 0, 0, 11, @NPC_GENERIC_BUNNY, 100, 0, 0, 0, 0, 0, 'Talla - On death - Set Data'), +(@NPC_TALLA_13214, 0, 3, 0, 21, 0, 100, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Talla - On reach home - Despawn self'), +(@NPC_TALLA_13214, 0, 4, 0, 5, 0, 100, 0, 0, 0, 0, 0, 45, @KILL_13214, @KILL_13214, 0, 0, 0, 0, 11, @NPC_GEIRRVIF, 100, 0, 0, 0, 0, 0, 'Talla - On kill target - Set Data'), +(@NPC_TALLA_13214, 0, 5, 0, 21, 0, 100, 0, 0, 0, 0, 0, 45, @WIPE_13214, @WIPE_13214, 0, 0, 0, 0, 11, @NPC_GEIRRVIF, 100, 0, 0, 0, 0,0, 'Talla - On reach home - Set Data'); + +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@NPC_GENERIC_BUNNY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@NPC_GENERIC_BUNNY AND `source_type`=0; +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 +(@NPC_GENERIC_BUNNY, 0, 0, 0, 38, 0, 100, 1, 1, 1, 0, 0, 23, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Kill trigger - On data set - increment phase 1(1)'), +(@NPC_GENERIC_BUNNY, 0, 1, 0, 38, 0, 100, 1, 2, 2, 0, 0, 23, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Kill trigger - On data set - increment phase 2(2)'), +(@NPC_GENERIC_BUNNY, 0, 2, 0, 38, 0, 100, 1, 3, 3, 0, 0, 23, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Kill trigger - On data set - increment phase 3(4)'), +(@NPC_GENERIC_BUNNY, 0, 3, 0, 38, 0, 100, 1, 4, 4, 0, 0, 23, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Kill trigger - On data set - increment phase 4(8)'), +(@NPC_GENERIC_BUNNY, 0, 4, 0, 38, 0, 100, 1, 5, 5, 0, 0, 23, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Kill trigger - On data set - increment phase 5(16)'), +(@NPC_GENERIC_BUNNY, 0, 5, 0, 38, 0, 100, 1, 6, 6, 0, 0, 23, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Kill trigger - On data set - increment phase 6(32)'), +(@NPC_GENERIC_BUNNY, 0, 6, 7, 1, 32, 100, 1, 0, 0, 0, 0, 45, @CREDIT_13214, @CREDIT_13214, 0, 0, 0, 0, 11, @NPC_GEIRRVIF, 100, 0, 0, 0, 0, 0, 'Kill trigger - On phase 6(32) - Set Data'), +(@NPC_GENERIC_BUNNY, 0, 7, 0, 61, 32, 100, 0, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Kill trigger - On phase 6(32) - Set Phase 0'); + +UPDATE `creature_template` SET `faction_A`=16, `faction_H`=16, `AIName`='SmartAI', `unit_flags`=0 WHERE `entry`=@NPC_KHITRIX_13215; +DELETE FROM `creature_text` WHERE `entry`=@NPC_KHITRIX_13215; +INSERT INTO `creature_text` VALUES +(@NPC_KHITRIX_13215,0,0,'When I am done here, I am going to mount your heads upon the walls of Azjol-Nerub!',14,0,0,0,0,0,'Dark Master say 1'); + +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@NPC_KHITRIX_13215, @NPC_KHITRIX_13215*100); +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 +(@NPC_KHITRIX_13215, 0, 0, 0, 0, 0, 80, 0, 0, 0, 10000, 20000, 11, 38243, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 'Khitrix the Dark Master - IC - Cast Mind Flay'), +(@NPC_KHITRIX_13215, 0, 1, 0, 0, 0, 80, 0, 5000, 25000, 5000, 25000, 11, 22884, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Khitrix the Dark Master - IC - Cast Psychic Scream'), +(@NPC_KHITRIX_13215, 0, 2, 0, 0, 0, 80, 0, 10000, 15000, 120000, 180000, 11, 61055, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Khitrix the Dark Master - IC - Cast Bone Spiders'), +(@NPC_KHITRIX_13215, 0, 3, 0, 54, 0, 100, 0, 0, 0, 0, 0, 80, @NPC_KHITRIX_13215*100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Khitrix the Dark Master - On summon - Call script 1'), +-- +(@NPC_KHITRIX_13215*100, 9, 0, 0, 1, 0, 100, 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 8197.6045, 3502.557, 625.108032, 0.585, 'Khitrix the Dark Master - OOC script 1 - Move to position'), +(@NPC_KHITRIX_13215*100, 9, 1, 0, 1, 0, 100, 1, 4000, 4000, 0, 0, 1, 0, 10, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Khitrix the Dark Master - OOC script 1 - Say 1'), +-- +(@NPC_KHITRIX_13215, 0, 5, 0, 1, 0, 100, 0, 500, 500, 0, 0, 49, 0, 0, 0, 0, 0, 0, 21, 50, 0, 0, 0, 0, 0, 0, 'Khitrix the Dark Master - OOC - Start Attack'), +(@NPC_KHITRIX_13215, 0, 6, 0, 5, 0, 100, 0, 0, 0, 0, 0, 45, @KILL_13214, @KILL_13214, 0, 0, 0, 0, 11, @NPC_GEIRRVIF, 100, 0, 0, 0, 0, 0, 'Khitrix the Dark Master - On Kill target - Set Data'), +(@NPC_KHITRIX_13215, 0, 7, 0, 6, 0, 100, 0, 0, 0, 1, 0, 45, @CREDIT_13215, @CREDIT_13215, 0, 0, 0, 0, 11, @NPC_GEIRRVIF, 100, 0, 0, 0, 0, 0, 'Khitrix the Dark Master - On Death - Set Data'), +(@NPC_KHITRIX_13215, 0, 8, 0, 1, 0, 100, 1, 30000, 30000, 0, 0, 45, @WIPE_13214, @WIPE_13214, 0, 0, 0, 0, 11, @NPC_GEIRRVIF, 100, 0, 0, 0, 0, 0, 'Khitrix the Dark Master - OOC - Set Data'); + +UPDATE `creature_template` SET `exp`=0, `mindmg`=200, `maxdmg`=300, `dmg_multiplier`=2, `AIName`='SmartAI',`Health_mod`=1 WHERE `entry`=@NPC_BONESPIDER_13215; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@NPC_BONESPIDER_13215 AND `source_type`=0; +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 +(@NPC_BONESPIDER_13215, 0, 0, 0, 0, 0, 80, 0, 0, 0, 10000, 20000, 11, 744, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 'Bone spiders - IC - Cast Poison'), +(@NPC_BONESPIDER_13215, 0, 1, 0, 1, 0, 100, 0, 500, 500, 0, 0, 49, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 'Bone Spiders - OOC - Start Attack Random Player'); + +DELETE FROM `creature_text` WHERE `entry` IN (@NPC_SIGRID_13216); +INSERT INTO `creature_text` VALUES +(@NPC_SIGRID_13216,0,0,'Ah, there you are! Remember me? Of course you do! Wait right there, I''m coming down.',14,0,0,0,0,0,'Sigrid Iceborn say 1'), +(@NPC_SIGRID_13216,1,0,'I told you I''d be better prepared when next we met. I''ve fought and won the Hyldsmeet, trained at Valkyrion, and here I am. Come and get some!',14,0,0,0,0,0,'Sigrid Iceborn say 2'); + +-- Sigrid Flight WP's +DELETE FROM `waypoints` WHERE entry =@NPC_SIGRID_MOUNT; +INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES +(@NPC_SIGRID_MOUNT, 1, 8258.836, 3599.048, 677.6457, ''), +(@NPC_SIGRID_MOUNT, 2, 8258.059, 3598.419, 677.6457, ''), +(@NPC_SIGRID_MOUNT, 3, 8217.432, 3554.571, 677.6457, ''), +(@NPC_SIGRID_MOUNT, 4, 8169.096, 3473.421, 677.6457, ''), +(@NPC_SIGRID_MOUNT, 5, 8200.269, 3417.768, 673.563, ''), +(@NPC_SIGRID_MOUNT, 6, 8281.517, 3453.952, 673.535, ''), +(@NPC_SIGRID_MOUNT, 7, 8278.022, 3504.947, 677.6457, ''), +(@NPC_SIGRID_MOUNT, 8, 8222.471, 3532.925, 631.09, ''), +(@NPC_SIGRID_MOUNT, 9, 8222.471, 3532.925, 631.09, ''); + +UPDATE `creature_template` SET `InhabitType` =1 WHERE `entry` =@NPC_SIGRID_13216; +UPDATE `creature_template` SET `InhabitType` =7 WHERE `entry` =@NPC_SIGRID_MOUNT; +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`IN (@NPC_SIGRID_13216,@NPC_SIGRID_MOUNT); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@NPC_SIGRID_13216, @NPC_SIGRID_13216*100,@NPC_SIGRID_MOUNT); +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 +(@NPC_SIGRID_13216, 0, 0, 0, 9, 0, 80, 0, 0, 2, 15000, 30000, 11, 57635, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Sigrid Iceborn - On range - Cast Disengage'), +(@NPC_SIGRID_13216, 0, 1, 2, 9, 0, 80, 0, 0, 3, 10000, 30000, 11, 61170, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Sigrid Iceborn - IC - Cast Flash Freeze'), +(@NPC_SIGRID_13216, 0, 2, 0, 61, 0, 80, 0, 0, 0, 0, 0, 89, 30, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Sigrid Iceborn - On Link - Set Random Movement'), +(@NPC_SIGRID_13216, 0, 3, 0, 1, 0, 100, 1, 0, 0, 0, 0, 11, 61165, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Sigrid Iceborn - IC - Cast Frostbite Weapon'), +(@NPC_SIGRID_13216, 0, 4, 0, 9, 0, 80, 0, 5, 30, 5000, 25000, 11, 61168, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 'Sigrid Iceborn - On range - Cast Throw'), +(@NPC_SIGRID_13216, 0, 5, 0, 9, 0, 100, 0, 30, 100, 0, 0, 21, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Sigrid Iceborn - Start Moving - Not in Throw Range'), +(@NPC_SIGRID_13216, 0, 6, 0, 9, 0, 100, 0, 9, 15, 0, 0, 21, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Sigrid Iceborn - In Range - Stop Moving at 15 Yard'), +(@NPC_SIGRID_13216, 0, 7, 0, 9, 0, 100, 0, 0, 5, 0, 0, 21, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Sigrid Iceborn - Start Moving - Not in Throw Range'), +(@NPC_SIGRID_13216, 0, 8, 0, 9, 0, 100, 0, 5, 30, 0, 0, 21, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Sigrid Iceborn - Stop Moving - In Throw Range'), +(@NPC_SIGRID_13216, 0, 9, 0, 54, 0, 100, 0, 0, 0, 0, 0, 80, @NPC_SIGRID_13216*100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Sigrid Iceborn - On summon - Call script 1'), +-- +(@NPC_SIGRID_13216*100, 9, 0, 0, 0, 0, 100, 0, 2000, 2000, 2000, 2000, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Sigrid Iceborn - On summon script 1 - Say 1'), +-- +(@NPC_SIGRID_13216, 0, 10, 0, 5, 0, 100, 0, 0, 0, 0, 0, 45, @KILL_13214, @KILL_13214, 0, 0, 0, 0, 11, @NPC_GEIRRVIF, 100, 0, 0, 0, 0, 0, 'Sigrid Iceborn - On kill target - Set Data'), +(@NPC_SIGRID_13216, 0, 11, 0, 6, 0, 100, 0, 0, 0, 1, 0, 45, @CREDIT_13216, @CREDIT_13216, 0, 0, 0, 0, 11, @NPC_GEIRRVIF, 100, 0, 0, 0, 0, 0, 'Sigrid Iceborn - On death - Set Data'), +(@NPC_SIGRID_13216, 0, 12, 0, 1, 0, 100, 1, 30000, 30000, 0, 0, 45, @WIPE_13214, @WIPE_13214, 0, 0, 0, 0, 11, @NPC_GEIRRVIF, 100, 0, 0, 0, 0, 0, 'Sigrid Iceborn - OOC - Set Data'), +-- +(@NPC_SIGRID_MOUNT, 0, 0, 0, 27, 0, 100, 0, 0, 0, 0, 0, 53, 1, @NPC_SIGRID_MOUNT, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Sigrid Iceborn Mount - On Respawn - Start WP movement'), +(@NPC_SIGRID_MOUNT, 0, 1, 2, 40, 0, 100, 1, 9, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Sigrid Iceborn Mount - On WP reached - Despawn'), +(@NPC_SIGRID_MOUNT, 0, 2, 0, 61, 0, 100, 1, 9, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 11, @NPC_SIGRID_13216, 20, 0, 0, 0, 0, 0, 'Sigrid Iceborn Mount - On WP reached - Set Data on Sigrid'), +-- +(@NPC_SIGRID_13216, 0, 13, 14, 54, 0, 100, 1, 0, 0, 0, 0, 12, @NPC_SIGRID_MOUNT, 7, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Sigrid Iceborn - On Link - Summon Mount'), +(@NPC_SIGRID_13216, 0, 14, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 46598, 7, 0, 0, 0, 0, 11, @NPC_SIGRID_MOUNT, 100, 0, 0, 0, 0, 0, 'Sigrid Iceborn - On Link - Mount Sigrid''s Proto Drake'), +(@NPC_SIGRID_13216, 0, 15, 16, 38, 0, 100, 1, 1, 1, 0, 0, 101, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Sigrid Iceborn - On WP reached - Start Attack'), +(@NPC_SIGRID_13216, 0, 16, 17, 61, 0, 100, 1, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 21, 50, 0, 0, 0, 0, 0, 0, 'Sigrid Iceborn - On WP reached - Start Attack'), +(@NPC_SIGRID_13216, 0, 17, 0, 61, 0, 100, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Sigrid Iceborn - On Link - Say 2'); + +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@NPC_CARNAGE_13217; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@NPC_CARNAGE_13217, @NPC_CARNAGE_13217*100); +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 +(@NPC_CARNAGE_13217, 0, 1, 0, 0, 0, 80, 0, 10000, 30000, 20000, 40000, 11, 61065, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 'Carnage - IC - Cast War Stomp'), +(@NPC_CARNAGE_13217, 0, 2, 0, 0, 0, 80, 0, 5000, 12000, 5000, 12000, 11, 61070, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Carnage - IC - Cast Smash'), +(@NPC_CARNAGE_13217, 0, 3, 0, 54, 0, 100, 0, 0, 0, 0, 0, 80, @NPC_CARNAGE_13217*100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Carnage - On summon - Call script 1'), +-- +(@NPC_CARNAGE_13217*100, 9, 0, 0, 1, 0, 100, 1, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 8193.264648, 3496.165771, 625.067322, 0.746269, 'Carnage - OOC script 1 - Move to position'), +-- +(@NPC_CARNAGE_13217, 0, 4, 0, 1, 0, 100, 0, 5000, 5000, 0, 0, 49, 0, 0, 0, 0, 0, 0, 21, 70, 0, 0, 0, 0, 0, 0, 'Carnage - OOC - Start Attack'), +(@NPC_CARNAGE_13217, 0, 5, 0, 5, 0, 100, 0, 0, 0, 0, 0, 45, @KILL_13214, @KILL_13214, 0, 0, 0, 0, 11, @NPC_GEIRRVIF, 100, 0, 0, 0, 0, 0, 'Carnage - On kill target - Set Data'), +(@NPC_CARNAGE_13217, 0, 6, 0, 6, 0, 100, 0, 0, 0, 1, 0, 45, @CREDIT_13217, @CREDIT_13217, 0, 0, 0, 0, 11, @NPC_GEIRRVIF, 100, 0, 0, 0, 0, 0, 'Carnage - On death - Set Data'), +(@NPC_CARNAGE_13217, 0, 7, 0, 1, 0, 100, 1, 30000, 30000, 0, 0, 45, @WIPE_13214, @WIPE_13214, 0, 0, 0, 0, 11, @NPC_GEIRRVIF, 100, 0, 0, 0, 0, 0, 'Carnage - OOC - Set Data'); + +DELETE FROM `creature_text` WHERE `entry` IN (@NPC_THANE_13218); +INSERT INTO `creature_text` VALUES +(@NPC_THANE_13218,0,0,'ENOUGH! You tiny insects are not worthy to do battle within this sacred place!.',14,0,0,0,0,0,'Thane say 1'), +(@NPC_THANE_13218,1,0,'Fight me and die you cowards!',14,0,0,0,0,0,'Thane say 2'), +(@NPC_THANE_13218,2,0,'Haraak foln! ',12,0,0,0,0,0,'Thane say 3'); + +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@NPC_THANE_13218; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@NPC_THANE_13218, @NPC_THANE_13218*100); +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 +(@NPC_THANE_13218, 0, 1, 0, 0, 0, 80, 0, 5000, 10000, 15000, 20000, 11, 13737, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Thane Banahogg - IC - Cast Mortal Strike'), +(@NPC_THANE_13218, 0, 2, 0, 0, 0, 80, 0, 5000, 10000, 5000, 10000, 11, 61133, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Thane Banahogg - IC - Cast Punt'), +(@NPC_THANE_13218, 0, 3, 0, 0, 0, 100, 0, 20000, 20000, 20000, 30000, 11, 61134, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 'Thane Banahogg - IC - Cast Leap'), +(@NPC_THANE_13218, 0, 5, 0, 12, 0, 100, 0, 0, 20, 5000, 10000, 11, 61140, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Thane Banahogg - On %hp - Cast Execute'), +(@NPC_THANE_13218, 0, 6, 0, 54, 0, 100, 0, 0, 0, 0, 0, 80, @NPC_THANE_13218*100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Thane Banahogg - On summon - call script 1'), +-- +(@NPC_THANE_13218*100, 9, 0, 0, 0, 0, 100, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Thane Banahogg - OOC script 1 - say 1'), +(@NPC_THANE_13218*100, 9, 1, 0, 0, 0, 100, 1, 5000, 5000, 0, 0, 97, 25, 30, 0, 0, 0, 0, 1, 0, 0, 0, 8169.0015, 3477.075, 626.4695, 0.673769, 'Thane Banahogg - OOC script 1 - Jump to position'), +(@NPC_THANE_13218*100, 9, 2, 0, 0, 0, 100, 1, 2000, 2000, 0, 0, 101, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Thane Banahogg - OOC script 1 - Set Home Pos'), +(@NPC_THANE_13218*100, 9, 3, 0, 0, 0, 100, 1, 1500, 1500, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Thane Banahogg - OOC script 1 - Say 2'), +(@NPC_THANE_13218*100, 9, 4, 0, 0, 0, 100, 1, 1000, 1000, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Thane Banahogg - OOC script 1 - Say 3'), +-- +(@NPC_THANE_13218, 0, 8, 0, 1, 0, 100, 0, 12000, 12000, 0, 0, 49, 0, 0, 0, 0, 0, 0, 21, 100, 0, 0, 0, 0, 0, 0, 'Thane Banahogg - OOC - Start Attack'), +(@NPC_THANE_13218, 0, 9, 0, 5, 0, 100, 0, 0, 0, 0, 0, 45, @KILL_13214, @KILL_13214, 0, 0, 0, 0, 11, @NPC_GEIRRVIF, 100, 0, 0, 0, 0, 0, 'Thane Banahogg - On kill target - Set Data'), +(@NPC_THANE_13218, 0, 10, 0, 6, 0, 100, 0, 0, 0, 1, 0, 45, @CREDIT_13218, @CREDIT_13218, 0, 0, 0, 0, 11, @NPC_GEIRRVIF, 100, 0, 0, 0, 0, 0, 'Thane Banahogg - On death - Set Data'), +(@NPC_THANE_13218, 0, 11, 0, 1, 0, 100, 1, 30000, 30000, 0, 0, 45, @WIPE_13214, @WIPE_13214, 0, 0, 0, 0, 11, @NPC_GEIRRVIF, 100, 0, 0, 0, 0, 0, 'Thane Banahogg - OOC - Set Data'); + +DELETE FROM `creature_text` WHERE `entry` IN (@NPC_PRINCESAND_13219); +INSERT INTO `creature_text` VALUES +(@NPC_PRINCESAND_13219,0,0,'Hardly a fitting introduction , Spear-Wife. Now, who is this outsider that I''ve been hearing so much about?',14,0,0,0,0,0,'Prince Sandoval say 1'), +(@NPC_PRINCESAND_13219,1,0,'I will make this as easy as possible for you. Simply come here and die. That is all that I ask for your many trespasses. For your sullying this exlated place of battle. ',14,0,0,0,0,0,'Prince Sandoval say 2'), +(@NPC_PRINCESAND_13219,2,0,'FOR YOUR EFFRONTERY TO THE LICH KING!',14,0,0,0,0,0,'Prince Sandoval say 3'); + +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@NPC_PRINCESAND_13219; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@NPC_PRINCESAND_13219, @NPC_PRINCESAND_13219*100); +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 +(@NPC_PRINCESAND_13219, 0, 0, 0, 0, 0, 80, 0, 0, 0, 10000, 20000, 11, 61162, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Prince Sandoval - IC - Cast Engulfing Strike'), +(@NPC_PRINCESAND_13219, 0, 1, 0, 0, 0, 80, 0, 15000, 20000, 30000, 30000, 11, 61163, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Prince Sandoval - IC - Cast Fire Nova'), +(@NPC_PRINCESAND_13219, 0, 2, 0, 0, 0, 100, 0, 30000, 30000, 30000, 30000, 11, 61144, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Prince Sandoval - IC - Cast Fire Shield'), +(@NPC_PRINCESAND_13219, 0, 3, 4, 0, 0, 100, 0, 31100, 31100, 30000, 30000, 11, 61145, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Prince Sandoval - IC - Cast Ember Shower'), +(@NPC_PRINCESAND_13219, 0, 4, 5, 61, 0, 100, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Prince Sandoval - On Link - Change state'), +(@NPC_PRINCESAND_13219, 0, 5, 6, 61, 0, 100, 0, 0, 0, 0, 0, 18, 131077, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Prince Sandoval - On Link - Change unit flag'), +(@NPC_PRINCESAND_13219, 0, 6, 0, 61, 0, 100, 0, 0, 0, 0, 0, 103, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Prince Sandoval - On Link - Set Root'), +(@NPC_PRINCESAND_13219, 0, 7, 8, 0, 0, 100, 0, 45100, 45100, 30000, 30000, 19, 131077, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Prince Sandoval - IC - Change unit flag'), +(@NPC_PRINCESAND_13219, 0, 8, 9, 61, 0, 100, 0, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Prince Sandoval - On Link - Change state'), +(@NPC_PRINCESAND_13219, 0, 9, 10, 61, 0, 100, 0, 0, 0, 0, 0, 28, 61144, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Prince Sandoval - On Link - Remove Fire Shield'), +(@NPC_PRINCESAND_13219, 0, 10, 11, 61, 0, 100, 0, 0, 0, 0, 0, 28, 61145, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Prince Sandoval - On Link- Remove Ember Shower'), +(@NPC_PRINCESAND_13219, 0, 11, 0, 61, 0, 100, 0, 0, 0, 0, 0, 103, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Prince Sandoval - On Link - Remove Root'), +(@NPC_PRINCESAND_13219, 0, 12, 0, 54, 0, 100, 0, 0, 0, 0, 0, 80, @NPC_PRINCESAND_13219*100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Prince Sandoval - On summon - Call script 1'), +(@NPC_PRINCESAND_13219, 0, 13, 0, 54, 0, 100, 0, 0, 0, 0, 0, 11, 4335, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Prince Sandoval - On summon - Cast Summon Smoke'), +-- +(@NPC_PRINCESAND_13219*100, 9, 0, 0, 1, 0, 100, 1, 4000, 4000, 0, 0, 1, 1, 10, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Prince Sandoval - OOC script 1 - Say 1'), +(@NPC_PRINCESAND_13219*100, 9, 1, 0, 1, 0, 100, 1, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 8197.6045, 3502.557, 625.108032, 0.585, 'Prince Sandoval - OOC script 1 - Move to position'), +(@NPC_PRINCESAND_13219*100, 9, 2, 0, 1, 0, 100, 1, 8000, 8000, 0, 0, 1, 2, 10, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Prince Sandoval - OOC script 1 - Say 2'), +-- +(@NPC_PRINCESAND_13219, 0, 14, 0, 54, 0, 100, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Prince Sandoval - OOC script 1 - Say 3'), +(@NPC_PRINCESAND_13219, 0, 15, 0, 1, 0, 100, 0, 14000, 14000, 0, 0, 49, 0, 0, 0, 0, 0, 0, 21, 100, 0, 0, 0, 0, 0, 0, 'Prince Sandoval - OOC - Start Attack'), +(@NPC_PRINCESAND_13219, 0, 16, 0, 5, 0, 100, 0, 0, 0, 0, 0, 45, @KILL_13214, @KILL_13214, 0, 0, 0, 0, 11, @NPC_GEIRRVIF, 100, 0, 0, 0, 0, 0, 'Prince Sandoval - On kill target - Set Data'), +(@NPC_PRINCESAND_13219, 0, 17, 0, 6, 0, 100, 0, 0, 0, 1, 0, 45, @CREDIT_13219, @CREDIT_13219, 0, 0, 0, 0, 11, @NPC_GEIRRVIF, 100, 0, 0, 0, 0, 0, 'Prince Sandoval - On death - Set Data'), +(@NPC_PRINCESAND_13219, 0, 18, 0, 1, 0, 100, 1, 30000, 30000, 0, 0, 45, @WIPE_13214, @WIPE_13214, 0, 0, 0, 0, 11, @NPC_GEIRRVIF, 100, 0, 0, 0, 0, 0, 'Prince Sandoval - OOC - Set Data'), +-- +(@NPC_PRINCESAND_13219, 0, 19, 20, 1, 0, 100, 0, 0, 0, 0, 0, 19, 131077, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Prince Sandoval - OOC - Change state'), +(@NPC_PRINCESAND_13219, 0, 20, 21, 61, 0, 100, 0, 0, 0, 0, 0, 28, 61144, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Prince Sandoval - On Link - Remove Fire Shield'), +(@NPC_PRINCESAND_13219, 0, 21, 22, 61, 0, 100, 0, 0, 0, 0, 0, 28, 61145, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Prince Sandoval - On Link- Remove Ember Shower'), +(@NPC_PRINCESAND_13219, 0, 22, 0, 61, 0, 100, 0, 0, 0, 0, 0, 103, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Prince Sandoval - On Link - Remove Root'); + +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@NPC_GEIRRVIF; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@NPC_GEIRRVIF, @NPC_GEIRRVIF*100, @NPC_GEIRRVIF*100+1, @NPC_GEIRRVIF*100+2, @NPC_GEIRRVIF*100+3, @NPC_GEIRRVIF*100+4, @NPC_GEIRRVIF*100+5, @NPC_GEIRRVIF*100+6); +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 +(@NPC_GEIRRVIF, 0, 0, 0, 19, 0, 100, 0, @QUEST_FALLENHEROES, 0, 0, 0, 80, @NPC_GEIRRVIF*100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Grieff - On accept quest 1 - Call script 1'), +-- +(@NPC_GEIRRVIF*100, 9, 0, 0, 1, 0, 100, 1, 1000, 1000, 0, 0, 69, 8216, 3516, 653, 0, 0, 0, 8, 0, 0, 0, 8215.81, 3515.88, 652.885, 3.83972, 'Grieff - OOC script 1 - Move to position'), +(@NPC_GEIRRVIF*100, 9, 1, 0, 1, 0, 100, 1, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 1 - Change npc flag'), +(@NPC_GEIRRVIF*100, 9, 2, 0, 1, 0, 100, 1, 0, 0, 0, 0, 45, @DESPAWN_13214, @DESPAWN_13214, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 1 - Despawn corpse'), +(@NPC_GEIRRVIF*100, 9, 3, 0, 1, 0, 100, 1, 1000, 1000, 0, 0, 1, 0, 10, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 1 - say 0'), +(@NPC_GEIRRVIF*100, 9, 4, 0, 1, 0, 100, 1, 4000, 4000, 0, 0, 1, 1, 10, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 1 - say 1'), +(@NPC_GEIRRVIF*100, 9, 5, 0, 1, 0, 100, 1, 6000, 6000, 0, 0, 1, 2, 10, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 1 - say 2'), +(@NPC_GEIRRVIF*100, 9, 6, 0, 1, 0, 100, 1, 5000, 5000, 0, 0, 1, 3, 10, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 1 - say 3'), +(@NPC_GEIRRVIF*100, 9, 7, 0, 1, 0, 100, 1, 0, 0, 0, 0, 12, @NPC_JHADRAS_13214, 7, 0, 0, 1, 0, 8, 0, 0, 0, 8222, 3518, 625.162, 3.559, 'Grieff - OOC script 1 - Summon Father Jhadras'), +(@NPC_GEIRRVIF*100, 9, 8, 0, 1, 0, 100, 1, 0, 0, 0, 0, 12, @NPC_MASUD_13214, 7, 0, 0, 1, 0, 8, 0, 0, 0, 8217, 3523, 624.908, 5.236, 'Grieff - OOC script 1 - Summon Masud'), +(@NPC_GEIRRVIF*100, 9, 9, 0, 1, 0, 100, 1, 0, 0, 0, 0, 12, @NPC_GENESS_13214, 7, 0, 0, 1, 0, 8, 0, 0, 0, 8210, 3517, 624.6, 6.143, 'Grieff - OOC script 1 - Summon Geness Half-Soul'), +(@NPC_GEIRRVIF*100, 9, 10, 0, 1, 0, 100, 1, 0, 0, 0, 0, 12, @NPC_TALLA_13214, 7, 0, 0, 1, 0, 8, 0, 0, 0, 8209, 3511, 625.117, 0.571, 'Grieff - OOC script 1 - Summon Talla'), +(@NPC_GEIRRVIF*100, 9, 11, 0, 1, 0, 100, 1, 0, 0, 0, 0, 12, @NPC_ELDRETH_13214, 7, 0, 0, 1, 0, 8, 0, 0, 0, 8198, 3517, 625.838, 0.089, 'Grieff - OOC script 1 - Summon Eldreth'), +(@NPC_GEIRRVIF*100, 9, 12, 0, 1, 0, 100, 1, 0, 0, 0, 0, 12, @NPC_RITH_13214, 7, 0, 0, 1, 0, 8, 0, 0, 0, 8200, 3507, 625.339, 0.514, 'Grieff - OOC script 1 - Summon Rith'), +-- +(@NPC_GEIRRVIF, 0, 1, 2, 38, 0, 100, 0, @CREDIT_13214, @CREDIT_13214, 0, 0, 1, 4, 10, 0, 0, 1, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Grieff - On data set - Say 5'), +(@NPC_GEIRRVIF, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, 1, 0, 8, 0, 0, 0, 8216.25, 3516.23, 629.357, 3.83972, 'Grieff - On linked - Move to position'), +(@NPC_GEIRRVIF, 0, 3, 4, 61, 0, 100, 0, 0, 0, 0, 0, 81, 3, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Grieff - On linked - Change npc flag'), +(@NPC_GEIRRVIF, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 15, @QUEST_FALLENHEROES, 0, 0, 0, 0, 0, 18, 80, 0, 0, 0, 0, 0, 0, 'Grieff - On linked - Kill credit'), +(@NPC_GEIRRVIF, 0, 5, 0, 19, 0, 100, 0, @QUEST_KDARKMASTER, 0, 0, 0, 80, @NPC_GEIRRVIF*100+1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Grieff - On accept quest 2 - Call script 2'), +-- +(@NPC_GEIRRVIF*100+1, 9, 0, 0, 1, 0, 100, 1, 1000, 1000, 0, 0, 69, 8216, 3516, 653, 0, 0, 0, 8, 0, 0, 0, 8215.81, 3515.88, 652.885, 3.83972, 'Grieff - OOC script 2 - Move to position'), +(@NPC_GEIRRVIF*100+1, 9, 1, 0, 1, 0, 100, 1, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 2 - Change npc flag'), +(@NPC_GEIRRVIF*100+1, 9, 2, 0, 1, 0, 100, 1, 0, 0, 0, 0, 45, @DESPAWN_13214, @DESPAWN_13214, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 2 - Despawn corpse'), +(@NPC_GEIRRVIF*100+1, 9, 3, 0, 1, 0, 100, 1, 1000, 1000, 0, 0, 1, 5, 10, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 2 - say 5'), +(@NPC_GEIRRVIF*100+1, 9, 4, 0, 1, 0, 100, 1, 4000, 4000, 0, 0, 1, 6, 10, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 2 - say 6'), +(@NPC_GEIRRVIF*100+1, 9, 5, 0, 1, 0, 100, 1, 6000, 6000, 0, 0, 1, 7, 10, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 2 - say 7'), +(@NPC_GEIRRVIF*100+1, 9, 6, 0, 1, 0, 100, 1, 0, 0, 0, 0, 12, @NPC_KHITRIX_13215, 7, 0, 0, 1, 0, 8, 0, 0, 0, 8165, 3451, 627.199, 1.935, 'Grieff - OOC script 2 - Summon Khitrix the Dark Master'), +-- +(@NPC_GEIRRVIF, 0, 6, 7, 38, 0, 100, 0, @CREDIT_13215, @CREDIT_13215, 0, 0, 1, 8, 10, 0, 0, 1, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Grieff - On data set - Say 8'), +(@NPC_GEIRRVIF, 0, 7, 8, 61, 0, 100, 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 8216.25, 3516.23, 629.357, 3.83972, 'Grieff - On linked - Move to position'), +(@NPC_GEIRRVIF, 0, 8, 9, 61, 0, 100, 0, 0, 0, 0, 0, 81, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Grieff - On linked - Change npc flag'), +(@NPC_GEIRRVIF, 0, 9, 0, 61, 0, 100, 0, 0, 0, 0, 0, 15, @QUEST_KDARKMASTER, 0, 0, 0, 0, 0, 18, 80, 0, 0, 0, 0, 0, 0, 'Grieff - On linked - Kill credit'), +(@NPC_GEIRRVIF, 0, 10, 0, 19, 0, 100, 0, @QUEST_SIGRIDICEBORN, 0, 0, 0, 80, @NPC_GEIRRVIF*100+2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Grieff - On accept quest 3 - Call script 3'), +-- +(@NPC_GEIRRVIF*100+2, 9, 0, 0, 1, 0, 100, 1, 1000, 1000, 0, 0, 69, 8216, 3516, 653, 0, 0, 0, 8, 0, 0, 0, 8215.81, 3515.88, 652.885, 3.83972, 'Grieff - OOC script 3 - Move to position'), +(@NPC_GEIRRVIF*100+2, 9, 1, 0, 1, 0, 100, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 3 - Change npc flag'), +(@NPC_GEIRRVIF*100+2, 9, 2, 0, 1, 0, 100, 1, 0, 0, 0, 0, 45, @DESPAWN_13214, @DESPAWN_13214, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 3 - Despawn corpse'), +(@NPC_GEIRRVIF*100+2, 9, 3, 0, 1, 0, 100, 1, 0, 0, 0, 0, 1, 9, 10, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 3 - Say 9'), +(@NPC_GEIRRVIF*100+2, 9, 4, 0, 1, 0, 100, 1, 9000, 9000, 0, 0, 1, 10, 10, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 3 - Say 10'), +(@NPC_GEIRRVIF*100+2, 9, 5, 0, 1, 0, 100, 1, 0, 0, 0, 0, 12, @NPC_SIGRID_13216, 7, 0, 0, 1, 0, 8, 0, 0, 0, 8258.836, 3599.048, 677.6457, 0.383, 'Grieff - OOC script 3 - summon Sigrid Iceborn'), +-- +(@NPC_GEIRRVIF, 0, 11, 12, 38, 0, 100, 0, @CREDIT_13216, @CREDIT_13216, 0, 0, 1, 11, 10, 0, 0, 1, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Grieff - On data set - Say 11'), +(@NPC_GEIRRVIF, 0, 12, 13, 61, 0, 100, 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 8216.25, 3516.23, 629.357, 3.83972, 'Grieff - On linked - Move to position'), +(@NPC_GEIRRVIF, 0, 13, 14, 61, 0, 100, 0, 0, 0, 0, 0, 81, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Grieff - On linked - Change npc flag'), +(@NPC_GEIRRVIF, 0, 14, 0, 61, 0, 100, 0, 0, 0, 0, 0, 15, @QUEST_SIGRIDICEBORN, 0, 0, 0, 0, 0, 18, 80, 0, 0, 0, 0, 0, 0, 'Grieff - On linked - Kill credit'), +(@NPC_GEIRRVIF, 0, 15, 0, 19, 0, 100, 0, @QUEST_CARNAGE, 0, 0, 0, 80, @NPC_GEIRRVIF*100+3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Grieff - On accept quest 4 - Call Script 4'), +-- +(@NPC_GEIRRVIF*100+3, 9, 0, 0, 1, 0, 100, 1, 1000, 1000, 0, 0, 69, 8216, 3516, 653, 0, 0, 0, 8, 0, 0, 0, 8215.81, 3515.88, 652.885, 3.83972, 'Grieff - OOC script 4 - Move to position'), +(@NPC_GEIRRVIF*100+3, 9, 1, 0, 1, 0, 100, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 4 - Change npc flag'), +(@NPC_GEIRRVIF*100+3, 9, 2, 0, 1, 0, 100, 1, 0, 0, 0, 0, 45, @DESPAWN_13214, @DESPAWN_13214, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 4 - Despawn corpse'), +(@NPC_GEIRRVIF*100+3, 9, 3, 0, 1, 0, 100, 1, 0, 0, 0, 0, 1, 12, 10, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 4 - say 13'), +(@NPC_GEIRRVIF*100+3, 9, 4, 0, 1, 0, 100, 1, 4000, 4000, 0, 0, 1, 13, 10, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 4 - say 13'), +(@NPC_GEIRRVIF*100+3, 9, 5, 0, 1, 0, 100, 1, 6000, 6000, 0, 0, 1, 14, 10, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 4 - say 14'), +(@NPC_GEIRRVIF*100+3, 9, 6, 0, 1, 0, 100, 1, 0, 0, 0, 0, 12, @NPC_CARNAGE_13217, 7, 0, 0, 1, 0, 8, 0, 0, 0, 8141.532715, 3488.100342, 626.986084, 3.662119, 'Grieff - OOC script 4 - summon Carnage'), +-- +(@NPC_GEIRRVIF, 0, 16, 17, 38, 0, 100, 0, @CREDIT_13217, @CREDIT_13217, 0, 0, 1, 15, 10, 0, 0, 1, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Grieff - On data set - Say 15'), +(@NPC_GEIRRVIF, 0, 17, 18, 61, 0, 100, 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 8216.25, 3516.23, 629.357, 3.83972, 'Grieff - On linked - Move to position'), +(@NPC_GEIRRVIF, 0, 18, 19, 61, 0, 100, 0, 0, 0, 0, 0, 81, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Grieff - On linked - Change npc flag'), +(@NPC_GEIRRVIF, 0, 19, 0, 61, 0, 100, 0, 0, 0, 0, 0, 15, @QUEST_CARNAGE, 0, 0, 0, 0, 0, 18, 80, 0, 0, 0, 0, 0, 0, 'Grieff - On Link - Kill credit'), +(@NPC_GEIRRVIF, 0, 20, 0, 19, 0, 100, 0, @QUEST_THANE, 0, 0, 0, 80, @NPC_GEIRRVIF*100+4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Grieff - On accept quest 5 - Call script 5'), +-- +(@NPC_GEIRRVIF*100+4, 9, 0, 0, 1, 0, 100, 1, 1000, 1000, 0, 0, 69, 8216, 3516, 653, 0, 0, 0, 8, 0, 0, 0, 8215.81, 3515.88, 652.885, 3.83972, 'Grieff - OOC script 5 - Move to position'), +(@NPC_GEIRRVIF*100+4, 9, 1, 0, 1, 0, 100, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 5 - Change npc flag'), +(@NPC_GEIRRVIF*100+4, 9, 2, 0, 1, 0, 100, 1, 0, 0, 0, 0, 45, @DESPAWN_13214, @DESPAWN_13214, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 5 - Despawn corpse'), +(@NPC_GEIRRVIF*100+4, 9, 3, 0, 1, 0, 100, 1, 0, 0, 0, 0, 1, 16, 10, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 5 - say 16'), +(@NPC_GEIRRVIF*100+4, 9, 4, 0, 1, 0, 100, 1, 4000, 4000, 0, 0, 1, 17, 10, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 5 - say 17'), +(@NPC_GEIRRVIF*100+4, 9, 5, 0, 1, 0, 100, 1, 6000, 6000, 0, 0, 1, 18, 10, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 5 - say 18'), +(@NPC_GEIRRVIF*100+4, 9, 6, 0, 1, 0, 100, 1, 0, 0, 0, 0, 12, @NPC_THANE_13218, 7, 0, 0, 1, 0, 8, 0, 0, 0, 8151.247559, 3462.894043, 672.115662, 0.6877, 'Grieff - OOC script 5 - summon Thane Banahogg'), +-- +(@NPC_GEIRRVIF, 0, 21, 22, 38, 0, 100, 0, @CREDIT_13218, @CREDIT_13218, 0, 0, 1, 19, 10, 0, 0, 1, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Grieff - On data set - Say 19'), +(@NPC_GEIRRVIF, 0, 22, 23, 61, 0, 100, 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 8216.25, 3516.23, 629.357, 3.83972, 'Grieff - On linked - Move to position'), +(@NPC_GEIRRVIF, 0, 23, 24, 61, 0, 100, 0, 0, 0, 0, 0, 81, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Grieff - On linked - Change npc flag'), +(@NPC_GEIRRVIF, 0, 24, 0, 61, 0, 100, 0, 0, 0, 0, 0, 15, @QUEST_THANE, 0, 0, 0, 0, 0, 18, 80, 0, 0, 0, 0, 0, 0, 'Grieff - On linked - Kill credit'), +(@NPC_GEIRRVIF, 0, 25, 0, 19, 0, 100, 0, @QUEST_FINCHAL, 0, 0, 0, 80, @NPC_GEIRRVIF*100+5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Grieff - On accept quest 6 - Call script 6'), +-- +(@NPC_GEIRRVIF*100+5, 9, 0, 0, 1, 0, 100, 1, 1000, 1000, 0, 0, 69, 8216, 3516, 653, 0, 0, 0, 8, 0, 0, 0, 8215.81, 3515.88, 652.885, 3.83972, 'Grieff - OOC script 6 - Move to position'), +(@NPC_GEIRRVIF*100+5, 9, 1, 0, 1, 0, 100, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 6 - Change npc flag'), +(@NPC_GEIRRVIF*100+5, 9, 2, 0, 1, 0, 100, 1, 0, 0, 0, 0, 45, @DESPAWN_13214, @DESPAWN_13214, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 6 - Despawn corpse'), +(@NPC_GEIRRVIF*100+5, 9, 3, 0, 1, 0, 100, 1, 0, 0, 0, 0, 1, 20, 10, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 6 - Say 20'), +(@NPC_GEIRRVIF*100+5, 9, 4, 0, 1, 0, 100, 1, 6000, 6000, 0, 0, 1, 21, 10, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 6 - Say 21'), +(@NPC_GEIRRVIF*100+5, 9, 5, 0, 1, 0, 100, 1, 6000, 6000, 0, 0, 1, 22, 10, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 6 - Say 22'), +(@NPC_GEIRRVIF*100+5, 9, 6, 0, 1, 0, 100, 1, 6000, 6000, 0, 0, 1, 23, 10, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 6 - Say 23'), +(@NPC_GEIRRVIF*100+5, 9, 7, 0, 1, 0, 100, 1, 0, 0, 0, 0, 12, @NPC_PRINCESAND_13219, 7, 0, 0, 1, 0, 8, 0, 0, 0, 8182.54, 3489.78, 625.50519, 0.63625, 'Grieff - OOC script 6 - Summon Prince Sandoval'), +-- +(@NPC_GEIRRVIF, 0, 26, 27, 38, 0, 100, 0, @CREDIT_13219, @CREDIT_13219, 0, 0, 80, @NPC_GEIRRVIF*100+6, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Grieff - On data set - Call script 7'), +-- +(@NPC_GEIRRVIF*100+6, 9, 0, 0, 1, 0, 100, 1, 0, 0, 0, 0, 1, 24, 10, 0, 0, 1, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Grieff - On data set - Say 24'), +(@NPC_GEIRRVIF*100+6, 9, 1, 0, 1, 0, 100, 0, 0, 0, 0, 0, 15, @QUEST_FINCHAL, 0, 0, 0, 0, 0, 18, 80, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 7 - Kill credit'), +(@NPC_GEIRRVIF*100+6, 9, 2, 0, 1, 0, 100, 1, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 8216.25, 3516.23, 629.357, 3.83972, 'Grieff - On link - Move to position'), +(@NPC_GEIRRVIF*100+6, 9, 3, 0, 1, 0, 100, 1, 5000, 5000, 0, 0, 1, 25, 10, 0, 0, 1, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 7 - Say 25'), +(@NPC_GEIRRVIF*100+6, 9, 4, 0, 1, 0, 100, 1, 6000, 6000, 0, 0, 1, 26, 10, 0, 0, 1, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 7 - Say 26'), +(@NPC_GEIRRVIF*100+6, 9, 5, 0, 1, 0, 100, 1, 0, 0, 0, 0, 81, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Grieff - OOC script 7 - Change npc flag'), +-- +(@NPC_GEIRRVIF, 0, 27, 0, 38, 0, 100, 0, @KILL_13214, @KILL_13214, 0, 0, 1, 27, 10, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Greiff - On data set - Say kill'), +(@NPC_GEIRRVIF, 0, 28, 0, 38, 0, 100, 0, @WIPE_13214, @WIPE_13214, 0, 0, 69, 0, 0, 0, 0, 1, 0, 8, 0, 0, 0, 8216.25, 3516.23, 629.357, 3.83972, 'Grieff - On data set - Move to position'), +(@NPC_GEIRRVIF, 0, 29, 0, 38, 0, 100, 0, @WIPE_13214, @WIPE_13214, 0, 0, 81, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Grieff - On data set - Change npc flag'), +(@NPC_GEIRRVIF, 0, 30, 0, 38, 0, 100, 0, @WIPE_13214, @WIPE_13214, 0, 0, 78, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Grieff - On data set - Script reset'), +(@NPC_GEIRRVIF, 0, 31, 0, 38, 0, 100, 0, @DESPAWN_13219, @DESPAWN_13219, 0, 0, 41, 0, 0, 0, 0, 0, 0, 11, @NPC_ELDRETH_13214, 200, 0, 0, 0, 0, 0, 'Grieff - On data set - Despawn corpse'), +(@NPC_GEIRRVIF, 0, 32, 0, 38, 0, 100, 0, @DESPAWN_13219, @DESPAWN_13219, 0, 0, 41, 0, 0, 0, 0, 0, 0, 11, @NPC_GENESS_13214, 200, 0, 0, 0, 0, 0, 'Grieff - On data set - Despawn corpse'), +(@NPC_GEIRRVIF, 0, 33, 0, 38, 0, 100, 0, @DESPAWN_13219, @DESPAWN_13219, 0, 0, 41, 0, 0, 0, 0, 0, 0, 11, @NPC_JHADRAS_13214, 200, 0, 0, 0, 0, 0, 'Grieff - On data set - Despawn corpse'), +(@NPC_GEIRRVIF, 0, 34, 0, 38, 0, 100, 0, @DESPAWN_13219, @DESPAWN_13219, 0, 0, 41, 0, 0, 0, 0, 0, 0, 11, @NPC_MASUD_13214, 200, 0, 0, 0, 0, 0, 'Grieff - On data set - Despawn corpse'), +(@NPC_GEIRRVIF, 0, 35, 0, 38, 0, 100, 0, @DESPAWN_13219, @DESPAWN_13219, 0, 0, 41, 0, 0, 0, 0, 0, 0, 11, @NPC_RITH_13214, 200, 0, 0, 0, 0, 0, 'Grieff - On data set - Despawn corpse'), +(@NPC_GEIRRVIF, 0, 36, 0, 38, 0, 100, 0, @DESPAWN_13219, @DESPAWN_13219, 0, 0, 41, 0, 0, 0, 0, 0, 0, 11, @NPC_TALLA_13214, 200, 0, 0, 0, 0, 0, 'Grieff - On data set - Despawn corpse'), +(@NPC_GEIRRVIF, 0, 37, 0, 38, 0, 100, 0, @DESPAWN_13219, @DESPAWN_13219, 0, 0, 41, 0, 0, 0, 0, 0, 0, 11, @NPC_KHITRIX_13215, 200, 0, 0, 0, 0, 0, 'Grieff - On data set - Despawn corpse'), +(@NPC_GEIRRVIF, 0, 38, 0, 38, 0, 100, 0, @DESPAWN_13219, @DESPAWN_13219, 0, 0, 41, 0, 0, 0, 0, 0, 0, 11, @NPC_SIGRID_13216, 200, 0, 0, 0, 0, 0, 'Grieff - On data set - Despawn corpse'), +(@NPC_GEIRRVIF, 0, 39, 0, 38, 0, 100, 0, @DESPAWN_13219, @DESPAWN_13219, 0, 0, 41, 0, 0, 0, 0, 0, 0, 11, @NPC_CARNAGE_13217, 200, 0, 0, 0, 0, 0, 'Grieff - On data set - Despawn corpse'), +(@NPC_GEIRRVIF, 0, 40, 0, 38, 0, 100, 0, @DESPAWN_13219, @DESPAWN_13219, 0, 0, 41, 0, 0, 0, 0, 0, 0, 11, @NPC_THANE_13218, 200, 0, 0, 0, 0, 0, 'Grieff - On data set - Despawn corpse'), +(@NPC_GEIRRVIF, 0, 41, 0, 38, 0, 100, 0, @DESPAWN_13219, @DESPAWN_13219, 0, 0, 41, 0, 0, 0, 0, 0, 0, 11, @NPC_PRINCESAND_13219, 200, 0, 0, 0, 0, 0, 'Grieff - On data set - Despawn corpse'); + +DELETE FROM `creature_text` WHERE `entry`=@NPC_GEIRRVIF; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES +(@NPC_GEIRRVIF, 0, 0, 'Valhalas is yours to win or die in, $N. But whatever you do, stay within the bounds of the arena. To flee is to lose and be dishonored.', 12, 0, 0, 0, 0, 0, 'Greiff quest 1 say 1'), +(@NPC_GEIRRVIF, 1, 1, '$N and $g his : her; comrades in arms have chosen to accept honorable combat within the sacred confines of Valhalas.', 14, 0, 0, 0, 0, 0, 'Greiff quest 1 say 2'), +(@NPC_GEIRRVIF, 2, 2, 'There can be only one outcome to such a battle: death for one side or the other. Let $N prove $g himself : herself; upon the bones of those outsiders who have fallen before!', 14, 0, 0, 0, 0, 0, 'Greiff quest 1 say 3'), +(@NPC_GEIRRVIF, 3, 3, 'The fallen heroes of Valhalas emerge from the ground to do battle once more!', 41, 0, 0, 0, 0, 14998, 'Greiff quest 1 say 4'), +(@NPC_GEIRRVIF, 4, 4, '$N has defeated the fallen heroes of Valhalas battles past. This is only a beginning, but it will suffice.', 14, 0, 0, 0, 0, 14998, 'Greiff quest 1 say 5'), +(@NPC_GEIRRVIF, 5, 5, 'Prepare yourself. Khit''rix will be entering Valhalas from the southeast. Remember, do not leave the ring or you will lose the battle.', 12, 0, 0, 0, 0, 0, 'Greiff quest 2 say 1'), +(@NPC_GEIRRVIF, 6, 6, '$N has accepted the challenge of Khit''rix the Dark Master. May the gods show mercy upon $g him : her; for Khit''rix surely will not.', 14, 0, 0, 0, 0, 0, 'Greiff quest 2 say 2'), +(@NPC_GEIRRVIF, 7, 7, 'Khit''rix the Dark Master skitters into Valhalas from the southeast!', 41, 0, 0, 0, 0, 14998, 'Greiff quest 2 say 3'), +(@NPC_GEIRRVIF, 8, 8, 'Khit''rix the Dark Master has been defeated by $N and $g his : her; band of companions. Let the next challenge be issued!', 14, 0, 0, 0, 0, 14998, 'Greiff quest 2 sasy 4'), +(@NPC_GEIRRVIF, 9, 9, 'Sigrid Iceborn has returned to the heights of Jotunheim to prove herself against $N. When last they met, $N bested her in personal combat. Let us see the outcome of this match.', 14, 0, 0, 0, 0, 0, 'Greiff quest 3 say 1'), +(@NPC_GEIRRVIF, 10, 10, 'Circling Valhalas, Sigrid Iceborn approaches to seek her revenge! ', 41, 0, 0, 0, 0, 14998, 'Greiff quest 3 say 2'), +(@NPC_GEIRRVIF, 11, 11, '$N has defeated Sigrid Iceborn for a second time. Well, this time $g he : she; did it with the help of $g his : her; friends, but a win is a win!', 14, 0, 0, 0, 0, 14998, 'Greiff quest 3 say 3'), +(@NPC_GEIRRVIF, 12, 12, 'Carnage is coming! Remember, no matter what you do, do NOT leave the battle ring or I will disqualify you and your group.', 12, 0, 0, 0, 0, 0, 'Greiff quest 4 say 1'), +(@NPC_GEIRRVIF, 13, 13, 'From the bowels of the Underhalls comes Carnage. Brave and foolish $N has accepted the challenge. $G He : She; and $g his : her; group stand ready to face the monstrosity.', 14, 0, 0, 0, 0, 0, 'Greiff quest 4 say 2'), +(@NPC_GEIRRVIF, 14, 14, 'Lumbering in from the south, the smell of Carnage precedes him!', 41, 0, 0, 0, 0, 14998, 'Greiff quest 4 say 3'), +(@NPC_GEIRRVIF, 15, 15, 'The horror known as Carnage is no more. Could it be that $N is truly worthy of battle in Valhalas? We shall see.', 14, 0, 0, 0, 0, 14998, 'Greiff quest 4 say 4'), +(@NPC_GEIRRVIF, 16, 16, 'Look to the southeast and you will see the thane upon the platform near Gjonner the Merciless when he shows himself. Let him come down. Stay within the ring of Valhalas.', 12, 0, 0, 0, 0, 0, 'Greiff quest 5 say 1'), +(@NPC_GEIRRVIF, 17, 17, 'Thane Banahogg returns to Valhalas for the first time in ages to prove that the vrykul are the only beings worthy to fight within its sacred ring. Will $N prove him wrong?', 14, 0, 0, 0, 0, 0, 'Greiff quest 5 say 2'), +(@NPC_GEIRRVIF, 18, 18, 'Thane Banahogg appears upon the overlook to the southeast!', 41, 0, 0, 0, 0, 14998, 'Greiff quest 5 say 3'), +(@NPC_GEIRRVIF, 19, 19, 'Thane Banahogg the Deathblow has fallen to $N and $g his : her; fighting companions. $G He : She; has but one challenge ahead of $g him : her;. Who will it be?', 14, 0, 0, 0, 0, 14998, 'Greiff quest 5 say 4'), +(@NPC_GEIRRVIF, 20, 20, 'It''s too late to run now. Do not leave the ring. Die bravely, $N!', 12, 0, 0, 0, 0, 0, 'Greiff quest 6 say 1'), +(@NPC_GEIRRVIF, 21, 21, 'From the depths of Icecrown Citadel, one of the Lich King''s chosen comes to put an end to the existence of $N and $g his : her; friends.', 14, 0, 0, 0, 0, 0, 'Greiff quest 6 say 2'), +(@NPC_GEIRRVIF, 22, 22, 'Warriors of Jotunheim, I present to you, Blood Prince Sandoval!', 14, 0, 0, 0, 0, 0, 'Greiff quest 6 say 3'), +(@NPC_GEIRRVIF, 23, 23, 'Without warning, Prince Sandoval magically appears within Valhalas! ', 41, 0, 0, 0, 0, 14998, 'Greiff quest 6 say 4'), +(@NPC_GEIRRVIF, 24, 24, 'The unthinkable has happened... $N has slain Prince Sandoval!', 14, 0, 0, 0, 0, 0, 'Greiff quest 6 say 5'), +(@NPC_GEIRRVIF, 25, 25, 'In defeating him, $g he : she; and $g his : her; fighting companions have proven themselves worthy of battle in this most sacred place of vrykul honor.', 14, 0, 0, 0, 0, 0, 'Greiff quest 6 say 6'), +(@NPC_GEIRRVIF, 26, 26, 'ALL HAIL $N, CHAMPION OF VALHALAS!', 14, 0, 0, 0, 0, 14998, 'Greiff quest 6 say 7'), +(@NPC_GEIRRVIF, 27, 27, 'You were not prepared!', 14, 0, 0, 0, 0, 0, 'Greiff kill'); -- cgit v1.2.3 From 56b3e52f067f5f5d671559e6f8ce28506afce635 Mon Sep 17 00:00:00 2001 From: Filip Date: Sat, 21 Sep 2013 22:44:07 +0200 Subject: DB/SAI: Eyes of Grillok By @dr-j fixes #10909 --- sql/updates/world/2013_09_21_00_world_sai.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/updates/world/2013_09_21_00_world_sai.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_21_00_world_sai.sql b/sql/updates/world/2013_09_21_00_world_sai.sql new file mode 100644 index 00000000000..f5827fbd78c --- /dev/null +++ b/sql/updates/world/2013_09_21_00_world_sai.sql @@ -0,0 +1,4 @@ +UPDATE `creature_template` SET `ainame`='SmartAI' WHERE `entry`=22177; +DELETE FROM `smart_scripts` WHERE `entryorguid`=22177 AND `source_type`=0; +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 +(22177,0,0,0,8,0,100,0,38530,0,0,0,33,22177,0,0,0,0,0,7,0,0,0,0,0,0,0,'Eye of Grillok Quest Credit Bunny - On Spellhit (Quest Credit for Eye of Grillok) - Give Kill Credit'); -- cgit v1.2.3 From 4498ac0062d56aa0a0f2b9a21358f12f83c4b1f7 Mon Sep 17 00:00:00 2001 From: Filip Date: Sun, 22 Sep 2013 18:40:47 +0200 Subject: DB/SAI: Zeth'Gor Must Burn! Fixes #10904 by @untaught --- sql/updates/world/2013_09_22_00_world_sai.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 sql/updates/world/2013_09_22_00_world_sai.sql (limited to 'sql') diff --git a/sql/updates/world/2013_09_22_00_world_sai.sql b/sql/updates/world/2013_09_22_00_world_sai.sql new file mode 100644 index 00000000000..e7c5753bfc4 --- /dev/null +++ b/sql/updates/world/2013_09_22_00_world_sai.sql @@ -0,0 +1,7 @@ +UPDATE `smart_scripts` SET `link`=3 WHERE `entryorguid` IN (22401,21182,22402,22403) AND `source_type`=0 AND `id`=2 AND `link`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (22401,21182,22402,22403) AND `source_type`=0 AND `id`=3; +INSERT INTO `smart_scripts` (`entryorguid`, `id`, `event_type`, `action_type`, `action_param1`, `target_type`, `comment`) VALUES +(22401,3,61,33,22401,7,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower North - On spell hit - Give Quest Credit'), +(21182,3,61,33,21182,7,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On spell hit - Give Quest Credit'), +(22402,3,61,33,22402,7,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower Forge - On spell hit - Give Quest Credit'), +(22403,3,61,33,22403,7,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower Foothill - On spell hit - Give Quest Credit'); -- cgit v1.2.3