Xtremist Posted December 14, 2011 Group: Members Topic Count: 39 Topics Per Day: 0.01 Content Count: 196 Reputation: 20 Joined: 11/20/11 Last Seen: February 22, 2019 Share Posted December 14, 2011 Hey guyz, as the topic says, I want to have monster on every map on hourly basis if they die. Permanent monster spawn will have too much of redundant code as we will have to copy paste all the things for all maps. This is what I tried but it aint worked! http://pastebin.com/aWjUWGe2 Quote Link to comment Share on other sites More sharing options...
jTynne Posted December 14, 2011 Group: Members Topic Count: 33 Topics Per Day: 0.01 Content Count: 399 Reputation: 199 Joined: 11/09/11 Last Seen: December 14, 2020 Share Posted December 14, 2011 Simply a copy/paste from the IRC log: [07:52] <%jTynne|Busy> Ah, here we are [07:52] <%jTynne|Busy> monster $motwmap$,0,0,"--ja--",$motw,1; [07:53] <%jTynne|Busy> You can modify that to work with what you wrote earlier [07:53] <%jTynne|Busy> Instead of a permanent global string variable, just use an array, and fill the sucker up. Replace the $motw at the end of the line with the monster ID you'd like spawned [07:53] <Xtremist> http://rathena.org/board/topic/54340-spawn-a-monster-on-n-no-of-maps-on-hourly-basis-if-they-die/ [07:54] <%jTynne|Busy> the --ja-- makes the name found in the japanese_name field display when spawned [07:54] <%jTynne|Busy> I'll copy/paste this to that thread So, using your example from earlier in the IRC chat, it would look something along the lines of, monster $maps$[$i],0,0,"--ja--",$spawn,1; Set the variables accordingly. I don't have much experience with arrays, so I wish you the best of luck with that. Quote Link to comment Share on other sites More sharing options...
KeiKun Posted December 14, 2011 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 967 Reputation: 53 Joined: 11/13/11 Last Seen: April 18 Share Posted December 14, 2011 Hey guyz, as the topic says, I want to have monster on every map on hourly basis if they die. Permanent monster spawn will have too much of redundant code as we will have to copy paste all the things for all maps. This is what I tried but it aint worked! http://pastebin.com/aWjUWGe2 Well if your problem is fixed lets dance @ IRC right now ROFL! Quote Link to comment Share on other sites More sharing options...
Emistry Posted December 14, 2011 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2370 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted December 14, 2011 This is what I tried but it aint worked!http://pastebin.com/aWjUWGe2 i guess,..the problem is here .@maps$[.i],0,0,0,0 monster Poring 1963,50,0,0,0 that is Permanent Spawn Monster script...but i dont think it will works in a "NPC Script" or "Function" However, based on this script....it will Work.... monster $maps$[$i],0,0,"--ja--",$spawn,1; but it wont summon upon it died....and why use ( Global Variable "$i" ) ?? so, based on your script, i have made another one... - script Sample -1,{ OnInit: OnMinute00: setarray .Maps$, "prontera", "veins", "xmas", "yuno"; for(set .@i,0; .@i < getarraysize( .Maps$ ); set .@i,.@i + 1 ){ if( !mobcount( .Maps$[.@i],strnpcinfo(0)+"::OnMobKilled" ){ monster .Maps$[.@i],0,0,"--ja--",1963,1,strnpcinfo(0)+"::OnMobKilled"; } } end; OnMobKilled: dispbottom "You have killed the Monster, and it will spawn back at next Hours."; end; } In this script, the monster will spawn Hourly, it will check for the Monster before they spawn... it the monster is already exists, it wont spawn another new 1... just some flaw i think might have... if the player killed the monster at XX:59 ( 59 Minutes , 1 Minutes for next Hours ) , it will spawn the monster after the "Next" Hours is reached. Quote Link to comment Share on other sites More sharing options...
jTynne Posted December 14, 2011 Group: Members Topic Count: 33 Topics Per Day: 0.01 Content Count: 399 Reputation: 199 Joined: 11/09/11 Last Seen: December 14, 2020 Share Posted December 14, 2011 Lol, go Emistry. Sneak posting before I can! xP Anyway, glad you got a good solution now. Goodnight! Try this for the 60 minute delay on spawn after being killed. Just put it together off the top of my head. As I said in IRC, I'm going to sleep now. Good luck! set $mobnum,1002; OnNPCKillEvent: if(killedrid == $mobnum) { getmapxy .@map$,.@x,.@y,0; sleep2 3600000; monster .@map$,0,0,"--ja--",$mobnum,1;} Quote Link to comment Share on other sites More sharing options...
Xtremist Posted December 14, 2011 Group: Members Topic Count: 39 Topics Per Day: 0.01 Content Count: 196 Reputation: 20 Joined: 11/20/11 Last Seen: February 22, 2019 Author Share Posted December 14, 2011 - script Monster -1,{ OnSpawn: setarray $@maps$,"alberta","aldebaran","amatsu","ayothaya","brasilis","brasilis","dicastes01","einbroch","geffen","gonryun","hugel","izlude","jawaii","lighthalzen","louyang","manuk","moscovia","morocc","niflheim","payon","prontera","rachel","umbala","veins","xmas","yuno"; for(set .i,0; .i<=getarraysize(.@maps$)-1; set .i,.i+1) { monster $@maps$[$i],0,0,"--ja--",1247,1,"Monster::OnDead"; } } end; OnDead: initnpctimer; end; OnTimer600000: stopnpctimer; goto OnSpawn; } Quote Link to comment Share on other sites More sharing options...
Emistry Posted December 14, 2011 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2370 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted December 14, 2011 (edited) OnDead:initnpctimer; end; OnTimer600000: stopnpctimer; goto OnSpawn; this will keep override the current time counting upon the same monster in killed in other map..... still...the best way is using the normal Permanent Monster Spawn way.... mapnam,0,0,0,0 monster Poring 1963,50,0,0,0 Edited December 14, 2011 by Emistry Quote Link to comment Share on other sites More sharing options...
Question
Xtremist
Hey guyz,
as the topic says,
I want to have monster on every map on hourly basis if they die.
Permanent monster spawn will have too much of redundant code as we will have to copy paste all the things for all maps.
This is what I tried but it aint worked!
http://pastebin.com/aWjUWGe2
Link to comment
Share on other sites
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.