Mounted Out of Combat Regeneration
Hello,
I was unable to find a fix for this (sorry if there is a known one) so here is the code I added to enable Mounted OOC Like on live. Orginal: horse.cpp Code:
void Client::SummonHorse(int16 spell_id) { Code:
void Client::SummonHorse(int16 spell_id) { Orginal: Code:
void Client::SetHorseId(int16 horseid_in) { Code:
void Client::SetHorseId(int16 horseid_in) { |
So I did more testing with this and the only problem I can find with this solution is that you still gain rested OOC while moving on a mount.
If anyone could point out were the code for movement is im sure just adding a playeraction = 0 when movement would fix that. Or another thought I can not find the code that controles the resting UI. If I knew were that was I see no reason why something like... if(restui == true) { playeraction = 1; } else playeraction = 2 wouldn't fix the entire mounted ooc problem Sikkun |
Ok so I have came out with a new solution. This works when sitting and standing still on a mount, it no longer allows you to regenerate while moving on a mount.
in the Zone project client_process.cpp void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) Method ADD: Code:
//allow player to have OOC regeneration on a mount Code:
// Break Hide if moving without sneaking and set rewind timer if moved |
Make client_process.cpp
client_packet.cpp |
Hmm, forcing them to sitting seems like the wrong approach to me. You know they're on a horse, so I think something like this might be better. I haven't tested it, but I think the logic is correct. It works the same as mana regen when sitting or mounted as seen in Client::CalcManaRegen() and Client::CalcBaseManaRegen().
client_process.cpp Code:
void Client::CalcRestState() { |
important note when implementing this new thing, there is a Rule in DB which controls OOC regen, if its on, off and how it scales. don't forget to take it into account ;)
|
Quote:
|
My code doesn't actually force the user to sit it just tells the system you are sitting (same animations as usual). Though ill try your code to see if that's an easier fix.
|
Quote:
Code:
if(AggroCount || !(IsSitting() || GetHorseId()) ) |
You're probably right on the logic. I didn't test it, but I think if a change is made, it should be made there.
Setting playeraction to 1 will make IsSitting() return true, which affects many other things, such as not being able to use skills/aa, being hit for max damage, and multiplying aggro. When you changed playeraction did you test in combat to see if you could cast spells and such? |
When I tried the gethorseid() orginally like you are saying it did not work. I assumed this is because that code isn't updating all the time. (I havn't checked it again but I will).
Mine only sets playeraction = 1 when youare mounted + standing still. Which as far as my understanding on live ony a moun + being still = everything the same as sitting. So when you are on a mount and still logically IsSitting() should be true. Casting a spell/combat/aa will change the playeraction code. I have tested with some spell casting/combat and it was all working correctly (because all of those break /sit. I'll test the spell casting/aa/combat some more and try to see if your work around works again. |
The other issue I can think of with your logic though is gethorseid() will be true all the time while your on a mount. Meaning if that fix did work you would get ooc regin the entire time you are on a horse. Meaning you would get ooc regin while moving.
|
Alright so I'm going to try and clean this thread up some and share all of my testing results.
Mounted OOC Testing 5-18-2011 Test 0 Base Case Unaltered EQEmulator Source Results: With Database Rule enables OOC regeneration works while sitting but not while on a mount. Test 1 Zone Code:
client_process.cpp Game does not add OOC regeneration while on a mount with this code Most likely due to when/how this code updates. It also disables OOC regeneration while /sit elemenating OOC regeneration from the game. Test 2 Zone client_process.cpp Code:
void Client::CalcRestState() method Game does not add OOC regeneration while on a mount with this code Most likely due to when/how this code updates So my testing shows that even though the logic of that code does seem right, it does not work (That was the first way I tried to fix the issue also). Because of the issues brought up my code has changed a little and I will explain each part. Test 3 (This first part allows the client to see the player as sitting when the player is mounted and still, when moving the client sees the player as standing. This allows for OOC regeneration while mounted, but stops regeneration when the player moves. All +argo, +dmg of sitting would still happen, this is because sitting on a mount is viewed the same /sit). Zone client_packet.cpp void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) method Insert code after // Break Hide if moving without sneaking and set rewind timer if moved code block. Code:
//allow player to have OOC regeneration on a mount (This second part tells the client that a user is "standing" when an aa ability is used this will stop OOC regen for that tick and allow a player to cast their aa ability while mounted. After the ability is used the OOC regeneration will start again on the next tick unless the AA used created an in combat situation.) Zone client_packet.cpp void Client::Handle_OP_AAAction(const EQApplicationPacket *app) method insert code before mlog(AA__IN, "Received OP_AAAction"); Code:
//check if you are on a mount Zone horse.cpp void Client::SetHorseId(int16 horseid_in) method Code:
void Client::SetHorseId(int16 horseid_in) { Extended Testing: Test 1 Player moves Results: Player does not gain OOC bonus until they have come to a complete stop. Test 2 Player is in combat Results: Player does not gain OOC bonus until compat has ended, OOC Timer is finished, and player is not moving. Test 3 Player cast spell Results Spell cast as normal Test 4 Player uses aa Results: AA skill works as normal Test 5 Player uses skill (Kick) Results: Skill works as normal Test 6 Player dismounts Results: OOC regeneration stops Test 7 Player dismounts and cast a spell Results: Spell cast as normal Test 8 Player dismounts and uses a aa skill Results: AA works as normal After all of this testing I am pretty confident in this fix. It maintains the rule set in the database so if OOC regeneration is turned off it will have no effect on the game. If anyone has any questions or any more testing they would like me to do feel free to let me know. Sikkun |
You might try the logic that Sorvani posted, since mine was broken.
Does out of combat regen work on live while mounted? If not, you'll probably want to wrap an optional rule around it so the default behaviour is live like and the server op can change it if they want to. Also, if you want to get this committed you should post a diff once you have it all working, since that's easy for someone to apply versus trying to copy/paste code out of a post manually and get it right. |
Test 1 was your logic and Test 2 was Sorvani's logic.
OOC regeneration does work on a mount on live so no rule needed if we are trying to emulate live. |
All times are GMT -4. The time now is 01:47 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.