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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
Old 10-22-2008, 07:33 PM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

Actually, after taking a 10th look at the code, I think I know what went wrong:
Code:
void Mob::TryDotCritical(int16 spell_id, Mob *caster, int &damage)
{
	if(!caster)
		return;

	float critChance = 0.00f;

	switch(GetAA(aaCriticalAffliction))
	{
		case 1:
			critChance += 0.03f;
			break;
		case 2:
			critChance += 0.06f;
			break;
		case 3:
			critChance += 0.10f;
			break;
		default:
			break;
	}

	switch (GetAA(aaImprovedCriticalAffliction))
	{
		case 1:
			critChance += 0.03f;
			break;
		case 2:
			critChance += 0.06f;
			break;
		case 3:
			critChance += 0.10f;
			break;
		default:
			break;
	}

	// since DOTs are the Necromancer forte, give an innate bonus
	// however, no chance to crit unless they've trained atleast one level in the AA first
	if (GetClass() == NECROMANCER && critChance > 0.0f){
		critChance += 0.05f;
	}

	if (critChance > 0.0f){
		if (MakeRandomFloat(0, 1) <= critChance)
		{
			damage *= 2;
		}
	}
}
We're basically looking at this, which is going the be the Mob affected by the spell, not the caster. Should just have to add caster-> to the beginnings of those, and they should look at the right Mob.

I just compiled & tested, and DoTs now crit.
__________________
GM-Impossible of 'A work in progress'
A non-legit PEQ DB server
How to create your own non-legit server

My Contributions to the Wiki
Reply With Quote
 


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:57 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