Mootie Posted November 9, 2012 Group: Members Topic Count: 43 Topics Per Day: 0.01 Content Count: 815 Reputation: 86 Joined: 10/26/12 Last Seen: June 10, 2022 Share Posted November 9, 2012 (edited) //===== rAthena Script ======================================= //= Poring Summoner //===== By: ================================================== //= Bahmut (Made it automated) //= MoonlightRO (Original) //===== Current Version: ===================================== //= 1.4 //===== Compatible With: ===================================== //= TXT & SQL //===== Link to orginal: ===================================== //= http://www.eathena.ws/board/index.php?showtopic=236779 //============================================================ - script Poring Summoner -1,{ OnInit: //---- NPC Config ----- set .ItemID,1000; set .SpecialPorings,2; set .NormalPorings,2; //--------------------- initnpctimer; end; OnSpecialKill: set .SpecialPorings[1],.SpecialPorings[1]-1; announce strcharinfo(0) + " got a " + getitemname(.ItemID) + "!",bc_map; getitem .ItemID,1; goto PoringCount; OnNormalKill: set .NormalPorings[1],.NormalPorings[1]-1; goto PoringCount; PoringCount: announce "Special Poring: " + .SpecialPorings[1] + " || Normal Poring: " + .NormalPorings[1],bc_map; if(!.SpecialPorings[1]) goto EndEvent; end; OnTimer216000000: RestartEvent: killmonster .Map$,"All"; set .Event,0; set .SpecialPorings[1],0; set .NormalPorings[1],0; removemapflag .Map$,mf_noskill; set $@ran, rand(1,10); if ($@ran == 10) set .Map$,"lighthalzen"; if ($@ran == 9) set .Map$,"louyang"; if ($@ran == 8) set .Map$,"comodo"; if ($@ran == 7) set .Map$,"xmas"; if ($@ran == 6) set .Map$,"aldebaran"; if ($@ran == 5) set .Map$,"izlude"; if ($@ran == 4) set .Map$,"payon"; if ($@ran == 3) set .Map$,"geffen"; if ($@ran == 2) set .Map$,"morocc"; if ($@ran == 1) set .Map$,"prontera"; setmapflag .Map$,mf_noskill; monster .Map$,0,0,"Poring",1002,.SpecialPorings,"Poring Summoner::OnSpecialKill"; monster .Map$,0,0,"Poring",1002,.NormalPorings,"Poring Summoner::OnNormalKill"; set .SpecialPorings[1],.SpecialPorings; set .NormalPorings[1],.NormalPorings; announce "The Poring Event has begun!",bc_all; announce "Location: " + .Map$,bc_all; announce "Special Poring: " + .SpecialPorings,bc_all; announce "Normal Poring: " + .NormalPorings,bc_all; setnpctimer 0; end; } if not can you guys help me to make this RA Edited November 9, 2012 by Emistry Please use [CODEBOX] or Attachments for long contents. Quote Link to comment Share on other sites More sharing options...
Dastgir Posted November 9, 2012 Group: Members Topic Count: 26 Topics Per Day: 0.01 Content Count: 331 Reputation: 63 Joined: 11/29/11 Last Seen: Yesterday at 10:21 AM Share Posted November 9, 2012 It seems fine. Is there any error, if yes then post the error. Quote Link to comment Share on other sites More sharing options...
Mootie Posted November 9, 2012 Group: Members Topic Count: 43 Topics Per Day: 0.01 Content Count: 815 Reputation: 86 Joined: 10/26/12 Last Seen: June 10, 2022 Author Share Posted November 9, 2012 no there is no error at all and i already put ontimer to 0 so once i restart the server the automated event will start nothing happen and no error Quote Link to comment Share on other sites More sharing options...
Ryokem Posted November 9, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 205 Reputation: 19 Joined: 10/12/12 Last Seen: November 7, 2013 Share Posted November 9, 2012 (edited) Untested. - script Poring Summoner -1,{ OnInit: //---- NPC Config ----- set .ItemID, 1000; set .SpecialPorings, 2; set .NormalPorings, 2; setarray .Map$[0], "lighthalzen","louyang","comodo","xmas","aldebaran","izlude","payon","geffen","morocc","prontera"; //--------------------- setnpctimer 0; initnpctimer; end; OnTimer360000: //1 hour delay stopnpctimer; killmonsterall .Map$; set .loc, rand(getarraysize(.Map$)); setmapflag .Map$[.loc], mf_noskill; monster .Map$[.loc], 0, 0, "Poring", 1002, .SpecialPorings, "Poring Summoner::OnSpecialKill"; monster .Map$[.loc], 0, 0, "Poring", 1002, .NormalPorings, "Poring Summoner::OnNormalKill"; announce "The Poring Event has begun!", 0; sleep 1000; announce "Location: " + .Map$[.loc], 0; sleep 1000; announce "Special Poring: " + .SpecialPorings, 0; sleep 1000; announce "Normal Poring: " + .NormalPorings, 0; end; OnSpecialKill: set .SpecialPorings, .SpecialPorings - 1; mapannounce strcharinfo(0) + " got a " + getitemname(.ItemID) + "!", bc_map, bc_blue; getitem .ItemID,1; goto PoringCount; OnNormalKill: set .NormalPorings, .NormalPorings - 1; goto PoringCount; PoringCount: if( .SpecialPorings || .NormalPorings ) announce "Special Poring: " + .SpecialPorings + " || Normal Poring: " + .NormalPorings, bc_map, bc_blue; else { announce "The Poring Event has ended.", 0; deletearray .Map$[0], getarraysize(.Map$); removemapflag .Map$[.loc], mf_noskill; goto OnInit; } end; } Your script didn't start 'cause ou set a 60 hours wait time, actually almost 3 days. Also, you converted simple integer variables into array elements, don't know why. Edited November 9, 2012 by Ryokem Quote Link to comment Share on other sites More sharing options...
Mootie Posted November 9, 2012 Group: Members Topic Count: 43 Topics Per Day: 0.01 Content Count: 815 Reputation: 86 Joined: 10/26/12 Last Seen: June 10, 2022 Author Share Posted November 9, 2012 (edited) //===== rAthena Script ======================================= //= Poring Summoner //===== By: ================================================== //= Bahmut (Made it automated) //= MoonlightRO (Original) //===== Current Version: ===================================== //= 1.4 //===== Compatible With: ===================================== //= TXT & SQL //===== Link to orginal: ===================================== //= [url="http://www.eathena.ws/board/index.php?showtopic=236779"]http://www.eathena.w...howtopic=236779[/url] //============================================================ - script Poring Summoner -1,{ OnInit: //---- NPC Config ----- set .ItemID,7960; set .SpecialPorings,50; set .NormalPorings,100; //--------------------- initnpctimer; end; OnSpecialKill: set .SpecialPorings[1],.SpecialPorings[1]-1; announce strcharinfo(0) + " got a " + getitemname(.ItemID) + "!",bc_map; getitem .ItemID,1; goto PoringCount; OnNormalKill: set .NormalPorings[1],.NormalPorings[1]-1; goto PoringCount; PoringCount: announce "Special Poring: " + .SpecialPorings[1] + " || Normal Poring: " + .NormalPorings[1],bc_map; if(!.SpecialPorings[1]) goto EndEvent; end; OnTimer17: RestartEvent: killmonster .Map$,"All"; set .Event,0; set .SpecialPorings[1],0; set .NormalPorings[1],0; removemapflag .Map$,mf_noskill; set $@ran, rand(1,10); if ($@ran == 10) set .Map$,"lighthalzen"; if ($@ran == 9) set .Map$,"louyang"; if ($@ran == 8) set .Map$,"comodo"; if ($@ran == 7) set .Map$,"xmas"; if ($@ran == 6) set .Map$,"aldebaran"; if ($@ran == 5) set .Map$,"izlude"; if ($@ran == 4) set .Map$,"payon"; if ($@ran == 3) set .Map$,"geffen"; if ($@ran == 2) set .Map$,"morocc"; if ($@ran == 1) set .Map$,"prontera"; setmapflag .Map$,mf_noskill; monster .Map$,0,0,"Poring",1002,.SpecialPorings,"Poring Summoner::OnSpecialKill"; monster .Map$,0,0,"Poring",1002,.NormalPorings,"Poring Summoner::OnNormalKill"; set .SpecialPorings[1],.SpecialPorings; set .NormalPorings[1[attachment=4361:Untitled.png]],.NormalPorings; announce "The Poring Event has begun!",bc_all; announce "Location: " + .Map$,bc_all; announce "Special Poring: " + .SpecialPorings,bc_all; announce "Normal Poring: " + .NormalPorings,bc_all; setnpctimer 0; end; } Edited November 9, 2012 by AnnieRuru TOPIC MERGE Quote Link to comment Share on other sites More sharing options...
Emistry Posted November 9, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: 19 hours ago Share Posted November 9, 2012 change .Map$ into global permanent variable.... or.... in the OnInit part...just simply add this.. set .Map$,"anymapname"; Quote Link to comment Share on other sites More sharing options...
Mootie Posted November 9, 2012 Group: Members Topic Count: 43 Topics Per Day: 0.01 Content Count: 815 Reputation: 86 Joined: 10/26/12 Last Seen: June 10, 2022 Author Share Posted November 9, 2012 (edited) change .Map$ into global permanent variable.... or.... in the OnInit part...just simply add this.. set .Map$,"anymapname"; i already add the OnInit: //---- NPC Config ----- set .ItemID,7960; set .SpecialPorings,50; set .NormalPorings,100; set .Map$,"anymapname"; its still the same problem mapindex_name2id: map "anymapname" not found in index list Edited November 9, 2012 by Mootie Quote Link to comment Share on other sites More sharing options...
Ryokem Posted November 9, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 205 Reputation: 19 Joined: 10/12/12 Last Seen: November 7, 2013 Share Posted November 9, 2012 (edited) Real. No need to open 2 topics with the same code and request. EDIT: Newer fixed version at Post #14 http://rathena.org/board/topic/73840-error-for-automated-events/#entry154225 Edited November 9, 2012 by Ryokem Quote Link to comment Share on other sites More sharing options...
Mootie Posted November 9, 2012 Group: Members Topic Count: 43 Topics Per Day: 0.01 Content Count: 815 Reputation: 86 Joined: 10/26/12 Last Seen: June 10, 2022 Author Share Posted November 9, 2012 (edited) so yeah how bout the its still the same problem mapindex_name2id: map "anymapname" not found in index list as emistry said just put OnInit set .Map$,"anymapname"; still having error i also try to put another item on itemID it seems i can only get 1 item per special poring OnInit: //---- NPC Config ----- set .ItemID,7960; set .ItemID,7539; set .SpecialPorings,50; set .NormalPorings,100; set .Map$,"anymapname"; another error shows when the event ends after the event ends the nxt event didnt start as well after that error shows Edited November 9, 2012 by Mootie Quote Link to comment Share on other sites More sharing options...
Ryokem Posted November 9, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 205 Reputation: 19 Joined: 10/12/12 Last Seen: November 7, 2013 Share Posted November 9, 2012 as emistry said just put OnInit set .Map$,"anymapname"; still having error "anymapname" is not a map name, he meant to put there a random map location.. such as "prontera", "morocc", "moc_fild02"... whatever! Quote Link to comment Share on other sites More sharing options...
Mootie Posted November 9, 2012 Group: Members Topic Count: 43 Topics Per Day: 0.01 Content Count: 815 Reputation: 86 Joined: 10/26/12 Last Seen: June 10, 2022 Author Share Posted November 9, 2012 as emistry said just put OnInit set .Map$,"anymapname"; still having error "anymapname" is not a map name, he meant to put there a random map location.. such as "prontera", "morocc", "moc_fild02"... whatever! so instead doing this if ($@ran == 10) set .Map$,"lighthalzen"; if ($@ran == 9) set .Map$,"louyang"; if ($@ran == 8) set .Map$,"comodo"; if ($@ran == 7) set .Map$,"xmas"; if ($@ran == 6) set .Map$,"aldebaran"; if ($@ran == 5) set .Map$,"izlude"; if ($@ran == 4) set .Map$,"payon"; if ($@ran == 3) set .Map$,"geffen"; if ($@ran == 2) set .Map$,"morocc"; if ($@ran == 1) set .Map$,"prontera"; ill set it to set .Map$,""prontera", "morocc", "moc_fild02"; Real. http://rathena.org/b...mpatible-in-ra/ No need to open 2 topics with the same code and request. Untested. - script Poring Summoner -1,{ OnInit: //---- NPC Config ----- set .ItemID, 1000; set .SpecialPorings, 2; set .NormalPorings, 2; setarray .Map$[0], "lighthalzen","louyang","comodo","xmas","aldebaran","izlude","payon","geffen","morocc","prontera"; //--------------------- setnpctimer 0; initnpctimer; end; OnTimer360000: //1 hour delay stopnpctimer; killmonsterall .Map$; set .loc, rand(getarraysize(.Map$)); setmapflag .Map$[.loc], mf_noskill; monster .Map$[.loc], 0, 0, "Poring", 1002, .SpecialPorings, "Poring Summoner::OnSpecialKill"; monster .Map$[.loc], 0, 0, "Poring", 1002, .NormalPorings, "Poring Summoner::OnNormalKill"; announce "The Poring Event has begun!", 0; sleep 1000; announce "Location: " + .Map$[.loc], 0; sleep 1000; announce "Special Poring: " + .SpecialPorings, 0; sleep 1000; announce "Normal Poring: " + .NormalPorings, 0; end; OnSpecialKill: set .SpecialPorings, .SpecialPorings - 1; mapannounce strcharinfo(0) + " got a " + getitemname(.ItemID) + "!", bc_map, bc_blue; getitem .ItemID,1; goto PoringCount; OnNormalKill: set .NormalPorings, .NormalPorings - 1; goto PoringCount; PoringCount: if( .SpecialPorings || .NormalPorings ) announce "Special Poring: " + .SpecialPorings + " || Normal Poring: " + .NormalPorings, bc_map, bc_blue; else { announce "The Poring Event has ended.", 0; deletearray .Map$[0], getarraysize(.Map$); removemapflag .Map$[.loc], mf_noskill; goto OnInit; } end; } Your script didn't start 'cause ou set a 60 hours wait time, actually almost 3 days. Also, you converted simple integer variables into array elements, don't know why. i tryed ur script ryokem still has a error bump Quote Link to comment Share on other sites More sharing options...
Ryokem Posted November 9, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 205 Reputation: 19 Joined: 10/12/12 Last Seen: November 7, 2013 Share Posted November 9, 2012 "morroc" and "moroc" are not avaible maps. "morocc" is the current correct map name. Quote Link to comment Share on other sites More sharing options...
Mootie Posted November 9, 2012 Group: Members Topic Count: 43 Topics Per Day: 0.01 Content Count: 815 Reputation: 86 Joined: 10/26/12 Last Seen: June 10, 2022 Author Share Posted November 9, 2012 "morroc" and "moroc" are not avaible maps. "morocc" is the current correct map name. morroc and moroc is mistaken @warp what i did the real error says Quote Link to comment Share on other sites More sharing options...
Ryokem Posted November 9, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 205 Reputation: 19 Joined: 10/12/12 Last Seen: November 7, 2013 Share Posted November 9, 2012 (edited) oh, my bad, I noticed the error I did... I just forgot to specify the map in the mapannounce and mapflag command. Also, I optimized the script when deleting the mapflag. - script Poring Summoner -1,{ OnInit: //---- NPC Config ----- set .ItemID, 1000; set .SpecialPorings, 2; set .NormalPorings, 2; setarray .Map$[0], "lighthalzen","louyang","comodo","xmas","aldebaran","izlude","payon","geffen","morocc","prontera"; //--------------------- setnpctimer 0; initnpctimer; end; OnTimer360000: //1 hour delay stopnpctimer; killmonsterall .Map$[.loc]; set .loc, rand(getarraysize(.Map$)); setmapflag .Map$[.loc], mf_noskill; monster .Map$[.loc], 0, 0, "Poring", 1002, .SpecialPorings, "Poring Summoner::OnSpecialKill"; monster .Map$[.loc], 0, 0, "Poring", 1002, .NormalPorings, "Poring Summoner::OnNormalKill"; announce "The Poring Event has begun!", 0; sleep 1000; announce "Location: " + .Map$[.loc], 0; sleep 1000; announce "Special Poring: " + .SpecialPorings, 0; sleep 1000; announce "Normal Poring: " + .NormalPorings, 0; end; OnSpecialKill: set .SpecialPorings, .SpecialPorings - 1; mapannounce .Map$[.loc], strcharinfo(0) + " got a " + getitemname(.ItemID) + "!", bc_blue; getitem .ItemID,1; goto PoringCount; OnNormalKill: set .NormalPorings, .NormalPorings - 1; goto PoringCount; PoringCount: if( .SpecialPorings || .NormalPorings ) mapannounce .Map$[.loc], "Special Poring: " + .SpecialPorings + " || Normal Poring: " + .NormalPorings, bc_blue; else { announce "The Poring Event has ended.", 0; removemapflag .Map$[.loc], mf_noskill; deletearray .Map$[0], getarraysize(.Map$); goto OnInit; } end; } This should fix my typo. Edited November 9, 2012 by Ryokem Quote Link to comment Share on other sites More sharing options...
nanakiwurtz Posted November 9, 2012 Group: Members Topic Count: 81 Topics Per Day: 0.02 Content Count: 1654 Reputation: 583 Joined: 08/09/12 Last Seen: January 14, 2020 Share Posted November 9, 2012 In your original script, it will cause an error because you're removing the mapflag before even set the .map$ variable. So the .map$ is still empty, that's why the console says it can't find the "" map. Actually Ryokem script works, but it still need a minor fix, in Ryokem's he clears the array then removing the mapflag, it will cause an error too. So, to make it work, the script will looked like this: //Based on Ryokem's script - script Poring Summoner -1,{ OnInit: //---- NPC Config ----- set .ItemID, 1000; set .SpecialPorings, 1; set .NormalPorings, 1; setarray .Map$[0], "prontera"; //--------------------- setnpctimer 0; initnpctimer; end; OnTimer5000: stopnpctimer; killmonsterall .Map$; set .loc, rand(getarraysize(.Map$)); setmapflag .Map$[.loc], mf_noskill; monster .Map$[.loc], 156, 179, "Poring", 1002, .SpecialPorings, "Poring Summoner::OnSpecialKill"; monster .Map$[.loc], 156, 177, "Poring", 1002, .NormalPorings, "Poring Summoner::OnNormalKill"; announce "The Poring Event has begun!", 0; sleep 1000; announce "Location: " + .Map$[.loc], 0; sleep 1000; announce "Special Poring: " + .SpecialPorings, 0; sleep 1000; announce "Normal Poring: " + .NormalPorings, 0; end; OnSpecialKill: set .SpecialPorings, .SpecialPorings - 1; //mapannounce strcharinfo(0) + " got a " + getitemname(.ItemID) + "!", bc_map, bc_blue; getitem .ItemID,1; goto PoringCount; OnNormalKill: set .NormalPorings, .NormalPorings - 1; goto PoringCount; PoringCount: if( .SpecialPorings || .NormalPorings ) announce "Special Poring: " + .SpecialPorings + " || Normal Poring: " + .NormalPorings, bc_map, bc_blue; else { announce "The Poring Event has ended.", 0; removemapflag .Map$[.loc], mf_noskill; deletearray .Map$[0], getarraysize(.Map$); goto OnInit; } end; } 1 Quote Link to comment Share on other sites More sharing options...
Ryokem Posted November 9, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 205 Reputation: 19 Joined: 10/12/12 Last Seen: November 7, 2013 Share Posted November 9, 2012 In your original script, it will cause an error because you're removing the mapflag before even set the .map$ variable. So the .map$ is still empty, that's why the console says it can't find the "" map. Actually Ryokem script works, but it still need a minor fix, in Ryokem's he clears the array then removing the mapflag, it will cause an error too. So, to make it work, the script will looked like this: Yeah, I actually already corrected them all Had no time when I posted it, now that I came back from work I fixed them in a second Anyway, you still forget to correct an error I did: killmonsterall .Map$; //.Map$ as array needs an index Quote Link to comment Share on other sites More sharing options...
nanakiwurtz Posted November 9, 2012 Group: Members Topic Count: 81 Topics Per Day: 0.02 Content Count: 1654 Reputation: 583 Joined: 08/09/12 Last Seen: January 14, 2020 Share Posted November 9, 2012 Ahh you're right Ryokem I missed that part too, you have a keen eye! Quote Link to comment Share on other sites More sharing options...
Ryokem Posted November 9, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 205 Reputation: 19 Joined: 10/12/12 Last Seen: November 7, 2013 Share Posted November 9, 2012 Heh, I do have it only when I'm not in a hurry, such as when I posted that script xD Quote Link to comment Share on other sites More sharing options...
nanakiwurtz Posted November 9, 2012 Group: Members Topic Count: 81 Topics Per Day: 0.02 Content Count: 1654 Reputation: 583 Joined: 08/09/12 Last Seen: January 14, 2020 Share Posted November 9, 2012 It looks like that you're experienced enough with rA scripting language, were you an eA user? Quote Link to comment Share on other sites More sharing options...
Ryokem Posted November 9, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 205 Reputation: 19 Joined: 10/12/12 Last Seen: November 7, 2013 Share Posted November 9, 2012 [OT] Yeah, I was on eA and worked as ssd in some pretty cool associations such as Blizzard, but honestly this is not the place to speak about, just PM me if you want to ask me personal info, this thread is meant to help not to chat [/OT] Quote Link to comment Share on other sites More sharing options...
Mootie Posted November 9, 2012 Group: Members Topic Count: 43 Topics Per Day: 0.01 Content Count: 815 Reputation: 86 Joined: 10/26/12 Last Seen: June 10, 2022 Author Share Posted November 9, 2012 In your original script, it will cause an error because you're removing the mapflag before even set the .map$ variable. So the .map$ is still empty, that's why the console says it can't find the "" map. Actually Ryokem script works, but it still need a minor fix, in Ryokem's he clears the array then removing the mapflag, it will cause an error too. So, to make it work, the script will looked like this: //Based on Ryokem's script - script Poring Summoner -1,{ OnInit: //---- NPC Config ----- set .ItemID, 1000; set .SpecialPorings, 1; set .NormalPorings, 1; setarray .Map$[0], "prontera"; //--------------------- setnpctimer 0; initnpctimer; end; OnTimer5000: stopnpctimer; killmonsterall .Map$; set .loc, rand(getarraysize(.Map$)); setmapflag .Map$[.loc], mf_noskill; monster .Map$[.loc], 156, 179, "Poring", 1002, .SpecialPorings, "Poring Summoner::OnSpecialKill"; monster .Map$[.loc], 156, 177, "Poring", 1002, .NormalPorings, "Poring Summoner::OnNormalKill"; announce "The Poring Event has begun!", 0; sleep 1000; announce "Location: " + .Map$[.loc], 0; sleep 1000; announce "Special Poring: " + .SpecialPorings, 0; sleep 1000; announce "Normal Poring: " + .NormalPorings, 0; end; OnSpecialKill: set .SpecialPorings, .SpecialPorings - 1; //mapannounce strcharinfo(0) + " got a " + getitemname(.ItemID) + "!", bc_map, bc_blue; getitem .ItemID,1; goto PoringCount; OnNormalKill: set .NormalPorings, .NormalPorings - 1; goto PoringCount; PoringCount: if( .SpecialPorings || .NormalPorings ) announce "Special Poring: " + .SpecialPorings + " || Normal Poring: " + .NormalPorings, bc_map, bc_blue; else { announce "The Poring Event has ended.", 0; removemapflag .Map$[.loc], mf_noskill; deletearray .Map$[0], getarraysize(.Map$); goto OnInit; } end; } Heh, I do have it only when I'm not in a hurry, such as when I posted that script xD really thanks for this btw how i can make it every 1hrs? if random it should be OnTimer1 setnpctimer 0 im correct? and for the result is like this //Based on Ryokem's script - script Poring Summoner -1,{ OnInit: //---- NPC Config ----- set .ItemID, 677; set .SpecialPorings, 50; set .NormalPorings, 100; killmonsterall .Map$; //.Map$ as array needs an index setarray .Map$[0], "lighthalzen","louyang","comodo","xmas","aldebaran","izlude","payon","geffen","morocc","prontera"; //--------------------- setnpctimer 0; initnpctimer; end; OnTimer5000: stopnpctimer; killmonsterall .Map$; set .loc, rand(getarraysize(.Map$)); setmapflag .Map$[.loc], mf_noskill; monster .Map$[.loc], 156, 179, "Poring", 1002, .SpecialPorings, "Poring Summoner::OnSpecialKill"; monster .Map$[.loc], 156, 177, "Poring", 1002, .NormalPorings, "Poring Summoner::OnNormalKill"; announce "The Poring Event has begun!", 0; sleep 1000; announce "Location: " + .Map$[.loc], 0; sleep 1000; announce "Special Poring: " + .SpecialPorings, 0; sleep 1000; announce "Normal Poring: " + .NormalPorings, 0; end; OnSpecialKill: set .SpecialPorings, .SpecialPorings - 1; //mapannounce strcharinfo(0) + " got a " + getitemname(.ItemID) + "!", bc_map, bc_blue; getitem .ItemID,1; goto PoringCount; OnNormalKill: set .NormalPorings, .NormalPorings - 1; goto PoringCount; PoringCount: if( .SpecialPorings || .NormalPorings ) announce "Special Poring: " + .SpecialPorings + " || Normal Poring: " + .NormalPorings, bc_map, bc_blue; else { announce "The Poring Event has ended.", 0; removemapflag .Map$[.loc], mf_noskill; deletearray .Map$[0], getarraysize(.Map$); goto OnInit; } end; } i guess i figure it out why i got "" on mapindex missing error due on the random map monster .Map$[.loc], 156, 179, instead with coordinate i put 0 0 to be random so thats the error? Quote Link to comment Share on other sites More sharing options...
nanakiwurtz Posted November 9, 2012 Group: Members Topic Count: 81 Topics Per Day: 0.02 Content Count: 1654 Reputation: 583 Joined: 08/09/12 Last Seen: January 14, 2020 Share Posted November 9, 2012 Change the 'OnTimer' label, you see that 5000? It means 5000 miliseconds = 5 seconds, and if you want to change it to an hour you'll need how many miliseconds? Yes, change it back to 0,0 to make it to become random monster spawn location. Quote Link to comment Share on other sites More sharing options...
Mootie Posted November 9, 2012 Group: Members Topic Count: 43 Topics Per Day: 0.01 Content Count: 815 Reputation: 86 Joined: 10/26/12 Last Seen: June 10, 2022 Author Share Posted November 9, 2012 (edited) Change the 'OnTimer' label, you see that 5000? It means 5000 miliseconds = 5 seconds, and if you want to change it to an hour you'll need how many miliseconds? Yes, change it back to 0,0 to make it to become random monster spawn location. so it wont cause the error " " again if i change it back to random? and 360000 = per 1 hour is that correct? and it will automatically kill the porings if the didnt participate right? via killmonsterall .Map$; Edited November 9, 2012 by Mootie Quote Link to comment Share on other sites More sharing options...
nanakiwurtz Posted November 9, 2012 Group: Members Topic Count: 81 Topics Per Day: 0.02 Content Count: 1654 Reputation: 583 Joined: 08/09/12 Last Seen: January 14, 2020 Share Posted November 9, 2012 1 hour is 60*60*1000 In order to force the script to restart again every hour, why don't you use OnMinute00 label? So you don't have to use the timer again. Quote Link to comment Share on other sites More sharing options...
Mootie Posted November 9, 2012 Group: Members Topic Count: 43 Topics Per Day: 0.01 Content Count: 815 Reputation: 86 Joined: 10/26/12 Last Seen: June 10, 2022 Author Share Posted November 9, 2012 1 hour is 60*60*1000 In order to force the script to restart again every hour, why don't you use OnMinute00 label? So you don't have to use the timer again. for the random time? uhm,good idea Quote Link to comment Share on other sites More sharing options...
Ryokem Posted November 9, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 205 Reputation: 19 Joined: 10/12/12 Last Seen: November 7, 2013 Share Posted November 9, 2012 Added the feature asked for. 1. Activate every hour at minute :00 - script Poring Summoner -1,{ OnInit: //---- NPC Config ----- set .ItemID, 1000; set .SpecialPorings, 2; set .NormalPorings, 2; setarray .Map$[0], "lighthalzen","louyang","comodo","xmas","aldebaran","izlude","payon","geffen","morocc","prontera"; //--------------------- end; OnMinute00: //means the event starts every hour killmonsterall .Map$[.loc]; //Kills monsters in case the even doesn't end in time for the next one. set .loc, rand(getarraysize(.Map$)); //Getting a random location (index of map array listed above) setmapflag .Map$[.loc], mf_noskill; monster .Map$[.loc], 0, 0, "Poring", 1002, .SpecialPorings, "Poring Summoner::OnSpecialKill"; monster .Map$[.loc], 0, 0, "Poring", 1002, .NormalPorings, "Poring Summoner::OnNormalKill"; announce "The Poring Event has begun!", 0; sleep 1000; announce "Location: " + .Map$[.loc], 0; sleep 1000; announce "Special Poring: " + .SpecialPorings, 0; sleep 1000; announce "Normal Poring: " + .NormalPorings, 0; end; OnSpecialKill: set .SpecialPorings, .SpecialPorings - 1; mapannounce .Map$[.loc], strcharinfo(0) + " got a " + getitemname(.ItemID) + "!", bc_blue; getitem .ItemID,1; goto PoringCount; OnNormalKill: set .NormalPorings, .NormalPorings - 1; goto PoringCount; PoringCount: if( .SpecialPorings || .NormalPorings ) mapannounce .Map$[.loc], "Special Poring: " + .SpecialPorings + " || Normal Poring: " + .NormalPorings, bc_blue; else { announce "The Poring Event has ended.", 0; removemapflag .Map$[.loc], mf_noskill; deletearray .Map$[0], getarraysize(.Map$); //Reset the map array before creating it back, just to avoid bugs. goto OnInit; } end; } Quote Link to comment Share on other sites More sharing options...
Question
Mootie
if not can you guys help me to make this RA
Edited by EmistryPlease use [CODEBOX] or Attachments for long contents.
Link to comment
Share on other sites
30 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.