#pragma once #include "servers/CNShardServer.hpp" #include "Player.hpp" #include "MobAI.hpp" struct CrocPotEntry { int multStats, multLooks; float base, rd0, rd1, rd2, rd3; }; struct Crate { int itemSetChanceId; int itemSetTypeId; int rarityWeightId; }; struct CrateDropChance { int dropChance, dropChanceTotal; std::vector crateWeights; }; struct MiscDropChance { int potionDropChance, potionDropChanceTotal; int boostDropChance, boostDropChanceTotal; int taroDropChance, taroDropChanceTotal; int fmDropChance, fmDropChanceTotal; }; struct MiscDropType { int potionAmount; int boostAmount; int taroAmount; int fmAmount; }; struct MobDrop { int crateDropChanceId; int crateDropTypeId; int miscDropChanceId; int miscDropTypeId; }; struct ItemSetType { bool ignoreGender; std::vector droppableItemIds; }; struct ItemSetChance { int defaultItemWeight; std::map specialItemWeights; }; struct DroppableItem { int itemId; int rarity; int type; }; namespace Items { enum class SlotType { EQUIP = 0, INVENTORY = 1, BANK = 3 }; struct Item { bool tradeable, sellable; int buyPrice, sellPrice; int stackSize, level, rarity; int pointDamage, groupDamage, fireRate, defense, gender; int weaponType; // TODO: implement more as needed }; // hopefully this is fine since it's never modified after load extern std::map, Item> ItemData; // -> data extern std::map CrocPotTable; // level gap -> entry extern std::map> RarityWeights; extern std::map Crates; extern std::map DroppableItems; extern std::map>> CodeItems; // code -> vector of // mob drops extern std::map CrateDropChances; extern std::map> CrateDropTypes; extern std::map MiscDropChances; extern std::map MiscDropTypes; extern std::map MobDrops; extern std::map ItemSetTypes; extern std::map ItemSetChances; void init(); // mob drops void giveMobDrop(CNSocket *sock, Mob *mob, int rolledBoosts, int rolledPotions, int rolledCrate, int rolledCrateType, int rolledEvent); int findFreeSlot(Player *plr); Item* getItemData(int32_t id, int32_t type); void checkItemExpire(CNSocket* sock, Player* player); void setItemStats(Player* plr); void updateEquips(CNSocket* sock, Player* plr); #ifdef ACADEMY extern std::map NanoCapsules; // crate id -> nano id #endif }