Q: The Mosswalker Savior

Hey Guys,

i startet working on http://www.wowhead.com/quest=12580

I thought of having a SAI with a random TImed_Action_List:



SET @ENTRY := 28113;

SET @SCRIPT1 := 2811301;

SET @SCRIPT2 := 2811302;

SET @SOURCETYPE := 0;

SET @SOURCETYPE2 := 9;



-- Correct unit-flag

UPDATE `creature_template` SET `unit_flags`=33024 WHERE `entry`=@ENTRY;


-- 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, 'Please take... my shinies. All done...', 12, 0, 100, 0, 0, 0, 'Mosswalker Victim - Dead1'),

(@ENTRY, 0, 1, 'We not do anything... to them... I no understand.', 12, 0, 100, 0, 0, 0, 'Mosswalker Victim - Dead2'),

(@ENTRY, 0, 2, 'Use my shinies... make weather good again... make undead things go away.', 12, 0, 100, 0, 0, 0, 'Mosswalker Victim - Dead3'),

(@ENTRY, 0, 3, 'We gave shinies to shrine... we not greedy... why this happen?', 12, 0, 100, 0, 0, 0, 'Mosswalker Victim - Dead4'),

(@ENTRY, 0, 4, 'I do something bad? I sorry...', 12, 0, 100, 0, 0, 0, 'Mosswalker Victim - Dead5'),

(@ENTRY, 1, 0, 'We saved. You nice, dryskin.', 12, 0, 100, 0, 0, 0, 'Mosswalker Victim - Saved1'),

(@ENTRY, 1, 1, 'Maybe you make weather better too?', 12, 0, 100, 0, 0, 0, 'Mosswalker Victim - Saved2'),

(@ENTRY, 1, 2, 'You save us! Yay for you!', 12, 0, 100, 0, 0, 0, 'Mosswalker Victim - Saved3'),

(@ENTRY, 1, 3, 'Thank you! You good!', 12, 0, 100, 0, 0, 0, 'Mosswalker Victim - Saved4');


-- Condition


DELETE FROM `conditions` WHERE `SourceGroup`=@GOSSIP AND `SourceTypeOrReferenceId`=15 ;

INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry` , `ElseGroup`, `ConditionTypeOrReference`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3` , `ErrorTextId`, `ScriptName`, `Comment`)

VALUES (15, @GOSSIP, 0 , 0, 9, @QUEST, 0 , 0, 0 , 0, 'Only show gossip 9728 when quest 12580 is added');


-- SAI

UPDATE creature_template SET AIName="SmartAI" WHERE entry=@ENTRY;

DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=@SOURCETYPE;

DELETE FROM `smart_scripts` WHERE `entryorguid`=@SCRIPT1 AND `source_type`=@SOURCETYPE2;

DELETE FROM `smart_scripts` WHERE `entryorguid`=@SCRIPT2 AND `source_type`=@SOURCETYPE2;

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

-- Random Timed_Action

(@ENTRY,@SOURCETYPE,0,0,62,0,100,0,9728,0,0,0,87,@SCRIPT1,@SCRIPT2,0,0,0,0,1,0,0,0,0.0,0.0,0.0,0.0,"On Gossip Select - Random Script Start"),

(@ENTRY,@SOURCETYPE,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0.0,0.0,0.0,0.0,"Close Gossip"),

-- Death

(@SCRIPT1,@SOURCETYPE2,0,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Script 1 - Say"),

(@SCRIPT1,@SOURCETYPE2,1,0,0,0,100,0,2000,2000,0,0,37,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Script 1 - Die"),

-- Live

(@SCRIPT2,@SOURCETYPE2,0,0,0,0,100,0,0,0,0,0,1,1,0,0,0,0,0,7,0,0,0,0,0,0,0,"Script 2 - Say"),

(@SCRIPT2,@SOURCETYPE2,1,0,0,0,100,0,0,0,0,0,11,52157,0,0,0,0,0,7,0,0,0,0,0,0,0,"Script 1 - Credit"),

(@SCRIPT2,@SOURCETYPE2,2,0,0,0,100,0,5000,5000,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Script 1 - Despawn");

For the random say:

You have to switch groupid and id


[FONT=arial]([/FONT][FONT=arial]@ENTRY, 0, 0, 'Please take... my shinies. All done...', 12, 0, 100, 0, 0, 0, 'Mosswalker Victim - Dead1'),[/FONT]

[FONT=arial]
(@ENTRY, 0, 1, 'We not do anything... to them... I no understand.', 12, 0, 100, 0, 0, 0, 'Mosswalker Victim - Dead2'),[/FONT]

[FONT=arial]
(@ENTRY, 0, 2, 'Use my shinies... make weather good again... make undead things go away.', 12, 0, 100, 0, 0, 0, 'Mosswalker Victim - Dead3'),[/FONT]

[FONT=arial]
(@ENTRY, 0, 3, 'We gave shinies to shrine... we not greedy... why this happen?', 12, 0, 100, 0, 0, 0, 'Mosswalker Victim - Dead4'),[/FONT]

[FONT=arial]
(@ENTRY, 0, 4, 'I do something bad? I sorry...', 12, 0, 100, 0, 0, 0, 'Mosswalker Victim - Dead5'),[/FONT]

[FONT=arial]
(@ENTRY, 1, 0, 'We saved. You nice, dryskin.', 12, 0, 100, 0, 0, 0, 'Mosswalker Victim - Saved1'),[/FONT]

[FONT=arial]
(@ENTRY, 1, 1, 'Maybe you make weather better too?', 12, 0, 100, 0, 0, 0, 'Mosswalker Victim - Saved2'),[/FONT]

[FONT=arial]
(@ENTRY, 1, 2, 'You save us! Yay for you!', 12, 0, 100, 0, 0, 0, 'Mosswalker Victim - Saved3'),[/FONT]

[FONT=arial]
(@ENTRY, 1, 3, 'Thank you! You good!', 12, 0, 100, 0, 0, 0, 'Mosswalker Victim - Saved4');[/FONT]

[FONT=arial]If you change the SmartAI to[/FONT]

[FONT=arial]
[/FONT]

[FONT=arial]


[FONT=arial]
[/FONT][FONT=arial](@SCRIPT1,@SOURCETYPE2,0,1,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Script 1 - Say"),[/FONT]

[FONT=arial]
(@SCRIPT2,@SOURCETYPE2,0,1,0,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Script 2 - Say"),[/FONT]

[FONT=arial]
[/FONT][FONT=arial]```[/FONT]

[FONT=arial]the npcs will say a line randomly[/FONT].

[FONT=arial]I dont think the texts are spoken. It's just a simple quest so probably there is no sound for the texts.[/FONT]

[FONT=arial]
[/FONT]

[FONT=arial]
I'm sorry but I don't see any point why the scripts don't start [/FONT]/emoticons/default_sad.png

[FONT=arial]
[/FONT]

I think the reason is the linking, check if the console give error for not found. When the text should occure.

Actualy, the reson might the very fact it can’t find the text u specified, if you write what Pitcrawler posted it might fix the action issue also.

Groupid for text is like a pool of texts so when say 5 it pick one of 5,1 5,2 5,3 /sub ids/. The script looks pretty fine.

Correct @thesensei!

Remove the linking from the timedactionlist. It’s not needed there. Actions are performed when the specified time has elapsed. I’d suggest


-- death

(@SCRIPT1,@SOURCETYPE2,0,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Script 1 - Say"),

(@SCRIPT1,@SOURCETYPE2,1,0,0,0,100,0,2000,2000,0,0,37,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Script 1 - Die"),

-- life

(@SCRIPT2,@SOURCETYPE2,0,0,0,0,100,0,0,0,0,0,1,1,0,0,0,0,0,7,0,0,0,0,0,0,0,"Script 2 - Say"),

(@SCRIPT2,@SOURCETYPE2,1,0,0,0,100,0,0,0,0,0,11,52157,0,0,0,0,0,7,0,0,0,0,0,0,0,"Script 1 - Credit"),

(@SCRIPT2,@SOURCETYPE2,2,0,0,0,100,0,5000,5000,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Script 1 - Despawn"),

Thank you for your help!

I updatet the script and it works just fine.

I think i need a close_gossip, too. Because the Gorloc walks away after the script an the dies or despawns, when the gossip is still open…

Should that hapen in the normal SAI or in one of the random scripts?

How can i get it done, that the Gorlocs are on a chain to the Undead? That would be the last thing on this one /emoticons/default_smile.png

Well, first of all you need the proper spell. 2nd I think on spell hit the npc should change it’s current creature_addon_data laying on ground. And then on gossip complete depending on the result, should change again. The chain part is 100% spell done. If I remember correctly a quest in Ogri’La was using a spell that makes aether rays follow the unit who wrangle them.

So maybe on OOC on specific time check for nearby gorlocs, cast the spell if target type 9 entry min range max range is in range.

You need a spell like 40926, but with chains. Tried to find it, but couldn’t.

The close gossip should be in the normal script linked to the on gossip select action.

The chain spell should be http://old.wowhead.com/spell=52140

Okay, Script updatet with condition and close Gossip.

The SAI part is done and the Quest ist working.

The part with the chains seems a bit to complicated to me ^^

This is the complete Fix:

SET @ENTRY := 28113; SET @SCRIPT1 := 2811301; SET @SCRIPT2 := 2811302; SET @SOURCETYPE := 0; SET @SOURCETYPE2 := 9; SET @GOSSIP := 9728; SET @QUEST := 12580; -- correct unit_flag UPDATE `creature_template` SET `unit_flags`=33024 WHERE `entry`=@ENTRY; -- creature-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, 'Please take... my shinies. All done...', 12, 0, 100, 0, 0, 0, 'Mosswalker Victim - Dead1'), (@ENTRY, 0, 1, 'We not do anything... to them... I no understand.', 12, 0, 100, 0, 0, 0, 'Mosswalker Victim - Dead2'), (@ENTRY, 0, 2, 'Use my shinies... make weather good again... make undead things go away.', 12, 0, 100, 0, 0, 0, 'Mosswalker Victim - Dead3'), (@ENTRY, 0, 3, 'We gave shinies to shrine... we not greedy... why this happen?', 12, 0, 100, 0, 0, 0, 'Mosswalker Victim - Dead4'), (@ENTRY, 0, 4, 'I do something bad? I sorry...', 12, 0, 100, 0, 0, 0, 'Mosswalker Victim - Dead5'), (@ENTRY, 1, 0, 'We saved. You nice, dryskin.', 12, 0, 100, 0, 0, 0, 'Mosswalker Victim - Saved1'), (@ENTRY, 1, 1, 'Maybe you make weather better too?', 12, 0, 100, 0, 0, 0, 'Mosswalker Victim - Saved2'), (@ENTRY, 1, 2, 'You save us! Yay for you!', 12, 0, 100, 0, 0, 0, 'Mosswalker Victim - Saved3'), (@ENTRY, 1, 3, 'Thank you! You good!', 12, 0, 100, 0, 0, 0, 'Mosswalker Victim - Saved4'); -- Gossip-Condition DELETE FROM `conditions` WHERE `SourceGroup`=@GOSSIP AND `SourceTypeOrReferenceId`=15 ; INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry` , `ElseGroup`, `ConditionTypeOrReference`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3` , `ErrorTextId`, `ScriptName`, `Comment`) VALUES (15, @GOSSIP, 0 , 0, 9, @QUEST, 0 , 0, 0 , 0, 'Only show gossip 9728 when quest 12580 is added'); -- SAI UPDATE creature_template SET AIName="SmartAI" WHERE entry=@ENTRY; DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=@SOURCETYPE; DELETE FROM `smart_scripts` WHERE `entryorguid`=@SCRIPT1 AND `source_type`=@SOURCETYPE2; DELETE FROM `smart_scripts` WHERE `entryorguid`=@SCRIPT2 AND `source_type`=@SOURCETYPE2; 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 -- Random Timed_Action (@ENTRY,@SOURCETYPE,0,1,62,0,100,0,9728,0,0,0,87,@SCRIPT1,@SCRIPT2,0,0,0,0,1,0,0,0,0.0,0.0,0.0,0.0,"On Gossip Select - Random Script Start"), (@ENTRY,@SOURCETYPE,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0.0,0.0,0.0,0.0,"Close Gossip"), -- Death (@SCRIPT1,@SOURCETYPE2,0,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Script 1 - Say"), (@SCRIPT1,@SOURCETYPE2,1,0,0,0,100,0,2000,2000,0,0,37,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Script 1 - Die"), -- Live (@SCRIPT2,@SOURCETYPE2,0,0,0,0,100,0,0,0,0,0,1,1,0,0,0,0,0,7,0,0,0,0,0,0,0,"Script 2 - Say"), (@SCRIPT2,@SOURCETYPE2,1,0,0,0,100,0,0,0,0,0,11,52157,0,0,0,0,0,7,0,0,0,0,0,0,0,"Script 1 - Credit"), (@SCRIPT2,@SOURCETYPE2,2,0,0,0,100,0,5000,5000,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Script 1 - Despawn"); [/SQL]

Is this already pushed to repo?

You should close gossip on the first line and run script on the linked line. Also why are you using target type 7 on the say text? Shouldn’t that be target type 1?

Also your sai comments does not have the creature name in it. Should be “creature name - event - action”.

According to sniffs it is usually the action invoker used as target in SMSG_MESSAGECHAT so target type 7 should be correct…

This is TC. Not everything is blizzlike.

– offtopic –

If there’s a core/db that tries to be “blizzlike” the right way… it’s TC.