Day / Night

Discussions of the design and development of in-game content.

Moderator: Team Members

Post Reply
User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Day / Night

Post by Gangrenous » Mon Jul 25, 2016 6:33 am

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.
Resident Dirty Hippy

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Day / Night

Post by Gangrenous » Mon Jul 25, 2016 7:28 am

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
Resident Dirty Hippy

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Day / Night

Post by Gangrenous » Mon Jul 25, 2016 10:36 am

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.
Resident Dirty Hippy

User avatar
xinux
Team Member
Posts: 680
Joined: Wed Mar 10, 2010 11:10 am
Location: Destroyer of Servers

Re: Day / Night

Post by xinux » Mon Jul 25, 2016 10:47 am

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);
EQ II - Build=1360 (Orig) - Build=1360 (DoF) - Build=2654 (KoS) - Build=3375 (Classic) - Build=3554 (EoF)
EQ II - Build=4412 (RoK) - Build=5122 (TSO) - Build=6118 (SF) - Build=7628 (DoV) - Build=8295 (Aod)

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Day / Night

Post by Gangrenous » Mon Jul 25, 2016 11:00 am

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.
Resident Dirty Hippy

User avatar
xinux
Team Member
Posts: 680
Joined: Wed Mar 10, 2010 11:10 am
Location: Destroyer of Servers

Re: Day / Night

Post by xinux » Mon Jul 25, 2016 11:03 am

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.
EQ II - Build=1360 (Orig) - Build=1360 (DoF) - Build=2654 (KoS) - Build=3375 (Classic) - Build=3554 (EoF)
EQ II - Build=4412 (RoK) - Build=5122 (TSO) - Build=6118 (SF) - Build=7628 (DoV) - Build=8295 (Aod)

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Day / Night

Post by Gangrenous » Mon Jul 25, 2016 12:29 pm

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.
Resident Dirty Hippy

User avatar
xinux
Team Member
Posts: 680
Joined: Wed Mar 10, 2010 11:10 am
Location: Destroyer of Servers

Re: Day / Night

Post by xinux » Mon Jul 25, 2016 12:36 pm

If you kill him does he respawn like normal?
EQ II - Build=1360 (Orig) - Build=1360 (DoF) - Build=2654 (KoS) - Build=3375 (Classic) - Build=3554 (EoF)
EQ II - Build=4412 (RoK) - Build=5122 (TSO) - Build=6118 (SF) - Build=7628 (DoV) - Build=8295 (Aod)

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Day / Night

Post by Gangrenous » Mon Jul 25, 2016 1:46 pm

Hmm, interesting. Let me change his respawn.
Resident Dirty Hippy

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Day / Night

Post by Gangrenous » Mon Jul 25, 2016 1:49 pm

Changed it to 2 seconds, no go, no respawn.
Resident Dirty Hippy

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Day / Night

Post by Jabantiz » Mon Jul 25, 2016 3:40 pm

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.

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Day / Night

Post by Gangrenous » Mon Jul 25, 2016 5:30 pm

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.
Resident Dirty Hippy

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests