Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-24-2006, 12:40 PM
Zuesrooster
Fire Beetle
 
Join Date: Mar 2006
Location: NYC
Posts: 20
Default Attack and Spell Aggro

As mentioned in the Wiki, a possible bug is that resisted spells don't cause aggro. I also noticed that missed attacks don't cause aggro. If I remeber correctly it use to generate aggro in eqlive. Also I noticed AvoidDamage wasn't in the if clause so i belive it was ignoring block, dodges, and other avoids. Here are the changes I made:

In attack.cpp starting at line 789 added:

Code:
		//check to see if we hit and a
		if(!other->CheckHitChance(this, attack_skill, Hand, skillinuse) || other->AvoidDamage(this, damage)) {
			mlog(COMBAT__ATTACKS, "Attack missed. Damage set to 0.");
			other->AddToHateList(this, damage, damage);
			damage = 0;
		}
attack.cpp line 896 replaced:

Code:
	//check to see if we hit..
		if(!other->CheckHitChance(this, attack_skill, Hand, skillinuse)) {
			mlog(COMBAT__ATTACKS, "Attack missed. Damage set to 0.");
			damage = 0;
		} else {	//we hit, try to avoid it
			other->AvoidDamage(this, damage);
			
			mlog(COMBAT__DAMAGE, "Final damage after all reductions: %d", damage);
			
			//once we hit, we will give the correct crit message
			if(landed_crit) {
				if(berserk)
					entity_list.MessageClose(this, false, 200, 10, "%s lands a crippling blow!(%d)", name,damage);
				else
					entity_list.MessageClose(this, false, 200, 10, "%s scores a critical hit!(%d)", name,damage);
			}
		}
		
		if (bRiposte && damage == -3) {	//cannot riposte a riposte
			mlog(COMBAT__ATTACKS, "Attack canceled. Cannot riposte a riposte");
			return false;
    	}
with:


Code:
	if (bRiposte && damage == -3) {	//cannot riposte a riposte
			mlog(COMBAT__ATTACKS, "Attack canceled. Cannot riposte a riposte");
			return false;
    	}
		if(damage > 0){
			mlog(COMBAT__DAMAGE, "Final damage after all reductions: %d", damage);
			
			//once we hit, we will give the correct crit message
			if(landed_crit) {
				if(berserk)
					entity_list.MessageClose(this, false, 200, 10, "%s lands a crippling blow!(%d)", name,damage);
				else
					entity_list.MessageClose(this, false, 200, 10, "%s scores a critical hit!(%d)", name,damage);
			}
		}
Attack.cpp line 1498 changed:

Code:
if(!other->CheckHitChance(this, attack_skill, Hand, skillinuse)) {
				damage = 0;	//miss
			} else {	//hit, check for damage avoidance
				other->AvoidDamage(this, damage);
with:

Code:
if(!other->CheckHitChance(this, attack_skill, Hand, skillinuse) || other->AvoidDamage(this, damage)) {
				other->AddToHateList(this, damage, damage);
				damage = 0;	//miss
In attack.cpp moved line 1750 to line 1739. Pets should be added to hate list first if they attack the NPC first. Again this is how I remeber it in Live but it might have changed since I quite a couple of years ago.

Finally for spells all I did was move lines 2289 - 2313 I moved it up to start on line 2253 before the resistance check.

Code:
if (spelltar->IsAIControlled() && spells[spell_id].goodEffect == 0
		//IsDetrimentalSpell(spell_id)
		) {
		int16 aggro_amount = CheckAggroAmount(spell_id);//*spelltar->CastToNPC()->AggroModifier();
		if (IsClient()) {
			switch (GetAA(aaSpellCastingSubtlety))
			{
			case 1:
				aggro_amount = aggro_amount * 95 / 100;
				break;
			case 2:
				aggro_amount = aggro_amount * 90 / 100;
				break;
			case 3:
				aggro_amount = aggro_amount * 80 / 100;
				break;
			}
		}
		aggro_amount /= 2;
		mlog(SPELLS__CASTING, "Spell %d cast on %s generated %d hate", spell_id, spelltar->GetName(), aggro_amount);
		spelltar->AddToHateList(this, aggro_amount);
	}
	else if (IsBeneficialSpell(spell_id))
		entity_list.AddHealAggro(spelltar, this, CheckHealAggroAmount(spell_id));
and commented out
Code:
		if(spelltar->IsAIControlled())
					spelltar->AddToHateList(this, 1);
in the resistance check. I tested this out with a couple different charectors at different levels and its seams a little more like I rememer. One think I also noticed but haven't quite figured out how it works is some spells have a value (HateAmount) according to Lucy. Those spell I remeber always caused tons of aggro in EQLIVe, but in eqemu cause the same amount of aggro as thier counter parts (ie Tash). I believe the hate amount plays apart on the hate generated but not sure ecatly how. Not sure if all the changes I made are moving aggro more towards EQLive but it feels like it when playing.
Reply With Quote
 

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 09:22 PM.


 

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