feat: use more zoneTable options (#1273)

* feat: use more zoneTable options

Allow setting framrate for the zone
Allow setting if pets are allowed in the zone
Allow setting if mounts are allowed in a zone
Allow disabling saving location to a zone

* address feedback
This commit is contained in:
Aaron Kimbrell
2023-11-14 07:02:17 -06:00
committed by GitHub
parent 79ff6e7ee4
commit 8a9883c224
8 changed files with 56 additions and 18 deletions

View File

@@ -19,6 +19,8 @@
#include "eObjectBits.h"
#include "eReplicaComponentType.h"
#include "eUseItemResponse.h"
#include "dZoneManager.h"
#include "ChatPackets.h"
#include "CDBrickIDTableTable.h"
#include "CDObjectSkillsTable.h"
@@ -292,12 +294,19 @@ void Item::UseNonEquip(Item* item) {
const auto type = static_cast<eItemType>(info->itemType);
if (type == eItemType::MOUNT) {
playerInventoryComponent->HandlePossession(this);
// TODO Check if mounts are allowed to be spawned
} else if (type == eItemType::PET_INVENTORY_ITEM && subKey != LWOOBJID_EMPTY) {
const auto& databasePet = playerInventoryComponent->GetDatabasePet(subKey);
if (databasePet.lot != LOT_NULL) {
playerInventoryComponent->SpawnPet(this);
if (Game::zoneManager->GetMountsAllowed()){
playerInventoryComponent->HandlePossession(this);
} else {
ChatPackets::SendSystemMessage(playerEntity->GetSystemAddress(), u"Mounts are not allowed in this zone");
}
} else if (type == eItemType::PET_INVENTORY_ITEM && subKey != LWOOBJID_EMPTY ) {
if (Game::zoneManager->GetPetsAllowed()){
const auto& databasePet = playerInventoryComponent->GetDatabasePet(subKey);
if (databasePet.lot != LOT_NULL) {
playerInventoryComponent->SpawnPet(this);
}
} else {
ChatPackets::SendSystemMessage(playerEntity->GetSystemAddress(), u"Pets are not allowed in this zone");
}
// This precondition response is taken care of in SpawnPet().
} else {