mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
[Feature] Add SE_IncreaseArchery and rules to tune archery (#4335)
* [Feature] Add SE_IncreaseArchery and rules to tune archery * Adjustments per comments, also added to the tune system. * Update bonuses.cpp --------- Co-authored-by: Kinglykrab <kinglykrab@gmail.com>
This commit is contained in:
@@ -232,6 +232,11 @@ int Mob::GetTotalToHit(EQ::skills::SkillType skill, int chance_mod)
|
||||
aabonuses.HitChanceEffect[skill] +
|
||||
spellbonuses.HitChanceEffect[skill];
|
||||
|
||||
if (skill == EQ::skills::SkillArchery) {
|
||||
hit_bonus += spellbonuses.increase_archery + aabonuses.increase_archery + itembonuses.increase_archery;
|
||||
hit_bonus -= hit_bonus * RuleR(Combat, ArcheryHitPenalty);
|
||||
}
|
||||
|
||||
accuracy = (accuracy * (100 + hit_bonus)) / 100;
|
||||
|
||||
// TODO: April 2003 added an archery/throwing PVP accuracy penalty while moving, should be in here some where,
|
||||
@@ -6348,6 +6353,9 @@ void Mob::CommonOutgoingHitSuccess(Mob* defender, DamageHitInfo &hit, ExtraAttac
|
||||
MessageString(Chat::MeleeCrit, BOW_DOUBLE_DAMAGE);
|
||||
}
|
||||
}
|
||||
|
||||
//Scale Factor for Archery Damage Tuning
|
||||
hit.damage_done *= RuleR(Combat, ArcheryBaseDamageBonus);
|
||||
}
|
||||
|
||||
int extra_mincap = 0;
|
||||
|
||||
@@ -2235,6 +2235,12 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
|
||||
break;
|
||||
}
|
||||
|
||||
case SE_IncreaseArchery:
|
||||
{
|
||||
new_bonus->increase_archery += effect_value;
|
||||
break;
|
||||
}
|
||||
|
||||
case SE_TotalHP:
|
||||
{
|
||||
new_bonus->FlatMaxHPChange += effect_value;
|
||||
@@ -4533,6 +4539,12 @@ void Mob::NegateSpellEffectBonuses(uint16 spell_id)
|
||||
if (negate_itembonus) { itembonuses.inhibitmelee = effect_value; }
|
||||
break;
|
||||
|
||||
case SE_IncreaseArchery:
|
||||
if (negate_spellbonus) { spellbonuses.increase_archery = effect_value; }
|
||||
if (negate_aabonus) { aabonuses.increase_archery = effect_value; }
|
||||
if (negate_itembonus) { itembonuses.increase_archery = effect_value; }
|
||||
break;
|
||||
|
||||
case SE_TotalHP:
|
||||
if (negate_spellbonus) { spellbonuses.FlatMaxHPChange = effect_value; }
|
||||
if (negate_aabonus) { aabonuses.FlatMaxHPChange = effect_value; }
|
||||
|
||||
@@ -336,6 +336,7 @@ struct StatBonuses {
|
||||
int32 hastetype2;
|
||||
int32 hastetype3;
|
||||
int32 inhibitmelee;
|
||||
int32 increase_archery;
|
||||
float AggroRange; // when calculate just replace original value with this
|
||||
float AssistRange;
|
||||
int32 skillmod[EQ::skills::HIGHEST_SKILL + 1];
|
||||
|
||||
@@ -3341,6 +3341,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
|
||||
case SE_SkillProcAttempt:
|
||||
case SE_SkillProcSuccess:
|
||||
case SE_SpellResistReduction:
|
||||
case SE_IncreaseArchery:
|
||||
case SE_Duration_HP_Pct:
|
||||
case SE_Duration_Mana_Pct:
|
||||
case SE_Duration_Endurance_Pct:
|
||||
|
||||
@@ -1323,6 +1323,11 @@ int64 Mob::TuneGetTotalToHit(EQ::skills::SkillType skill, int chance_mod, int ac
|
||||
aabonuses.HitChanceEffect[skill] +
|
||||
spellbonuses.HitChanceEffect[skill];
|
||||
|
||||
if (skill == EQ::skills::SkillArchery) {
|
||||
hit_bonus += spellbonuses.increase_archery + aabonuses.increase_archery + itembonuses.increase_archery;
|
||||
hit_bonus -= hit_bonus * RuleR(Combat, ArcheryHitPenalty);
|
||||
}
|
||||
|
||||
accuracy = (accuracy * (100 + hit_bonus)) / 100;
|
||||
return accuracy;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user