Jump to content
  • 0

Item script seems to not function well


iubantot

Question


  • Group:  Members
  • Topic Count:  117
  • Topics Per Day:  0.03
  • Content Count:  312
  • Reputation:   34
  • Joined:  10/15/12
  • Last Seen:  

62003,Spirit of Gryphon,Gryphon Egg Scroll,18,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ .@i = rand(100); if(.@i < 3){ .@x = callfunc("F_Rand",20069,5471); getitem .@x,1; announce "(" + strcharinfo(0) + "), won a <" + getitemname(.@x) + "> from <" + getitemname(62003) + ">!",bc_all,0xFFFF00; } else if(.@i < 7){ getitem callfunc("F_Rand",6230,6234),1; } else if(.@i < 15){ getitem callfunc("F_Rand",19537,20270,19669,5660),1; } else{ getitem callfunc("F_Rand",12684,14524,12710,12437,12214,12210),rand(3); } },{},{}

 

So i have this custom item where i used nested if as the item script, but sometimes when i open there are chances that you will not get any item at all.

what seems to be wrong here?

*note : i know we have item_package but i find it easier using this method because i dont have to add const id when making scrolls.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  120
  • Reputation:   48
  • Joined:  07/23/13
  • Last Seen:  

2 hours ago, iubantot said:

rand(3);

On the last line, you should use rand(1,3) since rand(3) will get you 0,1,2.
Also I check the getitem src, when getitem amount <=0 it will not give you the item.

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  117
  • Topics Per Day:  0.03
  • Content Count:  312
  • Reputation:   34
  • Joined:  10/15/12
  • Last Seen:  

Just now, yuchinin said:

On the last line, you should use rand(1,3) since rand(3) will get you 0,1,2.
Also I check the getitem src, when getitem amount <=0 it will not give you the item.

Oh I see thank you so much! hahaha what silly mistake really appreciated! thanks again! 

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