Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //////////////////////////////////////////////////////////////////////
- // OpenTibia - an opensource roleplaying game
- //////////////////////////////////////////////////////////////////////
- // class which takes care of all data which must get saved in the player
- //////////////////////////////////////////////////////////////////////
- // This program is free software; you can redistribute it and/or
- // modify it under the terms of the GNU General Public License
- // as published by the Free Software Foundation; either version 2
- // of the License, or (at your option) any later version.
- //
- // This program is distributed in the hope that it will be useful,
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- // GNU General Public License for more details.
- //
- // You should have received a copy of the GNU General Public License
- // along with this program; if not, write to the Free Software Foundation,
- // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- //////////////////////////////////////////////////////////////////////
- #ifndef __LUASCRIPT_H__
- #define __LUASCRIPT_H__
- #include <string>
- extern "C"
- {
- #include <lua.h>
- #include <lauxlib.h>
- #include <lualib.h>
- }
- #include "patch.h"
- extern "C" struct lua_State;
- #ifdef YUR_HIGH_LEVELS
- typedef __int64 exp_t;
- #else
- typedef uint32_t exp_t;
- #endif //YUR_HIGH_LEVELS
- class LuaScript
- {
- public:
- LuaScript();
- ~LuaScript();
- int TRAINING_TICKS;
- int REWRITE_TICKS;
- int KNIGHT_LOOSE;
- #ifdef ZS_SWORDS
- int32_t MANA_P_MB;
- int32_t MANA_F_MB;
- int32_t MANA_E_MB;
- int32_t MANA_P_MAUL;
- int32_t MANA_F_MAUL;
- int32_t MANA_E_MAUL;
- int32_t MANA_P_HEAD;
- int32_t MANA_F_HEAD;
- int32_t MANA_E_HEAD;
- int32_t MANA_HAIK_AXE;
- int32_t MANA_BLETKA_AXE;
- int32_t RANGE_P_MB;
- int32_t RANGE_F_MB;
- int32_t RANGE_E_MB;
- int32_t RANGE_P_MAUL;
- int32_t RANGE_F_MAUL;
- int32_t RANGE_E_MAUL;
- int32_t RANGE_P_HEAD;
- int32_t RANGE_F_HEAD;
- int32_t RANGE_E_HEAD;
- int32_t RANGE_HAIK_AXE;
- int32_t RANGE_BLETKA_AXE;
- #endif //ZS_SWORDS
- int32_t SOFT_MANA;
- int32_t SOFT_HEALTH;
- int32_t LR_MANA;
- int32_t LR_HEALTH;
- int32_t ROH_MANA;
- int32_t ROH_HEALTH;
- int32_t ROAH_MANA;
- int32_t ROAH_HEALTH;
- int32_t DROP_RATE;
- int32_t RESP_RATE;
- double FULLATTACK;
- double A_BALANCED;
- double A_FULL_DEFENSE;
- long PZ_LOCKED;
- int32_t ONEPERACC;
- #ifdef HUCZU_SKULLS
- int32_t WHITE_TIME;
- int32_t RED_TIME;
- int32_t FRAG_TIME;
- int32_t RED_UNJUST;
- int32_t BAN_UNJUST;
- #endif //HUCZU_SKULLS
- double NO_VOC_SPEED;
- double SORC_SPEED;
- double DRUID_SPEED;
- double PALLY_SPEED;
- double KNIGHT_SPEED;
- bool ADVANCE_ANI;
- bool EFFECT_ATACK;
- bool TRADE_LVL;
- bool SUMMON_BODIES;
- bool EXTRA_MSG_DEAD;
- bool MSG_DEAD;
- #ifdef HUCZU_FIX
- int32_t MAYA_POS_X,MAYA_POS_Y,MAYA_POS_Z;
- int32_t ANTALIS_POS_X,ANTALIS_POS_Y,ANTALIS_POS_Z;
- int32_t FARSON_POS_X,FARSON_POS_Y,FARSON_POS_Z;
- int32_t THA_POS_X,THA_POS_Y,THA_POS_Z;
- int32_t THM_POS_X,THM_POS_Y,THM_POS_Z;
- int32_t TOMB_POS_X,TOMB_POS_Y,TOMB_POS_Z;
- int32_t DLA_POS_X,DLA_POS_Y,DLA_POS_Z;
- int32_t DLM_POS_X,DLM_POS_Y,DLM_POS_Z;
- int32_t ROOK_POS_X,ROOK_POS_Y,ROOK_POS_Z;
- int32_t SCHIVA_POS_X,SCHIVA_POS_Y,SCHIVA_POS_Z;
- int32_t BEHE_POS_X,BEHE_POS_Y,BEHE_POS_Z;
- int32_t THS_POS_X,THS_POS_Y,THS_POS_Z;
- int32_t MADMAN_POS_X,MADMAN_POS_Y,MADMAN_POS_Z;
- int32_t DMJ_POS_X,DMJ_POS_Y,DMJ_POS_Z;
- int32_t DMA_POS_X,DMA_POS_Y,DMA_POS_Z;
- int32_t THF_POS_X,THF_POS_Y,THF_POS_Z;
- int32_t TEST_POS_X,TEST_POS_Y,TEST_POS_Z;
- int32_t JAMAICA_POS_X,JAMAICA_POS_Y,JAMAICA_POS_Z;
- #endif //HUCZU_FIX
- #ifdef UCB_LVL_EXP
- int32_t STG_1_LVL;
- exp_t STG_1_LVL_X;
- exp_t STG_2_LVL_X;
- #endif // UCB_LVL_EXP
- #ifdef YUR_MULTIPLIERS
- exp_t EXP_ROOK;
- exp_t EXP_MUL;
- exp_t EXP_MUL_PVP;
- int32_t HEALTH_TICK_MUL;
- int32_t MANA_TICK_MUL;
- int32_t ROHHEALTH;
- int32_t ROHMANA;
- int32_t ROAHHEALTH;
- int32_t ROAHMANA;
- int32_t LIFERINGHEALTH;
- int32_t LIFERINGMANA;
- int32_t CAP_GAIN[5];
- int32_t MANA_GAIN[5];
- int32_t HP_GAIN[5];
- int32_t WEAPON_MUL[5];
- int32_t SHIELD_MUL[5];
- int32_t DIST_MUL[5];
- int32_t MANA_MUL[5];
- #endif //YUR_MULTIPLIERS
- #ifdef TR_ANTI_AFK
- int32_t KICK_TIME;
- #endif //TR_ANTI_AFK
- #ifdef YUR_LEARN_SPELLS
- bool LEARN_SPELLS;
- #endif //YUR_LEARN_SPELLS
- #ifdef TLM_HOUSE_SYSTEM
- int32_t ACCESS_HOUSE;
- int32_t MAX_HOUSE_TILE_ITEMS;
- #endif //TLM_HOUSE_SYSTEM
- #ifdef TR_SUMMONS
- bool SUMMONS_ALL_VOC;
- size_t MAX_SUMMONS;
- #endif //TR_SUMMONS
- int SHOP_SYSTEM_CONTAINER;
- #ifdef SD_BURST_ARROW
- double KNIGHT_BURST_DMG_LVL;
- double KNIGHT_BURST_DMG_MLVL;
- double KNIGHT_BURST_DMG_LO;
- double KNIGHT_BURST_DMG_HI;
- double PALADIN_BURST_DMG_LVL;
- double PALADIN_BURST_DMG_MLVL;
- double PALADIN_BURST_DMG_LO;
- double PALADIN_BURST_DMG_HI;
- double DRUID_BURST_DMG_LVL;
- double DRUID_BURST_DMG_MLVL;
- double DRUID_BURST_DMG_LO;
- double DRUID_BURST_DMG_HI;
- double SORCERER_BURST_DMG_LVL;
- double SORCERER_BURST_DMG_MLVL;
- double SORCERER_BURST_DMG_LO;
- double SORCERER_BURST_DMG_HI;
- #endif //SD_BURST_ARROW
- #ifdef YUR_CONFIG_CAP
- bool CAP_SYSTEM;
- #endif //YUR_CONFIG_CAP
- #ifdef HUCZU_AUTORESTART
- int32_t AUTO_RESTART;
- #endif
- int32_t SPEAR_LOSE_CHANCE;
- #ifdef YUR_PREMIUM_PROMOTION
- bool FREE_PREMMY;
- bool QUEUE_PREMMY;
- #endif //YUR_PREMIUM_PROMOTION
- #ifdef YUR_CVS_MODS
- std::string VOCATIONS[5];
- std::string PROMOTED_VOCATIONS[5];
- int32_t DIE_PERCENT_EXP;
- int32_t DIE_PERCENT_MANA;
- int32_t DIE_PERCENT_SKILL;
- int32_t DIE_PERCENT_EQ;
- int32_t DIE_PERCENT_BP;
- int32_t DIE_BLESS_1;
- int32_t DIE_BLESS_2;
- int32_t DIE_BLESS_3;
- int32_t DIE_BLESS_4;
- int32_t DIE_BLESS_5;
- int32_t DIE_BLESS_1_PROMOTION;
- int32_t DIE_BLESS_2_PROMOTION;
- int32_t DIE_BLESS_3_PROMOTION;
- int32_t DIE_BLESS_4_PROMOTION;
- int32_t DIE_BLESS_5_PROMOTION;
- long EXHAUSTED;
- long EXHAUSTED_ADD;
- long EXHAUSTED_HEAL;
- int32_t ACCESS_PROTECT;
- int32_t ACCESS_REMOTE;
- int32_t ACCESS_TALK;
- int32_t ACCESS_ENTER;
- int32_t ACCESS_LOOK;
- int32_t MAX_DEPOT_ITEMS;
- std::string DATA_DIR;
- #endif //YUR_CVS_MODS
- #ifdef JD_DEATH_LIST
- size_t MAX_DEATH_ENTRIES;
- #endif //JD_DEATH_LIST
- #ifdef JD_WANDS
- int32_t ITEM_MDOWNHELMET;
- int32_t ITEM_MDOWNARMOR;
- int32_t ITEM_MDOWNLEGS;
- int32_t ITEM_MDOWNBOOTS;
- int32_t ITEM_MDOWNAMU;
- int32_t ITEM_MDOWNRING;
- int32_t MGITEMHELMET;
- int32_t MGITEMARMOR;
- int32_t MGITEMLEGS;
- int32_t MGITEMBOOTS;
- int32_t MGITEMAMU;
- int32_t MGITEMRINGS;
- bool MGITEMS;
- bool SKILLNUMBER;
- #endif //JD_WANDS
- int32_t ROOK_TEMPLE_X;
- int32_t ROOK_TEMPLE_Y;
- int32_t ROOK_TEMPLE_Z;
- int32_t OpenFile(const char* file);
- int32_t getField (const char *key);
- void setField (const char *index, int32_t value);
- //static version
- static int32_t getField (lua_State *L , const char *key);
- static void setField (lua_State *L, const char *index, int32_t val);
- // get a global string
- std::string getGlobalString(std::string var, const std::string &defString = "");
- int32_t getGlobalNumber(std::string var, const int32_t defNum = 0);
- std::string getGlobalStringField (std::string var, const int32_t key, const std::string &defString = "");
- // set a var to a val
- int32_t setGlobalString(std::string var, std::string val);
- int32_t setGlobalNumber(std::string var, int32_t val);
- protected:
- std::string luaFile; // the file we represent
- lua_State* luaState; // our lua state
- };
- #endif // #ifndef __LUASCRIPT_H__
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement