I have done a few source code edits of my own, so that would need to be done (the merging) anyhow, when the time comes to upgrade the server source.
I was myself puzzling over how to implement a "live" time change switch, like you mentioned, instead of just triggering on zoning. Incidentally, I have managed to break this script again, by trying to reverse what we coded and cancel out the night time buff when it's day time. I will highlight the area I think caused the problem, and explain why I think it happened. Code:
sub EVENT_TIMER { I believe this happened because we've kept the night check as just an "else" statement and not actually coded in the times that it considers to be night, so when I added another "else" in there, it's getting confused about what's actually going on. This is why I thought we needed to actually designate the specific times of night, instead of just going by "else" --- does that make sense, and am I correct in thinking this is what caused the problem? |
Here is your script edited for Arias, I have used spellid 11 as the day buff. Putting this back into .pl will be almost identical.
Code:
if ($text=~/timebuff/i) { quest::selfcast(346); #cast night buff but we are still in the "else" day/night check, but are outside of the "if has daytime buff check, which is also part of the else daytime/nightime check" Sorry, i suck at explaining things. Also, in this case you will get a message that it is dark, then a message that the sun fades, so if you would want this switched then just move the its very dark outside messaage to after the check for daytime buff and vice versa. |
rencro, you got it! This one works exactly as I wanted it to! Would still love to get it working in a "live" manner, as in automatically firing when the right times hit, but I'm more than happy with its current implementation! Maybe Kingly will know how to get it to update itself automatically without needing to zone.
Edit: I'm thinking about this, and my guess is that timers would somehow be involved in making this update itself without the need to zone......... |
Actually you did it, this is your code, I just helped a bit with the formatting. This could get silly complicated depending how far you want to push this idea. For instance if its nightime and the class in Necro, do they get a boost buff, where as if its a paladin do they get maybe a slight debuff.
Also, if its daytime and it starts to rain, do the day buffs get halved, and do druids get a silly powerfull storm buff, also what happens when inside a dungeon, I assume you would negate the system altogether but the choice is yours. ect ect ect, lots of places to take this. I'll post the c++ code sometime soon, just want to play with different setting ect first. |
Awesome! That's my ultimate plan, to make this into a very complex and robust Time and Weather System. I just wanted to start small so I could get a handle on how this would be working in practice. Theories, I have many, but putting them into practice is where I sometimes have trouble :)
Next I am going to be looking into the DayNight npcs and DayNight.pl in quest globals to find a way to make this update itself automatically when the time of day changes. Once I have a more robust version of this, with weather effects and such, I will be posting it for others who are interested in doing something like this with their servers. |
Edit: Nevermind!
|
Here is what i have so far, I built this on my fork, and tested, but a diff from my fork would be useless so I imported into the latest source after doing a diff between my source and the latest (not too many changes, and nothing I think that would cause any issues) Note, I did not build or test this on the current live source even though it is diffed against it.
I cannot stress enough to create a branch of your source, patch this in, and build on a TEST ENVIRONMENT, not your production server, also that test environment should be using a COPY of your production database, not the actual production db itself (sorry if I seem overly anal, but I assisted a server op before with the same provisos, and to thoroughly test my changes, and he told me he would, but he went live with it 5 minutes later :???: and there were countless bugs as a result affecting the live players :facepalm Rant over diff current source Code:
diff --git a/common/spdat.cpp b/common/spdat.cpp All this does is check if any of these buffs are active, and if its active during the wrong time-frame to remove it and put the relevant version on. You still need to turn the relevant buff on via perl for this to do the checks on. I made this to where it is easily expandable, can add more spells in, do compares of day buffs during the day ect ect. Also, please anyone, feel free to tell me where this can be improved ect.. |
All times are GMT -4. The time now is 04:14 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.