Quest 11593: The Honored Dead

TODO:

Despawn doesn’t work.

[CODE]
– Fix Quest 11593 ‘The Honored Dead’
SET @Guard :=25342; – Dead Caravan Guard
SET @Worker :=25343; – Dead Caravan Worker

DELETE FROM creature_ai_scripts WHERE creature_id IN (@Guard,@Worker);
UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry IN (@Guard,@Worker);

UPDATE creature SET spawntimesecs=180 WHERE id IN (@Guard,@Worker); – reduce spawntime
– Death State + Auras: Spirit Particles (green) and Permanent Feign Death
DELETE FROM creature_template_addon WHERE entry IN (@Guard,@Worker);
INSERT INTO creature_template_addon (entry,path_id,mount,bytes1,bytes2,emote,auras) VALUES
(@Guard,0,0,0,1,0,‘43167 29266’),
(@Worker,0,0,0,1,0,‘43167 29266’);

DELETE FROM smart_scripts WHERE source_type=0 AND entryorguid IN (@Guard,@Worker);
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
(@Guard,0,0,1,8,0,100,0,45474,0,0,0,33,@Guard,0,0,0,0,0,7,0,0,0,0,0,0,0,‘Dead Caravan Guard - on Spellhit - call Kill Credit’),
(@Guard,0,1,2,61,0,100,0,0,0,0,0,75,49132,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Dead Caravan Guard - on Spellhit - add Aura: Ember Flame (Burning Corpse)’),
(@Guard,0,2,3,61,0,100,0,0,0,0,0,28,43167,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Dead Caravan Guard - on Spellhit - remove Aura: Spirit Particles (green)’),
(@Guard,0,3,0,61,0,100,0,0,0,0,0,41,30000,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Dead Caravan Guard - despawn after 30 sec’),
(@Worker,0,0,1,8,0,100,0,45474,0,0,0,33,@Guard,0,0,0,0,0,7,0,0,0,0,0,0,0,‘Dead Caravan Worker - on Spellhit - call Kill Credit’),
(@Worker,0,1,2,61,0,100,0,0,0,0,0,75,49132,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Dead Caravan Worker - on Spellhit - add Aura: Ember Flame (Burning Corpse)’),
(@Worker,0,2,3,61,0,100,0,0,0,0,0,28,43167,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Dead Caravan Worker - on Spellhit - remove Aura: Spirit Particles (green)’),
(@Worker,0,3,0,61,0,100,0,0,0,0,0,41,30000,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Dead Caravan Worker - on Spellhit - despawn after 30 sec’);
[/sql][/CODE]

to prevent using the item more than one time within 30 sec on the same npc

my suggestion

[sql]
DELETE FROM spell_linked_spell WHERE spell_trigger=49132 AND spell_effect=-45474;
INSERT INTO spell_linked_spell (spell_trigger,spell_effect,type,comment) VALUES
(49132,-45474,2,‘on Aura:Ember Flame (Burning Corpse) - immun against Ragefist's Torch’);
issue

https://github.com/TrinityCore/TrinityCore/issues/1881

can’t you use spell_proc_event for the cooldown?

He doesn’t want a cooldown on the spell, he wants a cooldown so it can’t be used on ONE specific NPC more than once every 30 seconds.

my fault

have you thought about starting a script on Spell hit?

And, on your script you added this line:

DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid` IN (@Guard*100,@Worker*100);[/SQL]

you don’t have any script yet, what are you deleting?

Ok, so I’ll try to explain, although you don’t bother to listen.

He converted script from EAI to SAI - DELETE FROM creature_ai_scripts WHERE creature_id IN (@Guard,@Worker);

means: there’s no other script.

now, DELETE FROM smart_scripts WHERE source_type=9 AND entryorguid IN (@Guard100,@Worker100); deletes script with source_type 9 in other entrys for SCRIPT

please take a look in his SAI and tell me if you see either one of those.

keep the delete function and add script: “On spell hit run script”, might fix your problem.

This line isn’t needed though.

DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid` IN (@Guard*100,@Worker*100);

omg you’re right i just forgot to delete this line - thx for pointing this /emoticons/default_smile.png

/updated

so anybody can solve the despawn problem? - i don’t know what i did wrong

Aren’t you testing with .gm on? You need to turn it off