KucingHitam Posted July 9, 2013 Posted July 9, 2013 Is it possible to make a script with the following conditions? if kill this monster ID 1893 -Poring Coin Drop 80% -Potion Drop 100% -Custom Box 1 10% -Custom Box 2 10% -Custom Box 3 30% Quote
Skorm Posted July 9, 2013 Posted July 9, 2013 (edited) I don't see why not. - script Drop Emulator -1,{ OnNPCKillEvent: set .@mid, killedrid; set .@ar$, ".mob"+.@mid; set .@len, getarraysize(getd(.@ar$)); if(.@len){ for(set .@p,1; .@p<.@len;set .@p,.@p+2 ) { set .@itm, getd(.@ar$+"["+(.@p-1)+"]"); set @itmtyp, getiteminfo(.@itm,2); set .@btflg, callfunc("Monster_DB",.@mid); set .@itmrt, getd(.@ar$+"["+.@p+"]"); query_sql("SELECT ROUND("+.@itmrt+"*("+.@btflg+"/100));",.@rte); if(((.@rte<=10000)?((rand(1,10000/.@rte)==1)?1:0):1)) { getitem .@itm,1; } } } end; OnInit: //By Skorm //Example Poring Apple, 10%, Apple, 1.5%....etc setarray .mob1893, 7539, 8000, 512, 150, 619, 20, 713, 1500, 909, 7000, 938, 400, 1202, 100, 4001, 1; // Mob List 10000=100% can support up to 128 values } function script Monster_DB { switch(getarg(0)){ case 1893: switch(@itmtyp){ // Keep in mind these are precents overall so 20% is actually lower while 140% is actually 40% higher. // Where 200% is double... It's like saying 2*400=800. case 0: // Heal Item Rate (Healing Items) return 100; // 100% for healing items. case 2: case 7: case 11: case 18: // Uasable Item Rate (Anything Usable that doesn't heal) return 100; // 100% for healing items. case 3: // Common Item Rate (ETC) return 100; //100% more for Common Items. case 4: case 5: case 8: case 10: // Equip Item Rate (Ammo, Pet Equip, Weapon, Armor) return 100; // 100% more for equip items. case 6: // Card Item Rate (Card) return 100; // 100% more for cards. } case 1003: case 1004: case 1005: //...to add new monsters simply do as I've done. } } I don't know the IDs of your potion drop or your custom box drops so you'll have to add them. //Example Poring Apple, 10%, Apple, 1.5%....etc setarray .mob1893, 7539, 8000, 512, 150, 619, 20, 713, 1500, 909, 7000, 938, 400, 1202, 100, 4001, 1; // Mob List 10000=100% can support up to 128 values Edited July 9, 2013 by Skorm Quote
Archetype Saber Posted July 9, 2013 Posted July 9, 2013 I don't see why not. - script Drop Emulator -1,{ OnNPCKillEvent: set .@mid, killedrid; set .@ar$, ".mob"+.@mid; set .@len, getarraysize(getd(.@ar$)); if(.@len){ for(set .@p,1; .@p<.@len;set .@p,.@p+2 ) { set .@itm, getd(.@ar$+"["+(.@p-1)+"]"); set @itmtyp, getiteminfo(.@itm,2); set .@btflg, callfunc("Monster_DB",.@mid); set .@itmrt, getd(.@ar$+"["+.@p+"]"); query_sql("SELECT ROUND("+.@itmrt+"*("+.@btflg+"/100));",.@rte); if(((.@rte<=10000)?((rand(1,10000/.@rte)==1)?1:0):1)) { getitem .@itm,1; } } } end; OnInit: //By Skorm //Example Poring Apple, 10%, Apple, 1.5%....etc setarray .mob1893, 7539, 8000, 512, 150, 619, 20, 713, 1500, 909, 7000, 938, 400, 1202, 100, 4001, 1; // Mob List 10000=100% can support up to 128 values } function script Monster_DB { switch(getarg(0)){ case 1893: switch(@itmtyp){ // Keep in mind these are precents overall so 20% is actually lower while 140% is actually 40% higher. // Where 200% is double... It's like saying 2*400=800. case 0: // Heal Item Rate (Healing Items) return 100; // 100% for healing items. case 2: case 7: case 11: case 18: // Uasable Item Rate (Anything Usable that doesn't heal) return 100; // 100% for healing items. case 3: // Common Item Rate (ETC) return 100; //100% more for Common Items. case 4: case 5: case 8: case 10: // Equip Item Rate (Ammo, Pet Equip, Weapon, Armor) return 100; // 100% more for equip items. case 6: // Card Item Rate (Card) return 100; // 100% more for cards. } case 1003: case 1004: case 1005: //...to add new monsters simply do as I've done. } } I don't know the IDs of your potion drop or your custom box drops so you'll have to add them. //Example Poring Apple, 10%, Apple, 1.5%....etc setarray .mob1893, 7539, 8000, 512, 150, 619, 20, 713, 1500, 909, 7000, 938, 400, 1202, 100, 4001, 1; // Mob List 10000=100% can support up to 128 values Well Done Skorm. a True Professional.... I admire your talent /OTL Quote
Emistry Posted July 9, 2013 Posted July 9, 2013 http://rathena.org/board/topic/59964-custom-droprate/#entry84489 Quote
Lil Troll Posted August 3, 2013 Posted August 3, 2013 (edited) How can i make it work? -------------------------- npc invinsible on map. case level not integer: -------------------------- case mob3000: Edited August 3, 2013 by Lil Troll Quote
Question
KucingHitam
Is it possible to make a script with the following conditions?
if kill this monster ID 1893
-Poring Coin Drop 80%
-Potion Drop 100%
-Custom Box 1 10%
-Custom Box 2 10%
-Custom Box 3 30%
6 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.