Jump to content
  • 0

custom points = item


VladimirCastro

Question


  • Group:  Members
  • Topic Count:  114
  • Topics Per Day:  0.03
  • Content Count:  298
  • Reputation:   4
  • Joined:  03/13/12
  • Last Seen:  

hi i would like to have an npc that will exchange my custom points to an item id 7350

Link to comment
Share on other sites

8 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  135
  • Reputation:   41
  • Joined:  02/05/14
  • Last Seen:  


/*=========================================================

Points to Item Exchanger

by Mumbles

===========================================================

Request: http://goo.gl/MplDtF

===========================================================

Preview:

===========================================================

Description:

Exchanges items for points and vice-versa at a fixed rate.

===========================================================

Compatibility:

Optimised for rAthena emulators.

===========================================================

Changelog:

v1.0 - First version.

v1.0.1 - Added changelog.

v1.0.2 - Removed reverse transactions. [Missingno]

v1.0.3 - Adjusted rates. [Missingno]

v1.1 - Compatibilised for rAthena emulators. [Missingno]

=========================================================*/

prontera,164,169,3 script Point Exchanger::points2item 871,{

/*-----------------------------------------------------

Script

-----------------------------------------------------*/

mes .npc_name$;

mes "Hello there, ^FF8800"+ strcharinfo(0) +"^000000! "+

"Would you exchange your "+ .points_name$ +" "+

"for "+ .pod_name$ +"?";

mes " ";

mes "Exchange Rate: "+ .rate +":1";

mes .points_name$ +": [^FF0000"+ getd(.points_var$) +"^000000]";

next;

switch (select(implode(.menu_options$, ":"))) {

case 1:

mes .npc_name$;

mes "Okay, come back if you change your mind!";

break;

case 2:

mes .npc_name$;

mes "Please enter the amount of "+ .points_name$ +" that you want to exchange.";

do {

mes " ";

mes "Input ^0000FF0^000000 to cancel.";

next;

input .@amount;

.@total = .@amount / .rate;

// Check break input

if (!.@amount) {

message strcharinfo(0), strnpcinfo(1) +" : Exchange terminated.";

close;

}

// Check amount against points

if (getd(.points_var$) < .@amount) {

mes .npc_name$;

mes "^FF0000Please enter a valid amount.^000000";

}

} while (getd(.points_var$) < .@amount);

// Check weight

if (!checkweight(.pod_id, .@total)) {

mes .npc_name$;

mes "^FF0000You're overweight; please store some items.^000000";

break;

}

setd .points_var$, getd(.points_var$) - .@amount;

getitem .pod_id, .@total;

mes .npc_name$;

mes "You've exchanged "+ .@amount +" "+ .points_name$ +" for "+ .@total +" "+ .pod_name$ +". "+

"You now have "+ getd(.points_var$) +" "+ .points_name$ +" and "+ countitem(.pod_id) +" "+ .pod_name$ +".";

break;

}

close;

/*-----------------------------------------------------

Configuration

-----------------------------------------------------*/

OnInit:

.npc_name$ = "[^0000FFPoint Exchanger^000000]";

.rate = 20; // Exchange rate (rate = 1 PoDs)

.pod_id = 7350; // Proof of Donation item ID or constant

.pod_name$ = getitemname(.pod_id) +"(s)"; // Proof of Donation item name

.points_name$ = "Cash Point(s)"; // Points name

.points_var$ = "#CASHPOINTS"; // Points variable

// Modifying these options requires updates to the corresponding case

setarray .menu_options$[0], "^FF0000>^000000 Cancel",

"^0000FF>^000000 Exchange "+ .points_name$ +" for "+ .pod_name$;

end;

}

  • Upvote 2
Link to comment
Share on other sites

  • 1

  • Group:  Members
  • Topic Count:  86
  • Topics Per Day:  0.02
  • Content Count:  591
  • Reputation:   146
  • Joined:  06/19/12
  • Last Seen:  

prontera,155,155,4    script    Converter    83,{

    .@name$ ="[^FF0000Converter^000000]";



    mes .@name$;

    mes "Hello, 1 cashpoints is equals to 1 Pass.";

    mes "What would you like to do?";

    next;



    switch( select("Cash to Pass","Pass to Cash") ) {

        case 1:

            mes .@name$;

            mes "How many pass(s) do you want?";

            input .@num;

            next;



            if( .@num <= 0 || #CASHPOINTS < .@num * 1 ) {

                mes .@name$;

                mes "Sorry, you don't have enough cashpoints!";

                close;

            }

            mes .@name$;

            mes "This will cost ^FF0000" +(.@num * 1)+ " cashpoints^000000.";

            next;



            if( select("Proceed:Nevermind") -1 ) {

                mes .@name$;

                mes "Goodbye!";

                close;

            }

            set #CASHPOINTS, #CASHPOINTS - .@num * 1;

            dispbottom "Lost: " +(.@num * 1)+ " cashpoints. Total: " +#CASHPOINTS+" cashpoints.";

            getitem 7350 , .@num;

            break;

    

        case 2:

            mes .@name$;

            mes "How many Pass(s) will you give?";

            input .@num;

            next;



            if( .@num <= 0 || countitem(7350 ) < .@num ) {

                mes .@name$;

                mes "Sorry, you don't have enough Pass !";

                close;

            }

            mes .@name$;

            mes "I can give you ^FF0000" +(.@num * 1)+ " cashpoints^000000 for this.";

            next;



            if( select("Proceed:Nevermind") -1 ) {

                mes .@name$;

                mes "Goodbye!";

                close;

            }

            set #CASHPOINTS, #CASHPOINTS + .@num * 1;

            dispbottom "Gained: " +(.@num * 1)+ " cashpoints. Total: " +#CASHPOINTS+" cashpoints.";

            delitem 7350 ,.@num;

    }

    close;

}

chnage all #CASHPOINTS to your #Points

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

 

chnage all #CASHPOINTS to your #Points

 

 

Why space it out so hard to read. xD

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  114
  • Topics Per Day:  0.03
  • Content Count:  298
  • Reputation:   4
  • Joined:  03/13/12
  • Last Seen:  

well i want something like no vice versa just an npc that u can redeem ur pass if u have 20 points

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  135
  • Reputation:   41
  • Joined:  02/05/14
  • Last Seen:  

Here's a useful script from another board that would suit your needs (with a little tweaking for compatibility): Points to Item Exchanger

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  114
  • Topics Per Day:  0.03
  • Content Count:  298
  • Reputation:   4
  • Joined:  03/13/12
  • Last Seen:  

Here's a useful script from another board that would suit your needs (with a little tweaking for compatibility): Points to Item Exchanger

as i said no vice versa . i want something like he will talk and at the end will give the pass. if he meet the requirment of 20points

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  135
  • Reputation:   41
  • Joined:  02/05/14
  • Last Seen:  

as i said no vice versa . i want something like he will talk and at the end will give the pass. if he meet the requirment of 20points

Why not take the script and simply remove the reversed transaction? You'd literally comment out two blocks of code. o_o

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  114
  • Topics Per Day:  0.03
  • Content Count:  298
  • Reputation:   4
  • Joined:  03/13/12
  • Last Seen:  

 

as i said no vice versa . i want something like he will talk and at the end will give the pass. if he meet the requirment of 20points

Why not take the script and simply remove the reversed transaction? You'd literally comment out two blocks of code. o_o

 

sorry but im really noob with script im here for request. im  requesting if someone can do it. so if someone can provide me the script then really appreciate it

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...