Page 1 of 1

Day / Night

Posted: Mon Jul 25, 2016 6:33 am
by Gangrenous
Do we have a way of implementing Day / Night spawn cycles? I absolutely want a different feel in the towns between the day/time activity and the night time activities. Plus I will be pulling in many quest, like "Blackburrow Stout" and some mobs should be night time only.

Re: Day / Night

Posted: Mon Jul 25, 2016 7:28 am
by Gangrenous
I did see a post around 4 years or so ago, regarding Day / Night in LUA. Yeah I could go that route, but do we have anything directly in the database?

http://eq2emulator.net/wiki/index.php/LUA:ZoneScripts

Re: Day / Night

Posted: Mon Jul 25, 2016 10:36 am
by Gangrenous
I am not seeing anything in the source to handle this database wise. I think it would be viable to do it in the zone script using dawn and dusk. You can literally either spawn the mob or spawn the mob via location, set the mob at 0% and then spawn it manually via LUA.

Re: Day / Night

Posted: Mon Jul 25, 2016 10:47 am
by xinux
Just looking at the source i have it's in there the time is set via a rule for dawn/dusk.

The zone server checks it as part of the process and when it changes it call's the Zone Script.

Code: Select all

if (!isDusk && ((hour > dusk_hour || hour < dawn_hour) || ((dusk_hour == hour && minute >= dusk_minute) || (hour == dawn_hour && minute < dawn_minute)))) {
					isDusk = true;
					lua_interface->RunZoneScript(zone_script, "dusk", this);
				}
else if (isDusk && ((hour > dawn_hour && hour < dusk_hour) || ((hour == dawn_hour && minute >= dawn_minute) || (hour == dusk_hour && minute < dusk_minute)))) {
					isDusk = false;
					lua_interface->RunZoneScript(zone_script, "dawn", this);

Re: Day / Night

Posted: Mon Jul 25, 2016 11:00 am
by Gangrenous
Yeah I knew there was an event hook for LUA. I had read where John had wanted it more like the EQ1 spawn event, just wondering if that had ever been implemented.

Re: Day / Night

Posted: Mon Jul 25, 2016 11:03 am
by xinux
Ahh ok i get what you are saying now i'm not sure to tell you the truth. I'm working on this over at VGOEmu right now i got the server tracking day or night via a bool. My plan is to add a column in the spawn table called spawn_cycle where 0 = anytime 1 = day 2 = night. When the bool changes to IsNight() for instance any spawn marked with a 1 would despawn and any marked with a 2 would spawn. This way it doesn't have to be handled via LUA.

Re: Day / Night

Posted: Mon Jul 25, 2016 12:29 pm
by Gangrenous
Well the LUA shit did work though, like perfectly. I set the time to 19:59 and he spawned, he walks his path some, I set the time to 7:59 and a second later he disappears. Beautiful stuff. I hate doing it in LUA though, but it does work.

Re: Day / Night

Posted: Mon Jul 25, 2016 12:36 pm
by xinux
If you kill him does he respawn like normal?

Re: Day / Night

Posted: Mon Jul 25, 2016 1:46 pm
by Gangrenous
Hmm, interesting. Let me change his respawn.

Re: Day / Night

Posted: Mon Jul 25, 2016 1:49 pm
by Gangrenous
Changed it to 2 seconds, no go, no respawn.

Re: Day / Night

Posted: Mon Jul 25, 2016 3:40 pm
by Jabantiz
The plan was to handle Day/Night spawns with the DB but the people that intended to work on it never got around to it, LUA was meant for more of stuff like the doors in thundering steppes or the zone wide debuff in loping planes at night. While LUA can be used to spawn NPC's any thing spawned through LUA doesn't respawn as far as I know.

Re: Day / Night

Posted: Mon Jul 25, 2016 5:30 pm
by Gangrenous
Well it may be good enough for a few things, I will let this one quest go with the "assumption" it is a 24 hour spawn.