mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-12-26 05:30:05 +00:00
[refactor] E g g s
This commit is contained in:
@@ -33,33 +33,11 @@ struct WarpLocation {
|
||||
int x, y, z, instanceID, isInstance, limitTaskID, npcID;
|
||||
};
|
||||
|
||||
struct Egg : public BaseNPC {
|
||||
bool summoned;
|
||||
bool dead = false;
|
||||
time_t deadUntil;
|
||||
|
||||
Egg(int x, int y, int z, uint64_t iID, int type, int32_t id, bool summon)
|
||||
: BaseNPC(x, y, z, 0, iID, type, id) {
|
||||
summoned = summon;
|
||||
npcClass = NPCClass::NPC_EGG;
|
||||
}
|
||||
};
|
||||
|
||||
struct EggType {
|
||||
int dropCrateId;
|
||||
int effectId;
|
||||
int duration;
|
||||
int regen;
|
||||
};
|
||||
|
||||
namespace NPCManager {
|
||||
extern std::map<int32_t, BaseNPC*> NPCs;
|
||||
extern std::map<int32_t, WarpLocation> Warps;
|
||||
extern std::vector<WarpLocation> RespawnPoints;
|
||||
extern std::vector<NPCEvent> NPCEvents;
|
||||
extern std::unordered_map<int, Egg*> Eggs;
|
||||
extern std::map<std::pair<CNSocket*, int32_t>, time_t> EggBuffs;
|
||||
extern std::unordered_map<int, EggType> EggTypes;
|
||||
extern nlohmann::json NPCData;
|
||||
extern int32_t nextId;
|
||||
void init();
|
||||
@@ -72,8 +50,4 @@ namespace NPCManager {
|
||||
BaseNPC *summonNPC(int x, int y, int z, uint64_t instance, int type, bool respawn=false, bool baseInstance=false);
|
||||
|
||||
BaseNPC* getNearestNPC(std::set<Chunk*>* chunks, int X, int Y, int Z);
|
||||
|
||||
/// returns -1 on fail
|
||||
int eggBuffPlayer(CNSocket* sock, int skillId, int eggId, int duration);
|
||||
void npcDataToEggData(sNPCAppearanceData* npc, sShinyAppearanceData* egg);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user