Jump to content
  • 0

whats wrong with this 2 npc's?


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, i have a problem with 2 npc's, Guild Manager and Berry Trader:

 

-- The problem with the guild manager is i want before he make a guild he ask for 3 items, 1pc TCG Card, 5 Platinum Coins and 1 emperium, he ask for the items but if player dont have the 5 platinum coins he still make the guild(if player have them it will delete them but if player doesn't have it it will make the guild anyway) does somenone can fix it please?

prontera.gat,171,227,3	script	Guild Manager#1::GM	531,{

    set .item1, 7227; // Item ID 1
    set .item2, 677; // Item ID 2
    set .itemreq1, 1; // Ammount of item number 1 (9 since an emp is also consumed naturally upon guild creation)
    set .itemreq2, 5; // Ammount of item number 2
    set .name$, "[^0000ffGuild Manager^000000]";
    mes .name$;
    mes "Hello there ^FF0000 "+strcharinfo(0)+" ^000000.";
    mes "I can help you form a guild or disband your current one.";
    next;
    menu "Sign-up for Guild Creation.",L_approve,"Disband Guild.",L_disband,"Any requirements?",L_req,"No thanks.",L_cya;

L_approve:
    next;
    mes .name$;
    mes "Alright, I need you to tell me the name you want for your guild.";
    sleep2 1500;
    input @gcreatenm$;
    mes "Are you sure that's what you want?";
    switch(select("Yes:No")) {

case1:
    if(countitem(.item1) < .itemreq1) && (countitem(.item2) < .itemreq2) { goto L_nope; end; }
    mes .name$;
    mes "Alright then let's try this...";
    atcommand "@guild "+@gcreatenm$;
    next;
    if(getcharid(2) == 0) { mes "Woops, seems like that guild already exists...try another name."; goto L_create; end; }
    announce strcharinfo(0)+" has created "+strcharinfo(2)+" Guild!",0;
    mes .name$;
    mes "Congrats.";
    delitem .item1, .itemreq1;
    delitem .item2, .itemreq2;
    close;
    end;

case2:
    goto L_create;
    end;
    }

L_disband:
    if(getcharid(2) == 0) { goto L_noguild; end; }
    if(getguildmaster(getcharid(2)) == strcharinfo(0)) { next; mes .name$; mes "Type this:"; mes "^FF0000 @breakguild ^000000 ''^0000ff "+strcharinfo(2)+" ^000000''"; close; end; }
    else { mes .name$; mes "You're not the guild leader."; close; end; }

L_req:
    next;
    mes .name$;
    mes "To make a guild you'll need ^0000ff 1 ^000000 ^FF0000 Emperium ^000000 + ^0000ff 1 ^000000 piece of ^FF0000 TCG Card ^000000 and ^0000ff 5 ^000000 pieces of ^FF0000 Platinum Coins ^000000.";
    close;
    end;
    
L_nope:
    next;
    mes .name$;
    mes "Bring me the items first!";
    close;

L_noguild:
    next;
    mes .name$;
    mes "You're not even in a guild!";
    close;

L_cya:
    next;
    mes .name$;
    mes "Next time then!";
    close;

}

payon,164,219,2	duplicate(GM)	Guild Manager#2	531

 

-- The problem with this Berry trader is i want people can pack their ygg into boxes of 10 ygg and i want npc only accept if people enter multiples of 10, when somebody talk to the npc

he ask how much ygg you want to pack, if you put 0 he still give you the 10 ygg box -_- people was getting free ygg from this npc only by enter they want to pack 0 ygg.

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 % 10 ) > 0 ){
        mes $@npcname_mpq$;
        mes "What the hell? are you trying to scam me?";
        mes "Get out of here and next time use mutiples of 10 >,>";
        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;
}

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

please help me here ^_^

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   338
  • Joined:  10/17/12
  • Last Seen:  

Second one there are 2 problems

First

If( .@amount % 10 > 0)

Should be

If(.@amount % 10 != 0 || .@amount < 1)

Secondly

Getitem 14232,1;

Should be

Getitem 14232, .@amount / 10;


On phone so odd no codebox.

Edited by Patskie
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

Fix to issue 1:

Change:
if(countitem(.item1) < .itemreq1) && (countitem(.item2) < .itemreq2) { goto L_nope; end; }

INTO

if( (countitem(.item1) < .itemreq1) || (countitem(.item2) < .itemreq2) ) { goto L_nope; end; }

 

For your Second Problem, I see more than just that issue. For 1, your asking for Multiple of tens, but you only give them 1 box. If your going to do that, just make it a menu. Instead of input.

  • 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:  

Fix to issue 1:

Change:
if(countitem(.item1) < .itemreq1) && (countitem(.item2) < .itemreq2) { goto L_nope; end; }

INTO

if( (countitem(.item1) < .itemreq1) || (countitem(.item2) < .itemreq2) ) { goto L_nope; end; }

 

For your Second Problem, I see more than just that issue. For 1, your asking for Multiple of tens, but you only give them 1 box. If your going to do that, just make it a menu. Instead of input.

Thank you problem #1 solved, ^_^

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