[Wip] Deeprun Rat Roundup

I’ve been trying to fix http://old.wowhead.com/quest=6661/

Can anyone tell me why this SAI is not working? I think it’s ok.

[CODE]

– Deeprun Rat SAI
SET @ENTRY := 13016;
UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry=@ENTRY;
UPDATE quest_template SET ReqSpellCast1=0 WHERE entry=6661;
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,1,8,0,100,0,21050,0,0,0,29,0,0,0,0,0,0,7,0,0,0,0,0,0,0,“Deeprun Rat - On Spellhit - Follow Player”),
(@ENTRY,0,1,2,61,0,100,0,0,0,0,0,36,13017,0,0,0,0,0,1,0,0,0,0,0,0,0,“Deeprun Rat - On Spellhit - Update Template”),
(@ENTRY,0,2,3,61,0,100,0,0,0,0,0,33,13017,0,0,0,0,0,7,0,0,0,0,0,0,0,“Deeprun Rat - On Spellhit - Quest Credit”),
(@ENTRY,0,3,0,61,0,100,0,0,0,0,0,22,1,0,0,0,0,0,7,0,0,0,0,0,0,0,“Deeprun Rat - On Spellhit - Set Phase 1”);
[/sql][/CODE]

Why do you use eventflags for id 1 and 2. That’s not neccesary I’d say. Maybe if you remove these it’ll work.

Ok i’m going to check if that was the problem. Thank you for answering

This was one of the first non working quests I found in Trinity right after weakened Morbent Fel in Duskwood I think. Would be nice to see it working.

At the second SAI line use action_type SMART_ACTION_UPDATE_TEMPLATE (36) instead of SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL (3).

Also I am unsure if linking with credits works. I tried it once in the past and it didn’t work, so you might want to try on spellhit give kill credit. /emoticons/default_smile.png

P.S. Yes, the killcredit entry is correct.

http://old01.wowhead.com/npc=13017

And if all that won’t work, try changing the FIRST LINKED LINE to action_type 1 (SMART_ACTION_TALK) and make it say something to see if the link is actually reached. /emoticons/default_smile.png

Now the quest could be done without problem but there are few things that could be improved:

  1. The rat still doesn’t transform to 13017. I’ve tried with SMART_ACTION_UPDATE_TEMPLATE (36) but when it update the template the rat dies. I don’t know why is this happening.

  2. I can complete the quest casting 21050 on the same rat 5 times so this shouldn’t happen.

The kill credit works fine

you can set phase 1 on spawn, put the on spell hit in phase 1. On spell hit change phase to 2. this will prevent getting credit more than once from same creature.

The reason it didn’t update template is because you used action_type 3 instead of 36.

And I can confirm that the rat dies. It just sometimes doesn’t work in SAI, not your fault. /emoticons/default_smile.png

Here’s a version that’s tested and ready for push.

-- Deeprun Rat SAI SET @ENTRY := 13016; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; UPDATE `quest_template` SET `ReqSpellCast1`=0 WHERE `entry`=6661; 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,1,8,0,100,0,21050,0,0,0,29,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Deeprun Rat - On Spellhit - Follow Player"), (@ENTRY,0,1,2,61,0,100,0,0,0,0,0,36,13017,0,0,0,0,0,1,0,0,0,0,0,0,0,"Deeprun Rat - On Spellhit - Update Template"), (@ENTRY,0,2,3,61,0,100,0,0,0,0,0,33,13017,0,0,0,0,0,7,0,0,0,0,0,0,0,"Deeprun Rat - On Spellhit - Quest Credit"), (@ENTRY,0,3,0,61,0,100,0,0,0,0,0,22,1,0,0,0,0,0,7,0,0,0,0,0,0,0,"Deeprun Rat - On Spellhit - Set Phase 1");[/sql]

It’s a version where the rats die too. I don’t understand why morph(3) doesn’t work. A few days ago i made a SAI for http://old01.wowhead.com/npc=29621 who morphs into Mal’Ganis and it worked fine with action_type 3.

You shouldn’t use morph anyway. It’s a big hack…

then, is better update template and see how does the rat dies? I don’t understand why it’s a hack

Yes, it is better. It’s a hack because you should use Enthralled Deeprun Rat in the script. The fact the SAI bugs out is a core issue and we can blame someone else for it. Now stop crying and post it on the tracker…

Sorry but i dont think this SAI is finished. I won’t post it on the tracker yet

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

I’m such a kind person. Move thread to completed please.

(@ENTRY,0,3,0,61,0,100,0,0,0,0,0,22,1,0,0,0,0,0,7,0,0,0,0,0,0,0,"Deeprun Rat - On Spellhit - Set Phase 1"); [/sql]

This line doesn’t work. But you couldn’t know it because in your SAI the rat dies. Is still possible complete the quest in the same rat.

I’d take a slightly bugged quest that you can complete over one that doesn’t work at all any day. Push it so it ends up in everyone’s regular updates where us peons can at least finish quests and post followup bug reports to the tracker if needed. Thank you. /emoticons/default_smile.png

Finally someone who gets the point. It’s funny how the OP here asks for help, I offer him help and post a as-good-as-possible working (for SAI) fix and he still complains. Probably for a private server. =)

Both of you are right but my point of view is different of yours. I will work on this SAI until it works at least apparently good. And if it’s not possible with SAI i’ll try with C++. Thank you for your help. You can move to complete if you think this is ready for push.

I’m not saying stop trying to make it perfect, just don’t demand perfect before pushing it to the repo.

I understand you now. i didn’t demand nothing. I was only asking for help to make it perfect but you are right at pushing something at least working to the repo.