Npc Actions After Quest Completion

Hey guys,

wounder if anyone could possible help me, I would like to have an NPC that is a quest giver, say for example “Conservator Ilthalaine” who is in Shadowglen upon new Night Elf character arrivals and gives you your first couple of quests…

On retail, when you complete your first quest, he claps and then automatically gives you your second quest.

My problem is, I have been through the quest_template, creature, creature_template and creature_addon tables in the database, whilst following guidence of the wiki and the descriptions of the various fields and how they are linked and what they do, but I cannot make him clap on completing the quest.

Using the NPC above and the quest “The Balance Of Nature”, I changed in the quest_template table the column “CompleteEmote” to 21 which is the emote according to the Wiki for a “ONESHOT_APPLAUD”, but when I complete the quest, the NPC does NOT clap/applaud…

Please help, I am new to this database editing thing and would so very much like to learn so that I can find and fix things myself and share what I find, but after spending 5 hours digging through the database and linked tables etc, I am at a loss and think some help is required lol.

Thanks everyone in advance

Oh and one more thing, I was also trying to get an NPC to display a speech bubble above their head saying something when you get close to it and to display text from a selection of options I would like it to say randomly, but I did not have any joy with that either.

I was looking through the npc_text table for trying to do this, but had no luck. Any possible help?

You’ll have to make a script

Thanks Thatguy,

but, I don’t suppose you have any pointers for making such a script /emoticons/default_blink.png I am so very new to this, but once I have done it a couple of times I will pick it up real quick, its just that initial start thats stumped me /emoticons/default_blink.png

I thought so /emoticons/default_tongue.png , you can look into another scripts from here, ac web, skyfire, etc… and try to understand /emoticons/default_smile.png !

You’ll see it’s not that hard.

Thanks Thatguy /emoticons/default_smile.png

I guess I will begin my journey going through scripts and reading how their put together. One more thing though, are these scripts all database driven because I have no knowledge of C++ programming /emoticons/default_wacko.png

All C++, don’t try to avoid it.

That’s not true. I would advise learning the basics of SQL first (INCLUDING GUIDELINES AND CODESTYLE) and after that look into SmartAI. When you know SmartAI very well you’re welcome to learn C++.

Thanks guys,

I think I will keep C++ programming on the back burner for the mean time then and focus more on the database side of things.

So for the time being then with what I would like to achieve i.e. an NPC performing an action after succesful quest completion

and getting NPC characters to display message buggles above their heads, is this all able to be done database side with

SmartAI etc?

Thanks in advance guys, Neo

Easy to do in SAI.

For some reason it cheers me up reading this. ‘message buggles’ are just… /emoticons/default_tongue.png

Let’s start with the following links, go try out yourself, review other scripts, etc.

http://www.trinityco…pting-tutorial/

http://www.trinityco…ting-questions/

http://www.trinityco…e-smart-scripts

EDIT.

Here’s something I just wrote now. Off to school now, good luck!

http://paste2.org/p/1688410

Thanks guys,

you have all been a great help, the SAI seems to be quite good when using it, I have read all the info you have given me over and over a few times to help it sink in lol, and for now, for what I want to do, SAI seems great to me and I am so totally in favor of converting everything that can be converted into SAI, I would much prefer to edit and update the database if I find a problem/fix rather than program in C++, I mean, I am not going to try and run before I can walk…

Speaking of using SAI, you don’t by any chance know where there is a list of valid working emots I am able to use as a reference so I can use emots for example when I complete a quest, the quest giver claps or dances as I can’t seem to find any and the ones in the wiki don’t seem to work.

This is what I have done upto now. I am aiming to get the NPC to clap when I complete the very first quest as a Night Elf in Shadowglen, am I doing this right or on the right lines /emoticons/default_wacko.png/emoticons/default_unsure.png

[CODE]-- Conservator Ilthalaine - Shadowglen - First Quest Completion Script

DELETE FROM smart_scripts WHERE entryorguid=-46205 AND id=0 AND source_type=0 LIMIT 1;

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 (-46205,0,0,0,49,0,100,0,0,0,0,0,5,21,0,0,0,0,0,7,0,0,0,0.0,0.0,0.0,0.0,“Conservator Ilthalaine - Shadowglen - First Quest Completion Script”);[/CODE]

Thanks for all your help guys, Neo

Yes, these can be found here:

http://www.trinitycore.info/Creature_addon_tc2#emote

I highly suggest scripting it on entry instead. Using GUID is better to use in specific cases. /emoticons/default_smile.png

Also, you should change your way of commenting. /emoticons/default_tongue.png

Thanks Discover, your a big help /emoticons/default_smile.png

However, I have been working on this same NPC for the past 5 hours since you posted those links to the tutorials etc, and I have even used the Event Horizon SAI editor with me being a noob at db editing, but I am now at a loss…All I want the NPC to do is clap once I have completed my very first quest as a Night Elf, but I cannot get the NPC to clap, I can use SAI to make me the player automatically clap once I complete the quest, but thats not what I want, I want the NPC to clap at me…

Here is my code:


-- Conservator Ilthalaine

SET @ENTRY := 2079;

SET @SOURCETYPE := 0;

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

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

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,@SOURCETYPE,0,0,20,0,100,0,456,0,0,0,5,21,0,0,0,0,0,10,46205,2079,0,0.0,0.0,0.0,0.0,"test script");

I seem to have set everything correct, I even scripted using the entry id rather than the GUID, it is set for reward quest and the action is the applaud emote which should be done by Conservator Ilthalaine, but alas, I have no joy. I mean if I can’t get a simple NPC to wave at me after completing a quest, I have no hope of using SAI to edit and script my database then /emoticons/default_wacko.png/emoticons/default_blink.png/emoticons/default_sad.png

I understand the principle and logic of how it works, but I am just not having any luck in practice, especially when all the code looks right!

P.S Hope I commented correctly this time, I used the code button to paste my code

Try setting target_type to 1 and remove the target params. :stuck_out_tongue_winking_eye:

Nonetheless, emoting after a quest is handled by a column in quest_template.

http://www.trinitycore.info/Quest_template_tc2#CompleteEmote

Also your comment should be NPC - EVENT - ACTION. Makes it easier to understand.

Hey Guys,

Thanks for all your help again, but alas, I have hit a brick wall…I followed your directions Discover and changed my target_type to 1 and removed the params and even changed the CompleteEmote column in the quest_template to 21 (clap) but I am not able to get the NPC to clap or use any type of emote, I even tried the dance emote, but the NPC never danced…

It is so frustrating because looking at my code and following all your directions, logic would dictate that it should work, but in practice its just not working and thats the frustrating part about it because my code isn’t working /emoticons/default_wacko.png/emoticons/default_blink.png/emoticons/default_angry.png

All I wants is for [FONT=arial]NPC Conservator Ilthalaine [/FONT]- On Completion of The Balance of Nature Quest - To Clap - As you can see, a simple task, but I just cannot get the result I want despite following all your guideance and tutorials. I mean, I know am not doing it wrong, its only a simple emote played by an NPC after a quest completion, its not like am trying to script a massive quest chain or a boss battle or anything!

I have had some similar trouble yesterday. Apparently CompleteEmote (which has the exact same effect as using SAI) just doesn’t work. Maybe a core issue for quests… =)

The main point is that you’ve learned some new stuff in this topic, that’s the goal after all. Go pick a new subject and try again.