load imagination costs for pet abilities from CDClient

This commit is contained in:
jadebenn
2024-04-18 23:31:27 -05:00
parent 0b4d7b6d92
commit 36e0dbdb5e
8 changed files with 102 additions and 22 deletions

View File

@@ -2,6 +2,7 @@
#include "GameMessages.h"
#include "BrickDatabase.h"
#include "CDClientDatabase.h"
#include "CDPetAbilitiesTable.h"
#include "CDPetComponentTable.h"
#include "ChatPackets.h"
#include "EntityManager.h"
@@ -911,7 +912,9 @@ void PetComponent::StartInteractBouncer() {
if (!destroyableComponent) return;
auto imagination = destroyableComponent->GetImagination();
const int32_t imaginationCost = 2; // TODO: Get rid of this magic number - make static variable from lookup
const auto imaginationCost =
CDClientManager::GetTable<CDPetAbilitiesTable>()->GetByID(ePetAbilityType::JumpOnObject).imaginationCost;
if (imagination < imaginationCost) {
//GameMessages::SendHelp(user->GetObjectID(), eHelpType::PR_NEED_IMAGINATION, user->GetSystemAddress()); // Check if right message!
return;
@@ -989,7 +992,9 @@ void PetComponent::StartInteractTreasureDig() {
if (!destroyableComponent) return;
auto imagination = destroyableComponent->GetImagination();
const int32_t imaginationCost = 1; // TODO: Get rid of this magic number - make static variable from lookup
const auto imaginationCost =
CDClientManager::GetTable<CDPetAbilitiesTable>()->GetByID(ePetAbilityType::DigAtPosition).imaginationCost;
if (imagination < imaginationCost) {
//GameMessages::SendHelp(user->GetObjectID(), eHelpType::PR_NEED_IMAGINATION, user->GetSystemAddress()); // Check if right message!
return;