Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - script MVP_DROP FAKE_NPC,{
- OnNPCKillEvent:
- if(!getmonsterinfo(killedrid, MOB_MVPEXP)) end;
- .@rowCount = getarraysize(.itemInfos) / .columnCount;
- for (.@i = 0; .@i < .@rowCount; .@i++) {
- .@index = .@i * .@rowCount;
- .@randIndex = rand(.@i, .@rowCount - 1) * .@rowCount;
- copyarray .tmpItemInfo[0], .itemInfos[.@randIndex], .columnCount;
- copyarray .itemInfos[.@randIndex], .itemInfos[.@index], .columnCount;
- copyarray .itemInfos[.@index], .tmpItemInfo[0], .columnCount;
- }
- for(.@i = 0; .@i < getarraysize(.itemInfos); .@i += .columnCount) {
- if(rand(1, 100) <= .itemInfos[.@i + 2]) {
- getitem .itemInfos[.@i], .itemInfos[.@i + 1];
- 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;
- if(.onlyOneDrop) end;
- }
- }
- end;
- OnInit:
- // item id, item amount, item chance in %
- // (<structure,<item_id>,<chances>)
- setarray .itemInfos[0],
- 7179, 1, 5,
- 7227, 1, 25,
- 7539, 1, 50;
- .onlyOneDrop = true; //Dropa um tipo de moeda por vez
- .columnCount = 3; //Tipo do Anuncio
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement