Advertisement
johnlol

MVP_Drop

Jul 23rd, 2023
651
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VeriLog 1.24 KB | Gaming | 0 0
  1. -   script  MVP_DROP    FAKE_NPC,{
  2.     OnNPCKillEvent:
  3.         if(!getmonsterinfo(killedrid, MOB_MVPEXP)) end;
  4.  
  5.         .@rowCount = getarraysize(.itemInfos) / .columnCount;
  6.  
  7.         for (.@i = 0; .@i < .@rowCount; .@i++) {
  8.             .@index = .@i * .@rowCount;
  9.             .@randIndex = rand(.@i, .@rowCount - 1) * .@rowCount;
  10.  
  11.             copyarray .tmpItemInfo[0], .itemInfos[.@randIndex], .columnCount;
  12.             copyarray .itemInfos[.@randIndex], .itemInfos[.@index], .columnCount;
  13.             copyarray .itemInfos[.@index], .tmpItemInfo[0], .columnCount;
  14.         }
  15.  
  16.         for(.@i = 0; .@i < getarraysize(.itemInfos); .@i += .columnCount) {
  17.             if(rand(1, 100) <= .itemInfos[.@i + 2]) {
  18.                 getitem .itemInfos[.@i], .itemInfos[.@i + 1];
  19.                 announce "Congratulations! Player " + strcharinfo(0) + " has obtained "+ getitemname(.itemInfos[.@i]) +" [" + .itemInfos[.@i + 1] + "] from "+ getmonsterinfo(killedrid, 0) +" (chance: " + .itemInfos[.@i + 2] + "%) MVP Drop(s).", bc_all, 0x00FF00;
  20.                
  21.                 if(.onlyOneDrop) end;
  22.             }
  23.         }
  24.     end;
  25.  
  26.     OnInit:
  27.         //  item id, item amount, item chance in %
  28.         //  (<structure,<item_id>,<chances>)
  29.         setarray .itemInfos[0],
  30.         7179, 1, 5,
  31.         7227, 1, 25,
  32.         7539, 1, 50;
  33.  
  34.         .onlyOneDrop = true;            //Dropa um tipo de moeda por vez
  35.  
  36.         .columnCount = 3;       //Tipo do Anuncio
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement