PDA

View Full Version : Hate modifiers patch


blmille2
07-15-2010, 01:45 PM
Hello, all--it's been a while since my last code submission, so I'm sorry about that.

Someone asked me to fix the hate modifiers so that they work--for worn effects, spells (i.e. Enchanter Horrifying Visage, etc.), and AAs (if there be any hate modifiers currently implemented).

Here's a really simple patch that I think fixes the issue:

Index: zone/attack.cpp
================================================== =================
--- zone/attack.cpp (revision 1603)
+++ zone/attack.cpp (working copy)
@@ -1253,6 +1253,7 @@
other->MeleeMitigation(this, damage, min_hit);
ApplyMeleeDamageBonus(skillinuse, damage);
TryCriticalHit(other, skillinuse, damage);
+ hate += damage * 100 *(this->spellbonuses.hatemod + this->itembonuses.hatemod + this->aabonuses.hatemod)/100;
mlog(COMBAT__DAMAGE, "Final damage after all reductions: %d", damage);
}

blmille2
07-15-2010, 03:13 PM
Wow, sorry about that -- that'd would produce an insane amount of hate.

Here's the update:
Index: zone/attack.cpp
================================================== =================
--- zone/attack.cpp (revision 1603)
+++ zone/attack.cpp (working copy)
@@ -1253,6 +1253,7 @@
other->MeleeMitigation(this, damage, min_hit);
ApplyMeleeDamageBonus(skillinuse, damage);
TryCriticalHit(other, skillinuse, damage);
+ hate += damage * (this->spellbonuses.hatemod + this->itembonuses.hatemod + this->aabonuses.hatemod)/100;
mlog(COMBAT__DAMAGE, "Final damage after all reductions: %d", damage);
}

trevius
07-16-2010, 12:22 AM
Are hate modifiers not working without this patch? I thought they were already functional.

blmille2
07-16-2010, 08:07 PM
I think they are getting calculated, but I followed the hit code and found no reference to it. This should allow warrior epic 2.0 and enchanter hate buffs to add hate.
Greenmachine noticed that the warrior epic 2.0 wasn't working, which prompted investigation. Note this is for effects and not procs.

Thanks!

ghostriderdoom
07-16-2010, 08:42 PM
I think they are getting calculated, but I followed the hit code and found no reference to it. This should allow warrior epic 2.0 and enchanter hate buffs to add hate.
Greenmachine noticed that the warrior epic 2.0 wasn't working, which prompted investigation. Note this is for effects and not procs.

Thanks!

Epic 1.5 to be clear actually. And the focus effect it has just never felt like it did anything. I have had the warrior epic 1.5 for a year now. I didn't notice any change in aggro from getting the item.

Caryatis
07-16-2010, 09:05 PM
Seems like this wouldn't accurately reflect agro from live as there is no additional agro for crits, however with the code structured like that, on crits your hate would be doubled. Also Im pretty sure that agro on live is based on weapon dmg, not actual dmg, which is why war weapons from recent expansions have less dmg/dly with relatively high elemental dmg tacked on(The Keen Edge of Discord (http://lucy.allakhazam.com/item.html?id=106856) vs Skulltutor (http://lucy.allakhazam.com/item.html?id=106859)). This keeps the war agro high but their dps in check, however that is not entirely relevant to your change and seems to be in the code already.

That said, it should be a relatively easy effect to test(feel doesnt really cut it, especially with 15%), use an item like Raex's Chestplate of Destruction (http://lucy.allakhazam.com/item.html?id=47642) and check the hatelist entries with and without it.

blmille2
07-19-2010, 12:26 PM
I'm sorry, I didn't realize that crits didn't count toward additional hate from spells, effects, etc.

Please move the effective line up one, right above crits.

Thanks!

EqTitan
07-19-2010, 12:44 PM
Seems like this wouldn't accurately reflect agro from live as there is no additional agro for crits, however with the code structured like that, on crits your hate would be doubled. Also Im pretty sure that agro on live is based on weapon dmg, not actual dmg, which is why war weapons from recent expansions have less dmg/dly with relatively high elemental dmg tacked on(The Keen Edge of Discord (http://lucy.allakhazam.com/item.html?id=106856) vs Skulltutor (http://lucy.allakhazam.com/item.html?id=106859)). This keeps the war agro high but their dps in check, however that is not entirely relevant to your change and seems to be in the code already.

That said, it should be a relatively easy effect to test(feel doesnt really cut it, especially with 15%), use an item like Raex's Chestplate of Destruction (http://lucy.allakhazam.com/item.html?id=47642) and check the hatelist entries with and without it.

If the code is in then its in, thats the real question, is there code in for this exact kind of spell effect and how can we test besides taking a weopon or item with the multiplier on it completely off as it will still be a FEELING . Because as you stated its only 15%

trevius
07-19-2010, 12:52 PM
If the code is in then its in, thats the real question, is there code in for this exact kind of spell effect and how can we test besides taking a weopon or item with the multiplier on it completely off as it will still be a FEELING . Because as you stated its only 15%

check the hatelist entries with and without it.

Just make a script to check hate list entries.

blmille2
07-19-2010, 01:16 PM
Okay, so I assume you mean a quest script for the EVENT_COMBAT event?
Also, I'm having a hard time finding the variable that corresponds to the hate for a character.
Thanks!

Caryatis
07-19-2010, 04:41 PM
You could script it, or could just use the #hatelist command. I would make a level 1 mob, attack it, if you don't get a full dmg quad, repop until you do, then check its hatelist. Then make a level 255 mob with high ac, attack it, if you dont get a quad of misses, repop until you do. The hate values for a full dmg quad and quad of misses should be the same. Then do the same thing with the hate mod item.

blmille2
07-19-2010, 05:35 PM
Okay, so it sounds like you get extra hate even if you miss them, right?

Can you please post the formula for calculating the hate mod the way Live does it?

Thanks!

Caryatis
07-19-2010, 08:42 PM
Alright so I did the test myself since it seems you didnt do it. Turns out agro seems to be fine.

First off, agro is generated per swing, not based on damage...

http://i32.tinypic.com/e899jr.jpg

http://i31.tinypic.com/30mnupz.jpg

Notice 5 swings, different damage, same hate value.

Secondly, agro mods like Echo of Anger (http://lucy.allakhazam.com/spell.html?id=3922&source=Live), do indeed work:

http://i30.tinypic.com/vg3a04.jpg

Notice 5 swings again, this time hate is 100. 89 * 15% is 102, but its close enough that I would say its working.

KLS
07-20-2010, 12:35 AM
Part of that 89 is a small amount of static hate you get for aggroing a mob and isn't affected by any mods.