diff --git a/common/ruletypes.h b/common/ruletypes.h index 9874e4002..c5a4bb562 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -136,7 +136,6 @@ RULE_CATEGORY_END() RULE_CATEGORY( Pets ) RULE_REAL( Pets, AttackCommandRange, 150 ) RULE_BOOL( Pets, UnTargetableSwarmPet, false ) -RULE_BOOL( Pets, SwarmPetNotTargetableWithHotKey, false ) //On SOF+ clients this a semi-hack to make swarm pets not F8 targetable. RULE_CATEGORY_END() RULE_CATEGORY( GM ) diff --git a/zone/aa.cpp b/zone/aa.cpp index 61cf56db9..27229cb89 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -600,9 +600,6 @@ 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--; } @@ -699,9 +696,6 @@ 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--; } @@ -889,9 +883,6 @@ 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/npc.cpp b/zone/npc.cpp index 034be8f75..0c49f0388 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -1854,27 +1854,26 @@ void NPC::PetOnSpawn(NewSpawn_Struct* ns) { swarmOwner = entity_list.GetMobID(GetSwarmOwner()); } - + if (swarmOwner != nullptr) { if(swarmOwner->IsClient()) { SetPetOwnerClient(true); //Simple flag to determine if pet belongs to a client SetAllowBeneficial(1);//Allow temp pets to receive buffs and heals if owner is client. - //This is a hack to allow CLIENT swarm pets NOT to be targeted with F8. Warning: Will turn name 'Yellow'! - if (RuleB(Pets, SwarmPetNotTargetableWithHotKey)) - ns->spawn.IsMercenary = 1; + //This will allow CLIENT swarm pets NOT to be targeted with F8. + ns->spawn.targetable_with_hotkey = 0; } else { //NPC cast swarm pets should still be targetable with F8. - ns->spawn.IsMercenary = 0; + ns->spawn.targetable_with_hotkey = 1; } SetTempPet(true); //Simple mob flag for checking if temp pet swarmOwner->SetTempPetsActive(true); //Necessary fail safe flag set if mob ever had a swarm pet to ensure they are removed. swarmOwner->SetTempPetCount(swarmOwner->GetTempPetCount() + 1); - + //Not recommended if using above (However, this will work better on older clients). if (RuleB(Pets, UnTargetableSwarmPet)) { @@ -1882,7 +1881,7 @@ void NPC::PetOnSpawn(NewSpawn_Struct* ns) if(!IsCharmed() && swarmOwner->IsClient()) sprintf(ns->spawn.lastName, "%s's Pet", swarmOwner->GetName()); } - } + } else if(GetOwnerID()) { ns->spawn.is_pet = 1;