jTynne 101 Posted July 25, 2013 This is a very simple event script I created for the GM's of my server. Basically, you type one command and it spawns 5 "Wandering Porings" on the map of your choosing. You will want to customize the prizes that you receive from the event (it gives Red/Yellow/Orange/White/Blue Potions by default). It's also extremely easy to add in additional prizes. // Syntax: Item ID / Quantity if(.@prize == 1) { getitem 501,1; } if(.@prize == 2) { getitem 502,1; } if(.@prize == 3) { getitem 503,1; } if(.@prize == 4) { getitem 504,1; } if(.@prize == 5) { getitem 505,1; } // 25 Poring Coins Base Prize getitem 7539,25; Below is the code; After you change the values noted above in red, you should be able to just save this as a .txt, load it in-game, and voila. Questions, comments? Post as a response to this thread! If you find it useful, please +1 this thread and rate me five stars. Thanks! - script poringbind -1,{OnInit: unbindatcmd "poring"; bindatcmd("poring","poringbind::OnAtcommand",20,90); end; OnAtcommand:if(getgroupid() < 20) { end; }set @map$,.@atcmd_parameters$[0]; if(@map$ == "") {dispbottom "Syntax: @poring <mapname>";dispbottom "Five Porings will spawn on the map you choose. Recommended usage for this event is 3-5 times per day.";dispbottom "NOTE: Do NOT use capitals in the map name otherwise no Poring will spawn!";end;} monster @map$,0,0,"Wandering Poring",1002,5,"poringbind::OnKill";announce "[Wandering Poring] : 5x Wandering Porings have been sighted on the map: "+@map$+". The first person to find and kill each will receive an award!",0;end; OnKill:// Update Here!set .@prize,rand(1,5);announce "[Wandering Poring] : "+strcharinfo(0)+" has captured a Wandering Poring on the map "+strcharinfo(3)+"!",0;// Syntax: Item ID / Quantityif(.@prize == 1) { getitem 501,1; }if(.@prize == 2) { getitem 502,1; }if(.@prize == 3) { getitem 503,1; }if(.@prize == 4) { getitem 504,1; }if(.@prize == 5) { getitem 505,1; }// 25 Poring Coins Base Prizegetitem 7539,25;end; } 9 orange, Aegiskore, hemagx and 6 others reacted to this Quote Share this post Link to post Share on other sites
pr3p 39 Posted July 25, 2013 Thanks jTynne awesome Quote Share this post Link to post Share on other sites
jTynne 101 Posted July 25, 2013 Very welcome! Please be kind and award me a +1 at the bottom right of the thread if you use or find the script useful-- thanks! ^^ 1 p!\/aT3 reacted to this Quote Share this post Link to post Share on other sites
Mission 0 Posted November 5, 2013 sir what commands am i going to type to activate this event? Quote Share this post Link to post Share on other sites
jaBote 438 Posted November 5, 2013 sir what commands am i going to type to activate this event? You have it right there in the code: if(@map$ == "") {dispbottom "Syntax: @poring <mapname>";dispbottom "Five Porings will spawn on the map you choose. Recommended usage for this event is 3-5 times per day.";dispbottom "NOTE: Do NOT use capitals in the map name otherwise no Poring will spawn!";end;} Quote Share this post Link to post Share on other sites
Patskie 88 Posted November 5, 2013 Suggestions? Remove this part : dispbottom "NOTE: Do NOT use capitals in the map name otherwise no Poring will spawn!"; and change this : set @map$,.@atcmd_parameters$[0]; to : set @map$,strtolower(.@atcmd_parameters$[0]); to ensure that the input will be in lower case form? Quote Share this post Link to post Share on other sites
hannicaldummy 2 Posted November 5, 2013 But when i used @poring the emulator says "@poring is a invalid command" Quote Share this post Link to post Share on other sites
Patskie 88 Posted November 5, 2013 But when i used @poring the emulator says "@poring is a invalid command" Show error if any. Did you modify the name of the script? ( the poringbind one? ) - script poringbind -1,{ Quote Share this post Link to post Share on other sites
hannicaldummy 2 Posted November 5, 2013 But when i used @poring the emulator says "@poring is a invalid command" Show error if any. Did you modify the name of the script? ( the poringbind one? ) - script poringbind -1,{ There's no errors on map-server, i didn't modified anything Quote Share this post Link to post Share on other sites
Patskie 88 Posted November 5, 2013 Are you a gm level 20 ( or more ) ? Quote Share this post Link to post Share on other sites
hannicaldummy 2 Posted November 5, 2013 Are you a gm level 20 ( or more ) ? Yes, i'm 99 gm level Quote Share this post Link to post Share on other sites
Patskie 88 Posted November 5, 2013 Your emulator? I tried installing the script and the only problem i have encountered during installation is the tab part of the script heading? Quote Share this post Link to post Share on other sites
Mission 0 Posted November 6, 2013 but when i type @poring it says invalid command ) just like haniculdummy did.. Quote Share this post Link to post Share on other sites
jaBote 438 Posted November 6, 2013 but when i type @poring it says invalid command ) just like haniculdummy did.. Your reply is here: Your emulator? I tried installing the script and the only problem i have encountered during installation is the tab part of the script heading? Did you get any errors on map server when parsing the NPC? Your answer is you have to change each set of 4 spaces for a tabulation space. Quote Share this post Link to post Share on other sites
Patskie 88 Posted November 6, 2013 No no no, i am answering some questions and tell my experience while installing the script. It is working fine on my test server Quote Share this post Link to post Share on other sites
jaBote 438 Posted November 6, 2013 Whops, sorry Patskie, was trying to reply Mission all the time on last post 1 Patskie reacted to this Quote Share this post Link to post Share on other sites
Shio 0 Posted November 16, 2013 Would it be possible to add a timer in this script? with like OnMinute00:? Quote Share this post Link to post Share on other sites
jaBote 438 Posted November 16, 2013 Yes it is, but you should do a workaround them for setting automatically the necessary parameter (mapname only in this case). Quote Share this post Link to post Share on other sites
Shio 0 Posted November 16, 2013 alright, would it be better to just use 2 seperate scripts? 1 onminute: 1atcommand? Quote Share this post Link to post Share on other sites
jaBote 438 Posted November 16, 2013 Just set an additional label in which you do all necessary calculations and then fire the OnAtcommand label. Or even better: make the OnAtcommand label just process if there's been a map specified and your additional label set the map, then call a new label called OnEvent or so. Example: - script poringbind -1,{OnInit: unbindatcmd "poring"; bindatcmd("poring","poringbind::OnAtcommand",20,90); end; OnAtcommand:if(getgroupid() < 20) { end; }set .map$,.@atcmd_parameters$[0]; if(@map$ == "") {dispbottom "Syntax: @poring <mapname>";dispbottom "Five Porings will spawn on the map you choose. Recommended usage for this event is 3-5 times per day.";dispbottom "NOTE: Do NOT use capitals in the map name otherwise no Poring will spawn!";end;}donpcevent strnpcinfo(3)+"::OnEvent";end; OnMinute01: // Put your custom triggers hereset .map$, "yourmapname";donpcevent strnpcinfo(3)+"::OnEvent";end;OnEvent:monster .map$,0,0,"Wandering Poring",1002,5,"poringbind::OnKill";announce "[Wandering Poring] : 5x Wandering Porings have been sighted on the map: "+.map$+". The first person to find and kill each will receive an award!",0;end; OnKill:// Update Here!set .@prize,rand(1,5);announce "[Wandering Poring] : "+strcharinfo(0)+" has captured a Wandering Poring on the map "+strcharinfo(3)+"!",0;// Syntax: Item ID / Quantityif(.@prize == 1) { getitem 501,1; }if(.@prize == 2) { getitem 502,1; }if(.@prize == 3) { getitem 503,1; }if(.@prize == 4) { getitem 504,1; }if(.@prize == 5) { getitem 505,1; }// 25 Poring Coins Base Prizegetitem 7539,25;end; } 1 Shio reacted to this Quote Share this post Link to post Share on other sites
Shio 0 Posted November 17, 2013 Awesome Thanks @jTynne for the script. and Thanks @jaBote for the help & Example. Quote Share this post Link to post Share on other sites
Shio 0 Posted November 20, 2013 Hmm how could i add multi mobs? would i have to add a new line for each? Quote Share this post Link to post Share on other sites
Patskie 88 Posted November 20, 2013 Hmm how could i add multi mobs? would i have to add a new line for each? You can use an array 1 Shio reacted to this Quote Share this post Link to post Share on other sites
Shio 0 Posted November 20, 2013 Hmm how could i add multi mobs? would i have to add a new line for each? You can use an array - script poringbind -1,{OnInit: set .quan, 100; setarray .mob[0],<xxxx>,<xxxx>; unbindatcmd "poring"; bindatcmd("poring","poringbind::OnAtcommand",20,90); end; like this? Quote Share this post Link to post Share on other sites
Shio 0 Posted November 22, 2013 (edited) Nvm fixed Edited December 23, 2013 by Shio Quote Share this post Link to post Share on other sites