rookies Posted June 17, 2023 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 3 Reputation: 0 Joined: 06/16/23 Last Seen: June 21, 2023 Share Posted June 17, 2023 Hello can anyone help me about MVP kill reward via random item with chances in the latest update of rathena Quote Link to comment Share on other sites More sharing options...
0 xJohn Posted June 19, 2023 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 19 Reputation: 4 Joined: 04/18/23 Last Seen: February 4, 2024 Share Posted June 19, 2023 Quote //Created Date: 04/07/2022 - script AEOUS_MVP_DROP FAKE_NPC,{ end; OnNPCKillEvent: .@rnd = rand(1,100); if( getmonsterinfo( killedrid,MOB_MVPEXP ) ) { for( .@i = 0; .@i < getarraysize(.item_arrays); .@i += 3 ) { if( .@rnd < .item_arrays[.@i+2] ) { getitem .item_arrays[.@i], .item_arrays[.@i+1]; announce "Congratulations! Player "+ strcharinfo(0) +" has obtained "+ getitemname( .item_arrays[.@i] ) +" ["+ .item_arrays[.@i+1] +"] from "+ getmonsterinfo(killedrid, 0) +" (chance: "+.item_arrays[.@i+2]+"%) MVP Drop(s).",bc_all,0x00FF00; } } end; } OnInit: // (<structure,<item_id>,<chances>) setarray .item_arrays[0], 7179, 1, 5, 7227, 1, 25, 7539, 1, 50; end; } Quote Link to comment Share on other sites More sharing options...
0 rookies Posted June 19, 2023 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 3 Reputation: 0 Joined: 06/16/23 Last Seen: June 21, 2023 Author Share Posted June 19, 2023 3 hours ago, xJohn said: Hello i tried this but i got more than 1 item everytime i kill mvp Quote Link to comment Share on other sites More sharing options...
0 xJohn Posted June 19, 2023 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 19 Reputation: 4 Joined: 04/18/23 Last Seen: February 4, 2024 Share Posted June 19, 2023 Random_Mvp_Drop.txt Quote Link to comment Share on other sites More sharing options...
0 Winterfox Posted June 19, 2023 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 245 Reputation: 93 Joined: 06/30/18 Last Seen: November 27, 2024 Share Posted June 19, 2023 Hello, try this: - 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 % setarray .itemInfos[0], 7179, 1, 5, 7227, 1, 25, 7539, 1, 50; .onlyOneDrop = true; .columnCount = 3; } 1 Quote Link to comment Share on other sites More sharing options...
Question
rookies
Hello can anyone help me about MVP kill reward via random item with chances in the latest update of rathena
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.