kasim03 Posted January 9, 2020 Posted January 9, 2020 prontera,154,179,4 script summoner 100,{ monster "prontera", 157, 181, "Poring", 1005, 1, strnpcinfo(0) + "::OnMobKilled"; monster "prontera", 157, 181, "Poring", 1115, 1, strnpcinfo(0) + "::OnMobKilled"; end; OnMobKilled: getitem 501, 1; // 1 red potion end; } My plan is to have this script have a random spawn and to spawn it requires an item. If you press this npc it will ask for the item to avoid spam. I already love this script spawn, it just needs extra random spawn on this script. If possible, I want random items to fall off the mob as well. Thanks to those who helped me... Quote
0 BeWan Posted January 9, 2020 Posted January 9, 2020 here. prontera,154,179,4 script summoner 100,{ if( countitem(512) > 500){ monster "prontera", 0, 0, "Poring", 1005, 1, strnpcinfo(0) + "::OnMobKilled"; monster "prontera", 0, 0, "Poring", 1115, 1, strnpcinfo(0) + "::OnMobKilled"; end; }else{ mes "sorry you need 500 apple to summon"; } OnMobKilled: getitem 501, 1; // 1 red potion end; } Quote
0 LOOLP - OFF Posted January 9, 2020 Posted January 9, 2020 Completing the script : @BeWan prontera,154,179,4 script summoner 100,{ if( countitem(512) > 500){ delitem 512,500; monster "prontera", 0, 0, "Poring", 1005, 1, strnpcinfo(0) + "::OnMobKilled"; monster "prontera", 0, 0, "Poring", 1115, 1, strnpcinfo(0) + "::OnMobKilled"; end; }else{ mes "sorry you need 500 apple to summon"; } OnMobKilled: set @amount, rand(1,5); //quantity of different items set @whatItem, rand(0,.@size); //Which item was chosen set @amountItem, rand(1,10); //Quantity of item you will receive for (i = 0; i < @amount; i++) { getitem @whatItem, @amountItem; } end; OnInit: setarray .@listItens[0],500,501,502,503,504,505,506,507; //Itens .@size = getarraysize(.@listItens); //Size Array Itens end; } Quote
0 BeWan Posted January 9, 2020 Posted January 9, 2020 8 minutes ago, Disabled LOOLP said: Completing the script : @BeWan prontera,154,179,4 script summoner 100,{ if( countitem(512) > 500){ delitem 512,500; monster "prontera", 0, 0, "Poring", 1005, 1, strnpcinfo(0) + "::OnMobKilled"; monster "prontera", 0, 0, "Poring", 1115, 1, strnpcinfo(0) + "::OnMobKilled"; end; }else{ mes "sorry you need 500 apple to summon"; } OnMobKilled: set @amount, rand(1,5); //quantity of different items set @whatItem, rand(0,.@size); //Which item was chosen set @amountItem, rand(1,10); //Quantity of item you will receive for (i = 0; i < @amount; i++) { getitem @whatItem, @amountItem; } end; OnInit: setarray .@listItens[0],500,501,502,503,504,505,506,507; //Itens .@size = getarraysize(.@listItens); //Size Array Itens end; } sorry my bad. lol Quote
0 LOOLP - OFF Posted January 9, 2020 Posted January 9, 2020 1 minute ago, BeWan said: sorry my bad. lol You did it correct, I just presented some improvements :) Quote
0 BeWan Posted January 9, 2020 Posted January 9, 2020 29 minutes ago, Disabled LOOLP said: You did it correct, I just presented some improvements :) i know but im kinda in a rush thats why hehe Quote
0 kasim03 Posted January 9, 2020 Author Posted January 9, 2020 4 hours ago, Disabled LOOLP said: Completing the script : @BeWan prontera,154,179,4 script summoner 100,{ if( countitem(512) > 500){ delitem 512,500; monster "prontera", 0, 0, "Poring", 1005, 1, strnpcinfo(0) + "::OnMobKilled"; monster "prontera", 0, 0, "Poring", 1115, 1, strnpcinfo(0) + "::OnMobKilled"; end; }else{ mes "sorry you need 500 apple to summon"; } OnMobKilled: set @amount, rand(1,5); //quantity of different items set @whatItem, rand(0,.@size); //Which item was chosen set @amountItem, rand(1,10); //Quantity of item you will receive for (i = 0; i < @amount; i++) { getitem @whatItem, @amountItem; } end; OnInit: setarray .@listItens[0],500,501,502,503,504,505,506,507; //Itens .@size = getarraysize(.@listItens); //Size Array Itens end; } Thanks for this script and for your help. Actually there is a little more to add, if possible, I want a random spawn mob. Quote
0 LOOLP - OFF Posted January 9, 2020 Posted January 9, 2020 To spawn random mobs, use the same array idea as the items, set the quantity, id of the mobs, and invoke the same way as the poring in question. Just use the array [x] Quote
0 kasim03 Posted January 10, 2020 Author Posted January 10, 2020 3 minutes ago, Disabled LOOLP said: To spawn random mobs, use the same array idea as the items, set the quantity, id of the mobs, and invoke the same way as the poring in question. Just use the array [x] alb2trea,84,69,4 script summoner 100,{ set .monster, .mob_id[.random]; if( countitem(512) > 1){ delitem 512,1; monster "alb2trea",0,0,getmonsterinfo(.monster, 0),.monster,.amount,strnpcinfo(0)+ "::OnMobKilled"; end; }else{ mes "sorry you need 1 apple to summon"; } OnMobKilled: announce "Monster is already killed",0; set @amount, rand(1,5); //quantity of different items set @whatItem, rand(0,.@size); //Which item was chosen set @amountItem, rand(1,10); //Quantity of item you will receive for (i = 0; i < @amount; i++) { getitem @whatItem, @amountItem; } end; OnInit: setarray .@listItems[0],501,502,503; //Items .@size = getarraysize(.@listItems); //Size Array Items setarray .mob_id[0],1002,1113,1399,1159; set .size, getarraysize(.mob_id); set .random, rand(.size); set .amount, 2; // amount of monster spawned end; } I'm not sure if the script I'm editing is working properly or not. Monster spawn - ok Item use - ok Random spawn - not sure Random item drop - not sure and i have this error n bug?? Quote
0 Mabuhay Posted January 10, 2020 Posted January 10, 2020 1 hour ago, kasim03 said: .@listItems Change to .listitems Quote
0 kasim03 Posted January 11, 2020 Author Posted January 11, 2020 On 1/10/2020 at 2:43 AM, Disabled LOOLP said: Completing the script : @BeWan prontera,154,179,4 script summoner 100,{ if( countitem(512) > 500){ delitem 512,500; monster "prontera", 0, 0, "Poring", 1005, 1, strnpcinfo(0) + "::OnMobKilled"; monster "prontera", 0, 0, "Poring", 1115, 1, strnpcinfo(0) + "::OnMobKilled"; end; }else{ mes "sorry you need 500 apple to summon"; } OnMobKilled: set @amount, rand(1,5); //quantity of different items set @whatItem, rand(0,.@size); //Which item was chosen set @amountItem, rand(1,10); //Quantity of item you will receive for (i = 0; i < @amount; i++) { getitem @whatItem, @amountItem; } end; OnInit: setarray .@listItens[0],500,501,502,503,504,505,506,507; //Itens .@size = getarraysize(.@listItens); //Size Array Itens end; } this script have bug, item random not drop... Quote
0 Skorm Posted January 14, 2020 Posted January 14, 2020 prontera,154,179,4 script summoner 100,{ if(countitem(512) > 500){ delitem 512,500; monster "prontera", 0, 0, "Poring", 1005, 1, strnpcinfo(0) + "::OnMobKilled"; monster "prontera", 0, 0, "Poring", 1115, 1, strnpcinfo(0) + "::OnMobKilled"; } else { mes "sorry you need 500 apple to summon"; close; } end; OnMobKilled: set .@amount, rand(1,5); //quantity of different items set .@whatItem, rand(.size); //Which item was chosen set .@amountItem, rand(1,10); //Quantity of item you will receive for (.@i = 0; .@i < .@amount; .@i++) getitem .@whatItem, .@amountItem; end; OnInit: setarray .listItems[0], 500, 501, 502, 503, 504, 505, 506, 507; //Items .size = getarraysize(.listItems); } There are still a few problems with the script but I don't have time. If you want the item to look like it dropped. https://github.com/rathena/rathena/blob/master/doc/script_commands.txt#L4827 Quote
Question
kasim03
prontera,154,179,4 script summoner 100,{ monster "prontera", 157, 181, "Poring", 1005, 1, strnpcinfo(0) + "::OnMobKilled"; monster "prontera", 157, 181, "Poring", 1115, 1, strnpcinfo(0) + "::OnMobKilled"; end; OnMobKilled: getitem 501, 1; // 1 red potion end; }
My plan is to have this script have a random spawn and to spawn it requires an item. If you press this npc it will ask for the item to avoid spam.
I already love this script spawn, it just needs extra random spawn on this script. If possible, I want random items to fall off the mob as well.
Thanks to those who helped me...
11 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.