[Bug Fix] Illusions will now properly display armor to other clients when they zone in. (#1958)

* Fix for illusion wear change

On zone in, mobs with illusions were not displaying correct armor.

* [Bug Fix] Illusions will now properly display armor to other clients when they zone in

better looping
This commit is contained in:
KayenEQ 2022-02-03 22:04:15 -05:00 committed by GitHub
parent cc0371c16e
commit 5ce2889210
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 52 additions and 0 deletions

View File

@ -1460,6 +1460,10 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
break;
}
case SE_Illusion:
newbon->Illusion = true;
break;
case SE_IllusionPersistence:
newbon->IllusionPersistence = base_value;
break;
@ -3541,6 +3545,10 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
break;
}
case SE_Illusion:
new_bonus->Illusion = true;
break;
case SE_IllusionPersistence:
new_bonus->IllusionPersistence = effect_value;
break;

View File

@ -747,6 +747,8 @@ void Client::CompleteConnect()
entity_list.SendAppearanceEffects(this);
entity_list.SendIllusionWearChange(this);
entity_list.SendTraders(this);
Mob *pet = GetPet();

View File

@ -559,6 +559,7 @@ struct StatBonuses {
int32 WeaponStance[WEAPON_STANCE_TYPE_MAX +1];// base = trigger spell id, base2 = 0 is 2h, 1 is shield, 2 is dual wield, [0]spid 2h, [1]spid shield, [2]spid DW
bool ZoneSuspendMinion; // base 1 allows suspended minions to zone
bool CompleteHealBuffBlocker; // Use in SPA 101 to prevent recast of complete heal from this effect till blocker buff is removed.
bool Illusion; // check if illusion is present.
// AAs
int32 TrapCircumvention; // reduce chance to trigger a trap.

View File

@ -4686,6 +4686,25 @@ void EntityList::SendAppearanceEffects(Client *c)
}
}
void EntityList::SendIllusionWearChange(Client *c)
{
if (!c) {
return;
}
for (auto &e : mob_list) {
auto &mob = e.second;
if (mob) {
if (mob == c) {
continue;
}
mob->SendIllusionWearChange(c);
}
}
}
void EntityList::ZoneWho(Client *c, Who_All_Struct *Who)
{
// This is only called for SoF clients, as regular /who is now handled server-side for that client.

View File

@ -382,6 +382,7 @@ public:
void SendNimbusEffects(Client *c);
void SendUntargetable(Client *c);
void SendAppearanceEffects(Client *c);
void SendIllusionWearChange(Client *c);
void DuelMessage(Mob* winner, Mob* loser, bool flee);
void QuestJournalledSayClose(Mob *sender, float dist, const char* mobname, const char* message, Journal::Options &opts);
void GroupMessage(uint32 gid, const char *from, const char *message);

View File

@ -357,6 +357,7 @@ public:
void ConeDirectional(uint16 spell_id, int16 resist_adjust);
void TryOnSpellFinished(Mob *caster, Mob *target, uint16 spell_id);
void ApplySpellEffectIllusion(int32 spell_id, Mob* caster, int buffslot, int base, int limit, int max);
void SendIllusionWearChange(Client* c);
//Buff
void BuffProcess();

View File

@ -8963,6 +8963,26 @@ void Mob::SetProcLimitTimer(int32 base_spell_id, uint32 proc_reuse_time, int pro
}
}
void Mob::SendIllusionWearChange(Client* c) {
/*
We send this to client on Client::CompleteConnect() to properly update textures of
other mobs in zone with illusions on them.
*/
if (!c) {
return;
}
if (!spellbonuses.Illusion && !itembonuses.Illusion && !aabonuses.Illusion) {
return;
}
for (int x = EQ::textures::textureBegin; x <= EQ::textures::LastTintableTexture; x++) {
SendWearChange(x, c);
}
}
void Mob::ApplySpellEffectIllusion(int32 spell_id, Mob *caster, int buffslot, int base, int limit, int max)
{
// Gender Illusions