Jump to content
  • 0
Sign in to follow this  
hadiesyafiq

Need help about if and else on script

Question

hi i want make this script will work if we have just one of 3 different item

1 got 3 kind of item apple,meat and orange...this script will be use if we have one of the item..

example

 

-    script    VIP    FAKE_NPC,{

    OnPCLoginEvent:
        if (countitem(apple) > 0)
        {
            setparam(125, 55 * .exp_rate); // SP_MOD_EXP
            setparam(126, 40 * .drop_rate); // SP_MOD_DROP
            setparam(127, 0); // SP_MOD_DEATH
        }
        else
        {
            setparam(125, 100); // SP_MOD_EXP
            setparam(126, 100); // SP_MOD_DROP
            setparam(127, 0); // SP_MOD_DEATH
        }
    end;

    OnPCLoginEvent:
        if (countitem(meat) > 0)
        {
            setparam(125, 55 * .exp_rate); // SP_MOD_EXP
            setparam(126, 40 * .drop_rate); // SP_MOD_DROP
            setparam(127, 0); // SP_MOD_DEATH
        }
        else
        {
            setparam(125, 100); // SP_MOD_EXP
            setparam(126, 100); // SP_MOD_DROP
            setparam(127, 0); // SP_MOD_DEATH
        }
    end;

    OnPCLoginEvent:
        if (countitem(orange) > 0)
        {
            setparam(125, 55 * .exp_rate); // SP_MOD_EXP
            setparam(126, 40 * .drop_rate); // SP_MOD_DROP
            setparam(127, 0); // SP_MOD_DEATH
        }
        else
        {
            setparam(125, 100); // SP_MOD_EXP
            setparam(126, 100); // SP_MOD_DROP
            setparam(127, 0); // SP_MOD_DEATH
        }
    end;

}

 

not work like above..i forgot how to make script if and else...can someone show me the script?

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0
if (countitem(apple) > 0 || countitem(meat) > 0 || countitem(orange) > 0){
//
} else {
//
}
Edited by gantz

Share this post


Link to post
Share on other sites
  • 0

totally don't understand what this trying to do

on 1 thing, when player login, it will check the item, and if the player has the item, adjust the VIP like bonus

 

1. what happens if the player drop the item ? will it recalculate the exp bonus ?

2. what happens if the player has multiple of the said items ? will it stack the bonus ?

 

3. why use an item ????????

 

4. use OnPCStatCalcEvent ????? or Charms ???

 

5. is the bonus is bind to an account ???? or bind to an item ???

 

6. where the the .exp_rate comes from ?? if this isn't set anywhere, they actually get 0 because anything times ZERO is equal to ZERO

	setparam(125, 55 * .exp_rate); // SP_MOD_EXP
	setparam(126, 40 * .drop_rate); // SP_MOD_DROP
 	setparam(127, 0); // SP_MOD_DEATH

 

I have so many questions I don't even know where to start

 

 

EDIT: I think no.6 just forgot to add getbattleflag("<something>")

Edited by AnnieRuru

Share this post


Link to post
Share on other sites
  • 0
50 minutes ago, AnnieRuru said:

totally don't understand what this trying to do

on 1 thing, when player login, it will check the item, and if the player has the item, adjust the VIP like bonus

 

1. what happens if the player drop the item ? will it recalculate the exp bonus ?

2. what happens if the player has multiple of the said items ? will it stack the bonus ?

 

3. why use an item ????????

 

4. use OnPCStatCalcEvent ????? or Charms ???

 

5. is the bonus is bind to an account ???? or bind to an item ???

 

6. where the the .exp_rate comes from ?? if this isn't set anywhere, they actually get 0 because anything times ZERO is equal to ZERO

setparam(125, 55 * .exp_rate); // SP_MOD_EXP setparam(126, 40 * .drop_rate); // SP_MOD_DROP setparam(127, 0); // SP_MOD_DEATH


	setparam(125, 55 * .exp_rate); // SP_MOD_EXP
	setparam(126, 40 * .drop_rate); // SP_MOD_DROP
 	setparam(127, 0); // SP_MOD_DEATH

 

I have so many questions I don't even know where to start

 

 

EDIT: I think no.6 just forgot to add getbattleflag("<something>")

yes @AnnieRuru i use your charms plugins

thats script above is just example...i made new item use charms plugins vip will bind to item its mean only the character have it will get vip bonus...the item can be store but cannot trade or drops...but have 3 item to get same script effect like 3day/7day/30day with rental script

here like this 

-    script    VIP    FAKE_NPC,{

    OnInit:
        // Players Exp rate (Base and Job Experience)
        // 0 = No Exp
        // 1 = Normal Exp
        // 2 = 2x Exp
        .exp_rate = 2;

        // Players Drop rate
        // 0 = No Drop
        // 1 = Normal Drop
        // 2 = 2x Drop
        .drop_rate = 3;

    end;

    OnPCLoginEvent:
        if (countitem(newitem1) > 0)

        {
            setparam(125, 55 * .exp_rate); // SP_MOD_EXP
            setparam(126, 40 * .drop_rate); // SP_MOD_DROP
            //setparam(127, 0); // SP_MOD_DEATH
        }
        else
        {
            setparam(125, 100); // SP_MOD_EXP
            setparam(126, 100); // SP_MOD_DROP
            //setparam(127, 100); // SP_MOD_DEATH
        }
    end;

 OnPCLoginEvent:
        if (countitem(newitem3) > 0)

        {
            setparam(125, 55 * .exp_rate); // SP_MOD_EXP
            setparam(126, 40 * .drop_rate); // SP_MOD_DROP
            //setparam(127, 0); // SP_MOD_DEATH
        }
        else
        {
            setparam(125, 100); // SP_MOD_EXP
            setparam(126, 100); // SP_MOD_DROP
            //setparam(127, 100); // SP_MOD_DEATH
        }
    end;

 OnPCLoginEvent:
        if (countitem(newitem1) > 0)

        {
            setparam(125, 55 * .exp_rate); // SP_MOD_EXP
            setparam(126, 40 * .drop_rate); // SP_MOD_DROP
            //setparam(127, 0); // SP_MOD_DEATH
        }
        else
        {
            setparam(125, 100); // SP_MOD_EXP
            setparam(126, 100); // SP_MOD_DROP
            //setparam(127, 100); // SP_MOD_DEATH
        }
    end;

}

 

1 hour ago, gantz said:

if (countitem(apple) > 0 || countitem(meat) > 0 || countitem(orange) > 0){ // } else { // }


if (countitem(apple) > 0 || countitem(meat) > 0 || countitem(orange) > 0){
//
} else {
//
}

Thanks sir @gantz

Edited by hadiesyafiq

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.