Hook 5 : Tweak AC calculation
Index: client_mods.cpp
================================================== =================
RCS file: /cvsroot/eqemulator/EQEmuCVS/Source/zone/client_mods.cpp,v
retrieving revision 1.6.4.19
diff -u -b -B -r1.6.4.19 client_mods.cpp
--- client_mods.cpp 21 Feb 2007 16:04:20 -0000 1.6.4.19
+++ client_mods.cpp 2 Mar 2008 09:11:32 -0000
@@ -28,6 +28,7 @@
#include "../common/moremath.h"
#include "../common/guilds.h"
#include "../common/logsys.h"
+#include "../common/rulesys.h"
#include "StringIDs.h"
#include "NpcAI.h"
@@ -714,7 +715,10 @@
// AC from spells are not included (cant even cast spells yet..)
sint16 Client::CalcAC() {
- // new formula
+if(RuleH(Character, CalcAC) != NULL)
+ AC = ((Hook_Character_CalcAC) RuleH(Character, CalcAC))(GetLevel(), GetSkill(DEFENSE), itembonuses.AC, spellbonuses.AC);
+else
+{ // new formula
int avoidance = 0;
avoidance = (acmod() + ((GetSkill(DEFENSE)*16)/9));
if (avoidance < 0)
@@ -749,8 +753,8 @@
//spell AC bonuses are added directly to natural total
displayed += spellbonuses.AC;
-
AC = displayed;
+}
return(AC);
}
|