TreeChief Posted May 2, 2013 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 7 Reputation: 0 Joined: 04/26/13 Last Seen: May 6, 2013 Share Posted May 2, 2013 I need a simple NPC...that will exchange Proof of Donation for Kafra Credit Points...Tried making but I don't know how to getItem and exchange for KCP Quote Link to comment Share on other sites More sharing options...
Patskie Posted May 2, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 6 hours ago Share Posted May 2, 2013 Try: prontera,150,150,0 script Sample 100,{ mes .NPC$; mes "Can exchange your " +getitemname(.ID)+ " for kafra points. Want to exchange?"; next; if (select("Yes:No") - 1) close; mes .NPC$; mes "Okay how many " +getitemname(.ID)+ " will you exchange?"; next; input .@amount; if (.@amount == 0) { mes .NPC$; mes "Cannot trade 0 amount"; close; } mes .NPC$; mes "So you want to exchange " +.@amount+ "x " +getitemname(.ID); next; if (select("Yes:No") - 1) close; mes .NPC$; mes "Let me check if you have that amount of requirements"; next; if (countitem(.ID) < .@amount) { mes .NPC$; mes "Seems like you put an invalid amount"; close; } mes .NPC$; mes "Ohh that's nice here you go!"; delitem .ID,.@amount; set #KAFRAPOINTS,#KAFRAPOINTS+1; dispbottom "You now have " +#KAFRAPOINTS+ " kafra credit points"; next; mes .NPC$; mes "Success trading"; close; OnInit: set .NPC$,"[ " +strnpcinfo(1)+ " ]"; // NPC Name set .ID,7179; // Requirement end; } Quote Link to comment Share on other sites More sharing options...
TreeChief Posted May 3, 2013 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 7 Reputation: 0 Joined: 04/26/13 Last Seen: May 6, 2013 Author Share Posted May 3, 2013 Try: prontera,150,150,0 script Sample 100,{ mes .NPC$; mes "Can exchange your " +getitemname(.ID)+ " for kafra points. Want to exchange?"; next; if (select("Yes:No") - 1) close; mes .NPC$; mes "Okay how many " +getitemname(.ID)+ " will you exchange?"; next; input .@amount; if (.@amount == 0) { mes .NPC$; mes "Cannot trade 0 amount"; close; } mes .NPC$; mes "So you want to exchange " +.@amount+ "x " +getitemname(.ID); next; if (select("Yes:No") - 1) close; mes .NPC$; mes "Let me check if you have that amount of requirements"; next; if (countitem(.ID) < .@amount) { mes .NPC$; mes "Seems like you put an invalid amount"; close; } mes .NPC$; mes "Ohh that's nice here you go!"; delitem .ID,.@amount; set #KAFRAPOINTS,#KAFRAPOINTS+1; dispbottom "You now have " +#KAFRAPOINTS+ " kafra credit points"; next; mes .NPC$; mes "Success trading"; close; OnInit: set .NPC$,"[ " +strnpcinfo(1)+ " ]"; // NPC Name set .ID,7179; // Requirement end; } Hmm didn't work when I just try adding it, I will try restarting server. Quote Link to comment Share on other sites More sharing options...
Patskie Posted May 3, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 6 hours ago Share Posted May 3, 2013 Try: prontera,150,150,0 script Sample 100,{ mes .NPC$; mes "Can exchange your " +getitemname(.ID)+ " for kafra points. Want to exchange?"; next; if (select("Yes:No") - 1) close; mes .NPC$; mes "Okay how many " +getitemname(.ID)+ " will you exchange?"; next; input .@amount; if (.@amount == 0) { mes .NPC$; mes "Cannot trade 0 amount"; close; } mes .NPC$; mes "So you want to exchange " +.@amount+ "x " +getitemname(.ID); next; if (select("Yes:No") - 1) close; mes .NPC$; mes "Let me check if you have that amount of requirements"; next; if (countitem(.ID) < .@amount) { mes .NPC$; mes "Seems like you put an invalid amount"; close; } mes .NPC$; mes "Ohh that's nice here you go!"; delitem .ID,.@amount; set #KAFRAPOINTS,#KAFRAPOINTS+1; dispbottom "You now have " +#KAFRAPOINTS+ " kafra credit points"; next; mes .NPC$; mes "Success trading"; close; OnInit: set .NPC$,"[ " +strnpcinfo(1)+ " ]"; // NPC Name set .ID,7179; // Requirement end; } Hmm didn't work when I just try adding it, I will try restarting server. Post error if any occur. Well tried this and it works. Also want to add a check on the script. If amount is greater than pods then terminate. Forgot to add. if (countitem(.ID) > .@amount) close; Quote Link to comment Share on other sites More sharing options...
TreeChief Posted May 3, 2013 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 7 Reputation: 0 Joined: 04/26/13 Last Seen: May 6, 2013 Author Share Posted May 3, 2013 Where would I add the check? Is it for if they have the correct amount or don't have any? Quote Link to comment Share on other sites More sharing options...
Capuche Posted May 3, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted May 3, 2013 This check is not significant. No need to add it Quote Link to comment Share on other sites More sharing options...
TreeChief Posted May 3, 2013 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 7 Reputation: 0 Joined: 04/26/13 Last Seen: May 6, 2013 Author Share Posted May 3, 2013 This check is not significant. No need to add it Hmm I don't get why it is not working then...The script looks very well done without error. Quote Link to comment Share on other sites More sharing options...
Capuche Posted May 3, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted May 3, 2013 prontera,150,150,0%tab%script%tab%Sample%tab%100,{ Check the header, there are space instead of tab Quote Link to comment Share on other sites More sharing options...
Question
TreeChief
I need a simple NPC...that will exchange Proof of Donation for Kafra Credit Points...Tried making but I don't know how to getItem and exchange for KCP
Link to comment
Share on other sites
7 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.