mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 09:31:30 +00:00
[Bug Fix] Charm Break Invisibility Fix. (#1855)
- Invisibility vs. Undead and Invisibility vs. Animals were not breaking charm. - Add Invisibility enumerator. - Add special identifier for Invisibility vs. Undead and Invisibility vs. Animals.
This commit is contained in:
parent
bc0795bb48
commit
9a0c98397e
@ -371,4 +371,10 @@ enum AccountStatus : uint8 {
|
|||||||
Max = 255
|
Max = 255
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum Invisibility : uint8 {
|
||||||
|
Visible,
|
||||||
|
Invisible,
|
||||||
|
Special = 255
|
||||||
|
};
|
||||||
|
|
||||||
#endif /*COMMON_EMU_CONSTANTS_H*/
|
#endif /*COMMON_EMU_CONSTANTS_H*/
|
||||||
|
|||||||
@ -3465,7 +3465,7 @@ uint8 Client::SlotConvert2(uint8 slot){
|
|||||||
void Client::Escape()
|
void Client::Escape()
|
||||||
{
|
{
|
||||||
entity_list.RemoveFromTargets(this, true);
|
entity_list.RemoveFromTargets(this, true);
|
||||||
SetInvisible(1);
|
SetInvisible(Invisibility::Invisible);
|
||||||
|
|
||||||
MessageString(Chat::Skills, ESCAPE);
|
MessageString(Chat::Skills, ESCAPE);
|
||||||
}
|
}
|
||||||
|
|||||||
15
zone/mob.cpp
15
zone/mob.cpp
@ -575,13 +575,16 @@ uint32 Mob::GetAppearanceValue(EmuAppearance iAppearance) {
|
|||||||
|
|
||||||
void Mob::SetInvisible(uint8 state)
|
void Mob::SetInvisible(uint8 state)
|
||||||
{
|
{
|
||||||
invisible = state;
|
if (state != Invisibility::Special) {
|
||||||
SendAppearancePacket(AT_Invis, invisible);
|
invisible = state;
|
||||||
|
SendAppearancePacket(AT_Invis, invisible);
|
||||||
|
}
|
||||||
|
|
||||||
// Invis and hide breaks charms
|
// Invis and hide breaks charms
|
||||||
auto formerpet = GetPet();
|
auto pet = GetPet();
|
||||||
if (formerpet && formerpet->GetPetType() == petCharmed && (invisible || hidden || improved_hidden || invisible_animals || invisible_undead)) {
|
if (pet && pet->GetPetType() == petCharmed && (invisible || hidden || improved_hidden || invisible_animals || invisible_undead)) {
|
||||||
if (RuleB(Pets, LivelikeBreakCharmOnInvis) || IsInvisible(formerpet)) {
|
if (RuleB(Pets, LivelikeBreakCharmOnInvis) || IsInvisible(pet)) {
|
||||||
formerpet->BuffFadeByEffect(SE_Charm);
|
pet->BuffFadeByEffect(SE_Charm);
|
||||||
}
|
}
|
||||||
|
|
||||||
LogRules("Pets:LivelikeBreakCharmOnInvis for [{}] | Invis [{}] - Hidden [{}] - Shroud of Stealth [{}] - IVA [{}] - IVU [{}]", GetCleanName(), invisible, hidden, improved_hidden, invisible_animals, invisible_undead);
|
LogRules("Pets:LivelikeBreakCharmOnInvis for [{}] | Invis [{}] - Hidden [{}] - Shroud of Stealth [{}] - IVA [{}] - IVU [{}]", GetCleanName(), invisible, hidden, improved_hidden, invisible_animals, invisible_undead);
|
||||||
|
|||||||
@ -593,6 +593,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
|
|||||||
snprintf(effect_desc, _EDLEN, "Invisibility to Animals");
|
snprintf(effect_desc, _EDLEN, "Invisibility to Animals");
|
||||||
#endif
|
#endif
|
||||||
invisible_animals = true;
|
invisible_animals = true;
|
||||||
|
SetInvisible(Invisibility::Special);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -603,6 +604,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
|
|||||||
snprintf(effect_desc, _EDLEN, "Invisibility to Undead");
|
snprintf(effect_desc, _EDLEN, "Invisibility to Undead");
|
||||||
#endif
|
#endif
|
||||||
invisible_undead = true;
|
invisible_undead = true;
|
||||||
|
SetInvisible(Invisibility::Special);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SE_SeeInvis:
|
case SE_SeeInvis:
|
||||||
@ -2291,7 +2293,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
entity_list.RemoveFromTargets(caster);
|
entity_list.RemoveFromTargets(caster);
|
||||||
SetInvisible(1);
|
SetInvisible(Invisibility::Invisible);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -4190,7 +4192,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses)
|
|||||||
case SE_Invisibility2:
|
case SE_Invisibility2:
|
||||||
case SE_Invisibility:
|
case SE_Invisibility:
|
||||||
{
|
{
|
||||||
SetInvisible(0);
|
SetInvisible(Invisibility::Visible);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user