MvP and @reloadscript

Igniz

New member
Messages
56
Points
0
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.

 
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.

 
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.

 
Last edited by a moderator:
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?

 
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

 
Last edited by a moderator:
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.

 
Last edited by a moderator:
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...

 
Last edited by a moderator:
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
default_tongue.png
and gives advantage to those who noticed the reload to then go kill the mobs on reloadtime+mobspawntime
 
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..
default_smile.png


default_ani_meow.gif


 
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..
default_smile.png


default_ani_meow.gif
+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.
default_smile.png


 
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.

 
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..
default_smile.png


default_ani_meow.gif
+1. Please eat my soul T_T!

 
Back
Top