Jump to content
  • 0

who can edit this please?


eboni001

Question


  • Group:  Members
  • Topic Count:  79
  • Topics Per Day:  0.02
  • Content Count:  327
  • Reputation:   4
  • Joined:  06/22/13
  • Last Seen:  

hello guys, this is my ygg trader npc, the idea of this npc is to pack ygg into boxes of 10x Ygg but this npc have the option of ask how much ygg you want to pack, if somebody input want to pack only 1x ygg npc still giving the 10x ygg berry box, what i want is this npc only accept to pack ygg in multiple of 10 (10,20,30,etc) if somebody input an amount not in multiple of 10 npc wil say im sorry i only can pack ygg in multiple of 10.

 

this is my script:

prontera,144,173,3	script	Berry Trader#1::BT	91,{

    set $@npcname_mpq$, "^4000C0[Trader]^000000";
    mes $@npcname_mpq$;
    mes "Hi, I'm the Yggdrasil Berry Trader, I can pack them into boxes for easir trading! Would you like to do some packing?";
    next;
    menu "Yes, Please!",L_Berry,"No Thanks.",L_Exit;

L_Berry:
    mes $@npcname_mpq$;
    mes "Input the amount in multiples of 10 of yggdrassil berry you want to pack";
    next;
    input .@amount;
    if ( .@amount == 0 || countitem(607) < .@amount ) {
        mes $@npcname_mpq$;
        mes "Invalid amount";
        close;
    }

    delitem 607, .@amount;
    mes $@npcname_mpq$;
    mes "You really have " +.@amount+ " berrys? Okay, Let's trade!";
    getitem 14232,1;
    mes ". . .";
    mes "Thank you sweety. Dont ygg too much!";
    close;

LNotEnough:
    mes "You dont have the required items...?";
    mes "Come back when you are actually ready. Now gtfo!";
    close;

Lnotenuff:
    mes "Wtf, come back when you got the goods!";
    close;
L_Exit:
    close;
}

turbo_room,122,108,3	duplicate(BT)	Berry Trader#2	91
lighthalzen,177,89,1	duplicate(BT)	Berry Trader#3	91

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2350
  • Joined:  10/28/11
  • Last Seen:  


input .@amount;

if( ( .@amount % 10 ) > 0 ){

mes "Enter multiple of 10...";

close;

}

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  79
  • Topics Per Day:  0.02
  • Content Count:  327
  • Reputation:   4
  • Joined:  06/22/13
  • Last Seen:  

input .@amount;
if( ( .@amount % 10 ) > 0 ){
    mes "Enter multiple of 10...";
    close;
}

Thx Emistry you are awesome ^_^

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...