From 9680c039f096cc2bf599f6b7d102876c7e0121c5 Mon Sep 17 00:00:00 2001 From: Derision Date: Mon, 18 Feb 2013 18:58:26 +0000 Subject: [PATCH] Charmed pets should no longer be targettable with F8. Charmed pets no longer get a surname of Soandso's Pet. --- changelog.txt | 1 + common/eq_constants.h | 1 + zone/npc.cpp | 15 +++++++++------ zone/spell_effects.cpp | 2 ++ 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/changelog.txt b/changelog.txt index fe73f9de8..a8fc13a88 100644 --- a/changelog.txt +++ b/changelog.txt @@ -3,6 +3,7 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) == 02/18/2013 == Bad_Captain: Moved merc save to merc table, save merc buffs, added cure and rez spells to healer merc. JJ: Chat garbled for drunk characters. +Derision: Charmed pets should no longer be targettable with F8. Charmed pets no longer get a surname of Soandso's Pet. REQUIRED SQL: 2013_02_18_Merc_Rules_and_Tables.sql OPTIONAL SQL: 2013_02_18_Merc_Spells.sql diff --git a/common/eq_constants.h b/common/eq_constants.h index 1d5db537a..039f80006 100644 --- a/common/eq_constants.h +++ b/common/eq_constants.h @@ -145,6 +145,7 @@ enum { #define AT_GuildID 22 #define AT_GuildRank 23 // 0=member, 1=officer, 2=leader #define AT_AFK 24 // 0 = normal, 1 = afk +#define AT_Pet 25 // Param is EntityID of owner, or 0 for when charm breaks #define AT_Split 28 // 0 = normal, 1 = autosplit on #define AT_Size 29 // spawn's size #define AT_NPCName 31 // change PC's name's color to NPC color 0 = normal, 1 = npc name diff --git a/zone/npc.cpp b/zone/npc.cpp index add9e39ff..c78680c4f 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -1737,22 +1737,25 @@ void NPC::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) if (RuleB(Pets, UnTargetableSwarmPet)) { if(GetOwnerID() || GetSwarmOwner()) { ns->spawn.is_pet = 1; - if (GetOwnerID()) { + if (!IsCharmed() && GetOwnerID()) { Client *c = entity_list.GetClientByID(GetOwnerID()); if(c) sprintf(ns->spawn.lastName, "%s's Pet", c->GetName()); } else if (GetSwarmOwner()) { ns->spawn.bodytype = 11; - Client *c = entity_list.GetClientByID(GetSwarmOwner()); - if(c) - sprintf(ns->spawn.lastName, "%s's Pet", c->GetName()); + if(!IsCharmed()) + { + Client *c = entity_list.GetClientByID(GetSwarmOwner()); + if(c) + sprintf(ns->spawn.lastName, "%s's Pet", c->GetName()); + } } } } else { if(GetOwnerID()) { ns->spawn.is_pet = 1; - if (GetOwnerID()) { + if (!IsCharmed() && GetOwnerID()) { Client *c = entity_list.GetClientByID(GetOwnerID()); if(c) sprintf(ns->spawn.lastName, "%s's Pet", c->GetName()); @@ -2347,4 +2350,4 @@ void NPC::PrintOutQuestItems(Client* c){ } c->Message(4,"End of quest items list."); -} \ No newline at end of file +} diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index cd3a1b6a8..de8fd27e1 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -732,6 +732,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) entity_list.QueueClients(this, app); safe_delete(app); SendPetBuffsToClient(); + SendAppearancePacket(AT_Pet, caster->GetID(), true, true); } if (IsClient()) @@ -3499,6 +3500,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses) if(IsNPC()) { CastToNPC()->RestoreGuardSpotCharm(); + SendAppearancePacket(AT_Pet, 0, true, true); } Mob* tempmob = GetOwner();