mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 09:31:30 +00:00
Add show_name and untargetable to npc_types fixes #637
Note the bodytype hack is still there since I was having issues with some npcs still showing names
This commit is contained in:
parent
20b6c2f556
commit
ec77e3a6fd
@ -305,6 +305,7 @@ union
|
|||||||
uint8 DestructibleUnk8;
|
uint8 DestructibleUnk8;
|
||||||
uint32 DestructibleUnk9;
|
uint32 DestructibleUnk9;
|
||||||
bool targetable_with_hotkey;
|
bool targetable_with_hotkey;
|
||||||
|
bool show_name;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -3930,7 +3930,7 @@ namespace RoF
|
|||||||
if (strlen(emu->suffix))
|
if (strlen(emu->suffix))
|
||||||
PacketSize += strlen(emu->suffix) + 1;
|
PacketSize += strlen(emu->suffix) + 1;
|
||||||
|
|
||||||
bool ShowName = 1;
|
bool ShowName = emu->show_name;
|
||||||
if (emu->bodytype >= 66)
|
if (emu->bodytype >= 66)
|
||||||
{
|
{
|
||||||
emu->race = 127;
|
emu->race = 127;
|
||||||
|
|||||||
@ -4086,7 +4086,7 @@ namespace RoF2
|
|||||||
PacketSize += strlen(emu->DestructibleString) + 1;
|
PacketSize += strlen(emu->DestructibleString) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ShowName = 1;
|
bool ShowName = emu->show_name;
|
||||||
if (emu->bodytype >= 66)
|
if (emu->bodytype >= 66)
|
||||||
{
|
{
|
||||||
emu->race = 127;
|
emu->race = 127;
|
||||||
|
|||||||
@ -2560,7 +2560,7 @@ namespace SoD
|
|||||||
PacketSize += strlen(emu->DestructibleString) + 1;
|
PacketSize += strlen(emu->DestructibleString) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ShowName = 1;
|
bool ShowName = emu->show_name;
|
||||||
if (emu->bodytype >= 66)
|
if (emu->bodytype >= 66)
|
||||||
{
|
{
|
||||||
emu->race = 127;
|
emu->race = 127;
|
||||||
|
|||||||
@ -2097,7 +2097,7 @@ namespace SoF
|
|||||||
int k;
|
int k;
|
||||||
for (r = 0; r < entrycount; r++, eq++, emu++) {
|
for (r = 0; r < entrycount; r++, eq++, emu++) {
|
||||||
|
|
||||||
eq->showname = 1; //New Field - Toggles Name Display on or off - 0 = off, 1 = on
|
eq->showname = emu->show_name ? 1 : 0; //New Field - Toggles Name Display on or off - 0 = off, 1 = on
|
||||||
eq->linkdead = 0; //New Field - Toggles LD on or off after name - 0 = off, 1 = on
|
eq->linkdead = 0; //New Field - Toggles LD on or off after name - 0 = off, 1 = on
|
||||||
eq->statue = 0; //New Field - 1 freezes animation
|
eq->statue = 0; //New Field - 1 freezes animation
|
||||||
eq->showhelm = emu->showhelm;
|
eq->showhelm = emu->showhelm;
|
||||||
@ -2136,10 +2136,10 @@ namespace SoF
|
|||||||
eq->findable = emu->findable;
|
eq->findable = emu->findable;
|
||||||
if (emu->bodytype >= 66)
|
if (emu->bodytype >= 66)
|
||||||
{
|
{
|
||||||
eq->bodytype = 11; //non-targetable
|
eq->bodytype = 11; //non-targetable
|
||||||
eq->showname = 0; //no visible name
|
eq->showname = 0; //no visible name
|
||||||
eq->race = 127; //invisible man
|
eq->race = 127; //invisible man
|
||||||
eq->gender = 0; //invisible men are gender 0
|
eq->gender = 0; //invisible men are gender 0
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2844,7 +2844,7 @@ namespace UF
|
|||||||
PacketSize += strlen(emu->DestructibleString) + 1;
|
PacketSize += strlen(emu->DestructibleString) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ShowName = 1;
|
bool ShowName = emu->show_name;
|
||||||
if (emu->bodytype >= 66)
|
if (emu->bodytype >= 66)
|
||||||
{
|
{
|
||||||
emu->race = 127;
|
emu->race = 127;
|
||||||
|
|||||||
3
utils/sql/git/required/2017_07_19_show_name.sql
Normal file
3
utils/sql/git/required/2017_07_19_show_name.sql
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
ALTER TABLE `npc_types` ADD COLUMN `show_name` TINYINT(2) NOT NULL DEFAULT 1;
|
||||||
|
ALTER TABLE `npc_types` ADD COLUMN `untargetable` TINYINT(2) NOT NULL DEFAULT 0;
|
||||||
|
UPDATE `npc_types` SET `show_name` = 0, `untargetable` = 1 WHERE `bodytype` >= 66;
|
||||||
@ -1944,6 +1944,7 @@ void Client::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
|
|||||||
ns->spawn.guildID = GuildID();
|
ns->spawn.guildID = GuildID();
|
||||||
// ns->spawn.linkdead = IsLD() ? 1 : 0;
|
// ns->spawn.linkdead = IsLD() ? 1 : 0;
|
||||||
// ns->spawn.pvp = GetPVP() ? 1 : 0;
|
// ns->spawn.pvp = GetPVP() ? 1 : 0;
|
||||||
|
ns->spawn.show_name = true;
|
||||||
|
|
||||||
|
|
||||||
strcpy(ns->spawn.title, m_pp.title);
|
strcpy(ns->spawn.title, m_pp.title);
|
||||||
|
|||||||
@ -659,6 +659,8 @@ void EntityList::AddNPC(NPC *npc, bool SendSpawnPacket, bool dontqueue)
|
|||||||
QueueClients(npc, app);
|
QueueClients(npc, app);
|
||||||
npc->SendArmorAppearance();
|
npc->SendArmorAppearance();
|
||||||
npc->SetAppearance(npc->GetGuardPointAnim(),false);
|
npc->SetAppearance(npc->GetGuardPointAnim(),false);
|
||||||
|
if (!npc->IsTargetable())
|
||||||
|
npc->SendTargetable(false);
|
||||||
safe_delete(app);
|
safe_delete(app);
|
||||||
} else {
|
} else {
|
||||||
auto ns = new NewSpawn_Struct;
|
auto ns = new NewSpawn_Struct;
|
||||||
@ -799,6 +801,8 @@ void EntityList::CheckSpawnQueue()
|
|||||||
NPC *pnpc = it->second;
|
NPC *pnpc = it->second;
|
||||||
pnpc->SendArmorAppearance();
|
pnpc->SendArmorAppearance();
|
||||||
pnpc->SetAppearance(pnpc->GetGuardPointAnim(), false);
|
pnpc->SetAppearance(pnpc->GetGuardPointAnim(), false);
|
||||||
|
if (!pnpc->IsTargetable())
|
||||||
|
pnpc->SendTargetable(false);
|
||||||
}
|
}
|
||||||
safe_delete(outapp);
|
safe_delete(outapp);
|
||||||
iterator.RemoveCurrent();
|
iterator.RemoveCurrent();
|
||||||
|
|||||||
@ -375,6 +375,7 @@ NPC::NPC(const NPCType* d, Spawn2* in_respawn, const glm::vec4& position, int if
|
|||||||
CalcBonuses();
|
CalcBonuses();
|
||||||
raid_target = d->raid_target;
|
raid_target = d->raid_target;
|
||||||
ignore_despawn = d->ignore_despawn;
|
ignore_despawn = d->ignore_despawn;
|
||||||
|
m_targetable = !d->untargetable;
|
||||||
}
|
}
|
||||||
|
|
||||||
NPC::~NPC()
|
NPC::~NPC()
|
||||||
@ -1906,6 +1907,7 @@ void NPC::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
|
|||||||
ns->spawn.is_npc = 1;
|
ns->spawn.is_npc = 1;
|
||||||
UpdateActiveLight();
|
UpdateActiveLight();
|
||||||
ns->spawn.light = GetActiveLightType();
|
ns->spawn.light = GetActiveLightType();
|
||||||
|
ns->spawn.show_name = NPCTypedata->show_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NPC::PetOnSpawn(NewSpawn_Struct* ns)
|
void NPC::PetOnSpawn(NewSpawn_Struct* ns)
|
||||||
|
|||||||
@ -1967,7 +1967,9 @@ const NPCType* ZoneDatabase::LoadNPCTypesData(uint32 npc_type_id, bool bulk_load
|
|||||||
"npc_types.handtexture, "
|
"npc_types.handtexture, "
|
||||||
"npc_types.legtexture, "
|
"npc_types.legtexture, "
|
||||||
"npc_types.feettexture, "
|
"npc_types.feettexture, "
|
||||||
"npc_types.ignore_despawn "
|
"npc_types.ignore_despawn, "
|
||||||
|
"npc_types.show_name, "
|
||||||
|
"npc_types.untargetable "
|
||||||
"FROM npc_types %s",
|
"FROM npc_types %s",
|
||||||
where_condition.c_str()
|
where_condition.c_str()
|
||||||
);
|
);
|
||||||
@ -2143,6 +2145,8 @@ const NPCType* ZoneDatabase::LoadNPCTypesData(uint32 npc_type_id, bool bulk_load
|
|||||||
temp_npctype_data->legtexture = atoi(row[95]);
|
temp_npctype_data->legtexture = atoi(row[95]);
|
||||||
temp_npctype_data->feettexture = atoi(row[96]);
|
temp_npctype_data->feettexture = atoi(row[96]);
|
||||||
temp_npctype_data->ignore_despawn = atoi(row[97]) == 1 ? true : false;
|
temp_npctype_data->ignore_despawn = atoi(row[97]) == 1 ? true : false;
|
||||||
|
temp_npctype_data->show_name = atoi(row[98]) != 0 ? true : false;
|
||||||
|
temp_npctype_data->untargetable = atoi(row[99]) != 0 ? true : false;
|
||||||
|
|
||||||
// If NPC with duplicate NPC id already in table,
|
// If NPC with duplicate NPC id already in table,
|
||||||
// free item we attempted to add.
|
// free item we attempted to add.
|
||||||
|
|||||||
@ -133,6 +133,8 @@ struct NPCType
|
|||||||
uint8 legtexture;
|
uint8 legtexture;
|
||||||
uint8 feettexture;
|
uint8 feettexture;
|
||||||
bool ignore_despawn;
|
bool ignore_despawn;
|
||||||
|
bool show_name; // should default on
|
||||||
|
bool untargetable;
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace player_lootitem {
|
namespace player_lootitem {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user