Jump to content
  • 0

#CASHPOINTS to Items


Question

Posted (edited)

Hi, I wonder if its possible to change #CASHPOINTS to Gold Coins (7517) ? Or is there any NPC that converts the Gold Coins to #CASHPOINTS ?

 

EDIT: My mistake, what I'm trying to say is, A NPC that converts Gold Coins to Cash Points.

Edited by lionellex

8 answers to this question

Recommended Posts

  • 0
Posted (edited)

Ops my mistake, what I'm trying to say is, A NPC that converts Gold Coins to Cash Points.

 

EDIT:

prt_in,47,101,2	script	Cash Exchanger	721,{
    mes .NPC$;
    mes "Can exchange your " +getitemname(.ID)+ " for Cash 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 #CASHPOINTS,#CASHPOINTS+10;
    dispbottom "You now have " +#CASHPOINTS+ " Cash Points";
    next;
    mes .NPC$;
    mes "Success trading";
    close;
    
    OnInit:
        set .NPC$,"[ " +strnpcinfo(1)+ " ]"; // NPC Name
        set .ID,7517; // Requirement
        end;
}

Okay I found this script from THIS thread. I kinda change a little here and there.

Everything works fine, except 1 issue. whenever I give this NPC more than 1 piece of GOLD COIN, it will still give me only 10 Cash Points.

 

How do I set it to give more than just 10 Cash Point when I give this NPC more than 1 piece of GOLD COIN.

Edited by lionellex
  • 0
Posted (edited)

 

Change this...

set #CASHPOINTS,#CASHPOINTS+10;

to this...

set #CASHPOINTS,#CASHPOINTS+(.@amount*10);

Thanks sir, its working now. Thanks a lot.

Edited by lionellex
  • 0
Posted

set command is deprecated. Use direct assignment instead.

For example: #CASHPOINTS += (.@amount*10);

 

Okay so I change

set #CASHPOINTS,#CASHPOINTS+(.@amount*10);

to 

set #CASHPOINTS += (.@amount*10);

like this?

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...