battle.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. // $Id: battle.h,v 1.6 2004/09/29 21:08:17 Akitasha Exp $
  2. #ifndef _BATTLE_H_
  3. #define _BATTLE_H_
  4. // ダメージ
  5. struct Damage {
  6. int damage,damage2;
  7. int type,div_;
  8. int amotion,dmotion;
  9. int blewcount;
  10. int flag;
  11. int dmg_lv; //囲まれ減算計算用 0:スキル攻撃 ATK_LUCKY,ATK_FLEE,ATK_DEF
  12. };
  13. // 属性表(読み込みはpc.c、battle_attr_fixで使用)
  14. extern int attr_fix_table[4][10][10];
  15. struct map_session_data;
  16. struct mob_data;
  17. struct block_list;
  18. // ダメージ計算
  19. struct Damage battle_calc_attack( int attack_type,
  20. struct block_list *bl,struct block_list *target,int skill_num,int skill_lv,int flag);
  21. struct Damage battle_calc_weapon_attack(
  22. struct block_list *bl,struct block_list *target,int skill_num,int skill_lv,int flag);
  23. struct Damage battle_calc_magic_attack(
  24. struct block_list *bl,struct block_list *target,int skill_num,int skill_lv,int flag);
  25. struct Damage battle_calc_misc_attack(
  26. struct block_list *bl,struct block_list *target,int skill_num,int skill_lv,int flag);
  27. // 属性修正計算
  28. int battle_attr_fix(int damage,int atk_elem,int def_elem);
  29. // ダメージ最終計算
  30. int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,int div_,int skill_num,int skill_lv,int flag);
  31. enum { // 最終計算のフラグ
  32. BF_WEAPON = 0x0001,
  33. BF_MAGIC = 0x0002,
  34. BF_MISC = 0x0004,
  35. BF_SHORT = 0x0010,
  36. BF_LONG = 0x0040,
  37. BF_SKILL = 0x0100,
  38. BF_NORMAL = 0x0200,
  39. BF_WEAPONMASK=0x000f,
  40. BF_RANGEMASK= 0x00f0,
  41. BF_SKILLMASK= 0x0f00,
  42. };
  43. // 実際にHPを増減
  44. int battle_delay_damage(unsigned int tick,struct block_list *src,struct block_list *target,int damage,int flag);
  45. int battle_damage(struct block_list *bl,struct block_list *target,int damage,int flag);
  46. int battle_heal(struct block_list *bl,struct block_list *target,int hp,int sp,int flag);
  47. // 攻撃や移動を止める
  48. int battle_stopattack(struct block_list *bl);
  49. int battle_stopwalking(struct block_list *bl,int type);
  50. // 通常攻撃処理まとめ
  51. int battle_weapon_attack( struct block_list *bl,struct block_list *target,
  52. unsigned int tick,int flag);
  53. // 各種パラメータを得る
  54. int battle_counttargeted(struct block_list *bl,struct block_list *src,int target_lv);
  55. int battle_get_class(struct block_list *bl);
  56. int battle_get_dir(struct block_list *bl);
  57. int battle_get_lv(struct block_list *bl);
  58. int battle_get_range(struct block_list *bl);
  59. int battle_get_hp(struct block_list *bl);
  60. int battle_get_max_hp(struct block_list *bl);
  61. int battle_get_str(struct block_list *bl);
  62. int battle_get_agi(struct block_list *bl);
  63. int battle_get_vit(struct block_list *bl);
  64. int battle_get_int(struct block_list *bl);
  65. int battle_get_dex(struct block_list *bl);
  66. int battle_get_luk(struct block_list *bl);
  67. int battle_get_hit(struct block_list *bl);
  68. int battle_get_flee(struct block_list *bl);
  69. int battle_get_def(struct block_list *bl);
  70. int battle_get_mdef(struct block_list *bl);
  71. int battle_get_flee2(struct block_list *bl);
  72. int battle_get_def2(struct block_list *bl);
  73. int battle_get_mdef2(struct block_list *bl);
  74. int battle_get_baseatk(struct block_list *bl);
  75. int battle_get_atk(struct block_list *bl);
  76. int battle_get_atk2(struct block_list *bl);
  77. int battle_get_speed(struct block_list *bl);
  78. int battle_get_adelay(struct block_list *bl);
  79. int battle_get_amotion(struct block_list *bl);
  80. int battle_get_dmotion(struct block_list *bl);
  81. int battle_get_element(struct block_list *bl);
  82. int battle_get_attack_element(struct block_list *bl);
  83. int battle_get_attack_element2(struct block_list *bl); //左手武器属性取得
  84. #define battle_get_elem_type(bl) (battle_get_element(bl)%10)
  85. #define battle_get_elem_level(bl) (battle_get_element(bl)/10/2)
  86. int battle_get_party_id(struct block_list *bl);
  87. int battle_get_guild_id(struct block_list *bl);
  88. int battle_get_race(struct block_list *bl);
  89. int battle_get_size(struct block_list *bl);
  90. int battle_get_mode(struct block_list *bl);
  91. int battle_get_mexp(struct block_list *bl);
  92. struct status_change *battle_get_sc_data(struct block_list *bl);
  93. short *battle_get_sc_count(struct block_list *bl);
  94. short *battle_get_opt1(struct block_list *bl);
  95. short *battle_get_opt2(struct block_list *bl);
  96. short *battle_get_opt3(struct block_list *bl);
  97. short *battle_get_option(struct block_list *bl);
  98. enum {
  99. BCT_NOENEMY =0x00000,
  100. BCT_PARTY =0x10000,
  101. BCT_ENEMY =0x40000,
  102. BCT_NOPARTY =0x50000,
  103. BCT_ALL =0x20000,
  104. BCT_NOONE =0x60000,
  105. };
  106. int battle_check_undead(int race,int element);
  107. int battle_check_target( struct block_list *src, struct block_list *target,int flag);
  108. int battle_check_range(struct block_list *src,struct block_list *bl,int range);
  109. // 設定
  110. int battle_config_switch(const char *str); // [Valaris]
  111. extern struct Battle_Config {
  112. int warp_point_debug;
  113. int enemy_critical;
  114. int enemy_critical_rate;
  115. int enemy_str;
  116. int enemy_perfect_flee;
  117. int cast_rate,delay_rate,delay_dependon_dex;
  118. int sdelay_attack_enable;
  119. int left_cardfix_to_right;
  120. int pc_skill_add_range;
  121. int skill_out_range_consume;
  122. int mob_skill_add_range;
  123. int pc_damage_delay;
  124. int pc_damage_delay_rate;
  125. int defnotenemy;
  126. int random_monster_checklv;
  127. int attr_recover;
  128. int flooritem_lifetime;
  129. int item_auto_get;
  130. int item_first_get_time;
  131. int item_second_get_time;
  132. int item_third_get_time;
  133. int mvp_item_first_get_time;
  134. int mvp_item_second_get_time;
  135. int mvp_item_third_get_time;
  136. int item_rate,base_exp_rate,job_exp_rate; // removed item rate, depreciated
  137. int drop_rate0item;
  138. int death_penalty_type;
  139. int death_penalty_base,death_penalty_job;
  140. int pvp_exp; // [MouseJstr]
  141. int gtb_pvp_only; // [MouseJstr]
  142. int zeny_penalty;
  143. int restart_hp_rate;
  144. int restart_sp_rate;
  145. int mvp_item_rate,mvp_exp_rate;
  146. int mvp_hp_rate;
  147. int monster_hp_rate;
  148. int monster_max_aspd;
  149. int atc_gmonly;
  150. int atc_spawn_quantity_limit;
  151. int gm_allskill;
  152. int gm_allskill_addabra;
  153. int gm_allequip;
  154. int gm_skilluncond;
  155. int skillfree;
  156. int skillup_limit;
  157. int wp_rate;
  158. int pp_rate;
  159. int cdp_rate;
  160. int monster_active_enable;
  161. int monster_damage_delay_rate;
  162. int monster_loot_type;
  163. int mob_skill_use;
  164. int mob_count_rate;
  165. int quest_skill_learn;
  166. int quest_skill_reset;
  167. int basic_skill_check;
  168. int guild_emperium_check;
  169. int guild_exp_limit;
  170. int guild_max_castles;
  171. int pc_invincible_time;
  172. int pet_catch_rate;
  173. int pet_rename;
  174. int pet_friendly_rate;
  175. int pet_hungry_delay_rate;
  176. int pet_hungry_friendly_decrease;
  177. int pet_str;
  178. int pet_status_support;
  179. int pet_attack_support;
  180. int pet_damage_support;
  181. int pet_support_rate;
  182. int pet_attack_exp_to_master;
  183. int pet_attack_exp_rate;
  184. int skill_min_damage;
  185. int finger_offensive_type;
  186. int heal_exp;
  187. int resurrection_exp;
  188. int shop_exp;
  189. int combo_delay_rate;
  190. int item_check;
  191. int wedding_modifydisplay;
  192. int natural_healhp_interval;
  193. int natural_healsp_interval;
  194. int natural_heal_skill_interval;
  195. int natural_heal_weight_rate;
  196. int item_name_override_grffile;
  197. int arrow_decrement;
  198. int max_aspd;
  199. int max_hp;
  200. int max_sp;
  201. int max_lv;
  202. int max_parameter;
  203. int max_cart_weight;
  204. int pc_skill_log;
  205. int mob_skill_log;
  206. int battle_log;
  207. int save_log;
  208. int error_log;
  209. int etc_log;
  210. int save_clothcolor;
  211. int undead_detect_type;
  212. int pc_auto_counter_type;
  213. int monster_auto_counter_type;
  214. int agi_penaly_type;
  215. int agi_penaly_count;
  216. int agi_penaly_num;
  217. int vit_penaly_type;
  218. int vit_penaly_count;
  219. int vit_penaly_num;
  220. int player_defense_type;
  221. int monster_defense_type;
  222. int pet_defense_type;
  223. int magic_defense_type;
  224. int pc_skill_reiteration;
  225. int monster_skill_reiteration;
  226. int pc_skill_nofootset;
  227. int monster_skill_nofootset;
  228. int pc_cloak_check_type;
  229. int monster_cloak_check_type;
  230. int gvg_short_damage_rate;
  231. int gvg_long_damage_rate;
  232. int gvg_magic_damage_rate;
  233. int gvg_misc_damage_rate;
  234. int gvg_eliminate_time;
  235. int mob_changetarget_byskill;
  236. int pc_attack_direction_change;
  237. int monster_attack_direction_change;
  238. int pc_undead_nofreeze;
  239. int pc_land_skill_limit;
  240. int monster_land_skill_limit;
  241. int party_skill_penaly;
  242. int monster_class_change_full_recover;
  243. int produce_item_name_input;
  244. int produce_potion_name_input;
  245. int making_arrow_name_input;
  246. int holywater_name_input;
  247. int display_delay_skill_fail;
  248. int display_snatcher_skill_fail;
  249. int chat_warpportal;
  250. int mob_warpportal;
  251. int dead_branch_active;
  252. int vending_max_value;
  253. // int pet_lootitem; // removed [Valaris]
  254. // int pet_weight; // removed [Valaris]
  255. int show_steal_in_same_party;
  256. int enable_upper_class;
  257. int pet_attack_attr_none;
  258. int mob_attack_attr_none;
  259. int mob_ghostring_fix;
  260. int pc_attack_attr_none;
  261. int item_rate_common,item_rate_card,item_rate_equip,item_rate_heal,item_rate_use; // Added by RoVeRT, Additional Heal and Usable item rate by Val
  262. int item_drop_common_min,item_drop_common_max; // Added by TyrNemesis^
  263. int item_drop_card_min,item_drop_card_max;
  264. int item_drop_equip_min,item_drop_equip_max;
  265. int item_drop_mvp_min,item_drop_mvp_max; // End Addition
  266. int item_drop_heal_min,item_drop_heal_max; // Added by Valatris
  267. int item_drop_use_min,item_drop_use_max; //End
  268. int prevent_logout; // Added by RoVeRT
  269. int alchemist_summon_reward; // [Valaris]
  270. int maximum_level;
  271. int drops_by_luk;
  272. int monsters_ignore_gm;
  273. int equipment_breaking;
  274. int equipment_break_rate;
  275. int pet_equip_required;
  276. int multi_level_up;
  277. int pk_mode;
  278. int show_mob_hp; // end additions [Valaris]
  279. int agi_penaly_count_lv;
  280. int vit_penaly_count_lv;
  281. int gx_allhit;
  282. int gx_cardfix;
  283. int gx_dupele;
  284. int gx_disptype;
  285. int devotion_level_difference;
  286. int player_skill_partner_check;
  287. int hide_GM_session;
  288. int unit_movement_type;
  289. int invite_request_check;
  290. int skill_removetrap_type;
  291. int disp_experience;
  292. int castle_defense_rate;
  293. int riding_weight;
  294. int backstab_bow_penalty;
  295. int night_at_start; // added by [Yor]
  296. int day_duration; // added by [Yor]
  297. int night_duration; // added by [Yor]
  298. int ban_spoof_namer; // added by [Yor]
  299. int hack_info_GM_level; // added by [Yor]
  300. int any_warp_GM_min_level; // added by [Yor]
  301. int packet_ver_flag; // added by [Yor]
  302. int muting_players; // added by [Apple]
  303. int min_hair_style; // added by [MouseJstr]
  304. int max_hair_style; // added by [MouseJstr]
  305. int min_hair_color; // added by [MouseJstr]
  306. int max_hair_color; // added by [MouseJstr]
  307. int min_cloth_color; // added by [MouseJstr]
  308. int max_cloth_color; // added by [MouseJstr]
  309. int castrate_dex_scale; // added by [MouseJstr]
  310. int area_size; // added by [MouseJstr]
  311. int zeny_from_mobs; // [Valaris]
  312. int mobs_level_up; // [Valaris]
  313. int pk_min_level; // [celest]
  314. int skill_steal_type; // [celest]
  315. int skill_steal_rate; // [celest]
  316. int night_darkness_level; // [celest]
  317. int skill_range_leniency; // [celest]
  318. int motd_type; // [celest]
  319. #ifndef TXT_ONLY /* SQL-only options */
  320. int mail_system; // [Valaris]
  321. #endif
  322. } battle_config;
  323. extern int battle_config_read(const char *cfgName);
  324. extern void battle_validate_conf();
  325. extern void battle_set_defaults();
  326. extern int battle_set_value(char *, char *);
  327. #endif