Advertisement
Guest User

Untitled

a guest
Mar 28th, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.76 KB | None | 0 0
  1. //////////////////////////////////////////////////////////////////////
  2. // OpenTibia - an opensource roleplaying game
  3. //////////////////////////////////////////////////////////////////////
  4. // class which takes care of all data which must get saved in the player
  5. //////////////////////////////////////////////////////////////////////
  6. // This program is free software; you can redistribute it and/or
  7. // modify it under the terms of the GNU General Public License
  8. // as published by the Free Software Foundation; either version 2
  9. // of the License, or (at your option) any later version.
  10. //
  11. // This program is distributed in the hope that it will be useful,
  12. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. // GNU General Public License for more details.
  15. //
  16. // You should have received a copy of the GNU General Public License
  17. // along with this program; if not, write to the Free Software Foundation,
  18. // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  19. //////////////////////////////////////////////////////////////////////
  20.  
  21.  
  22. #ifndef __LUASCRIPT_H__
  23. #define __LUASCRIPT_H__
  24.  
  25. #include <string>
  26. extern "C"
  27. {
  28. #include <lua.h>
  29. #include <lauxlib.h>
  30. #include <lualib.h>
  31. }
  32.  
  33. #include "patch.h"
  34. extern "C" struct lua_State;
  35.  
  36.  
  37. #ifdef YUR_HIGH_LEVELS
  38. typedef __int64 exp_t;
  39. #else
  40. typedef uint32_t exp_t;
  41. #endif //YUR_HIGH_LEVELS
  42.  
  43. class LuaScript
  44. {
  45. public:
  46. LuaScript();
  47. ~LuaScript();
  48. int TRAINING_TICKS;
  49. int REWRITE_TICKS;
  50.  
  51. int KNIGHT_LOOSE;
  52.  
  53. #ifdef ZS_SWORDS
  54. int32_t MANA_P_MB;
  55. int32_t MANA_F_MB;
  56. int32_t MANA_E_MB;
  57. int32_t MANA_P_MAUL;
  58. int32_t MANA_F_MAUL;
  59. int32_t MANA_E_MAUL;
  60. int32_t MANA_P_HEAD;
  61. int32_t MANA_F_HEAD;
  62. int32_t MANA_E_HEAD;
  63. int32_t MANA_HAIK_AXE;
  64. int32_t MANA_BLETKA_AXE;
  65.  
  66. int32_t RANGE_P_MB;
  67. int32_t RANGE_F_MB;
  68. int32_t RANGE_E_MB;
  69. int32_t RANGE_P_MAUL;
  70. int32_t RANGE_F_MAUL;
  71. int32_t RANGE_E_MAUL;
  72. int32_t RANGE_P_HEAD;
  73. int32_t RANGE_F_HEAD;
  74. int32_t RANGE_E_HEAD;
  75. int32_t RANGE_HAIK_AXE;
  76. int32_t RANGE_BLETKA_AXE;
  77. #endif //ZS_SWORDS
  78.  
  79. int32_t SOFT_MANA;
  80. int32_t SOFT_HEALTH;
  81. int32_t LR_MANA;
  82. int32_t LR_HEALTH;
  83. int32_t ROH_MANA;
  84. int32_t ROH_HEALTH;
  85. int32_t ROAH_MANA;
  86. int32_t ROAH_HEALTH;
  87. int32_t DROP_RATE;
  88. int32_t RESP_RATE;
  89.  
  90. double FULLATTACK;
  91. double A_BALANCED;
  92. double A_FULL_DEFENSE;
  93.  
  94. long PZ_LOCKED;
  95. int32_t ONEPERACC;
  96.  
  97. #ifdef HUCZU_SKULLS
  98. int32_t WHITE_TIME;
  99. int32_t RED_TIME;
  100. int32_t FRAG_TIME;
  101. int32_t RED_UNJUST;
  102. int32_t BAN_UNJUST;
  103. #endif //HUCZU_SKULLS
  104.  
  105.  
  106. double NO_VOC_SPEED;
  107. double SORC_SPEED;
  108. double DRUID_SPEED;
  109. double PALLY_SPEED;
  110. double KNIGHT_SPEED;
  111. bool ADVANCE_ANI;
  112. bool EFFECT_ATACK;
  113. bool TRADE_LVL;
  114. bool SUMMON_BODIES;
  115. bool EXTRA_MSG_DEAD;
  116. bool MSG_DEAD;
  117.  
  118. #ifdef HUCZU_FIX
  119. int32_t MAYA_POS_X,MAYA_POS_Y,MAYA_POS_Z;
  120. int32_t ANTALIS_POS_X,ANTALIS_POS_Y,ANTALIS_POS_Z;
  121. int32_t FARSON_POS_X,FARSON_POS_Y,FARSON_POS_Z;
  122. int32_t THA_POS_X,THA_POS_Y,THA_POS_Z;
  123. int32_t THM_POS_X,THM_POS_Y,THM_POS_Z;
  124. int32_t TOMB_POS_X,TOMB_POS_Y,TOMB_POS_Z;
  125. int32_t DLA_POS_X,DLA_POS_Y,DLA_POS_Z;
  126. int32_t DLM_POS_X,DLM_POS_Y,DLM_POS_Z;
  127. int32_t ROOK_POS_X,ROOK_POS_Y,ROOK_POS_Z;
  128. int32_t SCHIVA_POS_X,SCHIVA_POS_Y,SCHIVA_POS_Z;
  129. int32_t BEHE_POS_X,BEHE_POS_Y,BEHE_POS_Z;
  130. int32_t THS_POS_X,THS_POS_Y,THS_POS_Z;
  131. int32_t MADMAN_POS_X,MADMAN_POS_Y,MADMAN_POS_Z;
  132. int32_t DMJ_POS_X,DMJ_POS_Y,DMJ_POS_Z;
  133. int32_t DMA_POS_X,DMA_POS_Y,DMA_POS_Z;
  134. int32_t THF_POS_X,THF_POS_Y,THF_POS_Z;
  135. int32_t TEST_POS_X,TEST_POS_Y,TEST_POS_Z;
  136. int32_t JAMAICA_POS_X,JAMAICA_POS_Y,JAMAICA_POS_Z;
  137. #endif //HUCZU_FIX
  138.  
  139. #ifdef UCB_LVL_EXP
  140. int32_t STG_1_LVL;
  141. exp_t STG_1_LVL_X;
  142. exp_t STG_2_LVL_X;
  143. #endif // UCB_LVL_EXP
  144. #ifdef YUR_MULTIPLIERS
  145. exp_t EXP_ROOK;
  146. exp_t EXP_MUL;
  147. exp_t EXP_MUL_PVP;
  148. int32_t HEALTH_TICK_MUL;
  149. int32_t MANA_TICK_MUL;
  150. int32_t ROHHEALTH;
  151. int32_t ROHMANA;
  152. int32_t ROAHHEALTH;
  153. int32_t ROAHMANA;
  154. int32_t LIFERINGHEALTH;
  155. int32_t LIFERINGMANA;
  156. int32_t CAP_GAIN[5];
  157. int32_t MANA_GAIN[5];
  158. int32_t HP_GAIN[5];
  159. int32_t WEAPON_MUL[5];
  160. int32_t SHIELD_MUL[5];
  161. int32_t DIST_MUL[5];
  162. int32_t MANA_MUL[5];
  163. #endif //YUR_MULTIPLIERS
  164.  
  165. #ifdef TR_ANTI_AFK
  166. int32_t KICK_TIME;
  167. #endif //TR_ANTI_AFK
  168.  
  169. #ifdef YUR_LEARN_SPELLS
  170. bool LEARN_SPELLS;
  171. #endif //YUR_LEARN_SPELLS
  172.  
  173. #ifdef TLM_HOUSE_SYSTEM
  174. int32_t ACCESS_HOUSE;
  175. int32_t MAX_HOUSE_TILE_ITEMS;
  176. #endif //TLM_HOUSE_SYSTEM
  177.  
  178. #ifdef TR_SUMMONS
  179. bool SUMMONS_ALL_VOC;
  180. size_t MAX_SUMMONS;
  181. #endif //TR_SUMMONS
  182.  
  183. int SHOP_SYSTEM_CONTAINER;
  184.  
  185.  
  186. #ifdef SD_BURST_ARROW
  187. double KNIGHT_BURST_DMG_LVL;
  188. double KNIGHT_BURST_DMG_MLVL;
  189. double KNIGHT_BURST_DMG_LO;
  190. double KNIGHT_BURST_DMG_HI;
  191.  
  192. double PALADIN_BURST_DMG_LVL;
  193. double PALADIN_BURST_DMG_MLVL;
  194. double PALADIN_BURST_DMG_LO;
  195. double PALADIN_BURST_DMG_HI;
  196.  
  197. double DRUID_BURST_DMG_LVL;
  198. double DRUID_BURST_DMG_MLVL;
  199. double DRUID_BURST_DMG_LO;
  200. double DRUID_BURST_DMG_HI;
  201.  
  202. double SORCERER_BURST_DMG_LVL;
  203. double SORCERER_BURST_DMG_MLVL;
  204. double SORCERER_BURST_DMG_LO;
  205. double SORCERER_BURST_DMG_HI;
  206. #endif //SD_BURST_ARROW
  207.  
  208. #ifdef YUR_CONFIG_CAP
  209. bool CAP_SYSTEM;
  210. #endif //YUR_CONFIG_CAP
  211.  
  212.  
  213.  
  214. #ifdef HUCZU_AUTORESTART
  215. int32_t AUTO_RESTART;
  216. #endif
  217.  
  218. int32_t SPEAR_LOSE_CHANCE;
  219.  
  220. #ifdef YUR_PREMIUM_PROMOTION
  221. bool FREE_PREMMY;
  222. bool QUEUE_PREMMY;
  223. #endif //YUR_PREMIUM_PROMOTION
  224.  
  225. #ifdef YUR_CVS_MODS
  226. std::string VOCATIONS[5];
  227. std::string PROMOTED_VOCATIONS[5];
  228. int32_t DIE_PERCENT_EXP;
  229. int32_t DIE_PERCENT_MANA;
  230. int32_t DIE_PERCENT_SKILL;
  231. int32_t DIE_PERCENT_EQ;
  232. int32_t DIE_PERCENT_BP;
  233. int32_t DIE_BLESS_1;
  234. int32_t DIE_BLESS_2;
  235. int32_t DIE_BLESS_3;
  236. int32_t DIE_BLESS_4;
  237. int32_t DIE_BLESS_5;
  238. int32_t DIE_BLESS_1_PROMOTION;
  239. int32_t DIE_BLESS_2_PROMOTION;
  240. int32_t DIE_BLESS_3_PROMOTION;
  241. int32_t DIE_BLESS_4_PROMOTION;
  242. int32_t DIE_BLESS_5_PROMOTION;
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250. long EXHAUSTED;
  251. long EXHAUSTED_ADD;
  252. long EXHAUSTED_HEAL;
  253. int32_t ACCESS_PROTECT;
  254. int32_t ACCESS_REMOTE;
  255. int32_t ACCESS_TALK;
  256. int32_t ACCESS_ENTER;
  257. int32_t ACCESS_LOOK;
  258. int32_t MAX_DEPOT_ITEMS;
  259. std::string DATA_DIR;
  260. #endif //YUR_CVS_MODS
  261.  
  262. #ifdef JD_DEATH_LIST
  263. size_t MAX_DEATH_ENTRIES;
  264. #endif //JD_DEATH_LIST
  265.  
  266. #ifdef JD_WANDS
  267. int32_t ITEM_MDOWNHELMET;
  268. int32_t ITEM_MDOWNARMOR;
  269. int32_t ITEM_MDOWNLEGS;
  270. int32_t ITEM_MDOWNBOOTS;
  271. int32_t ITEM_MDOWNAMU;
  272. int32_t ITEM_MDOWNRING;
  273. int32_t MGITEMHELMET;
  274. int32_t MGITEMARMOR;
  275. int32_t MGITEMLEGS;
  276. int32_t MGITEMBOOTS;
  277. int32_t MGITEMAMU;
  278. int32_t MGITEMRINGS;
  279. bool MGITEMS;
  280. bool SKILLNUMBER;
  281. #endif //JD_WANDS
  282.  
  283. int32_t ROOK_TEMPLE_X;
  284. int32_t ROOK_TEMPLE_Y;
  285. int32_t ROOK_TEMPLE_Z;
  286.  
  287. int32_t OpenFile(const char* file);
  288. int32_t getField (const char *key);
  289. void setField (const char *index, int32_t value);
  290. //static version
  291. static int32_t getField (lua_State *L , const char *key);
  292. static void setField (lua_State *L, const char *index, int32_t val);
  293. // get a global string
  294. std::string getGlobalString(std::string var, const std::string &defString = "");
  295. int32_t getGlobalNumber(std::string var, const int32_t defNum = 0);
  296. std::string getGlobalStringField (std::string var, const int32_t key, const std::string &defString = "");
  297. // set a var to a val
  298. int32_t setGlobalString(std::string var, std::string val);
  299. int32_t setGlobalNumber(std::string var, int32_t val);
  300.  
  301. protected:
  302. std::string luaFile; // the file we represent
  303. lua_State* luaState; // our lua state
  304. };
  305.  
  306.  
  307. #endif // #ifndef __LUASCRIPT_H__
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement