mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 01:11:29 +00:00
Rule to make player cast swarm pets untargetable with F8.
New npc_types field to allow any NPC to be untargetable with F8 Swarm pets will now be heal/buffable like live. See change log for more details. Note: The method used here to prevent targeting is a hack but the only side effect it turns affected NPC's names Yellow.
This commit is contained in:
parent
35cd98c7a7
commit
f0a0f0677f
@ -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.
|
||||
|
||||
@ -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 )
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -945,6 +945,7 @@ protected:
|
||||
int16 petpower;
|
||||
uint32 follow;
|
||||
uint32 follow_dist;
|
||||
bool no_target_hotkey;
|
||||
|
||||
uint8 gender;
|
||||
uint16 race;
|
||||
|
||||
24
zone/npc.cpp
24
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());
|
||||
|
||||
@ -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; }
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -1281,6 +1282,7 @@ 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.
|
||||
|
||||
@ -120,6 +120,7 @@ struct NPCType
|
||||
uint32 emoteid;
|
||||
float spellscale;
|
||||
float healscale;
|
||||
bool no_target_hotkey;
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user