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

Reply
 
Thread Tools Display Modes
  #1  
Old 09-16-2008, 08:59 PM
renoofturks1
Sarnak
 
Join Date: Jan 2008
Posts: 60
Default

Aye, I tried to define them as they became needed. I see now, this wouldn't work. I'll have a revised tested version shortly here.
Reply With Quote
  #2  
Old 09-16-2008, 10:20 PM
renoofturks1
Sarnak
 
Join Date: Jan 2008
Posts: 60
Default

Ok, I have it tested and working, but I had to comment out part of the existing code, and I am not sure what it does.... Someone care to fill me in?

Code:
if (Weapon->ItemClass == ItemClassCommon)
What is ItemClassCommon? Barring that not being important...the below code is tested to work, and add the proper damage bonus(within two, rounding) after all AC calculations as it should. Now, if that little piece of code I commented out is important, I'll go back to the drawing board LOL

Code:
int Mob::GetWeaponDamageBonus(const Item_Struct* Weapon)
{
	// Kaiyodo - Calculate the damage bonus for a weapon on the main hand
	if (GetLevel() < 28)
		return(0);
	
	// Check we're on of the classes that gets a damage bonus
	if (!IsWarriorClass())
		return 0;
	
	int BasicBonus = ((GetLevel() - 25) / 3) + 1;
	
	if(!Weapon)
		return(BasicBonus);
	
	// If we have no weapon, or only a single handed weapon, just return the default
	// damage bonus of (Level - 25) / 3
	//if (Weapon->ItemClass == ItemClassCommon)
		//return BasicBonus;
	
	if ((Weapon->ItemType == ItemType1HS) || (Weapon->ItemType == ItemTypePierce) || (Weapon->ItemType == ItemType1HB))
		return BasicBonus;

		if (Weapon->Delay <= 27)
			return (BasicBonus + 1);
		if (Weapon->Delay <= 39)
			return (BasicBonus + ((GetLevel()-27) / 4));
		if (Weapon->Delay <= 41)
			return (BasicBonus + ((GetLevel()-27) / 4) + 1);
                //reno-calc 2hand dmg bonus
		if (Weapon->Delay >= 42)
		{
			int levelint = 0;
			int delayint = 0;
			if (GetLevel() > 54)
				levelint++;
			if (GetLevel() > 56)
				levelint++;
			if (GetLevel() > 56)
				levelint++;
			if (GetLevel() > 58)
				levelint++;
			if (GetLevel() > 59)
				levelint++;
			if (GetLevel() > 66)
				levelint++;
			if (GetLevel() > 71)
				levelint++;
			if (Weapon->Delay > 42)
				delayint++;
			if (Weapon->Delay > 44)
				delayint++;
			return (((Weapon->Delay-37)/3) + ((GetLevel()-25)/5) + ((Weapon->Delay * ((GetLevel()-50) + levelint))/40) + delayint + BasicBonus);
			}
}
Reply With Quote
  #3  
Old 09-16-2008, 10:27 PM
renoofturks1
Sarnak
 
Join Date: Jan 2008
Posts: 60
Default

Note: The formula for delay's UNDER 42 and ABOVE 28 is off. I will work on this one next
Reply With Quote
  #4  
Old 09-16-2008, 11:13 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

in eq_constants.h

Code:
/*
** Item types
**
*/
enum ItemClass
{
	ItemClassCommon		= 0,
	ItemClassContainer	= 1,
	ItemClassBook		= 2
};
So, ItemClassCommon is just checking to verify that the item is a normal item. I think your 1hs check should probably work fine to replace it. But, if you wanted to keep it in there just be be sure (since it was there before), it probably wouldn't hurt. I think you could just do something like this maybe:

Code:
	if ((Weapon->ItemClass == ItemClassCommon) && ((Weapon->ItemType == ItemType1HS) || (Weapon->ItemType == ItemTypePierce) || (Weapon->ItemType == ItemType1HB)))
		return BasicBonus;
That way you are checking for both things. I am no coder, but it makes sense that this should work to me.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 09-17-2008 at 07:15 AM..
Reply With Quote
  #5  
Old 09-17-2008, 09:11 AM
renoofturks1
Sarnak
 
Join Date: Jan 2008
Posts: 60
Default

The problem was with the fact that, no matter what weapon I was wielding.

Code:
if (Weapon->ItemClass == ItemClassCommon)
      return BasicBonus;
Was always returning true, and never allowing anything but BasicBonus to be returned. Adding it as you stated should solve that problem. Thank you.
Reply With Quote
  #6  
Old 09-17-2008, 06:31 PM
renoofturks1
Sarnak
 
Join Date: Jan 2008
Posts: 60
Default

This is a working tested version. It isn't perfect yet, but, this works for level 60+ accurately, and becomes less and less accurate as level decreases. Weapon's under 42 delay is still off, but closer. I'll work on it some more but if anyone cares to try it, or use it.

zone/attack.cpp - Replacing lines 1935 through 1971
Code:
int Mob::GetWeaponDamageBonus(const Item_Struct* Weapon)
{
	// Kaiyodo - Calculate the damage bonus for a weapon on the main hand
	if (GetLevel() < 28)
		return(0);
	
	// Check we're on of the classes that gets a damage bonus
	if (!IsWarriorClass())
		return 0;
	
	int BasicBonus = ((GetLevel() - 25) / 3);
	
	if(!Weapon)
		return(BasicBonus);
	
	// If we have no weapon, or only a single handed weapon, just return the default
	// damage bonus of (Level - 25) / 3
	//if (Weapon->ItemClass == ItemClassCommon)
		//return BasicBonus;
	
	if ((Weapon->ItemType == ItemType1HS) || (Weapon->ItemType == ItemTypePierce) || (Weapon->ItemType == ItemType1HB))
		return BasicBonus;

		if (Weapon->Delay <= 27)
			return (BasicBonus + 1);
		if (Weapon->Delay <= 39)
			return (BasicBonus + ((GetLevel()-25) / 5));
		if (Weapon->Delay <= 41)
			return (BasicBonus + ((GetLevel()-25) / 5) + 1);
		if (Weapon->Delay >= 42)
		{
			int levelint = 0;
			int delayint = 0;
			if (GetLevel() > 54)
				levelint++;
			if (GetLevel() > 56)
				levelint++;
			if (GetLevel() > 56)
				levelint++;
			if (GetLevel() > 58)
				levelint++;
			if (GetLevel() > 59)
				levelint++;
			if (GetLevel() > 66)
				levelint++;
			if (GetLevel() > 71)
				levelint++;
			if (Weapon->Delay > 42)
				delayint++;
			if (Weapon->Delay > 44)
				delayint++;
			return (((Weapon->Delay-37)/3) + ((GetLevel()-25)/5) + ((Weapon->Delay * ((GetLevel()-50) + levelint))/40) + BasicBonus);
			}
}
Reply With Quote
  #7  
Old 09-21-2008, 06:49 PM
renoofturks1
Sarnak
 
Join Date: Jan 2008
Posts: 60
Default

Final version coming soon.....
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 10:45 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