mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-19 13:28:25 +00:00
[Spells] Implement PVP resist and duration overrides (#1513)
* Make use of PVP resist field * Implement PVP duration formulas
This commit is contained in:
committed by
GitHub
parent
af6d344e12
commit
41352f77ae
@@ -354,6 +354,16 @@ int Lua_Spell::GetSpellCategory() {
|
||||
return self->spell_category;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetPVPDuration() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->pvp_duration;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetPVPDurationCap() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->pvp_duration_cap;
|
||||
}
|
||||
|
||||
int Lua_Spell::GetCanMGB() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->can_mgb;
|
||||
@@ -543,6 +553,8 @@ luabind::scope lua_register_spell() {
|
||||
.def("PVPResistCalc", &Lua_Spell::GetPVPResistCalc)
|
||||
.def("PVPResistCap", &Lua_Spell::GetPVPResistCap)
|
||||
.def("SpellCategory", &Lua_Spell::GetSpellCategory)
|
||||
.def("PVPDuration", &Lua_Spell::GetPVPDuration)
|
||||
.def("PVPDurationCap", &Lua_Spell::GetPVPDurationCap)
|
||||
.def("CanMGB", &Lua_Spell::GetCanMGB)
|
||||
.def("DispelFlag", &Lua_Spell::GetDispelFlag)
|
||||
.def("MinResist", &Lua_Spell::GetMinResist)
|
||||
|
||||
@@ -83,6 +83,8 @@ public:
|
||||
int GetPVPResistCalc();
|
||||
int GetPVPResistCap();
|
||||
int GetSpellCategory();
|
||||
int GetPVPDuration();
|
||||
int GetPVPDurationCap();
|
||||
int GetCanMGB();
|
||||
int GetDispelFlag();
|
||||
int GetMinResist();
|
||||
|
||||
+20
-3
@@ -2816,8 +2816,14 @@ int Mob::CalcBuffDuration(Mob *caster, Mob *target, uint16 spell_id, int32 caste
|
||||
if(!target)
|
||||
target = caster;
|
||||
|
||||
formula = spells[spell_id].buffdurationformula;
|
||||
duration = spells[spell_id].buffduration;
|
||||
// PVP duration
|
||||
if (IsDetrimentalSpell(spell_id) && target->IsClient() && caster->IsClient()) {
|
||||
formula = spells[spell_id].pvp_duration;
|
||||
duration = spells[spell_id].pvp_duration_cap;
|
||||
} else {
|
||||
formula = spells[spell_id].buffdurationformula;
|
||||
duration = spells[spell_id].buffduration;
|
||||
}
|
||||
|
||||
int castlevel = caster->GetCasterLevel(spell_id);
|
||||
if(caster_level_override > 0)
|
||||
@@ -4591,7 +4597,18 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use
|
||||
}
|
||||
|
||||
//Get resist modifier and adjust it based on focus 2 resist about eq to 1% resist chance
|
||||
int resist_modifier = (use_resist_override) ? resist_override : spells[spell_id].ResistDiff;
|
||||
int resist_modifier = 0;
|
||||
if (use_resist_override) {
|
||||
resist_modifier = resist_override;
|
||||
} else {
|
||||
// PVP, we don't have the normal per_level or cap stuff implemented ... so ahh do that
|
||||
// and make sure the PVP versions are also handled.
|
||||
if (IsClient() && caster->IsClient()) {
|
||||
resist_modifier = spells[spell_id].pvpresistbase;
|
||||
} else {
|
||||
resist_modifier = spells[spell_id].ResistDiff;
|
||||
}
|
||||
}
|
||||
|
||||
if(caster->GetSpecialAbility(CASTING_RESIST_DIFF))
|
||||
resist_modifier += caster->GetSpecialAbilityParam(CASTING_RESIST_DIFF, 0);
|
||||
|
||||
Reference in New Issue
Block a user