dungpt8782 Posted April 1, 2014 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 16 Reputation: 0 Joined: 02/21/14 Last Seen: May 28, 2017 Share Posted April 1, 2014 Hi, i'm newbie, i dont know alot of function to make custome NPC, so someone can help me to make this event please! My idea is: - Make NPC in somewhere, - For every hour will announce "I need rand(card), please trade with me to receive rand(1,3) points",bc_all, - When players bring that card to trade with NPC, they will receive points in announce; Thank you for help. Quote Link to comment Share on other sites More sharing options...
Yuka Posted April 2, 2014 Group: Members Topic Count: 100 Topics Per Day: 0.02 Content Count: 333 Reputation: 7 Joined: 03/01/14 Last Seen: May 6, 2020 Share Posted April 2, 2014 (edited) Change first line to your desired map, position, direction, display name and sprite id. Change "CardEventPoints" to your desired variable name for the points. Add '##' as prefix if it should be accountwise instead of characterwise. Add Card IDs to the blockedcards array like this:setarray .blockedcards[0],4001,4002; Couldn't test it myself, just report any errors it throws if you cannot fix them yourself. mapname,x,y,direct script Name id,{ if (.game){ mes .npcname$; if(countitem(.cardid) < 1){ mes "You don't have my ^ff0000"+getitemname(.cardid)+"^000000!!"; close; end; } mes "Oh you've brought me my ^ff0000"+getitemname(.cardid)+"^000000."; mes "Can I have it please?"; if(select("Yes:No")==2){ next; mes .npcname$; mes "Aww.."; close; end; } next; mes .npcname$; mes "Woooow, thank you! Here are your "+.pointamount+" point(s)!"; delitem .cardid,1; set CardEventPoints, CardEventPoints+.pointamount; set .game,0; close; end; } else{ mes .npcname$; mes "Sorry, I don't need a card at the moment."; close; end; } end; L_start: OnMinute11: set .cardid, rand(4001,4453); //card id ranges from 4001 to 4453 for(set .@i, 0; .@i < getarraysize(.blockedcards); set .@i, .@i+1){ if (.blockedcards[.@i] == .cardid){ goto L_start; end; } } set .pointamount, rand(1,3); set .game,1; announce .npcname$+": I need a "+getitemname(.cardid)+".",0; end; OnInit: set .pointamount, 0; set .cardid, 0; set .npcname$,"Name"; //npc name setarray .blockedcards[0],0; //add cards you don't want to happen here set .game,0; end; } Edited April 2, 2014 by Greyford Quote Link to comment Share on other sites More sharing options...
dungpt8782 Posted April 2, 2014 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 16 Reputation: 0 Joined: 02/21/14 Last Seen: May 28, 2017 Author Share Posted April 2, 2014 Thank you Greyford, i will try and report here soon. rand(4001,4453) 4001 - 4453 is all normal card ID yet? prontera,155,86,4 script vnRO 751,{ if (.game){ mes .npcname$; if(countitem(.cardid) < 1){ mes "You don't have my ^ff0000"+getitemname(.cardid)+"^000000!!"; close; end; } mes "Oh you've brought me my ^ff0000"+getitemname(.cardid)+"^000000."; mes "Can I have it please?"; if(select("Yes:No")==2){ next; mes .npcname$; mes "Aww.."; close; end; } next; mes .npcname$; mes "Woooow, thank you! Here are your "+.pointamount+" Poring coin(s)!"; delitem .cardid,1; getitem 7539,.pointamount; //get poring coin // set CardEventPoints, CardEventPoints+.pointamount; // set .game,0; close; end; } end; L_start: OnMinute24: set .cardid, rand(4001,4453); //card id ranges from 4001 to 4453 for(set .@i, 0; .@i < getarraysize(.blockedcards); set .@i, .@i+1){ if (.blockedcards[.@i] == .cardid){ goto L_start; end; } } set .pointamount, rand(1,3); set .game,1; announce .npcname$+": I need a "+getitemname(.cardid)+" for "+.pointamount+" Poring Coins .",0; end; OnInit: set .pointamount, 0; set .cardid, 0; set .npcname$,"vnRO"; //npc name setarray .blockedcards[0],0; //add cards you don't want to happen here set .game,0; end; } This is my script i made follow you, it worked perfect. I changed - get point to get Poring Coin. - Will unlimit exchange card to coin times. - I still need set .game,0; OnInit? Thank you for support! Quote Link to comment Share on other sites More sharing options...
Yuka Posted April 2, 2014 Group: Members Topic Count: 100 Topics Per Day: 0.02 Content Count: 333 Reputation: 7 Joined: 03/01/14 Last Seen: May 6, 2020 Share Posted April 2, 2014 Oh, you want the event to run a whole hour so everyone can exchange their cards? I thought you just want to reward the first one who brings the card, that's why I had the .game variable to check if there actually is a game or not. You need to watch out then since when there comes an easy card people will just collect 100 and exchange them. For the IDs check your item_db.txt in your db, db/pre-re or db/re folder (depending on what you run). 4001 - 4453 contains all pre-renewal cards including MvP Cards as far as I know. Quote Link to comment Share on other sites More sharing options...
Question
dungpt8782
Hi, i'm newbie, i dont know alot of function to make custome NPC, so someone can help me to make this event please!
My idea is:
- Make NPC in somewhere,
- For every hour will announce "I need rand(card), please trade with me to receive rand(1,3) points",bc_all,
- When players bring that card to trade with NPC, they will receive points in announce;
Thank you for help.
Link to comment
Share on other sites
3 answers to this question
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.