CalciumKid Posted December 2, 2011 Group: Members Topic Count: 25 Topics Per Day: 0.01 Content Count: 257 Reputation: 253 Joined: 11/29/11 Last Seen: February 21, 2014 Share Posted December 2, 2011 Hi All, Here is a rather simple quest template based on arrays. It will tell users what they're missing among other things, and makes for a good way to quickly get a quest in game. //===== eAthena Script ======================================= //= Super Awesome Quest Template //===== By: ================================================== //= CalciumKid //= & Okira //===== Current Version: ===================================== //= 2.0 //===== Compatible With: ===================================== //= eAthena 1.0 Final + //===== Description: ========================================= //= Quest Template //============================================================ <map>,<x>,<y>,<facing> script <npcname> <npcsprite>,{ //===== Config: ============================================== set .npcname$,"[^FF0000 <npcname> ^000000]"; //Change to whatever you want the NPC name to be setarray .reqid[1],<id>,<id>,<id>; //Item IDs for the items, required for item checks setarray .reqn$[1],"<name>","<name>","<name>"; //These are names of the required items, for the dialogue setarray .reqa[1],<amount>,<amount>,<amount>; //These are how many of each item is required set .prize,<rewardid>; //Change this to the Item ID of the item reward set .prizen$,"<rewardname>"; //Change this to the name of your reward set .prizea,<rewardamount>; //Change this to the amount of the prize item set .zeny,20000000; //Amount of zeny for quest (set to 0 to disable) L_QUEST: mes .npcname$; mes "Hah! Hello there "+strcharinfo(0); next; mes .npcname$; mes "I don't get many visitors, so I assume you're after my legendary ^FF0000"+.prizen$+"^000000?"; menu "Of course",-,"No way",L_EXIT; next; mes .npcname$; mes "Great! I love business. I can make you a ^FF0000"+.prizen$+"^000000, but only if you bring me the materials required."; next; mes .npcname$; mes "Would you like me to make one for you?"; menu "Yes",-,"No",L_EXIT; next; mes .npcname$; mes "I'll need the following:"; for (set .@x,1; .@x < getarraysize(.reqid); set .@x,.@x + 1) { mes .reqa[.@x]+" ^FF0000"+.reqn$[.@x]+"^000000"; } if (.zeny > 0) { mes .zeny+" ^FF0000Zeny^000000"; } next; mes .npcname$; mes "Do you have those items?"; menu "Yes",-,"No",L_EXIT; next; mes .npcname$; for (set .@x,1; .@x < getarraysize(.reqid); set .@x,.@x + 1) { if(countitem(.reqid[.@x]) >= .reqa[.@x]) {mes "You've got enough ^00FF00"+.reqn$[.@x]+"^000000";} else {mes "You need more ^FF0000"+.reqn$[.@x]+"^000000";} } if (.zeny > 0) { if (Zeny < .zeny) {mes "You're missing ^FF0000Zeny^000000";} else {mes "You've got enough ^00FF00Zeny^000000";} } next; mes .npcname$; mes "Would you like to complete the quest?"; menu "Yes please!",-,"No Thanks",L_EXIT; next; for (set .@x,1; .@x < getarraysize(.reqid); set .@x,.@x + 1) { if(countitem(.reqid[.@x]) < .reqa[.@x]) goto L_EXIT2; } if (.zeny > 0) { if (Zeny < .zeny) goto L_EXIT2; } mes .npcname$; mes "Brilliant! Fantastic! Here you go."; for (set .@x,1; .@x < getarraysize(.reqid); set .@x,.@x + 1) { delitem .reqid[.@x],.reqa[.@x]; } if (.zeny > 0) { set Zeny, Zeny - .zeny; } goto L_FINAL2; close; L_EXIT: next; mes .npcname$; mes "Eh. I don't need you either. Bah!"; close; L_EXIT2: next; mes .npcname$; mes "I'm sorry, you don't have enough!"; close; L_FINAL2: next; mes .npcname$; mes "Brilliant! Fantastic! Here you go."; getitem .prize,1; close; } Just edit everywhere it has placeholders wrapped in <>. You can expand the NPC to contain as many required items as you wish, just keep adding entries to the arrays. I also have a version that doesn't require the input of item names. This version however I don't have laying around because the servers I have used this template on often have strange names for items in their item_dbs. I can recode release this version if requested. If you like my work, please rate the topic and give reputation! Thanks! 13 Quote Link to comment Share on other sites More sharing options...
Jude Posted December 2, 2011 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 9 Reputation: 0 Joined: 11/28/11 Last Seen: March 1, 2012 Share Posted December 2, 2011 Cool Script. goin to use this for my server Quote Link to comment Share on other sites More sharing options...
Judas Posted December 2, 2011 Group: Members Topic Count: 26 Topics Per Day: 0.01 Content Count: 2244 Reputation: 182 Joined: 11/19/11 Last Seen: September 15, 2024 Share Posted December 2, 2011 nicely done Quote Link to comment Share on other sites More sharing options...
leadtech Posted December 2, 2011 Group: Members Topic Count: 26 Topics Per Day: 0.01 Content Count: 59 Reputation: 2 Joined: 11/12/11 Last Seen: March 31, 2020 Share Posted December 2, 2011 Can i also put 1 or more quest in this Quest script ?? Quote Link to comment Share on other sites More sharing options...
Emistry Posted December 2, 2011 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted December 2, 2011 (edited) instead of using setarray .reqn$[1],"<name>","<name>","<name>"; //These are names of the required items, for the dialogue how about change to this ??? this could save uo alot work for users....unless they want a custom name for the item lists..xD getitemname( itemID ) LOL...i missed this part... >.< Sorry ~ I also have a version that doesn't require the input of item names. This version however I don't have laying around because the servers I have used this template on often have strange names for items in their item_dbs. I can recode release this version if requested. Edited December 3, 2011 by Emistry Quote Link to comment Share on other sites More sharing options...
LadyRingo Posted December 2, 2011 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 25 Reputation: 0 Joined: 11/22/11 Last Seen: December 16, 2011 Share Posted December 2, 2011 Will be using this. Quote Link to comment Share on other sites More sharing options...
Rikimaru Posted December 2, 2011 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 658 Reputation: 57 Joined: 11/20/11 Last Seen: July 1, 2017 Share Posted December 2, 2011 Nice Quest Template. Quote Link to comment Share on other sites More sharing options...
Jezu Posted December 2, 2011 Group: Members Topic Count: 29 Topics Per Day: 0.01 Content Count: 566 Reputation: 34 Joined: 11/17/11 Last Seen: January 24 Share Posted December 2, 2011 I'm using this now on my server. Thanks a lot Calciumkid! <3 it! 1 Quote Link to comment Share on other sites More sharing options...
manabeast Posted December 3, 2011 Group: Members Topic Count: 138 Topics Per Day: 0.03 Content Count: 835 Reputation: 25 Joined: 11/22/11 Last Seen: December 4, 2012 Share Posted December 3, 2011 in future maybe use for me. say thanks first ^^. Quote Link to comment Share on other sites More sharing options...
CalciumKid Posted December 3, 2011 Group: Members Topic Count: 25 Topics Per Day: 0.01 Content Count: 257 Reputation: 253 Joined: 11/29/11 Last Seen: February 21, 2014 Author Share Posted December 3, 2011 instead of using setarray .reqn$[1],"<name>","<name>","<name>"; //These are names of the required items, for the dialogue how about change to this ??? this could save uo alot work for users....unless they want a custom name for the item lists..xD getitemname( itemID ) I also have a version that doesn't require the input of item names. This version however I don't have laying around because the servers I have used this template on often have strange names for items in their item_dbs. I can recode release this version if requested. Would you like me to release that version? Quote Link to comment Share on other sites More sharing options...
Emistry Posted December 3, 2011 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted December 3, 2011 DX ......damn...i missed that part... >.< sry ~ Quote Link to comment Share on other sites More sharing options...
CalciumKid Posted December 3, 2011 Group: Members Topic Count: 25 Topics Per Day: 0.01 Content Count: 257 Reputation: 253 Joined: 11/29/11 Last Seen: February 21, 2014 Author Share Posted December 3, 2011 No worries, just thought you wanted it Quote Link to comment Share on other sites More sharing options...
Fjaan Posted December 4, 2011 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 17 Reputation: 1 Joined: 12/01/11 Last Seen: May 1, 2017 Share Posted December 4, 2011 (edited) Thanks heaps Just wondering (NEWB HERE) If i want to add more lines of "TALK" what should i be doing? Edited December 4, 2011 by Fjaan Quote Link to comment Share on other sites More sharing options...
CalciumKid Posted December 4, 2011 Group: Members Topic Count: 25 Topics Per Day: 0.01 Content Count: 257 Reputation: 253 Joined: 11/29/11 Last Seen: February 21, 2014 Author Share Posted December 4, 2011 Just add more mes lines where you feel they're needed. mes "rahrahrah"; Quote Link to comment Share on other sites More sharing options...
Fjaan Posted December 8, 2011 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 17 Reputation: 1 Joined: 12/01/11 Last Seen: May 1, 2017 Share Posted December 8, 2011 Just add more mes lines where you feel they're needed. mes "rahrahrah"; *Adds mes "rahrahrah";**I did what u said but when i open the npc it says "rahrahrah"* LOL Just kidding Thanks heaps man works great. Quote Link to comment Share on other sites More sharing options...
Tempo Posted January 5, 2012 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 26 Reputation: 0 Joined: 11/19/11 Last Seen: March 19, 2012 Share Posted January 5, 2012 Thanks! Very nice script. Quote Link to comment Share on other sites More sharing options...
Flaid Posted January 6, 2012 Group: Members Topic Count: 20 Topics Per Day: 0.00 Content Count: 398 Reputation: 140 Joined: 01/04/12 Last Seen: February 19, 2022 Share Posted January 6, 2012 This is great, I am sure it will help a lot of people who don't know much about scripting. 1 Quote Link to comment Share on other sites More sharing options...
Keim Posted March 5, 2012 Group: Members Topic Count: 27 Topics Per Day: 0.01 Content Count: 221 Reputation: 12 Joined: 12/18/11 Last Seen: July 13, 2015 Share Posted March 5, 2012 Although I'm not 100% familiar with arrays, I really like the quest style. Wish I knew more about arrays ! Quote Link to comment Share on other sites More sharing options...
jedwynne Posted June 28, 2012 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 68 Reputation: 2 Joined: 03/10/12 Last Seen: July 12, 2012 Share Posted June 28, 2012 just wated to ask if this template can be used in 2or more quest in same npc? if yes would you mind to give me some guide? Quote Link to comment Share on other sites More sharing options...
jutaysxd Posted November 1, 2012 Group: Members Topic Count: 63 Topics Per Day: 0.01 Content Count: 134 Reputation: 1 Joined: 09/29/12 Last Seen: June 27, 2015 Share Posted November 1, 2012 Just add more mes lines where you feel they're needed. mes "rahrahrah"; Should i Remove the <> ? when editing ? Quote Link to comment Share on other sites More sharing options...
Checkmate Posted November 16, 2012 Group: Members Topic Count: 96 Topics Per Day: 0.02 Content Count: 554 Reputation: 14 Joined: 09/24/12 Last Seen: November 20, 2024 Share Posted November 16, 2012 Yes you are.. you need to get rid < > sign... I wonder if i can make 5 or more quest on this script... Because it can save space for NPC on my RO town... (Sorry broken english) Quote Link to comment Share on other sites More sharing options...
mrfizi Posted January 3, 2013 Group: Members Topic Count: 20 Topics Per Day: 0.00 Content Count: 383 Reputation: 78 Joined: 10/30/12 Last Seen: March 17 Share Posted January 3, 2013 Will be use in my server soon. Thank you.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.