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

Reply
 
Thread Tools Display Modes
  #1  
Old 10-12-2008, 09:39 PM
seveianrex
Sarnak
 
Join Date: Sep 2008
Location: asdf
Posts: 60
Default Critical Affliction AA

{spell_effects.cpp}

~ line 2671, in Mob:oBuffTic, there should be this set of code:

Code:
			//TODO: account for AAs and stuff

			//dont know what the signon this should be... - makes sense
			if (caster && caster->IsClient() &&
				IsDetrimentalSpell(spell_id) &&
				effect_value < 0) {

				sint32 modifier = 100;
				modifier += caster->CastToClient()->GetFocusEffect(focusImprovedDamage, spell_id);

				if(caster){
					if(caster->IsClient() && !caster->CastToClient()->GetFeigned()){
						AddToHateList(caster, -effect_value);
					}
					else if(!caster->IsClient())
						AddToHateList(caster, -effect_value);
				}

				effect_value = effect_value * modifier / 100;
Insert directly underneath the last line:

Code:
// 2008-10-12 seveian
				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)
					{
						effect_value = (effect_value * 2);
					}
				}
Reply With Quote
  #2  
Old 10-12-2008, 10:58 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

Would make this section a little messy, might be a good candidate for it's own function.
Reply With Quote
  #3  
Old 10-12-2008, 11:02 PM
seveianrex
Sarnak
 
Join Date: Sep 2008
Location: asdf
Posts: 60
Default

Okay. I'll do up a TryCriticalDOT function then. Stand by.
Reply With Quote
  #4  
Old 10-12-2008, 11:17 PM
seveianrex
Sarnak
 
Join Date: Sep 2008
Location: asdf
Posts: 60
Default Revised Version

{mob.h}
line 591, currently reads:
Code:
void	WakeTheDead(int16 spell_id, Mob *target, uint32 duration);
add directly below:
Code:
bool	TryCriticalDOT(int16 spell_id);
{spell_effects.cpp}
@~ line 2671, there should be the following code:
Code:
			//TODO: account for AAs and stuff

			//dont know what the signon this should be... - makes sense
			if (caster && caster->IsClient() &&
				IsDetrimentalSpell(spell_id) &&
				effect_value < 0) {

				sint32 modifier = 100;
				modifier += caster->CastToClient()->GetFocusEffect(focusImprovedDamage, spell_id);

				if(caster){
					if(caster->IsClient() && !caster->CastToClient()->GetFeigned()){
						AddToHateList(caster, -effect_value);
					}
					else if(!caster->IsClient())
						AddToHateList(caster, -effect_value);
				}

				effect_value = effect_value * modifier / 100;
add directly beneath it:
Code:
				// 2008-10-12 seveian
				if (TryCriticalDOT(spell_id))
				{
					effect_value = (effect_value * 2);
				}


can be placed anywhere in the same file:
Code:
// 2008-10-12 seveian
bool Mob::TryCriticalDOT(int16 spell_id)
{
	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)
		{
			return true;
		}
	}

	return false;
}
Reply With Quote
  #5  
Old 10-12-2008, 11:20 PM
paaco
Discordant
 
Join Date: Jan 2005
Posts: 320
Default

Man you work quick, and that's definitely a nice addition. Critical Affliction is a pretty huge skill for Dot casters in EQ. Great job man, hope to see more stuff like this.
Reply With Quote
  #6  
Old 10-22-2008, 03:05 PM
janusd
Sarnak
 
Join Date: Jan 2008
Posts: 47
Default

Getting reports from PEQ that this isn't working. Personally, I have yet to see a critical DoT happen.
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 08:55 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