kasim03 Posted January 9, 2020 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 14 Reputation: 0 Joined: 03/27/17 Last Seen: April 4, 2023 Share 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 Link to comment Share on other sites More sharing options...
0 BeWan Posted January 9, 2020 Group: Members Topic Count: 20 Topics Per Day: 0.01 Content Count: 403 Reputation: 249 Joined: 07/04/19 Last Seen: Saturday at 04:58 AM Share 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 Link to comment Share on other sites More sharing options...
0 LOOLP - OFF Posted January 9, 2020 Group: Members Topic Count: 12 Topics Per Day: 0.01 Content Count: 233 Reputation: 51 Joined: 12/20/18 Last Seen: March 10, 2021 Share 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 Link to comment Share on other sites More sharing options...
0 BeWan Posted January 9, 2020 Group: Members Topic Count: 20 Topics Per Day: 0.01 Content Count: 403 Reputation: 249 Joined: 07/04/19 Last Seen: Saturday at 04:58 AM Share 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 Link to comment Share on other sites More sharing options...
0 LOOLP - OFF Posted January 9, 2020 Group: Members Topic Count: 12 Topics Per Day: 0.01 Content Count: 233 Reputation: 51 Joined: 12/20/18 Last Seen: March 10, 2021 Share Posted January 9, 2020 1 minute ago, BeWan said: sorry my bad. lol You did it correct, I just presented some improvements :) Quote Link to comment Share on other sites More sharing options...
0 BeWan Posted January 9, 2020 Group: Members Topic Count: 20 Topics Per Day: 0.01 Content Count: 403 Reputation: 249 Joined: 07/04/19 Last Seen: Saturday at 04:58 AM Share 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 Link to comment Share on other sites More sharing options...
0 kasim03 Posted January 9, 2020 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 14 Reputation: 0 Joined: 03/27/17 Last Seen: April 4, 2023 Author Share 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 Link to comment Share on other sites More sharing options...
0 LOOLP - OFF Posted January 9, 2020 Group: Members Topic Count: 12 Topics Per Day: 0.01 Content Count: 233 Reputation: 51 Joined: 12/20/18 Last Seen: March 10, 2021 Share 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 Link to comment Share on other sites More sharing options...
0 kasim03 Posted January 10, 2020 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 14 Reputation: 0 Joined: 03/27/17 Last Seen: April 4, 2023 Author Share 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 Link to comment Share on other sites More sharing options...
0 Mabuhay Posted January 10, 2020 Group: Members Topic Count: 105 Topics Per Day: 0.02 Content Count: 446 Reputation: 232 Joined: 03/20/12 Last Seen: October 22, 2020 Share Posted January 10, 2020 1 hour ago, kasim03 said: .@listItems Change to .listitems Quote Link to comment Share on other sites More sharing options...
0 kasim03 Posted January 11, 2020 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 14 Reputation: 0 Joined: 03/27/17 Last Seen: April 4, 2023 Author Share 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 Link to comment Share on other sites More sharing options...
0 Skorm Posted January 14, 2020 Group: Forum Moderator Topic Count: 33 Topics Per Day: 0.01 Content Count: 1282 Reputation: 393 Joined: 02/03/12 Last Seen: Sunday at 10:43 PM Share 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 Link to comment Share on other sites More sharing options...
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...
Link to comment
Share on other sites
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.