Jump to content
  • 0

R> MVP custom drop


Quesooo

Question


  • Group:  Members
  • Topic Count:  197
  • Topics Per Day:  0.08
  • Content Count:  883
  • Reputation:   28
  • Joined:  02/13/17
  • Last Seen:  

Hi good day i would like to request a mvp custom drop item script example

 

if you kill amon.ra or any mvp monster with a chance of 0.02% the monster will drop a random ( 1 item only ) on this list

a random enchanted armor or enchanted weapon +10

 

just 1 item in random drop with announcement 

 

thank you

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

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

@Wickedknight2 your method aren't quite correct, you shall randomize the value when it roll the items. Otherwise your script end up always giving the same item.

 

could try something like this.

https://pastebin.com/PZzpiz6V

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  39
  • Reputation:   5
  • Joined:  06/09/17
  • Last Seen:  

-    script    MvPKill    ,{

OnNPCKillEvent:
 if( getmonsterinfo( killedrid,MOB_MVPEXP ) ){
set .Dice,rand(1,10000){ // 1 =  0,01%

if(.Dice <= .Chance){

getitem2 .PossibleItems[.RandItem],1,rand(.MinEnchant,.MaxEnchant),0,.RandEnchant1,.RandEnchant2,.RandEnchant3,.RandEnchant4;


}

}
}
end;


OnInit:
set .Chance,2; // Set the drop chance here
setarray .PossibleItems[0], ;//<- Put your items IDs here. I.E:  .PossibleItems[0],123,124,125;
setarray .PossibleEnchants[0], ;//<- Put your enchants IDs here
set .MinEnchant,0; // Minimum possible enchant
set .MaxEnchant,20; // Max Possible enchant
set .RandItem,rand(.SizeItem);
set .RandEnchant1,rand(.SizeEnchants);
set .RandEnchant2,rand(.SizeEnchants);
set .RandEnchant3,rand(.SizeEnchants);
set .RandEnchant4,rand(.SizeEnchants);
set .SizeItem,getarraysize(.PossibleItems);
set .SizeEnchants,getarraysize(.PossibleEnchants);
end;

}

   Haven't tested it tho, so let me know if anything goes wrong ? 
   Have in mind it will get you an item with enchants on the 4 slots.

  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  197
  • Topics Per Day:  0.08
  • Content Count:  883
  • Reputation:   28
  • Joined:  02/13/17
  • Last Seen:  

16 hours ago, Wickedknight2 said:

-    script    MvPKill    ,{

OnNPCKillEvent:
 if( getmonsterinfo( killedrid,MOB_MVPEXP ) ){
set .Dice,rand(1,10000){ // 1 =  0,01%

if(.Dice <= .Chance){

getitem2 .PossibleItems[.RandItem],1,rand(.MinEnchant,.MaxEnchant),0,.RandEnchant1,.RandEnchant2,.RandEnchant3,.RandEnchant4;


}

}
}
end;


OnInit:
set .Chance,2; // Set the drop chance here
setarray .PossibleItems[0], ;//<- Put your items IDs here. I.E:  .PossibleItems[0],123,124,125;
setarray .PossibleEnchants[0], ;//<- Put your enchants IDs here
set .MinEnchant,0; // Minimum possible enchant
set .MaxEnchant,20; // Max Possible enchant
set .RandItem,rand(.SizeItem);
set .RandEnchant1,rand(.SizeEnchants);
set .RandEnchant2,rand(.SizeEnchants);
set .RandEnchant3,rand(.SizeEnchants);
set .RandEnchant4,rand(.SizeEnchants);
set .SizeItem,getarraysize(.PossibleItems);
set .SizeEnchants,getarraysize(.PossibleEnchants);
end;

}

   Haven't tested it tho, so let me know if anything goes wrong ? 
   Have in mind it will get you an item with enchants on the 4 slots.

thank you i will try this later

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  109
  • Reputation:   5
  • Joined:  08/12/17
  • Last Seen:  

On 9/27/2018 at 3:10 PM, Wickedknight2 said:

-    script    MvPKill    ,{

OnNPCKillEvent:
 if( getmonsterinfo( killedrid,MOB_MVPEXP ) ){
set .Dice,rand(1,10000){ // 1 =  0,01%

if(.Dice <= .Chance){

getitem2 .PossibleItems[.RandItem],1,rand(.MinEnchant,.MaxEnchant),0,.RandEnchant1,.RandEnchant2,.RandEnchant3,.RandEnchant4;


}

}
}
end;


OnInit:
set .Chance,2; // Set the drop chance here
setarray .PossibleItems[0], ;//<- Put your items IDs here. I.E:  .PossibleItems[0],123,124,125;
setarray .PossibleEnchants[0], ;//<- Put your enchants IDs here
set .MinEnchant,0; // Minimum possible enchant
set .MaxEnchant,20; // Max Possible enchant
set .RandItem,rand(.SizeItem);
set .RandEnchant1,rand(.SizeEnchants);
set .RandEnchant2,rand(.SizeEnchants);
set .RandEnchant3,rand(.SizeEnchants);
set .RandEnchant4,rand(.SizeEnchants);
set .SizeItem,getarraysize(.PossibleItems);
set .SizeEnchants,getarraysize(.PossibleEnchants);
end;

}

   Haven't tested it tho, so let me know if anything goes wrong ? 
   Have in mind it will get you an item with enchants on the 4 slots.

It is possible to made this randomly for a party member? Only restriction is the party member need to be in the same map and the same area when mvp is killed, like 20-30 cells

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  625
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

@Wickedknight2

I also see nowhere where you set the .SizeItems and .SizeEnchants, or I'm blind lol

Maybe you meant getarraysize(.PossibleEnchants) and getarraysize(.PossibleItems) in your rand. XX

Edited by llchrisll
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  39
  • Reputation:   5
  • Joined:  06/09/17
  • Last Seen:  

5 hours ago, llchrisll said:

@Wickedknight2

I also see nowhere where you set the .SizeItems and .SizeEnchants, or I'm blind lol

Maybe you meant getarraysize(.PossibleEnchants) and getarraysize(.PossibleItems) in your rand. XX

   They were set within the OnInit ?! Though it's not working, as  Emistry said.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  625
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

3 hours ago, Wickedknight2 said:

   They were set within the OnInit ?! Though it's not working, as  Emistry said.

Okayy. Must have been blind, after reading it like 10 times, I was able to find them lol.

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