PDA

View Full Version : Pets and AC


Armm
03-21-2013, 10:49 AM
Do pets actually use the AC value in database?

I ask this because i had tested a level 60 pet who at first had roughly 1300 ac against a flame lord (level 64) and in parsing i noticed that over 75% of hits were max hit.

I then doubled the AC to 3000 and ran the same test with exactly the same results leading me to believe that AC either it is not working for pets, or i am misunderstanding something.

Do pets use the Mob::MeleeMitigation function in attack.cpp or is there someplace else i am missing? I was looking at this chunk of it..

else if(IsNPC())
{
armor = spellbonuses.AC + itembonuses.AC + (CastToNPC()->GetRawAC() / RuleR(Combat, NPCACFactor)) + 1;
}

So it seems to pull raw ac value from database then divide by 2.25(rule value, no idea why they divide this).

Anyhow, anyone have a clue what i am missing here or someplace i can look to get pet AC working? Thanks!

Secrets
03-21-2013, 11:02 AM
Do pets actually use the AC value in database?

I ask this because i had tested a level 60 pet who at first had roughly 1300 ac against a flame lord (level 64) and in parsing i noticed that over 75% of hits were max hit.

I then doubled the AC to 3000 and ran the same test with exactly the same results leading me to believe that AC either it is not working for pets, or i am misunderstanding something.

Do pets use the Mob::MeleeMitigation function in attack.cpp or is there someplace else i am missing? I was looking at this chunk of it..

else if(IsNPC())
{
armor = spellbonuses.AC + itembonuses.AC + (CastToNPC()->GetRawAC() / RuleR(Combat, NPCACFactor)) + 1;
}

So it seems to pull raw ac value from database then divide by 2.25(rule value, no idea why they divide this).

Anyhow, anyone have a clue what i am missing here or someplace i can look to get pet AC working? Thanks!

Try adding && !IsPet to that portion of code, would probably solve your issue. I'm fairly certain the issue lies in the fact that it's an NPC fighting another NPC and thus calcs get out of whack.

Armm
03-21-2013, 12:07 PM
I added code in attack.cpp

else if(IsNPC()&& !IsPet())
{
armor = spellbonuses.AC + itembonuses.AC + (CastToNPC()->GetRawAC() / RuleR(Combat, NPCACFactor)) + 1;
}

This had no effect that i can tell. I set pet ac to 15000, and flame lord hit him 34 times for max hit, rest of hits are 1-3 each.

The total code block is...

if(RuleB(Combat, UseIntervalAC))
{
float softcap = 0.0;
float mitigation_rating = 0.0;
float attack_rating = 0.0;
int shield_ac = 0;
int armor = 0;
float weight = 0.0;
if(IsClient())
{
armor = CastToClient()->GetRawACNoShield(shield_ac);
weight = (CastToClient()->CalcCurrentWeight() / 10.0);
}
else if(IsNPC()&& !IsPet())
{
armor = spellbonuses.AC + itembonuses.AC + (CastToNPC()->GetRawAC() / RuleR(Combat, NPCACFactor)) + 1;
}

if(GetClass() == WIZARD || GetClass() == MAGICIAN || GetClass() == NECROMANCER || GetClass() == ENCHANTER)
{
softcap = RuleI(Combat, ClothACSoftcap);
}
else if(GetClass() == MONK && weight <= 15.0)
{
softcap = RuleI(Combat, MonkACSoftcap);
}
else if(GetClass() == DRUID || GetClass() == BEASTLORD || GetClass() == MONK)
{
softcap = RuleI(Combat, LeatherACSoftcap);
}
else if(GetClass() == SHAMAN || GetClass() == ROGUE || GetClass() == BERSERKER || GetClass() == RANGER)
{
softcap = RuleI(Combat, ChainACSoftcap);
}
else
{
softcap = RuleI(Combat, PlateACSoftcap);
}


Which to me suggests that if you are client it works fine. If you are a pet it doesnt even get your AC with current code because of the !pet??. It also seems like if applies softcaps and all that to npc ac??!? On live they just used mob ac value, there was no softcaps for mobs, never was as far as i can recall.

Thanks for your help, if you have any other ideas im open to them, ill keep farting around with it.

bad_captain
03-27-2013, 12:26 AM
I did some testing, and will keep going, but I decided to put the formula into an excel spreadsheet, using a Jord Tyv as my target. I did 300 random rolls for mitigation & attack and found that doubling the pet's AC led to an difference in average hits by 40. Up that to 10x the AC and there was a difference of about 100 in average hits.

How long did you perform the test and were there any other mitigating factors that could have affected the outcome? Buffs?

With my primary being a magician, I do believe pet mitigation needs tweaked (I think they do get hit for max too often), but I think the formula does actually work in taking pet AC into consideration.

I'm testing removing the NPCACFactor from the calculations for pets and see what that does. The softcap stuff definitely affects the results and I will try testing just using the pet's raw AC to see how that affects the results (I can test it in my spreadsheet, as I just enter the adjusted armor rating, so I can make it whatever I want).

bad_captain
04-02-2013, 07:39 PM
I removed the NPCACFactor from being used for pets, and it definitely comes closer to where it should be. DPS against pets still parsed higher than on live, but was better. It also 'felt' closer, for what that's worth.

Armm
04-03-2013, 08:01 AM
I should have declared i write my own mititgation code. I have had it so long i dont think about it much. It doesn't differ from stock in figuring out the armor thou.

That being said the minute i excluded pets from NPCacfactor i had alot better results also. Part of the problem with pets tanking at higher levels is prism skin doesnt work, but ill likely work around that by including pet weapons that proc almost same effect.

I also recently rewrote most of the mitigation code(again) to scale with levels, produce better bell curves, have diminishing returns instead of caps and have more logging.

Pets seem much better after that. You are remarkably close on merc AC on most levels btw. Thanks for your time and your suggestions, hope i didnt lead you on a wild goose chase.

ChaosSlayerZ
04-03-2013, 09:14 AM
SOE really didn't make this easy for us ;)
They should have used identical AC/combat formulas for EVERYTHING,
and then balance it out with actual stats on mobs/pets to make them stronger/weaker.