Jump to content
Igniz

MvP and @reloadscript

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

 

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?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 :P and gives advantage to those who noticed the reload to then go kill the mobs on reloadtime+mobspawntime

Share this post


Link to post
Share on other sites

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..:)

 

:meow:

Share this post


Link to post
Share on other sites

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.. :)

 

:meow:

+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. :)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.. :)

 

:meow:

 

+1. Please eat my soul T_T!

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

@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.

Share this post


Link to post
Share on other sites

@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. 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.