[Spells] Implemented SPA 476 SE_Weapons_Stance and Live-like AA Enable/Disable Toggle (#1477)

* Work started on SPA 476

defines

* bonus structure add

bonus structure set up

* updates spa476

updates spa476

* spell bonus now functional

spell bonus working well.

* major update with debug messages

aa, item and spell now working

* Pre clean up, effect implemented

working for AA, spells, items, all checked for stacking issues.

* removed debug messages

removed debug messages

* spdat description added

spdat description added

* minor fix

removed debug shout
removed unneeded code check.

* syntax updates, minor fixes

syntax updates, minor fixes

* syntax fixes

syntax fixes

* improvements to code

moved function to check at swap item.  Easier to manage and more live like behavior. Required minor adjustment
Still working on AA toggle.

* updates to aa buy, functionalish

* Syntax / Formatting

* Add break / default to switch

* updates

* completed v2

* Major revisions

Main function check moved to when items are swapped and out of when ever bonus are recalculated.

AA Toggle and data structure now more accurate to live.

* Update aa.cpp

* debug removed

* implemented SE_Buy_AA_Rank

Closer to live.

* Update aa.cpp

broadening AA toggle to be more general use.

* improved various checks

aa toggle is now broadly implemented to be usable with any passive effect.

Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
KayenEQ
2021-08-10 15:46:37 -04:00
committed by GitHub
parent c69446c460
commit 51ad6d65dc
12 changed files with 548 additions and 35 deletions
+60 -1
View File
@@ -154,6 +154,7 @@ void Client::CalcItemBonuses(StatBonuses* newbon) {
SetShieldEquiped(false);
SetTwoHandBluntEquiped(false);
SetTwoHanderEquipped(false);
SetDuelWeaponsEquiped(false);
unsigned int i;
// Update: MainAmmo should only calc skill mods (TODO: Check for other cases)
@@ -171,8 +172,13 @@ void Client::CalcItemBonuses(StatBonuses* newbon) {
SetTwoHandBluntEquiped(true);
SetTwoHanderEquipped(true);
}
else if (i == EQ::invslot::slotPrimary && (item && (item->ItemType == EQ::item::ItemType2HSlash || item->ItemType == EQ::item::ItemType2HPiercing)))
else if (i == EQ::invslot::slotPrimary && (item && (item->ItemType == EQ::item::ItemType2HSlash || item->ItemType == EQ::item::ItemType2HPiercing))) {
SetTwoHanderEquipped(true);
}
}
if (CanThisClassDualWield()) {
SetDuelWeaponsEquiped(true);
}
//tribute items
@@ -1555,6 +1561,25 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
newbon->Pet_Add_Atk += base1;
break;
case SE_Weapon_Stance:
{
if (IsValidSpell(base1)) { //base1 is the spell_id of buff
if (base2 <= WEAPON_STANCE_TYPE_MAX) { //0=2H, 1=Shield, 2=DW
if (IsValidSpell(newbon->WeaponStance[base2])) { //Check if we already a spell_id saved for this effect
if (spells[newbon->WeaponStance[base2]].rank < spells[base1].rank) { //If so, check if any new spellids with higher rank exist (live spells for this are ranked).
newbon->WeaponStance[base2] = base1; //Overwrite with new effect
SetWeaponStanceEnabled(true);
}
}
else {
newbon->WeaponStance[base2] = base1; //If no prior effect exists, then apply
SetWeaponStanceEnabled(true);
}
}
}
break;
}
case SE_ExtraAttackChance:
{
if (newbon->ExtraAttackChance[SBIndex::EXTRA_ATTACK_CHANCE] < base1) {
@@ -1583,6 +1608,7 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
break;
}
// to do
case SE_PetDiscipline:
break;
@@ -1603,6 +1629,7 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
case SE_TrapCircumvention:
break;
// not handled here
case SE_HastenedAASkill:
// not handled here but don't want to clutter debug log -- these may need to be verified to ignore
@@ -3474,6 +3501,38 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
new_bonus->Pet_Add_Atk += effect_value;
break;
case SE_Weapon_Stance: {
if (IsValidSpell(effect_value)) { //base1 is the spell_id of buff
if (base2 <= WEAPON_STANCE_TYPE_MAX) { //0=2H, 1=Shield, 2=DW
if (IsValidSpell(new_bonus->WeaponStance[base2])) { //Check if we already a spell_id saved for this effect
if (spells[new_bonus->WeaponStance[base2]].rank < spells[effect_value].rank) { //If so, check if any new spellids with higher rank exist (live spells for this are ranked).
new_bonus->WeaponStance[base2] = effect_value; //Overwrite with new effect
SetWeaponStanceEnabled(true);
if (WornType) {
weaponstance.itembonus_enabled = true;
}
else {
weaponstance.spellbonus_enabled = true;
}
}
}
else {
new_bonus->WeaponStance[base2] = effect_value; //If no prior effect exists, then apply
SetWeaponStanceEnabled(true);
if (WornType) {
weaponstance.itembonus_enabled = true;
}
else {
weaponstance.spellbonus_enabled = true;
}
}
}
}
break;
}
//Special custom cases for loading effects on to NPC from 'npc_spels_effects' table
if (IsAISpellEffect) {