TrinityCore icon indicating copy to clipboard operation
TrinityCore copied to clipboard

Spell Targeting using position for summons (SAI)

Open dr-j opened this issue 12 years ago • 12 comments

There are some spells with sniffed target positions which are used to summon creatures but when cast only summons on self regardless of target

Ie

DELETE FROM `creature_text` WHERE `entry` IN(28479,28514,28515,28516,28517);
INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES
(28479, 0, 0, 'Gods of old, we beseech you. What must we do? How can we save the gods of this land?', 15, 0, 100, 6, 0, 0, 'Witch Doctor Khufu'),
(28514, 0, 0, 'But try they must or all will be lost. The Drakkari will be the death of both themselves and their gods!', 12, 0, 100, 0, 0, 473, 'Nalorakk'),
(28515, 0, 0, 'The spotted one must be sought. Their fates are entwined.', 12, 0, 100, 0, 0, 9919, 'Jan''alai'),
(28516, 0, 0, 'But she is chained. A way must be found to free her.', 12, 0, 100, 0, 0, 12196, 'Akil''zon'),
(28517, 0, 0, 'To her altar this mortal must travel. What they must do will not be easy. In the end it may prove impossible.', 12, 0, 100, 0, 0, 643, 'Halazzi');


-- (29024, 0, 0, 'The unblemished heart of the guardian must be secured to show defiance and strength. Jealous Zim''Rhuk keeps those who harbor it.', 12, 0, 100, 0, 0, 473, 'Nalorakk'),
-- (29022, 0, 0, 'Once more we hear your call, Khufu. We have wisdom for you and $n. You face great peril and must act swiftly or you all and Har''koa will die.', 12, 0, 100, 0, 0, 643, 'Halazzi'),
-- (29023, 0, 0, 'The gusty essence of deceased Quetz''lun''s wardens must be gathered to draw him near. To Har''koa must both of these rarities be delivered.', 12, 0, 100, 0, 0, 9919, 'Jan''alai');


UPDATE `creature_template` SET `ainame`='SmartAI', `scriptname`='' WHERE `entry` =28479;
DELETE FROM `smart_scripts` WHERE `entryorguid` =28479 AND `source_type`=0 AND `id`>5;
DELETE FROM `smart_scripts` WHERE `entryorguid` =2847900 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
(28479, 0, 6, 7, 20, 0, 100, 0, 12627, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Witch Doctor Khufu - On Quest Reward (Breaking Through Jin''Alai) - Say'), 
(28479, 0, 7, 0, 61, 0, 100, 0, 0, 0, 0, 0, 80, 2847900, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Witch Doctor Khufu - On Quest Reward (Breaking Through Jin''Alai) - Run Script'), 
(2847900, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Witch Doctor Khufu - Script - Set NPC Flags'), 
(2847900, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 51861, 0, 0, 0, 0, 0, 8, 0, 0, 0, 5731.183, -3564.148, 392.6102, 5.852268, 'Witch Doctor Khufu - Script - Cast Breaking Through Jin Alai: Summon Akil zon'), 
(2847900, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 52452, 0, 0, 0, 0, 0, 8, 0, 0, 0, 5736.573, -3580.068, 386.9349, 1.711507, 'Witch Doctor Khufu - Script - Cast Breaking Through Jin alai: Summon Jan Alai'), 
(2847900, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 52453, 0, 0, 0, 0, 0, 8, 0, 0, 0, 5740.701, -3584.477, 386.6601, 1.917363, 'Witch Doctor Khufu - Script - Cast Breaking Through Jin Alai: Summon Halazzi'), 
(2847900, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 52454, 0, 0, 0, 0, 0, 8, 0, 0, 0, 5737.002, -3563.429, 387.6779, 4.32643, 'Witch Doctor Khufu - Script - Cast Breaking Through Jin Alai: Summon Nalorakk'), 
(2847900, 9, 5, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 28515, 0, 0, 0, 0, 0, 0, 'Witch Doctor Khufu - Script - Say Line (Jan alai)'), 
(2847900, 9, 6, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 28516, 0, 0, 0, 0, 0, 0, 'Witch Doctor Khufu - Script - Say Line (Akil zon)'), 
(2847900, 9, 7, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 28517, 0, 0, 0, 0, 0, 0, 'Witch Doctor Khufu - Script - Say Line (Halazzi)'), 
(2847900, 9, 8, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 28514, 0, 0, 0, 0, 0, 0, 'Witch Doctor Khufu - Script - Say Line (Nalorakk)'), 
(2847900, 9, 9, 0, 0, 0, 100, 0, 20000, 20000, 0, 0, 81, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Witch Doctor Khufu - Script - Set NPC Flags'); 

This script fails to summon anything when target position is used, if you change the target type to 1 they summon but all at caster position, the target positions are from sniff of ie

ServerToClient: SMSG_SPELL_GO (0x09D8) Length: 64 ConnectionIndex: 2 Time: 08/20/2014 16:49:48.656 Number: 184005 Target Flags: DestinationLocation (64) Int50: -195886910 Position: X: 5737.002 Y: -3563.429 Z: 387.6779 DestLocationTargetGUID: 0x0 Cast Flags: Unknown3, Unknown7, Unknown8 (776) Byte1A0: 55 CastCount: 0 Spell ID: 52454

and orientation from

[34] Orientation: 5.274293 [34] Walk Speed: 2.5 [34] Fly Back Speed: 4.5 [34] Run Back Speed: 2.5 [34] Run Speed: 8 [34] Swim Back Speed: 4.72222 [34] Position: X: 5737.002 Y: -3563.429 Z: 387.586 [34] OBJECT_FIELD_GUID: 1164221/1.631421E-39 [34] 1: 4046483298/-8.736642E+29 [34] OBJECT_FIELD_DATA: 40084080/1.672394E-37 [34] 3: 536150016/1.037615E-19 [34] OBJECT_FIELD_TYPE: 65545/9.184811E-41 [34] OBJECT_FIELD_ENTRY: 28514/3.995662E-41

I would like to know if there was any chance that it could be made so spell_target_position can be used to specify target positions for summons or those that are meant to be cast at a specific location rather than invoker/unit, etc

dr-j avatar Aug 22 '14 14:08 dr-j

For the 4.3.4 there are many spells like 88559, 88560, 88562, they spawn npcs in th correct Position (from sniff) even if the target type used is 1. Maybe 51861, 52452, ect, must be scripted like those one. You have to add the spell in spell_target_position with the position.

Killyana avatar Aug 22 '14 14:08 Killyana

I tried that already

dr-j avatar Aug 22 '14 18:08 dr-j

spells 51861, 52452, 52453, 52454 need impl spell target conditions to work, i think the spell should hit a trigger, you will not find this trigger in any spell packet, you have to search a spawn on the same coords as the dest on your spell packet

joschiwald avatar Aug 23 '14 01:08 joschiwald

You may want to take my script which has been pushed quite some time ago as a template.

SET @NPC_ELM_BUNNY := 23837;
SET @NPC_HARKOA := 28401;
SET @NPC_KHUFU := 28479;
SET @NPC_AKILZON := 29021;
SET @NPC_HALAZZI := 29022;
SET @NPC_JANALAI := 29023;
SET @NPC_NALORAKK := 29024;
DELETE FROM `creature_text` WHERE `entry`=@NPC_HARKOA AND `groupid`=1;
DELETE FROM `creature_text` WHERE `entry` IN (@NPC_AKILZON,@NPC_HALAZZI,@NPC_JANALAI,@NPC_NALORAKK);
INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
(@NPC_HARKOA,1,0,'No, not Akali too!',15,0,100,0,0,0,'Har''koa'),
(@NPC_AKILZON,0,0,'And yet we see only doom in your future. It is your destiny that you do this, $N, but we fear that the prophet is too powerful for you and your friends. Still, you must try.',12,0,100,0,0,12196,'Akil''zon'),
(@NPC_HALAZZI,0,0,'Once more we hear your call, Khufu. We have wisdom for you and $N. You face great peril and must act swiftly or you all and Har''koa will die.',12,0,100,0,0,643,'Halazzi'),
(@NPC_JANALAI,0,0,'The gusty essence of deceased Quetz''lun''s wardens must be gathered to draw him near. To Har''koa must both of these rarities be delivered.',12,0,100,0,0,9919,'Jana''lai'),
(@NPC_NALORAKK,0,0,'The unblemished heart of the guardian must be secured to show defiance and strength. Jealous Zim''Rhuk keeps those who harbor it.',12,0,100,0,0,473,'Nalorakk');
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (52934,52935,52936,52937);
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(13,1,52934,0,0,31,0,3,@NPC_ELM_BUNNY,0,0,0,'','Spell Rampage: Summon Akil''zon targets ELM General Purpose Bunny'),
(13,1,52934,0,0,29,0,28527,10,0,1,0,'','Spell Rampage: Summon Akil''zon target needs to be 35y from Chronicler To''kini'),
(13,1,52934,0,0,29,0,28527,15,0,1,0,'','Spell Rampage: Summon Akil''zon target needs to be 35y from Chronicler To''kini'),
(13,1,52934,0,0,29,0,28527,30,0,1,0,'','Spell Rampage: Summon Akil''zon target needs to be 35y from Chronicler To''kini'),
(13,1,52934,0,0,29,0,28527,35,0,0,0,'','Spell Rampage: Summon Akil''zon target needs to be 35y from Chronicler To''kini'),
(13,1,52935,0,0,31,0,3,@NPC_ELM_BUNNY,0,0,0,'','Spell Rampage: Summon Akil''zon targets ELM General Purpose Bunny'),
(13,1,52935,0,0,29,0,28527,10,0,0,0,'','Spell Rampage: Summon Akil''zon target needs to be 10y from Chronicler To''kini'),
(13,1,52936,0,0,31,0,3,@NPC_ELM_BUNNY,0,0,0,'','Spell Rampage: Summon Akil''zon targets ELM General Purpose Bunny'),
(13,1,52936,0,0,29,0,28527,10,0,1,0,'','Spell Rampage: Summon Akil''zon target needs to be 15y from Chronicler To''kini'),
(13,1,52936,0,0,29,0,28527,15,0,0,0,'','Spell Rampage: Summon Akil''zon target needs to be 15y from Chronicler To''kini'),
(13,1,52937,0,0,31,0,3,@NPC_ELM_BUNNY,0,0,0,'','Spell Rampage: Summon Akil''zon targets ELM General Purpose Bunny'),
(13,1,52937,0,0,29,0,28527,10,0,1,0,'','Spell Rampage: Summon Akil''zon target needs to be 30y from Chronicler To''kini'),
(13,1,52937,0,0,29,0,28527,15,0,1,0,'','Spell Rampage: Summon Akil''zon target needs to be 30y from Chronicler To''kini'),
(13,1,52937,0,0,29,0,28527,30,0,0,0,'','Spell Rampage: Summon Akil''zon target needs to be 30y from Chronicler To''kini');
DELETE FROM `spell_scripts` WHERE `id`=52933;
INSERT INTO `spell_scripts` (`id`,`effIndex`,`delay`,`command`,`datalong`,`datalong2`,`dataint`,`x`,`y`,`z`,`o`) VALUES
(52933,0,0,15,52934,0,0,0,0,0,0),
(52933,0,0,15,52935,0,0,0,0,0,0),
(52933,0,0,15,52936,0,0,0,0,0,0),
(52933,0,0,15,52937,0,0,0,0,0,0);
UPDATE `creature_model_info` SET `bounding_radius`=0.93 WHERE `modelid`=21793;
UPDATE `creature_model_info` SET `bounding_radius`=1.833, `combat_reach`=4.5 WHERE `modelid`=21830;
UPDATE `creature_model_info` SET `bounding_radius`=0.525, `combat_reach`=2.625 WHERE `modelid`=21831;
UPDATE `creature_model_info` SET `bounding_radius`=0.775, `combat_reach`=5 WHERE `modelid`=22256;
DELETE FROM `creature_template_addon` WHERE `entry`=29021;
INSERT INTO `creature_template_addon` (`entry`,`bytes1`) VALUES
(29021,33554432);
UPDATE `creature_template` SET `minlevel`=83, `maxlevel`=83, `faction_A`=1610, `faction_H`=1610, `unit_flags`=512|256, `AIName`='SmartAI' WHERE `entry` IN (@NPC_AKILZON,@NPC_HALAZZI,@NPC_JANALAI,@NPC_NALORAKK);
DELETE FROM `smart_scripts` WHERE `entryorguid`=@NPC_HARKOA AND `source_type`=0 AND `id`=16;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@NPC_KHUFU AND `source_type`=0 AND `id` IN (3,4,5);
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@NPC_AKILZON,@NPC_HALAZZI,@NPC_JANALAI,@NPC_NALORAKK) AND `source_type`=0;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@NPC_HALAZZI*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
(@NPC_HARKOA,0,16,15,38,0,100,0,0,2,0,0,1,1,0,0,0,0,0,12,1,0,0,0,0,0,0, 'Har''koa - On data 0 2 set - Say line'),
(@NPC_KHUFU,0,3,4,20,0,100,0,12721,0,0,0,64,1,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Khufu - On quest rewarded - Store targetlist'),
(@NPC_KHUFU,0,4,5,61,0,100,0,0,0,0,0,100,1,0,0,0,0,0,19,@NPC_HARKOA,100,0,0,0,0,0, 'Khufu - On quest rewarded - Send targetlist to Har''koa'),
(@NPC_KHUFU,0,5,0,61,0,100,0,0,0,0,0,45,0,2,0,0,0,0,19,@NPC_HARKOA,100,0,0,0,0,0, 'Khufu - On quest rewarded - Set data 0 2 Har''koa'),
(@NPC_AKILZON,0,0,0,54,0,100,0,0,0,0,0,11,35426,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Akil''zon - Just summoned - Spellcast Arcane Explosion Visual'),
(@NPC_AKILZON,0,1,0,38,0,100,0,0,1,0,0,1,0,0,0,0,0,0,23,0,0,0,0,0,0,0, 'Akil''zon - On data 0 1 set - Say line'),
(@NPC_AKILZON,0,2,0,38,0,100,0,0,2,0,0,41,800,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Akil''zon - On data 0 2 set - Despawn'),
(@NPC_HALAZZI,0,0,1,54,0,100,0,0,0,0,0,11,35426,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Halazzi - Just summoned - Spellcast Arcane Explosion Visual'),
(@NPC_HALAZZI,0,1,0,61,0,100,0,0,0,0,0,80,@NPC_HALAZZI*100,2,0,0,0,0,1,0,0,0,0,0,0,0, 'Halazzi - Just summoned - Run script'),
(@NPC_JANALAI,0,0,0,54,0,100,0,0,0,0,0,11,35426,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Jana''lai - Just summoned - Spellcast Arcane Explosion Visual'),
(@NPC_JANALAI,0,1,0,38,0,100,0,0,1,0,0,1,0,0,0,0,0,0,23,0,0,0,0,0,0,0, 'Jana''lai - On data 0 1 set - Say line'),
(@NPC_JANALAI,0,2,0,38,0,100,0,0,2,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Jana''lai - On data 0 2 set - Despawn'),
(@NPC_NALORAKK,0,0,0,54,0,100,0,0,0,0,0,11,35426,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Nalorakk - Just summoned - Spellcast Arcane Explosion Visual'),
(@NPC_NALORAKK,0,1,0,38,0,100,0,0,1,0,0,1,0,0,0,0,0,0,23,0,0,0,0,0,0,0, 'Nalorakk - On data 0 1 set - Say line'),
(@NPC_NALORAKK,0,2,0,38,0,100,0,0,2,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Nalorakk - On data 0 2 set - Despawn'),
(@NPC_HALAZZI*100,9,0,0,0,0,100,0,3300,3300,0,0,1,0,0,0,0,0,0,23,0,0,0,0,0,0,0, 'Halazzi script - Say line'),
(@NPC_HALAZZI*100,9,1,0,0,0,100,0,5200,5200,0,0,45,0,1,0,0,0,0,19,@NPC_NALORAKK,20,0,0,0,0,0, 'Halazzi script - Set data 0 1 Nalorakk'),
(@NPC_HALAZZI*100,9,2,0,0,0,100,0,5600,5600,0,0,45,0,1,0,0,0,0,19,@NPC_JANALAI,20,0,0,0,0,0, 'Halazzi script - Set data 0 1 Jana''lai'),
(@NPC_HALAZZI*100,9,3,0,0,0,100,0,7700,7700,0,0,45,0,1,0,0,0,0,19,@NPC_AKILZON,20,0,0,0,0,0, 'Halazzi script - Set data 0 1 Akil''zon'),
(@NPC_HALAZZI*100,9,4,0,0,0,100,0,8300,8300,0,0,45,0,2,0,0,0,0,19,@NPC_JANALAI,20,0,0,0,0,0, 'Halazzi script - Set data 0 2 Jana''lai'),
(@NPC_HALAZZI*100,9,5,0,0,0,100,0,800,800,0,0,11,42466,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Halazzi script - Spellcast Spirit Visual'),
(@NPC_HALAZZI*100,9,6,0,0,0,100,0,0,0,0,0,45,0,2,0,0,0,0,19,@NPC_AKILZON,20,0,0,0,0,0, 'Halazzi script - Set data 0 2 Akil''zon'),
(@NPC_HALAZZI*100,9,7,0,0,0,100,0,0,0,0,0,45,0,2,0,0,0,0,19,@NPC_NALORAKK,20,0,0,0,0,0, 'Halazzi script - Set data 0 2 Nalorakk'),
(@NPC_HALAZZI*100,9,8,0,0,0,100,0,0,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Halazzi script - Despawn');

Btw: This is just another example that conditions by GUID would be such a great help to make things easier. It was quite a pain in the ass to figure the distances to get it working.

Pitcrawler avatar Aug 23 '14 10:08 Pitcrawler

Well solved this a different way as found elm general purpose bunnys where already spawned at exact co-ordinates where these are meant to spawn,

DELETE FROM `creature_text` WHERE `entry` IN(28479,28514,28515,28516,28517);
INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES
(28479, 0, 0, 'Gods of old, we beseech you. What must we do? How can we save the gods of this land?', 15, 0, 100, 6, 0, 0, 'Witch Doctor Khufu'),
(28514, 0, 0, 'But try they must or all will be lost. The Drakkari will be the death of both themselves and their gods!', 12, 0, 100, 0, 0, 473, 'Nalorakk'),
(28515, 0, 0, 'The spotted one must be sought. Their fates are entwined.', 12, 0, 100, 0, 0, 9919, 'Jan''alai'),
(28516, 0, 0, 'But she is chained. A way must be found to free her.', 12, 0, 100, 0, 0, 12196, 'Akil''zon'),
(28517, 0, 0, 'To her altar this mortal must travel. What they must do will not be easy. In the end it may prove impossible.', 12, 0, 100, 0, 0, 643, 'Halazzi');

UPDATE `creature_template` SET `ainame`='SmartAI', `scriptname`='' WHERE `entry` IN(28479,28514,28515,28516,28517);
DELETE FROM `smart_scripts` WHERE `entryorguid` =28479 AND `source_type`=0 AND `id`>5;
DELETE FROM `smart_scripts` WHERE `entryorguid` IN(28514,28515,28516,28517) AND `source_type`=0;
DELETE FROM `smart_scripts` WHERE `entryorguid` IN(-98546,-98547,-98548,-98549) AND `source_type`=0;

DELETE FROM `smart_scripts` WHERE `entryorguid` =2847900 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
(28479, 0, 6, 7, 20, 0, 100, 0, 12627, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Witch Doctor Khufu - On Quest Reward (Breaking Through Jin''Alai) - Say'), 
(28479, 0, 7, 0, 61, 0, 100, 0, 0, 0, 0, 0, 80, 2847900, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Witch Doctor Khufu - On Quest Reward (Breaking Through Jin''Alai) - Run Script'), 
(28514, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 11, 35426, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Nalorakk - On Just Summoned - Cast Arcane Explosion Visual'), 
(28515, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 11, 35426, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Jan''alai - On Just Summoned - Cast Arcane Explosion Visual'), 
(28516, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 11, 35426, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Akil''zon - On Just Summoned - Cast Arcane Explosion Visual'), 
(28517, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 11, 35426, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Halazzi - On Just Summoned - Cast Arcane Explosion Visual'), 
(-98547, 0, 0, 0, 38, 0, 100, 0, 1, 1, 0, 0, 11, 51861, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny - On Data Set - Cast Breaking Through Jin Alai: Summon Akil zon '), 
(-98549, 0, 0, 0, 38, 0, 100, 0, 1, 1, 0, 0, 11, 52452, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny - On Data Set - Cast Breaking Through Jin alai: Summon Jan Alai'), 
(-98546, 0, 0, 0, 38, 0, 100, 0, 1, 1, 0, 0, 11, 52453, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny - On Data Set - Cast Breaking Through Jin Alai: Summon Halazzi'), 
(-98548, 0, 0, 0, 38, 0, 100, 0, 1, 1, 0, 0, 11, 52454, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny - On Data Set - Cast Breaking Through Jin Alai: Summon Nalorakk'),
(2847900, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Witch Doctor Khufu - Script - Set NPC Flags'), 
(2847900, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 10, 98547, 23837, 0, 0, 0, 0, 0, 'Witch Doctor Khufu - Script - Set Data ELM General Purpose Bunny'), 
(2847900, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 10, 98549, 23837, 0, 0, 0, 0, 0, 'Witch Doctor Khufu - Script - Set Data ELM General Purpose Bunny'), 
(2847900, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 10, 98546, 23837, 0, 0, 0, 0, 0, 'Witch Doctor Khufu - Script - Set Data ELM General Purpose Bunny'), 
(2847900, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 10, 98548, 23837, 0, 0, 0, 0, 0, 'Witch Doctor Khufu - Script - Set Data ELM General Purpose Bunny'), 
(2847900, 9, 5, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 28515, 0, 0, 0, 0, 0, 0, 'Witch Doctor Khufu - Script - Say Line (Jan alai)'), 
(2847900, 9, 6, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 28516, 0, 0, 0, 0, 0, 0, 'Witch Doctor Khufu - Script - Say Line (Akil zon)'), 
(2847900, 9, 7, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 28517, 0, 0, 0, 0, 0, 0, 'Witch Doctor Khufu - Script - Say Line (Halazzi)'), 
(2847900, 9, 8, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 28514, 0, 0, 0, 0, 0, 0, 'Witch Doctor Khufu - Script - Say Line (Nalorakk)'), 
(2847900, 9, 9, 0, 0, 0, 100, 0, 20000, 20000, 0, 0, 81, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Witch Doctor Khufu - Script - Set NPC Flags'); 

And yes would be easier if spells could be targeted by guid, this works by getting the bunnies to cast the spells, on data set (by guid)

dr-j avatar Aug 23 '14 13:08 dr-j

@dr-j: we could implement a condition to allow targetting by guid, if it is required, and you can get rid of this setdata onsetdata stuff

joschiwald avatar Aug 23 '14 16:08 joschiwald

I'd say that would be the best solution to target via guid conditions. The script would be much shorter then and if you consider sniffs this would be the right way to go. Regarding sniffs Khufu casts the spells instead of the bunnies. So the set data method is just some hackish workaround.

Pitcrawler avatar Aug 23 '14 17:08 Pitcrawler

actually according to sniff that I have the spells are cast by player xd so would be invoker cast which as far as using range conditions to specify target makes them even more dodgy as you dont know what position player is going to stand in when turning in quest.

Spell ID: 52453 casterUnitGUID: * Type: Player Low: * CasterGUID: Full: * Type: Player Low: * targetGUID: 0x0 ItemTargetGUID: 0x0 UnkGUID: 0x0

and ye agree targeting by guid is needed.

and spawn points are definitly fixed found the bunnies where already spawned on exact spots.

dr-j avatar Aug 23 '14 21:08 dr-j

Great news! I tried to adept the script using @dr-j 's script and my one as template. I didn't test it though.

Broadcast text ids are still missing!

DELETE FROM `creature_text` WHERE `entry` IN(28479,28514,28515,28516,28517);
INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES
(28479, 0, 0, 'Gods of old, we beseech you. What must we do? How can we save the gods of this land?', 15, 0, 100, 6, 0, 0, 'Witch Doctor Khufu'),
(28514, 0, 0, 'But try they must or all will be lost. The Drakkari will be the death of both themselves and their gods!', 12, 0, 100, 0, 0, 473, 'Nalorakk'),
(28515, 0, 0, 'The spotted one must be sought. Their fates are entwined.', 12, 0, 100, 0, 0, 9919, 'Jan''alai'),
(28516, 0, 0, 'But she is chained. A way must be found to free her.', 12, 0, 100, 0, 0, 12196, 'Akil''zon'),
(28517, 0, 0, 'To her altar this mortal must travel. What they must do will not be easy. In the end it may prove impossible.', 12, 0, 100, 0, 0, 643, 'Halazzi');

DELETE FROM `spell_scripts` WHERE `id`=51862;
INSERT INTO `spell_scripts` (`id`,`effIndex`,`delay`,`command`,`datalong`,`datalong2`,`dataint`,`x`,`y`,`z`,`o`) VALUES
(51862,0,0,15,51861,0,0,0,0,0,0),
(51862,0,0,15,52452,0,0,0,0,0,0),
(51862,0,0,15,52453,0,0,0,0,0,0),
(51862,0,0,15,52454,0,0,0,0,0,0);

DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (51861,52452,52453,52454);
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(13,1,51861,0,0,31,0,3,23837,98547,0,0,'','Spell Breaking Through Jin''Alai: Summon Akil''zon targets ELM General Purpose Bunny'),
(13,1,52452,0,0,31,0,3,23837,98549,0,0,'','Spell Breaking Through Jin''Alai: Summon Jan''Alai targets ELM General Purpose Bunny'),
(13,1,52453,0,0,31,0,3,23837,98546,0,0,'','Spell Breaking Through Jin''Alai: Summon Halazzi targets ELM General Purpose Bunny'),
(13,1,52454,0,0,31,0,3,23837,98548,0,0,'','Spell Breaking Through Jin''Alai: Summon Nalorakk targets ELM General Purpose Bunny');

DELETE FROM `creature_template_addon` WHERE `entry` IN (28514,28515,28516,28517);
INSERT INTO `creature_template_addon` (`entry`,`bytes1`,`bytes2`) VALUES
(28514,0,1),
(28515,0,1),
(28516,33554432,1),
(28517,0,1);

UPDATE `creature_template` SET `minlevel`=83, `maxlevel`=83, `unit_flags`=512|256 WHERE `entry` IN (28514,28515,28516,28517);
UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry` IN(28479,28514,28515,28516,28517);
DELETE FROM `smart_scripts` WHERE `entryorguid` =28479 AND `source_type`=0 AND `id` IN (6,7);
DELETE FROM `smart_scripts` WHERE `entryorguid` IN(28514,28515,28516,28517) AND `source_type`=0;
DELETE FROM `smart_scripts` WHERE `entryorguid` =2847900 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
(28479, 0, 6, 7, 20, 0, 100, 0, 12627, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Witch Doctor Khufu - On Quest Reward (Breaking Through Jin''Alai) - Say'), 
(28479, 0, 7, 0, 61, 0, 100, 0, 0, 0, 0, 0, 80, 2847900, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Witch Doctor Khufu - On Quest Reward (Breaking Through Jin''Alai) - Run Script'), 
(28514, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 11, 35426, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Nalorakk - On Just Summoned - Cast Arcane Explosion Visual'), 
(28515, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 11, 35426, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Jan''alai - On Just Summoned - Cast Arcane Explosion Visual'), 
(28516, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 11, 35426, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Akil''zon - On Just Summoned - Cast Arcane Explosion Visual'), 
(28517, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 11, 35426, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Halazzi - On Just Summoned - Cast Arcane Explosion Visual'), 
(2847900, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Witch Doctor Khufu - Script - Set NPC Flags'),  
(2847900, 9, 5, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 28515, 0, 0, 0, 0, 0, 0, 'Witch Doctor Khufu - Script - Say Line (Jan alai)'), 
(2847900, 9, 6, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 28516, 0, 0, 0, 0, 0, 0, 'Witch Doctor Khufu - Script - Say Line (Akil zon)'), 
(2847900, 9, 7, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 28517, 0, 0, 0, 0, 0, 0, 'Witch Doctor Khufu - Script - Say Line (Halazzi)'), 
(2847900, 9, 8, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 28514, 0, 0, 0, 0, 0, 0, 'Witch Doctor Khufu - Script - Say Line (Nalorakk)'), 
(2847900, 9, 9, 0, 0, 0, 100, 0, 20000, 20000, 0, 0, 81, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Witch Doctor Khufu - Script - Set NPC Flags'); 

Pitcrawler avatar Aug 24 '14 04:08 Pitcrawler

broadcast text ids comes from broadcast_text table.

Aokromes avatar Aug 24 '14 07:08 Aokromes

had not got round to that yet

http://paste2.org/aAp066Xp

dr-j avatar Aug 24 '14 09:08 dr-j

Updated

Pitcrawler avatar Aug 24 '14 10:08 Pitcrawler