2021-12-05 17:54:36 +00:00
|
|
|
#pragma once
|
|
|
|
#include "CppScripts.h"
|
|
|
|
|
|
|
|
struct DigInfo {
|
|
|
|
LOT digLot; // The lot of the chest
|
|
|
|
LOT spawnLot; // Option lot of pet to spawn
|
|
|
|
int32_t requiredMission; // Optional mission required before pet can be spawned, if < 0 == don't use
|
|
|
|
bool specificPet; // This treasure requires a specific pet to be dug up
|
|
|
|
bool xBuild; // This treasure is retrieved from a buildable cross
|
|
|
|
bool bouncer; // This treasure spawns a bouncer
|
|
|
|
bool builderOnly; // Only the builder of this diggable may access the rewards, for example with crosses
|
|
|
|
};
|
|
|
|
|
|
|
|
class PetDigServer : public CppScripts::Script
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void OnStartup(Entity* self) override;
|
|
|
|
void OnDie(Entity* self, Entity* killer) override;
|
|
|
|
|
2024-11-18 02:48:48 +00:00
|
|
|
static Entity* GetClosestTreasure(NiPoint3 position);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
private:
|
2022-02-05 12:19:25 +00:00
|
|
|
static void ProgressPetDigMissions(const Entity* owner, const Entity* chest);
|
2021-12-05 17:54:36 +00:00
|
|
|
static void SpawnPet(Entity* self, const Entity* owner, DigInfo digInfo);
|
|
|
|
static void HandleXBuildDig(const Entity* self, Entity* owner, Entity* pet);
|
|
|
|
static void HandleBouncerDig(const Entity* self, const Entity* owner);
|
|
|
|
static std::vector<LWOOBJID> treasures;
|
|
|
|
static const DigInfo defaultDigInfo;
|
|
|
|
static const std::map<LOT, DigInfo> digInfoMap;
|
|
|
|
};
|