I agree with this, after killing MVPs you can save it to db, if uses @reloadscript it will fetch the respawn time from and calculate it like how it spawns normally but the the thing is alive MVPs. You'll figure it out malufett.this could be done in src easily..
MVP killed -> save to db left respawn time
Server restarted or npc reloaded -> server fetch respawn time from db then parse then load to its ticking process before respawn
this will only work if the MVP mob dies after server initial start...
ATM just an idea and the codes are still in my brain..if I have time I'll do it..![]()
That would be no purpose, in case map server saves respawn times of MvPs and minibosses to restore them automaticallyHow about @saveglobal will save all calculation into db, later @restoreglobal will put last state into alive again.
That's exactly my point.The main problem its not reload all or reload only a thing, it's keeping the respawn times alive when you need to refresh functions or labels. If every mvp has his timer, it could be saved into the db and match the time when you reload the server. Maybe we can create a list in the db folder with the mobs that you want to keep dead (for main purposes for everyone).
Yeah, it shouldn't be used in production servers but what can you do when you need to refresh a function or call the OnInit labels again without duplicate the npc's? Massive Npc's that uses a main function can't be refreshed one by one due the main function is alive in the deepest code. It's @reloadnpc or do a shutdown on the server. (In my case, a lot of variables are temporal in order to avoid consuming a lot of memory in permanent variables)
// NPC to trigger other NPC events manually// To "click" this NPC, whisper to NPC::donpcevent as you would// to any other player.- script donpcevent -1,{ end;OnWhisperGlobal: if (getgmlevel() >= 99) { while (1) { mes "Please enter eventname in"; mes "^0000FFNPCName::Event^000000 format."; mes "Enter ^FF00000^000000 to cancel."; next; input .@event$; if (.@event$ != "" && compare(.@event$, "::")) break; if (.@event$ == "0") close; } mes "Triggered event:"; mes "^0000FF" + .@event$ + "^000000."; donpcevent .@event$; close; } end;}
You could spawn mvps manually and create a global variable for each one of them containing the time of the last spawn...Something like:I'm looking for the solution the whole day, but it seems there's none. Anyone?
OnInit: // Mvp ids setarray $MVP_id[0],id1,id2,id3; // Mvp maps NO GAT's! setarray $MVP_maps$[0],"map1","map2","map3"; // Respawn time (HOURS) setarray $MVP_tm[0],tm1,tm2,tm3; initnpctimer; // IT SHOULD FALL HERE! OnTimer3600: // After a hour for( set .@i,0; .@i < getarraysize($MVP_id); set .@i, .@i+1 ) { set .@time, $MVP_tm[.@i]*3600; // Conversion to seconds so we can use gettimetick if( ($MVP_last_respawn[.@i] + $MVP_tm[.@i]) > gettimetick(2) ) continue; // Time has yet to pass monster "map",0,0,"--ja--",$MVP_id[.@i],1; // Defines last respawn set $MVP_last_respawn[.@i], gettimetick(2); } setnpctimer 0; end;
are my maps correct?buildin_monster: Attempted to spawn monster class 1112 on non-existing map 'map'
OnInit: // Mvp ids setarray $MVP_id[0],id1,id2,id3; // Mvp maps NO GAT's! setarray $MVP_maps$[0],"map1","map2","map3"; // Respawn time (HOURS) setarray $MVP_tm[0],tm1,tm2,tm3; initnpctimer; // IT SHOULD FALL HERE! OnTimer3600: // After a hour for( set .@i,0; .@i < getarraysize($MVP_id); set .@i, .@i+1 ) { set .@time, $MVP_tm[.@i]*3600; // Conversion to seconds so we can use gettimetick if( ($MVP_last_respawn[.@i] + $MVP_tm[.@i]) > gettimetick(2) ) continue; // Time has yet to pass monster $MVP_maps$[.@i],0,0,"--ja--",$MVP_id[.@i],1; // Defines last respawn set $MVP_last_respawn[.@i], gettimetick(2); } setnpctimer 0; end;
Everything should be fixed now, even the .@time variable c:http://pastebin.com/sAX7KazVWhat is the purpose of .@time variable?
Is this behavior normal? The MVP will respawn even the last MVP respawn is not yet killed?
Can you pls fix this. It keeps respawning even the boss not killed
Thats the ideal way to do it. But you cant control the crash of the server that makes all ur mobs re respawn on sever restart. Specially MvPs.I know i am a "bit" late with my opinion ^^ but I use a local test server for scripting and other things. In that server i can do @reloadscript as much as i want / need and no player is online to kill any monster. New scripts are uploaded when they work 100% fine and i do @reloads for very important bugfixes ONLY. All other stuff has to wait for the next monthly maintenance.
Regards
Snowflake![]()
True ^^ i can't control a crash. In that case it is usefull to have a time controlled re-spawn in case the mvp was killed already. So it would be nice when the server logs it and respawns MvPs only in case their respawn time is up.Thats the ideal way to do it. But you cant control the crash of the server that makes all ur mobs re respawn on sever restart. Specially MvPs.I know i am a "bit" late with my opinion ^^ but I use a local test server for scripting and other things. In that server i can do @reloadscript as much as i want / need and no player is online to kill any monster. New scripts are uploaded when they work 100% fine and i do @reloads for very important bugfixes ONLY. All other stuff has to wait for the next monthly maintenance.
Regards
Snowflake![]()
We use essential cookies to make this site work, and optional cookies to enhance your experience.