diff --git a/common/ruletypes.h b/common/ruletypes.h index 594bcd85e..d31d27e8e 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -391,6 +391,7 @@ RULE_BOOL(Spells, NPCSpellPush, false, "Enable spell push on NPCs") RULE_CATEGORY_END() RULE_CATEGORY(Combat) +RULE_REAL(Combat, AERampageSafeZone, 0.018, "max hit ae ramp reduction range") RULE_INT(Combat, PetBaseCritChance, 0, "Pet base crit chance") RULE_INT(Combat, NPCBashKickLevel, 6, "The level that NPCcan KICK/BASH") RULE_INT(Combat, NPCBashKickStunChance, 15, "Percent chance that a bash/kick will stun") @@ -492,6 +493,7 @@ RULE_INT(Combat, NPCAssistCap, 5, "Maxiumium number of NPCthat will assist anoth RULE_INT(Combat, NPCAssistCapTimer, 6000, "Time a NPC will take to clear assist aggro cap space (milliseconds)") RULE_BOOL(Combat, UseRevampHandToHand, false, "Use h2h revamped dmg/delays I believe this was implemented during SoF") RULE_BOOL(Combat, ClassicMasterWu, false, "Classic master wu uses a random special, modern doesn't") +RULE_REAL(Combat, HitBoxMod, 1.00, "Added to test hit boxes.") RULE_INT(Combat, LevelToStopDamageCaps, 0, "Level to stop damage caps. 1 will effectively disable them, 20 should give basically same results as old incorrect system") RULE_INT(Combat, LevelToStopACTwinkControl, 50, "Level to stop armorclass twink control. 1 will effectively disable it, 50 should give basically same results as current system") RULE_BOOL(Combat, ClassicNPCBackstab, false, "True disables npc facestab - NPCget normal attack if not behind") diff --git a/zone/aggro.cpp b/zone/aggro.cpp index 0cc2d7691..a3aa301ac 100644 --- a/zone/aggro.cpp +++ b/zone/aggro.cpp @@ -800,7 +800,7 @@ bool Mob::IsBeneficialAllowed(Mob *target) return false; } -bool Mob::CombatRange(Mob* other) +bool Mob::CombatRange(Mob* other, float fixed_size_mod, bool aeRampage) { if(!other) return(false); @@ -825,13 +825,25 @@ bool Mob::CombatRange(Mob* other) // this could still use some work, but for now it's an improvement.... - if (size_mod > 29) + if (size_mod > 29) { size_mod *= size_mod; - else if (size_mod > 19) + } else if (size_mod > 19) { size_mod *= size_mod * 2; - else + } else { size_mod *= size_mod * 4; + } + if (other->GetRace() == 184) // Lord Vyemm and other velious dragons + { + size_mod *= 1.75; + } + if (other->GetRace() == 122) // Dracoliche in Fear. Skeletal Dragon + { + size_mod *= 2.25; + } + + size_mod *= RuleR(Combat,HitBoxMod); // used for testing sizemods on different races. + size_mod *= fixed_size_mod; // used to extend the size_mod // prevention of ridiculously sized hit boxes if (size_mod > 10000) @@ -865,6 +877,15 @@ bool Mob::CombatRange(Mob* other) else SetPseudoRoot(false); } + if(aeRampage) { + float multiplyer = GetSize() * RuleR(Combat, AERampageSafeZone); + float ramp_range = (size_mod * multiplyer); + if (_DistNoRoot <= ramp_range) { + return true; + } else { + return false; + } + } if (_DistNoRoot <= size_mod) { @@ -872,13 +893,11 @@ bool Mob::CombatRange(Mob* other) if (flymode != GravityBehavior::Flying && _zDist > 500 && !CheckLastLosState()) { return false; } - return true; } return false; } -//Father Nitwit's LOS code bool Mob::CheckLosFN(Mob *other) { bool Result = false; diff --git a/zone/hate_list.cpp b/zone/hate_list.cpp index 725918762..67d98be22 100644 --- a/zone/hate_list.cpp +++ b/zone/hate_list.cpp @@ -675,10 +675,12 @@ int HateList::AreaRampage(Mob *caster, Mob *target, int count, ExtraAttackOption std::vector id_list; for (auto &h : list) { if (h->entity_on_hatelist && h->entity_on_hatelist != caster && h->entity_on_hatelist != target && - caster->CombatRange(h->entity_on_hatelist)) + caster->CombatRange(h->entity_on_hatelist, 1.0, true)) { id_list.push_back(h->entity_on_hatelist->GetID()); - if (count != -1 && id_list.size() > count) + } + if (count != -1 && id_list.size() > count) { break; + } } for (auto &id : id_list) { @@ -688,7 +690,6 @@ int HateList::AreaRampage(Mob *caster, Mob *target, int count, ExtraAttackOption caster->ProcessAttackRounds(mob, opts); } } - return hit_count; } diff --git a/zone/mob.h b/zone/mob.h index b07f51ceb..6fd040175 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -222,7 +222,7 @@ public: inline int GetMitigationAC() { return mitigation_ac; } void MeleeMitigation(Mob *attacker, DamageHitInfo &hit, ExtraAttackOptions *opts = nullptr); double RollD20(int offense, int mitigation); // CALL THIS FROM THE DEFENDER - bool CombatRange(Mob* other); + bool CombatRange(Mob* other, float fixed_size_mod = 1.0, bool aeRampage = false); virtual inline bool IsBerserk() { return false; } // only clients void RogueEvade(Mob *other); void CommonOutgoingHitSuccess(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions *opts = nullptr);