mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-10 19:10:25 +00:00
[Feature] New SPAs pass 1 (#1454)
* Implemented SPA Duration Pct Implemented new spell effects SE_Duration_HP_Pct 524 SE_Duration_Mana_Pct 525 SE_Duration_Endurance_Pct 526 Consumes 'base1' % of your maximum health/mana/endurance every 6 seconds. 'max' is maximum amount that can be consumed per tic. Additional Functionality Can be used as a heal/gain % by setting the base1 value to a positive. * Implemented SPA Instant Mana/End pct Fixes for SPA 524-526 Implemented SE_Instant_Mana_Pct 522 SE_Instant_Endurance_Pct 523 Extracts 'base1' percent of your maximum mana/endurance, or 'max', whichever is lower. * Implemented: SPA 521 EndAbsorbPctDmg Implemented SE_Endurance_Absorb_Pct_Damage 521 Absorb Damage using Endurance: base1 % (base2 End per 1 HP) Note: Both base1 and base2 need to be divided by 100 for actually value * Implemented SE_HealthTransfer 509 Implemented SE_Health_Transfer 509 'life burn' Consume base2 % of Hit Points to Damage for base % of Hit Points Can be used for heal Act of Valor * Implemented SPA 515,516,518,496 Implemented SE_AC_Avoidance_Max_Percent 515 SE_AC_Mitigation_Max_Percent 516 SE_Attack_Accuracy_Max_Percent 518 Above are stackable defense and offensive mods SE_Critical_Melee_Damage_Mod_Max 496 - This is a non stackable melee critical modifier * Implemented SPA 503 , 505 SE_Melee_Damage_Position_Mod 503 define SE_Damage_Taken_Position_Mod 505 SPA 503 increase/decreases melee damage by percent base1 based on your position base2 0=back 1=front SPA 504 increase/decreases melee damage taken by percent base1 based on your position base2 0=back 1=front * Implemented 467,468 Implemented SE_DS_Mitigation_Amount 467 SE_DS_Mitigation_Percentage 468 Reduce incoming DS by amt or percentage. base1 is value, if a reduction is desired it should be set to negative for both. * Fixes Formula fixes * Update spdat.h Added spa descriptions. * Fixes for PR removed debug shouts fixed description issue
This commit is contained in:
+87
-2
@@ -3711,6 +3711,32 @@ void Mob::TryTwincast(Mob *caster, Mob *target, uint32 spell_id)
|
||||
}
|
||||
}
|
||||
|
||||
//Used for effects that should occur after the completion of the spell
|
||||
void Mob::TryOnSpellFinished(Mob *caster, Mob *target, uint16 spell_id)
|
||||
{
|
||||
if (!IsValidSpell(spell_id))
|
||||
return;
|
||||
|
||||
/*Apply damage from Lifeburn type effects on caster at end of spell cast.
|
||||
This allows for the AE spells to function without repeatedly killing caster
|
||||
Damage or heal portion can be found as regular single use spell effect
|
||||
*/
|
||||
if (IsEffectInSpell(spell_id, SE_Health_Transfer)){
|
||||
for (int i = 0; i < EFFECT_COUNT; i++) {
|
||||
|
||||
if (spells[spell_id].effectid[i] == SE_Health_Transfer) {
|
||||
int new_hp = GetMaxHP();
|
||||
new_hp -= GetMaxHP() * spells[spell_id].base[i] / 1000;
|
||||
|
||||
if (new_hp > 0)
|
||||
SetHP(new_hp);
|
||||
else
|
||||
Kill();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int32 Mob::GetVulnerability(Mob* caster, uint32 spell_id, uint32 ticsremaining)
|
||||
{
|
||||
if (!IsValidSpell(spell_id))
|
||||
@@ -3771,7 +3797,7 @@ int32 Mob::GetVulnerability(Mob* caster, uint32 spell_id, uint32 ticsremaining)
|
||||
return value;
|
||||
}
|
||||
|
||||
int16 Mob::GetSkillDmgTaken(const EQ::skills::SkillType skill_used, ExtraAttackOptions *opts)
|
||||
int32 Mob::GetSkillDmgTaken(const EQ::skills::SkillType skill_used, ExtraAttackOptions *opts)
|
||||
{
|
||||
int skilldmg_mod = 0;
|
||||
|
||||
@@ -3790,6 +3816,33 @@ int16 Mob::GetSkillDmgTaken(const EQ::skills::SkillType skill_used, ExtraAttackO
|
||||
return skilldmg_mod;
|
||||
}
|
||||
|
||||
int32 Mob::GetPositionalDmgTaken(Mob *attacker)
|
||||
{
|
||||
if (!attacker)
|
||||
return 0;
|
||||
|
||||
int front_arc = 0;
|
||||
int back_arc = 0;
|
||||
int total_mod = 0;
|
||||
|
||||
back_arc += itembonuses.Damage_Taken_Position_Mod[0] + aabonuses.Damage_Taken_Position_Mod[0] + spellbonuses.Damage_Taken_Position_Mod[0];
|
||||
front_arc += itembonuses.Damage_Taken_Position_Mod[1] + aabonuses.Damage_Taken_Position_Mod[1] + spellbonuses.Damage_Taken_Position_Mod[1];
|
||||
|
||||
if (back_arc || front_arc) { //Do they have this bonus?
|
||||
if (attacker->BehindMob(this, attacker->GetX(), attacker->GetY()))//Check if attacker is striking from behind
|
||||
total_mod = back_arc; //If so, apply the back arc modifier only
|
||||
else
|
||||
total_mod = front_arc;//If not, apply the front arc modifer only
|
||||
}
|
||||
|
||||
total_mod = round(static_cast<double>(total_mod) * 0.1);
|
||||
|
||||
if (total_mod < -100)
|
||||
total_mod = -100;
|
||||
|
||||
return total_mod;
|
||||
}
|
||||
|
||||
int16 Mob::GetHealRate(uint16 spell_id, Mob* caster) {
|
||||
|
||||
int16 heal_rate = 0;
|
||||
@@ -4598,10 +4651,13 @@ int16 Mob::GetCritDmgMod(uint16 skill)
|
||||
{
|
||||
int critDmg_mod = 0;
|
||||
|
||||
// All skill dmg mod + Skill specific
|
||||
// All skill dmg mod + Skill specific [SPA 330 and 496]
|
||||
critDmg_mod += itembonuses.CritDmgMod[EQ::skills::HIGHEST_SKILL + 1] + spellbonuses.CritDmgMod[EQ::skills::HIGHEST_SKILL + 1] + aabonuses.CritDmgMod[EQ::skills::HIGHEST_SKILL + 1] +
|
||||
itembonuses.CritDmgMod[skill] + spellbonuses.CritDmgMod[skill] + aabonuses.CritDmgMod[skill];
|
||||
|
||||
critDmg_mod += itembonuses.CritDmgModNoStack[EQ::skills::HIGHEST_SKILL + 1] + spellbonuses.CritDmgModNoStack[EQ::skills::HIGHEST_SKILL + 1] + aabonuses.CritDmgModNoStack[EQ::skills::HIGHEST_SKILL + 1] +
|
||||
itembonuses.CritDmgModNoStack[skill] + spellbonuses.CritDmgModNoStack[skill] + aabonuses.CritDmgModNoStack[skill];
|
||||
|
||||
return critDmg_mod;
|
||||
}
|
||||
|
||||
@@ -4692,6 +4748,35 @@ int16 Mob::GetCrippBlowChance()
|
||||
return crip_chance;
|
||||
}
|
||||
|
||||
|
||||
int16 Mob::GetMeleeDmgPositionMod(Mob* defender)
|
||||
{
|
||||
if (!defender)
|
||||
return 0;
|
||||
|
||||
int front_arc = 0;
|
||||
int back_arc = 0;
|
||||
int total_mod = 0;
|
||||
|
||||
back_arc += itembonuses.Melee_Damage_Position_Mod[0] + aabonuses.Melee_Damage_Position_Mod[0] + spellbonuses.Melee_Damage_Position_Mod[0];
|
||||
front_arc += itembonuses.Melee_Damage_Position_Mod[1] + aabonuses.Melee_Damage_Position_Mod[1] + spellbonuses.Melee_Damage_Position_Mod[1];
|
||||
|
||||
if (back_arc || front_arc) { //Do they have this bonus?
|
||||
if (BehindMob(defender, GetX(), GetY()))//Check if attacker is striking from behind
|
||||
total_mod = back_arc; //If so, apply the back arc modifier only
|
||||
else
|
||||
total_mod = front_arc;//If not, apply the front arc modifer only
|
||||
}
|
||||
|
||||
total_mod = round(static_cast<double>(total_mod) * 0.1);
|
||||
|
||||
if (total_mod < -100)
|
||||
total_mod = -100;
|
||||
|
||||
return total_mod;
|
||||
|
||||
}
|
||||
|
||||
int16 Mob::GetSkillReuseTime(uint16 skill)
|
||||
{
|
||||
int skill_reduction = this->itembonuses.SkillReuseTime[skill] + this->spellbonuses.SkillReuseTime[skill] + this->aabonuses.SkillReuseTime[skill];
|
||||
|
||||
Reference in New Issue
Block a user