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)

Reply
 
Thread Tools Display Modes
  #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
  #2  
Old 08-24-2006, 01:05 PM
WildcardX
Developer
 
Join Date: Apr 2003
Posts: 589
Default

I'm pretty sure a missed attack doesnt cause aggro in EQ live.

I remember swinging my sword at a bat as a young ranger and not getting any aggro until I connected with a hit.
Reply With Quote
  #3  
Old 08-25-2006, 01:50 AM
dfenster
Fire Beetle
 
Join Date: Aug 2006
Posts: 1
Default

I played a magician for five years, and knew the mechanics of such in depth.

Spells definitely did cause a large amount of aggro even if they resisted.
Pets definitely did gain aggro for misses.

As for players with melee, I couldn't tell you for sure. I do remember that scenario with the bats happening to me, though. Regardless, I could tell you there would be problems with aggro on raids if players did not get aggro for their misses. Can you imagine what trying to hold aggro on the Avatar of War would be like if all your misses didn't count for anything? Every nuker would die pretty fast.

Although that bat scenario did happen to me, I do believe that it might have been a fluke, or the aggro mechanics might have changed since we were newbies.
Reply With Quote
  #4  
Old 09-07-2006, 08:09 AM
EmanonCow
Sarnak
 
Join Date: Aug 2006
Posts: 35
Default

Aggro on Live:

Weapons:
SwingAggro:
On a 20/50 weapon with 15 damage bonus, every swing (hit OR miss) causes 35 points of aggro. 20 (weapon damage) + 15 (weapon damage bonus)

On a 6/18 weapon with 15 damage bonus, every swing causes 21 points of aggro.

Hitting, critting, and missing don't matter. The attempt to hit causes X aggro.

Procs:
For the most part, they work like spells. As an exception, procs of spells your class cannot cast cause less aggro if they are status effects.

A status effect proc (snare, stun, slow, etc) causes about 400 points of aggro (above and beyond any DD component).

Spells:
Nukes:
Crits and resists cause the same aggro as a hit. +% damage focus effects do not change the aggro generated by a nuke.

A nuke that lists at 500 damage does 500 hate.

DoTs:
I don't know how DoT aggro works.

Slows/Stuns/Snare/other status:
These do aggro that grows with the HP and Level of the mob. I don't know the formula.

Heals:
Heals generate aggro on every NPC who has the target on their aggro list. Small heals generate 1/2 a point of aggro for every point healed. There is a cap how much aggro a heal can generate.

HoTs:
These generate no more hate than a Buff.

Buffs:
Casting a buff on someone gives you 1 hate on every NPC who hates the person you buffed.

Kick/bash:
I believe these work just like melee attacks. Bash does "weapon damage" based off shield AC, and caps out at 25 "weapon damage". Kick I understand less.

HTH.
Reply With Quote
  #5  
Old 09-07-2006, 09:13 AM
Zuesrooster
Fire Beetle
 
Join Date: Mar 2006
Location: NYC
Posts: 20
Default

Everything you said sounds right to me. The only thing I still have questions on is I believe aggro might also be modified on what class you are, do you have any insight or opinion on this? I will try to update the way aggro works to the way you mentioned sometime this or next week, and I guess post the changes.
Reply With Quote
  #6  
Old 09-09-2006, 06:51 PM
EmanonCow
Sarnak
 
Join Date: Aug 2006
Posts: 35
Default

Bards are crazy. (their spells act wierd)

Casting status-modifying spells that are not "on your list" generates less aggro than casting status-modifying spells that are "on your list". (On L ~70 mobs, a status not on your list effect generates ~400 hate). This mainly is about procs, as mentioned above.

Other than that, I'm not aware of any parsed difference between aggro generation of different classes.

There may be something wierd with "initial aggro" and some effects.

Note there are two columns in the spells_en.txt that change the hate a spell produces. One overrides the amount of hate produced by the spell (and sets it to a fixed value), the other adds to the hate produced by the spell (and is only really used by one effect: static blow).

In some cases, the "slot" the effect is in seems to change how much aggro it produces. A rune effect in slot 1 generates lots of hate -- a rune effect in slot 2 or later generates "I just cast a buff" hate.

Similar wierdness seems to occur with some druid AC/ATK/resist debuffs. Some generate "status effect" level hate, others generate "dispell" level hate.
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 07:44 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