diff --git a/zone/aa.cpp b/zone/aa.cpp index 09a8d0306..472f90d5d 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -36,7 +36,7 @@ Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net) extern QueryServ* QServ; -void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, uint32 duration_override, bool followme, bool sticktarg) { +void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, uint32 duration_override, bool followme, bool sticktarg, uint16 *eye_id) { //It might not be a bad idea to put these into the database, eventually.. @@ -164,8 +164,8 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u summon_count--; } - if (IsClient() && spell_id == SPELL_EYE_OF_ZOMM) { - CastToClient()->SetControlledMobId(swarm_pet_npc->GetID()); + if (IsClient() && eye_id != nullptr) { + *eye_id = swarm_pet_npc->GetID(); } //the target of these swarm pets will take offense to being cast on... diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 79361b637..837d83864 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -10784,7 +10784,7 @@ void Client::Handle_OP_PopupResponse(const EQApplicationPacket *app) } char buf[16]; - sprintf(buf, "%d\0", popup_response->popupid); + sprintf(buf, "%d", popup_response->popupid); parse->EventPlayer(EVENT_POPUP_RESPONSE, this, buf, 0); diff --git a/zone/mob.cpp b/zone/mob.cpp index edaf87001..d5b95a298 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -1208,7 +1208,7 @@ void Mob::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) // Changing the second string made no visible difference sprintf(ns->spawn.DestructibleName2, "%s", ns->spawn.name); // Putting a string in the final one that was previously empty had no visible effect. - sprintf(ns->spawn.DestructibleString, ""); + ns->spawn.DestructibleString[0] = '\0'; // Sets damage appearance level of the object. ns->spawn.DestructibleAppearance = luclinface; // Was 0x00000000 diff --git a/zone/mob.h b/zone/mob.h index 21003fbd6..bcf3adcca 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -762,7 +762,7 @@ public: virtual void UnStun(); inline void Silence(bool newval) { silenced = newval; } inline void Amnesia(bool newval) { amnesiad = newval; } - void TemporaryPets(uint16 spell_id, Mob *target, const char *name_override = nullptr, uint32 duration_override = 0, bool followme=true, bool sticktarg=false); + void TemporaryPets(uint16 spell_id, Mob *target, const char *name_override = nullptr, uint32 duration_override = 0, bool followme=true, bool sticktarg=false, uint16 *controlled_pet_id = nullptr); void TypesTemporaryPets(uint32 typesid, Mob *target, const char *name_override = nullptr, uint32 duration_override = 0, bool followme=true, bool sticktarg=false); void WakeTheDead(uint16 spell_id, Mob *target, uint32 duration); void Spin(); diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 9cc58ed60..406a801d0 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -1561,7 +1561,11 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove char eye_name[64]; snprintf(eye_name, sizeof(eye_name), "Eye_of_%s", caster->GetCleanName()); int duration = CalcBuffDuration(caster, this, spell_id) * 6; - caster->TemporaryPets(spell_id, nullptr, eye_name, duration, false); + uint16 eye_id=0; + caster->TemporaryPets(spell_id, nullptr, eye_name, duration, false, false, &eye_id); + if (eye_id != 0) { + caster->CastToClient()->SetControlledMobId(eye_id); + } } break; }