EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Server Code Submissions (https://www.eqemulator.org/forums/forumdisplay.php?f=669)
-   -   Make time available to quests (https://www.eqemulator.org/forums/showthread.php?t=24122)

Angelox 06-27-2008 02:56 PM

what about gottime? should I leave as original, Knightly, or your change?

Derision 06-27-2008 03:04 PM

Quote:

Originally Posted by Angelox (Post 151604)
what about gottime? should I leave as original, Knightly, or your change?

I don't understand why you get different results with Knightly's change or mine, on the face of it they should have the same effect.

I was more interested in why the statics had a different time than dynamics. My 'gottime fix' seems the more 'correct' one to me, but you can try with either.

Angelox 06-27-2008 03:17 PM

Quote:

Originally Posted by Derision (Post 151606)
I don't understand why you get different results with Knightly's change or mine, on the face of it they should have the same effect.

I was more interested in why the statics had a different time than dynamics. My 'gottime fix' seems the more 'correct' one to me, but you can try with either.

O well, I already compiled with your "zone->GetTimeSync();" fix and knightlys - I was just wanting to have it the way you wanted it.
BtW, it's working fine, all zones Sync together, static and dynamic. I'll watch it for a while and see i f it stays.
If so, what is "gottime" needed for? seems your insert will render gottime useless?

Derision 06-27-2008 03:24 PM

Quote:

Originally Posted by Angelox (Post 151607)
If so, what is "gottime" needed for? seems your insert will render gottime useless?

It appears that whoever wrote the code meant the 'gottime' flag to mean that the zone had already synced it's time and didn't need to go to the trouble of sending another TimeSync request packet to world to sync again.

Since GetTimeSync is only called once during zone bootup, it doesn't seem to serve any purpose at present.

Angelox 06-27-2008 03:50 PM

Well, this fix you made is working - best fix I've seen yet, MUCH better now.
I was just looking at a few old things I did - believe it or not, I hadn't looked at this time thing since I first came out with my "day and night" logic (from a dummies' point of view), sort of got burnt out on it. And now I'm out of work again and at home, so I'm back to learning all this.
Maybe you can find time to make a diff (probably quote out, the "gottime" entries ), see if the Devs can put it in.

Angelox 06-30-2008 03:02 PM

Here's what I was able to come up with using Knightly's '$zonetime' and Derision's 'zone->GetTimeSync();' fix.
This is the most effective and less intrusive way to spawn the day/night NPCs. This originally was Qadar's idea (use EVENT_WAYPOINT), while we were working on the boat system, I just ported it over to the day/night spawns.
You need one npc, preferably invisible , untrackable, etc. and you need to assign him two waypoints at the same spawnpoint. Example: Lets say I spawned my LakeRathe NPC at 0,0,0 (X,Y,Z); I then make two more grid/waypoints at the same 0,0,0 ( no need to make it move around, it will still move from WP to WP), and give each WP a pausetime of 45. Then comes the script, which I see is different from Knightlys, but probably arrives at the same conclusion , if you just change EVENT_ENTER or EXIT to EVENT_WAYPOINT.
Code:

#lakerathe night and day spawns
#Angelox

sub EVENT_WAYPOINT{
if (($zonetime >= 0)&&($zonetime <= 800)){          #nighttime
        quest::spawn_condition(lakerathe, 2,0);      #live are 2
        quest::spawn_condition(lakerathe, 1,1);}    #undead are 1
elsif (($zonetime >= 2000)&&($zonetime <= 2359)){    #nighttime
        quest::spawn_condition(lakerathe, 2,0);      #live are 2
        quest::spawn_condition(lakerathe, 1,1);}    #undead are 1
else{                #daytime
        quest::spawn_condition(lakerathe,2,1);
        quest::spawn_condition(lakerathe,1,0);}}
## End spawn Script

Now, the only way this truly works is if you follow Derisions simple instructions for the 'zone->GetTimeSync();' fix, and add the insert - once the insert is in, there will be no need for time syncs, timers, or anything else. All zones will have the same time exactly: static or dynamic. The only thing I saw was, my server will start up at 4:00am instead of the original 8:00am (EQ Time), which is no big deal because it continues on to cycle the 24 hours in all zones.
Here's a pointer on using EVENT_WAYPOINT (Something we figured out while doing the boat work); Although the zone may be static, Perl scripts will not work, unless a PC is there (in the zone) too - This was a big problem with the boats, but solved.
Now that I think of it, I see where I can throw in an EVENT_SPAWN to the above script and that will easily fix any waypoint delays when you first zone in.
This will be the next script to try out;
Code:

#lakerathe night and day spawns
#Angelox
sub EVENT_SPAWN{
if (($zonetime >= 0)&&($zonetime <= 800)){          #nighttime
        quest::spawn_condition(lakerathe, 2,0);      #live are 2
        quest::spawn_condition(lakerathe, 1,1);}    #undead are 1
elsif (($zonetime >= 2000)&&($zonetime <= 2359)){    #nighttime
        quest::spawn_condition(lakerathe, 2,0);      #live are 2
        quest::spawn_condition(lakerathe, 1,1);}    #undead are 1
else{                #daytime
        quest::spawn_condition(lakerathe,2,1);
        quest::spawn_condition(lakerathe,1,0);}}

sub EVENT_WAYPOINT{
if (($zonetime >= 0)&&($zonetime <= 800)){          #nighttime
        quest::spawn_condition(lakerathe, 2,0);      #live are 2
        quest::spawn_condition(lakerathe, 1,1);}    #undead are 1
elsif (($zonetime >= 2000)&&($zonetime <= 2359)){    #nighttime
        quest::spawn_condition(lakerathe, 2,0);      #live are 2
        quest::spawn_condition(lakerathe, 1,1);}    #undead are 1
else{                #daytime
        quest::spawn_condition(lakerathe,2,1);
        quest::spawn_condition(lakerathe,1,0);}}
## End spawn Script

EVENT_SPAWN will instantly set the right spawn when you Zone in, and EVENT_WAYPOINT will keep checks on what mob should be up.

If you use the same NPC i placed for day/night, you only need but one of these spawns attached to the above PL per zone, so you can delete all the other ones, where I used proximity - this should be easy, as I always 'hand spawn' my NPCs under the same spawngroup. In places like Kithicor and Commons, I had put in numerous spawns.


All times are GMT -4. The time now is 07:20 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.