[Spells] Invisibility updates and rework (#1991)

* updates pre merge

* update

* Update spell_effects.cpp

* Update mob.h

* test

* test

* updates

* updates

* save

* update

* working solid

* animal and undead start

* progress

* updates

* rename

* set invis appearance on bonus

* remove fade buff state check

* update IsViisble check

* optimizing

* don't break bots

* debug remover

* Update ruletypes.h

* perl adds

* Update client_packet.cpp

* update

* done

* remove debugs

* Update client_packet.cpp

* update

* [Spells] Invisibility updates and rework

lua support

* [Spells] Invisibility updates and rework

lua
This commit is contained in:
KayenEQ
2022-02-15 00:18:02 -05:00
committed by GitHub
parent 51c8771bd2
commit b938e6223c
18 changed files with 369 additions and 188 deletions
+35 -1
View File
@@ -47,6 +47,8 @@ void Mob::CalcBonuses()
CalcMaxMana();
SetAttackTimer();
CalcAC();
CalcSeeInvisibleLevel();
CalcInvisibleLevel();
/* Fast walking NPC's are prone to disappear into walls/hills
We set this here because NPC's can cast spells to change walkspeed/runspeed
@@ -81,6 +83,9 @@ void Client::CalcBonuses()
CalcSpellBonuses(&spellbonuses);
CalcAABonuses(&aabonuses);
CalcSeeInvisibleLevel();
CalcInvisibleLevel();
ProcessItemCaps(); // caps that depend on spell/aa bonuses
RecalcWeight();
@@ -867,7 +872,10 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
newbon->MaxBindWound += base_value;
break;
case SE_SeeInvis:
newbon->SeeInvis = base_value;
base_value = std::min({ base_value, MAX_INVISIBILTY_LEVEL });
if (newbon->SeeInvis < base_value) {
newbon->SeeInvis = base_value;
}
break;
case SE_BaseMovementSpeed:
newbon->BaseMovementSpeed += base_value;
@@ -3825,6 +3833,32 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
break;
}
case SE_Invisibility:
case SE_Invisibility2:
effect_value = std::min({ effect_value, MAX_INVISIBILTY_LEVEL });
if (new_bonus->invisibility < effect_value)
new_bonus->invisibility = effect_value;
break;
case SE_InvisVsUndead:
case SE_InvisVsUndead2:
if (new_bonus->invisibility_verse_undead < effect_value)
new_bonus->invisibility_verse_undead = effect_value;
break;
case SE_InvisVsAnimals:
effect_value = std::min({ effect_value, MAX_INVISIBILTY_LEVEL });
if (new_bonus->invisibility_verse_animal < effect_value)
new_bonus->invisibility_verse_animal = effect_value;
break;
case SE_SeeInvis:
effect_value = std::min({ effect_value, MAX_INVISIBILTY_LEVEL });
if (new_bonus->SeeInvis < effect_value) {
new_bonus->SeeInvis = effect_value;
}
break;
case SE_ZoneSuspendMinion:
new_bonus->ZoneSuspendMinion = effect_value;
break;