Jump to content
  • 0

MVP Box


mathibas

Question


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  18
  • Reputation:   0
  • Joined:  09/07/14
  • Last Seen:  

I am trying to create a script that when an mvp monster is killed it will reward an item. I'm no good at scripting I am just trying to understand how it works and all. Is this the correct way? 

 

 

- script MVPBox -1,{

        OnNPCKillEvent:
        setarray .@BOSSID[0],1511,1038,1272,1389,1086,1251;
        setarray .@HMVP[0],1647,1785,1630,1039,1874,2068,2238,2240,2236,2253,1719,1046,1112,1115,1418,1871,1252,2251,1768,2165,1885,2241,1649,1651,1832,1492,2255,1734,2202,1779;
                if ( getmonsterinfo( killedrid,22) && getarraysize( .@BOSSID ) ) {
                                getitem 13909,1;
                }
                else if ( getmonsterinfo( killedrid,22) && getarraysize( .@HMVP ) ) {
                                getitem 19508,1;
               }
      end;
}

 

I don't think its working at all. What I have in mind is mvp box will drop when the mvp spawn time is 1-2 hours and another mvp box when the mvp spawn time is more than 2 hours.

 

Thanks in advance.

Edited by mathibas
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  74
  • Topics Per Day:  0.02
  • Content Count:  420
  • Reputation:   89
  • Joined:  01/30/12
  • Last Seen:  

I'm a rookie in scripting, but this does not seem to be right to me:

if ( getmonsterinfo( killedrid,22) && getarraysize( .@BOSSID ) ) {

getarraysize returns the size of the array, and not whether the item is inside the array or not. You need to do a search in the arrays you defined.

Currently you need to loop through the arrays and check every item, but someday this might get into prod

http://rathena.org/board/topic/92070-suggestion-new-scriptcommand-search-array/

Link to comment
Share on other sites


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

you can try this

http://upaste.me/r/0fdab0

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