View Single Post
  #6  
Old 07-24-2015, 03:58 PM
N0ctrnl's Avatar
N0ctrnl
Discordant
 
Join Date: Jan 2007
Posts: 443
Default

Cowboy6534 came up with a custom bit of code that I've been using for around 6 months to ease this very thing: http://www.eqemulator.org/forums/sho...3&postcount=75

Here's a patch file if you want to give this a shot:
Code:
--- attack.cpp	2015-07-22 17:07:55.879303652 -0500
+++ attack.cpp.patched	2015-07-24 09:55:03.886735122 -0500
@@ -1851,24 +1851,29 @@
 		uint8 otherlevel = other->GetLevel();
 		uint8 mylevel = this->GetLevel();
 
-		otherlevel = otherlevel ? otherlevel : 1;
-		mylevel = mylevel ? mylevel : 1;
+                int otherac = other->GetAC();
+                float acdiv = (RuleR(Combat, ACDR));
 
-		//instead of calcing damage in floats lets just go straight to ints
-		if(RuleB(Combat, UseIntervalAC))
-			damage = (max_dmg+eleBane);
-		else
-			damage = zone->random.Int((min_dmg+eleBane),(max_dmg+eleBane));
-
-		//check if we're hitting above our max or below it.
-		if((min_dmg+eleBane) != 0 && damage < (min_dmg+eleBane)) {
-			Log.Out(Logs::Detail, Logs::Combat, "Damage (%d) is below min (%d). Setting to min.", damage, (min_dmg+eleBane));
-			damage = (min_dmg+eleBane);
-		}
-		if((max_dmg+eleBane) != 0 && damage > (max_dmg+eleBane)) {
-			Log.Out(Logs::Detail, Logs::Combat, "Damage (%d) is above max (%d). Setting to max.", damage, (max_dmg+eleBane));
-			damage = (max_dmg+eleBane);
-		}
+                otherlevel = otherlevel ? otherlevel : 1;
+                mylevel = mylevel ? mylevel : 1;
+
+                //instead of calcing damage in floats lets just go straight to ints
+                if(RuleB(Combat, UseIntervalAC)) {
+                        damage = (max_dmg+eleBane);
+                }
+                else {
+                        damage = zone->random.Real((min_dmg+eleBane) - (otherac * acdiv/100.0f),(max_dmg+eleBane) - (otherac * acdiv/100.0f));
+
+                }
+
+                //check if we're hitting above our max or below it.
+                if((min_dmg+eleBane) != 0 && damage < (min_dmg+eleBane)) {
+                        Log.Out(Logs::Detail, Logs::Combat, "Damage (%d) is below min (%d). Setting to min.", damage, (min_dmg+eleBane));
+                        damage = ((min_dmg+eleBane) - (otherac * acdiv/100.0f));
+                }
+                if((max_dmg+eleBane) != 0 && damage > (max_dmg+eleBane)) {
+                        Log.Out(Logs::Detail, Logs::Combat, "Damage (%d) is above max (%d). Setting to max.", damage, (max_dmg+eleBane));
+                        damage = (max_dmg+eleBane);
+                }
 
 		damage = mod_npc_damage(damage, skillinuse, Hand, weapon, other);
You'll also need the Combat::ACDR rule:
Code:
--- ruletypes.h 2015-07-22 17:01:15.399924354 -0500
+++ ruletypes.h.patched 2015-07-24 10:00:08.434263104 -0500
@@ -452,6 +452,7 @@
 RULE_BOOL(Combat, MeleePush, true) // enable melee push
 RULE_INT(Combat, MeleePushChance, 50) // (NPCs) chance the target will be pushed. Made up, 100 actually isn't that bad
 RULE_BOOL(Combat, UseLiveCombatRounds, true) // turn this false if you don't want to worry about fixing up combat rounds for NPCs
+RULE_REAL (Combat, ACDR, 2) // Divisor for Cowboy6354's AC changes (acdiv) http://www.eqemulator.org/forums/showpost.php?p=229623&postcount=75
 RULE_CATEGORY_END()

 RULE_CATEGORY(NPC)
Code:
INSERT INTO `rule_values` (`ruleset_id`, `rule_name`, `rule_value`, `notes`) VALUES ('1', 'Combat:ACDR', '2', 'Divisor for Cowboy6354's AC changes (acdiv) http://www.eqemulator.org/forums/showpost.php?p=229623&postcount=75');
Reply With Quote