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

Reply
 
Thread Tools Display Modes
  #1  
Old 09-15-2007, 04:24 AM
sfisque
Hill Giant
 
Join Date: Oct 2006
Posts: 248
Default Warrior Berserk bonus

i noticed that warriors do not recieve the +10 Strength bonus when going into berserk frenzy (when going below 30% health).

i'm not sure if this would be considered a "invisible buff" (one that doesnt have generate a effect icon) or if it would be some form of temporary stat modification.

on Live, going berserk would give the warrior +10 strength, which would disappear when they were healed back to 30% or more health.

== sfisque
Reply With Quote
  #2  
Old 09-15-2007, 05:38 AM
sfisque
Hill Giant
 
Join Date: Oct 2006
Posts: 248
Default

this should fix it:

in bool Client::Process() // client_process.cpp

change

Code:
		if (GetClass() == WARRIOR || GetClass() == BERSERKER) {
			if(!dead && !berserk && this->GetHPRatio() < 30) {
	//			char temp[100];
	//			snprintf(temp, 100, "%s goes into a berserker frenzy!", this->GetName());
	//			entity_list.MessageClose(this, 0, 200, 10, temp);
				entity_list.MessageClose_StringID(this, false, 200, 0, BERSERK_START, GetName());
				this->berserk = true;
			}
			if (berserk && this->GetHPRatio() > 30) {
	//			char temp[100];
	//			snprintf(temp, 100, "%s is no longer berserk.", this->GetName());
	//			entity_list.MessageClose(this, 0, 200, 10, temp);
				entity_list.MessageClose_StringID(this, false, 200, 0, BERSERK_END, GetName());
				this->berserk = false;
			}
		}

to this:

Code:
		if (GetClass() == WARRIOR || GetClass() == BERSERKER) {
			if(!dead && !berserk && this->GetHPRatio() < 30) {
	//			char temp[100];
	//			snprintf(temp, 100, "%s goes into a berserker frenzy!", this->GetName());
	//			entity_list.MessageClose(this, 0, 200, 10, temp);
				entity_list.MessageClose_StringID(this, false, 200, 0, BERSERK_START, GetName());
				this->berserk = true;
				this->CalcSTR();
			}
			if (berserk && this->GetHPRatio() > 30) {
	//			char temp[100];
	//			snprintf(temp, 100, "%s is no longer berserk.", this->GetName());
	//			entity_list.MessageClose(this, 0, 200, 10, temp);
				entity_list.MessageClose_StringID(this, false, 200, 0, BERSERK_END, GetName());
				this->berserk = false;
				this->CalcSTR();
			}
		}
and in

sint16 Client::CalcSTR() // client_mods.cpp

change:

Code:
	sint16 val = m_pp.STR + itembonuses.STR + spellbonuses.STR;
	
	sint16 mod = 2 * (GetAA(aaInnateStrength) + GetAA(aaAdvancedInnateStrength));
	
	if(val>255 && GetLevel() <= 60)
		val = 255;
	STR = val + mod;
to

Code:
	sint16 val = m_pp.STR + itembonuses.STR + spellbonuses.STR;
	
	sint16 mod = 2 * (GetAA(aaInnateStrength) + GetAA(aaAdvancedInnateStrength));
	
	// check for berserking warrior or berserker
	// normally you cant be berserk if not a warrior or berserker but we check
	// for sanity sake
	if( berserk && ( GetClass() == WARRIOR || GetClass() == BERSERKER) )
	{
		mod += 10;
	}
	
	if(val>255 && GetLevel() <= 60)
		val = 255;
	STR = val + mod;
i apologize for not offering diffs, but many of my files are not upto date with CVS and have custom modifications. this is the cleanest way to display what i changed without confusing versions and stuff.

== sfisque
Reply With Quote
  #3  
Old 09-15-2007, 05:51 AM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default

Moved to a better place
Reply With Quote
  #4  
Old 09-15-2007, 06:19 AM
sfisque
Hill Giant
 
Join Date: Oct 2006
Posts: 248
Default

this isnt done, though. i'm investigating on getting the server to update the client. when my warrior goes berserk, his strength isnt updated in the client. so, more code snippets OTW when i find out how to do that.

== sfisque
Reply With Quote
  #5  
Old 09-15-2007, 07:42 PM
froglok23's Avatar
froglok23
Hill Giant
 
Join Date: May 2005
Location: Australia
Posts: 113
Default

I know this really lies with the dev team and is more of a general commit.

In concern to magic numbers / strings embedded in the code. using the example below:

Quote:
if (berserk && this->GetHPRatio() > 30) {
This 30, should be a variable in a configuration table (possible variables or some sort). This would make it easier to adjust for custom servers and if EverQuest live ever change this value, it’s not a code recompile but just a db value change.

Defiantly not a dig at sfisque at all.! (so don’t take it at that!) Its great work sfisque has helped and developed the code for this.

Just my 2cp

- froglok
Reply With Quote
  #6  
Old 09-15-2007, 08:07 PM
froglok23's Avatar
froglok23
Hill Giant
 
Join Date: May 2005
Location: Australia
Posts: 113
Default

I did some gooling, because of this thread and of course my own interests being a software dev by carer.

Its a lot of content, but this article on Wikipedia can explain things like using "magic numbers and strings" a hell of a lot better than i can, plus provides explains and documentation to fit.

Really good read if you’re looking at getting into Software Development either has a hobbyist and/or professional

URL: http://en.wikipedia.org/wiki/Anti-pattern

URL About Magic Numbers: http://en.wikipedia.org/wiki/Magic_n...rical_Constant

- froglok

Last edited by froglok23; 09-16-2007 at 04:12 AM.. Reason: GRR my paste is broken
Reply With Quote
  #7  
Old 09-16-2007, 04:29 AM
sfisque
Hill Giant
 
Join Date: Oct 2006
Posts: 248
Default

yah, i should have used a constant for that. as for using a configurable parameter, maybe. its always been 30% on Live since day zero, so i dont foresee it changing.

also, in my defense, the if line was cut and pasted from elsewhere in the code base :P

now, back to figuring out how to update the client so they see the modified strength value.

== sfisque

ps: this made me chuckle

Quote:
Really good read if you’re looking at getting into Software Development either has a hobbyist and/or professional
i've been doing S/W dev for about 14 years now. what i really need is a good C++ IDE that does code completion and edit time code inspection, similar to Intellij IDEA, that doesnt suck like Eclipse.

Last edited by sfisque; 09-16-2007 at 12:33 PM..
Reply With Quote
  #8  
Old 09-16-2007, 11:38 AM
froglok23's Avatar
froglok23
Hill Giant
 
Join Date: May 2005
Location: Australia
Posts: 113
Default

Hmm an C++ IDE which doesnt suck? hmm That would be good!

- froglok
Reply With Quote
  #9  
Old 10-17-2007, 09:29 AM
WildcardX
Developer
 
Join Date: Apr 2003
Posts: 589
Default

I'll examine this code for possible integration into the server code sometime after the weekend.
__________________
Read my developer notes at my blog.

Quote:
If it's not on IRC, it ain't l33t!
Reply With Quote
  #10  
Old 10-18-2007, 06:55 PM
WildcardX
Developer
 
Join Date: Apr 2003
Posts: 589
Default

sfisque,

Have you added any more code to complete this enhancement?

Quote:
this isnt done, though. i'm investigating on getting the server to update the client. when my warrior goes berserk, his strength isnt updated in the client. so, more code snippets OTW when i find out how to do that.
__________________
Read my developer notes at my blog.

Quote:
If it's not on IRC, it ain't l33t!
Reply With Quote
Reply


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 11:09 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3