diff --git a/changelog.txt b/changelog.txt index 08f8df3c4..d21af0a8b 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,14 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 04/10/2014 == +Kayen: Added 'no_target_hotkey' field to npc_types table. This will prevent the NPC from being targeted with F8 (Warning: Will also turn it's name YELLOW) +Kayen: Added a rule to make all (Player cast) Swarm Pets not targetable with F8 (nearest NPC) by default (Warning: Will also turn pets names YELLOW). This is semi-hack but it works. +Kayen: Player cast swarm pets can now be healed and buffed consistent with live. + +Optional SQL: utils/sql/git/optional/2014_04_10_SwarmPetNotTargetableWithHotKey.sql +Required SQL: utils/sql/git/required/2014_04_10_No_Target_With_Hotkey.sql +Note: For the required new npc_types field you DO NOT need to set values for swarm pets if you enable the above rule. + == 04/09/2014 == Kayen: Implemented ability to use the actual live spell projectile graphics that are defined in the modern spell file. *This is disabled by default. Recommend enabling if your server uses an UF+ spell file AND most of your players use UF+ clients. diff --git a/common/ruletypes.h b/common/ruletypes.h index 5612a90c0..fa07c752e 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -135,6 +135,7 @@ 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/mob.cpp b/zone/mob.cpp index 87486714c..2538a3a49 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -891,7 +891,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() ? 1 : 0; + ns->spawn.IsMercenary = (IsMerc() || no_target_hotkey) ? 1 : 0; + ns->spawn.petOwnerId = ownerid; ns->spawn.haircolor = haircolor; @@ -1626,7 +1627,7 @@ void Mob::SendAppearanceEffect(uint32 parm1, uint32 parm2, uint32 parm3, uint32 la->parm4 = parm4; la->parm5 = parm5; // Note that setting the b values to 0 will disable the related effect from the corresponding parameter. - // Setting the a value appears to have no affect at all. + // Setting the a value appears to have no affect at all.s la->value1a = 1; la->value1b = 1; la->value2a = 1; diff --git a/zone/mob.h b/zone/mob.h index a5ce86903..bf3399251 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -170,7 +170,7 @@ public: bool IsInvisible(Mob* other = 0) const; void SetInvisible(uint8 state); bool AttackAnimation(SkillUseTypes &skillinuse, int Hand, const ItemInst* weapon); - + //Song bool UseBardSpellLogic(uint16 spell_id = 0xffff, int slot = -1); bool ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot); @@ -945,6 +945,7 @@ protected: int16 petpower; uint32 follow; uint32 follow_dist; + bool no_target_hotkey; uint8 gender; uint16 race; diff --git a/zone/npc.cpp b/zone/npc.cpp index f83d1d31b..20bc025fc 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -224,6 +224,8 @@ NPC::NPC(const NPCType* d, Spawn2* in_respawn, float x, float y, float z, float p_depop = false; loottable_id = d->loottable_id; + no_target_hotkey = d->no_target_hotkey; + primary_faction = 0; SetNPCFactionID(d->npc_faction_id); @@ -1719,6 +1721,22 @@ bool Mob::HasNPCSpecialAtk(const char* parse) { void NPC::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) { Mob::FillSpawnStruct(ns, ForWho); + + //Basic settings to make sure swarm pets work properly. + if (GetSwarmOwner()) { + Client *c = entity_list.GetClientByID(GetSwarmOwner()); + if(c) { + SetAllowBeneficial(1); //Allow client cast swarm pets to be heal/buffed. + //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; + } + //NPC cast swarm pets should still be targetable with F8. + else + ns->spawn.IsMercenary = 0; + } + + //Not recommended if using above (However, this will work better on older clients). if (RuleB(Pets, UnTargetableSwarmPet)) { if(GetOwnerID() || GetSwarmOwner()) { ns->spawn.is_pet = 1; @@ -1867,6 +1885,12 @@ void NPC::ModifyNPCStat(const char *identifier, const char *newValue) return; } + if(id == "PhR") + { + PhR = atoi(val.c_str()); + return; + } + if(id == "runspeed") { runspeed = (float)atof(val.c_str()); diff --git a/zone/npc.h b/zone/npc.h index e8877172b..406be550f 100644 --- a/zone/npc.h +++ b/zone/npc.h @@ -245,6 +245,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; } //waypoint crap int GetMaxWp() const { return max_wp; } diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 568780e7d..119d83cc2 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -1099,7 +1099,8 @@ const NPCType* ZoneDatabase::GetNPCType (uint32 id) { "npc_types.underwater," "npc_types.emoteid," "npc_types.spellscale," - "npc_types.healscale"; + "npc_types.healscale," + "npc_types.no_target_hotkey"; MakeAnyLenString(&query, "%s FROM npc_types WHERE id=%d", basic_query, id); @@ -1191,7 +1192,7 @@ const NPCType* ZoneDatabase::GetNPCType (uint32 id) { tmpNPCType->armor_tint[0] |= (atoi(row[r++]) & 0xFF) << 8; tmpNPCType->armor_tint[0] |= (atoi(row[r++]) & 0xFF); tmpNPCType->armor_tint[0] |= (tmpNPCType->armor_tint[0]) ? (0xFF << 24) : 0; - + int i; if (armor_tint_id > 0) { @@ -1281,7 +1282,8 @@ const NPCType* ZoneDatabase::GetNPCType (uint32 id) { tmpNPCType->emoteid = atoi(row[r++]); tmpNPCType->spellscale = atoi(row[r++]); tmpNPCType->healscale = atoi(row[r++]); - + tmpNPCType->no_target_hotkey = atoi(row[r++]) == 1 ? true : false; + // If NPC with duplicate NPC id already in table, // free item we attempted to add. if (zone->npctable.find(tmpNPCType->npc_id) != zone->npctable.end()) diff --git a/zone/zonedump.h b/zone/zonedump.h index 2c036be61..ab8f88d23 100644 --- a/zone/zonedump.h +++ b/zone/zonedump.h @@ -120,6 +120,7 @@ struct NPCType uint32 emoteid; float spellscale; float healscale; + bool no_target_hotkey; }; /*