Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Reply
 
Thread Tools Display Modes
  #1  
Old 05-15-2011, 02:18 AM
Sikkun
Sarnak
 
Join Date: Apr 2011
Posts: 30
Default

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
Reply With Quote
  #2  
Old 05-15-2011, 03:46 PM
Sikkun
Sarnak
 
Join Date: Apr 2011
Posts: 30
Default

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
	if(ppu->y_pos == y_pos || ppu->x_pos == x_pos)
	{
		if(GetHorseId() != 0)
		{
			playeraction = 1;
		}
	}
	else if(ppu->y_pos != y_pos || ppu->x_pos != x_pos)
	{
		if(GetHorseId() != 0)
		{
			playeraction = 0;
		}
	}
I added my code right after the //Break hide if moving without sneak code block so it looks like:

Code:
// Break Hide if moving without sneaking and set rewind timer if moved
	if(ppu->y_pos != y_pos || ppu->x_pos != x_pos){
	    if((hidden || improved_hidden) && !sneaking){
			hidden = false;
			improved_hidden = false;
			if(!invisible) {
				EQApplicationPacket* outapp = new EQApplicationPacket(OP_SpawnAppearance, sizeof(SpawnAppearance_Struct));
				SpawnAppearance_Struct* sa_out = (SpawnAppearance_Struct*)outapp->pBuffer;
				sa_out->spawn_id = GetID();
				sa_out->type = 0x03;
				sa_out->parameter = 0;
				entity_list.QueueClients(this, outapp, true);
				safe_delete(outapp);
			}
		}
		rewind_timer.Start(30000, true);
	}

	//allow player to have OOC regeneration on a mount
	if(ppu->y_pos == y_pos || ppu->x_pos == x_pos)
	{
		if(GetHorseId() != 0)
		{
			playeraction = 1;
		}
	}
	else if(ppu->y_pos != y_pos || ppu->x_pos != x_pos)
	{
		if(GetHorseId() != 0)
		{
			playeraction = 0;
		}
	}
Reply With Quote
  #3  
Old 05-16-2011, 04:20 PM
Sikkun
Sarnak
 
Join Date: Apr 2011
Posts: 30
Default

Make client_process.cpp
client_packet.cpp
Reply With Quote
  #4  
Old 05-16-2011, 05:09 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

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() {

	// This method calculates rest state HP and mana regeneration.
	// The client must have been out of combat for RuleI(Character, RestRegenTimeToActivate) seconds,
	// must be sitting down or mounted, and must not have any detrimental spells affecting them.
	//
	if(!RuleI(Character, RestRegenPercent))
		return;

	RestRegenHP = RestRegenMana = RestRegenEndurance = 0;

        if(AggroCount || !IsSitting() || !GetHorseId())
		return;
Reply With Quote
  #5  
Old 05-17-2011, 10:53 AM
sorvani
Dragon
 
Join Date: May 2010
Posts: 965
Default

Quote:
Originally Posted by lerxst2112 View Post
client_process.cpp
Code:
void Client::CalcRestState() {

	// This method calculates rest state HP and mana regeneration.
	// The client must have been out of combat for RuleI(Character, RestRegenTimeToActivate) seconds,
	// must be sitting down or mounted, and must not have any detrimental spells affecting them.
	//
	if(!RuleI(Character, RestRegenPercent))
		return;

	RestRegenHP = RestRegenMana = RestRegenEndurance = 0;

        if(AggroCount || !IsSitting() || !GetHorseId())
		return;
IsSitting will be FALSE if GetHorseID = TRUE so the ! will cause it to still do what it was doing before, return if you are not sitting. Should it be more like:
Code:
        if(AggroCount || !(IsSitting() || GetHorseId()) )
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 12:38 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3