aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/2013_05_26_00_world_sai.sql114
-rw-r--r--sql/updates/world/2013_05_26_01_world_sai.sql39
-rw-r--r--sql/updates/world/2013_05_26_02_world_sai.sql79
-rw-r--r--sql/updates/world/2013_05_26_03_world_sai.sql5
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp26
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.h1
-rw-r--r--src/server/game/Entities/Item/Item.cpp24
-rw-r--r--src/server/game/Entities/Item/Item.h4
-rw-r--r--src/server/game/Handlers/ItemHandler.cpp21
-rw-r--r--src/server/game/Handlers/QuestHandler.cpp2
-rw-r--r--src/server/game/Server/Protocol/Opcodes.cpp2
-rw-r--r--src/server/game/Server/Protocol/Opcodes.h2
-rw-r--r--src/server/game/Server/WorldSession.h2
-rw-r--r--src/server/game/Spells/SpellEffects.cpp10
14 files changed, 305 insertions, 26 deletions
diff --git a/sql/updates/world/2013_05_26_00_world_sai.sql b/sql/updates/world/2013_05_26_00_world_sai.sql
new file mode 100644
index 00000000000..90e207fb78d
--- /dev/null
+++ b/sql/updates/world/2013_05_26_00_world_sai.sql
@@ -0,0 +1,114 @@
+SET @ETHEREAL_TELEPORT := 34427; -- Arete Teleport Animation
+SET @ARETE := 29560; -- LC Arete
+SET @SUMMON_AERTE := 18280; -- LC Arete Summon Spell
+SET @LANDGREN := 29542; -- Landgren
+SET @LANDGRENS_SOUL := 29572; -- Landgren's Soul
+SET @SOUL_TARGET_BUNNY := 29577; -- Target Bunny for the Soul
+SET @CORPSE_SFOCUS := 22965; -- Spell focus for the corpse
+SET @SOUL_COAX := 22966; -- Soul Coax Spell
+SET @SOUL_MOVE := 12601; -- Sould Move position
+SET @SUMMON_SOUL := 12600; -- Summon Landgren's Soul
+SET @SOUL_WRACK := 54723; -- Soul Wrack Spell
+SET @ARCANE_EXP := 35426; -- Arcane Explosion Visual
+SET @SUMMON_GATE := 26560; -- Summon Arete Gateway spell
+SET @ARETE_GATE := 191579; -- Arete Gateway Object
+SET @LANDGREN_CORPSE := 191578; -- Landgrens Corpse Object
+
+UPDATE `gameobject_template` SET `faction`=114, `AIName`='SmartGameObjectAI' WHERE `entry`=@ARETE_GATE;
+DELETE FROM `gameobject_template` WHERE `entry`=@LANDGREN_CORPSE;
+INSERT INTO `gameobject_template` (`entry`,`type`,`displayId`,`name`,`data0`,`data1`,`data6`) VALUES
+(@LANDGREN_CORPSE,8,0,'Archbishop Landgren''s Corpse',1566,20,0);
+
+UPDATE `creature_template` SET `npcflag`=2, `unit_flags`=33280 WHERE `entry`=@ARETE;
+UPDATE `creature_template` SET `faction_A`=14, `faction_H`=14, `speed_walk`=0.4, `unit_flags`=256, `dynamicflags`=32 WHERE `entry`=@LANDGRENS_SOUL;
+UPDATE `creature_template` SET `unit_flags`=33555200, `flags_extra`=`flags_extra`|128 WHERE `entry`=@SOUL_TARGET_BUNNY;
+
+UPDATE `creature_model_info` SET `bounding_radius`=0.5745, `combat_reach`=2.25 WHERE `modelid`=26197;
+UPDATE `creature_model_info` SET `bounding_radius`=0.3825, `combat_reach`=1.875 WHERE `modelid`=26346;
+
+DELETE FROM `creature_template_addon` WHERE `entry`=@LANDGRENS_SOUL;
+INSERT INTO `creature_template_addon` (`entry`,`bytes2`,`emote`,`auras`) VALUES
+(@LANDGRENS_SOUL,1,0,'36545 36550'); -- Float Aura for Landgren's Soul
+
+DELETE FROM `creature_text` WHERE `entry` IN (@ARETE,@LANDGRENS_SOUL);
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(@ARETE,0,0,'Well done. Let''s get this over with.',12,0,100,1,0,0,''),
+(@ARETE,1,0,'Come, Landgren, cough up your soul so that I can ask you a very important question.',12,0,100,0,0,0,''),
+(@ARETE,2,0,'YOU WILL TELL ME WHERE WESTWIND IS OR I WILL DESTROY YOUR SOUL!',14,0,100,25,0,0,''),
+(@ARETE,3,0,'Then you leave me no choice. I won''t say that I won''t enjoy this.',12,0,100,1,0,0,''),
+(@ARETE,4,0,'Very well. Tell me!',12,0,100,0,0,0,''),
+(@ARETE,5,0,'A hidden hollow? How very interesting. You''ve served your purpose, Landgren, but I''m afraid there''ll be no resurrection for you this time!',12,0,100,6,0,0,''),
+(@ARETE,6,0,'Now that the unpleasantness is finished with, let''s talk about you dealing with Grand Admiral Westwind.',12,0,100,11,0,0,''),
+
+(@LANDGRENS_SOUL,0,0,'You''ll get nothing out of me, monster. I am beyond your ability to influence.',12,0,100,0,0,0,''),
+(@LANDGRENS_SOUL,1,0,'No.',12,0,100,0,0,0,''),
+(@LANDGRENS_SOUL,2,0,'STOP! It isn''t worth it. I''ll tell you where he is.',12,0,100,0,0,0,''),
+(@LANDGRENS_SOUL,3,0,'On the south end of the island is a cave -- a hidden hollow. The grand admiral has holed himself up in there, preparing for the final battle against the Lich King.',12,0,100,0,0,0,''),
+(@LANDGRENS_SOUL,4,0,'AAAEEEEIIIiiiiiiiiiiiiiiiiiiiiiiiiiiii........................................',14,0,100,0,0,0,'');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (@SOUL_COAX,@SUMMON_GATE);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(13,1,@SOUL_COAX,0,0,31,0,3,@LANDGREN,0,0,0,'','Spell Soul Coax targets Archbishop Landgren'),
+(13,2,@SUMMON_GATE,0,0,31,0,3,@LANDGREN,0,0,0,'','Spell Summon Arete''s Gate effect1 targets Archbishop Landgren');
+
+UPDATE `creature_template` SET AIName='SmartAI' WHERE entry=@SOUL_TARGET_BUNNY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@SOUL_TARGET_BUNNY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(@SOUL_TARGET_BUNNY,0,0,0,54,0,100,0,0,0,0,0,69,0,0,0,0,0,0,19,@LANDGREN,20,0,0,0,59.057,0,'Spell Focus Bunny - Just summoned - Move to position');
+
+
+UPDATE `creature_template` SET AIName='SmartAI' WHERE entry IN (@LANDGREN,@ARETE,@LANDGRENS_SOUL);
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@LANDGREN,@ARETE,@LANDGRENS_SOUL) AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ARETE_GATE AND `source_type`=1;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ARETE_GATE*100 AND `source_type`=9;
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ARETE*100,@LANDGRENS_SOUL*100) AND `source_type`=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
+(@LANDGREN,0,0,0,4,0,100,0,0,0,0,0,42,0,1,0,0,0,0,1,0,0,0,0,0,0,0,'Archbishop Landgren - On Aggro - Set invincibility 1HP'),
+(@LANDGREN,0,1,2,2,0,100,1,0,1,0,0,11,@CORPSE_SFOCUS,0,0,0,0,0,1,0,0,0,0,0,0,0,'Archbishop Landgren - On health below 0.1% - Spellcast Summon Archbishop Landgren''s Corpse Spell Focus'),
+(@LANDGREN,0,2,3,61,0,100,0,0,0,0,0,90,7,0,0,0,0,0,1,0,0,0,0,0,0,0,'Archbishop Landgren - On health below 0.1% - Add unit field byte1 Death'),
+(@LANDGREN,0,3,0,61,0,100,0,0,0,0,0,20,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Archbishop Landgren - On Link - Forbid Attack'),
+(@LANDGREN,0,4,0,8,0,100,0,@SUMMON_GATE,0,0,0,45,0,1,0,0,0,0,20,@ARETE_GATE,20,0,0,0,0,0,'Archbishop Landgren - On spellhit Summon Arete''s Gate - Set data 0 1 Arete''s Gate'),
+(@LANDGREN,0,5,0,8,0,100,0,@SOUL_COAX,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Archbishop Landgren - On spellhit Soul Coax - Set event phase 1'),
+(@LANDGREN,0,6,7,23,1,100,1,@SOUL_COAX,0,0,0,11,@SOUL_MOVE,2,0,0,0,0,1,0,0,0,0,0,0,0,'Archbishop Landgren - On spellfade Soul Coax (phase 1) - Spellcast Summon Landgren''s Soul Moveto Target Bunny'),
+(@LANDGREN,0,7,8,61,1,100,0,0,0,0,0,11,@SUMMON_SOUL,2,0,0,0,0,1,0,0,0,0,0,0,0,'Archbishop Landgren - On spellfade Soul Coax (phase 1) - Spellcast Summon Landgren''s Soul'),
+(@LANDGREN,0,8,0,61,1,100,0,0,0,0,0,37,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Archbishop Landgren - On Link - Die'),
+(@LANDGREN,0,9,10,11,0,100,0,0,0,0,0,91,7,0,0,0,0,0,1,0,0,0,0,0,0,0,'Archbishop Landgren - On Respawn - Remove unit field byte1 Death'),
+(@LANDGREN,0,10,0,61,0,100,0,0,0,0,0,20,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Archbishop Landgren - On Respawn - Allow Attack'),
+
+
+(@ARETE,0,0,1,54,0,100,0,0,0,0,0,11,@ETHEREAL_TELEPORT,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lord-Commander Arete - Just summoned - Spellcast Ethereal Teleport'),
+(@ARETE,0,1,2,61,0,100,0,0,0,0,0,66,0,0,0,0,0,0,19,@LANDGREN,20,0,0,0,0,0,'Lord-Commander Arete - Just summoned - Turn to Archbishop Landgren'),
+(@ARETE,0,2,3,61,0,100,0,0,0,0,0,41,300000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lord-Commander Arete - On Link - Despawn after timer'),
+(@ARETE,0,3,0,61,0,100,0,0,0,0,0,80,@ARETE*100,2,0,0,0,0,1,0,0,0,0,0,0,0,'Lord-Commander Arete - Just summoned - Run script'),
+
+(@LANDGRENS_SOUL,0,0,0,54,0,100,0,0,0,0,0,80,@LANDGRENS_SOUL*100,2,0,0,0,0,1,0,0,0,0,0,0,0,'Landgren''s Soul - Just summoned - Run script'),
+
+
+(@ARETE_GATE,1,0,1,38,0,100,0,0,1,0,0,80,@ARETE_GATE*100,2,0,0,0,0,1,0,0,0,0,0,0,0,'Arete''s Gateway - On Data Set - Start Action Script'),
+(@ARETE_GATE,1,1,0,61,0,100,0,0,0,0,0,41,300000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Arete''s Gateway - On Link - Despawn after timer'),
+(@ARETE_GATE*100,9,0,0,0,0,100,0,4000,4000,0,0,11,@SUMMON_ARETE,0,0,0,0,0,1,0,0,0,0,0,0,0,'Arete''s Gateway - On Script - Spellcast Summon Arete'),
+
+(@ARETE*100,9,0,0,0,0,100,0,500,500,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lord-Commander Arete script - Say line'),
+(@ARETE*100,9,1,0,0,0,100,0,4000,4000,0,0,66,0,0,0,0,0,0,19,@LANDGREN,20,0,0,0,0,0,'Lord-Commander Arete script - Turn to Archbishop Landgren'),
+(@ARETE*100,9,2,0,0,0,100,0,1000,1000,0,0,11,@SOUL_COAX,0,0,0,0,0,19,@LANDGREN,20,0,0,0,0,0,'Lord-Commander Arete script - Spellcast Soul Coax'),
+(@ARETE*100,9,3,0,0,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lord-Commander Arete script - Say line'),
+(@ARETE*100,9,4,0,0,0,100,0,20000,20000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lord-Commander Arete script - Say line'),
+(@ARETE*100,9,5,0,0,0,100,0,7000,7000,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lord-Commander Arete script - Say line'),
+(@ARETE*100,9,6,0,0,0,100,0,4000,4000,0,0,11,27765,0,0,0,0,0,19,@LANDGRENS_SOUL,20,0,0,0,0,0,'Lord-Commander Arete script - Spellcast Soul Wrack'),
+(@ARETE*100,9,7,0,0,0,100,0,15000,15000,0,0,1,4,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lord-Commander Arete script - Say line'),
+(@ARETE*100,9,8,0,0,0,100,0,0,0,0,0,92,0,27765,1,0,0,0,1,0,0,0,0,0,0,0,'Lord-Commander Arete script - Interrupt spellcast'),
+(@ARETE*100,9,9,0,0,0,100,0,10000,10000,0,0,1,5,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lord-Commander Arete script - Say line'),
+(@ARETE*100,9,10,0,0,0,100,0,4000,4000,0,0,5,25,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lord-Commander Arete script - Play emote'),
+(@ARETE*100,9,11,0,0,0,100,0,4000,4000,0,0,11,@SOUL_WRACK,0,0,0,0,0,19,@LANDGRENS_SOUL,20,0,0,0,0,0,'Lord-Commander Arete script - Spellcast Soul Wrack'), -- 18
+(@ARETE*100,9,12,0,0,0,100,0,8000,8000,0,0,92,0,@SOUL_WRACK,1,0,0,0,1,0,0,0,0,0,0,0,'Lord-Commander Arete script - Interrupt spellcast'),
+(@ARETE*100,9,13,0,0,0,100,0,0,0,0,0,1,6,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lord-Commander Arete script - Say line'),
+(@ARETE*100,9,14,0,0,0,100,0,0,0,0,0,81,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lord-Commander Arete script - Set npcflag questgiver'),
+
+(@LANDGRENS_SOUL*100,9,0,0,0,0,100,0,500,500,0,0,66,0,0,0,0,0,0,19,@ARETE,20,0,0,0,0,0,'Landgren''s Soul script - Turn to Lord-Commander Arete'),
+(@LANDGRENS_SOUL*100,9,1,0,0,0,100,0,6000,6000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Landgren''s Soul script - Say line'),
+(@LANDGRENS_SOUL*100,9,2,0,0,0,100,0,10000,10000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Landgren''s Soul script - Say line'),
+(@LANDGRENS_SOUL*100,9,3,0,0,0,100,0,15000,15000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Landgren''s Soul script - Say line'),
+(@LANDGRENS_SOUL*100,9,4,0,0,0,100,0,10000,10000,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Landgren''s Soul script - Say line'),
+(@LANDGRENS_SOUL*100,9,5,0,0,0,100,0,16000,16000,0,0,1,4,0,0,0,0,0,1,0,0,0,0,0,0,0,'Landgren''s Soul script - Say line'),
+(@LANDGRENS_SOUL*100,9,6,0,0,0,100,0,5000,5000,0,0,11,@ARCANE_EXP,0,0,0,0,0,1,0,0,0,0,0,0,0,'Landgren''s Soul script - Spellcast Arcane Explosion Visual'),
+(@LANDGRENS_SOUL*100,9,7,0,0,0,100,0,1000,1000,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Landgren''s Soul script - Despawn');
diff --git a/sql/updates/world/2013_05_26_01_world_sai.sql b/sql/updates/world/2013_05_26_01_world_sai.sql
new file mode 100644
index 00000000000..0c70f665c27
--- /dev/null
+++ b/sql/updates/world/2013_05_26_01_world_sai.sql
@@ -0,0 +1,39 @@
+SET @THANE := 29919;
+SET @SPELL := 31696;
+SET @B_STRIKE := 58460;
+SET @REND := 16509;
+SET @P_SMASH := 60868;
+SET @EVENT := 19490;
+
+DELETE FROM `disables` WHERE `sourceType`=0 AND `entry` IN (@SPELL);
+INSERT INTO `disables`(`sourceType`,`entry`,`flags`,`comment`) VALUES
+(0,@SPELL,64,'Ignore LOS on Thane');
+
+DELETE FROM `event_scripts` WHERE `id`=@EVENT;
+INSERT INTO `event_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `dataint`, `x`, `y`, `z`, `o`) VALUES
+(@EVENT,0,15,53799,4,29919,30,0,0,0);
+
+DELETE FROM `creature_text` WHERE `entry` IN (@THANE);
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(@THANE,1,0, 'By order of Duke Lankral, Commander of the Knights of the Ebon Blade, Vanquisher of the Scourge and Conquerer of The Shadow Vault, you are hearby served notice to cease and desist from all activities providing materiel assistance, vrykul, and any other type of support to the Lich King. Failure to comply will result in your immediate destruction. My messenger will serve as the instrument of my will. What is your decision?',12,0,100,0,0,0,'Thane'),
+(@THANE,2,0, 'What is this?',14,0,100,0,0,0,'Thane'),
+(@THANE,3,0, 'My answer? Here''s my answer, little messenger!',14,0,100,0,0,0,'Thane'),
+(@THANE,4,0, 'I will feed you to the dogs!',14,0,100,0,0,0,'Thane');
+
+UPDATE `creature_template` SET AIName='SmartAI' WHERE entry = @THANE;
+DELETE FROM `smart_scripts` WHERE source_type=0 AND entryorguid = @THANE;
+DELETE FROM `smart_scripts` WHERE source_type=9 AND entryorguid = @THANE*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
+(@THANE,0,0,1,4,0,100,0,0,0,0,0,1,2,12000,0,0,0,0,1,0,0,0,0,0,0,0,'Thane - On spellhit - Say text2'),
+(@THANE,0,1,2,61,0,100,0,0,0,0,0,18,33685504,0,0,0,0,0,1,0,0,0,0,0,0,0,'Thane - On Link - Set Unit Flags'),
+(@THANE,0,2,0,61,0,100,0,0,0,0,0,84,1,0,0,0,0,0,7,0,0,0,0,0,0,0,'Thane - On Link - Make player say Text1'),
+(@THANE,0,3,0,52,0,100,0,2,@THANE,0,0,1,3,4000,0,0,0,0,1,0,0,0,0,0,0,0,'Thane - On Text2 over - Say Text3'),
+(@THANE,0,4,5,52,0,100,0,3,@THANE,0,0,1,4,4000,0,0,0,0,1,0,0,0,0,0,0,0,'Thane - On Text3 over - Say Text4'),
+(@THANE,0,5,0,61,0,100,0,0,0,0,0,19,33685504,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Thane - On Link - Remove unit flags'),
+(@THANE,0,6,0,0,0,100,0,4000,7000,4000,7000,11,@B_STRIKE,0,0,0,0,0,5,0,0,0,0,0,0,0,'Thane - In Combat - Cast Brutal Strike'),
+(@THANE,0,7,0,0,0,100,0,4000,15000,4000,15000,11,@REND,0,0,0,0,0,5,0,0,0,0,0,0,0,'Thane - In Combat - Cast Rend'),
+(@THANE,0,8,0,0,0,100,0,12000,25000,12000,25000,11,@P_SMASH,0,0,0,0,0,5,0,0,0,0,0,0,0,'Thane - In Combat - Cast Powerful Smash');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`= 13 AND `SourceEntry`=@SPELL;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(13,1,@SPELL,0,0,31,0,3,@THANE,0,0,0,'','Shadow Decree hits only Thane');
diff --git a/sql/updates/world/2013_05_26_02_world_sai.sql b/sql/updates/world/2013_05_26_02_world_sai.sql
new file mode 100644
index 00000000000..a30b6c8be43
--- /dev/null
+++ b/sql/updates/world/2013_05_26_02_world_sai.sql
@@ -0,0 +1,79 @@
+-- Not-So-Honorable Combat (13137)
+SET @GO_SIGNAL_FIRE := 193024; -- Battlescar Signal Fire
+SET @EVENT_SCRIPT := 20069; -- Event Script
+SET @NPC_POSSESSED_ISKALDER := 30924; -- Possessed Iskalder <The Ancient Hero>
+SET @NPC_VARDMADRA := 30945; -- Vadmadra
+SET @NPC_LADY_NIGHTSWOOD := 30955; -- Lady Nightswood
+SET @MOVE_TARGET_BUNNY := 25715; -- Not-So-Honorable Combat: Summon Lady Nightswood's Moveto Target Bunny
+SET @TARGET_BUNNY := 30959; -- Lady Nightswood's Moveto Target Bunny
+SET @SUMMON_NIGHTSWOOD := 25727; -- Not-So-Honorable Combat: Summon Lady Nightswood
+SET @POSSESS_VARDMADRA := 25745; -- Possession
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`= 13 AND `SourceEntry`IN (@SUMMON_NIGHTSWOOD,@MOVE_TARGET_BUNNY,@POSSESS_VARDMADRA);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(13,1,@SUMMON_NIGHTSWOOD,0,0,31,0,3,@TARGET_BUNNY,0,0,0,'','Summon Nightswood only hits Target Bunny'),
+(13,1,@MOVE_TARGET_BUNNY,0,0,31,0,3,@NPC_POSSESSED_ISKALDER,0,0,0,'','Move Target Bunny only hits Target Bunny'),
+(13,1,@POSSESS_VARDMADRA,0,0,31,0,3,@NPC_VARDMADRA,0,0,0,'','Possess Vardmadra only hits Vardmadra');
+
+UPDATE `creature_template` SET `AIName`='SmartAI',`faction_A`=2116,`faction_H`=2116,`unit_flags`=33088,`mindmg`=422,`maxdmg`=586,`attackpower`=642,`minrangedmg`=345,`maxrangedmg`=509,`rangedattackpower`=103 WHERE `entry`=@NPC_POSSESSED_ISKALDER;
+UPDATE `creature_template` SET `faction_A`=2116,`faction_H`=2116,`unit_flags`=33536,`AIName`='SmartAI',`minlevel`=80, `maxlevel`=80 WHERE `entry`=@NPC_VARDMADRA;
+UPDATE `creature_template` SET `AIName`='SmartAI', `InhabitType`=7 WHERE `entry` IN (@TARGET_BUNNY,@NPC_LADY_NIGHTSWOOD);
+UPDATE `creature_template` SET `modelid1`=11686, `modelid2`=0 WHERE `entry`=@TARGET_BUNNY;
+DELETE FROM `creature_template_addon` WHERE `entry` IN (@NPC_POSSESSED_ISKALDER,@NPC_VARDMADRA);
+INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`auras`) VALUES
+(@NPC_POSSESSED_ISKALDER,0,0x0,0x1,'58102'),
+(@NPC_VARDMADRA,0,0x3000000,0x1,'');
+
+DELETE FROM `creature_equip_template` WHERE `entry`=@NPC_POSSESSED_ISKALDER;
+INSERT INTO `creature_equip_template` (`entry`,`itemEntry1`,`itemEntry2`,`itemEntry3`) VALUES
+(@NPC_POSSESSED_ISKALDER,43296,43295,0);
+
+DELETE FROM `creature_text` WHERE `entry` IN (@NPC_POSSESSED_ISKALDER,@NPC_VARDMADRA,@NPC_LADY_NIGHTSWOOD);
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(@NPC_POSSESSED_ISKALDER,0,0,'Now fight me, $N! Kill Iskalder!',14,0,100,0,0,1167,'Possessed Iskalder'),
+(@NPC_VARDMADRA,0,0, 'Iskalder, there you are. What is this? Engaged in battle already?',14,0,100,457,0,13824,'Vardmadra'),
+(@NPC_VARDMADRA,1,0, 'NO! How is this possible?',14,0,100,457,0,13825,'Vardmadra'),
+(@NPC_VARDMADRA,2,0, 'I know not how this was possible, but you must still be judged Iskalder. Wait... what is this?',14,0,100,457,0,13824,'Vardmadra'),
+(@NPC_VARDMADRA,3,0, 'Stay away from me creature! Do not touch me!',14,0,100,0,0,1168,'Vardmadra to Nightswood'),
+(@NPC_VARDMADRA,4,0, 'Ahahahahahaha! It is done. Return to my cave. We have much to discuss!',14,0,100,457,0,1167,'Vardmadra to '),
+(@NPC_LADY_NIGHTSWOOD,0,0, 'This? This is me taking control of you. This is me setting up my final revenge!',14,0,100,457,0,13824,'Lady Nightswood');
+
+-- Possessed Iskalder <The Ancient Hero>
+DELETE FROM `event_scripts` WHERE `id`=@EVENT_SCRIPT;
+INSERT INTO `event_scripts` (`id`,`delay`,`command`,`datalong`,`datalong2`,`dataint`,`x`,`y`,`z`,`o`) VALUES
+(@EVENT_SCRIPT,5,10,@NPC_POSSESSED_ISKALDER,180000,0,7229.436,3642.27,809.0175,0);
+
+DELETE FROM `smart_scripts` WHERE `source_type` IN (0,9) AND `entryorguid` IN (@NPC_POSSESSED_ISKALDER,@NPC_VARDMADRA,@NPC_LADY_NIGHTSWOOD,@TARGET_BUNNY,@TARGET_BUNNY*100);
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@NPC_POSSESSED_ISKALDER,0,0,1,54,0,100,0,0,0,0,0,19,256,0,0,0,0,0,1,0,0,0,0,0,0,0,'Iskalder - On Summon - Remove unit flag'),
+(@NPC_POSSESSED_ISKALDER,0,1,0,61,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Iskalder - On Link - Talk'),
+(@NPC_POSSESSED_ISKALDER,0,2,0,2,0,100,1,0,65,0,0,12,@NPC_VARDMADRA,3,180000,0,0,0,8,0,0,0,7182.766602,3661.931885, 826.149292, 5.838641, 'Possessed Iskalder - on 65% HP - Spawn Vardmara'),
+(@NPC_POSSESSED_ISKALDER,0,3,0,4,0,100,1,0,0,0,0,11,60108,0,0,0,0,0,2,0,0,0,0,0,0,0,'Iskalder - On Aggro - Cast Heroic Leap'),
+(@NPC_POSSESSED_ISKALDER,0,4,0,0,0,100,0,3500,3500,14500,16700,11,15496,0,0,0,0,0,2,0,0,0,0,0,0,0,'Iskalder - In Combat - Cast Cleave'),
+(@NPC_POSSESSED_ISKALDER,0,5,0,0,0,100,0,5000,6000,11200,15800,11,57846,0,0,0,0,0,2,0,0,0,0,0,0,0,'Iskalder - In Combat - Cast Heroic Strike'),
+(@NPC_POSSESSED_ISKALDER,0,6,0,0,0,100,0,9000,11000,25000,25000,11,60121,0,0,0,0,0,1,0,0,0,0,0,0,0,'Iskalder - In Combat - Cast Ancient Curse'),
+(@NPC_POSSESSED_ISKALDER,0,7,0,2,0,100,1,0,50,0,0,1,0,0,0,0,0,0,11,@NPC_VARDMADRA,200,0,0,0,0,0,'Iskalder - On HPC - Make Vardmadra Say'),
+(@NPC_POSSESSED_ISKALDER,0,8,0,6,0,100,1,0,0,0,0,45,1,1,0,0,0,0,11,@NPC_VARDMADRA,200,0,0,0,0,0,' Iskalder - On event death - Send Data to Vardmadra'),
+(@NPC_POSSESSED_ISKALDER,0,9,10,1,0,100,1,0,0,0,0,19,256,0,0,0,0,0,1,0,0,0,0,0,0,0,'Iskalder - OOC - Remove unit flag'),
+(@NPC_POSSESSED_ISKALDER,0,10,0,61,0,100,1,0,0,0,0,45,2,2,0,0,0,0,11,@NPC_VARDMADRA,300,0,0,0,0,0, 'Possessed Iskalder - On link - Set Data on Vardmara'),
+
+(@NPC_VARDMADRA,0,0,1,38,0,100,0,1,1,0,0,59,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Vardmadra - On Receive Data - Set Run'),
+(@NPC_VARDMADRA,0,1,2,61,0,100,0,1,1,0,0,69,0,0,0,0,0,0,8,0,0,0,7234.742,3643.584,811.8065,5.507,'Vardmadra - Linked with Previous Event - Move to position'),
+(@NPC_VARDMADRA,0,2,3,61,0,100,0,0,0,0,0,1,1,10000,0,0,0,0,1,0,0,0,0,0,0,0,'Vardmadra - Linked with Previous Event - Say'),
+(@NPC_VARDMADRA,0,3,4,61,0,100,1,0,0,0,0,11,@MOVE_TARGET_BUNNY,2,0,0,0,0,19,@NPC_POSSESSED_ISKALDER,200,1,0,0,0,0,'Vardmadra - Linked with Previous Event - Cast Not-So-Honorable Combat: Summon Lady Nightswood''s Moveto Target Bunny'),
+(@NPC_VARDMADRA,0,4,5,52,0,100,0,1,@NPC_VARDMADRA,0,0,1,2,10000,0,0,0,0,1,0,0,0,0,0,0,0,'Vardmadra - On Text Over - Say'),
+(@NPC_VARDMADRA,0,5,0,61,0,100,0,0,0,0,0,66,0,0,0,0,0,0,19,@NPC_POSSESSED_ISKALDER,200,1,0,0,0,0,'Vardmadra - On Link - Turn to Iskalder'),
+(@NPC_VARDMADRA,0,6,7,52,0,100,0,2,@NPC_VARDMADRA,0,0,1,0,10000,0,0,0,0,11,@NPC_LADY_NIGHTSWOOD,200,0,0,0,0,0,'Vardmadra - On Text Over - Say'),
+(@NPC_VARDMADRA,0,7,8,61,0,100,0,0,0,0,0,66,0,0,0,0,0,0,19,@NPC_LADY_NIGHTSWOOD,200,0,0,0,0,0,'Vardmadra - On Link - Turn to Lady Nightswood'),
+(@NPC_VARDMADRA,0,8,0,61,0,100,0,0,0,0,0,45,1,1,0,0,0,0,11,@NPC_LADY_NIGHTSWOOD,200,0,0,0,0,0,'Vardmadra - On link - Send Data to Lady Nightswood'),
+(@NPC_VARDMADRA,0,9,0,52,0,100,0,0,@NPC_LADY_NIGHTSWOOD,0,0,1,3,10000,0,0,0,0,1,0,0,0,0,0,0,0,'Vardmadra - On Text Over - Say'),
+(@NPC_VARDMADRA,0,10,0,52,0,100,0,3,@NPC_VARDMADRA,0,0,1,4,10000,0,0,0,0,1,0,0,0,0,0,0,0,'Vardmadra- On Text Over - Say'),
+(@NPC_VARDMADRA,0,11,0,52,0,100,0,4,@NPC_VARDMADRA,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Vardmadra - On Text Over - Despawn'),
+(@NPC_VARDMADRA,0,12,0,38,0,100,0,2,2,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Vardmadra - On Receive Data - Despawn'),
+
+(@TARGET_BUNNY,0,0,0,54,0,100,0,0,0,0,0,80,@TARGET_BUNNY*100,2,0,0,0,0,1,0,0,0,0,0,0,0,'Lady Nightswood Move-to-Bunny - On Summon - Start Timed Script'),
+(@TARGET_BUNNY*100,9,0,0,0,0,100,0,7000,7000,7000,7000,69,0,0,0,0,0,0,8,0,0,0,7242.77,3631.67,814.0644,2.227,'Lady Nightswood Move-to-Bunny - On Script - Go to position'),
+(@TARGET_BUNNY*100,9,1,0,0,0,100,0,8000,8000,8000,8000,11,@SUMMON_NIGHTSWOOD,2,0,0,0,0,1,0,0,0,0,0,0,0,'Lady Nightswood Move-to-Bunny - Linked with Previous Event - Cast Not-So-Honorable Combat: Summon Lady Nightswood''s Moveto Target Bunny'),
+
+(@NPC_LADY_NIGHTSWOOD,0,0,0,54,0,100,0,0,0,0,0,66,0,0,0,0,0,0,19,@NPC_VARDMADRA,200,0,0,0,0,0,'Lady Nightswood - On Summon - Turn to Vardmadra'),
+(@NPC_LADY_NIGHTSWOOD,0,1,0,38,0,100,0,1,1,0,0,11,@POSSESS_VARDMADRA,0,0,0,0,0,19,@NPC_VARDMADRA,200,0,0,0,0,0,'Lady Nigtswood - On Receive Data - Possess Vardmadra');
diff --git a/sql/updates/world/2013_05_26_03_world_sai.sql b/sql/updates/world/2013_05_26_03_world_sai.sql
new file mode 100644
index 00000000000..6a3225266e7
--- /dev/null
+++ b/sql/updates/world/2013_05_26_03_world_sai.sql
@@ -0,0 +1,5 @@
+SET @SUMMON_ARETE := 18280; -- LC Arete Summon Spell
+SET @ARETE_GATE := 191579; -- Arete Gateway Object
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ARETE_GATE*100 AND `source_type`=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
+(@ARETE_GATE*100,9,0,0,0,0,100,0,4000,4000,0,0,11,@SUMMON_ARETE,0,0,0,0,0,1,0,0,0,0,0,0,0,'Arete''s Gateway - On Script - Spellcast Summon Arete');
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index 576d77a2e24..9d182ee6885 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -657,9 +657,18 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
if (IsUnit(*itr))
{
- (*itr)->ToUnit()->SetFlag(UNIT_FIELD_FLAGS, e.action.unitFlag.flag);
- TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_UNIT_FLAG. Unit %u added flag %u to UNIT_FIELD_FLAGS",
+ if (!e.action.unitFlag.type)
+ {
+ (*itr)->ToUnit()->SetFlag(UNIT_FIELD_FLAGS, e.action.unitFlag.flag);
+ TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_UNIT_FLAG. Unit %u added flag %u to UNIT_FIELD_FLAGS",
+ (*itr)->GetGUIDLow(), e.action.unitFlag.flag);
+ }
+ else
+ {
+ (*itr)->ToUnit()->SetFlag(UNIT_FIELD_FLAGS_2, e.action.unitFlag.flag);
+ TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_UNIT_FLAG. Unit %u added flag %u to UNIT_FIELD_FLAGS_2",
(*itr)->GetGUIDLow(), e.action.unitFlag.flag);
+ }
}
}
@@ -676,9 +685,18 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
if (IsUnit(*itr))
{
- (*itr)->ToUnit()->RemoveFlag(UNIT_FIELD_FLAGS, e.action.unitFlag.flag);
- TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_REMOVE_UNIT_FLAG. Unit %u removed flag %u to UNIT_FIELD_FLAGS",
+ if (!e.action.unitFlag.type)
+ {
+ (*itr)->ToUnit()->RemoveFlag(UNIT_FIELD_FLAGS, e.action.unitFlag.flag);
+ TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_REMOVE_UNIT_FLAG. Unit %u removed flag %u to UNIT_FIELD_FLAGS",
+ (*itr)->GetGUIDLow(), e.action.unitFlag.flag);
+ }
+ else
+ {
+ (*itr)->ToUnit()->RemoveFlag(UNIT_FIELD_FLAGS_2, e.action.unitFlag.flag);
+ TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_REMOVE_UNIT_FLAG. Unit %u removed flag %u to UNIT_FIELD_FLAGS_2",
(*itr)->GetGUIDLow(), e.action.unitFlag.flag);
+ }
}
}
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
index 33e458976f1..2fcee55ed14 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
@@ -827,6 +827,7 @@ struct SmartAction
struct
{
uint32 flag;
+ uint32 type;
} unitFlag;
struct
diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp
index e1ca398c7f3..d87e1e8fbbc 100644
--- a/src/server/game/Entities/Item/Item.cpp
+++ b/src/server/game/Entities/Item/Item.cpp
@@ -877,16 +877,26 @@ bool Item::IsFitToSpellRequirements(SpellInfo const* spellInfo) const
return true;
}
-void Item::SetEnchantment(EnchantmentSlot slot, uint32 id, uint32 duration, uint32 charges)
+void Item::SetEnchantment(EnchantmentSlot slot, uint32 id, uint32 duration, uint32 charges, uint64 caster /*= 0*/)
{
// Better lost small time at check in comparison lost time at item save to DB.
if ((GetEnchantmentId(slot) == id) && (GetEnchantmentDuration(slot) == duration) && (GetEnchantmentCharges(slot) == charges))
return;
+ Player* owner = GetOwner();
+ if (slot < MAX_INSPECTED_ENCHANTMENT_SLOT)
+ {
+ if (uint32 oldEnchant = GetEnchantmentId(slot))
+ owner->GetSession()->SendEnchantmentLog(GetOwnerGUID(), 0, GetEntry(), oldEnchant);
+
+ if (id)
+ owner->GetSession()->SendEnchantmentLog(GetOwnerGUID(), caster, GetEntry(), id);
+ }
+
SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_ID_OFFSET, id);
SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_DURATION_OFFSET, duration);
SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_CHARGES_OFFSET, charges);
- SetState(ITEM_CHANGED, GetOwner());
+ SetState(ITEM_CHANGED, owner);
}
void Item::SetEnchantmentDuration(EnchantmentSlot slot, uint32 duration, Player* owner)
@@ -1003,6 +1013,16 @@ bool Item::IsLimitedToAnotherMapOrZone(uint32 cur_mapId, uint32 cur_zoneId) cons
return proto && ((proto->Map && proto->Map != cur_mapId) || (proto->Area && proto->Area != cur_zoneId));
}
+void Item::SendUpdateSockets()
+{
+ WorldPacket data(SMSG_SOCKET_GEMS_RESULT, 8+4+4+4+4);
+ data << uint64(GetGUID());
+ for (uint32 i = SOCK_ENCHANTMENT_SLOT; i <= BONUS_ENCHANTMENT_SLOT; ++i)
+ data << uint32(GetEnchantmentId(EnchantmentSlot(i)));
+
+ GetOwner()->GetSession()->SendPacket(&data);
+}
+
// Though the client has the information in the item's data field,
// we have to send SMSG_ITEM_TIME_UPDATE to display the remaining
// time.
diff --git a/src/server/game/Entities/Item/Item.h b/src/server/game/Entities/Item/Item.h
index 0d34305d15c..b18dfe694d6 100644
--- a/src/server/game/Entities/Item/Item.h
+++ b/src/server/game/Entities/Item/Item.h
@@ -289,7 +289,7 @@ class Item : public Object
void SetItemRandomProperties(int32 randomPropId);
void UpdateItemSuffixFactor();
static int32 GenerateItemRandomPropertyId(uint32 item_id);
- void SetEnchantment(EnchantmentSlot slot, uint32 id, uint32 duration, uint32 charges);
+ void SetEnchantment(EnchantmentSlot slot, uint32 id, uint32 duration, uint32 charges, uint64 caster = 0);
void SetEnchantmentDuration(EnchantmentSlot slot, uint32 duration, Player* owner);
void SetEnchantmentCharges(EnchantmentSlot slot, uint32 charges);
void ClearEnchantment(EnchantmentSlot slot);
@@ -300,6 +300,8 @@ class Item : public Object
std::string const& GetText() const { return m_text; }
void SetText(std::string const& text) { m_text = text; }
+ void SendUpdateSockets();
+
void SendTimeUpdate(Player* owner);
void UpdateDuration(Player* owner, uint32 diff);
diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp
index e1a9dd27450..13f1988f050 100644
--- a/src/server/game/Handlers/ItemHandler.cpp
+++ b/src/server/game/Handlers/ItemHandler.cpp
@@ -1007,15 +1007,14 @@ void WorldSession::HandleSetAmmoOpcode(WorldPacket& recvData)
GetPlayer()->SetAmmo(item);
}
-void WorldSession::SendEnchantmentLog(uint64 Target, uint64 Caster, uint32 ItemID, uint32 SpellID)
+void WorldSession::SendEnchantmentLog(uint64 target, uint64 caster, uint32 itemId, uint32 enchantId)
{
- WorldPacket data(SMSG_ENCHANTMENTLOG, (8+8+4+4+1)); // last check 2.0.10
- data << uint64(Target);
- data << uint64(Caster);
- data << uint32(ItemID);
- data << uint32(SpellID);
- data << uint8(0);
- SendPacket(&data);
+ WorldPacket data(SMSG_ENCHANTMENTLOG, (8+8+4+4)); // last check 2.0.10
+ data.appendPackGUID(target);
+ data.appendPackGUID(caster);
+ data << uint32(itemId);
+ data << uint32(enchantId);
+ GetPlayer()->SendMessageToSet(&data, true);
}
void WorldSession::SendItemEnchantTimeUpdate(uint64 Playerguid, uint64 Itemguid, uint32 slot, uint32 Duration)
@@ -1334,7 +1333,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recvData)
{
if (GemEnchants[i])
{
- itemTarget->SetEnchantment(EnchantmentSlot(SOCK_ENCHANTMENT_SLOT+i), GemEnchants[i], 0, 0);
+ itemTarget->SetEnchantment(EnchantmentSlot(SOCK_ENCHANTMENT_SLOT+i), GemEnchants[i], 0, 0, _player->GetGUID());
if (Item* guidItem = _player->GetItemByGuid(gem_guids[i]))
_player->DestroyItem(guidItem->GetBagSlot(), guidItem->GetSlot(), true);
}
@@ -1347,7 +1346,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recvData)
if (SocketBonusActivated ^ SocketBonusToBeActivated) //if there was a change...
{
_player->ApplyEnchantment(itemTarget, BONUS_ENCHANTMENT_SLOT, false);
- itemTarget->SetEnchantment(BONUS_ENCHANTMENT_SLOT, (SocketBonusToBeActivated ? itemTarget->GetTemplate()->socketBonus : 0), 0, 0);
+ itemTarget->SetEnchantment(BONUS_ENCHANTMENT_SLOT, (SocketBonusToBeActivated ? itemTarget->GetTemplate()->socketBonus : 0), 0, 0, _player->GetGUID());
_player->ApplyEnchantment(itemTarget, BONUS_ENCHANTMENT_SLOT, true);
//it is not displayed, client has an inbuilt system to determine if the bonus is activated
}
@@ -1356,6 +1355,8 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recvData)
_player->RemoveTradeableItem(itemTarget);
itemTarget->ClearSoulboundTradeable(_player); // clear tradeable flag
+
+ itemTarget->SendUpdateSockets();
}
void WorldSession::HandleCancelTempEnchantmentOpcode(WorldPacket& recvData)
diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp
index 4e4ec1350cb..43a0b083b91 100644
--- a/src/server/game/Handlers/QuestHandler.cpp
+++ b/src/server/game/Handlers/QuestHandler.cpp
@@ -580,7 +580,7 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket)
continue;
}
- player->PlayerTalkClass->SendQuestGiverQuestDetails(quest, player->GetGUID(), true);
+ player->PlayerTalkClass->SendQuestGiverQuestDetails(quest, _player->GetGUID(), true);
player->SetDivider(_player->GetGUID());
}
}
diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp
index 7237d5f74f7..065b80cb08f 100644
--- a/src/server/game/Server/Protocol/Opcodes.cpp
+++ b/src/server/game/Server/Protocol/Opcodes.cpp
@@ -1317,7 +1317,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] =
/*0x508*/ { "CMSG_SET_ALLOW_LOW_LEVEL_RAID1", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL },
/*0x509*/ { "CMSG_SET_ALLOW_LOW_LEVEL_RAID2", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL },
/*0x50A*/ { "SMSG_CAMERA_SHAKE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
- /*0x50B*/ { "SMSG_UPDATE_ITEM_ENCHANTMENTS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
+ /*0x50B*/ { "SMSG_SOCKET_GEMS_RESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
/*0x50C*/ { "CMSG_SET_CHARACTER_MODEL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL },
/*0x50D*/ { "SMSG_REDIRECT_CLIENT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
/*0x50E*/ { "CMSG_REDIRECTION_FAILED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL },
diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h
index 30c5b1dcdf4..254f9fe5350 100644
--- a/src/server/game/Server/Protocol/Opcodes.h
+++ b/src/server/game/Server/Protocol/Opcodes.h
@@ -1325,7 +1325,7 @@ enum Opcodes
CMSG_SET_ALLOW_LOW_LEVEL_RAID1 = 0x508,
CMSG_SET_ALLOW_LOW_LEVEL_RAID2 = 0x509,
SMSG_CAMERA_SHAKE = 0x50A, // uint32 SpellEffectCameraShakes.dbc index, uint32
- SMSG_UPDATE_ITEM_ENCHANTMENTS = 0x50B, // some item update packet?
+ SMSG_SOCKET_GEMS_RESULT = 0x50B,
CMSG_SET_CHARACTER_MODEL = 0x50C,
SMSG_REDIRECT_CLIENT = 0x50D, // uint32 ip, uint16 port, uint32 unk, uint8[20] hash (ip + port, seed=sessionkey)
CMSG_REDIRECTION_FAILED = 0x50E, // something with networking
diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h
index b714cd71e6d..bf79b34822d 100644
--- a/src/server/game/Server/WorldSession.h
+++ b/src/server/game/Server/WorldSession.h
@@ -322,7 +322,7 @@ class WorldSession
void SendAuctionOwnerNotification(AuctionEntry* auction);
//Item Enchantment
- void SendEnchantmentLog(uint64 Target, uint64 Caster, uint32 ItemID, uint32 SpellID);
+ void SendEnchantmentLog(uint64 target, uint64 caster, uint32 itemId, uint32 enchantId);
void SendItemEnchantTimeUpdate(uint64 Playerguid, uint64 Itemguid, uint32 slot, uint32 Duration);
//Taxi
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index db6263a8062..64a538dce86 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -2771,7 +2771,7 @@ void Spell::EffectEnchantItemPerm(SpellEffIndex effIndex)
// remove old enchanting before applying new if equipped
item_owner->ApplyEnchantment(itemTarget, PERM_ENCHANTMENT_SLOT, false);
- itemTarget->SetEnchantment(PERM_ENCHANTMENT_SLOT, enchant_id, 0, 0);
+ itemTarget->SetEnchantment(PERM_ENCHANTMENT_SLOT, enchant_id, 0, 0, m_caster->GetGUID());
// add new enchanting if equipped
item_owner->ApplyEnchantment(itemTarget, PERM_ENCHANTMENT_SLOT, true);
@@ -2836,7 +2836,7 @@ void Spell::EffectEnchantItemPrismatic(SpellEffIndex effIndex)
// remove old enchanting before applying new if equipped
item_owner->ApplyEnchantment(itemTarget, PRISMATIC_ENCHANTMENT_SLOT, false);
- itemTarget->SetEnchantment(PRISMATIC_ENCHANTMENT_SLOT, enchant_id, 0, 0);
+ itemTarget->SetEnchantment(PRISMATIC_ENCHANTMENT_SLOT, enchant_id, 0, 0, m_caster->GetGUID());
// add new enchanting if equipped
item_owner->ApplyEnchantment(itemTarget, PRISMATIC_ENCHANTMENT_SLOT, true);
@@ -2970,7 +2970,7 @@ void Spell::EffectEnchantItemTmp(SpellEffIndex effIndex)
// remove old enchanting before applying new if equipped
item_owner->ApplyEnchantment(itemTarget, TEMP_ENCHANTMENT_SLOT, false);
- itemTarget->SetEnchantment(TEMP_ENCHANTMENT_SLOT, enchant_id, duration * 1000, 0);
+ itemTarget->SetEnchantment(TEMP_ENCHANTMENT_SLOT, enchant_id, duration * 1000, 0, m_caster->GetGUID());
// add new enchanting if equipped
item_owner->ApplyEnchantment(itemTarget, TEMP_ENCHANTMENT_SLOT, true);
@@ -4521,7 +4521,7 @@ void Spell::EffectEnchantHeldItem(SpellEffIndex effIndex)
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
- Player* item_owner = (Player*)unitTarget;
+ Player* item_owner = unitTarget->ToPlayer();
Item* item = item_owner->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
if (!item)
@@ -4552,7 +4552,7 @@ void Spell::EffectEnchantHeldItem(SpellEffIndex effIndex)
return;
// Apply the temporary enchantment
- item->SetEnchantment(slot, enchant_id, duration*IN_MILLISECONDS, 0);
+ item->SetEnchantment(slot, enchant_id, duration*IN_MILLISECONDS, 0, m_caster->GetGUID());
item_owner->ApplyEnchantment(item, slot, true);
}
}