Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Feb 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions zone/bonuses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions zone/client_packet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,8 @@ void Client::CompleteConnect()

entity_list.SendAppearanceEffects(this);

entity_list.SendIllusionWearChange(this);

entity_list.SendTraders(this);

Mob *pet = GetPet();
Expand Down
1 change: 1 addition & 0 deletions zone/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
19 changes: 19 additions & 0 deletions zone/entity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4657,6 +4657,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.
Expand Down
1 change: 1 addition & 0 deletions zone/entity.h
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ class EntityList
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);
Expand Down
1 change: 1 addition & 0 deletions zone/mob.h
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ class Mob : public Entity {
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();
Expand Down
20 changes: 20 additions & 0 deletions zone/spell_effects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down