Conflicts:
	src/server/game/Entities/Player/Player.cpp
This commit is contained in:
megamage
2011-10-07 12:48:20 -04:00
486 changed files with 7564 additions and 2642 deletions
@@ -0,0 +1,3 @@
DELETE FROM `spell_dbc` WHERE `Id`=72958;
INSERT INTO `spell_dbc` (`Id`,`Attributes`,`AttributesEx`,`AttributesEx2`,`ProcChance`,`DurationIndex`,`Effect1`,`EffectImplicitTargetA1`,`EffectApplyAuraName1`,`EffectAmplitude1`,`EffectTriggerSpell1`,`Comment`) VALUES
(72958,0x000001C0,0,0,101,21,6,1,23,85000,72957,'Shaman T10 shoulder visual');
@@ -0,0 +1,2 @@
ALTER TABLE `game_event_creature` DROP PRIMARY KEY, ADD PRIMARY KEY (`guid`,`eventEntry`);
ALTER TABLE `game_event_gameobject` DROP PRIMARY KEY, ADD PRIMARY KEY (`guid`,`eventEntry`);
@@ -0,0 +1,2 @@
-- Fix quest 11162 Challenge to the Black Flight
UPDATE `creature_template` SET `unit_flags`=`unit_flags`&~768 WHERE `entry`=23789; -- Smolderwing
@@ -0,0 +1,9 @@
UPDATE `gameobject_template` SET `faction`=1732 WHERE `entry`=195139; -- Portal to Stormwind
UPDATE `gameobject_template` SET `faction`=1735 WHERE `entry`=195140; -- Portal to Orgrimmar
UPDATE `creature_template` SET `flags_extra`=`flags_extra`|128|2 WHERE `entry` IN (18967,18968,19230); -- Dark Assault - Alliance/Horde/Legion Portal - Invisible Stalker
DELETE FROM `gameobject` WHERE `id` IN (195139, 195140);
INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
(164, 195140, 530, 1, 1, -161.3178, 965.4099, 54.29044, 0, 0, 0, 0, 0, 200, 0, 1), -- Portal to Orgrimmar
(170, 195139, 530, 1, 1, -337.4917, 962.6188, 54.28853, 0, 0, 0, 0, 0, 200, 0, 1); -- Portal to Stormwind
@@ -0,0 +1,6 @@
UPDATE `creature_template` SET `flags_extra`=`flags_extra`|128|2 WHERE `entry` IN (19871); -- World Trigger (World Trigger (Not Immune NPC))
DELETE FROM `game_event_creature` WHERE `guid` IN (62848,62849) AND `eventEntry`=11;
INSERT INTO `game_event_creature` (`eventEntry`, `guid`) VALUES
(11, 62848),
(11, 62849);
@@ -0,0 +1,4 @@
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=18 AND `SourceEntry`=41058;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(18, 0, 41058, 0, 24, 1, 29625, 0, 0, '', 'Hyldnir Harpoon target Hyldsmeet Proto-Drake'),
(18, 0, 41058, 0, 24, 1, 29754, 0, 0, '', 'Hyldnir Harpoon target Column Ornament');
@@ -0,0 +1,9 @@
-- Fix quest Strength of the Tempest
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=29079;
DELETE FROM `smart_scripts` WHERE `entryorguid`=29079 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
(29079,0,0,0,9,0,100,0,0,70,2000,6000,11,53062,0,0,0,0,0,18,70,0,0,0,0,0,0,'Shrine of the Tempest - Range cast Lightning Strike'); -- GUESSING, 10% sure that this is the correct spell. Could 51213 Weather Shrine Active Aura
DELETE FROM `spell_scripts` WHERE `id`=53062;
INSERT INTO `spell_scripts` (`id`, `effIndex`, `delay`, `command`, `datalong`, `datalong2`, `dataint`, `x`, `y`, `z`, `o`) VALUES
(53062, 0, 0, 15, 53067, 2, 0, 0, 0, 0, 0); -- Cast create item spell
@@ -0,0 +1,51 @@
UPDATE `creature_template` SET `unit_flags`=32768,`equipment_id`=53 WHERE `entry`=24062; -- Wildervar Miner
UPDATE `creature_template` SET `unit_flags`=33536 WHERE `entry`=24178; -- Shatterhorn
UPDATE `creature_model_info` SET `bounding_radius`=1.25,`combat_reach`=4.375,`gender`=0 WHERE `modelid`=22486; -- Shatterhorn
DELETE FROM `creature_template_addon` WHERE `entry` IN (24062,24178);
INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
(24062,0,1,257,0, NULL), -- Wildervar Miner
(24178,0,3,1,0, '6606'); -- Shatterhorn, Self Visual - Sleep Until Cancelled (DND)
DELETE FROM `creature_addon` WHERE `guid` IN (120419,120422,106573);
INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
(120419,0,0,0,0,1,''), -- Wildervar Miner, talk
(120422,0,0,0,0,1,''); -- Wildervar Miner, talk
DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY;
-- The ram meat spell may only be used if player is inside the mine
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=43209;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(17,0,43209,0,23,4534,0,0,64,'','Place Ram Meat can only be used in Wildervar Mine');
-- Insert missing spell_target_position for Place Ram Meat spell
DELETE FROM `spell_target_position` WHERE `id`=43209;
INSERT INTO `spell_target_position` (`id`,`target_map`,`target_position_x`,`target_position_y`,`target_position_z`,`target_orientation`) VALUES
(43209,571,2636.288086,-5050.891113,295.537445,5.374982);
-- Shatterhorn SAI
SET @ENTRY := 24178;
SET @SPELL_GROUND_SMASH := 12734; -- Ground Smash
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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
(@ENTRY,0,0,0,4,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Shatterhorn - On Aggro - Say Line 0'),
(@ENTRY,0,1,0,0,0,100,0,3000,5000,12000,13000,11,@SPELL_GROUND_SMASH,1,0,0,0,0,2,0,0,0,0,0,0,0,'Shatterhorn - In Combat - Cast Ground Smash'),
(@ENTRY,0,2,0,6,0,100,0,0,0,0,0,41,8000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Shatterhorn - Force Despawn 8 Seconds After Death'),
(@ENTRY,0,3,0,8,0,0,0,43209,0,0,0,19,0x300,1,0,0,0,0,1,0,0,0,0,0,0,0,'Shatterhorn - On Place Meat spellhit remove unit flags'),
(@ENTRY,0,4,0,8,0,0,0,43209,0,0,0,28,6606,1,0,0,0,0,1,0,0,0,0,0,0,0,'Shatterhorn - On Place Meat spellhit remove sleep aura'),
(@ENTRY,0,5,0,8,0,0,0,43209,0,0,0,91,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Shatterhorn - On Place Meat spellhit remove byte1 3');
-- Text
DELETE FROM `creature_text` WHERE `entry`=@ENTRY;
INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
(@ENTRY,0,0,'%s wakes up from the smell of fresh meat!',16,0,100,15,0,0,'Shatterhorn on aggro line and roar at same time');
/* Target is null, can't use event_scripts
-- Event send by Place Ram Meat spell
DELETE FROM `event_scripts` WHERE `id`=15739;
INSERT INTO `event_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `dataint`, `x`, `y`, `z`, `o`) VALUES
(15739, 2, 14, 6606, 0, 0, 0, 0, 0, 0),
(15739, 3, 5, 0x6+0x35, 0x300, 0, 0, 0, 0, 0);
*/
@@ -0,0 +1,32 @@
-- Fix quest What Illidan Wants, Illidan Gets...
-- Make the npc_text entries work properly
DELETE FROM `gossip_menu` WHERE `entry` IN (8336,8342,8341,8340,8339,8338) AND `text_id` IN (10401,10405,10406,10407,10408,10409);
INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES
(8336,10401),
(8342,10405),
(8341,10406),
(8340,10407),
(8339,10408),
(8338,10409);
-- Conditions for gossip menu of quest What Illidan Wants, Illidan Gets...
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=8336;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(15,8336,0,0,9,10577,0,0,0,'','Only show first gossip if player is on quest What Illidan Wants, Illidan Gets...');
-- Insert options (for players)
DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (8336,8342,8341,8340,8339,8338);
INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`) VALUES
(8336,0,0,'I bring word from Lord Illidan.',1,1,8342),
(8342,0,0,'The cipher fragment is to be moved. Have it delivered to Zuluhed.',1,1,8341),
(8341,0,0,'Perhaps you did not hear me, Ruusk. I am giving you an order from Illidan himself!',1,1,8340),
(8340,0,0,'Very well. I will return to the Black Temple and notify Lord Illidan of your unwillingness to carry out his wishes. I suggest you make arrangements with your subordinates and let them know that you will soon be leaving this world.',1,1,8339),
(8339,0,0,'Do I need to go into all the gory details? I think we are both well aware of what Lord Illidan does with those that would oppose his word. Now, I must be going! Farewell, Ruusk! Forever...',1,1,8338),
(8338,0,0,'Ah, good of you to come around, Ruusk. Thank you and farewell.',1,1,0); -- Here the quest credit is given
-- Commander Ruusk SAI
UPDATE `creature_template` SET `gossip_menu_id`=8336,`AIName`='SmartAI' WHERE `entry`=20563;
DELETE FROM `smart_scripts` WHERE `entryorguid`=20563 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
(20563,0,0,1,62,0,100,0,8338,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Commander Ruusk - On Gossip Select - Close Gossip'),
(20563,0,1,0,61,0,100,0,0,0,0,0,26,10577,0,0,0,0,0,7,0,0,0,0,0,0,0,'Commander Ruusk - On Gossip Select (link) - Quest Credit');
@@ -0,0 +1,34 @@
SET @ENTRY_FIRJUS := 24213;
SET @ENTRY_JLARBORN := 24215;
SET @ENTRY_YORUS := 24214;
SET @ENTRY_OLUF := 23931;
SET @QUEST := 11300;
-- Summon Firjus on quest accept - this starts the quest
UPDATE `quest_template` SET `StartScript`=@QUEST WHERE `entry`=@QUEST;
DELETE FROM `quest_start_scripts` WHERE `id`=@QUEST;
INSERT INTO `quest_start_scripts` (`id`,`delay`,`command`,`datalong`,`datalong2`,`dataint`,`x`,`y`,`z`,`o`) VALUES
(@QUEST,3,10,@ENTRY_FIRJUS,300000,0,799.653931,-4718.678711,-96.236053,4.992353);
-- Firjus, Jlarborn, Yorus and Oluf SAI
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (@ENTRY_FIRJUS,@ENTRY_JLARBORN,@ENTRY_YORUS,@ENTRY_OLUF);
DELETE FROM `creature_ai_scripts` WHERE `creature_id` IN (@ENTRY_FIRJUS,@ENTRY_JLARBORN,@ENTRY_YORUS,@ENTRY_OLUF);
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY_FIRJUS,@ENTRY_JLARBORN,@ENTRY_YORUS,@ENTRY_OLUF) 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
(@ENTRY_FIRJUS,0,0,0,0,0,100,0,3000,6000,12000,15000,11,15284,0,0,0,0,0,2,0,0,0,0,0,0,0,'Firjus - In Combat - Cleave'),
(@ENTRY_FIRJUS,0,1,0,0,0,100,0,10000,10000,10000,10000,11,43348,0,0,0,0,0,2,0,0,0,0,0,0,0,'Firjus - In Combat - Head Crush'),
(@ENTRY_FIRJUS,0,2,0,6,0,100,1,0,0,0,0,12,@ENTRY_JLARBORN,1,300000,0,0,0,8,0,0,0,799.653931,-4718.678711,-96.236053,4.992353,'Firjus - On Death - Summon Jlarborn'),
(@ENTRY_JLARBORN,0,0,0,0,0,100,1,1000,2000,0,0,11,19131,0,0,0,0,0,2,0,0,0,0,0,0,0,'Jlarborn - In Combat - Shield Charge'),
(@ENTRY_JLARBORN,0,1,0,0,0,100,0,4000,5000,15000,16000,11,12169,0,0,0,0,0,1,0,0,0,0,0,0,0,'Jlarborn - In Combat - Shield Block'),
(@ENTRY_JLARBORN,0,2,0,0,0,100,0,7000,8000,18000,19000,11,38233,0,0,0,0,0,2,0,0,0,0,0,0,0,'Jlarborn - In Combat - Shield Bash'),
(@ENTRY_JLARBORN,0,3,0,0,0,100,0,10000,10000,10000,10000,11,8374,0,0,0,0,0,2,0,0,0,0,0,0,0,'Jlarborn - In Combat - Arcing Smash'),
(@ENTRY_JLARBORN,0,4,0,6,0,100,1,0,0,0,0,12,@ENTRY_YORUS,1,300000,0,0,0,8,0,0,0,799.653931,-4718.678711,-96.236053,4.992353,'Jlarborn - On Death - Summon Yorus'),
(@ENTRY_YORUS,0,0,0,0,0,100,0,3000,6000,12000,15000,11,15284,0,0,0,0,0,2,0,0,0,0,0,0,0,'Yorus - In Combat - Cleave'),
(@ENTRY_YORUS,0,1,0,0,0,100,0,8000,9000,18000,19000,11,41057,0,0,0,0,0,1,0,0,0,0,0,0,0,'Yorus - In Combat - Whirlwind'),
(@ENTRY_YORUS,0,2,0,6,0,100,1,0,0,0,0,12,@ENTRY_OLUF,1,300000,0,0,0,8,0,0,0,799.653931,-4718.678711,-96.236053,4.992353,'Yorus - On Death - Summon Oluf'),
(@ENTRY_OLUF,0,0,0,0,0,100,0,3000,6000,12000,15000,11,15284,0,0,0,0,0,2,0,0,0,0,0,0,0,'Oluf - In Combat - Cleave'),
(@ENTRY_OLUF,0,1,0,0,0,100,0,8000,9000,28000,29000,11,13730,0,0,0,0,0,1,0,0,0,0,0,0,0,'Oluf - In Combat - Demoralizing Shout'),
(@ENTRY_OLUF,0,2,0,0,0,100,0,7000,7000,21000,21000,11,6533,0,0,0,0,0,2,0,0,0,0,0,0,0,'Oluf - In Combat - Net'),
(@ENTRY_OLUF,0,3,0,0,0,100,1,1000,1000,0,0,11,42870,0,0,0,0,0,2,0,0,0,0,0,0,0,'Oluf - In Combat - Throw Harpoon'),
(@ENTRY_OLUF,0,4,0,0,0,100,0,10000,10000,10000,10000,11,41057,0,0,0,0,0,1,0,0,0,0,0,0,0,'Oluf - In Combat - Whirlwind'),
(@ENTRY_OLUF,0,5,0,6,0,100,1,0,0,0,0,50,186640,90000,0,0,0,0,8,0,0,0,799.653931,-4718.678711,-96.236053,4.992353,'Oluf - On Death - Summon Ancient Cipher');
@@ -0,0 +1,18 @@
-- Doctor Razorgrin SAI
SET @ENTRY := 25678;
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY;
DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY;
DELETE FROM `creature_ai_texts` WHERE `entry`=-767;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(@ENTRY,0,0,0,4,0,100,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'Doctor Razorgin - On Aggro - Say Line 0 (random)');
-- Texts
DELETE FROM `creature_text` WHERE `entry`=@ENTRY;
INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
(@ENTRY,0,0,'Ah, good... more parts!',14,0,100,0,0,0,'Part of the Doctor Razorgin on aggro lines'),
(@ENTRY,0,1,'Clear!',14,0,100,0,0,0,'Part of the Doctor Razorgin on aggro lines'),
(@ENTRY,0,2,'Fresh meat!',14,0,100,0,0,0,'Part of the Doctor Razorgin on aggro lines'),
(@ENTRY,0,3,'I recommened evisceration!',14,0,100,0,0,0,'Part of the Doctor Razorgin on aggro lines'),
(@ENTRY,0,4,'It''s no good... you need more work first.',14,0,100,0,0,0,'Part of the Doctor Razorgin on aggro lines'),
(@ENTRY,0,5,'Live, damn you!',14,0,100,0,0,0,'Part of the Doctor Razorgin on aggro lines'),
(@ENTRY,0,6,'The doctor is in!',14,0,100,0,0,0,'Part of the Doctor Razorgin on aggro lines');
@@ -0,0 +1,11 @@
UPDATE `creature_template` SET `faction_A`=16,`faction_H`=16,`unit_flags`=0x8040,`speed_run`=2.85714,`InhabitType`=`InhabitType`|4 WHERE `entry`=32358; -- Fumblub Gearwind
UPDATE `creature_template` SET `faction_A`=1885,`faction_H`=1885,`unit_flags`=0x8040,`speed_run`=1.28571 WHERE `entry`=32438; -- Syreian the Bonecarver
UPDATE `creature_model_info` SET `bounding_radius`=1.25,`combat_reach`=3.919432,`gender`=1 WHERE `modelid`=27970; -- Syreian the Bonecarver
UPDATE `creature_addon` SET `mount`=25587, `bytes1`=0x3000000 WHERE `guid`=151938; -- Fumblub Gearwind
DELETE FROM `creature_template_addon` WHERE `entry` IN (32358,32438);
INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
(32358,25587,0x3000000,1,0, NULL), -- Fumblub Gearwind
(32438,0,0,2,0, NULL); -- Syreian the Bonecarver
@@ -0,0 +1,7 @@
-- Removing obsolete quest 960, which was replaced by quest 961
DELETE FROM `creature_questrelation` WHERE `quest`=960;
DELETE FROM `creature_involvedrelation` WHERE `quest`=960;
DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=960;
INSERT INTO `disables` (`sourceType`, `entry`, `flags`, `params_0`, `params_1`, `comment`) VALUES
(1, 960, 0, '', '', 'Deprecated quest');
@@ -0,0 +1,79 @@
-- Skin loot entry
SET @LibraryLaborer := 29724;
SET @UldarBoss := 29725;
SET @AirStrip := 29726;
SET @ReavandDispo := 29727;
SET @HallsofStone := 29728;
SET @Dirkee := 29729;
SET @Recovery := 29730;
-- Ref Loot Entry
SET @UldarBossRef := 50013;
SET @AirStripRef := 50013+1;
SET @HallsofStoneRef := 50013+2;
SET @ReavandDispoRef := 50013+3;
SET @LibraryLaborerRef := 50013+4;
-- Add loot to the skinning table
DELETE FROM `skinning_loot_template` WHERE `entry` IN (@Recovery,@Dirkee,@LibraryLaborer,@ReavandDispo,@HallsofStone,@AirStrip,@UldarBoss);
INSERT INTO `skinning_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES
(@Recovery, 41338, 42, 1, 0, 1, 3), -- Sprung Whirlygig
(@Recovery, 41337, 44, 1, 0, 1, 3), -- Whizzed out Gizmo
(@Recovery, 39690, 9, 1, 0, 1, 3), -- Volatile Blasting trigger
(@Recovery, 39681, 4, 1, 0, 2, 4), -- Handfull of copper bolts
(@Recovery, 49050, 0.5, 1, 0, 1, 1), -- jeeves
(@Recovery, 39682, 0.5, 1, 0, 1, 1), -- Overcharged Capacitor
(@Dirkee, 41338, 42, 1, 0, 1, 3), -- Sprung Whirlygig
(@Dirkee, 41337, 44.5, 1, 0, 1, 3), -- Whizzed out Gizmo
(@Dirkee, 39690, 10, 1, 0, 1, 3), -- Volatile Blasting trigger
(@Dirkee, 39681, 3, 1, 0, 2, 4), -- Handfull of copper bolts
(@Dirkee, 49050, 0.5, 1, 0, 1, 1), -- jeeves
(@LibraryLaborer , 1, 100, 1, 0, -@LibraryLaborerRef, 1),
(@ReavandDispo, 1, 100, 1, 0, -@ReavandDispoRef, 1),
(@HallsofStone, 1, 100, 1, 0, -@HallsofStoneRef, 1),
(@AirStrip, 1, 100, 1, 0, -@AirStripRef, 1),
(@UldarBoss, 1, 100, 1, 0, -@UldarBossRef, 1);
-- Add loot to the reference table
DELETE FROM `reference_loot_template` WHERE `entry` IN (@AirStripRef,@ReavandDispoRef,@LibraryLaborerRef,@HallsofStoneRef,@UldarBossRef);
INSERT INTO `reference_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES
(@AirStripRef, 41338, 33, 1, 0, 1, 1), -- Sprung Whirlygig
(@AirStripRef, 41337, 42, 1, 0, 1, 1), -- Whizzed out Gizmo
(@AirStripRef, 39690, 13, 1, 0, 1, 3), -- Volatile Blasting trigger
(@AirStripRef, 39681, 10, 1, 0, 1, 4), -- Handfull of copper bolts
(@AirStripRef, 39686, 1.2, 1, 0, 1, 1), -- Frost steel Tube
(@AirStripRef, 49050, 0.8, 1, 0, 1, 1), -- jeeves
(@ReavandDispoRef, 41338, 40, 1, 0, 1, 3), -- Sprung Whirlygig
(@ReavandDispoRef, 41337, 40, 1, 0, 1, 3), -- Whizzed out Gizmo
(@ReavandDispoRef, 39690, 9.5, 1, 0, 1, 3), -- Volatile Blasting trigger
(@ReavandDispoRef, 39681, 9.5, 1, 0, 2, 4), -- Handfull of copper bolts
(@ReavandDispoRef, 39686, 0.5, 1, 0, 1, 1), -- Frost steel Tube
(@ReavandDispoRef, 49050, 0.5, 1, 0, 1, 1), -- jeeves
(@LibraryLaborerRef, 41338, 43, 1, 0, 1, 3), -- Sprung Whirlygig
(@LibraryLaborerRef, 41337, 42, 1, 0, 1, 3), -- Whizzed out Gizmo
(@LibraryLaborerRef, 39690, 9, 1, 0, 1, 3), -- Volatile Blasting trigger
(@LibraryLaborerRef, 39681, 4, 1, 0, 2, 4), -- Handfull of copper bolts
(@LibraryLaborerRef, 49050, 1, 1, 0, 1, 1), -- jeeves
(@LibraryLaborerRef, 39686, 0.5, 1, 0, 1, 1), -- Frost steel Tube
(@LibraryLaborerRef, 39682, 0.5, 1, 0, 1, 1), -- Overcharged Capacitor
(@HallsofStoneRef, 41338, 43.5, 1, 0, 1, 3), -- Sprung Whirlygig
(@HallsofStoneRef, 41337, 42, 1, 0, 1, 3), -- Whizzed out Gizmo
(@HallsofStoneRef, 39690, 8, 1, 0, 1, 3), -- Volatile Blasting trigger
(@HallsofStoneRef, 39681, 5, 1, 0, 2, 4), -- Handfull of copper bolts
(@HallsofStoneRef, 49050, 0.5, 1, 0, 1, 1), -- jeeves
(@HallsofStoneRef, 39686, 0.5, 1, 0, 1, 1), -- Frost steel Tube
(@HallsofStoneRef, 39682, 0.5, 1, 0, 1, 1), -- Overcharged Capacitor
(@UldarBossRef, 35627, 43, 1, 0, 2, 10), -- Eternal Shadow
(@UldarBossRef, 35624, 42, 1, 0, 4, 10), -- Eternal Earth
(@UldarBossRef, 35623, 43, 1, 0, 2, 6), -- Eternal Air
(@UldarBossRef, 36860, 42, 1, 0, 2, 6), -- Eternal Fire
(@UldarBossRef, 39690, 30, 1, 0, 16, 19), -- Volatile Blasting trigger
(@UldarBossRef, 39686, 26, 1, 0, 2, 3), -- Frost steel Tube
(@UldarBossRef, 39682, 22, 1, 0, 5, 5), -- Overcharged Capacitor
(@UldarBossRef, 39681, 21, 1, 0, 8, 10), -- Handfull of copper bolts
(@UldarBossRef, 49050, 2, 1, 0, 1, 1); -- jeeves
UPDATE `creature_template` SET `skinloot`=@LibraryLaborer WHERE `entry` IN (29389,29724); -- Library Guardian and Mechagnome Laborer
UPDATE `creature_template` SET `skinloot`=@ReavandDispo WHERE `entry` IN (34273,34274,29382); -- Stromforged Reaver and XB-488 Disposalbot
UPDATE `creature_template` SET `skinloot`=@Dirkee WHERE `entry`=32500; -- Dirkee
UPDATE `creature_template` SET `skinloot`=@Recovery WHERE `entry` IN (34267,34268); -- Parts Recovery Technician
UPDATE `creature_template` SET `skinloot`=@AirStrip WHERE `entry` IN (32358,25792,25758,25752,25753,25814,25793); -- Fumblub Gearwind, Scavenge-bot 005-B6, Defendo-tank 66D, Scavenge-bot 004-A8, Sentry-bot 57-K, Fizzcrank Mechagnome, 55-D Collect-a-tron
UPDATE `creature_template` SET `skinloot`=@HallsofStone WHERE `entry` IN (27972,31383,27971,31387); -- Lightning Construct, Unrelenting Construct
UPDATE `creature_template` SET `skinloot`=@UldarBoss WHERE `entry` IN (34332,34106,33113,34003,33293,33885); -- Leviathan Mk II, Flame Leviathan, XT-002 Deconstructor
@@ -0,0 +1,35 @@
-- Jormunger Control Orb
DELETE FROM `gameobject` WHERE `id`=192262;
INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
(173, 192262, 571, 1, 0x8, 8497.219, -90.90104, 789.2875, 0.1396245, 0, 0, 0.06975555, 0.9975641, 0, 0, 0);
DELETE FROM `creature` WHERE `id` IN (30301,30322,30300);
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
(4089, 30301, 571, 1, 0x8, 0, 0, 8497.78, -99.0251, 786.528, 3.01942, 120, 0, 0, 1, 0, 0, 0, 0, 0), -- Tamed Jormungar
(4090, 30322, 571, 1, 0x8, 0, 0, 8505.47, -86.2532, 787.339, 3.28122, 120, 0, 0, 1, 0, 0, 0, 0, 0), -- Earthen Jormungar Handler
(4765, 30322, 571, 1, 0x8, 0, 0, 8502.62, -111.308, 790.176, 3.05433, 120, 0, 0, 1, 0, 0, 0, 0, 0),
(6095, 30322, 571, 1, 0x8, 0, 0, 8498.78, -46.0375, 788.895, 2.53073, 120, 0, 0, 1, 0, 0, 0, 0, 0),
(6096, 30300, 571, 1, 0x8, 0, 0, 8015.63, -126.515, 865.719, 3.39914, 120, 0, 0, 1, 0, 0, 0, 0, 0); -- Iron Colossus
-- Template updates
UPDATE `gameobject_template` SET `flags`=0x4 WHERE `entry`=192262; -- Jormungar Control Orb
UPDATE `creature_template` SET `faction_A`=1771,`faction_H`=1771,`unit_flags`=0x8040,`speed_walk`=2.8,`speed_run`=1.5873 WHERE `entry`=30300; -- Iron Colossus
UPDATE `creature_template` SET `faction_A`=1770,`faction_H`=1770,`npcflag`=0x1,`unit_flags`=0x300,`equipment_id`=1003,`speed_run`=0.99206 WHERE `entry`=30322; -- Earthen Jormungar Handler
UPDATE `creature_template` SET `faction_A`=113,`faction_H`=113,`unit_flags`=0x300,`speed_walk`=6,`speed_run`=2.14286,`VehicleId`=227 WHERE `entry`=30301; -- Tamed Jormungar
-- Model data
UPDATE `creature_model_info` SET `bounding_radius`=3.1,`combat_reach`=50,`gender`=0 WHERE `modelid`=27093; -- Iron Colossus
UPDATE `creature_model_info` SET `bounding_radius`=0.31,`combat_reach`=1,`gender`=0 WHERE `modelid`=26091; -- Earthen Jormungar Handler
UPDATE `creature_model_info` SET `bounding_radius`=1.55,`combat_reach`=5,`gender`=2 WHERE `modelid`=26935; -- Tamed Jormungar
-- Addon data for creature 30300 (Iron Colossus)
DELETE FROM `creature_template_addon` WHERE `entry` IN (30300,30322,30301);
INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
(30300,0,0,1,0, NULL), -- Iron Colossus
(30322,0,0,1,0, NULL), -- Earthen Jormungar Handler
(30301,0,0,1,0, NULL); -- Tamed Jormungar
DELETE FROM `spell_area` WHERE spell=56526;
INSERT INTO `spell_area`(`spell`,`area`,`quest_start`,`quest_start_active`,`quest_end`,`aura_spell`,`racemask`,`gender`,`autocast`) VALUES
(56526,4436,13007,1,13007,0,0,2,1), -- Snowdrift Plains
(56526,4435,13007,1,13007,0,0,2,1); -- Navirs Cradle
@@ -0,0 +1,3 @@
DELETE FROM `spell_dbc` WHERE `Id`=31247;
INSERT INTO `spell_dbc`(`Id`,`Dispel`,`Mechanic`,`Attributes`,`AttributesEx`,`AttributesEx2`,`AttributesEx3`,`AttributesEx4`,`AttributesEx5`,`AttributesEx6`,`AttributesEx7`,`Stances`,`StancesNot`,`Targets`,`CastingTimeIndex`,`AuraInterruptFlags`,`ProcFlags`,`ProcChance`,`ProcCharges`,`MaxLevel`,`BaseLevel`,`SpellLevel`,`DurationIndex`,`RangeIndex`,`StackAmount`,`EquippedItemClass`,`EquippedItemSubClassMask`,`EquippedItemInventoryTypeMask`,`Effect1`,`Effect2`,`Effect3`,`EffectDieSides1`,`EffectDieSides2`,`EffectDieSides3`,`EffectRealPointsPerLevel1`,`EffectRealPointsPerLevel2`,`EffectRealPointsPerLevel3`,`EffectBasePoints1`,`EffectBasePoints2`,`EffectBasePoints3`,`EffectMechanic1`,`EffectMechanic2`,`EffectMechanic3`,`EffectImplicitTargetA1`,`EffectImplicitTargetA2`,`EffectImplicitTargetA3`,`EffectImplicitTargetB1`,`EffectImplicitTargetB2`,`EffectImplicitTargetB3`,`EffectRadiusIndex1`,`EffectRadiusIndex2`,`EffectRadiusIndex3`,`EffectApplyAuraName1`,`EffectApplyAuraName2`,`EffectApplyAuraName3`,`EffectAmplitude1`,`EffectAmplitude2`,`EffectAmplitude3`,`EffectMultipleValue1`,`EffectMultipleValue2`,`EffectMultipleValue3`,`EffectMiscValue1`,`EffectMiscValue2`,`EffectMiscValue3`,`EffectMiscValueB1`,`EffectMiscValueB2`,`EffectMiscValueB3`,`EffectTriggerSpell1`,`EffectTriggerSpell2`,`EffectTriggerSpell3`,`EffectSpellClassMaskA1`,`EffectSpellClassMaskA2`,`EffectSpellClassMaskA3`,`EffectSpellClassMaskB1`,`EffectSpellClassMaskB2`,`EffectSpellClassMaskB3`,`EffectSpellClassMaskC1`,`EffectSpellClassMaskC2`,`EffectSpellClassMaskC3`,`MaxTargetLevel`,`SpellFamilyName`,`SpellFamilyFlags1`,`SpellFamilyFlags2`,`SpellFamilyFlags3`,`MaxAffectedTargets`,`DmgClass`,`PreventionType`,`DmgMultiplier1`,`DmgMultiplier2`,`DmgMultiplier3`,`AreaGroupId`,`SchoolMask`,`Comment`) VALUES
(31247,0,0,256,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,-1,0,0,77,0/*122*/,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,'Silithyst Cap Reward');
@@ -0,0 +1 @@
UPDATE `creature_template` SET `minlevel`=82, `maxlevel`=82 WHERE `entry`=31674; -- Ingvar the Plunderer (1)
@@ -0,0 +1,28 @@
DELETE FROM `player_factionchange_items` WHERE `alliance_id`=48356; -- Wrong entry
DELETE FROM `player_factionchange_spells` WHERE `alliance_id` IN (67093,67091,67095,67096,67092,67085,67080,67082,67087,67083,67084,67086,60867,67065,67064,67079,67066);
INSERT INTO `player_factionchange_spells` (`alliance_id`,`horde_id`) VALUES
(67093,67132),
(67091,67130),
(67095,67134),
(67096,67135),
(67092,67131),
(67085,67141),
(67080,67136),
(67082,67138),
(67087,67139),
(67083,67143),
(67084,67140),
(67086,67142),
(60867,60866),
(67065,67147),
(67064,67144),
(67079,67145),
(67066,67146);
DELETE FROM `player_factionchange_items` WHERE `alliance_id` IN (47003,47626,44503,47654);
INSERT INTO `player_factionchange_items` (`race_A`,`alliance_id`,`commentA`,`race_H`,`horde_id`,`commentH`) VALUES
(0,47003,'Dawnbreaker Greaves',0,47430,'Dawnbreaker Sabatons'),
(0,47626,'Plans: Sunforged Breastplate',0,47643,'Plans: Sunforged Breastplate'),
(0,44503,'Schematic: Mekgineers Chopper',0,44502,'Schematic: Mechano-Hog'),
(0,47654,'Pattern: Bejeweled Wizards Bracers',0,47639,'Pattern: Bejeweled Wizards Bracers');
@@ -0,0 +1,35 @@
SET @ENTRY := 33499; -- Skeletal Woodcutter
SET @QUEST_LOOT := 45080; -- Large Femur
SET @QUEST := 13654; -- There's Something About the Squire
SET @SPELL1 := 63124; -- Incapacitate Maloric
SET @SPELL2 := 63126; -- Search Maloric
-- add quest item to Skeletal Woodcutter
UPDATE `creature_template` SET `lootid`=`entry` WHERE `entry`=@ENTRY;
DELETE FROM `creature_loot_template` WHERE `entry`=@ENTRY;
INSERT INTO `creature_loot_template` VALUES
(@ENTRY,@QUEST_LOOT,-100,1,0,1,1); -- 100% drop
-- set visual effects on the skeletons
DELETE FROM `creature_template_addon` WHERE `entry`=@ENTRY;
INSERT INTO `creature_template_addon` (`entry`,`emote`) VALUES
(@ENTRY,234); -- chopping wood
SET @ENTRY := 33498; -- Maloric
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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
(@ENTRY,0,0,0,23,0,100,0,@SPELL1,1,0,0,81,16777216,0,0,0,0,0,1,0,0,0,0,0,0,0,'Maloric - on Aura: Incapacitate Maloric - set npcflag: Spellclick'),
(@ENTRY,0,1,0,23,0,100,0,@SPELL1,0,0,0,81,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Maloric - on NoAura: Incapacitate Maloric - set npcflag: none');
-- conditions for Large Femur and Maloric
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=18 AND `SourceEntry`=@QUEST_LOOT;
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=@SPELL2;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(18,0,@QUEST_LOOT,0,24,1,@ENTRY,0,0,'','Item:Large Femur only target Maloric'),
(17,0,@SPELL2,0,9,@QUEST,0,0,0,'','Needs taken Quest 13654 to perform Spell: Search Maloric');
-- cast search Maloric, get quest item, quest completed
DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=@ENTRY;
INSERT INTO `npc_spellclick_spells` VALUES
(@ENTRY,@SPELL2,@QUEST,1,@QUEST,2,0,0,0);
@@ -0,0 +1,13 @@
-- [Q] Scourgekabob
-- Despawn Mummy Bunny SAI
SET @ENTRY := 27931;
SET @SPELL_CREDIT := 50035;
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(@ENTRY,0,0,0,54,0,100,0,0,0,0,0,11,@SPELL_CREDIT,0,0,0,0,0,7,0,0,0,0,0,0,0,'Despawn Mummy Bunny - Just Summoned - Quest Credit');
-- Fix an older sql guid
DELETE FROM `gameobject` WHERE `id`=192262; -- Jormunger Control Orb
INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
(173, 192262, 571, 1, 0x8, 8497.219, -90.90104, 789.2875, 0.1396245, 0, 0, 0.06975555, 0.9975641, 0, 0, 0);
@@ -0,0 +1,35 @@
-- Saronite Mine Slave SAI
SET @ENTRY := 31397;
SET @QUEST := 13300;
SET @GOSSIP := 10137;
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY,@ENTRY*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
(@ENTRY,0,0,0,62,0,100,0,@GOSSIP,0,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Saronite Mine Slave - On Gossip Select - Run Script"),
(@ENTRY*100,9,0,0,0,0,100,1,0,0,0,0,72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"Saronite Mine Slave - On Script - Close Gossip"),
(@ENTRY*100,9,1,0,0,0,100,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"Saronite Mine Slave - On Script - Yell Line (random)"),
(@ENTRY*100,9,2,0,0,0,100,1,0,0,0,0,33,31866,0,0,0,0,0,0,0,0,0,0,0,0,0,"Saronite Mine Slave - On Script - Quest Credit"),
(@ENTRY*100,9,3,0,0,0,100,1,0,0,0,0,41,5000,0,0,0,0,0,0,0,0,0,0,0,0,0,"Saronite Mine Slave - On Script - Force Despawn");
-- Texts
DELETE FROM `creature_text` WHERE `entry`=@ENTRY;
INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
(@ENTRY,0,0,"AHAHAHAHA... you'll join us soon enough!",14,0,100,0,0,0,"Saronite Mine Slave"),
(@ENTRY,0,1,"I don't want to leave! I want to stay here!",14,0,100,0,0,0,"Saronite Mine Slave"),
(@ENTRY,0,2,"NO! You're wrong! The voices in my head are beautiful!",14,0,100,0,0,0,"Saronite Mine Slave"),
(@ENTRY,0,3,"My life for you!",14,0,100,0,0,0,"Saronite Mine Slave"),
(@ENTRY,0,4,"I'm coming, master!",14,0,100,0,0,0,"Saronite Mine Slave");
-- Actual story menu
DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=14068;
INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,14068);
-- Insert option menu
DELETE FROM `gossip_menu_option` WHERE `menu_id`=@GOSSIP;
INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`) VALUES
(@GOSSIP,0,0,"Go on, you're free. Get out of here!",1,1,0);
-- Only show gossip if player is on quest Slaves to Saronite
DELETE FROM `conditions` WHERE `SourceGroup`=@GOSSIP AND `ConditionValue1`=@QUEST;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(15,@GOSSIP,0,0,9,@QUEST,0,0,0,'',"Only show first gossip if player is on quest Slaves to Saronite");
@@ -0,0 +1,6 @@
-- Prisoners of the Grimtotems
UPDATE `gameobject_template` SET `ScriptName`='go_blackhoof_cage'/*,`data2`=30000*/ WHERE `entry`=186287;
UPDATE `quest_template` SET `ReqSpellCast1`=0 WHERE `entry`=11145;
DELETE FROM `creature_text` WHERE `entry`=23720;
INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
(23720,0,0,"Thank you! There's no telling what those brutes would've done to me.",12,0,100,18,0,0,"Theramore Prisoner");
@@ -0,0 +1,19 @@
-- Electromental SAI
SET @ENTRY := 21729;
SET @SPELL_LIGHTNING_BOLT := 37273;
SET @SPELL_MAGNETO_COLLECTOR := 37136;
SET @SPELL_ELECTROMENTAL_VISUAL := 37248;
SET @SPELL_SUMMON_ELECTROMENTAL := 37264;
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY;
DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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
(@ENTRY,0,0,0,1,0,100,1,0,0,0,0,11,@SPELL_ELECTROMENTAL_VISUAL,1,0,0,0,0,1,0,0,0,0,0,0,0,"Electromental - Out Of Combat - Cast Power Converters: Electromental Visual"),
(@ENTRY,0,1,0,0,0,100,0,1000,2000,2400,3800,11,@SPELL_LIGHTNING_BOLT,1,0,0,0,0,2,0,0,0,0,0,0,0,"Electromental - In Combat - Cast Lightning Bolt"),
(@ENTRY,0,2,0,8,0,100,0,@SPELL_MAGNETO_COLLECTOR,0,0,0,23,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Electromental - on spellhit - increment event phase'),
(@ENTRY,0,3,0,6,1,100,0,0,0,0,0,33,21731,0,0,0,0,0,7,0,0,0,0,0,0,0,'Electromental - on death during phase 1 - give quest credit');
-- Insert spell
DELETE FROM `spell_dbc` WHERE `Id`=@SPELL_SUMMON_ELECTROMENTAL;
INSERT INTO `spell_dbc`(`Id`,`Dispel`,`Mechanic`,`Attributes`,`AttributesEx`,`AttributesEx2`,`AttributesEx3`,`AttributesEx4`,`AttributesEx5`,`Stances`,`StancesNot`,`Targets`,`CastingTimeIndex`,`AuraInterruptFlags`,`ProcFlags`,`ProcChance`,`ProcCharges`,`MaxLevel`,`BaseLevel`,`SpellLevel`,`DurationIndex`,`RangeIndex`,`StackAmount`,`EquippedItemClass`,`EquippedItemSubClassMask`,`EquippedItemInventoryTypeMask`,`Effect1`,`Effect2`,`Effect3`,`EffectDieSides1`,`EffectDieSides2`,`EffectDieSides3`,`EffectRealPointsPerLevel1`,`EffectRealPointsPerLevel2`,`EffectRealPointsPerLevel3`,`EffectBasePoints1`,`EffectBasePoints2`,`EffectBasePoints3`,`EffectMechanic1`,`EffectMechanic2`,`EffectMechanic3`,`EffectImplicitTargetA1`,`EffectImplicitTargetA2`,`EffectImplicitTargetA3`,`EffectImplicitTargetB1`,`EffectImplicitTargetB2`,`EffectImplicitTargetB3`,`EffectRadiusIndex1`,`EffectRadiusIndex2`,`EffectRadiusIndex3`,`EffectApplyAuraName1`,`EffectApplyAuraName2`,`EffectApplyAuraName3`,`EffectAmplitude1`,`EffectAmplitude2`,`EffectAmplitude3`,`EffectMultipleValue1`,`EffectMultipleValue2`,`EffectMultipleValue3`,`EffectMiscValue1`,`EffectMiscValue2`,`EffectMiscValue3`,`EffectMiscValueB1`,`EffectMiscValueB2`,`EffectMiscValueB3`,`EffectTriggerSpell1`,`EffectTriggerSpell2`,`EffectTriggerSpell3`,`EffectSpellClassMaskA1`,`EffectSpellClassMaskA2`,`EffectSpellClassMaskA3`,`EffectSpellClassMaskB1`,`EffectSpellClassMaskB2`,`EffectSpellClassMaskB3`,`EffectSpellClassMaskC1`,`EffectSpellClassMaskC2`,`EffectSpellClassMaskC3`,`MaxTargetLevel`,`SpellFamilyName`,`SpellFamilyFlags1`,`SpellFamilyFlags2`,`SpellFamilyFlags3`,`MaxAffectedTargets`,`DmgClass`,`PreventionType`,`DmgMultiplier1`,`DmgMultiplier2`,`DmgMultiplier3`,`AreaGroupId`,`SchoolMask`,`Comment`) VALUES
(@SPELL_SUMMON_ELECTROMENTAL,0,0,256,0,0,0,0,0,0,0,0,1,0,0,101,0,0,0,0,26,1,0,-1,0,0,28,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,38,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,@ENTRY,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,'Power Converters: Summon Electromental');
@@ -0,0 +1,27 @@
-- Fix quest 12166: The Liquid Fire Of Elune
SET @SPELL := 46770;
SET @VISUAL := 47972;
SET @ITEM := 36956;
SET @ELK := 26616;
SET @GRIZZLY := 26643;
SET @ELKDUMMY = 27111;
SET @GRIZZLYDUMMY = 27112;
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (@ELK, @GRIZZLY);
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ELK,@GRIZZLY) AND `source_type`=0;
DELETE FROM `creature_ai_scripts` WHERE `id` IN (2661601,2661602,2661603,2664301,2664302,2664303);
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
(@GRIZZLY,0,0,1,8,0,100,0x01,@SPELL,0,0,0,33,@GRIZZLYDUMMY,0,0,0,0,0,7,0,0,0,0,0,0,0,'Rabid Grizzly - On spell hit - Give kill credit for quest 12166'),
(@GRIZZLY,0,1,0,61,0,100,1,0,0,0,0,41,5000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Rabid Grizzly - Despawn after 5 seconds'),
(@ELK,0,0,1,8,0,100,0x01,@SPELL,0,0,0,33,@ELKDUMMY,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Blighted Elk - On spell hit - Give kill credit for quest 12166'),
(@ELK,0,1,0,61,0,100,1,0,0,0,0,41,5000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blighted Elk - Despawn after 5 secondes');
-- Fix the quest item to allow it to only target the two quest NPCs
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=18 AND `SourceEntry`=@ITEM;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(18,0,@ITEM,0,24,2,@GRIZZLY,0,0,'','Item Elune Liquid Fire target Rabid Grizzly (dead)'),
(18,0,@ITEM,0,24,2,@ELK,0,0,'','Item Elune Liquid Fire target Blighted Elk (dead)');
DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=46770;
INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES
(46770, 47972, 1, 'Liquid Fire of Elune');
@@ -0,0 +1,21 @@
UPDATE `creature_template` SET `baseattacktime`=2000,`unit_flags`=`unit_flags`|0x8040,`equipment_id`=1014 WHERE `entry` IN (35309,35310); -- Argent Lightwielder
UPDATE `creature_template` SET `baseattacktime`=2000,`unit_flags`=`unit_flags`|0x8040,`equipment_id`=279 WHERE `entry` IN (35307,35308); -- Argent Priestess
UPDATE `creature_template` SET `baseattacktime`=1500,`unit_flags`=`unit_flags`|0x140,`equipment_id`=1926 WHERE `entry` IN (35451,35490); -- The Black Knight
UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1.5,`gender`=1 WHERE `modelid`=29763; -- Argent Lightwielder
UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1.5,`gender`=1 WHERE `modelid`=29761; -- Argent Priestess
UPDATE `creature_model_info` SET `bounding_radius`=0.766,`combat_reach`=3,`gender`=0 WHERE `modelid`=29837; -- The Black Knight
DELETE FROM `creature_template_addon` WHERE `entry` IN (35309,35307,35451);
INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
(35309,0,0,1,0, NULL), -- Argent Lightwielder
(35307,0,0,1,0, NULL), -- Argent Priestess
(35451,0,0,1,0, NULL); -- The Black Knight
-- Related to last commit:
UPDATE `creature_model_info` SET `bounding_radius`=1.222,`combat_reach`=3,`gender`=0 WHERE `modelid`=23966; -- Rabid Grizzly
UPDATE `creature_model_info` SET `bounding_radius`=0.98,`combat_reach`=0.98,`gender`=0 WHERE `modelid`=23952; -- Blighted Elk
DELETE FROM `creature_template_addon` WHERE `entry` IN (26616,26643);
INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
(26616,0,0,1,0, NULL), -- Blighted Elk
(26643,0,0,1,0, NULL); -- Rabid Grizzly
@@ -0,0 +1,58 @@
-- [Q] In the Name of Loken
-- Gavrock SAI
SET @ENTRY := 26420;
SET @QUEST := 12204;
SET @GOSSIP := 9485;
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY,@ENTRY*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
(@ENTRY,0,0,0,62,0,100,0,@GOSSIP,0,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,"Gavrock - On Gossip Select - Run Script"),
(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Gavrock - On Script - Close Gossip"),
(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,81,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Gavrock - On Script - Remove Gossip & Quest Flags"),
(@ENTRY*100,9,2,0,0,0,100,0,5000,5000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Gavrock - On Script - Say Text 0"),
(@ENTRY*100,9,3,0,0,0,100,0,10000,10000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Gavrock - On Script - Say Text 1"),
(@ENTRY*100,9,4,0,0,0,100,0,15000,15000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Gavrock - On Script - Say Text 2"),
(@ENTRY*100,9,5,0,0,0,100,0,0,0,0,0,33,@ENTRY,0,0,0,0,0,7,0,0,0,0,0,0,0,"Gavrock - On Script - Quest Credit"),
(@ENTRY*100,9,6,0,0,0,100,0,0,0,0,0,81,3,0,0,0,0,0,1,0,0,0,0,0,0,0,"Gavrock - On Script - Add Gossip & Quest Flags");
-- NPC talk text insert from sniff
DELETE FROM `creature_text` WHERE `entry`=@ENTRY;
INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
(@ENTRY,0,0,"Ah, yes. Loken is well known to me.",12,0,100,0,0,0,"Gavrock"),
(@ENTRY,1,0,"It is he who commands the sons of iron in their war against us.",12,0,100,0,0,0,"Gavrock"),
(@ENTRY,2,0,"From his hiding place, he oversees their preparations for war with the goal of exterminating the stone giants!",12,0,100,0,0,0,"Gavrock");
-- Add gossip_menu_option condition
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=@GOSSIP;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ConditionTypeOrReference`,`ConditionValue1`) VALUES
(15,@GOSSIP,0,9,@QUEST);
-- Hugh Glass SAI
SET @ENTRY := 26484;
SET @QUEST := 12204;
SET @GOSSIP := 9484;
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY,@ENTRY*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
(@ENTRY,0,0,0,62,0,100,0,@GOSSIP,0,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,"Hugh Glass - On Gossip Select - Run Script"),
(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Hugh Glass - On Script - Close Gossip"),
(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,81,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Hugh Glass - On Script - Remove Gossip & Quest Flags"),
(@ENTRY*100,9,2,0,0,0,100,0,5000,5000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Hugh Glass - On Script - Say Text 0"),
(@ENTRY*100,9,3,0,0,0,100,0,10000,10000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Hugh Glass - On Script - Say Text 1"),
(@ENTRY*100,9,5,0,0,0,100,0,0,0,0,0,33,@ENTRY,0,0,0,0,0,7,0,0,0,0,0,0,0,"Hugh Glass - On Script - Quest Credit"),
(@ENTRY*100,9,6,0,0,0,100,0,0,0,0,0,81,3,0,0,0,0,0,1,0,0,0,0,0,0,0,"Hugh Glass - On Script - Add Gossip & Quest Flags");
DELETE FROM `gossip_menu_option` WHERE `menu_id`=@GOSSIP AND `id`=0;
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
(@GOSSIP, 0, 0, 'Calm down, I want to ask you about the Iron Dwarves and Loken.', 1, 1, 0, 0, 0, 0, NULL);
-- NPC talk text insert from sniff
DELETE FROM `creature_text` WHERE `entry`=@ENTRY;
INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`TEXT`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
(@ENTRY,0,0,"He's out to get me, too! I'd be careful around here if I was you, traveler. You never know which tree he's hiding behind!",12,0,100,0,0,0,"Hugh Glass"),
(@ENTRY,1,0,"That's not something Limpy Joe would ask! But yeah, I know Loken.",12,0,100,0,0,0,"Hugh Glass");
-- Add gossip_menu_option condition
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=@GOSSIP;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ConditionTypeOrReference`,`ConditionValue1`) VALUES
(15,@GOSSIP,0,9,@QUEST);
@@ -0,0 +1,22 @@
-- [Q] The Dreghood Elder
SET @ENTRY_AYLAAN := 20679;
SET @ENTRY_AKORU := 20678;
SET @ENTRY_MOROD := 20677;
-- Aylaan the Waterwalker - Akoru the Firecaller - Morod the Windstirrer SAI
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (@ENTRY_AKORU,@ENTRY_AYLAAN,@ENTRY_MOROD);
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY_AKORU,@ENTRY_AYLAAN,@ENTRY_MOROD);
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_AYLAAN,0,0,0,62,0,100,0,8161,0,0,0,33,@ENTRY_AYLAAN,0,0,0,0,0,7,0,0,0,0,0,0,0,"Aylaan the Waterwalker - On Gossip Select - Quest Credit The Dreghood Elders"),
(@ENTRY_AYLAAN,0,1,0,62,0,100,0,8161,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Aylaan the Waterwalker - On gossip option select - Close gossip"),
(@ENTRY_AKORU,0,0,0,62,0,100,0,8163,0,0,0,33,@ENTRY_AKORU,0,0,0,0,0,7,0,0,0,0,0,0,0,"Akoru the Firecaller - On Gossip Select - Quest Credit The Dreghood Elders"),
(@ENTRY_AKORU,0,1,0,62,0,100,0,8163,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Akoru the Firecaller - On gossip option select - Close gossip"),
(@ENTRY_MOROD,0,0,0,62,0,100,0,8162,0,0,0,33,@ENTRY_MOROD,0,0,0,0,0,7,0,0,0,0,0,0,0,"Morod the Windstirrer - On Gossip Select - Quest Credit The Dreghood Elders"),
(@ENTRY_MOROD,0,1,0,62,0,100,0,8162,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Morod the Windstirrer - On gossip option select - Close gossip");
-- Only show first gossip if player is on quest The Dreghood Elders
DELETE FROM `conditions` WHERE `SourceGroup` IN (8161,8163,8162) AND `ConditionValue1` IN (10368);
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(15,8161,0,0,9,10368,0,0,0,'',"Only show gossip if player is on quest The Dreghood Elders"),
(15,8163,0,0,9,10368,0,0,0,'',"Only show gossip if player is on quest The Dreghood Elders"),
(15,8162,0,0,9,10368,0,0,0,'',"Only show gossip if player is on quest The Dreghood Elders");
@@ -0,0 +1,43 @@
-- [Q] The Warm-Up
-- Kirgaraak SAI
SET @ENTRY := 29352;
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY;
DELETE FROM smart_scripts WHERE source_type=0 AND entryorguid=@ENTRY;
DELETE FROM smart_scripts WHERE source_type=9 AND entryorguid=@ENTRY*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
(@ENTRY,0,0,0,2,0,100,0,0,5,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,'Kirgaraak - At 5% HP - Run Script'),
(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,33,30221,0,0,0,0,0,7,0,0,0,0,0,0,0,'Kirgaraak - On Script - Quest Credit'),
(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,2,35,0,0,0,0,0,1,0,0,0,0,0,0,0,'Kirgaraak - On Script - Make Friendly'),
(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,24,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Kirgaraak - On Script - Evade'),
(@ENTRY*100,9,3,0,0,0,100,0,10000,10000,0,0,2,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Kirgaraak - On Script - Reset Faction');
UPDATE `creature_template` SET `exp`=0 WHERE `entry`=24921; -- Cosmetic Trigger - LAB
UPDATE `creature_model_info` SET `bounding_radius`=2,`combat_reach`=7,`gender`=0 WHERE `modelid`=26202; -- Kirgaraak
DELETE FROM `creature_template_addon` WHERE `entry` IN (@ENTRY,29918,24921);
INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
(@ENTRY,0,0,1,0, NULL), -- Kirgaraak
(29918,0,0,1,0, NULL), -- Warbear Matriarch
(24921,0,0,1,0, NULL); -- Cosmetic Trigger - LAB
-- Not working correctly. It will work when spells get fixed
-- 1) Can't have more than one 54324 in the same target. 2) That aura gets removed when target enters in combat and it shouldn't
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=24921;
DELETE FROM `smart_scripts` WHERE `entryorguid` BETWEEN -104008 AND -103996 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
(-103996, 0, 0, 0, 1, 0, 0, 1, 500, 500, 0, 0, 11, 54324, 0, 0, 0, 0, 0, 11, @ENTRY, 60, 0, 0, 0, 0, 0, 'Cosmetic Trigger - LAB (Brunnhildar Village) - Cast Cosmetic Chains at Kirgaraak'),
(-103997, 0, 0, 0, 1, 0, 0, 1, 500, 500, 0, 0, 11, 54324, 0, 0, 0, 0, 0, 11, @ENTRY, 60, 0, 0, 0, 0, 0, 'Cosmetic Trigger - LAB (Brunnhildar Village) - Cast Cosmetic Chains at Kirgaraak'),
(-103998, 0, 0, 0, 1, 0, 0, 1, 500, 500, 0, 0, 11, 54324, 0, 0, 0, 0, 0, 11, @ENTRY, 60, 0, 0, 0, 0, 0, 'Cosmetic Trigger - LAB (Brunnhildar Village) - Cast Cosmetic Chains at Kirgaraak'),
(-103999, 0, 0, 0, 1, 0, 0, 1, 500, 500, 0, 0, 11, 54324, 0, 0, 0, 0, 0, 11, @ENTRY, 60, 0, 0, 0, 0, 0, 'Cosmetic Trigger - LAB (Brunnhildar Village) - Cast Cosmetic Chains at Kirgaraak'),
(-104000, 0, 0, 0, 1, 0, 0, 1, 500, 500, 0, 0, 11, 54324, 0, 0, 0, 0, 0, 11, @ENTRY, 60, 0, 0, 0, 0, 0, 'Cosmetic Trigger - LAB (Brunnhildar Village) - Cast Cosmetic Chains at Kirgaraak'),
(-104001, 0, 0, 0, 1, 0, 0, 1, 500, 500, 0, 0, 11, 54324, 0, 0, 0, 0, 0, 11, @ENTRY, 60, 0, 0, 0, 0, 0, 'Cosmetic Trigger - LAB (Brunnhildar Village) - Cast Cosmetic Chains at Kirgaraak'),
(-104002, 0, 0, 0, 1, 0, 0, 1, 500, 500, 0, 0, 11, 54324, 0, 0, 0, 0, 0, 11, @ENTRY, 60, 0, 0, 0, 0, 0, 'Cosmetic Trigger - LAB (Brunnhildar Village) - Cast Cosmetic Chains at Kirgaraak'),
(-104003, 0, 0, 0, 1, 0, 0, 1, 500, 500, 0, 0, 11, 54324, 0, 0, 0, 0, 0, 11, @ENTRY, 60, 0, 0, 0, 0, 0, 'Cosmetic Trigger - LAB (Brunnhildar Village) - Cast Cosmetic Chains at Kirgaraak'),
(-104004, 0, 0, 0, 1, 0, 0, 1, 500, 500, 0, 0, 11, 54324, 0, 0, 0, 0, 0, 11, @ENTRY, 60, 0, 0, 0, 0, 0, 'Cosmetic Trigger - LAB (Brunnhildar Village) - Cast Cosmetic Chains at Kirgaraak'),
(-104005, 0, 0, 0, 1, 0, 0, 1, 500, 500, 0, 0, 11, 54324, 0, 0, 0, 0, 0, 11, @ENTRY, 60, 0, 0, 0, 0, 0, 'Cosmetic Trigger - LAB (Brunnhildar Village) - Cast Cosmetic Chains at Kirgaraak'),
(-104006, 0, 0, 0, 1, 0, 0, 1, 500, 500, 0, 0, 11, 54324, 0, 0, 0, 0, 0, 11, @ENTRY, 60, 0, 0, 0, 0, 0, 'Cosmetic Trigger - LAB (Brunnhildar Village) - Cast Cosmetic Chains at Kirgaraak'),
(-104007, 0, 0, 0, 1, 0, 0, 1, 500, 500, 0, 0, 11, 54324, 0, 0, 0, 0, 0, 11, @ENTRY, 60, 0, 0, 0, 0, 0, 'Cosmetic Trigger - LAB (Brunnhildar Village) - Cast Cosmetic Chains at Kirgaraak'),
(-104008, 0, 0, 0, 1, 0, 0, 1, 500, 500, 0, 0, 11, 54324, 0, 0, 0, 0, 0, 11, @ENTRY, 60, 0, 0, 0, 0, 0, 'Cosmetic Trigger - LAB (Brunnhildar Village) - Cast Cosmetic Chains at Kirgaraak');
@@ -0,0 +1,74 @@
-- Quest:The Armor's Secrets (12980)
DELETE FROM `creature` WHERE `id`=30190;
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
(6337,30190,571,1,1,0,0,8256.75,-433.488,970.583,4.223697,300,0,0,1,0,0,0,0,0);
-- Anvil and Metel bars
DELETE FROM `gameobject` WHERE `id` IN (192125,192128);
INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES
(177,192125,571,1,1,8262.05,-430.288,968.272,0,0,0,-0.861628,0.507539,120,0,1),
(183,192125,571,1,1,8231.716,-451.452576,968.368835,-3.10665226,0,0,0,0,120,0,1),
(181,192128,571,1,1,8281.357,-432.069,970.723,-2.844883,0,0,-0.9890156,0.1478114,120,0,1),
(188,192128,571,1,1,8233.997,-434.379456,970.722961,-2.07693934,0,0,0,0,120,0,1),
(190,192128,571,1,1,8243.935,-429.880981,970.722961,-1.08210289,0,0,0,0,120,0,1),
(194,192128,571,1,1,8246.777,-424.707367,970.722961,-1.16936862,0,0,0,0,120,0,1),
(197,192128,571,1,1,8264.213,-432.40332,975.778564,1.134463,0,0,0,0,120,0,1);
-- Template updates
UPDATE `creature_template` SET `npcflag`=`npcflag`|1,`speed_run`=0.99206 WHERE `entry`=30190; -- Attendant Tock
UPDATE `creature_template` SET `speed_run`=0.99206 WHERE `entry`=30170; -- Mechagnome Attendant
-- Addon data
DELETE FROM `creature_template_addon` WHERE `entry` IN (30190,30170);
INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
(30190,0,0,1,0,NULL), -- Mechagnome Attendant
(30170,0,7,1,0, NULL); -- Attendant Tock
SET @ENTRY=30190;
UPDATE `creature_template` SET `gossip_menu_id`=9880, `AIName`='SmartAI' WHERE entry=@ENTRY;
DELETE FROM `gossip_menu_option` WHERE `menu_id`=9880;
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
(9880,0,0,'I found this strange armor plate. Can you tell me more about it?',1,1,0,0,0,0, '');
DELETE FROM `gossip_menu` WHERE `entry`=9880;
INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES
(9880,13703);
DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@ENTRY*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
(@ENTRY,0,0,0,62,0,100,0,9880,0,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Attendant Tock - Start Script'),
(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,83,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Attendant Tock - Remove Gossip Flag'),
(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Attendant Tock - Close Gossip'),
(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,50,192132,77000,0,0,0,0,8,0,0,0,8262.029,-430.0284,974.1605,-2.757613, 'Attendant Tock - Summon Armor'),
(@ENTRY*100,9,3,0,0,0,100,0,4000,4000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Attendant Tock - Speach 0'),
(@ENTRY*100,9,4,0,0,0,100,0,5000,5000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Attendant Tock - Speach 1'),
(@ENTRY*100,9,5,0,0,0,100,0,4000,4000,0,0,69,0,0,0,0,0,0,8,0,0,0,8262.029,-430.0284,976.1391,1.6, 'Attendant Tock - Move'), -- Move
(@ENTRY*100,9,6,0,0,0,100,0,15000,15000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Attendant Tock - Speach 2'),
(@ENTRY*100,9,7,0,0,0,100,0,6000,6000,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Attendant Tock - Speach 3'),
(@ENTRY*100,9,8,0,0,0,100,0,7000,7000,0,0,1,4,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Attendant Tock - Speach 4'),
(@ENTRY*100,9,9,0,0,0,100,0,7000,7000,0,0,1,5,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Attendant Tock - Speach 5'),
(@ENTRY*100,9,10,0,0,0,100,0,6000,6000,0,0,1,6,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Attendant Tock - Speach 6'),
(@ENTRY*100,9,11,0,0,0,100,0,5000,5000,0,0,1,7,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Attendant Tock - Speach 7'),
(@ENTRY*100,9,12,0,0,0,100,0,6000,6000,0,0,1,8,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Attendant Tock - Speach 8'),
(@ENTRY*100,9,13,0,0,0,100,0,0,0,0,0,69,0,0,0,0,0,0,1,0,0,0,8256.75,-433.488,970.583,4.223697, 'Attendant Tock - Move Home'),
(@ENTRY*100,9,14,0,0,0,100,0,6000,6000,0,0,1,9,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Attendant Tock - Speach 9'),
(@ENTRY*100,9,15,0,0,0,100,0,0,0,0,0,33,30190,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Attendant Tock - Quest Credit'),
(@ENTRY*100,9,16,0,0,0,100,0,0,0,0,0,82,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Attendant Tock - Add Gossip Flag');
DELETE FROM `creature_text` WHERE `entry`=30190;
INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
(30190,0,0,'Metallic specimen of foreign origin detected.',12,0,100,0,5,0, 'Attendant Tock'),
(30190,1,0,'Beginning analysis...',12,0,100,0,0,0, 'Attendant Tock'),
(30190,2,0,'Specimen identified as an alloy of saronite and iron.',12,0,100,0,0,0, 'Attendant Tock'),
(30190,3,0,'The ore used in this sample originated deep wihin the crust of Azeroth and was recently unearthed.',12,0,100,275,0,0, 'Attendant Tock'),
(30190,4,0,'The saronite in this sample is nearly pure. Ores like this do not occur naturally on the surface of Azeroth.',12,0,100,0,0,0, 'Attendant Tock'),
(30190,5,0,'This ore can only have been created by a powerful, malevolent force. Attempting to access databanks for more information...',12,0,100,1,0,0, 'Attendant Tock'),
(30190,6,0,'Access denied?!',12,0,100,6,0,0, 'Attendant Tock'),
(30190,7,0,'Further information can only be accessed from the archives within Ulduar, by order of Keeper Loken.',12,0,100,1,0,0, 'Attendant Tock'),
(30190,8,0,'But one thing is for certain: this plate''s size, thickness, and bolt holes point to a use as armor for a colossal structure.',12,0,100,1,0,0, 'Attendant Tock'),
(30190,9,0,'Directive completed. Returning TO standby mode.',12,0,100,1,0,0, 'Attendant Tock');
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=9880;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(15,9880,0,0,9,12980,0,0,0, '', 'The Armor''s Secrets');
@@ -0,0 +1,46 @@
-- Quest: No Where to Run (12261)
-- SAI for Destructive Ward
SET @ENTRY :=27430;
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@ENTRY*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
(@ENTRY,0,0,0,11,0,100,0,0,0,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0, 'Destructive Ward - On spawn Start Script'),
(@ENTRY*100,9,0,0,0,0,100,0,2000,2000,0,0,11,48715,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Destructive Ward - Summon Smoldering Skeleton'),
(@ENTRY*100,9,1,0,0,0,100,0,15000,15000,0,0,11,48715,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Destructive Ward - Summon Smoldering Skeleton'),
(@ENTRY*100,9,2,0,0,0,100,0,1000,1000,0,0,11,48735,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Destructive Ward - Destructive Ward Powerup'),
(@ENTRY*100,9,3,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Destructive Ward - Raid Emote'),
(@ENTRY*100,9,4,0,0,0,100,0,0,0,0,0,11,48733,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Destructive Ward - Destructive Pulse'),
(@ENTRY*100,9,5,0,0,0,100,0,15000,15000,0,0,11,48718,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Destructive Ward - Summon Smoldering Construct'),
(@ENTRY*100,9,6,0,0,0,100,0,15000,15000,0,0,11,48718,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Destructive Ward - Summon Smoldering Construct'),
(@ENTRY*100,9,7,0,0,0,100,0,1000,1000,0,0,11,48735,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Destructive Ward - Destructive Ward Powerup'),
(@ENTRY*100,9,8,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Destructive Ward - Raid Emote'),
(@ENTRY*100,9,9,0,0,0,100,0,0,0,0,0,11,48733,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Destructive Ward - Destructive Pulse'),
(@ENTRY*100,9,10,0,0,0,100,0,25000,25000,0,0,11,48715,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Destructive Ward - Summon Smoldering Skeleton'),
(@ENTRY*100,9,11,0,0,0,100,0,0,0,0,0,11,48715,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Destructive Ward - Summon Smoldering Skeleton'),
(@ENTRY*100,9,12,0,0,0,100,0,0,0,0,0,11,48718,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Destructive Ward - Summon Smoldering Construct'),
(@ENTRY*100,9,13,0,0,0,100,0,2000,2000,0,0,11,48735,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Destructive Ward - Destructive Ward Powerup'),
(@ENTRY*100,9,14,0,0,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Destructive Ward - Raid Emote'),
(@ENTRY*100,9,15,0,0,0,100,0,0,0,0,0,11,48734,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Destructive Ward - Destructive Barrage'),
(@ENTRY*100,9,16,0,0,0,100,0,1000,1000,0,0,11,48734,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Destructive Ward - Destructive Barrage'),
(@ENTRY*100,9,17,0,0,0,100,0,1000,1000,0,0,11,48734,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Destructive Ward - Destructive Barrage'),
(@ENTRY*100,9,18,0,0,0,100,0,0,0,0,0,11,52409,0,0,0,0,0,23,0,0,0,0,0,0,0, 'Destructive Ward - Destructive Ward Kill Credit'),
(@ENTRY*100,9,19,0,0,0,100,0,0,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Destructive Ward - Despawn');
DELETE FROM `creature_text` WHERE `entry`=27430;
INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
(27430,0,0, 'The Destructive Ward gains in power.',41,0,100,0,0,0, 'Destructive Ward'),
(27430,1,0, 'The Destructive Ward is fully charged!',41,0,100,0,0,0, 'Destructive Ward');
-- Template update
UPDATE `creature_template` SET `exp`=2,`minlevel`=73,`maxlevel`=73,`unit_flags`=`unit_flags`|4|256,`speed_run`=1, RegenHealth=0 WHERE `entry`=27430; -- Destructive Ward
-- Model data
UPDATE `creature_model_info` SET `bounding_radius`=1,`combat_reach`=1,`gender`=2 WHERE `modelid`=25167; -- Destructive Ward
UPDATE `creature_model_info` SET `bounding_radius`=0.945,`combat_reach`=0.945,`gender`=0 WHERE `modelid`=23951; -- Snowfall Elk
-- Addon data
DELETE FROM `creature_template_addon` WHERE `entry` IN (27430,26615);
INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
(26615,0,0,1,0, NULL), -- Snowfall Elk
(27430,0,0,1,0, NULL); -- Destructive Ward
@@ -0,0 +1,23 @@
-- [Q] Brother Against Brother
-- Lakka SAI
SET @ENTRY := 18956;
SET @QUEST := 10097;
SET @GOSSIP := 7868;
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY,@ENTRY*100) 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
(@ENTRY,0,0,0,62,0,100,0,@GOSSIP,0,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,"Lakka - On Gossip Select - Run Script"),
(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Lakka - On Script - Close Gossip"),
(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Lakka - On Script - Say Text 0"), -- Target_type_action_invoker because of <name>
(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,33,@ENTRY,0,0,0,0,0,7,0,0,0,0,0,0,0,"Lakka - On Script - Quest Credit"),
(@ENTRY*100,9,3,0,0,0,100,0,0,0,0,0,41,5000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Lakka - On Script - Despawn");
-- NPC talk text insert
DELETE FROM `creature_text` WHERE `entry`=@ENTRY;
INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
(@ENTRY,0,0,"Thank you for freeing me, $N! I'm going to make my way to Shattrath!",12,0,100,0,0,0,"Lakka");
-- Add gossip_menu_option condition
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=@GOSSIP;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ConditionTypeOrReference`,`ConditionValue1`) VALUES
(15,@GOSSIP,0,9,@QUEST);
@@ -0,0 +1,13 @@
-- Make Fjola drop two items from her loot table
-- 10 Normal
UPDATE `creature_loot_template` SET `maxcount`=2 WHERE `entry`=34497 AND `item`=2;
UPDATE `creature_loot_template` SET `maxcount`=2 WHERE `entry`=34497 AND `item`=1;
-- 25 Normal
UPDATE `creature_loot_template` SET `maxcount`=2 WHERE `entry`=35350 AND `item`=2;
UPDATE `creature_loot_template` SET `maxcount`=2 WHERE `entry`=35350 AND `item`=1;
-- 10 Heroic
UPDATE `creature_loot_template` SET `maxcount`=2 WHERE `entry`=35351 AND `item`=2;
UPDATE `creature_loot_template` SET `maxcount`=2 WHERE `entry`=35351 AND `item`=1;
-- 25 Herioc
UPDATE `creature_loot_template` SET `maxcount`=2 WHERE `entry`=35352 AND `item`=2;
UPDATE `creature_loot_template` SET `maxcount`=2 WHERE `entry`=35352 AND `item`=1;
@@ -0,0 +1 @@
DELETE FROM `spell_linked_spell` WHERE `spell_trigger` = -58600;
@@ -0,0 +1,201 @@
DELETE FROM `creature_text` WHERE `entry` IN (36597,38995,38579,36823,39217);
INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
(36597,0,0,'So the Light''s vaunted justice has finally arrived? Shall I lay down Frostmourne and throw myself at your mercy, Fordring?',14,0,0,0,0,17349,'The Lich King - SAY_LK_INTRO_1'),
(36597,1,0,'You''ll learn of that first hand. When my work is complete, you will beg for mercy -- and I will deny you. Your anguished cries will be testament to my unbridled power...',14,0,0,22,0,17350,'The Lich King - SAY_LK_INTRO_2'),
(36597,2,0,'I''ll keep you alive to witness the end, Fordring. I would not want the Light''s greatest champion to miss seeing this wretched world remade in my image.',14,0,0,0,0,17351,'The Lich King - SAY_LK_INTRO_3'),
(36597,3,0,'Come then champions, feed me your rage!',14,0,0,0,0,0,'The Lich King - SAY_LK_AGGRO'),
(36597,4,0,'I will freeze you from within until all that remains is an icy husk!',14,0,0,0,0,17369,'The Lich King - SAY_LK_REMORSELESS_WINTER'),
(36597,5,0,'Watch as the world around you collapses!',14,0,0,0,0,17370,'The Lich King - SAY_LK_QUAKE'),
(36597,6,0,'Val''kyr, your master calls!',14,0,0,0,0,17373,'The Lich King - SAY_LK_SUMMON_VALKYR'),
(36597,7,0,'Frostmourne hungers...',14,0,0,0,0,17366,'The Lich King - SAY_LK_HARVEST_SOUL'),
(36597,8,0,'Argh... Frostmourne, obey me!',14,0,0,0,0,17367,'The Lich King - SAY_LK_FROSTMOURNE_ESCAPE'),
(36597,9,0,'Frostmourne feeds on the soul of your fallen ally!',14,0,0,0,0,17368,'The Lich King - SAY_LK_FROSTMOURNE_KILL'),
(36597,10,0,'Hope wanes!',14,0,0,0,0,17363,'The Lich King - SAY_LK_KILL'),
(36597,10,1,'The end has come!',14,0,0,0,0,17364,'The Lich King - SAY_LK_KILL'),
(36597,11,0,'Face now your tragic end!',14,0,0,0,0,17365,'The Lich King - SAY_LK_BERSERK'),
(36597,12,0,'%s begins to cast Defile!',41,0,0,0,0,0,'The Lich King - EMOTE_DEFILE_WARNING'),
(36597,13,0,'|TInterface\\Icons\\ability_creature_disease_02.blp:16|tYou have been infected by |cFFCF00FFNecrotic Plague!|r',42,0,0,0,0,0,'The Lich King - EMOTE_NECROTIC_PLAGUE_WARNING'),
(36597,14,0,'No questions remain unanswered. No doubts linger. You ARE Azeroth''s greatest champions. You overcame every challenge I laid before you. My mightiest servants have fallen before your relentless onslaught... your unbridled fury...',14,0,0,0,0,17353,'The Lich King - SAY_LK_OUTRO_1'),
(36597,15,0,'Is it truly the righteousness that drives you? I wonder...',14,0,0,0,0,17354,'The Lich King - SAY_LK_OUTRO_2'),
(36597,16,0,'You trained them well, Fordring. You delivered the greatest fighting force this world has ever known... right into my hands -- exactly as I intended. You shall be rewarded for your unwitting sacrifice.',14,0,0,0,0,17355,'The Lich King - SAY_LK_OUTRO_3'),
(36597,17,0,'Watch now as I raise them from the dead to become masters of the Scourge. They will shroud this world in chaos and destruction. Azeroth''s fall will come at their hands -- and you will be the first to die.',14,0,0,0,0,17356,'The Lich King - SAY_LK_OUTRO_4'),
(36597,18,0,'I delight in the irony...',14,0,0,0,0,17357,'The Lich King - SAY_LK_OUTRO_5'),
(36597,19,0,'Impossible...',14,0,0,0,0,17358,'The Lich King - SAY_LK_OUTRO_6'),
(36597,20,0,'Now I stand, the lion before the lambs... and they do not fear.',14,0,0,0,0,17361,'The Lich King - SAY_LK_OUTRO_7'),
(36597,21,0,'They cannot fear.',14,0,0,0,0,17362,'The Lich King - SAY_LK_OUTRO_8'),
(38995,0,0,'We''ll grant you a swift death, Arthas. More than can be said for the thousands you''ve tortured and slain.',14,0,0,0,0,17390,'Highlord Tirion Fordring - SAY_TIRION_INTRO_1'),
(38995,1,0,'So be it. Champions, attack!',14,0,0,0,0,17391,'Highlord Tirion Fordring - SAY_TIRION_INTRO_2'),
(38995,2,0,'LIGHT, GRANT ME ONE FINAL BLESSING. GIVE ME THE STRENGTH... TO SHATTER THESE BONDS!',14,0,0,0,0,17392,'Highlord Tirion Fordring - SAY_TIRION_OUTRO_1'),
(38995,3,0,'No more, Arthas! No more lives will be consumed by your hatred!',14,0,0,0,0,17393,'Highlord Tirion Fordring - SAY_TIRION_OUTRO_2'),
(38579,0,0,'Free at last! It is over, my son. This is the moment of reckoning.',14,0,0,1,0,17397,'Terenas Menethil - SAY_TERENAS_OUTRO_1'),
(38579,1,0,'Rise up, champions of the Light!',14,0,0,0,0,17398,'Terenas Menethil - SAY_TERENAS_OUTRO_2'),
(36823,0,0,'You have come to bring Arthas to justice? To see the Lich King destroyed?',14,0,0,0,0,17394,'Terenas Menethil - SAY_TERENAS_INTRO_1'),
(36823,1,0,'First, you must escape Frostmourne''s hold, or be damned as I am; trapped within this cursed blade for all eternity.',14,0,0,0,0,17395,'Terenas Menethil - SAY_TERENAS_INTRO_2'),
(36823,2,0,'Aid me in destroying these tortured souls! Together we will loosen Frostmourne''s hold and weaken the Lich King from within!',14,0,0,0,0,17396,'Terenas Menethil - SAY_TERENAS_INTRO_3'),
(39217,0,0,'You have come to bring Arthas to justice? To see the Lich King destroyed?',14,0,0,0,0,17394,'Terenas Menethil - SAY_TERENAS_INTRO_1'),
(39217,1,0,'First, you must escape Frostmourne''s hold, or be damned as I am; trapped within this cursed blade for all eternity.',14,0,0,0,0,17395,'Terenas Menethil - SAY_TERENAS_INTRO_2');
-- Text corrections
DELETE FROM `creature_text` WHERE `entry`=36627 AND `groupid` IN (4,9);
DELETE FROM `creature_text` WHERE `entry`=36678 AND `groupid`=9;
INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
(36627,4,0,'|TInterface\\Icons\\spell_shadow_unstableaffliction_2.blp:16|t%s begins to cast |cFFFF0000Unstable Ooze Explosion!|r',41,0,0,0,0,0,'Rotface - EMOTE_UNSTABLE_EXPLOSION'),
(36627,9,0,'|TInterface\\Icons\\ability_creature_disease_02.blp:16|tYou have |cFF00FF00Mutated Infection!|r',42,0,0,0,0,0,'Rotface - EMOTE_MUTATED_INFECTION'),
(36678,9,0,'|TInterface\\Icons\\inv_misc_herb_evergreenmoss.blp:16|t%s cast |cFF00FF00Malleable Goo!|r',41,0,0,0,0,0,'Professor Putricide - EMOTE_MALLEABLE_GOO');
UPDATE `creature_template` SET `speed_walk`=2,`speed_run`=1.71429,`exp`=2,`minlevel`=83,`maxlevel`=83,`faction_A`=974,`faction_H`=974,`unit_flags`=768,`dynamicflags`=0,`equipment_id`=2425,`baseattacktime`=1500 WHERE `entry` IN (36597,39166,39167,39168); -- The Lich King
UPDATE `creature_template` SET `exp`=2,`unit_class`=2 WHERE `entry`=38995; -- Highlord Tirion Fordring
UPDATE `creature_template` SET `speed_walk`=1.2,`speed_run`=0.428571,`exp`=2,`minlevel`=80,`maxlevel`=80,`faction_A`=14,`faction_H`=14,`dynamicflags`=0 WHERE `entry` IN (36633,39305,39306,39307); -- Ice Sphere
UPDATE `creature_template` SET `speed_walk`=2,`speed_run`=1.42857,`exp`=2,`minlevel`=83,`maxlevel`=83,`faction_A`=14,`faction_H`=14,`dynamicflags`=0 WHERE `entry`=36701; -- Raging Spirit
UPDATE `creature_template` SET `speed_walk`=1.2,`speed_run`=0.428571,`exp`=2,`minlevel`=80,`maxlevel`=80,`faction_A`=14,`faction_H`=14,`dynamicflags`=0,`unit_flags`=33554944 WHERE `entry`=38757; -- Defile
UPDATE `creature_template` SET `minlevel`=80,`maxlevel`=80,`exp`=2,`faction_A`=14,`faction_H`=14,`speed_walk`=2,`speed_run`=1.71429,`unit_flags`=33554944,`dynamicflags`=0,`VehicleId`=532,`InhabitType`=1|4 WHERE `entry` IN (36609,39120,39121,39122); -- Val'kyr Shadowguard
UPDATE `creature_template` SET `speed_walk`=2,`speed_run`=1.71429,`exp`=2,`minlevel`=83,`maxlevel`=83,`faction_A`=35,`faction_H`=35,`unit_flags`=33554944,`dynamicflags`=0,`VehicleId`=531,`InhabitType`=1|4,`flags_extra`=0 WHERE `entry`=36598; -- Strangulate Vehicle
UPDATE `creature_template` SET `speed_walk`=1.2,`speed_run`=0.428571,`exp`=2,`minlevel`=80,`maxlevel`=80,`faction_A`=14,`faction_H`=14,`unit_flags`=33554944,`dynamicflags`=0,`flags_extra`=128 WHERE `entry`=38584; -- Frostmourne Trigger
UPDATE `creature_template` SET `speed_walk`=2.8,`speed_run`=1,`exp`=2,`minlevel`=80,`maxlevel`=80,`faction_A`=14,`faction_H`=14,`unit_flags`=32832,`dynamicflags`=0,`flags_extra`=256,`InhabitType`=1|4 WHERE `entry` IN (37799,39284,39285,39286); -- Vile Spirit
UPDATE `creature_template` SET `speed_walk`=1,`speed_run`=1,`exp`=2,`minlevel`=80,`maxlevel`=80,`faction_A`=1665,`faction_H`=1665,`unit_flags`=32832,`dynamicflags`=0,`flags_extra`=0,`equipment_id`=2475 WHERE `entry` IN (36823,38579,39217); -- Terenas Menethil
UPDATE `creature_template` SET `flags_extra`=`flags_extra`|128 WHERE `entry`=24648; -- Invisible Stalker (Scale x2)
UPDATE `creature_template` SET `difficulty_entry_1`=39287,`difficulty_entry_2`=39288,`difficulty_entry_3`=39289 WHERE `entry`=39190; -- Wicked Spirit
UPDATE `creature_template` SET `speed_walk`=2.8,`speed_run`=1,`exp`=2,`minlevel`=80,`maxlevel`=80,`faction_A`=14,`faction_H`=14,`unit_flags`=32832,`dynamicflags`=0,`flags_extra`=256,`InhabitType`=1|4 WHERE `entry` IN (39190,39287,39288,39289); -- Wicked Spirit
UPDATE `creature_template` SET `exp`=2,`minlevel`=83,`maxlevel`=83,`faction_A`=14,`faction_H`=14,`dynamicflags`=0,`flags_extra`=256 WHERE `entry`=36824; -- Spirit Warden
UPDATE `creature_template` SET `exp`=2,`minlevel`=83,`maxlevel`=83,`faction_A`=14,`faction_H`=14,`dynamicflags`=0,`flags_extra`=128 WHERE `entry`=39137; -- Shadow Trap
UPDATE `creature_template` SET `exp`=2,`minlevel`=80,`maxlevel`=80,`faction_A`=14,`faction_H`=14,`InhabitType`=1|4,`flags_extra`=`flags_extra`|128 WHERE `entry`=39189; -- Spirit Bomb
-- HACK, Unit::_IsValidAttackTarget returns false because of UNIT_FLAG_OOC_NOT_ATTACKABLE flag
UPDATE `creature_template` SET `unit_flags`=0x02000000 WHERE `entry`=36171;
UPDATE `creature_model_info` SET `combat_reach`=5.5 WHERE `modelid`=30721; -- The Lich King
UPDATE `creature_model_info` SET `gender`=0 WHERE `modelid`=31286; -- Highlord Tirion Fordring
DELETE FROM `creature` WHERE `guid`=202865;
DELETE FROM `creature_addon` WHERE `guid`=150211;
INSERT INTO `creature_addon` (`guid`,`bytes1`,`auras`) VALUES
(150211,1,'72846 73220 73878'); -- The Lich King
DELETE FROM `creature_template_addon` WHERE `entry` IN (39137,36609,39120,39121,39122,36598,37799,39284,39285,39286,39190,39287,39288,39289,36823,38579,39217,39189);
INSERT INTO `creature_template_addon` (`entry`,`bytes1`,`auras`) VALUES
(39137,0,'73530'),
(36609,50331648,''), -- Val'kyr Shadowguard
(39120,50331648,''), -- Val'kyr Shadowguard
(39121,50331648,''), -- Val'kyr Shadowguard
(39122,50331648,''), -- Val'kyr Shadowguard
(36598,50331648,''), -- Strangulate Vehicle
(37799,50331648,''), -- Vile Spirit
(39284,50331648,''), -- Vile Spirit
(39285,50331648,''), -- Vile Spirit
(39286,50331648,''), -- Vile Spirit
(39190,50331648,''), -- Wicked Spirit
(39287,50331648,''), -- Wicked Spirit
(39288,50331648,''), -- Wicked Spirit
(39289,50331648,''), -- Wicked Spirit
(36823,0,'72372'), -- Terenas Menethil
(38579,0,'72372'), -- Terenas Menethil
(39217,0,'72372'), -- Terenas Menethil
(39189,0,'73572'); -- Spirit Bomb
UPDATE `gameobject` SET `rotation3`=1,`animprogress`=255,`spawntimesecs`=604800 WHERE `guid` IN (100056,100061,100064);
UPDATE `gameobject` SET `rotation2`=1,`animprogress`=255,`spawntimesecs`=604800 WHERE `guid` IN (100057,100058,100059,100060,100062);
UPDATE `gameobject` SET `rotation3`=1,`animprogress`=255,`spawntimesecs`=-604800 WHERE `guid`=100063;
UPDATE `gameobject_template` SET `faction`=1375,`flags`=32 WHERE `entry`=202438; -- Lavaman Pillars (Unchained)
UPDATE `gameobject_template` SET `faction`=1375,`flags`=32 WHERE `entry`=202188; -- Doodad_Icecrown_ThroneFrostyWind01
UPDATE `gameobject_template` SET `faction`=1375,`flags`=32 WHERE `entry`=202189; -- Doodad_Icecrown_ThroneFrostyEdge01
DELETE FROM `gameobject` WHERE `id`=202438;
INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`position_x`,`position_y`,`position_z`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES
(100488,202438,631,15,425.0885,-2123.311,858.6748,1,-604800,255,1);
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (71614,70338,73785,73786,73787,68981,74270,74271,74272,72262,71440,76379,74086,72595,73650,72679,74318,74319,74320,73028,74321,74322,74323,73582,71809,71811,72431,72405,72429,73159);
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(13,0,71614,0,18,1,38995,0,0, '', 'Ice Lock - target Highlord Tirion Fordring'),
(13,0,70338,0,18,1,0,0,0, '', 'Necrotic Plague - target player'),
(13,0,70338,0,18,1,37698,0,0, '', 'Necrotic Plague - target Shambling Horror'),
(13,0,70338,0,18,1,37695,0,0, '', 'Necrotic Plague - target Drudge Ghoul'),
(13,0,73785,0,18,1,0,0,0, '', 'Necrotic Plague - target player'),
(13,0,73785,0,18,1,37698,0,0, '', 'Necrotic Plague - target Shambling Horror'),
(13,0,73785,0,18,1,37695,0,0, '', 'Necrotic Plague - target Drudge Ghoul'),
(13,0,73786,0,18,1,0,0,0, '', 'Necrotic Plague - target player'),
(13,0,73786,0,18,1,37698,0,0, '', 'Necrotic Plague - target Shambling Horror'),
(13,0,73786,0,18,1,37695,0,0, '', 'Necrotic Plague - target Drudge Ghoul'),
(13,0,73787,0,18,1,0,0,0, '', 'Necrotic Plague - target player'),
(13,0,73787,0,18,1,37698,0,0, '', 'Necrotic Plague - target Shambling Horror'),
(13,0,73787,0,18,1,37695,0,0, '', 'Necrotic Plague - target Drudge Ghoul'),
(13,0,68981,0,18,0,202141,0,0, '', 'Remorseless Winter - target Doodad_IceShard_standing02'),
(13,0,68981,0,18,0,202142,0,0, '', 'Remorseless Winter - target Doodad_IceShard_standing01'),
(13,0,68981,0,18,0,202143,0,0, '', 'Remorseless Winter - target Doodad_IceShard_standing03'),
(13,0,68981,0,18,0,202144,0,0, '', 'Remorseless Winter - target Doodad_IceShard_standing04'),
(13,0,74270,0,18,0,202141,0,0, '', 'Remorseless Winter - target Doodad_IceShard_standing02'),
(13,0,74270,0,18,0,202142,0,0, '', 'Remorseless Winter - target Doodad_IceShard_standing01'),
(13,0,74270,0,18,0,202143,0,0, '', 'Remorseless Winter - target Doodad_IceShard_standing03'),
(13,0,74270,0,18,0,202144,0,0, '', 'Remorseless Winter - target Doodad_IceShard_standing04'),
(13,0,74271,0,18,0,202141,0,0, '', 'Remorseless Winter - target Doodad_IceShard_standing02'),
(13,0,74271,0,18,0,202142,0,0, '', 'Remorseless Winter - target Doodad_IceShard_standing01'),
(13,0,74271,0,18,0,202143,0,0, '', 'Remorseless Winter - target Doodad_IceShard_standing03'),
(13,0,74271,0,18,0,202144,0,0, '', 'Remorseless Winter - target Doodad_IceShard_standing04'),
(13,0,74272,0,18,0,202141,0,0, '', 'Remorseless Winter - target Doodad_IceShard_standing02'),
(13,0,74272,0,18,0,202142,0,0, '', 'Remorseless Winter - target Doodad_IceShard_standing01'),
(13,0,74272,0,18,0,202143,0,0, '', 'Remorseless Winter - target Doodad_IceShard_standing03'),
(13,0,74272,0,18,0,202144,0,0, '', 'Remorseless Winter - target Doodad_IceShard_standing04'),
(13,0,72262,0,18,1,22515,0,0, '', 'Quake - target World Trigger'),
(13,0,71440,0,18,1,36597,0,0, '', 'Harvest Soul - target The Lich King'),
(13,0,76379,0,18,1,36597,0,0, '', 'Harvest Soul - target The Lich King'),
(13,0,74086,0,18,1,0,0,0, '', 'Destroy Soul - target player'),
(13,0,72595,0,18,1,0,0,0, '', 'Restore Soul - target player'),
(13,0,73650,0,18,1,0,0,0, '', 'Restore Soul - target player'),
(13,0,72679,0,18,1,36597,0,0, '', 'Harvested Soul - target The Lich King'),
(13,0,74318,0,18,1,36597,0,0, '', 'Harvested Soul - target The Lich King'),
(13,0,74319,0,18,1,36597,0,0, '', 'Harvested Soul - target The Lich King'),
(13,0,74320,0,18,1,36597,0,0, '', 'Harvested Soul - target The Lich King'),
(13,0,73028,0,18,1,36597,0,0, '', 'Harvested Soul - target The Lich King'),
(13,0,74321,0,18,1,36597,0,0, '', 'Harvested Soul - target The Lich King'),
(13,0,73650,0,18,1,36597,0,0, '', 'Harvested Soul - target The Lich King'),
(13,0,74323,0,18,1,36597,0,0, '', 'Harvested Soul - target The Lich King'),
(13,0,73582,0,18,1,39190,0,0, '', 'Trigger Vile Spirit (Inside, Heroic) - target Wicked Spirit'),
(13,0,71809,0,18,1,36597,0,0, '', 'Jump - target The Lich King'),
(13,0,71811,0,18,1,36597,0,0, '', 'Jump - target The Lich King'),
(13,0,72431,0,18,1,0,0,0, '', 'Jump - target player'),
(13,0,72405,0,18,1,38995,0,0, '', 'Broken Frostmourne - target Highlord Tirion Fordring'),
(13,0,72429,0,18,1,0,0,0, '', 'Mass Resurrection - target player'),
(13,0,73159,0,18,1,0,0,0, '', 'Play Movie - target player');
DELETE FROM `spell_target_position` WHERE `id` IN (70860,72546,73655);
INSERT INTO `spell_target_position` (`id`,`target_map`,`target_position_x`,`target_position_y`,`target_position_z`,`target_orientation`) VALUES
(70860,631,529.302,-2124.49, 840.857,3.1765), -- Frozen Throne Teleport
(72546,631,514.000,-2523.00,1050.990,3.1765), -- Harvest Soul (normal mode)
(73655,631,495.708,-2523.76,1050.990,3.1765); -- Harvest Soul (heroic mode)
DELETE FROM `spell_area` WHERE `spell`=74276;
INSERT INTO `spell_area` (`spell`,`area`,`autocast`) VALUES
(74276,4910,1); -- In Frostmourne Room
DELETE FROM `disables` WHERE `entry` IN (12825,13246,13247,13244,13245,13342,13309,13362,13311,12823,13163,13164,13243,12764,12909,12826,13103,13136,13137,13138,12818) AND `sourceType`=4;
DELETE FROM `achievement_criteria_data` WHERE `criteria_id` IN (12825,13246,13247,13244,13245,13342,13309,13362,13311,12823,13163,13164,13243,12764,12909,12826,13103,13136,13137,13138,12818);
INSERT INTO `achievement_criteria_data` (`criteria_id`,`type`,`value1`,`value2`,`ScriptName`) VALUES
(12825,12,2,0,''), -- Bane of the Fallen King
(13246,11,0,0,'achievement_been_waiting_long_time'), -- Been Waiting a Long Time for This (10 player)
(13246,12,0,0,''), -- Been Waiting a Long Time for This (10 player)
(13247,11,0,0,'achievement_been_waiting_long_time'), -- Been Waiting a Long Time for This (10 player) Heroic
(13247,12,2,0,''), -- Been Waiting a Long Time for This (10 player) Heroic
(13244,11,0,0,'achievement_been_waiting_long_time'), -- Been Waiting a Long Time for This (25 player)
(13244,12,1,0,''), -- Been Waiting a Long Time for This (25 player)
(13245,11,0,0,'achievement_been_waiting_long_time'), -- Been Waiting a Long Time for This (25 player) Heroic
(13245,12,3,0,''), -- Been Waiting a Long Time for This (25 player) Heroic
(13342,12,0,0,''), -- Lich King 10-player bosses killed
(13309,12,0,0,''), -- Lich King 10-player raids completed (final boss killed)
(13362,12,1,0,''), -- Lich King 25-player bosses killed
(13311,12,1,0,''), -- Lich King 25-player raids completed (final boss killed)
(12823,11,0,0,'achievement_neck_deep_in_vile'), -- Neck-Deep in Vile (10 player)
(12823,12,0,0,''), -- Neck-Deep in Vile (10 player)
(13163,11,0,0,'achievement_neck_deep_in_vile'), -- Neck-Deep in Vile (10 player) Heroic
(13163,12,2,0,''), -- Neck-Deep in Vile (10 player) Heroic
(13164,11,0,0,'achievement_neck_deep_in_vile'), -- Neck-Deep in Vile (25 player)
(13164,12,1,0,''), -- Neck-Deep in Vile (25 player)
(13243,11,0,0,'achievement_neck_deep_in_vile'), -- Neck-Deep in Vile (25 player) Heroic
(13243,12,3,0,''), -- Neck-Deep in Vile (25 player) Heroic
(12764,12,0,0,''), -- The Frozen Throne (10 player)
(12909,12,1,0,''), -- The Frozen Throne (25 player)
(12826,12,3,0,''), -- The Light of Dawn
(13103,12,0,0,''), -- Victories over the Lich King (Icecrown 10 player)
(13136,12,1,0,''), -- Victories over the Lich King (Icecrown 25 player)
(13137,12,2,0,''), -- Victories over the Lich King (Heroic Icecrown 10 player)
(13138,12,3,0,''), -- Victories over the Lich King (Heroic Icecrown 25 player)
(12818,12,3,0,''); -- Realm First! Fall of the Lich King
@@ -0,0 +1,10 @@
UPDATE `creature_template` SET `ScriptName`='boss_the_lich_king' WHERE `entry`=36597;
UPDATE `creature_template` SET `ScriptName`='npc_tirion_fordring_tft' WHERE `entry`=38995;
UPDATE `creature_template` SET `ScriptName`='npc_shambling_horror_icc' WHERE `entry`=37698;
UPDATE `creature_template` SET `ScriptName`='npc_raging_spirit' WHERE `entry`=36701;
UPDATE `creature_template` SET `ScriptName`='npc_valkyr_shadowguard' WHERE `entry`=36609;
UPDATE `creature_template` SET `ScriptName`='npc_strangulate_vehicle' WHERE `entry`=36598;
UPDATE `creature_template` SET `ScriptName`='npc_terenas_menethil' WHERE `entry` IN (36823,38579,39217); -- not difficulty_entries
UPDATE `creature_template` SET `ScriptName`='npc_spirit_warden' WHERE `entry`=36824;
UPDATE `creature_template` SET `ScriptName`='npc_spirit_bomb' WHERE `entry`=39189;
UPDATE `creature_template` SET `ScriptName`='npc_broken_frostmourne' WHERE `entry`=38584;
@@ -0,0 +1,90 @@
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_the_lich_king_infest';
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_the_lich_king_necrotic_plague';
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_the_lich_king_necrotic_plague_jump';
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_the_lich_king_shadow_trap_visual';
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_the_lich_king_shadow_trap_periodic';
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_the_lich_king_quake';
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_the_lich_king_ice_burst_target_search';
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_the_lich_king_raging_spirit';
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_the_lich_king_defile';
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_the_lich_king_summon_into_air';
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_the_lich_king_soul_reaper';
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_the_lich_king_valkyr_target_search';
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_the_lich_king_eject_all_passengers';
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_the_lich_king_cast_back_to_caster';
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_the_lich_king_life_siphon';
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_the_lich_king_vile_spirits';
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_the_lich_king_vile_spirits_visual';
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_the_lich_king_vile_spirit_move_target_search';
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_the_lich_king_vile_spirit_damage_target_search';
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_the_lich_king_harvest_soul';
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_the_lich_king_lights_favor';
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_the_lich_king_soul_rip';
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_the_lich_king_restore_soul';
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_the_lich_king_in_frostmourne_room';
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_the_lich_king_summon_spirit_bomb';
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_the_lich_king_trigger_vile_spirit';
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_the_lich_king_jump';
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_the_lich_king_jump_remove_aura';
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_the_lich_king_mass_resurrection';
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_the_lich_king_play_movie';
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
(70541,'spell_the_lich_king_infest'),
(73779,'spell_the_lich_king_infest'),
(73780,'spell_the_lich_king_infest'),
(73781,'spell_the_lich_king_infest'),
(70337,'spell_the_lich_king_necrotic_plague'),
(73912,'spell_the_lich_king_necrotic_plague'),
(73913,'spell_the_lich_king_necrotic_plague'),
(73914,'spell_the_lich_king_necrotic_plague'),
(70338,'spell_the_lich_king_necrotic_plague_jump'),
(73785,'spell_the_lich_king_necrotic_plague_jump'),
(73786,'spell_the_lich_king_necrotic_plague_jump'),
(73787,'spell_the_lich_king_necrotic_plague_jump'),
(73530,'spell_the_lich_king_shadow_trap_visual'),
(74282,'spell_the_lich_king_shadow_trap_periodic'),
(72262,'spell_the_lich_king_quake'),
(69110,'spell_the_lich_king_ice_burst_target_search'),
(69200,'spell_the_lich_king_raging_spirit'),
(72754,'spell_the_lich_king_defile'),
(73708,'spell_the_lich_king_defile'),
(73709,'spell_the_lich_king_defile'),
(73710,'spell_the_lich_king_defile'),
(69037,'spell_the_lich_king_summon_into_air'),
(70497,'spell_the_lich_king_summon_into_air'),
(73579,'spell_the_lich_king_summon_into_air'),
(74300,'spell_the_lich_king_summon_into_air'),
(69409,'spell_the_lich_king_soul_reaper'),
(73797,'spell_the_lich_king_soul_reaper'),
(73798,'spell_the_lich_king_soul_reaper'),
(73799,'spell_the_lich_king_soul_reaper'),
(69030,'spell_the_lich_king_valkyr_target_search'),
(68576,'spell_the_lich_king_eject_all_passengers'),
(74445,'spell_the_lich_king_cast_back_to_caster'),
(68984,'spell_the_lich_king_cast_back_to_caster'),
(73488,'spell_the_lich_king_life_siphon'),
(73782,'spell_the_lich_king_life_siphon'),
(73783,'spell_the_lich_king_life_siphon'),
(73784,'spell_the_lich_king_life_siphon'),
(70498,'spell_the_lich_king_vile_spirits'),
(70499,'spell_the_lich_king_vile_spirits_visual'),
(70501,'spell_the_lich_king_vile_spirit_move_target_search'),
(70534,'spell_the_lich_king_vile_spirit_damage_target_search'),
(68980,'spell_the_lich_king_harvest_soul'),
(74325,'spell_the_lich_king_harvest_soul'),
(74296,'spell_the_lich_king_harvest_soul'),
(74297,'spell_the_lich_king_harvest_soul'),
(69382,'spell_the_lich_king_lights_favor'),
(69397,'spell_the_lich_king_soul_rip'),
(72595,'spell_the_lich_king_restore_soul'),
(73650,'spell_the_lich_king_restore_soul'),
(74276,'spell_the_lich_king_in_frostmourne_room'),
(74302,'spell_the_lich_king_summon_spirit_bomb'),
(74341,'spell_the_lich_king_summon_spirit_bomb'),
(74342,'spell_the_lich_king_summon_spirit_bomb'),
(74343,'spell_the_lich_king_summon_spirit_bomb'),
(73582,'spell_the_lich_king_trigger_vile_spirit'),
(71811,'spell_the_lich_king_jump'),
(72431,'spell_the_lich_king_jump_remove_aura'),
(72429,'spell_the_lich_king_mass_resurrection'),
(73159,'spell_the_lich_king_play_movie');
@@ -0,0 +1,42 @@
/*
Approximate damage of NPCs before armor reduction
75k-90k - The Lich King
25k-30k - Shambling Horror
3.5-5k - Drudge Ghoul
30k-40k - Raging Spirit
10k-12k - Spirit Warden
10k-12k - Terenas Menethil
Multipliers
1.2 = 10H/25N
1.5 = 25H
*/
UPDATE `creature_template` SET `mindmg`=509,`maxdmg`=683,`attackpower`=805,`dmg_multiplier`=150 WHERE `entry`=36597; -- The Lich King 10N
UPDATE `creature_template` SET `mindmg`=509,`maxdmg`=683,`attackpower`=805,`dmg_multiplier`=180 WHERE `entry`=39167; -- The Lich King 25N
UPDATE `creature_template` SET `mindmg`=509,`maxdmg`=683,`attackpower`=805,`dmg_multiplier`=180 WHERE `entry`=39168; -- The Lich King 10H
UPDATE `creature_template` SET `mindmg`=509,`maxdmg`=683,`attackpower`=805,`dmg_multiplier`=225 WHERE `entry`=39169; -- The Lich King 25H
UPDATE `creature_template` SET `mindmg`=509,`maxdmg`=683,`attackpower`=805,`dmg_multiplier`=50 WHERE `entry`=37698; -- Shambling Horror 10N
UPDATE `creature_template` SET `mindmg`=509,`maxdmg`=683,`attackpower`=805,`dmg_multiplier`=60 WHERE `entry`=39299; -- Shambling Horror 25N
UPDATE `creature_template` SET `mindmg`=509,`maxdmg`=683,`attackpower`=805,`dmg_multiplier`=60 WHERE `entry`=39300; -- Shambling Horror 10H
UPDATE `creature_template` SET `mindmg`=509,`maxdmg`=683,`attackpower`=805,`dmg_multiplier`=75 WHERE `entry`=39301; -- Shambling Horror 25H
UPDATE `creature_template` SET `mindmg`=509,`maxdmg`=683,`attackpower`=805,`dmg_multiplier`=7 WHERE `entry`=37695; -- Drudge Ghoul 10N
UPDATE `creature_template` SET `mindmg`=509,`maxdmg`=683,`attackpower`=805,`dmg_multiplier`=8.4 WHERE `entry`=39309; -- Drudge Ghoul 25N
UPDATE `creature_template` SET `mindmg`=509,`maxdmg`=683,`attackpower`=805,`dmg_multiplier`=8.4 WHERE `entry`=39310; -- Drudge Ghoul 10H
UPDATE `creature_template` SET `mindmg`=509,`maxdmg`=683,`attackpower`=805,`dmg_multiplier`=10.5 WHERE `entry`=39311; -- Drudge Ghoul 25H
UPDATE `creature_template` SET `difficulty_entry_1`=39302,`difficulty_entry_2`=39303,`difficulty_entry_3`=39304 WHERE `entry`=36701; -- Raging Spirit
UPDATE `creature_template` SET `speed_walk`=2,`speed_run`=1.42857,`exp`=2,`minlevel`=83,`maxlevel`=83,`faction_A`=14,`faction_H`=14,`dynamicflags`=0 WHERE `entry` IN (39302,39303,39304); -- Raging Spirit
UPDATE `creature_template` SET `mindmg`=509,`maxdmg`=683,`attackpower`=805,`dmg_multiplier`=60 WHERE `entry`=36701; -- Raging Spirit 10N
UPDATE `creature_template` SET `mindmg`=509,`maxdmg`=683,`attackpower`=805,`dmg_multiplier`=72 WHERE `entry`=39302; -- Raging Spirit 25N
UPDATE `creature_template` SET `mindmg`=509,`maxdmg`=683,`attackpower`=805,`dmg_multiplier`=72 WHERE `entry`=39303; -- Raging Spirit 10H
UPDATE `creature_template` SET `mindmg`=509,`maxdmg`=683,`attackpower`=805,`dmg_multiplier`=90 WHERE `entry`=39304; -- Raging Spirit 25H
UPDATE `creature_template` SET `difficulty_entry_1`=39296 WHERE `entry`=36824; -- Spirit Warden
UPDATE `creature_template` SET `minlevel`=83,`maxlevel`=83,`exp`=2,`faction_A`=14,`faction_H`=14,`flags_extra`=256 WHERE `entry`=39296; -- Spirit Warden (1)
UPDATE `creature_template` SET `mindmg`=509,`maxdmg`=683,`attackpower`=805,`dmg_multiplier`=20 WHERE `entry`=36824; -- Spirit Warden 10N
UPDATE `creature_template` SET `mindmg`=509,`maxdmg`=683,`attackpower`=805,`dmg_multiplier`=20 WHERE `entry`=39296; -- Spirit Warden 25N
UPDATE `creature_template` SET `mindmg`=509,`maxdmg`=683,`attackpower`=805,`dmg_multiplier`=20 WHERE `entry`=36823; -- Terenas Menethil
@@ -0,0 +1,196 @@
-- Pathing for Conquest Hold Berserker Entry: 27500
SET @NPC := 105857;
SET @PATH := @NPC * 10;
UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=2721.081,`position_y`=-1832.136,`position_z`=4.838899 WHERE `guid`=@NPC;
DELETE FROM `creature_addon` WHERE `guid`=@NPC;
INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,257,0, '');
DELETE FROM `waypoint_data` WHERE `id`=@PATH;
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
(@PATH,1,2710.015,-1832.177,4.838899,0,0,0,100,0),
(@PATH,2,2700.421,-1833.964,4.838899,0,0,0,100,0),
(@PATH,3,2693.419,-1835.334,4.867931,0,0,0,100,0),
(@PATH,4,2700.177,-1834.009,4.838899,0,0,0,100,0),
(@PATH,5,2710.015,-1832.177,4.838899,0,0,0,100,0),
(@PATH,6,2721.081,-1832.136,4.838899,0,0,0,100,0),
(@PATH,7,2732.511,-1831.47,4.838899,0,0,0,100,0),
(@PATH,8,2737.419,-1830.768,4.838899,0,0,0,100,0),
(@PATH,9,2732.511,-1831.47,4.838899,0,0,0,100,0),
(@PATH,10,2721.081,-1832.136,4.838899,0,0,0,100,0);
-- Pathing for Conquest Hold Berserker Entry: 27500
SET @NPC := 105821;
SET @PATH := @NPC * 10;
UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=2738.191,`position_y`=-1784.905,`position_z`=5.87062 WHERE `guid`=@NPC;
DELETE FROM `creature_addon` WHERE `guid`=@NPC;
INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,257,0, '');
DELETE FROM `waypoint_data` WHERE `id`=@PATH;
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
(@PATH,1,2734.5,-1775.514,6.962903,0,0,0,100,0),
(@PATH,2,2738.191,-1784.905,5.87062,0,0,0,100,0),
(@PATH,3,2741.883,-1793.762,5.804742,0,0,0,100,0),
(@PATH,4,2746.422,-1807.012,5.22166,0,0,0,100,0),
(@PATH,5,2748.496,-1816.049,5.223536,0,0,0,100,0),
(@PATH,6,2750.136,-1823.419,5.425339,0,0,0,100,0),
(@PATH,7,2748.496,-1816.049,5.223536,0,0,0,100,0),
(@PATH,8,2746.422,-1807.012,5.22166,0,0,0,100,0),
(@PATH,9,2741.883,-1793.762,5.804742,0,0,0,100,0),
(@PATH,10,2738.191,-1784.905,5.87062,0,0,0,100,0);
-- Pathing for Conquest Hold Berserker Entry: 27500
SET @NPC := 105859;
SET @PATH := @NPC * 10;
UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=2753.638,`position_y`=-1895.846,`position_z`=5.03679 WHERE `guid`=@NPC;
DELETE FROM `creature_addon` WHERE `guid`=@NPC;
INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,257,0, '');
DELETE FROM `waypoint_data` WHERE `id`=@PATH;
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
(@PATH,1,2754.177,-1888.177,5.087607,0,0,0,100,0),
(@PATH,2,2754.56,-1879.827,5.126619,0,0,0,100,0),
(@PATH,3,2754.854,-1867.842,5.131936,0,0,0,100,0),
(@PATH,4,2754.627,-1856.456,5.450566,0,0,0,100,0),
(@PATH,5,2753.946,-1848.716,5.450566,0,0,0,100,0),
(@PATH,6,2751.545,-1837.476,5.39562,0,0,0,100,0),
(@PATH,7,2753.931,-1848.54,5.450566,0,0,0,100,0),
(@PATH,8,2754.627,-1856.456,5.450566,0,0,0,100,0),
(@PATH,9,2754.854,-1867.842,5.131936,0,0,0,100,0),
(@PATH,10,2754.56,-1879.827,5.126619,0,0,0,100,0),
(@PATH,11,2754.177,-1888.177,5.087607,0,0,0,100,0),
(@PATH,12,2753.638,-1895.846,5.03679,0,0,0,100,0);
-- Pathing for Conquest Hold Berserker Entry: 27500
SET @NPC := 105810;
SET @PATH := @NPC * 10;
UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=2805.754,`position_y`=-1824.487,`position_z`=10.76279 WHERE `guid`=@NPC;
DELETE FROM `creature_addon` WHERE `guid`=@NPC;
INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,257,0, '');
DELETE FROM `waypoint_data` WHERE `id`=@PATH;
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
(@PATH,1,2811.704,-1833.185,11.26279,0,0,0,100,0),
(@PATH,2,2825.015,-1839.888,11.25652,0,0,0,100,0),
(@PATH,3,2811.704,-1833.185,11.26279,0,0,0,100,0),
(@PATH,4,2805.754,-1824.487,10.76279,0,0,0,100,0),
(@PATH,5,2806.472,-1815.43,10.76279,0,0,0,100,0),
(@PATH,6,2806.509,-1806.167,10.63779,0,0,0,100,0),
(@PATH,7,2806.472,-1815.43,10.76279,0,0,0,100,0),
(@PATH,8,2805.754,-1824.487,10.76279,0,0,0,100,0);
-- Pathing for Conquest Hold Berserker Entry: 27500
SET @NPC := 105750;
SET @PATH := @NPC * 10;
UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=2691.886,`position_y`=-1764.669,`position_z`=9.601107 WHERE `guid`=@NPC;
DELETE FROM `creature_addon` WHERE `guid`=@NPC;
INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,257,0, '');
DELETE FROM `waypoint_data` WHERE `id`=@PATH;
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
(@PATH,1,2681.84,-1768.02,9.601107,0,0,0,100,0),
(@PATH,2,2691.886,-1764.669,9.601107,0,0,0,100,0),
(@PATH,3,2705.537,-1760.065,9.601107,0,0,0,100,0),
(@PATH,4,2714.329,-1758.981,9.601107,0,0,0,100,0),
(@PATH,5,2705.537,-1760.065,9.601107,0,0,0,100,0),
(@PATH,6,2691.886,-1764.669,9.601107,0,0,0,100,0);
-- Pathing for Conquest Hold Berserker Entry: 27500
SET @NPC := 105854;
SET @PATH := @NPC * 10;
UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=2683.998,`position_y`=-1873.36,`position_z`=14.20639 WHERE `guid`=@NPC;
DELETE FROM `creature_addon` WHERE `guid`=@NPC;
INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,257,0, '');
DELETE FROM `waypoint_data` WHERE `id`=@PATH;
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
(@PATH,1,2681.924,-1863.327,14.19665,0,0,0,100,0),
(@PATH,2,2691.357,-1860.246,13.94065,0,0,0,100,0),
(@PATH,3,2705.164,-1860.508,13.85815,0,0,0,100,0),
(@PATH,4,2706.999,-1867.629,13.94356,0,0,0,100,0),
(@PATH,5,2702.301,-1873.661,13.86975,0,0,0,100,0),
(@PATH,6,2690.931,-1875.133,13.94601,0,0,0,100,0),
(@PATH,7,2683.998,-1873.36,14.20639,0,0,0,100,0);
-- Pathing for Westfall Brigade Marine Entry: 27501
SET @NPC := 105933;
SET @PATH := @NPC * 10;
UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=2670.551,`position_y`=-2010.984,`position_z`=18.17214 WHERE `guid`=@NPC;
DELETE FROM `creature_addon` WHERE `guid`=@NPC;
INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,257,0, '');
DELETE FROM `waypoint_data` WHERE `id`=@PATH;
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
(@PATH,1,2673.404,-2006.613,18.2068,0,0,0,100,0),
(@PATH,2,2670.639,-2010.848,18.17313,0,0,0,100,0),
(@PATH,3,2667.047,-2016.413,18.20223,0,0,0,100,0),
(@PATH,4,2670.551,-2010.984,18.17214,0,0,0,100,0);
-- Pathing for Westfall Brigade Marine Entry: 27501
SET @NPC := 105932;
SET @PATH := @NPC * 10;
UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=2633.481,`position_y`=-1987.501,`position_z`=8.764043 WHERE `guid`=@NPC;
DELETE FROM `creature_addon` WHERE `guid`=@NPC;
INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,257,0, '');
DELETE FROM `waypoint_data` WHERE `id`=@PATH;
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
(@PATH,1,2632.814,-1993.635,8.538836,0,0,0,100,0),
(@PATH,2,2638.163,-1998.093,8.282835,0,0,0,100,0),
(@PATH,3,2643.552,-2000.655,8.280496,0,0,0,100,0),
(@PATH,4,2646.837,-1997.753,8.30875,0,0,0,100,0),
(@PATH,5,2649.113,-1994.113,8.310638,0,0,0,100,0),
(@PATH,6,2649.836,-1989.002,8.284628,0,0,0,100,0),
(@PATH,7,2645.433,-1984.703,8.336969,0,0,0,100,0),
(@PATH,8,2638.931,-1981.989,8.592985,0,0,0,100,0),
(@PATH,9,2633.481,-1987.501,8.764043,0,0,0,100,0);
-- Missing spawn for Purkom "Venture Coin Vendor" Horde
DELETE FROM `creature` WHERE `id`=27730;
DELETE FROM `creature` WHERE `guid`=107018 AND `id`=27511;
INSERT INTO creature (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES
(107018,27730,571,1,1,0,0,2492.467,-1839.655,11.72851,5.532694,120,0,0,1,0,0);
-- Rogue Voidwalkers Shouldn't have weapons
UPDATE `creature_template` SET `equipment_id`=0 WHERE `entry`=16974;
-- Add Missing Spawn
DELETE FROM `creature` WHERE `guid` IN (13425,13426,13427,13428,14241);
INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES
-- Bubb Lazarr
(13425,27628,571,1,1,0,0,2404.771,-1823.437,1.99793,5.078908,300,0,0,1,0,0),
-- Rocket Propelled Warhead
(13426,27593,571,1,1,0,0,2394.92358,-1832.18921,-1.69907868,2.687807,300,0,0,1,0,0),
(13427,27593,571,1,1,0,0,2396.13013,-1829.49475,-1.6780616,2.75762,300,0,0,1,0,0),
(13428,27593,571,1,1,0,0,2397.40283,-1826.75,-1.65229559,2.72271371,300,0,0,1,0,0),
(14241,27593,571,1,1,0,0,2398.62329,-1824.14063,-1.66098964,2.740167,300,0,0,1,0,0);
-- Template updates Rocket Propelled Warhead
UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216,`InhabitType`=4,`unit_flags`=`unit_flags`|16384,`speed_walk`=12,`speed_run`=4.28571 WHERE `entry`=27593;
UPDATE `creature_model_info` SET `bounding_radius`=0.534723,`combat_reach`=3.5,`gender`=2 WHERE `modelid`=26611; -- Rocket Propelled Warhead
DELETE FROM `creature_template_addon` WHERE `entry`=27593;
INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
(27593,0,0,1,0, NULL); -- Rocket Propelled Warhead
DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=27593;
INSERT INTO `npc_spellclick_spells` (`npc_entry`, `spell_id`, `quest_start`, `quest_start_active`, `quest_end`, `cast_flags`, `aura_required`, `aura_forbidden`, `user_type`) VALUES
(27593, 49177, 0, 0, 0, 1, 0, 0, 0); -- Ride Rocket Propelled Warhead
-- Fix requirements for Element 115 from Nayd
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=4 AND `SourceEntry`=37664;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(4, 24095, 37664, 0, 9, 12433, 0, 0, 0, '', 'Element 115 - Seeking Solvent'),
(4, 24095, 37664, 1, 9, 12434, 0, 0, 0, '', 'Element 115 - Always Seeking Solvent'),
(4, 24095, 37664, 2, 9, 12443, 0, 0, 0, '', 'Element 115 - Seeking Solvent'),
(4, 24095, 37664, 3, 9, 12446, 0, 0, 0, '', 'Element 115 - Always Seeking Solvent'),
(4, 24095, 37664, 4, 9, 12437, 0, 0, 0, '', 'Element 115 - Riding the Red Rocket A'),
(4, 24095, 37664, 5, 9, 12432, 0, 0, 0, '', 'Element 115 - Riding the Red Rocket H');
UPDATE `gameobject_loot_template` SET `ChanceOrQuestChance`=100 WHERE `entry`=24095 AND `item`=37664;
-- Add some missing Azure Scalebane Spawns to crystalsong Forest
DELETE FROM `creature` WHERE `guid` IN (6499,6627,7630,10504,12599,12954,13423,13424);
INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`unit_flags`,`dynamicflags`) VALUES
(6499,31402,571,1,1,0,0,5220.886,591.7798,187.861328,4.866286,180,10,0,1,0,1,0,0),
(6627,31402,571,1,1,0,0,5344.32,595.7,183.07399,4.99164152,180,10,0,1,0,1,0,0),
(7630,31402,571,1,1,0,0,5411.67773,623.1622,178.355133,0.87266463,180,10,0,1,0,1,0,0),
(10504,31402,571,1,1,0,0,5434.40332,783.9654,182.770508,0.5726554,180,10,0,1,0,1,0,0),
(12599,31402,571,1,1,0,0,5464.40771,716.290344,171.820313,2.65290046,180,10,0,1,0,1,0,0),
(12954,31402,571,1,1,0,0,5573.34326,862.8543,161.738586,1.48352981,180,10,0,1,0,1,0,0),
(13423,31402,571,1,1,0,0,5659.52734,987.839844,174.5677,0.314159274,180,0,0,1,0,0,570688256,32),
(13424,31402,571,1,1,0,0,5660.18652,1028.454,174.562653,2.79252672,180,0,0,1,0,0,570688256,32);
-- Addons for dead appearance
DELETE FROM `creature_addon` WHERE `guid` IN (13423,13424);
INSERT INTO `creature_addon` (`guid`,`bytes2`,`auras`) VALUES
(13423,1,29266),
(13424,1,29266);
UPDATE `creature_model_info` SET `bounding_radius`=0.465,`combat_reach`=1.5,`gender`=0 WHERE `modelid`=25195; -- Azure Scalebane
DELETE FROM `creature_template_addon` WHERE `entry`=31402;
INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
(31402,0,0,1,0, NULL); -- Azure Scalebane
@@ -0,0 +1,2 @@
DELETE FROM `spell_script_names` WHERE `spell_id`=40121;
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES (40121,'spell_dru_swift_flight_passive');
@@ -62,17 +62,6 @@ namespace VMAP
return pos;
}
Vector3 VMapManager2::convertPositionToMangosRep(float x, float y, float z) const
{
Vector3 pos;
const float mid = 0.5f * 64.0f * 533.33333333f;
pos.x = mid - x;
pos.y = mid - y;
pos.z = z;
return pos;
}
// move to MapTree too?
std::string VMapManager2::getMapFileName(unsigned int mapId)
{
@@ -175,7 +164,7 @@ namespace VMAP
Vector3 pos2 = convertPositionToInternalRep(x2, y2, z2);
Vector3 resultPos;
bool result = instanceTree->second->getObjectHitPos(pos1, pos2, resultPos, modifyDist);
resultPos = convertPositionToMangosRep(resultPos.x, resultPos.y, resultPos.z);
resultPos = convertPositionToInternalRep(resultPos.x, resultPos.y, resultPos.z);
rx = resultPos.x;
ry = resultPos.y;
rz = resultPos.z;
@@ -222,7 +211,7 @@ namespace VMAP
{
Vector3 pos = convertPositionToInternalRep(x, y, z);
bool result = instanceTree->second->getAreaInfo(pos, flags, adtId, rootId, groupId);
// z is not touched by convertPositionToMangosRep(), so just copy
// z is not touched by convertPositionToInternalRep(), so just copy
z = pos.z;
return result;
}
@@ -78,7 +78,6 @@ namespace VMAP
public:
// public for debug
G3D::Vector3 convertPositionToInternalRep(float x, float y, float z) const;
G3D::Vector3 convertPositionToMangosRep(float x, float y, float z) const;
static std::string getMapFileName(unsigned int mapId);
VMapManager2();
+1 -2
View File
@@ -505,9 +505,8 @@ namespace VMAP
if (!wf)
return false;
bool result = true;
uint32 chunkSize, count;
result = fwrite(VMAP_MAGIC, 1, 8, wf) == 8;
bool result = fwrite(VMAP_MAGIC, 1, 8, wf) == 8;
if (result && fwrite("WMOD", 1, 4, wf) != 4) result = false;
chunkSize = sizeof(uint32) + sizeof(uint32);
if (result && fwrite(&chunkSize, sizeof(uint32), 1, wf) != 1) result = false;
+1 -1
View File
@@ -56,7 +56,7 @@ struct DefaultTargetSelector : public std::unary_function<Unit* , bool>
bool m_playerOnly;
int32 m_aura;
// pUnit: the reference unit
// unit: the reference unit
// dist: if 0: ignored, if > 0: maximum distance to the reference unit, if < 0: minimum distance to the reference unit
// playerOnly: self explaining
// aura: if 0: ignored, if > 0: the target shall have the aura, if < 0, the target shall NOT have the aura
+1 -1
View File
@@ -100,7 +100,7 @@ void CreatureAI::DoZoneInCombat(Creature* creature /*= NULL*/, float maxRangeToN
}
/* Causes certain things to never leave the threat list (Priest Lightwell, etc):
for (Unit::ControlList::const_iterator itr = pPlayer->m_Controlled.begin(); itr != pPlayer->m_Controlled.end(); ++itr)
for (Unit::ControlList::const_iterator itr = player->m_Controlled.begin(); itr != player->m_Controlled.end(); ++itr)
{
creature->SetInCombatWith(*itr);
(*itr)->SetInCombatWith(creature);
+2 -2
View File
@@ -329,7 +329,7 @@ class EventMap : private std::map<uint32, uint32>
// Sets event phase, must be in range 1 - 8
void SetPhase(uint32 phase)
{
if (phase && phase < 9)
if (phase && phase < 8)
_phase = (1 << (phase + 24));
}
@@ -340,7 +340,7 @@ class EventMap : private std::map<uint32, uint32>
time += _time;
if (groupId && groupId < 9)
eventId |= (1 << (groupId + 16));
if (phase && phase < 9)
if (phase && phase < 8)
eventId |= (1 << (phase + 24));
const_iterator itr = find(time);
while (itr != end())
@@ -52,8 +52,7 @@ void SummonList::DespawnEntry(uint32 entry)
else if (summon->GetEntry() == entry)
{
erase(i++);
summon->setDeathState(JUST_DIED);
summon->RemoveCorpse();
summon->DespawnOrUnsummon();
}
else
++i;
@@ -70,13 +69,7 @@ void SummonList::DespawnAll()
else
{
erase(begin());
if (TempSummon* summ = summon->ToTempSummon())
{
summon->DestroyForNearbyPlayers();
summ->UnSummon();
}
else
summon->DisappearAndDie();
summon->DespawnOrUnsummon();
}
}
}
+7 -4
View File
@@ -462,14 +462,20 @@ void SmartAI::EnterEvadeMode()
void SmartAI::MoveInLineOfSight(Unit* who)
{
if (!who) return;
if (!who)
return;
GetScript()->OnMoveInLineOfSight(who);
if (me->HasReactState(REACT_PASSIVE) || AssistPlayerInCombat(who))
return;
if (!CanAIAttack(who))
return;
if (!me->canStartAttack(who, false))
return;
if (me->IsHostileTo(who))
{
float fAttackRadius = me->GetAttackDistance(who);
@@ -487,9 +493,6 @@ void SmartAI::MoveInLineOfSight(Unit* who)
}
}
}
//if (me->canStartAttack(who, false))
// AttackStart(who);
}
bool SmartAI::CanAIAttack(const Unit* /*who*/) const
@@ -1323,7 +1323,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (IsCreature(*itr))
(*itr)->ToCreature()->Respawn();
else if (IsGameObject(*itr))
(*itr)->ToGameObject()->Respawn();
(*itr)->ToGameObject()->SetRespawnTime(e.action.RespawnTarget.GoRespawnTime);
}
delete targets;
@@ -857,6 +857,11 @@ struct SmartAction
uint32 withEmote;
} flee;
struct
{
uint32 GoRespawnTime;
} RespawnTarget;
struct
{
uint32 param1;
@@ -506,11 +506,9 @@ void AchievementMgr::SaveToDB(SQLTransaction& trans)
iter->second.changed = false;
}
if (need_execute)
ssdel << ')';
if (need_execute)
{
ssdel << ')';
trans->Append(ssdel.str().c_str());
trans->Append(ssins.str().c_str());
}
+20 -20
View File
@@ -1527,36 +1527,36 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, uint32 teamval, f
if (!map)
return NULL;
Creature* pCreature = new Creature;
if (!pCreature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, PHASEMASK_NORMAL, entry, 0, teamval, x, y, z, o))
Creature* creature = new Creature;
if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, PHASEMASK_NORMAL, entry, 0, teamval, x, y, z, o))
{
sLog->outError("Battleground::AddCreature: cannot create creature (entry: %u) for BG (map: %u, instance id: %u)!",
entry, m_MapId, m_InstanceID);
delete pCreature;
delete creature;
return NULL;
}
pCreature->SetHomePosition(x, y, z, o);
creature->SetHomePosition(x, y, z, o);
CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(entry);
if (!cinfo)
{
sLog->outError("Battleground::AddCreature: creature template (entry: %u) does not exist for BG (map: %u, instance id: %u)!",
entry, m_MapId, m_InstanceID);
delete pCreature;
delete creature;
return NULL;
}
// Force using DB speeds
pCreature->SetSpeed(MOVE_WALK, cinfo->speed_walk);
pCreature->SetSpeed(MOVE_RUN, cinfo->speed_run);
creature->SetSpeed(MOVE_WALK, cinfo->speed_walk);
creature->SetSpeed(MOVE_RUN, cinfo->speed_run);
map->Add(pCreature);
m_BgCreatures[type] = pCreature->GetGUID();
map->Add(creature);
m_BgCreatures[type] = creature->GetGUID();
if (respawntime)
pCreature->SetRespawnDelay(respawntime);
creature->SetRespawnDelay(respawntime);
return pCreature;
return creature;
}
bool Battleground::DelCreature(uint32 type)
@@ -1601,18 +1601,18 @@ bool Battleground::AddSpiritGuide(uint32 type, float x, float y, float z, float
BG_CREATURE_ENTRY_A_SPIRITGUIDE :
BG_CREATURE_ENTRY_H_SPIRITGUIDE;
if (Creature* pCreature = AddCreature(entry, type, team, x, y, z, o))
if (Creature* creature = AddCreature(entry, type, team, x, y, z, o))
{
pCreature->setDeathState(DEAD);
pCreature->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, pCreature->GetGUID());
creature->setDeathState(DEAD);
creature->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, creature->GetGUID());
// aura
// TODO: Fix display here
// pCreature->SetVisibleAura(0, SPELL_SPIRIT_HEAL_CHANNEL);
// creature->SetVisibleAura(0, SPELL_SPIRIT_HEAL_CHANNEL);
// casting visual effect
pCreature->SetUInt32Value(UNIT_CHANNEL_SPELL, SPELL_SPIRIT_HEAL_CHANNEL);
creature->SetUInt32Value(UNIT_CHANNEL_SPELL, SPELL_SPIRIT_HEAL_CHANNEL);
// correct cast speed
pCreature->SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f);
//pCreature->CastSpell(pCreature, SPELL_SPIRIT_HEAL_CHANNEL, true);
creature->SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f);
//creature->CastSpell(creature, SPELL_SPIRIT_HEAL_CHANNEL, true);
return true;
}
sLog->outError("Battleground::AddSpiritGuide: cannot create spirit guide (type: %u, entry: %u) for BG (map: %u, instance id: %u)!",
@@ -1887,8 +1887,8 @@ bool Battleground::IsTeamScoreInRange(uint32 team, uint32 minScore, uint32 maxSc
void Battleground::StartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
{
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
if (Player* pPlayer = ObjectAccessor::FindPlayer(itr->first))
pPlayer->GetAchievementMgr().StartTimedAchievement(type, entry);
if (Player* player = ObjectAccessor::FindPlayer(itr->first))
player->GetAchievementMgr().StartTimedAchievement(type, entry);
}
void Battleground::SetBracket(PvPDifficultyEntry const* bracketEntry)
@@ -573,6 +573,8 @@ class Battleground
void RewardXPAtKill(Player* killer, Player* victim);
bool CanAwardArenaPoints() const { return m_LevelMin >= BG_AWARD_ARENA_POINTS_MIN_LEVEL; }
virtual uint64 GetFlagPickerGUID(int32 /*team*/ = -1) const { return 0; }
protected:
// this method is called, when BG cannot spawn its own spirit guide, or something is wrong, It correctly ends Battleground
void EndNow();
@@ -907,8 +907,7 @@ bool BattlegroundMgr::IsArenaType(BattlegroundTypeId bgTypeId)
bgTypeId == BATTLEGROUND_NA ||
bgTypeId == BATTLEGROUND_DS ||
bgTypeId == BATTLEGROUND_RV ||
bgTypeId == BATTLEGROUND_RL ||
bgTypeId == BATTLEGROUND_DS);
bgTypeId == BATTLEGROUND_RL);
}
BattlegroundQueueTypeId BattlegroundMgr::BGQueueTypeId(BattlegroundTypeId bgTypeId, uint8 arenaType)
@@ -341,7 +341,7 @@ class BattlegroundEY : public Battleground
virtual void StartingEventOpenDoors();
/* BG Flags */
uint64 GetFlagPickerGUID() const { return m_FlagKeeper; }
uint64 GetFlagPickerGUID(int32 /*team*/ = -1) const { return m_FlagKeeper; }
void SetFlagPicker(uint64 guid) { m_FlagKeeper = guid; }
bool IsFlagPickedup() const { return m_FlagKeeper != 0; }
uint8 GetFlagState() const { return m_FlagState; }
@@ -359,7 +359,7 @@ void BattlegroundWS::EventPlayerDroppedFlag(Player* Source)
{
if (!this->IsHordeFlagPickedup())
return;
if (GetHordeFlagPickerGUID() == Source->GetGUID())
if (GetFlagPickerGUID(BG_TEAM_HORDE) == Source->GetGUID())
{
SetHordeFlagPicker(0);
Source->RemoveAurasDueToSpell(BG_WS_SPELL_WARSONG_FLAG);
@@ -369,7 +369,7 @@ void BattlegroundWS::EventPlayerDroppedFlag(Player* Source)
{
if (!this->IsAllianceFlagPickedup())
return;
if (GetAllianceFlagPickerGUID() == Source->GetGUID())
if (GetFlagPickerGUID(BG_TEAM_ALLIANCE) == Source->GetGUID())
{
SetAllianceFlagPicker(0);
Source->RemoveAurasDueToSpell(BG_WS_SPELL_SILVERWING_FLAG);
@@ -384,7 +384,7 @@ void BattlegroundWS::EventPlayerDroppedFlag(Player* Source)
{
if (!IsHordeFlagPickedup())
return;
if (GetHordeFlagPickerGUID() == Source->GetGUID())
if (GetFlagPickerGUID(BG_TEAM_HORDE) == Source->GetGUID())
{
SetHordeFlagPicker(0);
Source->RemoveAurasDueToSpell(BG_WS_SPELL_WARSONG_FLAG);
@@ -401,7 +401,7 @@ void BattlegroundWS::EventPlayerDroppedFlag(Player* Source)
{
if (!IsAllianceFlagPickedup())
return;
if (GetAllianceFlagPickerGUID() == Source->GetGUID())
if (GetFlagPickerGUID(BG_TEAM_ALLIANCE) == Source->GetGUID())
{
SetAllianceFlagPicker(0);
Source->RemoveAurasDueToSpell(BG_WS_SPELL_SILVERWING_FLAG);
@@ -629,12 +629,12 @@ void BattlegroundWS::HandleAreaTrigger(Player* Source, uint32 Trigger)
break;
case 3646: // Alliance Flag spawn
if (m_FlagState[BG_TEAM_HORDE] && !m_FlagState[BG_TEAM_ALLIANCE])
if (GetHordeFlagPickerGUID() == Source->GetGUID())
if (GetFlagPickerGUID(BG_TEAM_HORDE) == Source->GetGUID())
EventPlayerCapturedFlag(Source);
break;
case 3647: // Horde Flag spawn
if (m_FlagState[BG_TEAM_ALLIANCE] && !m_FlagState[BG_TEAM_HORDE])
if (GetAllianceFlagPickerGUID() == Source->GetGUID())
if (GetFlagPickerGUID(BG_TEAM_ALLIANCE) == Source->GetGUID())
EventPlayerCapturedFlag(Source);
break;
case 3649: // unk1
@@ -168,8 +168,12 @@ class BattlegroundWS : public Battleground
virtual void StartingEventOpenDoors();
/* BG Flags */
uint64 GetAllianceFlagPickerGUID() const { return m_FlagKeepers[BG_TEAM_ALLIANCE]; }
uint64 GetHordeFlagPickerGUID() const { return m_FlagKeepers[BG_TEAM_HORDE]; }
uint64 GetFlagPickerGUID(int32 team) const
{
if (team == BG_TEAM_ALLIANCE || team == BG_TEAM_HORDE)
return m_FlagKeepers[team];
return 0;
}
void SetAllianceFlagPicker(uint64 guid) { m_FlagKeepers[BG_TEAM_ALLIANCE] = guid; }
void SetHordeFlagPicker(uint64 guid) { m_FlagKeepers[BG_TEAM_HORDE] = guid; }
bool IsAllianceFlagPickedup() const { return m_FlagKeepers[BG_TEAM_ALLIANCE] != 0; }
@@ -177,10 +181,6 @@ class BattlegroundWS : public Battleground
void RespawnFlag(uint32 Team, bool captured);
void RespawnFlagAfterDrop(uint32 Team);
uint8 GetFlagState(uint32 team) { return m_FlagState[GetTeamIndexByTeamId(team)]; }
void AddTimedAura(uint32 aura);
void RemoveTimedAura(uint32 aura);
bool IsBrutalTimerDone;
bool IsForceTimerDone;
/* Battleground Events */
virtual void EventPlayerDroppedFlag(Player* Source);
+10 -10
View File
@@ -4689,32 +4689,32 @@ bool ChatHandler::HandleGroupRemoveCommand(const char *args)
bool ChatHandler::HandlePossessCommand(const char * /*args*/)
{
Unit* pUnit = getSelectedUnit();
if (!pUnit)
Unit* unit = getSelectedUnit();
if (!unit)
return false;
m_session->GetPlayer()->CastSpell(pUnit, 530, true);
m_session->GetPlayer()->CastSpell(unit, 530, true);
return true;
}
bool ChatHandler::HandleUnPossessCommand(const char * /*args*/)
{
Unit* pUnit = getSelectedUnit();
if (!pUnit)
pUnit = m_session->GetPlayer();
Unit* unit = getSelectedUnit();
if (!unit)
unit = m_session->GetPlayer();
pUnit->RemoveCharmAuras();
unit->RemoveCharmAuras();
return true;
}
bool ChatHandler::HandleBindSightCommand(const char * /*args*/)
{
Unit* pUnit = getSelectedUnit();
if (!pUnit)
Unit* unit = getSelectedUnit();
if (!unit)
return false;
m_session->GetPlayer()->CastSpell(pUnit, 6277, true);
m_session->GetPlayer()->CastSpell(unit, 6277, true);
return true;
}
+4 -4
View File
@@ -1308,12 +1308,12 @@ void LFGMgr::UpdateProposal(uint32 proposalId, uint64 guid, bool accept)
// Save wait times before redoing groups
for (LfgPlayerList::const_iterator it = players.begin(); it != players.end(); ++it)
{
LfgProposalPlayer* pPlayer = pProposal->players[(*it)->GetGUID()];
LfgProposalPlayer* player = pProposal->players[(*it)->GetGUID()];
uint32 lowgroupguid = (*it)->GetGroup() ? (*it)->GetGroup()->GetLowGUID() : 0;
if (pPlayer->groupLowGuid != lowgroupguid)
sLog->outError("LFGMgr::UpdateProposal: [" UI64FMTD "] group mismatch: actual (%u) - queued (%u)", (*it)->GetGUID(), lowgroupguid, pPlayer->groupLowGuid);
if (player->groupLowGuid != lowgroupguid)
sLog->outError("LFGMgr::UpdateProposal: [" UI64FMTD "] group mismatch: actual (%u) - queued (%u)", (*it)->GetGUID(), lowgroupguid, player->groupLowGuid);
uint64 guid = pPlayer->groupLowGuid ? MAKE_NEW_GUID(pPlayer->groupLowGuid, 0, HIGHGUID_GROUP) : (*it)->GetGUID();
uint64 guid = player->groupLowGuid ? MAKE_NEW_GUID(player->groupLowGuid, 0, HIGHGUID_GROUP) : (*it)->GetGUID();
LfgQueueInfoMap::iterator itQueue = m_QueueInfoMap.find(guid);
if (itQueue == m_QueueInfoMap.end())
{
+55 -51
View File
@@ -657,14 +657,14 @@ void Creature::DoFleeToGetAssistance()
float radius = sWorld->getFloatConfig(CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS);
if (radius >0)
{
Creature* pCreature = NULL;
Creature* creature = NULL;
CellPair p(Trinity::ComputeCellPair(GetPositionX(), GetPositionY()));
Cell cell(p);
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
Trinity::NearestAssistCreatureInCreatureRangeCheck u_check(this, getVictim(), radius);
Trinity::CreatureLastSearcher<Trinity::NearestAssistCreatureInCreatureRangeCheck> searcher(this, pCreature, u_check);
Trinity::CreatureLastSearcher<Trinity::NearestAssistCreatureInCreatureRangeCheck> searcher(this, creature, u_check);
TypeContainerVisitor<Trinity::CreatureLastSearcher<Trinity::NearestAssistCreatureInCreatureRangeCheck>, GridTypeMapContainer > grid_creature_searcher(searcher);
@@ -673,12 +673,12 @@ void Creature::DoFleeToGetAssistance()
SetNoSearchAssistance(true);
UpdateSpeed(MOVE_RUN, false);
if (!pCreature)
if (!creature)
//SetFeared(true, getVictim()->GetGUID(), 0, sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_FLEE_DELAY));
//TODO: use 31365
SetControlled(true, UNIT_STAT_FLEEING);
else
GetMotionMaster()->MoveSeekAssistance(pCreature->GetPositionX(), pCreature->GetPositionY(), pCreature->GetPositionZ());
GetMotionMaster()->MoveSeekAssistance(creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ());
}
}
@@ -805,7 +805,7 @@ bool Creature::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry,
return true;
}
bool Creature::isCanTrainingOf(Player* pPlayer, bool msg) const
bool Creature::isCanTrainingOf(Player* player, bool msg) const
{
if (!isTrainer())
return false;
@@ -822,65 +822,65 @@ bool Creature::isCanTrainingOf(Player* pPlayer, bool msg) const
switch (GetCreatureInfo()->trainer_type)
{
case TRAINER_TYPE_CLASS:
if (pPlayer->getClass() != GetCreatureInfo()->trainer_class)
if (player->getClass() != GetCreatureInfo()->trainer_class)
{
if (msg)
{
pPlayer->PlayerTalkClass->ClearMenus();
player->PlayerTalkClass->ClearMenus();
switch (GetCreatureInfo()->trainer_class)
{
case CLASS_DRUID: pPlayer->PlayerTalkClass->SendGossipMenu(4913, GetGUID()); break;
case CLASS_HUNTER: pPlayer->PlayerTalkClass->SendGossipMenu(10090, GetGUID()); break;
case CLASS_MAGE: pPlayer->PlayerTalkClass->SendGossipMenu(328, GetGUID()); break;
case CLASS_PALADIN:pPlayer->PlayerTalkClass->SendGossipMenu(1635, GetGUID()); break;
case CLASS_PRIEST: pPlayer->PlayerTalkClass->SendGossipMenu(4436, GetGUID()); break;
case CLASS_ROGUE: pPlayer->PlayerTalkClass->SendGossipMenu(4797, GetGUID()); break;
case CLASS_SHAMAN: pPlayer->PlayerTalkClass->SendGossipMenu(5003, GetGUID()); break;
case CLASS_WARLOCK:pPlayer->PlayerTalkClass->SendGossipMenu(5836, GetGUID()); break;
case CLASS_WARRIOR:pPlayer->PlayerTalkClass->SendGossipMenu(4985, GetGUID()); break;
case CLASS_DRUID: player->PlayerTalkClass->SendGossipMenu(4913, GetGUID()); break;
case CLASS_HUNTER: player->PlayerTalkClass->SendGossipMenu(10090, GetGUID()); break;
case CLASS_MAGE: player->PlayerTalkClass->SendGossipMenu(328, GetGUID()); break;
case CLASS_PALADIN:player->PlayerTalkClass->SendGossipMenu(1635, GetGUID()); break;
case CLASS_PRIEST: player->PlayerTalkClass->SendGossipMenu(4436, GetGUID()); break;
case CLASS_ROGUE: player->PlayerTalkClass->SendGossipMenu(4797, GetGUID()); break;
case CLASS_SHAMAN: player->PlayerTalkClass->SendGossipMenu(5003, GetGUID()); break;
case CLASS_WARLOCK:player->PlayerTalkClass->SendGossipMenu(5836, GetGUID()); break;
case CLASS_WARRIOR:player->PlayerTalkClass->SendGossipMenu(4985, GetGUID()); break;
}
}
return false;
}
break;
case TRAINER_TYPE_PETS:
if (pPlayer->getClass() != CLASS_HUNTER)
if (player->getClass() != CLASS_HUNTER)
{
pPlayer->PlayerTalkClass->ClearMenus();
pPlayer->PlayerTalkClass->SendGossipMenu(3620, GetGUID());
player->PlayerTalkClass->ClearMenus();
player->PlayerTalkClass->SendGossipMenu(3620, GetGUID());
return false;
}
break;
case TRAINER_TYPE_MOUNTS:
if (GetCreatureInfo()->trainer_race && pPlayer->getRace() != GetCreatureInfo()->trainer_race)
if (GetCreatureInfo()->trainer_race && player->getRace() != GetCreatureInfo()->trainer_race)
{
if (msg)
{
pPlayer->PlayerTalkClass->ClearMenus();
player->PlayerTalkClass->ClearMenus();
switch (GetCreatureInfo()->trainer_class)
{
case RACE_DWARF: pPlayer->PlayerTalkClass->SendGossipMenu(5865, GetGUID()); break;
case RACE_GNOME: pPlayer->PlayerTalkClass->SendGossipMenu(4881, GetGUID()); break;
case RACE_HUMAN: pPlayer->PlayerTalkClass->SendGossipMenu(5861, GetGUID()); break;
case RACE_NIGHTELF: pPlayer->PlayerTalkClass->SendGossipMenu(5862, GetGUID()); break;
case RACE_ORC: pPlayer->PlayerTalkClass->SendGossipMenu(5863, GetGUID()); break;
case RACE_TAUREN: pPlayer->PlayerTalkClass->SendGossipMenu(5864, GetGUID()); break;
case RACE_TROLL: pPlayer->PlayerTalkClass->SendGossipMenu(5816, GetGUID()); break;
case RACE_UNDEAD_PLAYER:pPlayer->PlayerTalkClass->SendGossipMenu(624, GetGUID()); break;
case RACE_BLOODELF: pPlayer->PlayerTalkClass->SendGossipMenu(5862, GetGUID()); break;
case RACE_DRAENEI: pPlayer->PlayerTalkClass->SendGossipMenu(5864, GetGUID()); break;
case RACE_DWARF: player->PlayerTalkClass->SendGossipMenu(5865, GetGUID()); break;
case RACE_GNOME: player->PlayerTalkClass->SendGossipMenu(4881, GetGUID()); break;
case RACE_HUMAN: player->PlayerTalkClass->SendGossipMenu(5861, GetGUID()); break;
case RACE_NIGHTELF: player->PlayerTalkClass->SendGossipMenu(5862, GetGUID()); break;
case RACE_ORC: player->PlayerTalkClass->SendGossipMenu(5863, GetGUID()); break;
case RACE_TAUREN: player->PlayerTalkClass->SendGossipMenu(5864, GetGUID()); break;
case RACE_TROLL: player->PlayerTalkClass->SendGossipMenu(5816, GetGUID()); break;
case RACE_UNDEAD_PLAYER:player->PlayerTalkClass->SendGossipMenu(624, GetGUID()); break;
case RACE_BLOODELF: player->PlayerTalkClass->SendGossipMenu(5862, GetGUID()); break;
case RACE_DRAENEI: player->PlayerTalkClass->SendGossipMenu(5864, GetGUID()); break;
}
}
return false;
}
break;
case TRAINER_TYPE_TRADESKILLS:
if (GetCreatureInfo()->trainer_spell && !pPlayer->HasSpell(GetCreatureInfo()->trainer_spell))
if (GetCreatureInfo()->trainer_spell && !player->HasSpell(GetCreatureInfo()->trainer_spell))
{
if (msg)
{
pPlayer->PlayerTalkClass->ClearMenus();
pPlayer->PlayerTalkClass->SendGossipMenu(11031, GetGUID());
player->PlayerTalkClass->ClearMenus();
player->PlayerTalkClass->SendGossipMenu(11031, GetGUID());
}
return false;
}
@@ -891,23 +891,23 @@ bool Creature::isCanTrainingOf(Player* pPlayer, bool msg) const
return true;
}
bool Creature::isCanInteractWithBattleMaster(Player* pPlayer, bool msg) const
bool Creature::isCanInteractWithBattleMaster(Player* player, bool msg) const
{
if (!isBattleMaster())
return false;
BattlegroundTypeId bgTypeId = sBattlegroundMgr->GetBattleMasterBG(GetEntry());
if (!msg)
return pPlayer->GetBGAccessByLevel(bgTypeId);
return player->GetBGAccessByLevel(bgTypeId);
if (!pPlayer->GetBGAccessByLevel(bgTypeId))
if (!player->GetBGAccessByLevel(bgTypeId))
{
pPlayer->PlayerTalkClass->ClearMenus();
player->PlayerTalkClass->ClearMenus();
switch (bgTypeId)
{
case BATTLEGROUND_AV: pPlayer->PlayerTalkClass->SendGossipMenu(7616, GetGUID()); break;
case BATTLEGROUND_WS: pPlayer->PlayerTalkClass->SendGossipMenu(7599, GetGUID()); break;
case BATTLEGROUND_AB: pPlayer->PlayerTalkClass->SendGossipMenu(7642, GetGUID()); break;
case BATTLEGROUND_AV: player->PlayerTalkClass->SendGossipMenu(7616, GetGUID()); break;
case BATTLEGROUND_WS: player->PlayerTalkClass->SendGossipMenu(7599, GetGUID()); break;
case BATTLEGROUND_AB: player->PlayerTalkClass->SendGossipMenu(7642, GetGUID()); break;
case BATTLEGROUND_EY:
case BATTLEGROUND_NA:
case BATTLEGROUND_BE:
@@ -915,7 +915,7 @@ bool Creature::isCanInteractWithBattleMaster(Player* pPlayer, bool msg) const
case BATTLEGROUND_RL:
case BATTLEGROUND_SA:
case BATTLEGROUND_DS:
case BATTLEGROUND_RV: pPlayer->PlayerTalkClass->SendGossipMenu(10024, GetGUID()); break;
case BATTLEGROUND_RV: player->PlayerTalkClass->SendGossipMenu(10024, GetGUID()); break;
default: break;
}
return false;
@@ -923,11 +923,11 @@ bool Creature::isCanInteractWithBattleMaster(Player* pPlayer, bool msg) const
return true;
}
bool Creature::isCanTrainingAndResetTalentsOf(Player* pPlayer) const
bool Creature::isCanTrainingAndResetTalentsOf(Player* player) const
{
return pPlayer->getLevel() >= 10
return player->getLevel() >= 10
&& GetCreatureInfo()->trainer_type == TRAINER_TYPE_CLASS
&& pPlayer->getClass() == GetCreatureInfo()->trainer_class;
&& player->getClass() == GetCreatureInfo()->trainer_class;
}
void Creature::AI_SendMoveToPacket(float x, float y, float z, uint32 time, uint32 /*MovementFlags*/, uint8 /*type*/)
@@ -1412,6 +1412,10 @@ bool Creature::canStartAttack(Unit const* who, bool force) const
if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE))
return false;
// Do not attack non-combat pets
if (who->GetTypeId() == TYPEID_UNIT && who->GetCreatureType() == CREATURE_TYPE_NON_COMBAT_PET)
return false;
if (!canFly() && (GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE + m_CombatDistance))
//|| who->IsControlledByPlayer() && who->IsFlying()))
// we cannot check flying for other creatures, too much map/vmap calculation
@@ -2128,16 +2132,16 @@ void Creature::SetInCombatWithZone()
for (Map::PlayerList::const_iterator i = PlList.begin(); i != PlList.end(); ++i)
{
if (Player* pPlayer = i->getSource())
if (Player* player = i->getSource())
{
if (pPlayer->isGameMaster())
if (player->isGameMaster())
continue;
if (pPlayer->isAlive())
if (player->isAlive())
{
this->SetInCombatWith(pPlayer);
pPlayer->SetInCombatWith(this);
AddThreat(pPlayer, 0.0f);
this->SetInCombatWith(player);
player->SetInCombatWith(this);
AddThreat(player, 0.0f);
}
}
}
+1 -1
View File
@@ -456,7 +456,7 @@ class Creature : public Unit, public GridObject<Creature>
///// TODO RENAME THIS!!!!!
bool isCanTrainingOf(Player* player, bool msg) const;
bool isCanInteractWithBattleMaster(Player* player, bool msg) const;
bool isCanTrainingAndResetTalentsOf(Player* pPlayer) const;
bool isCanTrainingAndResetTalentsOf(Player* player) const;
bool canCreatureAttack(Unit const* pVictim, bool force = true) const;
bool IsImmunedToSpell(SpellInfo const* spellInfo);
// redefine Unit::IsImmunedToSpell
@@ -1211,15 +1211,13 @@ void GameObject::Use(Unit* user)
SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
SetLootState(GO_ACTIVATED);
uint32 time_to_restore = info->GetAutoCloseTime();
// this appear to be ok, however others exist in addition to this that should have custom (ex: 190510, 188692, 187389)
if (time_to_restore && info->goober.customAnim)
if (info->goober.customAnim)
SendCustomAnim(GetGoAnimProgress());
else
SetGoState(GO_STATE_ACTIVE);
m_cooldownTime = time(NULL) + time_to_restore;
m_cooldownTime = time(NULL) + info->GetAutoCloseTime();
// cast this spell later if provided
spellId = info->goober.spellId;
@@ -1540,11 +1538,8 @@ void GameObject::Use(Unit* user)
switch (info->entry)
{
case 179785: // Silverwing Flag
// check if it's correct bg
if (bg->IsRandom() ? bg->GetTypeID(true) : bg->GetTypeID(false) == BATTLEGROUND_WS)
bg->EventPlayerClickedOnFlag(player, this);
break;
case 179786: // Warsong Flag
// check if it's correct bg
if (bg->IsRandom() ? bg->GetTypeID(true) : bg->GetTypeID(false) == BATTLEGROUND_WS)
bg->EventPlayerClickedOnFlag(player, this);
break;
@@ -1660,7 +1655,7 @@ void GameObject::SendCustomAnim(uint32 anim)
bool GameObject::IsInRange(float x, float y, float z, float radius) const
{
GameObjectDisplayInfoEntry const* info = sGameObjectDisplayInfoStore.LookupEntry(GetUInt32Value(GAMEOBJECT_DISPLAYID));
GameObjectDisplayInfoEntry const* info = sGameObjectDisplayInfoStore.LookupEntry(m_goInfo->displayId);
if (!info)
return IsWithinDist3d(x, y, z, radius);
+2 -2
View File
@@ -778,14 +778,14 @@ bool Item::CanBeTraded(bool mail, bool trade) const
return true;
}
bool Item::HasEnchantRequiredSkill(const Player* pPlayer) const
bool Item::HasEnchantRequiredSkill(const Player* player) const
{
// Check all enchants for required skill
for (uint32 enchant_slot = PERM_ENCHANTMENT_SLOT; enchant_slot < MAX_ENCHANTMENT_SLOT; ++enchant_slot)
if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot)))
if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id))
if (enchantEntry->requiredSkill && pPlayer->GetSkillValue(enchantEntry->requiredSkill) < enchantEntry->requiredSkillValue)
if (enchantEntry->requiredSkill && player->GetSkillValue(enchantEntry->requiredSkill) < enchantEntry->requiredSkillValue)
return false;
return true;
+1 -1
View File
@@ -264,7 +264,7 @@ class Item : public Object
void SetInTrade(bool b = true) { mb_in_trade = b; }
bool IsInTrade() const { return mb_in_trade; }
bool HasEnchantRequiredSkill(const Player* pPlayer) const;
bool HasEnchantRequiredSkill(const Player* player) const;
uint32 GetEnchantRequiredLevel() const;
bool IsFitToSpellRequirements(SpellInfo const* spellInfo) const;
+1 -1
View File
@@ -1488,7 +1488,7 @@ void Position::GetSinCos(const float x, const float y, float &vsin, float &vcos)
float dx = GetPositionX() - x;
float dy = GetPositionY() - y;
if (dx < 0.001f && dy < 0.001f)
if (fabs(dx) < 0.001f && fabs(dy) < 0.001f)
{
float angle = (float)rand_norm()*static_cast<float>(2*M_PI);
vcos = cos(angle);
+4 -4
View File
@@ -348,13 +348,13 @@ void Pet::SavePetToDB(PetSaveMode mode)
if (!IS_PLAYER_GUID(GetOwnerGUID()))
return;
Player* pOwner = (Player*)GetOwner();
if (!pOwner)
Player* owner = (Player*)GetOwner();
if (!owner)
return;
// not save pet as current if another pet temporary unsummoned
if (mode == PET_SAVE_AS_CURRENT && pOwner->GetTemporaryUnsummonedPetNumber() &&
pOwner->GetTemporaryUnsummonedPetNumber() != m_charmInfo->GetPetNumber())
if (mode == PET_SAVE_AS_CURRENT && owner->GetTemporaryUnsummonedPetNumber() &&
owner->GetTemporaryUnsummonedPetNumber() != m_charmInfo->GetPetNumber())
{
// pet will lost anyway at restore temporary unsummoned
if (getPetType() == HUNTER_PET)
+46 -52
View File
@@ -4774,8 +4774,8 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
sObjectAccessor->ConvertCorpseForPlayer(playerguid);
if (uint32 guildId = GetGuildIdFromDB(playerguid))
if (Guild* pGuild = sGuildMgr->GetGuildById(guildId))
pGuild->DeleteMember(guid);
if (Guild* guild = sGuildMgr->GetGuildById(guildId))
guild->DeleteMember(guid);
// remove from arena teams
LeaveAllArenaTeams(playerguid);
@@ -5462,11 +5462,11 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g
return TotalCost;
}
Guild* pGuild = sGuildMgr->GetGuildById(GetGuildId());
if (!pGuild)
Guild* guild = sGuildMgr->GetGuildById(GetGuildId());
if (!guild)
return TotalCost;
if (!pGuild->HandleMemberWithdrawMoney(GetSession(), costs, true))
if (!guild->HandleMemberWithdrawMoney(GetSession(), costs, true))
return TotalCost;
TotalCost = costs;
@@ -9057,11 +9057,7 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid)
case 3698:
case 3702:
case 3968:
NumberOfFields = 11;
break;
case 4378:
NumberOfFields = 11;
break;
case 3703:
NumberOfFields = 11;
break;
@@ -9072,8 +9068,6 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid)
NumberOfFields = 28;
break;
case 4812: // Icecrown Citadel
NumberOfFields = 13;
break;
case 4100: // The Culling of Stratholme
NumberOfFields = 13;
break;
@@ -13291,11 +13285,11 @@ void Player::SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2, uint
GetSession()->SendPacket(&data);
}
void Player::SendBuyError(BuyResult msg, Creature* pCreature, uint32 item, uint32 param)
void Player::SendBuyError(BuyResult msg, Creature* creature, uint32 item, uint32 param)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_BUY_FAILED");
WorldPacket data(SMSG_BUY_FAILED, (8+4+4+1));
data << uint64(pCreature ? pCreature->GetGUID() : 0);
data << uint64(creature ? creature->GetGUID() : 0);
data << uint32(item);
if (param > 0)
data << uint32(param);
@@ -13303,11 +13297,11 @@ void Player::SendBuyError(BuyResult msg, Creature* pCreature, uint32 item, uint3
GetSession()->SendPacket(&data);
}
void Player::SendSellError(SellResult msg, Creature* pCreature, uint64 guid, uint32 param)
void Player::SendSellError(SellResult msg, Creature* creature, uint64 guid, uint32 param)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_SELL_ITEM");
WorldPacket data(SMSG_SELL_ITEM, (8+8+(param?4:0)+1)); // last check 2.0.10
data << uint64(pCreature ? pCreature->GetGUID() : 0);
data << uint64(creature ? creature->GetGUID() : 0);
data << uint64(guid);
if (param > 0)
data << uint32(param);
@@ -14348,11 +14342,11 @@ void Player::PrepareQuestMenu(uint64 guid)
QuestRelationBounds pObjectQIR;
// pets also can have quests
Creature* pCreature = ObjectAccessor::GetCreatureOrPetOrVehicle(*this, guid);
if (pCreature)
Creature* creature = ObjectAccessor::GetCreatureOrPetOrVehicle(*this, guid);
if (creature)
{
pObjectQR = sObjectMgr->GetCreatureQuestRelationBounds(pCreature->GetEntry());
pObjectQIR = sObjectMgr->GetCreatureQuestInvolvedRelationBounds(pCreature->GetEntry());
pObjectQR = sObjectMgr->GetCreatureQuestRelationBounds(creature->GetEntry());
pObjectQIR = sObjectMgr->GetCreatureQuestInvolvedRelationBounds(creature->GetEntry());
}
else
{
@@ -14459,10 +14453,10 @@ void Player::SendPreparedQuest(uint64 guid)
std::string title = "";
// need pet case for some quests
Creature* pCreature = ObjectAccessor::GetCreatureOrPetOrVehicle(*this, guid);
if (pCreature)
Creature* creature = ObjectAccessor::GetCreatureOrPetOrVehicle(*this, guid);
if (creature)
{
uint32 textid = GetGossipTextId(pCreature);
uint32 textid = GetGossipTextId(creature);
GossipText const* gossiptext = sObjectMgr->GetGossipText(textid);
if (!gossiptext)
{
@@ -14507,9 +14501,9 @@ Quest const* Player::GetNextQuest(uint64 guid, Quest const* pQuest)
{
QuestRelationBounds pObjectQR;
Creature* pCreature = ObjectAccessor::GetCreatureOrPetOrVehicle(*this, guid);
if (pCreature)
pObjectQR = sObjectMgr->GetCreatureQuestRelationBounds(pCreature->GetEntry());
Creature* creature = ObjectAccessor::GetCreatureOrPetOrVehicle(*this, guid);
if (creature)
pObjectQR = sObjectMgr->GetCreatureQuestRelationBounds(creature->GetEntry());
else
{
//we should obtain map pointer from GetMap() in 99% of cases. Special case
@@ -15668,9 +15662,9 @@ void Player::AreaExploredOrEventHappens(uint32 questId)
//not used in Trinityd, function for external script library
void Player::GroupEventHappens(uint32 questId, WorldObject const* pEventObject)
{
if (Group* pGroup = GetGroup())
if (Group* group = GetGroup())
{
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
{
Player* pGroupGuy = itr->getSource();
@@ -16253,12 +16247,12 @@ void Player::SendQuestConfirmAccept(const Quest* pQuest, Player* pReceiver)
}
}
void Player::SendPushToPartyResponse(Player* pPlayer, uint32 msg)
void Player::SendPushToPartyResponse(Player* player, uint32 msg)
{
if (pPlayer)
if (player)
{
WorldPacket data(MSG_QUEST_PUSH_RESULT, (8+1));
data << uint64(pPlayer->GetGUID());
data << uint64(player->GetGUID());
data << uint8(msg); // valid values: 0-8
GetSession()->SendPacket(&data);
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent MSG_QUEST_PUSH_RESULT");
@@ -20434,24 +20428,24 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32
return false;
}
Creature* pCreature = GetNPCIfCanInteractWith(vendorguid, UNIT_NPC_FLAG_VENDOR);
if (!pCreature)
Creature* creature = GetNPCIfCanInteractWith(vendorguid, UNIT_NPC_FLAG_VENDOR);
if (!creature)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: BuyItemFromVendor - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(vendorguid)));
SendBuyError(BUY_ERR_DISTANCE_TOO_FAR, NULL, item, 0);
return false;
}
VendorItemData const* vItems = pCreature->GetVendorItems();
VendorItemData const* vItems = creature->GetVendorItems();
if (!vItems || vItems->Empty())
{
SendBuyError(BUY_ERR_CANT_FIND_ITEM, pCreature, item, 0);
SendBuyError(BUY_ERR_CANT_FIND_ITEM, creature, item, 0);
return false;
}
if (vendorslot >= vItems->GetItemCount())
{
SendBuyError(BUY_ERR_CANT_FIND_ITEM, pCreature, item, 0);
SendBuyError(BUY_ERR_CANT_FIND_ITEM, creature, item, 0);
return false;
}
@@ -20459,23 +20453,23 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32
// store diff item (cheating)
if (!crItem || crItem->item != item)
{
SendBuyError(BUY_ERR_CANT_FIND_ITEM, pCreature, item, 0);
SendBuyError(BUY_ERR_CANT_FIND_ITEM, creature, item, 0);
return false;
}
// check current item amount if it limited
if (crItem->maxcount != 0)
{
if (pCreature->GetVendorItemCurrentCount(crItem) < pProto->BuyCount * count)
if (creature->GetVendorItemCurrentCount(crItem) < pProto->BuyCount * count)
{
SendBuyError(BUY_ERR_ITEM_ALREADY_SOLD, pCreature, item, 0);
SendBuyError(BUY_ERR_ITEM_ALREADY_SOLD, creature, item, 0);
return false;
}
}
if (pProto->RequiredReputationFaction && (uint32(GetReputationRank(pProto->RequiredReputationFaction)) < pProto->RequiredReputationRank))
{
SendBuyError(BUY_ERR_REPUTATION_REQUIRE, pCreature, item, 0);
SendBuyError(BUY_ERR_REPUTATION_REQUIRE, creature, item, 0);
return false;
}
@@ -20533,18 +20527,18 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32
price = pProto->BuyPrice * count; //it should not exceed MAX_MONEY_AMOUNT
// reputation discount
price = uint32(floor(price * GetReputationPriceDiscount(pCreature)));
price = uint32(floor(price * GetReputationPriceDiscount(creature)));
if (!HasEnoughMoney(price))
{
SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, pCreature, item, 0);
SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, creature, item, 0);
return false;
}
}
if ((bag == NULL_BAG && slot == NULL_SLOT) || IsInventoryPos(bag, slot))
{
if (!_StoreOrEquipNewItem(vendorslot, item, count, bag, slot, price, pProto, pCreature, crItem, true))
if (!_StoreOrEquipNewItem(vendorslot, item, count, bag, slot, price, pProto, creature, crItem, true))
return false;
}
else if (IsEquipmentPos(bag, slot))
@@ -20554,7 +20548,7 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32
SendEquipError(EQUIP_ERR_ITEM_CANT_BE_EQUIPPED, NULL, NULL);
return false;
}
if (!_StoreOrEquipNewItem(vendorslot, item, count, bag, slot, price, pProto, pCreature, crItem, false))
if (!_StoreOrEquipNewItem(vendorslot, item, count, bag, slot, price, pProto, creature, crItem, false))
return false;
}
else
@@ -21970,9 +21964,9 @@ bool Player::GetBGAccessByLevel(BattlegroundTypeId bgTypeId) const
return true;
}
float Player::GetReputationPriceDiscount(Creature const* pCreature) const
float Player::GetReputationPriceDiscount(Creature const* creature) const
{
FactionTemplateEntry const* vendor_faction = pCreature->getFactionTemplateEntry();
FactionTemplateEntry const* vendor_faction = creature->getFactionTemplateEntry();
if (!vendor_faction || !vendor_faction->faction)
return 1.0f;
@@ -22383,9 +22377,9 @@ void Player::RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewar
uint64 creature_guid = (pRewardSource->GetTypeId() == TYPEID_UNIT) ? pRewardSource->GetGUID() : uint64(0);
// prepare data for near group iteration
if (Group* pGroup = GetGroup())
if (Group* group = GetGroup())
{
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
{
Player* pGroupGuy = itr->getSource();
if (!pGroupGuy)
@@ -22399,7 +22393,7 @@ void Player::RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewar
pGroupGuy->KilledMonsterCredit(creature_id, creature_guid);
}
}
else // if (!pGroup)
else // if (!group)
KilledMonsterCredit(creature_id, creature_guid);
}
@@ -22618,14 +22612,14 @@ void Player::SendCorpseReclaimDelay(bool load)
Player* Player::GetNextRandomRaidMember(float radius)
{
Group* pGroup = GetGroup();
if (!pGroup)
Group* group = GetGroup();
if (!group)
return NULL;
std::vector<Player*> nearMembers;
nearMembers.reserve(pGroup->GetMembersCount());
nearMembers.reserve(group->GetMembersCount());
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
{
Player* Target = itr->getSource();
+4 -4
View File
@@ -1317,8 +1317,8 @@ class Player : public Unit, public GridObject<Player>
void RemoveItemFromBuyBackSlot(uint32 slot, bool del);
uint32 GetMaxKeyringSize() const { return KEYRING_SLOT_END-KEYRING_SLOT_START; }
void SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2 = NULL, uint32 itemid = 0);
void SendBuyError(BuyResult msg, Creature* pCreature, uint32 item, uint32 param);
void SendSellError(SellResult msg, Creature* pCreature, uint64 guid, uint32 param);
void SendBuyError(BuyResult msg, Creature* creature, uint32 item, uint32 param);
void SendSellError(SellResult msg, Creature* creature, uint64 guid, uint32 param);
void AddWeaponProficiency(uint32 newflag) { m_WeaponProficiency |= newflag; }
void AddArmorProficiency(uint32 newflag) { m_ArmorProficiency |= newflag; }
uint32 GetWeaponProficiency() const { return m_WeaponProficiency; }
@@ -1337,7 +1337,7 @@ class Player : public Unit, public GridObject<Player>
bool BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 item, uint8 count, uint8 bag, uint8 slot);
bool _StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 count, uint8 bag, uint8 slot, int32 price, ItemTemplate const* pProto, Creature* pVendor, VendorItem const* crItem, bool bStore);
float GetReputationPriceDiscount(Creature const* pCreature) const;
float GetReputationPriceDiscount(Creature const* creature) const;
Player* GetTrader() const { return m_trade ? m_trade->GetTrader() : NULL; }
TradeData* GetTradeData() const { return m_trade; }
@@ -1485,7 +1485,7 @@ class Player : public Unit, public GridObject<Player>
void SendQuestTimerFailed(uint32 quest_id);
void SendCanTakeQuestResponse(uint32 msg);
void SendQuestConfirmAccept(Quest const* pQuest, Player* pReceiver);
void SendPushToPartyResponse(Player* pPlayer, uint32 msg);
void SendPushToPartyResponse(Player* player, uint32 msg);
void SendQuestUpdateAddItem(Quest const* pQuest, uint32 item_idx, uint16 count);
void SendQuestUpdateAddCreatureOrGo(Quest const* pQuest, uint64 guid, uint32 creatureOrGO_idx, uint16 old_count, uint16 add_count);
void SendQuestUpdateAddPlayer(Quest const* pQuest, uint16 old_count, uint16 add_count);
@@ -642,39 +642,39 @@ void Transport::BuildStopMovePacket(Map const* targetMap)
uint32 Transport::AddNPCPassenger(uint32 tguid, uint32 entry, float x, float y, float z, float o, uint32 anim)
{
Map* map = GetMap();
Creature* pCreature = new Creature;
Creature* creature = new Creature;
if (!pCreature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, GetPhaseMask(), entry, 0, GetGOInfo()->faction, 0, 0, 0, 0))
if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, GetPhaseMask(), entry, 0, GetGOInfo()->faction, 0, 0, 0, 0))
{
delete pCreature;
delete creature;
return 0;
}
pCreature->SetTransport(this);
pCreature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
pCreature->m_movementInfo.guid = GetGUID();
pCreature->m_movementInfo.t_pos.Relocate(x, y, z, o);
creature->SetTransport(this);
creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
creature->m_movementInfo.guid = GetGUID();
creature->m_movementInfo.t_pos.Relocate(x, y, z, o);
if (anim)
pCreature->SetUInt32Value(UNIT_NPC_EMOTESTATE, anim);
creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, anim);
pCreature->Relocate(
creature->Relocate(
GetPositionX() + (x * cos(GetOrientation()) + y * sin(GetOrientation() + float(M_PI))),
GetPositionY() + (y * cos(GetOrientation()) + x * sin(GetOrientation())),
z + GetPositionZ(),
o + GetOrientation());
pCreature->SetHomePosition(pCreature->GetPositionX(), pCreature->GetPositionY(), pCreature->GetPositionZ(), pCreature->GetOrientation());
creature->SetHomePosition(creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ(), creature->GetOrientation());
if (!pCreature->IsPositionValid())
if (!creature->IsPositionValid())
{
sLog->outError("Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)", pCreature->GetGUIDLow(), pCreature->GetEntry(), pCreature->GetPositionX(), pCreature->GetPositionY());
delete pCreature;
sLog->outError("Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)", creature->GetGUIDLow(), creature->GetEntry(), creature->GetPositionX(), creature->GetPositionY());
delete creature;
return 0;
}
map->Add(pCreature);
m_NPCPassengerSet.insert(pCreature);
map->Add(creature);
m_NPCPassengerSet.insert(creature);
if (tguid == 0)
{
@@ -684,8 +684,8 @@ uint32 Transport::AddNPCPassenger(uint32 tguid, uint32 entry, float x, float y,
else
currenttguid = std::max(tguid, currenttguid);
pCreature->SetGUIDTransport(tguid);
sScriptMgr->OnAddCreaturePassenger(this, pCreature);
creature->SetGUIDTransport(tguid);
sScriptMgr->OnAddCreaturePassenger(this, creature);
return tguid;
}
+23 -21
View File
@@ -7271,6 +7271,8 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
// Frozen Power
if (dummySpell->SpellIconID == 3780)
{
if (!target)
return false;
if (GetDistance(target) < 15.0f)
return false;
float chance = (float)triggerAmount;
@@ -7943,7 +7945,7 @@ bool Unit::HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, Sp
if (procSpell->SpellFamilyFlags[0] & 0x40000000 && procSpell->SpellIconID == 242)
{
*handled = true;
if (victim->HasAura(53601))
if (victim && victim->HasAura(53601))
{
int32 bp0 = CalculatePctN(int32(damage / 12), dummySpell->Effects[EFFECT_2]. CalcValue());
// Item - Paladin T9 Holy 4P Bonus
@@ -10079,9 +10081,9 @@ Unit* Unit::GetNextRandomRaidMemberOrPet(float radius)
if (!player)
return NULL;
Group* pGroup = player->GetGroup();
Group* group = player->GetGroup();
// When there is no group check pet presence
if (!pGroup)
if (!group)
{
// We are pet now, return owner
if (player != this)
@@ -10096,9 +10098,9 @@ Unit* Unit::GetNextRandomRaidMemberOrPet(float radius)
std::vector<Unit*> nearMembers;
// reserve place for players and pets because resizing vector every unit push is unefficient (vector is reallocated then)
nearMembers.reserve(pGroup->GetMembersCount() * 2);
nearMembers.reserve(group->GetMembersCount() * 2);
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
if (Player* Target = itr->getSource())
{
// IsHostileTo check duel and controlled by enemy
@@ -13803,8 +13805,8 @@ CharmInfo::~CharmInfo()
void CharmInfo::RestoreState()
{
if (m_unit->GetTypeId() == TYPEID_UNIT)
if (Creature* pCreature = m_unit->ToCreature())
pCreature->SetReactState(m_oldReactState);
if (Creature* creature = m_unit->ToCreature())
creature->SetReactState(m_oldReactState);
}
void CharmInfo::InitPetActionBar()
@@ -15680,8 +15682,8 @@ void Unit::SetStunned(bool apply)
SetTarget(getVictim()->GetGUID());
// don't remove UNIT_FLAG_STUNNED for pet when owner is mounted (disabled pet's interface)
Unit* pOwner = GetOwner();
if (!pOwner || (pOwner->GetTypeId() == TYPEID_PLAYER && !pOwner->ToPlayer()->IsMounted()))
Unit* owner = GetOwner();
if (!owner || (owner->GetTypeId() == TYPEID_PLAYER && !owner->ToPlayer()->IsMounted()))
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
if (!HasUnitState(UNIT_STAT_ROOT)) // prevent allow move if have also root effect
@@ -16181,10 +16183,10 @@ void Unit::GetRaidMember(std::list<Unit*> &nearMembers, float radius)
if (!owner)
return;
Group* pGroup = owner->GetGroup();
if (pGroup)
Group* group = owner->GetGroup();
if (group)
{
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
{
Player* Target = itr->getSource();
@@ -16212,15 +16214,15 @@ void Unit::GetRaidMember(std::list<Unit*> &nearMembers, float radius)
void Unit::GetPartyMemberInDist(std::list<Unit*> &TagUnitMap, float radius)
{
Unit* owner = GetCharmerOrOwnerOrSelf();
Group* pGroup = NULL;
Group* group = NULL;
if (owner->GetTypeId() == TYPEID_PLAYER)
pGroup = owner->ToPlayer()->GetGroup();
group = owner->ToPlayer()->GetGroup();
if (pGroup)
if (group)
{
uint8 subgroup = owner->ToPlayer()->GetSubGroup();
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
{
Player* Target = itr->getSource();
@@ -16249,15 +16251,15 @@ void Unit::GetPartyMemberInDist(std::list<Unit*> &TagUnitMap, float radius)
void Unit::GetPartyMembers(std::list<Unit*> &TagUnitMap)
{
Unit* owner = GetCharmerOrOwnerOrSelf();
Group* pGroup = NULL;
Group* group = NULL;
if (owner->GetTypeId() == TYPEID_PLAYER)
pGroup = owner->ToPlayer()->GetGroup();
group = owner->ToPlayer()->GetGroup();
if (pGroup)
if (group)
{
uint8 subgroup = owner->ToPlayer()->GetSubGroup();
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
{
Player* Target = itr->getSource();
@@ -16510,7 +16512,7 @@ void Unit::KnockbackFrom(float x, float y, float speedXY, float speedZ)
WorldPacket data(SMSG_MOVE_KNOCK_BACK, (8+4+4+4+4+4));
data.append(GetPackGUID());
data << uint32(0); // Sequence
data << uint32(0); // counter
data << float(vcos); // x direction
data << float(vsin); // y direction
data << float(speedXY); // Horizontal speed
+20 -20
View File
@@ -1174,12 +1174,12 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
// We use spawn coords to spawn
if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY))
{
Creature* pCreature = new Creature;
Creature* creature = new Creature;
//sLog->outDebug("Spawning creature %u", *itr);
if (!pCreature->LoadFromDB(*itr, map))
delete pCreature;
if (!creature->LoadFromDB(*itr, map))
delete creature;
else
map->Add(pCreature);
map->Add(creature);
}
}
}
@@ -1248,8 +1248,8 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
{
sObjectMgr->RemoveCreatureFromGrid(*itr, data);
if (Creature* pCreature = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_UNIT), (Creature*)NULL))
pCreature->AddObjectToRemoveList();
if (Creature* creature = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_UNIT), (Creature*)NULL))
creature->AddObjectToRemoveList();
}
}
@@ -1296,38 +1296,38 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
continue;
// Update if spawned
Creature* pCreature = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(itr->first, data->id, HIGHGUID_UNIT), (Creature*)NULL);
if (pCreature)
Creature* creature = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(itr->first, data->id, HIGHGUID_UNIT), (Creature*)NULL);
if (creature)
{
if (activate)
{
itr->second.equipement_id_prev = pCreature->GetCurrentEquipmentId();
itr->second.modelid_prev = pCreature->GetDisplayId();
pCreature->LoadEquipment(itr->second.equipment_id, true);
itr->second.equipement_id_prev = creature->GetCurrentEquipmentId();
itr->second.modelid_prev = creature->GetDisplayId();
creature->LoadEquipment(itr->second.equipment_id, true);
if (itr->second.modelid >0 && itr->second.modelid_prev != itr->second.modelid)
{
CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelInfo(itr->second.modelid);
if (minfo)
{
pCreature->SetDisplayId(itr->second.modelid);
pCreature->SetNativeDisplayId(itr->second.modelid);
pCreature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, minfo->bounding_radius);
pCreature->SetFloatValue(UNIT_FIELD_COMBATREACH, minfo->combat_reach);
creature->SetDisplayId(itr->second.modelid);
creature->SetNativeDisplayId(itr->second.modelid);
creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, minfo->bounding_radius);
creature->SetFloatValue(UNIT_FIELD_COMBATREACH, minfo->combat_reach);
}
}
}
else
{
pCreature->LoadEquipment(itr->second.equipement_id_prev, true);
creature->LoadEquipment(itr->second.equipement_id_prev, true);
if (itr->second.modelid_prev >0 && itr->second.modelid_prev != itr->second.modelid)
{
CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelInfo(itr->second.modelid_prev);
if (minfo)
{
pCreature->SetDisplayId(itr->second.modelid_prev);
pCreature->SetNativeDisplayId(itr->second.modelid_prev);
pCreature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, minfo->bounding_radius);
pCreature->SetFloatValue(UNIT_FIELD_COMBATREACH, minfo->combat_reach);
creature->SetDisplayId(itr->second.modelid_prev);
creature->SetNativeDisplayId(itr->second.modelid_prev);
creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, minfo->bounding_radius);
creature->SetFloatValue(UNIT_FIELD_COMBATREACH, minfo->combat_reach);
}
}
}
+1 -1
View File
@@ -199,7 +199,7 @@ bool SpellClickInfo::IsFitToRequirements(Unit const* clicker, Unit const* clicke
if (questStart)
{
// not in expected required quest state
if (((!questStartCanActive || !playerClicker->IsActiveQuest(questStart)) && !playerClicker->GetQuestRewardStatus(questStart)))
if ((!questStartCanActive || !playerClicker->IsActiveQuest(questStart)) && !playerClicker->GetQuestRewardStatus(questStart))
return false;
}
@@ -1025,15 +1025,11 @@ namespace Trinity
return false;
if (m_force)
{
if (!me->IsValidAttackTarget(u))
return false;
}
else
{
if (!me->canStartAttack(u, false))
return false;
}
m_range = me->GetDistance(u); // use found unit range as new range limit for next check
return true;
@@ -1184,16 +1180,16 @@ namespace Trinity
class AllFriendlyCreaturesInGrid
{
public:
AllFriendlyCreaturesInGrid(Unit const* obj) : pUnit(obj) {}
AllFriendlyCreaturesInGrid(Unit const* obj) : unit(obj) {}
bool operator() (Unit* u)
{
if (u->isAlive() && u->IsVisible() && u->IsFriendlyTo(pUnit))
if (u->isAlive() && u->IsVisible() && u->IsFriendlyTo(unit))
return true;
return false;
}
private:
Unit const* pUnit;
Unit const* unit;
};
class AllGameObjectsWithEntryInRange
@@ -1217,9 +1213,9 @@ namespace Trinity
{
public:
AllCreaturesOfEntryInRange(const WorldObject* pObject, uint32 uiEntry, float fMaxRange) : m_pObject(pObject), m_uiEntry(uiEntry), m_fRange(fMaxRange) {}
bool operator() (Unit* pUnit)
bool operator() (Unit* unit)
{
if (pUnit->GetEntry() == m_uiEntry && m_pObject->IsWithinDist(pUnit, m_fRange, false))
if (unit->GetEntry() == m_uiEntry && m_pObject->IsWithinDist(unit, m_fRange, false))
return true;
return false;
@@ -1234,18 +1230,18 @@ namespace Trinity
class PlayerAtMinimumRangeAway
{
public:
PlayerAtMinimumRangeAway(Unit const* unit, float fMinRange) : pUnit(unit), fRange(fMinRange) {}
bool operator() (Player* pPlayer)
PlayerAtMinimumRangeAway(Unit const* unit, float fMinRange) : unit(unit), fRange(fMinRange) {}
bool operator() (Player* player)
{
//No threat list check, must be done explicit if expected to be in combat with creature
if (!pPlayer->isGameMaster() && pPlayer->isAlive() && !pUnit->IsWithinDist(pPlayer, fRange, false))
if (!player->isGameMaster() && player->isAlive() && !unit->IsWithinDist(player, fRange, false))
return true;
return false;
}
private:
Unit const* pUnit;
Unit const* unit;
float fRange;
};
+10 -14
View File
@@ -172,7 +172,6 @@ void Group::LoadGroupFromDB(Field* fields)
m_raidDifficulty = RAID_DIFFICULTY_10MAN_NORMAL;
else
m_raidDifficulty = Difficulty(r_diff);
}
void Group::LoadMemberFromDB(uint32 guidLow, uint8 memberFlags, uint8 subgroup, uint8 roles)
@@ -720,12 +719,12 @@ void Group::SendLootAllPassed(uint32 NumberOfPlayers, const Roll &r)
}
// notify group members which player is the allowed looter for the given creature
void Group::SendLooter(Creature* pCreature, Player* pLooter)
void Group::SendLooter(Creature* creature, Player* pLooter)
{
ASSERT(pCreature);
ASSERT(creature);
WorldPacket data(SMSG_LOOT_LIST, (8+8));
data << uint64(pCreature->GetGUID());
data << uint64(creature->GetGUID());
data << uint8(0); // unk1
if (pLooter)
@@ -770,7 +769,6 @@ void Group::GroupLoot(Loot* loot, WorldObject* pLootedObject)
{
if (member->IsWithinDistInMap(pLootedObject, sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE), false))
{
r->totalPlayersRolling++;
if (member->GetPassOnGroupLoot())
@@ -1255,19 +1253,18 @@ void Group::SendUpdateToPlayer(uint64 playerGUID, MemberSlot* slot)
player->GetSession()->SendPacket(&data);
}
void Group::UpdatePlayerOutOfRange(Player* pPlayer)
void Group::UpdatePlayerOutOfRange(Player* player)
{
if (!pPlayer || !pPlayer->IsInWorld())
if (!player || !player->IsInWorld())
return;
Player* player;
WorldPacket data;
pPlayer->GetSession()->BuildPartyMemberStatsChangedPacket(pPlayer, &data);
player->GetSession()->BuildPartyMemberStatsChangedPacket(player, &data);
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
{
player = itr->getSource();
if (player && !player->IsWithinDist(pPlayer, player->GetSightRange(), false))
if (player && !player->IsWithinDist(player, player->GetSightRange(), false))
player->GetSession()->SendPacket(&data);
}
}
@@ -1589,9 +1586,9 @@ bool Group::InCombatToInstance(uint32 instanceId)
{
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
{
Player* pPlayer = itr->getSource();
if (pPlayer && !pPlayer->getAttackers().empty() && pPlayer->GetInstanceId() == instanceId && (pPlayer->GetMap()->IsRaidOrHeroicDungeon()))
for (std::set<Unit*>::const_iterator i = pPlayer->getAttackers().begin(); i != pPlayer->getAttackers().end(); ++i)
Player* player = itr->getSource();
if (player && !player->getAttackers().empty() && player->GetInstanceId() == instanceId && (player->GetMap()->IsRaidOrHeroicDungeon()))
for (std::set<Unit*>::const_iterator i = player->getAttackers().begin(); i != player->getAttackers().end(); ++i)
if ((*i) && (*i)->GetTypeId() == TYPEID_UNIT && (*i)->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND)
return true;
}
@@ -1755,7 +1752,6 @@ void Group::BroadcastGroupUpdate(void)
// -- not very efficient but safe
for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
{
Player* pp = ObjectAccessor::FindPlayer(citr->guid);
if (pp && pp->IsInWorld())
{
+2 -2
View File
@@ -261,7 +261,7 @@ class Group
void SendTargetIconList(WorldSession* session);
void SendUpdate();
void SendUpdateToPlayer(uint64 playerGUID, MemberSlot* slot = NULL);
void UpdatePlayerOutOfRange(Player* pPlayer);
void UpdatePlayerOutOfRange(Player* player);
// ignore: GUID of player that will be ignored
void BroadcastPacket(WorldPacket* packet, bool ignorePlayersInBGRaid, int group=-1, uint64 ignore=0);
void BroadcastReadyCheck(WorldPacket* packet);
@@ -276,7 +276,7 @@ class Group
void SendLootRoll(uint64 SourceGuid, uint64 TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r);
void SendLootRollWon(uint64 SourceGuid, uint64 TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r);
void SendLootAllPassed(uint32 NumberOfPlayers, const Roll &r);
void SendLooter(Creature* pCreature, Player* pLooter);
void SendLooter(Creature* creature, Player* pLooter);
void GroupLoot(Loot* loot, WorldObject* pLootedObject);
void NeedBeforeGreed(Loot* loot, WorldObject* pLootedObject);
void MasterLoot(Loot* loot, WorldObject* pLootedObject);
+8 -8
View File
@@ -489,7 +489,7 @@ bool Guild::BankTab::SetItem(SQLTransaction& trans, uint8 slotId, Item* pItem)
return true;
}
void Guild::BankTab::SendText(const Guild* pGuild, WorldSession* session) const
void Guild::BankTab::SendText(const Guild* guild, WorldSession* session) const
{
WorldPacket data(MSG_QUERY_GUILD_BANK_TEXT, 1 + m_text.size() + 1);
data << uint8(m_tabId);
@@ -498,7 +498,7 @@ void Guild::BankTab::SendText(const Guild* pGuild, WorldSession* session) const
if (session)
session->SendPacket(&data);
else
pGuild->BroadcastPacket(&data);
guild->BroadcastPacket(&data);
}
///////////////////////////////////////////////////////////////////////////////
@@ -671,7 +671,7 @@ void Guild::Member::DecreaseBankRemainingValue(SQLTransaction& trans, uint8 tabI
// If (tabId == GUILD_BANK_MAX_TABS) return money amount.
// Otherwise return remaining items amount for specified tab.
// If reset time was more than 24 hours ago, renew reset time and reset amount to maximum value.
uint32 Guild::Member::GetBankRemainingValue(uint8 tabId, const Guild* pGuild) const
uint32 Guild::Member::GetBankRemainingValue(uint8 tabId, const Guild* guild) const
{
// Guild master has unlimited amount.
if (IsRank(GR_GUILDMASTER))
@@ -679,7 +679,7 @@ uint32 Guild::Member::GetBankRemainingValue(uint8 tabId, const Guild* pGuild) co
// Check rights for non-money tab.
if (tabId != GUILD_BANK_MAX_TABS)
if ((pGuild->_GetRankBankTabRights(m_rankId, tabId) & GUILD_BANK_RIGHT_VIEW_TAB) != GUILD_BANK_RIGHT_VIEW_TAB)
if ((guild->_GetRankBankTabRights(m_rankId, tabId) & GUILD_BANK_RIGHT_VIEW_TAB) != GUILD_BANK_RIGHT_VIEW_TAB)
return 0;
uint32 curTime = uint32(::time(NULL) / MINUTE); // minutes
@@ -688,8 +688,8 @@ uint32 Guild::Member::GetBankRemainingValue(uint8 tabId, const Guild* pGuild) co
RemainingValue& rv = const_cast <RemainingValue&> (m_bankRemaining[tabId]);
rv.resetTime = curTime;
rv.value = tabId == GUILD_BANK_MAX_TABS ?
pGuild->_GetRankBankMoneyPerDay(m_rankId) :
pGuild->_GetRankBankTabSlotsPerDay(m_rankId, tabId);
guild->_GetRankBankMoneyPerDay(m_rankId) :
guild->_GetRankBankTabSlotsPerDay(m_rankId, tabId);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(
tabId == GUILD_BANK_MAX_TABS ?
@@ -1293,7 +1293,7 @@ void Guild::HandleSetEmblem(WorldSession* session, const EmblemInfo& emblemInfo)
{
Player* player = session->GetPlayer();
if (!_IsLeader(player))
// "Only pGuild leaders can create emblems."
// "Only guild leaders can create emblems."
SendSaveEmblemResult(session, ERR_GUILDEMBLEM_NOTGUILDMASTER);
else if (!player->HasEnoughMoney(EMBLEM_PRICE))
// "You can't afford to do that."
@@ -1634,7 +1634,7 @@ void Guild::HandleMemberDepositMoney(WorldSession* session, uint32 amount)
if (!AccountMgr::IsPlayerAccount(player->GetSession()->GetSecurity()) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
{
sLog->outCommand(player->GetSession()->GetAccountId(),
"GM %s (Account: %u) deposit money (Amount: %u) to pGuild bank (Guild ID %u)",
"GM %s (Account: %u) deposit money (Amount: %u) to guild bank (Guild ID %u)",
player->GetName(), player->GetSession()->GetAccountId(), amount, m_id);
}
// Log guild bank event
+6 -6
View File
@@ -473,7 +473,7 @@ private:
void SetInfo(const std::string& name, const std::string& icon);
void SetText(const std::string& text);
void SendText(const Guild* pGuild, WorldSession* session) const;
void SendText(const Guild* guild, WorldSession* session) const;
inline Item* GetItem(uint8 slotId) const { return slotId < GUILD_BANK_MAX_SLOTS ? m_items[slotId] : NULL; }
bool SetItem(SQLTransaction& trans, uint8 slotId, Item* pItem);
@@ -492,7 +492,7 @@ private:
class MoveItemData
{
public:
MoveItemData(Guild* pGuild, Player* player, uint8 container, uint8 slotId) : m_pGuild(pGuild), m_pPlayer(player),
MoveItemData(Guild* guild, Player* player, uint8 container, uint8 slotId) : m_pGuild(guild), m_pPlayer(player),
m_container(container), m_slotId(slotId), m_pItem(NULL), m_pClonedItem(NULL) { }
virtual ~MoveItemData() { }
@@ -538,8 +538,8 @@ private:
class PlayerMoveItemData : public MoveItemData
{
public:
PlayerMoveItemData(Guild* pGuild, Player* player, uint8 container, uint8 slotId) :
MoveItemData(pGuild, player, container, slotId) { }
PlayerMoveItemData(Guild* guild, Player* player, uint8 container, uint8 slotId) :
MoveItemData(guild, player, container, slotId) { }
bool IsBank() const { return false; }
bool InitItem();
@@ -553,8 +553,8 @@ private:
class BankMoveItemData : public MoveItemData
{
public:
BankMoveItemData(Guild* pGuild, Player* player, uint8 container, uint8 slotId) :
MoveItemData(pGuild, player, container, slotId) { }
BankMoveItemData(Guild* guild, Player* player, uint8 container, uint8 slotId) :
MoveItemData(guild, player, container, slotId) { }
bool IsBank() const { return true; }
bool InitItem();
+10 -10
View File
@@ -292,8 +292,8 @@ void InstanceScript::DoUpdateWorldState(uint32 uiStateId, uint32 uiStateData)
if (!lPlayers.isEmpty())
{
for (Map::PlayerList::const_iterator itr = lPlayers.begin(); itr != lPlayers.end(); ++itr)
if (Player* pPlayer = itr->getSource())
pPlayer->SendUpdateWorldState(uiStateId, uiStateData);
if (Player* player = itr->getSource())
player->SendUpdateWorldState(uiStateId, uiStateData);
}
else
sLog->outDebug(LOG_FILTER_TSCR, "TSCR: DoUpdateWorldState attempt send data but no players in map.");
@@ -311,8 +311,8 @@ void InstanceScript::DoSendNotifyToInstance(const char *format, ...)
va_start(ap, format);
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
if (Player* pPlayer = i->getSource())
if (WorldSession* pSession = pPlayer->GetSession())
if (Player* player = i->getSource())
if (WorldSession* pSession = player->GetSession())
pSession->SendNotification(format, ap);
}
va_end(ap);
@@ -326,8 +326,8 @@ void InstanceScript::DoUpdateAchievementCriteria(AchievementCriteriaTypes type,
if (!PlayerList.isEmpty())
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (Player* pPlayer = i->getSource())
pPlayer->UpdateAchievementCriteria(type, miscValue1, miscValue2, unit);
if (Player* player = i->getSource())
player->UpdateAchievementCriteria(type, miscValue1, miscValue2, unit);
}
// Start timed achievement for all players in instance
@@ -337,8 +337,8 @@ void InstanceScript::DoStartTimedAchievement(AchievementCriteriaTimedTypes type,
if (!PlayerList.isEmpty())
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (Player* pPlayer = i->getSource())
pPlayer->GetAchievementMgr().StartTimedAchievement(type, entry);
if (Player* player = i->getSource())
player->GetAchievementMgr().StartTimedAchievement(type, entry);
}
// Stop timed achievement for all players in instance
@@ -348,8 +348,8 @@ void InstanceScript::DoStopTimedAchievement(AchievementCriteriaTimedTypes type,
if (!PlayerList.isEmpty())
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (Player* pPlayer = i->getSource())
pPlayer->GetAchievementMgr().RemoveTimedAchievement(type, entry);
if (Player* player = i->getSource())
player->GetAchievementMgr().RemoveTimedAchievement(type, entry);
}
// Remove Auras due to Spell on all players in instance
+4 -4
View File
@@ -430,19 +430,19 @@ bool Loot::FillLoot(uint32 lootId, LootStore const& store, Player* lootOwner, bo
tab->Process(*this, store.IsRatesAllowed(), lootMode); // Processing is done there, callback via Loot::AddItem()
// Setting access rights for group loot case
Group* pGroup = lootOwner->GetGroup();
if (!personal && pGroup)
Group* group = lootOwner->GetGroup();
if (!personal && group)
{
roundRobinPlayer = lootOwner->GetGUID();
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
if (Player* pl = itr->getSource()) // should actually be looted object instead of lootOwner but looter has to be really close so doesnt really matter
FillNotNormalLootFor(pl, pl->IsAtGroupRewardDistance(lootOwner));
for (uint8 i = 0; i < items.size(); ++i)
{
if (ItemTemplate const* proto = sObjectMgr->GetItemTemplate(items[i].itemid))
if (proto->Quality < uint32(pGroup->GetLootThreshold()))
if (proto->Quality < uint32(group->GetLootThreshold()))
items[i].is_underthreshold = true;
}
}
+2 -2
View File
@@ -2240,8 +2240,8 @@ bool InstanceMap::CanEnter(Player* player)
}
// cannot enter while an encounter is in progress on raids
/*Group* pGroup = player->GetGroup();
if (!player->isGameMaster() && pGroup && pGroup->InCombatToInstance(GetInstanceId()) && player->GetMapId() != GetId())*/
/*Group* group = player->GetGroup();
if (!player->isGameMaster() && group && group->InCombatToInstance(GetInstanceId()) && player->GetMapId() != GetId())*/
if (IsRaid() && GetInstanceScript() && GetInstanceScript()->IsEncounterInProgress())
{
player->SendTransferAborted(GetId(), TRANSFER_ABORT_ZONE_IN_COMBAT);
+2 -2
View File
@@ -432,9 +432,9 @@ void OPvPCapturePoint::SendObjectiveComplete(uint32 id, uint64 guid)
void OutdoorPvP::HandleKill(Player* killer, Unit* killed)
{
if (Group* pGroup = killer->GetGroup())
if (Group* group = killer->GetGroup())
{
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
{
Player* pGroupGuy = itr->getSource();
+8 -8
View File
@@ -220,8 +220,8 @@ void PoolGroup<Creature>::Despawn1Object(uint32 guid)
{
sObjectMgr->RemoveCreatureFromGrid(guid, data);
if (Creature* pCreature = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_UNIT), (Creature*)NULL))
pCreature->AddObjectToRemoveList();
if (Creature* creature = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_UNIT), (Creature*)NULL))
creature->AddObjectToRemoveList();
}
}
@@ -363,15 +363,15 @@ void PoolGroup<Creature>::Spawn1Object(PoolObject* obj)
// We use spawn coords to spawn
if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY))
{
Creature* pCreature = new Creature;
Creature* creature = new Creature;
//sLog->outDebug(LOG_FILTER_POOLSYS, "Spawning creature %u", guid);
if (!pCreature->LoadFromDB(obj->guid, map))
if (!creature->LoadFromDB(obj->guid, map))
{
delete pCreature;
delete creature;
return;
}
else
map->Add(pCreature);
map->Add(creature);
}
}
}
@@ -506,8 +506,8 @@ template <>
void PoolGroup<Creature>::ReSpawn1Object(PoolObject* obj)
{
if (CreatureData const* data = sObjectMgr->GetCreatureData(obj->guid))
if (Creature* pCreature = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(obj->guid, data->id, HIGHGUID_UNIT), (Creature*)NULL))
pCreature->GetMap()->Add(pCreature);
if (Creature* creature = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(obj->guid, data->id, HIGHGUID_UNIT), (Creature*)NULL))
creature->GetMap()->Add(creature);
}
// Method that does the respawn job on the specified gameobject
+4 -4
View File
@@ -166,16 +166,16 @@ Quest::Quest(Field* questRecord)
++m_rewchoiceitemscount;
}
uint32 Quest::XPValue(Player* pPlayer) const
uint32 Quest::XPValue(Player* player) const
{
if (pPlayer)
if (player)
{
int32 quest_level = (QuestLevel == -1 ? pPlayer->getLevel() : QuestLevel);
int32 quest_level = (QuestLevel == -1 ? player->getLevel() : QuestLevel);
const QuestXPEntry* xpentry = sQuestXPStore.LookupEntry(quest_level);
if (!xpentry)
return 0;
int32 diffFactor = 2 * (quest_level - pPlayer->getLevel()) + 20;
int32 diffFactor = 2 * (quest_level - player->getLevel()) + 20;
if (diffFactor < 1)
diffFactor = 1;
else if (diffFactor > 10)
+1 -1
View File
@@ -183,7 +183,7 @@ class Quest
friend class ObjectMgr;
public:
Quest(Field* questRecord);
uint32 XPValue(Player* pPlayer) const;
uint32 XPValue(Player* player) const;
bool HasFlag(uint32 flag) const { return (QuestFlags & flag) != 0; }
void SetFlag(uint32 flag) { QuestFlags |= flag; }
+27 -27
View File
@@ -100,29 +100,29 @@ void Map::ScriptCommandStart(ScriptInfo const& script, uint32 delay, Object* sou
// Helpers for ScriptProcess method.
inline Player* Map::_GetScriptPlayerSourceOrTarget(Object* source, Object* target, const ScriptInfo* scriptInfo) const
{
Player* pPlayer = NULL;
Player* player = NULL;
if (!source && !target)
sLog->outError("%s source and target objects are NULL.", scriptInfo->GetDebugInfo().c_str());
else
{
// Check target first, then source.
if (target)
pPlayer = target->ToPlayer();
if (!pPlayer && source)
pPlayer = source->ToPlayer();
player = target->ToPlayer();
if (!player && source)
player = source->ToPlayer();
if (!pPlayer)
if (!player)
sLog->outError("%s neither source nor target object is player (source: TypeId: %u, Entry: %u, GUID: %u; target: TypeId: %u, Entry: %u, GUID: %u), skipping.",
scriptInfo->GetDebugInfo().c_str(),
source ? source->GetTypeId() : 0, source ? source->GetEntry() : 0, source ? source->GetGUIDLow() : 0,
target ? target->GetTypeId() : 0, target ? target->GetEntry() : 0, target ? target->GetGUIDLow() : 0);
}
return pPlayer;
return player;
}
inline Creature* Map::_GetScriptCreatureSourceOrTarget(Object* source, Object* target, const ScriptInfo* scriptInfo, bool bReverse) const
{
Creature* pCreature = NULL;
Creature* creature = NULL;
if (!source && !target)
sLog->outError("%s source and target objects are NULL.", scriptInfo->GetDebugInfo().c_str());
else
@@ -131,31 +131,31 @@ inline Creature* Map::_GetScriptCreatureSourceOrTarget(Object* source, Object* t
{
// Check target first, then source.
if (target)
pCreature = target->ToCreature();
if (!pCreature && source)
pCreature = source->ToCreature();
creature = target->ToCreature();
if (!creature && source)
creature = source->ToCreature();
}
else
{
// Check source first, then target.
if (source)
pCreature = source->ToCreature();
if (!pCreature && target)
pCreature = target->ToCreature();
creature = source->ToCreature();
if (!creature && target)
creature = target->ToCreature();
}
if (!pCreature)
if (!creature)
sLog->outError("%s neither source nor target are creatures (source: TypeId: %u, Entry: %u, GUID: %u; target: TypeId: %u, Entry: %u, GUID: %u), skipping.",
scriptInfo->GetDebugInfo().c_str(),
source ? source->GetTypeId() : 0, source ? source->GetEntry() : 0, source ? source->GetGUIDLow() : 0,
target ? target->GetTypeId() : 0, target ? target->GetEntry() : 0, target ? target->GetGUIDLow() : 0);
}
return pCreature;
return creature;
}
inline Unit* Map::_GetScriptUnit(Object* obj, bool isSource, const ScriptInfo* scriptInfo) const
{
Unit* pUnit = NULL;
Unit* unit = NULL;
if (!obj)
sLog->outError("%s %s object is NULL.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target");
else if (!obj->isType(TYPEMASK_UNIT))
@@ -163,42 +163,42 @@ inline Unit* Map::_GetScriptUnit(Object* obj, bool isSource, const ScriptInfo* s
scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target", obj->GetTypeId(), obj->GetEntry(), obj->GetGUIDLow());
else
{
pUnit = obj->ToUnit();
if (!pUnit)
unit = obj->ToUnit();
if (!unit)
sLog->outError("%s %s object could not be casted to unit.",
scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target");
}
return pUnit;
return unit;
}
inline Player* Map::_GetScriptPlayer(Object* obj, bool isSource, const ScriptInfo* scriptInfo) const
{
Player* pPlayer = NULL;
Player* player = NULL;
if (!obj)
sLog->outError("%s %s object is NULL.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target");
else
{
pPlayer = obj->ToPlayer();
if (!pPlayer)
player = obj->ToPlayer();
if (!player)
sLog->outError("%s %s object is not a player (TypeId: %u, Entry: %u, GUID: %u).",
scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target", obj->GetTypeId(), obj->GetEntry(), obj->GetGUIDLow());
}
return pPlayer;
return player;
}
inline Creature* Map::_GetScriptCreature(Object* obj, bool isSource, const ScriptInfo* scriptInfo) const
{
Creature* pCreature = NULL;
Creature* creature = NULL;
if (!obj)
sLog->outError("%s %s object is NULL.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target");
else
{
pCreature = obj->ToCreature();
if (!pCreature)
creature = obj->ToCreature();
if (!creature)
sLog->outError("%s %s object is not a creature (TypeId: %u, Entry: %u, GUID: %u).", scriptInfo->GetDebugInfo().c_str(),
isSource ? "source" : "target", obj->GetTypeId(), obj->GetEntry(), obj->GetGUIDLow());
}
return pCreature;
return creature;
}
inline WorldObject* Map::_GetScriptWorldObject(Object* obj, bool isSource, const ScriptInfo* scriptInfo) const
@@ -479,6 +479,7 @@ void AddSC_boss_blood_prince_council();
void AddSC_boss_blood_queen_lana_thel();
void AddSC_boss_valithria_dreamwalker();
void AddSC_boss_sindragosa();
void AddSC_boss_the_lich_king();
void AddSC_icecrown_citadel_teleport();
void AddSC_instance_icecrown_citadel();
void AddSC_icecrown_citadel();
@@ -1181,6 +1182,7 @@ void AddNorthrendScripts()
AddSC_boss_blood_queen_lana_thel();
AddSC_boss_valithria_dreamwalker();
AddSC_boss_sindragosa();
AddSC_boss_the_lich_king();
AddSC_icecrown_citadel_teleport();
AddSC_instance_icecrown_citadel();
AddSC_icecrown_citadel();
@@ -130,14 +130,14 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data)
if (!item || !bid || !etime)
return; //check for cheaters
Creature* pCreature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER);
if (!pCreature)
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER);
if (!creature)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionSellItem - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(auctioneer)));
return;
}
AuctionHouseEntry const* auctionHouseEntry = AuctionHouseMgr::GetAuctionHouseEntry(pCreature->getFaction());
AuctionHouseEntry const* auctionHouseEntry = AuctionHouseMgr::GetAuctionHouseEntry(creature->getFaction());
if (!auctionHouseEntry)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionSellItem - Unit (GUID: %u) has wrong faction.", uint32(GUID_LOPART(auctioneer)));
@@ -195,7 +195,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data)
return;
}
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(pCreature->getFaction());
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
//we have to take deposit :
uint32 deposit = sAuctionMgr->GetAuctionDeposit(auctionHouseEntry, etime, it, count);
@@ -262,8 +262,8 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recv_data)
if (!auctionId || !price)
return; //check for cheaters
Creature* pCreature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER);
if (!pCreature)
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER);
if (!creature)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionPlaceBid - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(auctioneer)));
return;
@@ -273,7 +273,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recv_data)
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(pCreature->getFaction());
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
AuctionEntry* auction = auctionHouse->GetAuction(auctionId);
Player* pl = GetPlayer();
@@ -380,8 +380,8 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data)
recv_data >> auctionId;
//sLog->outDebug("Cancel AUCTION AuctionID: %u", auctionId);
Creature* pCreature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER);
if (!pCreature)
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER);
if (!creature)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionRemoveItem - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(auctioneer)));
return;
@@ -391,7 +391,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data)
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(pCreature->getFaction());
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
AuctionEntry* auction = auctionHouse->GetAuction(auctionId);
Player* pl = GetPlayer();
@@ -465,8 +465,8 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket & recv_data)
outbiddedCount = 0;
}
Creature* pCreature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER);
if (!pCreature)
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER);
if (!creature)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionListBidderItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid)));
return;
@@ -476,7 +476,7 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket & recv_data)
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(pCreature->getFaction());
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
WorldPacket data(SMSG_AUCTION_BIDDER_LIST_RESULT, (4+4+4));
Player* pl = GetPlayer();
@@ -512,8 +512,8 @@ void WorldSession::HandleAuctionListOwnerItems(WorldPacket & recv_data)
recv_data >> guid;
recv_data >> listfrom; // not used in fact (this list not have page control in client)
Creature* pCreature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER);
if (!pCreature)
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER);
if (!creature)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionListOwnerItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid)));
return;
@@ -523,7 +523,7 @@ void WorldSession::HandleAuctionListOwnerItems(WorldPacket & recv_data)
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(pCreature->getFaction());
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
WorldPacket data(SMSG_AUCTION_OWNER_LIST_RESULT, (4+4+4));
data << (uint32) 0; // amount place holder
@@ -565,8 +565,8 @@ void WorldSession::HandleAuctionListItems(WorldPacket & recv_data)
recv_data.read_skip<uint8>();
}
Creature* pCreature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER);
if (!pCreature)
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER);
if (!creature)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionListItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid)));
return;
@@ -576,7 +576,7 @@ void WorldSession::HandleAuctionListItems(WorldPacket & recv_data)
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(pCreature->getFaction());
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
//sLog->outDebug("Auctionhouse search (GUID: %u TypeId: %u)",, list from: %u, searchedname: %s, levelmin: %u, levelmax: %u, auctionSlotID: %u, auctionMainCategory: %u, auctionSubCategory: %u, quality: %u, usable: %u",
// GUID_LOPART(guid), GuidHigh2TypeId(GUID_HIPART(guid)), listfrom, searchedname.c_str(), levelmin, levelmax, auctionSlotID, auctionMainCategory, auctionSubCategory, quality, usable);
@@ -25,7 +25,6 @@
#include "ArenaTeam.h"
#include "BattlegroundMgr.h"
#include "BattlegroundWS.h"
#include "Battleground.h"
#include "Chat.h"
#include "Language.h"
@@ -252,19 +251,23 @@ void WorldSession::HandleBattlegroundPlayerPositionsOpcode(WorldPacket & /*recv_
if (!bg) // can't be received if player not in battleground
return;
switch(bg->GetTypeID(true))
{
case BATTLEGROUND_WS:
{
uint32 count = 0;
Player* aplr = NULL;
Player* hplr = NULL;
Player* aplr = ObjectAccessor::FindPlayer(((BattlegroundWS*)bg)->GetAllianceFlagPickerGUID());
if (uint64 guid = bg->GetFlagPickerGUID(BG_TEAM_ALLIANCE))
{
aplr = ObjectAccessor::FindPlayer(guid);
if (aplr)
++count;
}
Player* hplr = ObjectAccessor::FindPlayer(((BattlegroundWS*)bg)->GetHordeFlagPickerGUID());
if (uint64 guid = bg->GetFlagPickerGUID(BG_TEAM_HORDE))
{
hplr = ObjectAccessor::FindPlayer(guid);
if (hplr)
++count;
}
WorldPacket data(MSG_BATTLEGROUND_PLAYER_POSITIONS, 4 + 4 + 16 * count);
data << 0;
@@ -284,24 +287,6 @@ void WorldSession::HandleBattlegroundPlayerPositionsOpcode(WorldPacket & /*recv_
}
SendPacket(&data);
break;
}
case BATTLEGROUND_EY:
//TODO : fix me!
break;
case BATTLEGROUND_AB:
case BATTLEGROUND_AV:
{
WorldPacket data(MSG_BATTLEGROUND_PLAYER_POSITIONS, (4+4));
data << uint32(0);
data << uint32(0);
SendPacket(&data);
break;
}
default:
//maybe it is sent also in arena - do nothing
break;
}
}
void WorldSession::HandlePVPLogDataOpcode(WorldPacket & /*recv_data*/)
@@ -883,8 +883,8 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder)
if (pCurrChar->GetGuildId() != 0)
{
if (Guild* pGuild = sGuildMgr->GetGuildById(pCurrChar->GetGuildId()))
pGuild->SendLoginInfo(this);
if (Guild* guild = sGuildMgr->GetGuildById(pCurrChar->GetGuildId()))
guild->SendLoginInfo(this);
else
{
// remove wrong guild data
@@ -33,8 +33,8 @@
inline Guild* _GetPlayerGuild(WorldSession* session, bool sendError = false)
{
if (uint32 guildId = session->GetPlayer()->GetGuildId()) // If guild id = 0, player is not in guild
if (Guild* pGuild = sGuildMgr->GetGuildById(guildId)) // Find guild by id
return pGuild;
if (Guild* guild = sGuildMgr->GetGuildById(guildId)) // Find guild by id
return guild;
if (sendError)
Guild::SendCommandResult(session, GUILD_CREATE_S, ERR_GUILD_PLAYER_NOT_IN_GUILD);
return NULL;
@@ -47,8 +47,8 @@ void WorldSession::HandleGuildQueryOpcode(WorldPacket& recvPacket)
uint32 guildId;
recvPacket >> guildId;
// Use received guild id to access guild method (not player's guild id)
if (Guild* pGuild = sGuildMgr->GetGuildById(guildId))
pGuild->HandleQuery(this);
if (Guild* guild = sGuildMgr->GetGuildById(guildId))
guild->HandleQuery(this);
else
Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_PLAYER_NOT_IN_GUILD);
}
@@ -62,11 +62,11 @@ void WorldSession::HandleGuildCreateOpcode(WorldPacket& recvPacket)
if (!GetPlayer()->GetGuildId()) // Player cannot be in guild
{
Guild* pGuild = new Guild();
if (pGuild->Create(GetPlayer(), name))
sGuildMgr->AddGuild(pGuild);
Guild* guild = new Guild();
if (guild->Create(GetPlayer(), name))
sGuildMgr->AddGuild(guild);
else
delete pGuild;
delete guild;
}
}
@@ -78,8 +78,8 @@ void WorldSession::HandleGuildInviteOpcode(WorldPacket& recvPacket)
recvPacket >> invitedName;
if (normalizePlayerName(invitedName))
if (Guild* pGuild = _GetPlayerGuild(this, true))
pGuild->HandleInviteMember(this, invitedName);
if (Guild* guild = _GetPlayerGuild(this, true))
guild->HandleInviteMember(this, invitedName);
}
void WorldSession::HandleGuildRemoveOpcode(WorldPacket& recvPacket)
@@ -90,8 +90,8 @@ void WorldSession::HandleGuildRemoveOpcode(WorldPacket& recvPacket)
recvPacket >> playerName;
if (normalizePlayerName(playerName))
if (Guild* pGuild = _GetPlayerGuild(this, true))
pGuild->HandleRemoveMember(this, playerName);
if (Guild* guild = _GetPlayerGuild(this, true))
guild->HandleRemoveMember(this, playerName);
}
void WorldSession::HandleGuildAcceptOpcode(WorldPacket& /*recvPacket*/)
@@ -100,8 +100,8 @@ void WorldSession::HandleGuildAcceptOpcode(WorldPacket& /*recvPacket*/)
// Player cannot be in guild
if (!GetPlayer()->GetGuildId())
// Guild where player was invited must exist
if (Guild* pGuild = sGuildMgr->GetGuildById(GetPlayer()->GetGuildIdInvited()))
pGuild->HandleAcceptMember(this);
if (Guild* guild = sGuildMgr->GetGuildById(GetPlayer()->GetGuildIdInvited()))
guild->HandleAcceptMember(this);
}
void WorldSession::HandleGuildDeclineOpcode(WorldPacket& /*recvPacket*/)
@@ -116,16 +116,16 @@ void WorldSession::HandleGuildInfoOpcode(WorldPacket& /*recvPacket*/)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_INFO");
if (Guild* pGuild = _GetPlayerGuild(this, true))
pGuild->SendInfo(this);
if (Guild* guild = _GetPlayerGuild(this, true))
guild->SendInfo(this);
}
void WorldSession::HandleGuildRosterOpcode(WorldPacket& /*recvPacket*/)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_ROSTER");
if (Guild* pGuild = _GetPlayerGuild(this))
pGuild->HandleRoster(this);
if (Guild* guild = _GetPlayerGuild(this))
guild->HandleRoster(this);
}
void WorldSession::HandleGuildPromoteOpcode(WorldPacket& recvPacket)
@@ -136,8 +136,8 @@ void WorldSession::HandleGuildPromoteOpcode(WorldPacket& recvPacket)
recvPacket >> playerName;
if (normalizePlayerName(playerName))
if (Guild* pGuild = _GetPlayerGuild(this, true))
pGuild->HandleUpdateMemberRank(this, playerName, false);
if (Guild* guild = _GetPlayerGuild(this, true))
guild->HandleUpdateMemberRank(this, playerName, false);
}
void WorldSession::HandleGuildDemoteOpcode(WorldPacket& recvPacket)
@@ -148,24 +148,24 @@ void WorldSession::HandleGuildDemoteOpcode(WorldPacket& recvPacket)
recvPacket >> playerName;
if (normalizePlayerName(playerName))
if (Guild* pGuild = _GetPlayerGuild(this, true))
pGuild->HandleUpdateMemberRank(this, playerName, true);
if (Guild* guild = _GetPlayerGuild(this, true))
guild->HandleUpdateMemberRank(this, playerName, true);
}
void WorldSession::HandleGuildLeaveOpcode(WorldPacket& /*recvPacket*/)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_LEAVE");
if (Guild* pGuild = _GetPlayerGuild(this, true))
pGuild->HandleLeaveMember(this);
if (Guild* guild = _GetPlayerGuild(this, true))
guild->HandleLeaveMember(this);
}
void WorldSession::HandleGuildDisbandOpcode(WorldPacket& /*recvPacket*/)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_DISBAND");
if (Guild* pGuild = _GetPlayerGuild(this, true))
pGuild->HandleDisband(this);
if (Guild* guild = _GetPlayerGuild(this, true))
guild->HandleDisband(this);
}
void WorldSession::HandleGuildLeaderOpcode(WorldPacket& recvPacket)
@@ -176,8 +176,8 @@ void WorldSession::HandleGuildLeaderOpcode(WorldPacket& recvPacket)
recvPacket >> name;
if (normalizePlayerName(name))
if (Guild* pGuild = _GetPlayerGuild(this, true))
pGuild->HandleSetLeader(this, name);
if (Guild* guild = _GetPlayerGuild(this, true))
guild->HandleSetLeader(this, name);
}
void WorldSession::HandleGuildMOTDOpcode(WorldPacket& recvPacket)
@@ -188,8 +188,8 @@ void WorldSession::HandleGuildMOTDOpcode(WorldPacket& recvPacket)
if (!recvPacket.empty())
recvPacket >> motd;
if (Guild* pGuild = _GetPlayerGuild(this, true))
pGuild->HandleSetMOTD(this, motd);
if (Guild* guild = _GetPlayerGuild(this, true))
guild->HandleSetMOTD(this, motd);
}
void WorldSession::HandleGuildSetPublicNoteOpcode(WorldPacket& recvPacket)
@@ -203,8 +203,8 @@ void WorldSession::HandleGuildSetPublicNoteOpcode(WorldPacket& recvPacket)
recvPacket >> publicNote;
if (normalizePlayerName(playerName))
if (Guild* pGuild = _GetPlayerGuild(this, true))
pGuild->HandleSetMemberNote(this, playerName, publicNote, false);
if (Guild* guild = _GetPlayerGuild(this, true))
guild->HandleSetMemberNote(this, playerName, publicNote, false);
}
void WorldSession::HandleGuildSetOfficerNoteOpcode(WorldPacket& recvPacket)
@@ -218,16 +218,16 @@ void WorldSession::HandleGuildSetOfficerNoteOpcode(WorldPacket& recvPacket)
recvPacket >> officerNote;
if (normalizePlayerName(playerName))
if (Guild* pGuild = _GetPlayerGuild(this, true))
pGuild->HandleSetMemberNote(this, playerName, officerNote, true);
if (Guild* guild = _GetPlayerGuild(this, true))
guild->HandleSetMemberNote(this, playerName, officerNote, true);
}
void WorldSession::HandleGuildRankOpcode(WorldPacket& recvPacket)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_RANK");
Guild* pGuild = _GetPlayerGuild(this, true);
if (!pGuild)
Guild* guild = _GetPlayerGuild(this, true);
if (!guild)
{
recvPacket.rpos(recvPacket.wpos());
return;
@@ -257,7 +257,7 @@ void WorldSession::HandleGuildRankOpcode(WorldPacket& recvPacket)
rightsAndSlots[tabId] = GuildBankRightsAndSlots(uint8(bankRights), slots);
}
pGuild->HandleSetRankInfo(this, rankId, rankName, rights, money, rightsAndSlots);
guild->HandleSetRankInfo(this, rankId, rankName, rights, money, rightsAndSlots);
}
void WorldSession::HandleGuildAddRankOpcode(WorldPacket& recvPacket)
@@ -267,16 +267,16 @@ void WorldSession::HandleGuildAddRankOpcode(WorldPacket& recvPacket)
std::string rankName;
recvPacket >> rankName;
if (Guild* pGuild = _GetPlayerGuild(this, true))
pGuild->HandleAddNewRank(this, rankName);
if (Guild* guild = _GetPlayerGuild(this, true))
guild->HandleAddNewRank(this, rankName);
}
void WorldSession::HandleGuildDelRankOpcode(WorldPacket& /*recvPacket*/)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_DEL_RANK");
if (Guild* pGuild = _GetPlayerGuild(this, true))
pGuild->HandleRemoveLowestRank(this);
if (Guild* guild = _GetPlayerGuild(this, true))
guild->HandleRemoveLowestRank(this);
}
void WorldSession::HandleGuildChangeInfoTextOpcode(WorldPacket& recvPacket)
@@ -286,8 +286,8 @@ void WorldSession::HandleGuildChangeInfoTextOpcode(WorldPacket& recvPacket)
std::string info;
recvPacket >> info;
if (Guild* pGuild = _GetPlayerGuild(this, true))
pGuild->HandleSetInfo(this, info);
if (Guild* guild = _GetPlayerGuild(this, true))
guild->HandleSetInfo(this, info);
}
void WorldSession::HandleSaveGuildEmblemOpcode(WorldPacket& recvPacket)
@@ -306,10 +306,10 @@ void WorldSession::HandleSaveGuildEmblemOpcode(WorldPacket& recvPacket)
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
if (Guild* pGuild = _GetPlayerGuild(this))
pGuild->HandleSetEmblem(this, emblemInfo);
if (Guild* guild = _GetPlayerGuild(this))
guild->HandleSetEmblem(this, emblemInfo);
else
// "You are not part of a pGuild!";
// "You are not part of a guild!";
Guild::SendSaveEmblemResult(this, ERR_GUILDEMBLEM_NOGUILD);
}
else
@@ -324,24 +324,24 @@ void WorldSession::HandleGuildEventLogQueryOpcode(WorldPacket& /* recvPacket */)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (MSG_GUILD_EVENT_LOG_QUERY)");
if (Guild* pGuild = _GetPlayerGuild(this))
pGuild->SendEventLog(this);
if (Guild* guild = _GetPlayerGuild(this))
guild->SendEventLog(this);
}
void WorldSession::HandleGuildBankMoneyWithdrawn(WorldPacket & /* recv_data */)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (MSG_GUILD_BANK_MONEY_WITHDRAWN)");
if (Guild* pGuild = _GetPlayerGuild(this))
pGuild->SendMoneyInfo(this);
if (Guild* guild = _GetPlayerGuild(this))
guild->SendMoneyInfo(this);
}
void WorldSession::HandleGuildPermissions(WorldPacket& /* recv_data */)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (MSG_GUILD_PERMISSIONS)");
if (Guild* pGuild = _GetPlayerGuild(this))
pGuild->SendPermissions(this);
if (Guild* guild = _GetPlayerGuild(this))
guild->SendPermissions(this);
}
// Called when clicking on Guild bank gameobject
@@ -357,14 +357,14 @@ void WorldSession::HandleGuildBankerActivate(WorldPacket & recv_data)
if (GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK))
{
if (Guild* pGuild = _GetPlayerGuild(this))
pGuild->SendBankTabsInfo(this);
if (Guild* guild = _GetPlayerGuild(this))
guild->SendBankTabsInfo(this);
else
Guild::SendCommandResult(this, GUILD_UNK1, ERR_GUILD_PLAYER_NOT_IN_GUILD);
}
}
// Called when opening pGuild bank tab only (first one)
// Called when opening guild bank tab only (first one)
void WorldSession::HandleGuildBankQueryTab(WorldPacket & recv_data)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (CMSG_GUILD_BANK_QUERY_TAB)");
@@ -379,8 +379,8 @@ void WorldSession::HandleGuildBankQueryTab(WorldPacket & recv_data)
recv_data >> unk1;
if (GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK))
if (Guild* pGuild = _GetPlayerGuild(this))
pGuild->SendBankTabData(this, tabId);
if (Guild* guild = _GetPlayerGuild(this))
guild->SendBankTabData(this, tabId);
}
void WorldSession::HandleGuildBankDepositMoney(WorldPacket & recv_data)
@@ -395,8 +395,8 @@ void WorldSession::HandleGuildBankDepositMoney(WorldPacket & recv_data)
if (GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK))
if (money && GetPlayer()->HasEnoughMoney(money))
if (Guild* pGuild = _GetPlayerGuild(this))
pGuild->HandleMemberDepositMoney(this, money);
if (Guild* guild = _GetPlayerGuild(this))
guild->HandleMemberDepositMoney(this, money);
}
void WorldSession::HandleGuildBankWithdrawMoney(WorldPacket & recv_data)
@@ -411,8 +411,8 @@ void WorldSession::HandleGuildBankWithdrawMoney(WorldPacket & recv_data)
if (money)
if (GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK))
if (Guild* pGuild = _GetPlayerGuild(this))
pGuild->HandleMemberWithdrawMoney(this, money);
if (Guild* guild = _GetPlayerGuild(this))
guild->HandleMemberWithdrawMoney(this, money);
}
void WorldSession::HandleGuildBankSwapItems(WorldPacket & recv_data)
@@ -428,8 +428,8 @@ void WorldSession::HandleGuildBankSwapItems(WorldPacket & recv_data)
return;
}
Guild* pGuild = _GetPlayerGuild(this);
if (!pGuild)
Guild* guild = _GetPlayerGuild(this);
if (!guild)
{
recv_data.rfinish(); // Prevent additional spam at rejected packet
return;
@@ -459,7 +459,7 @@ void WorldSession::HandleGuildBankSwapItems(WorldPacket & recv_data)
recv_data >> splitedAmount;
pGuild->SwapItems(GetPlayer(), tabId, slotId, destTabId, destSlotId, splitedAmount);
guild->SwapItems(GetPlayer(), tabId, slotId, destTabId, destSlotId, splitedAmount);
}
else
{
@@ -492,7 +492,7 @@ void WorldSession::HandleGuildBankSwapItems(WorldPacket & recv_data)
if (!Player::IsInventoryPos(playerBag, playerSlotId) && !(playerBag == NULL_BAG && playerSlotId == NULL_SLOT))
GetPlayer()->SendEquipError(EQUIP_ERR_NONE, NULL);
else
pGuild->SwapItemsWithInventory(GetPlayer(), toChar, tabId, slotId, playerBag, playerSlotId, splitedAmount);
guild->SwapItemsWithInventory(GetPlayer(), toChar, tabId, slotId, playerBag, playerSlotId, splitedAmount);
}
}
@@ -507,8 +507,8 @@ void WorldSession::HandleGuildBankBuyTab(WorldPacket & recv_data)
recv_data >> tabId;
if (GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK))
if (Guild* pGuild = _GetPlayerGuild(this))
pGuild->HandleBuyBankTab(this, tabId);
if (Guild* guild = _GetPlayerGuild(this))
guild->HandleBuyBankTab(this, tabId);
}
void WorldSession::HandleGuildBankUpdateTab(WorldPacket & recv_data)
@@ -529,8 +529,8 @@ void WorldSession::HandleGuildBankUpdateTab(WorldPacket & recv_data)
if (!name.empty() && !icon.empty())
if (GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK))
if (Guild* pGuild = _GetPlayerGuild(this))
pGuild->HandleSetBankTabInfo(this, tabId, name, icon);
if (Guild* guild = _GetPlayerGuild(this))
guild->HandleSetBankTabInfo(this, tabId, name, icon);
}
void WorldSession::HandleGuildBankLogQuery(WorldPacket & recv_data)
@@ -540,8 +540,8 @@ void WorldSession::HandleGuildBankLogQuery(WorldPacket & recv_data)
uint8 tabId;
recv_data >> tabId;
if (Guild* pGuild = _GetPlayerGuild(this))
pGuild->SendBankLog(this, tabId);
if (Guild* guild = _GetPlayerGuild(this))
guild->SendBankLog(this, tabId);
}
void WorldSession::HandleQueryGuildBankTabText(WorldPacket &recv_data)
@@ -551,8 +551,8 @@ void WorldSession::HandleQueryGuildBankTabText(WorldPacket &recv_data)
uint8 tabId;
recv_data >> tabId;
if (Guild* pGuild = _GetPlayerGuild(this))
pGuild->SendBankTabText(this, tabId);
if (Guild* guild = _GetPlayerGuild(this))
guild->SendBankTabText(this, tabId);
}
void WorldSession::HandleSetGuildBankTabText(WorldPacket &recv_data)
@@ -565,6 +565,6 @@ void WorldSession::HandleSetGuildBankTabText(WorldPacket &recv_data)
std::string text;
recv_data >> text;
if (Guild* pGuild = _GetPlayerGuild(this))
pGuild->SetBankTabText(tabId, text);
if (Guild* guild = _GetPlayerGuild(this))
guild->SetBankTabText(tabId, text);
}
@@ -494,8 +494,8 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data)
if (!itemguid)
return;
Creature* pCreature = GetPlayer()->GetNPCIfCanInteractWith(vendorguid, UNIT_NPC_FLAG_VENDOR);
if (!pCreature)
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(vendorguid, UNIT_NPC_FLAG_VENDOR);
if (!creature)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleSellItemOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorguid)));
_player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, NULL, itemguid, 0);
@@ -512,21 +512,21 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data)
// prevent sell not owner item
if (_player->GetGUID() != pItem->GetOwnerGUID())
{
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, pCreature, itemguid, 0);
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0);
return;
}
// prevent sell non empty bag by drag-and-drop at vendor's item list
if (pItem->IsNotEmptyBag())
{
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, pCreature, itemguid, 0);
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0);
return;
}
// prevent sell currently looted item
if (_player->GetLootGUID() == pItem->GetGUID())
{
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, pCreature, itemguid, 0);
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0);
return;
}
@@ -546,7 +546,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data)
// prevent sell more items that exist in stack (possible only not from client)
if (count > pItem->GetCount())
{
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, pCreature, itemguid, 0);
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0);
return;
}
}
@@ -562,7 +562,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data)
if (!pNewItem)
{
sLog->outError("WORLD: HandleSellItemOpcode - could not create clone of item %u; count = %u", pItem->GetEntry(), count);
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, pCreature, itemguid, 0);
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0);
return;
}
@@ -589,11 +589,11 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data)
_player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_VENDORS, money);
}
else
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, pCreature, itemguid, 0);
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0);
return;
}
}
_player->SendSellError(SELL_ERR_CANT_FIND_ITEM, pCreature, itemguid, 0);
_player->SendSellError(SELL_ERR_CANT_FIND_ITEM, creature, itemguid, 0);
return;
}
@@ -605,8 +605,8 @@ void WorldSession::HandleBuybackItem(WorldPacket & recv_data)
recv_data >> vendorguid >> slot;
Creature* pCreature = GetPlayer()->GetNPCIfCanInteractWith(vendorguid, UNIT_NPC_FLAG_VENDOR);
if (!pCreature)
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(vendorguid, UNIT_NPC_FLAG_VENDOR);
if (!creature)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleBuybackItem - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorguid)));
_player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, NULL, 0, 0);
@@ -623,7 +623,7 @@ void WorldSession::HandleBuybackItem(WorldPacket & recv_data)
uint32 price = _player->GetUInt32Value(PLAYER_FIELD_BUYBACK_PRICE_1 + slot - BUYBACK_SLOT_START);
if (!_player->HasEnoughMoney(price))
{
_player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, pCreature, pItem->GetEntry(), 0);
_player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, creature, pItem->GetEntry(), 0);
return;
}
@@ -642,7 +642,7 @@ void WorldSession::HandleBuybackItem(WorldPacket & recv_data)
return;
}
else
_player->SendBuyError(BUY_ERR_CANT_FIND_ITEM, pCreature, 0, 0);
_player->SendBuyError(BUY_ERR_CANT_FIND_ITEM, creature, 0, 0);
}
void WorldSession::HandleBuyItemInSlotOpcode(WorldPacket & recv_data)
@@ -867,8 +867,8 @@ void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket)
// cheating protection
/* not critical if "cheated", and check skip allow by slots in bank windows open by .bank command.
Creature* pCreature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_BANKER);
if (!pCreature)
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_BANKER);
if (!creature)
{
sLog->outDebug("WORLD: HandleBuyBankSlotOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid)));
return;
@@ -78,17 +78,17 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket & recv_data)
}
else
{
Creature* pCreature = GetPlayer()->GetMap()->GetCreature(lguid);
Creature* creature = GetPlayer()->GetMap()->GetCreature(lguid);
bool ok_loot = pCreature && pCreature->isAlive() == (player->getClass() == CLASS_ROGUE && pCreature->lootForPickPocketed);
bool ok_loot = creature && creature->isAlive() == (player->getClass() == CLASS_ROGUE && creature->lootForPickPocketed);
if (!ok_loot || !pCreature->IsWithinDistInMap(_player, INTERACTION_DISTANCE))
if (!ok_loot || !creature->IsWithinDistInMap(_player, INTERACTION_DISTANCE))
{
player->SendLootRelease(lguid);
return;
}
loot = &pCreature->loot;
loot = &creature->loot;
}
player->StoreLootItem(lootSlot, loot);
@@ -329,9 +329,9 @@ void WorldSession::DoLootRelease(uint64 lguid)
// if the round robin player release, reset it.
if (player->GetGUID() == loot->roundRobinPlayer)
{
if (Group* pGroup = player->GetGroup())
if (Group* group = player->GetGroup())
{
if (pGroup->GetLootMethod() != MASTER_LOOT)
if (group->GetLootMethod() != MASTER_LOOT)
{
loot->roundRobinPlayer = 0;
}
@@ -384,20 +384,20 @@ void WorldSession::DoLootRelease(uint64 lguid)
}
else
{
Creature* pCreature = GetPlayer()->GetMap()->GetCreature(lguid);
Creature* creature = GetPlayer()->GetMap()->GetCreature(lguid);
bool ok_loot = pCreature && pCreature->isAlive() == (player->getClass() == CLASS_ROGUE && pCreature->lootForPickPocketed);
if (!ok_loot || !pCreature->IsWithinDistInMap(_player, INTERACTION_DISTANCE))
bool ok_loot = creature && creature->isAlive() == (player->getClass() == CLASS_ROGUE && creature->lootForPickPocketed);
if (!ok_loot || !creature->IsWithinDistInMap(_player, INTERACTION_DISTANCE))
return;
loot = &pCreature->loot;
loot = &creature->loot;
if (loot->isLooted())
{
// skip pickpocketing loot for speed, skinning timer reduction is no-op in fact
if (!pCreature->isAlive())
pCreature->AllLootRemovedFromCorpse();
if (!creature->isAlive())
creature->AllLootRemovedFromCorpse();
pCreature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
loot->clear();
}
else
@@ -405,15 +405,15 @@ void WorldSession::DoLootRelease(uint64 lguid)
// if the round robin player release, reset it.
if (player->GetGUID() == loot->roundRobinPlayer)
{
if (Group* pGroup = player->GetGroup())
if (Group* group = player->GetGroup())
{
if (pGroup->GetLootMethod() != MASTER_LOOT)
if (group->GetLootMethod() != MASTER_LOOT)
{
loot->roundRobinPlayer = 0;
pGroup->SendLooter(pCreature, NULL);
group->SendLooter(creature, NULL);
// force update of dynamic flags, otherwise other group's players still not able to loot.
pCreature->ForceValuesUpdateAtIndex(UNIT_DYNAMIC_FLAGS);
creature->ForceValuesUpdateAtIndex(UNIT_DYNAMIC_FLAGS);
}
}
else
@@ -452,11 +452,11 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket & recv_data)
if (IS_CRE_OR_VEH_GUID(GetPlayer()->GetLootGUID()))
{
Creature* pCreature = GetPlayer()->GetMap()->GetCreature(lootguid);
if (!pCreature)
Creature* creature = GetPlayer()->GetMap()->GetCreature(lootguid);
if (!creature)
return;
pLoot = &pCreature->loot;
pLoot = &creature->loot;
}
else if (IS_GAMEOBJECT_GUID(GetPlayer()->GetLootGUID()))
{
@@ -1464,13 +1464,13 @@ void WorldSession::HandleTimeSyncResp(WorldPacket & recv_data)
void WorldSession::HandleResetInstancesOpcode(WorldPacket & /*recv_data*/)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_RESET_INSTANCES");
Group* pGroup = _player->GetGroup();
if (pGroup)
Group* group = _player->GetGroup();
if (group)
{
if (pGroup->IsLeader(_player->GetGUID()))
if (group->IsLeader(_player->GetGUID()))
{
pGroup->ResetInstances(INSTANCE_RESET_ALL, false, _player);
pGroup->ResetInstances(INSTANCE_RESET_ALL, true, _player);
group->ResetInstances(INSTANCE_RESET_ALL, false, _player);
group->ResetInstances(INSTANCE_RESET_ALL, true, _player);
}
}
else
@@ -1504,12 +1504,12 @@ void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket & recv_data)
return;
}
Group* pGroup = _player->GetGroup();
if (pGroup)
Group* group = _player->GetGroup();
if (group)
{
if (pGroup->IsLeader(_player->GetGUID()))
if (group->IsLeader(_player->GetGUID()))
{
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
{
Player* pGroupGuy = itr->getSource();
if (!pGroupGuy)
@@ -1527,8 +1527,8 @@ void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket & recv_data)
}
// the difficulty is set even if the instances can't be reset
//_player->SendDungeonDifficulty(true);
pGroup->ResetInstances(INSTANCE_RESET_CHANGE_DIFFICULTY, false, _player);
pGroup->SetDungeonDifficulty(Difficulty(mode));
group->ResetInstances(INSTANCE_RESET_CHANGE_DIFFICULTY, false, _player);
group->SetDungeonDifficulty(Difficulty(mode));
}
}
else
@@ -1562,12 +1562,12 @@ void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket & recv_data)
if (Difficulty(mode) == _player->GetRaidDifficulty())
return;
Group* pGroup = _player->GetGroup();
if (pGroup)
Group* group = _player->GetGroup();
if (group)
{
if (pGroup->IsLeader(_player->GetGUID()))
if (group->IsLeader(_player->GetGUID()))
{
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
{
Player* pGroupGuy = itr->getSource();
if (!pGroupGuy)
@@ -1585,8 +1585,8 @@ void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket & recv_data)
}
// the difficulty is set even if the instances can't be reset
//_player->SendDungeonDifficulty(true);
pGroup->ResetInstances(INSTANCE_RESET_CHANGE_DIFFICULTY, true, _player);
pGroup->SetRaidDifficulty(Difficulty(mode));
group->ResetInstances(INSTANCE_RESET_CHANGE_DIFFICULTY, true, _player);
group->SetRaidDifficulty(Difficulty(mode));
}
}
else
@@ -374,18 +374,12 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recv_data)
{
plMover->EnvironmentalDamage(DAMAGE_FALL_TO_VOID, GetPlayer()->GetMaxHealth());
// pl can be alive if GM/etc
if (!plMover->isAlive())
{
// change the death state to CORPSE to prevent the death timer from
// starting in the next player update
if (!plMover->isAlive())
plMover->KillPlayer();
plMover->BuildPlayerRepop();
}
}
// cancel the death timer here if started
plMover->RepopAtGraveyard();
}
}
}
}
@@ -523,13 +517,29 @@ void WorldSession::HandleMoveKnockBackAck(WorldPacket & recv_data)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_MOVE_KNOCK_BACK_ACK");
uint64 guid; // guid - unused
uint64 guid;
recv_data.readPackGUID(guid);
if (_player->m_mover->GetGUID() != guid)
return;
recv_data.read_skip<uint32>(); // unk
MovementInfo movementInfo;
ReadMovementInfo(recv_data, &movementInfo);
_player->m_movementInfo = movementInfo;
WorldPacket data(MSG_MOVE_KNOCK_BACK, 66);
data.appendPackGUID(guid);
_player->BuildMovementPacket(&data);
// knockback specific info
data << movementInfo.j_sinAngle;
data << movementInfo.j_cosAngle;
data << movementInfo.j_xyspeed;
data << movementInfo.j_zspeed;
_player->SendMessageToSet(&data, false);
}
void WorldSession::HandleMoveHoverAck(WorldPacket& recv_data)
@@ -90,8 +90,8 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data)
sLog->outDebug(LOG_FILTER_NETWORKIO, "Petitioner with GUID %u tried sell petition: name %s", GUID_LOPART(guidNPC), name.c_str());
// prevent cheating
Creature* pCreature = GetPlayer()->GetNPCIfCanInteractWith(guidNPC, UNIT_NPC_FLAG_PETITIONER);
if (!pCreature)
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guidNPC, UNIT_NPC_FLAG_PETITIONER);
if (!creature)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandlePetitionBuyOpcode - Unit (GUID: %u) not found or you can't interact with him.", GUID_LOPART(guidNPC));
return;
@@ -104,7 +104,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data)
uint32 charterid = 0;
uint32 cost = 0;
uint32 type = 0;
if (pCreature->isTabardDesigner())
if (creature->isTabardDesigner())
{
// if tabard designer, then trying to buy a guild charter.
// do not let if already in guild.
@@ -189,7 +189,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data)
if (!_player->HasEnoughMoney(cost))
{ //player hasn't got enough money
_player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, pCreature, charterid, 0);
_player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, creature, charterid, 0);
return;
}
@@ -881,8 +881,8 @@ void WorldSession::HandlePetitionShowListOpcode(WorldPacket & recv_data)
void WorldSession::SendPetitionShowList(uint64 guid)
{
Creature* pCreature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_PETITIONER);
if (!pCreature)
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_PETITIONER);
if (!creature)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandlePetitionShowListOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid)));
return;
@@ -891,7 +891,7 @@ void WorldSession::SendPetitionShowList(uint64 guid)
WorldPacket data(SMSG_PETITION_SHOWLIST, 8+1+4*6);
data << guid; // npc guid
if (pCreature->isTabardDesigner())
if (creature->isTabardDesigner())
{
data << uint8(1); // count
data << uint32(1); // index
@@ -86,8 +86,8 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket & recv_data)
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_HELLO npc = %u", GUID_LOPART(guid));
Creature* pCreature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE);
if (!pCreature)
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE);
if (!creature)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleQuestgiverHelloOpcode - Unit (GUID: %u) not found or you can't interact with him.",
GUID_LOPART(guid));
@@ -98,15 +98,15 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket & recv_data)
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
// Stop the npc if moving
pCreature->StopMoving();
creature->StopMoving();
if (sScriptMgr->OnGossipHello(_player, pCreature))
if (sScriptMgr->OnGossipHello(_player, creature))
return;
_player->PrepareGossipMenu(pCreature, pCreature->GetCreatureInfo()->GossipMenuId, true);
_player->SendPreparedGossip(pCreature);
_player->PrepareGossipMenu(creature, creature->GetCreatureInfo()->GossipMenuId, true);
_player->SendPreparedGossip(creature);
pCreature->AI()->sGossipHello(_player);
creature->AI()->sGossipHello(_player);
}
void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data)
@@ -146,10 +146,10 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data)
if (_player->GetDivider() != 0)
{
Player* pPlayer = ObjectAccessor::FindPlayer(_player->GetDivider());
if (pPlayer)
Player* player = ObjectAccessor::FindPlayer(_player->GetDivider());
if (player)
{
pPlayer->SendPushToPartyResponse(_player, QUEST_PARTY_MSG_ACCEPT_QUEST);
player->SendPushToPartyResponse(_player, QUEST_PARTY_MSG_ACCEPT_QUEST);
_player->SetDivider(0);
}
}
@@ -160,23 +160,23 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data)
if (qInfo->HasFlag(QUEST_FLAGS_PARTY_ACCEPT))
{
if (Group* pGroup = _player->GetGroup())
if (Group* group = _player->GetGroup())
{
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
{
Player* pPlayer = itr->getSource();
Player* player = itr->getSource();
if (!pPlayer || pPlayer == _player) // not self
if (!player || player == _player) // not self
continue;
if (pPlayer->CanTakeQuest(qInfo, true))
if (player->CanTakeQuest(qInfo, true))
{
pPlayer->SetDivider(_player->GetGUID());
player->SetDivider(_player->GetGUID());
//need confirmation that any gossip window will close
pPlayer->PlayerTalkClass->SendCloseGossip();
player->PlayerTalkClass->SendCloseGossip();
_player->SendQuestConfirmAccept(qInfo, pPlayer);
_player->SendQuestConfirmAccept(qInfo, player);
}
}
}
@@ -546,49 +546,49 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket)
if (Quest const* pQuest = sObjectMgr->GetQuestTemplate(questId))
{
if (Group* pGroup = _player->GetGroup())
if (Group* group = _player->GetGroup())
{
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
{
Player* pPlayer = itr->getSource();
Player* player = itr->getSource();
if (!pPlayer || pPlayer == _player) // skip self
if (!player || player == _player) // skip self
continue;
_player->SendPushToPartyResponse(pPlayer, QUEST_PARTY_MSG_SHARING_QUEST);
_player->SendPushToPartyResponse(player, QUEST_PARTY_MSG_SHARING_QUEST);
if (!pPlayer->SatisfyQuestStatus(pQuest, false))
if (!player->SatisfyQuestStatus(pQuest, false))
{
_player->SendPushToPartyResponse(pPlayer, QUEST_PARTY_MSG_HAVE_QUEST);
_player->SendPushToPartyResponse(player, QUEST_PARTY_MSG_HAVE_QUEST);
continue;
}
if (pPlayer->GetQuestStatus(questId) == QUEST_STATUS_COMPLETE)
if (player->GetQuestStatus(questId) == QUEST_STATUS_COMPLETE)
{
_player->SendPushToPartyResponse(pPlayer, QUEST_PARTY_MSG_FINISH_QUEST);
_player->SendPushToPartyResponse(player, QUEST_PARTY_MSG_FINISH_QUEST);
continue;
}
if (!pPlayer->CanTakeQuest(pQuest, false))
if (!player->CanTakeQuest(pQuest, false))
{
_player->SendPushToPartyResponse(pPlayer, QUEST_PARTY_MSG_CANT_TAKE_QUEST);
_player->SendPushToPartyResponse(player, QUEST_PARTY_MSG_CANT_TAKE_QUEST);
continue;
}
if (!pPlayer->SatisfyQuestLog(false))
if (!player->SatisfyQuestLog(false))
{
_player->SendPushToPartyResponse(pPlayer, QUEST_PARTY_MSG_LOG_FULL);
_player->SendPushToPartyResponse(player, QUEST_PARTY_MSG_LOG_FULL);
continue;
}
if (pPlayer->GetDivider() != 0)
if (player->GetDivider() != 0)
{
_player->SendPushToPartyResponse(pPlayer, QUEST_PARTY_MSG_BUSY);
_player->SendPushToPartyResponse(player, QUEST_PARTY_MSG_BUSY);
continue;
}
pPlayer->PlayerTalkClass->SendQuestGiverQuestDetails(pQuest, _player->GetGUID(), true);
pPlayer->SetDivider(_player->GetGUID());
player->PlayerTalkClass->SendQuestGiverQuestDetails(pQuest, _player->GetGUID(), true);
player->SetDivider(_player->GetGUID());
}
}
}
@@ -604,19 +604,19 @@ void WorldSession::HandleQuestPushResult(WorldPacket& recvPacket)
if (_player->GetDivider() != 0)
{
Player* pPlayer = ObjectAccessor::FindPlayer(_player->GetDivider());
if (pPlayer)
Player* player = ObjectAccessor::FindPlayer(_player->GetDivider());
if (player)
{
WorldPacket data(MSG_QUEST_PUSH_RESULT, (8+1));
data << uint64(guid);
data << uint8(msg); // valid values: 0-8
pPlayer->GetSession()->SendPacket(&data);
player->GetSession()->SendPacket(&data);
_player->SetDivider(0);
}
}
}
uint32 WorldSession::getDialogStatus(Player* pPlayer, Object* questgiver, uint32 defstatus)
uint32 WorldSession::getDialogStatus(Player* player, Object* questgiver, uint32 defstatus)
{
uint32 result = defstatus;
@@ -651,12 +651,12 @@ uint32 WorldSession::getDialogStatus(Player* pPlayer, Object* questgiver, uint32
if (!pQuest) continue;
ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK, pQuest->GetQuestId());
if (!sConditionMgr->IsPlayerMeetToConditions(pPlayer, conditions))
if (!sConditionMgr->IsPlayerMeetToConditions(player, conditions))
continue;
QuestStatus status = pPlayer->GetQuestStatus(quest_id);
if ((status == QUEST_STATUS_COMPLETE && !pPlayer->GetQuestRewardStatus(quest_id)) ||
(pQuest->IsAutoComplete() && pPlayer->CanTakeQuest(pQuest, false)))
QuestStatus status = player->GetQuestStatus(quest_id);
if ((status == QUEST_STATUS_COMPLETE && !player->GetQuestRewardStatus(quest_id)) ||
(pQuest->IsAutoComplete() && player->CanTakeQuest(pQuest, false)))
{
if (pQuest->IsAutoComplete() && pQuest->IsRepeatable())
result2 = DIALOG_STATUS_REWARD_REP;
@@ -679,19 +679,19 @@ uint32 WorldSession::getDialogStatus(Player* pPlayer, Object* questgiver, uint32
continue;
ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK, pQuest->GetQuestId());
if (!sConditionMgr->IsPlayerMeetToConditions(pPlayer, conditions))
if (!sConditionMgr->IsPlayerMeetToConditions(player, conditions))
continue;
QuestStatus status = pPlayer->GetQuestStatus(quest_id);
QuestStatus status = player->GetQuestStatus(quest_id);
if (status == QUEST_STATUS_NONE)
{
if (pPlayer->CanSeeStartQuest(pQuest))
if (player->CanSeeStartQuest(pQuest))
{
if (pPlayer->SatisfyQuestLevel(pQuest, false))
if (player->SatisfyQuestLevel(pQuest, false))
{
if (pQuest->IsAutoComplete() || (pQuest->IsRepeatable() && pPlayer->IsQuestRewarded(quest_id)))
if (pQuest->IsAutoComplete() || (pQuest->IsRepeatable() && player->IsQuestRewarded(quest_id)))
result2 = DIALOG_STATUS_REWARD_REP;
else if (pPlayer->getLevel() <= ((pPlayer->GetQuestLevel(pQuest) == -1) ? pPlayer->getLevel() : pPlayer->GetQuestLevel(pQuest) + sWorld->getIntConfig(CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF)))
else if (player->getLevel() <= ((player->GetQuestLevel(pQuest) == -1) ? player->getLevel() : player->GetQuestLevel(pQuest) + sWorld->getIntConfig(CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF)))
{
if (pQuest->HasFlag(QUEST_FLAGS_DAILY) || pQuest->HasFlag(QUEST_FLAGS_WEEKLY))
result2 = DIALOG_STATUS_AVAILABLE_REP;
+2 -2
View File
@@ -441,8 +441,8 @@ void WorldSession::LogoutPlayer(bool Save)
HandleMoveWorldportAckOpcode();
///- If the player is in a guild, update the guild roster and broadcast a logout message to other guild members
if (Guild* pGuild = sGuildMgr->GetGuildById(_player->GetGuildId()))
pGuild->HandleMemberLogout(this);
if (Guild* guild = sGuildMgr->GetGuildById(_player->GetGuildId()))
guild->HandleMemberLogout(this);
///- Remove pet
_player->RemovePet(NULL, PET_SAVE_AS_CURRENT, true);
+1 -1
View File
@@ -367,7 +367,7 @@ class WorldSession
uint32 GetLatency() const { return m_latency; }
void SetLatency(uint32 latency) { m_latency = latency; }
uint32 getDialogStatus(Player* pPlayer, Object* questgiver, uint32 defstatus);
uint32 getDialogStatus(Player* player, Object* questgiver, uint32 defstatus);
time_t m_timeOutTime;
void UpdateTimeOutTime(uint32 diff)
+2 -1
View File
@@ -1347,7 +1347,8 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
if (removeMode == AURA_REMOVE_BY_ENEMY_SPELL && GetSpellInfo()->SpellFamilyFlags[1] & 0x1)
{
// Shattered Barrier
if (caster->GetDummyAuraEffect(SPELLFAMILY_MAGE, 2945, 0))
if (AuraEffect * dummy = caster->GetDummyAuraEffect(SPELLFAMILY_MAGE, 2945, 0))
if (roll_chance_i(dummy->GetSpellInfo()->ProcChance))
caster->CastSpell(target, 55080, true, NULL, GetEffect(0));
}
break;
+13 -5
View File
@@ -2665,10 +2665,10 @@ uint32 Spell::SelectEffectTargets(uint32 i, SpellImplicitTargetInfo const& cur)
Player* targetPlayer = m_targets.GetUnitTarget() && m_targets.GetUnitTarget()->GetTypeId() == TYPEID_PLAYER
? (Player*)m_targets.GetUnitTarget() : NULL;
Group* pGroup = targetPlayer ? targetPlayer->GetGroup() : NULL;
if (pGroup)
Group* group = targetPlayer ? targetPlayer->GetGroup() : NULL;
if (group)
{
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
{
Player* Target = itr->getSource();
@@ -3407,7 +3407,7 @@ void Spell::_handle_immediate_phase()
}
}
// Proc damage for spells which have only dest targets (2484 should proc 51486 for example)
m_originalCaster->ProcDamageAndSpell(0, procAttacker, 0, m_procEx | PROC_EX_NORMAL_HIT, 0, BASE_ATTACK, m_spellInfo, m_triggeredByAuraSpell);
m_originalCaster->ProcDamageAndSpell(NULL, procAttacker, 0, m_procEx | PROC_EX_NORMAL_HIT, 0, BASE_ATTACK, m_spellInfo, m_triggeredByAuraSpell);
}
}
@@ -4577,7 +4577,10 @@ SpellCastResult Spell::CheckCast(bool strict)
}
if (m_spellInfo->AttributesEx7 & SPELL_ATTR7_IS_CHEAT_SPELL && !m_caster->HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_ALLOW_CHEAT_SPELLS))
return SPELL_FAILED_SPELL_UNAVAILABLE;
{
m_customError = SPELL_CUSTOM_ERROR_GM_ONLY;
return SPELL_FAILED_CUSTOM_ERROR;
}
// Check global cooldown
if (strict && !(_triggeredCastFlags & TRIGGERED_IGNORE_GCD) && HasGlobalCooldown())
@@ -4626,6 +4629,11 @@ SpellCastResult Spell::CheckCast(bool strict)
}
}
Unit::AuraEffectList const& blockSpells = m_caster->GetAuraEffectsByType(SPELL_AURA_BLOCK_SPELL_FAMILY);
for (Unit::AuraEffectList::const_iterator blockItr = blockSpells.begin(); blockItr != blockSpells.end(); ++blockItr)
if ((*blockItr)->GetMiscValue() == m_spellInfo->SpellFamilyName)
return SPELL_FAILED_SPELL_UNAVAILABLE;
bool reqCombat = true;
Unit::AuraEffectList const& stateAuras = m_caster->GetAuraEffectsByType(SPELL_AURA_ABILITY_IGNORE_AURASTATE);
for (Unit::AuraEffectList::const_iterator j = stateAuras.begin(); j != stateAuras.end(); ++j)
+17 -18
View File
@@ -62,6 +62,7 @@
#include "ScriptMgr.h"
#include "GameObjectAI.h"
#include "AccountMgr.h"
#include "InstanceScript.h"
pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
{
@@ -308,7 +309,7 @@ void Spell::EffectEnvironmentalDMG(SpellEffIndex /*effIndex*/)
void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
{
if (effectHandleMode == SPELL_EFFECT_HANDLE_LAUNCH_TARGET)
if (effectHandleMode != SPELL_EFFECT_HANDLE_LAUNCH_TARGET)
return;
bool apply_direct_bonus = true;
@@ -2141,7 +2142,7 @@ void Spell::EffectSendEvent(SpellEffIndex effIndex)
&& effectHandleMode != SPELL_EFFECT_HANDLE_HIT)
return;
Object* target = NULL;
WorldObject* target = NULL;
// call events for target if present
if (effectHandleMode == SPELL_EFFECT_HANDLE_HIT_TARGET)
@@ -2162,7 +2163,9 @@ void Spell::EffectSendEvent(SpellEffIndex effIndex)
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell ScriptStart %u for spellid %u in EffectSendEvent ", m_spellInfo->Effects[effIndex].MiscValue, m_spellInfo->Id);
if (ZoneScript* zoneScript = m_caster->GetZoneScript())
zoneScript->ProcessEvent(unitTarget, m_spellInfo->Effects[effIndex].MiscValue);
zoneScript->ProcessEvent(target, m_spellInfo->Effects[effIndex].MiscValue);
else if (InstanceScript* instanceScript = m_caster->GetInstanceScript()) // needed in case Player is the caster
instanceScript->ProcessEvent(target, m_spellInfo->Effects[effIndex].MiscValue);
m_caster->GetMap()->ScriptsStart(sEventScripts, m_spellInfo->Effects[effIndex].MiscValue, m_caster, target);
}
@@ -3325,9 +3328,9 @@ void Spell::EffectDispel(SpellEffIndex effIndex)
int32 heal_amount = m_spellInfo->Effects[EFFECT_1].CalcValue();
m_caster->CastCustomSpell(m_caster, 19658, &heal_amount, NULL, NULL, true);
// Glyph of Felhunter
if (Unit* pOwner = m_caster->GetOwner())
if (pOwner->GetAura(56249))
pOwner->CastCustomSpell(pOwner, 19658, &heal_amount, NULL, NULL, true);
if (Unit* owner = m_caster->GetOwner())
if (owner->GetAura(56249))
owner->CastCustomSpell(owner, 19658, &heal_amount, NULL, NULL, true);
}
}
@@ -6241,11 +6244,7 @@ void Spell::EffectKnockBack(SpellEffIndex effIndex)
if (unitTarget->IsNonMeleeSpellCasted(true))
unitTarget->InterruptNonMeleeSpells(true);
float ratio = m_caster->GetCombatReach() / std::max(unitTarget->GetCombatReach(), 1.0f);
if (ratio < 1.0f)
ratio = ratio * ratio * ratio * 0.1f; // volume = length^3
else
ratio = 0.1f; // dbc value ratio
float ratio = 0.1f;
float speedxy = float(m_spellInfo->Effects[effIndex].MiscValue) * ratio;
float speedz = float(damage) * ratio;
if (speedxy < 0.1f && speedz < 0.1f)
@@ -6288,7 +6287,7 @@ void Spell::EffectQuestClear(SpellEffIndex effIndex)
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
Player* pPlayer = unitTarget->ToPlayer();
Player* player = unitTarget->ToPlayer();
uint32 quest_id = m_spellInfo->Effects[effIndex].MiscValue;
@@ -6298,24 +6297,24 @@ void Spell::EffectQuestClear(SpellEffIndex effIndex)
return;
// Player has never done this quest
if (pPlayer->GetQuestStatus(quest_id) == QUEST_STATUS_NONE)
if (player->GetQuestStatus(quest_id) == QUEST_STATUS_NONE)
return;
// remove all quest entries for 'entry' from quest log
for (uint8 slot = 0; slot < MAX_QUEST_LOG_SIZE; ++slot)
{
uint32 quest = pPlayer->GetQuestSlotQuestId(slot);
uint32 quest = player->GetQuestSlotQuestId(slot);
if (quest == quest_id)
{
pPlayer->SetQuestSlot(slot, 0);
player->SetQuestSlot(slot, 0);
// we ignore unequippable quest items in this case, its' still be equipped
pPlayer->TakeQuestSourceItem(quest, false);
player->TakeQuestSourceItem(quest, false);
}
}
pPlayer->RemoveActiveQuest(quest_id);
pPlayer->RemoveRewardedQuest(quest_id);
player->RemoveActiveQuest(quest_id);
player->RemoveRewardedQuest(quest_id);
}
void Spell::EffectSendTaxi(SpellEffIndex effIndex)

Some files were not shown because too many files have changed in this diff Show More