Igniz 8 Posted February 11, 2013 In my research tasks i need a lot this script and of course, while my server is running but there is a annoying thing.... everytime when i do this the users go and kill every mvp that can untill the next @reloadscript..... so, could you set a lock on reloading for mvp respawn if they are killed? It would be awesome. Quote Share this post Link to post Share on other sites
ossi0110 200 Posted February 11, 2013 why not use @loadnpc and @unloadnpc 2 jTynne and Mumbles reacted to this Quote Share this post Link to post Share on other sites
jTynne 101 Posted February 11, 2013 This would actually be a neat thing to implement, even for reboots and/or server crashes, not just @reloadscript usage. As a server owner who sees their players of both past and present make usage of these such things, it'd be a wonderful addition to the emulator. +1 from me. 1 Igniz reacted to this Quote Share this post Link to post Share on other sites
Relzz 32 Posted February 11, 2013 I really hate when users go and kill many MVP's after reload.. Quote Share this post Link to post Share on other sites
Ancyker 13 Posted February 11, 2013 I fixed this before in eAthena by scripting every MVPs spawn timer into global variables. It would only respawn them if the global variable was up. It's not hard to script, just takes a while to do each of them. Some pseudo code: - script MVPSpawner -1,{OnTimer60000: if ( $maya < gettimetick(2) && .maya != 1) { monster "anthell02",0,0,"Maya",1147,1,"MVPSpawner::OnMayaDeath"; set .maya,1; } if ( $doppel < gettimetick(2) && .doppel != 1) { monster "gef_dun02",0,0,"Doppelganger",1046,1,"MVPSpawner::OnDoppelDeath"; set .doppel,1; } stopnpctimer; setnpctimer 0; startnpctimer; end; OnMayaDeath: set $maya,gettimetick(2) + 7200 + rand(0,600); set .maya,0; end;OnDoppelDeath: set $doppel,gettimetick(2) + 7200 + rand(0,600); set .doppel,0; end;OnInit: initnpctimer; setnpctimer 0; startnpctimer; end;} There's obviously more to it than this. You need to track if it's currently alive (this will just keep spawning Mayas forever until someone kills one), start and reset the timer, etc. But this would preserve the monsters dead/alive state even through server restarts. Ok I wrote some more code, it should work but I did not test it. You'll need to add the rest of the MVPs as well. Quote Share this post Link to post Share on other sites
Mystery 594 Posted February 11, 2013 I fixed this before in eAthena by scripting every MVPs spawn timer into global variables. It would only respawn them if the global variable was up. It's not hard to script, just takes a while to do each of them. Some pseudo code: - script MVPSpawner -1,{OnTimer60000: if ( $maya < gettimetick(2) && .maya != 1) { monster "anthell02",0,0,"Maya",1147,1,"MVPSpawner::OnMayaDeath"; set .maya,1; } if ( $doppel < gettimetick(2) && .doppel != 1) { monster "gef_dun02",0,0,"Doppelganger",1046,1,"MVPSpawner::OnDoppelDeath"; set .doppel,1; } stopnpctimer; setnpctimer 0; startnpctimer; end; OnMayaDeath: set $maya,gettimetick(2) + 7200 + rand(0,600); set .maya,0; end;OnDoppelDeath: set $doppel,gettimetick(2) + 7200 + rand(0,600); set .doppel,0; end;OnInit: initnpctimer; setnpctimer 0; startnpctimer; end;} There's obviously more to it than this. You need to track if it's currently alive (this will just keep spawning Mayas forever until someone kills one), start and reset the timer, etc. But this would preserve the monsters dead/alive state even through server restarts. Ok I wrote some more code, it should work but I did not test it. You'll need to add the rest of the MVPs as well. I think by making it through the NPC script consists of more time for everyone MvP thats recent + news ones that will come out. Isn't there a way to do this via source and configure it to all MvPs? Quote Share this post Link to post Share on other sites
Igniz 8 Posted February 11, 2013 A simple clausule will be more easy to set, for example, currently the server handle a temporal variable for the tombs of every mvp killed, so, making it a permanent global variable and a if clausule must work. ex. if(##Maya == 1) dontrespawn; else respawn; This variable could be setted like OnInterIfInitOnce. This would be a lot easier than set a timer for every MvP Quote Share this post Link to post Share on other sites
Ancyker 13 Posted February 12, 2013 A simple clausule will be more easy to set, for example, currently the server handle a temporal variable for the tombs of every mvp killed, so, making it a permanent global variable and a if clausule must work. ex. if(##Maya == 1) dontrespawn; else respawn; This variable could be setted like OnInterIfInitOnce. This would be a lot easier than set a timer for every MvP 1) You don't need an NPC timer for every MVP. A single timer can control every MVP. My example shows 2 MVPs controlled by a single timer. 2) Every MVP already has a timer. How do you think the server knows when to spawn them? It uses a timer. 3) You should not be using @reloadscript on a live/production server anyway. That's what test servers are for. Quote Share this post Link to post Share on other sites
Emistry 145 Posted February 12, 2013 just use killmonster command to kill all mvp during the startup / reloading server... brian already did 1...and if i am not mistaken...it's your topic there... Quote Share this post Link to post Share on other sites
Ind 945 Posted February 12, 2013 just use killmonster command to kill all mvp during the startup / reloading server... brian already did 1...and if i am not mistaken...it's your topic there... nevertheless that behavior screws up any player who had mvp death times and gives advantage to those who noticed the reload to then go kill the mobs on reloadtime+mobspawntime 1 Igniz reacted to this Quote Share this post Link to post Share on other sites
Igniz 8 Posted February 25, 2013 ¿Any new about this? Quote Share this post Link to post Share on other sites
Kichi 6 Posted February 27, 2013 strange request Quote Share this post Link to post Share on other sites
malufett 247 Posted February 27, 2013 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.. 6 kyeme, AnnieRuru, Ind and 3 others reacted to this Quote Share this post Link to post Share on other sites
Zopokx 7 Posted February 28, 2013 Admin fault. Use @loadnpc and @unloadnpc instead. 1 evilpuncker reacted to this Quote Share this post Link to post Share on other sites
kyeme 71 Posted February 28, 2013 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.. +1 In the official if the server restarts, it should refresh the monster spawn. As i see, only @reloadscript should be separated in monster spawn refresh. Quote Share this post Link to post Share on other sites
clydelion 4 Posted February 28, 2013 Here's a global solution to your problem. Add 5-45 minutes of delay to BOSS monsters after a restart/reloadscript(random for every one) + display the remaining time for it to spawn(@mobsearch). http://pastebin.com/frRFwCq4 Quote Share this post Link to post Share on other sites
jTynne 101 Posted February 28, 2013 Admin fault. Use @loadnpc and @unloadnpc instead. Even when there are server maintenances, map server crashes, and/or connectivity issues beyond the control of the admin of an individual server? I think not. Correct, @reloadscript shouldn't be used on public servers to reload scripts, however, things happen which disrupt connectivity of game services, and players abuse crashes to quickly re-farm MVPs after such events take place. 1 Igniz reacted to this Quote Share this post Link to post Share on other sites
Igniz 8 Posted March 3, 2013 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.. +1. Please eat my soul T_T! Quote Share this post Link to post Share on other sites
Igniz 8 Posted March 22, 2013 Sorry for doublepost but.... any new of this? Quote Share this post Link to post Share on other sites
simplynice 1 Posted July 12, 2013 Well, it would be great if it's not just MVPs also regular mobs and mini-bosses. Quest items can be obtain in a regular mobs and mini-bosses. @reloadscript causes them to respawn also. 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.. 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. Quote Share this post Link to post Share on other sites
jaBote 438 Posted July 12, 2013 @Igniz Maybe this would be a lot better if it was a suggestion for Hercules Devs? You think it'd be better if this got officially implemented for everyone in case this is done? In that case I could move this to `Suggestions` forum. Quote Share this post Link to post Share on other sites
Gepard 55 Posted July 15, 2013 @reloadscript should not be used in production servers, at least not too often. The real problem lies elsewhere. It's currently not possible to not use this command at all, because there is no way to unload mob spawns. If this was fixed, you could easily unload anything you want: mob spawnsets (with new command), scripts (NPCs, warps) and user functions (with @unloadnpc). I think it covers all that we have in /npc/ folder. 1 evilpuncker reacted to this Quote Share this post Link to post Share on other sites
OnNplay 27 Posted July 15, 2013 How about @saveglobal will save all calculation into db, later @restoreglobal will put last state into alive again. Quote Share this post Link to post Share on other sites