diff --git a/changelog.txt b/changelog.txt index 2fe60ee70..842d66f9a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,7 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- == 12/09/2014 == Trevius: (RoF+) Implemented Hero's Forge Armor Models for Items. To use, set herosforgemodel field in the item table to a model number such as 63 (for example). +demonstar55: SoF+ swarm pets will no longer be F8able (without a hack!) == 12/08/2014 == Secrets: Added a feature that allows an EQ client to log in directly to World without having to enter the LoginServer, provided the 'password' field is set in WorldServer. diff --git a/common/eq_packet_structs.h b/common/eq_packet_structs.h index cffe4e354..930b76843 100644 --- a/common/eq_packet_structs.h +++ b/common/eq_packet_structs.h @@ -363,6 +363,7 @@ union uint32 DestructibleUnk7; uint8 DestructibleUnk8; uint32 DestructibleUnk9; + bool targetable_with_hotkey; }; diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index 43b411dca..fc35e36cd 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -3706,7 +3706,7 @@ namespace RoF Bitfields->showhelm = emu->showhelm; Bitfields->trader = 0; Bitfields->targetable = 1; - Bitfields->targetable_with_hotkey = (emu->IsMercenary ? 0 : 1); + Bitfields->targetable_with_hotkey = emu->targetable_with_hotkey ? 1 : 0; Bitfields->showname = ShowName; // Not currently found diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index a22d2d4c5..32a3fc592 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -3706,7 +3706,7 @@ namespace RoF2 Bitfields->showhelm = emu->showhelm; Bitfields->trader = 0; Bitfields->targetable = 1; - Bitfields->targetable_with_hotkey = (emu->IsMercenary ? 0 : 1); + Bitfields->targetable_with_hotkey = emu->targetable_with_hotkey ? 1 : 0; Bitfields->showname = ShowName; // Not currently found diff --git a/common/patches/sod.cpp b/common/patches/sod.cpp index 498058e19..baca905a2 100644 --- a/common/patches/sod.cpp +++ b/common/patches/sod.cpp @@ -2383,7 +2383,7 @@ namespace SoD Bitfields->anon = emu->anon; Bitfields->showhelm = emu->showhelm; Bitfields->targetable = 1; - Bitfields->targetable_with_hotkey = (emu->IsMercenary ? 0 : 1); + Bitfields->targetable_with_hotkey = emu->targetable_with_hotkey ? 1 : 0; Bitfields->statue = 0; Bitfields->trader = 0; Bitfields->buyer = 0; diff --git a/common/patches/sof.cpp b/common/patches/sof.cpp index 2d2fff48d..8430a51bb 100644 --- a/common/patches/sof.cpp +++ b/common/patches/sof.cpp @@ -1889,7 +1889,7 @@ namespace SoF eq->beard = emu->beard; eq->targetable = 1; //New Field - Toggle Targetable on or off - 0 = off, 1 = on eq->NPC = emu->NPC; - eq->targetable_with_hotkey = 1;//New Field - Toggle Targetable on or off - 0 = off, 1 = on + eq->targetable_with_hotkey = emu->targetable_with_hotkey ? 1 : 0; //New Field - Toggle Targetable on or off - 0 = off, 1 = on eq->x = emu->x; eq->deltaX = emu->deltaX; eq->deltaY = emu->deltaY; diff --git a/common/patches/underfoot.cpp b/common/patches/underfoot.cpp index 6da577be6..16095faa9 100644 --- a/common/patches/underfoot.cpp +++ b/common/patches/underfoot.cpp @@ -2668,7 +2668,7 @@ namespace Underfoot Bitfields->anon = emu->anon; Bitfields->showhelm = emu->showhelm; Bitfields->targetable = 1; - Bitfields->targetable_with_hotkey = (emu->IsMercenary ? 0 : 1); + Bitfields->targetable_with_hotkey = emu->targetable_with_hotkey ? 1 : 0; Bitfields->statue = 0; Bitfields->trader = 0; Bitfields->buyer = 0; diff --git a/zone/aa.cpp b/zone/aa.cpp index 27229cb89..61cf56db9 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -600,6 +600,9 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u if(npc_dup != nullptr) npca->GiveNPCTypeData(npc_dup); + if (IsClient()) + npca->no_target_hotkey = 1; + entity_list.AddNPC(npca, true, true); summon_count--; } @@ -696,6 +699,9 @@ void Mob::TypesTemporaryPets(uint32 typesid, Mob *targ, const char *name_overrid if(npc_dup != nullptr) npca->GiveNPCTypeData(npc_dup); + if (IsClient()) + npca->no_target_hotkey = 1; + entity_list.AddNPC(npca, true, true); summon_count--; } @@ -883,6 +889,9 @@ void Mob::WakeTheDead(uint16 spell_id, Mob *target, uint32 duration) if(make_npc != nullptr) npca->GiveNPCTypeData(make_npc); + if (IsClient()) + npca->no_target_hotkey = 1; + entity_list.AddNPC(npca, true, true); //the target of these swarm pets will take offense to being cast on... diff --git a/zone/merc.cpp b/zone/merc.cpp index 2641e7cb4..f86ed7faf 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -4772,6 +4772,7 @@ Merc* Merc::LoadMerc(Client *c, MercTemplate* merc_template, uint32 merchant_id, npc_type->npc_id = 0; //NPC ID has to be 0, otherwise db gets all confuzzled. npc_type->class_ = merc_template->ClassID; npc_type->maxlevel = 0; //We should hard-set this to override scalerate's functionality in the NPC class when it is constructed. + npc_type->no_target_hotkey = 1; Merc* merc = new Merc(npc_type, c->GetX(), c->GetY(), c->GetZ(), 0); diff --git a/zone/mob.cpp b/zone/mob.cpp index e501862a2..c30cc6d2b 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -923,7 +923,8 @@ void Mob::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) ns->spawn.invis = (invisible || hidden) ? 1 : 0; // TODO: load this before spawning players ns->spawn.NPC = IsClient() ? 0 : 1; - ns->spawn.IsMercenary = (IsMerc() || no_target_hotkey) ? 1 : 0; + ns->spawn.IsMercenary = IsMerc() ? 1 : 0; + ns->spawn.targetable_with_hotkey = no_target_hotkey ? 0 : 1; // opposite logic! ns->spawn.petOwnerId = ownerid; diff --git a/zone/npc.h b/zone/npc.h index d374f4950..081fca514 100644 --- a/zone/npc.h +++ b/zone/npc.h @@ -269,7 +269,7 @@ public: void AddLootDrop(const Item_Struct*dbitem, ItemList* itemlistconst, int16 charges, uint8 minlevel, uint8 maxlevel, bool equipit, bool wearchange = false); virtual void DoClassAttacks(Mob *target); void CheckSignal(); - inline bool IsTargetableWithHotkey() const { return no_target_hotkey; } + inline bool IsNotTargetableWithHotkey() const { return no_target_hotkey; } int32 GetNPCHPRegen() const { return hp_regen + itembonuses.HPRegen + spellbonuses.HPRegen; } inline const char* GetAmmoIDfile() const { return ammo_idfile; }