chests no longer show as corpses to client in DoF, kept consistency in AoM. Disabled ability for a chest to drop from an existing chest when using GM kill command

This commit is contained in:
Emagi 2023-05-24 09:26:54 -04:00
parent c49802616e
commit a9b68f5c53
2 changed files with 10 additions and 0 deletions

View file

@ -43,6 +43,10 @@ NPC* Entity::DropChest() {
if (rule_manager.GetGlobalRule(R_World, TreasureChestDisabled)->GetBool())
return 0;
if(GetChestDropTime()) {
return 0; // this is a chest! It doesn't drop itself!
}
NPC* chest = 0;
chest = new NPC();
@ -52,6 +56,8 @@ NPC* Entity::DropChest() {
chest->SetTargetable(1);
chest->SetLevel(GetLevel());
chest->SetChestDropTime();
chest->SetTotalHP(100);
chest->SetHP(100);
chest->SetAlive(false);
// Set the brain to a blank brain so it does nothing
chest->SetBrain(new BlankBrain(chest));

View file

@ -2608,6 +2608,10 @@ void Spawn::InitializeInfoPacketData(Player* spawn, PacketStruct* packet) {
if (!Alive() && GetTotalHP() > 0 && !IsObject() && !IsGroundSpawn())
temp_activity_status = 1;
if(version >= 1188 && GetChestDropTime()) {
temp_activity_status = 0;
}
temp_activity_status += (IsNPC() || IsObject() || IsGroundSpawn()) ? 1 << 1 : 0;
if (version >= 1188) {
// Fix widget or sign having 'Play Legends of Norrath' or 'Tell' options in right click (client hard-coded entity commands)