Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

battle.h

00001 // $Id: battle.h 486 2006-04-03 20:57:58Z zugule $
00002 #ifndef _BATTLE_H_
00003 #define _BATTLE_H_
00004 
00005 // MATK_FIX is used only for magical attack calculation
00006 #define MATK_FIX(a, b) { matk1 = matk1 * (a) / (b); matk2 = matk2 * (a) / (b); }
00007 
00008 struct Damage {
00009         int damage,damage2;
00010         int type,div_;
00011         int amotion,dmotion;
00012         int blewcount;
00013         int flag;
00014         int dmg_lv;
00015 };
00016 
00017 extern int attr_fix_table[4][10][10];
00018 
00019 struct map_session_data;
00020 struct mob_data;
00021 struct block_list;
00022 
00023 struct Damage battle_calc_attack(       int attack_type,
00024         struct block_list *bl,struct block_list *target,int skill_num,int skill_lv,int flag);
00025 struct Damage battle_calc_weapon_attack(
00026         struct block_list *bl,struct block_list *target,int skill_num,int skill_lv,int flag);
00027 struct Damage battle_calc_magic_attack(
00028         struct block_list *bl,struct block_list *target,int skill_num,int skill_lv,int flag);
00029 struct Damage  battle_calc_misc_attack(
00030         struct block_list *bl,struct block_list *target,int skill_num,int skill_lv,int flag);
00031 
00032 int battle_attr_fix(int damage,int atk_elem,int def_elem);
00033 
00034 int battle_calc_damage(struct block_list *src, struct block_list *bl, int damage, int div_, int skill_num, int skill_lv, int flag); // Calculate Damage
00035 int battle_calc_rdamage(struct block_list *bl, int damage, int damage_type, int attack_type, int skill_id); // Calculate Reflection Damage
00036 
00037 enum
00038 {
00039         BF_WEAPON    = 0x0001,
00040         BF_MAGIC     = 0x0002,
00041         BF_MISC      = 0x0004,
00042         BF_SHORT     = 0x0010,
00043         BF_LONG      = 0x0040,
00044         BF_SKILL     = 0x0100,
00045         BF_NORMAL    = 0x0200,
00046         BF_WEAPONMASK= 0x000f,
00047         BF_RANGEMASK = 0x00f0,
00048         BF_SKILLMASK = 0x0f00
00049 };
00050 
00051 // 実際にHPを増減
00052 int battle_delay_damage (unsigned int tick, struct block_list *src, struct block_list *target, int attack_type, int skill_id, int skill_lv, int damage, int dmg_lv, int flag);
00053 int battle_damage(struct block_list *bl, struct block_list *target, int damage, int flag);
00054 int battle_heal(struct block_list *bl, struct block_list *target, int hp, int sp, int flag);
00055 
00056 // 攻撃や移動を止める
00057 void battle_stopattack(struct block_list *bl);
00058 int battle_stopwalking(struct block_list *bl, int type);
00059 
00060 // 通常攻撃処理まとめ
00061 int battle_weapon_attack(struct block_list *bl, struct block_list *target,
00062          unsigned int tick, int flag);
00063 
00064 // 各種パラメータを得る
00065 int battle_counttargeted(struct block_list *bl, struct block_list *src, int target_lv);
00066 
00067 enum {
00068         BCT_NOENEMY = 0x00000,
00069         BCT_PARTY   = 0x10000,
00070         BCT_ENEMY   = 0x40000,
00071         BCT_NOPARTY = 0x50000,
00072         BCT_ALL     = 0x20000,
00073         BCT_NOONE   = 0x60000,
00074         BCT_SELF    = 0x60000
00075 };
00076 
00077 int battle_check_undead(int race, int element);
00078 int battle_check_target(struct block_list *src, struct block_list *target, int flag);
00079 int battle_check_range(struct block_list *src, struct block_list *bl, int range);
00080 
00081 
00082 // 設定
00083 
00084 extern struct Battle_Config {
00085         int warp_point_debug;
00086         int enemy_critical;
00087         int enemy_critical_rate;
00088         int enemy_str;
00089         int enemy_perfect_flee;
00090         int cast_rate,delay_rate,delay_dependon_dex;
00091         int sdelay_attack_enable;
00092         int left_cardfix_to_right;
00093         int pc_skill_add_range;
00094         int skill_out_range_consume;
00095         int mob_skill_add_range;
00096         int pc_damage_delay;
00097         int pc_damage_delay_rate;
00098         int defnotenemy;
00099         int random_monster_checklv;
00100         int attr_recover;
00101         int flooritem_lifetime;
00102         int item_auto_get;
00103         int item_auto_get_loot;
00104         int item_auto_get_distance;
00105         int item_first_get_time;
00106         int item_second_get_time;
00107         int item_third_get_time;
00108         int mvp_item_first_get_time;
00109         int mvp_item_second_get_time;
00110         int mvp_item_third_get_time;
00111         int base_exp_rate, job_exp_rate;
00112         int drop_rate0item;
00113         int death_penalty_type_base;
00114         int death_penalty_base;
00115         int death_penalty_base2_lvl, death_penalty_base2;
00116         int death_penalty_base3_lvl, death_penalty_base3;
00117         int death_penalty_base4_lvl, death_penalty_base4;
00118         int death_penalty_base5_lvl, death_penalty_base5;
00119         int death_penalty_type_job;
00120         int death_penalty_job;
00121         int death_penalty_job2_lvl, death_penalty_job2;
00122         int death_penalty_job3_lvl, death_penalty_job3;
00123         int death_penalty_job4_lvl, death_penalty_job4;
00124         int death_penalty_job5_lvl, death_penalty_job5;
00125         int pvp_exp; // [MouseJstr]
00126         int gtb_pvp_only; // [MouseJstr]
00127         int zeny_penalty;
00128         int zeny_penalty_percent;
00129         int zeny_penalty_by_lvl;
00130         int restart_hp_rate;
00131         int restart_sp_rate;
00132         int mvp_item_rate,mvp_exp_rate;
00133         int mvp_hp_rate;
00134         int monster_hp_rate;
00135         int monster_max_aspd;
00136         int atc_gmonly;
00137         int atc_spawn_quantity_limit;
00138         int atc_map_mob_limit;
00139         int atc_local_spawn_interval;
00140         int npc_summon_type;
00141         int gm_allskill;
00142         int gm_all_skill_job;
00143         int gm_all_skill_platinum;
00144         int gm_allskill_addabra;
00145         int gm_allequip;
00146         int gm_skilluncond;
00147         int skillfree;
00148         int skillup_limit;
00149         int check_minimum_skill_points;
00150         int check_maximum_skill_points;
00151         int wp_rate;
00152         int pp_rate;
00153         int cdp_rate;
00154         int monster_active_enable;
00155         int monster_damage_delay_rate;
00156         int monster_loot_type;
00157         int mob_skill_use;
00158         int mob_count_rate;
00159         int quest_skill_learn;
00160         int quest_skill_reset;
00161         int basic_skill_check;
00162         int no_caption_cloaking; // remove the caption "cloaking !!" when skill is casted
00163         int display_hallucination; // Enable or disable hallucination Skill.
00164         int no_guilds_glory;
00165         int guild_emperium_check;
00166         int guild_exp_limit;
00167         int guild_max_castles;
00168         int pc_invincible_time;
00169         int pet_birth_effect;
00170         int pet_catch_rate;
00171         int pet_rename;
00172         int pet_friendly_rate;
00173         int pet_hungry_delay_rate;
00174         int pet_hungry_friendly_decrease;
00175         int pet_str;
00176         int pet_status_support;
00177         int pet_attack_support;
00178         int pet_damage_support;
00179         int pet_support_rate;
00180         int pet_attack_exp_to_master;
00181         int pet_attack_exp_rate;
00182         int skill_min_damage;
00183         int finger_offensive_type;
00184         int heal_exp;
00185         int resurrection_exp;
00186         int shop_exp;
00187         int combo_delay_rate;
00188         int item_check;
00189         int item_use_interval; // [Skotlex]
00190         int wedding_modifydisplay;
00191         int natural_healhp_interval;
00192         int natural_healsp_interval;
00193         int natural_heal_skill_interval;
00194         int natural_heal_weight_rate;
00195         int item_name_override_grffile;
00196         int indoors_override_grffile; // [Celest]
00197         int skill_sp_override_grffile; // [Celest]
00198         int cardillust_read_grffile;
00199         int item_equip_override_grffile;
00200         int item_slots_override_grffile;
00201         int arrow_decrement;
00202         int max_aspd;
00203         int max_hp;
00204         int max_sp;
00205         int max_lv;
00206         int max_parameter;
00207         int max_cart_weight;
00208         int pc_skill_log;
00209         int mob_skill_log;
00210         int battle_log;
00211         int save_log;
00212         int error_log;
00213         int etc_log;
00214         int save_clothcolor;
00215         int undead_detect_type;
00216         int pc_auto_counter_type;
00217         int monster_auto_counter_type;
00218         int agi_penalty_type;
00219         int agi_penalty_count;
00220         int agi_penalty_num;
00221         int vit_penalty_type;
00222         int vit_penalty_count;
00223         int vit_penalty_num;
00224         int player_defense_type;
00225         int monster_defense_type;
00226         int pet_defense_type;
00227         int magic_defense_type;
00228         int pc_skill_reiteration;
00229         int monster_skill_reiteration;
00230         int pc_skill_nofootset;
00231         int monster_skill_nofootset;
00232         int pc_cloak_check_type;
00233         int monster_cloak_check_type;
00234         int gvg_short_damage_rate;
00235         int gvg_long_damage_rate;
00236         int gvg_magic_damage_rate;
00237         int gvg_misc_damage_rate;
00238         int gvg_eliminate_time;
00239         int mob_changetarget_byskill;
00240         int pc_attack_direction_change;
00241         int monster_attack_direction_change;
00242         int pc_land_skill_limit;
00243         int monster_land_skill_limit;
00244         int party_skill_penalty;
00245         int monster_class_change_full_recover;
00246         int produce_item_name_input;
00247         int produce_potion_name_input;
00248         int making_arrow_name_input;
00249         int holywater_name_input;
00250         int atcommand_item_creation_name_input;
00251         int atcommand_max_player_gm_level;
00252         int display_delay_skill_fail;
00253         int display_snatcher_skill_fail;
00254         int chat_warpportal;
00255         int mob_warpportal;
00256         int dead_branch_active;
00257         int vending_max_value;
00258 //      int pet_lootitem; // removed
00259 //      int pet_weight; // removed
00260         int show_steal_in_same_party;
00261         int enable_upper_class;
00262         int pet_attack_attr_none;
00263         int mob_attack_attr_none;
00264         int mob_ghostring_fix;
00265         int pc_attack_attr_none;
00266         int item_rate_common, item_rate_card, item_rate_equip, item_rate_heal, item_rate_use;
00267         int item_drop_common_min, item_drop_common_max;
00268         int item_drop_card_min, item_drop_card_max;
00269         int item_drop_equip_min, item_drop_equip_max;
00270         int item_drop_mvp_min, item_drop_mvp_max;
00271         int item_drop_heal_min, item_drop_heal_max;
00272         int item_drop_use_min, item_drop_use_max;
00273 
00274         int prevent_logout; // Added by RoVeRT
00275 
00276         int alchemist_summon_reward;    // [Valaris]
00277         int maximum_level;
00278         int atcommand_max_job_level_novice;
00279         int atcommand_max_job_level_job1;
00280         int atcommand_max_job_level_job2;
00281         int atcommand_max_job_level_supernovice;
00282         int atcommand_max_job_level_highnovice;
00283         int atcommand_max_job_level_highjob1;
00284         int atcommand_max_job_level_highjob2;
00285         int atcommand_max_job_level_babynovice;
00286         int atcommand_max_job_level_babyjob1;
00287         int atcommand_max_job_level_babyjob2;
00288         int atcommand_max_job_level_superbaby;
00289         int drops_by_luk;
00290         int monsters_ignore_gm;
00291         int equipment_breaking;
00292         int equipment_break_rate;
00293         int pet_equip_required;
00294         int multi_level_up;
00295         int pk_mode;
00296         int show_mob_hp;  // end additions [Valaris]
00297 
00298         int agi_penalty_count_lv;
00299         int vit_penalty_count_lv;
00300 
00301         int gx_allhit;
00302         int gx_cardfix;
00303         int gx_dupele;
00304         int gx_disptype;
00305         int devotion_level_difference;
00306         int player_skill_partner_check;
00307         int hide_GM_session; // minimum level of hidden GMs
00308         int unit_movement_type;
00309         int invite_request_check;
00310         int skill_removetrap_type;
00311         int disp_experience;
00312         int disp_experience_type;
00313         int castle_defense_rate;
00314         int riding_weight;
00315         int backstab_bow_penalty;
00316         int hp_rate;
00317         int sp_rate;
00318         int gm_can_drop_lv;
00319         int disp_hpmeter;
00320         int bone_drop;
00321 
00322         int night_at_start; // added by [Yor]
00323         int day_duration; // added by [Yor]
00324         int night_duration; // added by [Yor]
00325         int ban_spoof_namer; // added by [Yor]
00326         int ban_hack_trade; // added by [Yor]
00327         int ban_bot; // added by [Yor]
00328         int check_ban_bot; // added by [Yor]
00329         int max_message_length; // added by [Yor]
00330         int max_global_message_length; // added by [Yor]
00331         int hack_info_GM_level; // added by [Yor]
00332         int speed_hack_info_GM_level; // added by [Yor]
00333         int any_warp_GM_min_level; // added by [Yor]
00334         int packet_ver_flag; // added by [Yor]
00335         int muting_players; // added by [PoW]
00336 
00337         int min_hair_style; // added by [Yor]
00338         int max_hair_style; // added by [Yor]
00339         int min_hair_color; // added by [Yor]
00340         int max_hair_color; // added by [Yor]
00341         int min_cloth_color; // added by [Yor]
00342         int max_cloth_color; // added by [Yor]
00343         int clothes_color_for_assassin; // added by [Yor]
00344 
00345         int castrate_dex_scale; // added by [Yor]
00346         int area_size; // added by [Yor]
00347 
00348         int zeny_from_mobs; // [Valaris]
00349         int mobs_level_up; // [Valaris]
00350         int pk_min_level; // [celest]
00351         int skill_steal_type; // [celest]
00352         int skill_steal_rate; // [celest]
00353         int night_darkness_level; // [celest]
00354         int skill_range_leniency; // [celest]
00355         int motd_type; // [celest]
00356         int allow_atcommand_when_mute; // [celest]
00357         int manner_action; // [Yor]
00358         int finding_ore_rate;
00359         int min_skill_delay_limit;
00360         int idle_no_share; // exp share in party
00361         int idle_delay_no_share; // exp share in party
00362         int chat_no_share; // exp share in party
00363         int npc_chat_no_share; // exp share in party
00364         int shop_no_share; // exp share in party
00365         int trade_no_share; // exp share in party
00366         int idle_disconnect; // disconnection without sending information
00367         int idle_disconnect_chat; // disconnection without sending information
00368         int idle_disconnect_vender; // disconnection without sending information
00369         int idle_disconnect_disable_for_restore; // disconnection without sending information
00370         int idle_disconnect_ignore_GM; // disconnection without sending information
00371         int jail_message; // Do we send message to ALL players when a player is put in jail?
00372         int jail_discharge_message; // Do we send message to ALL players when a player is discharged?
00373         int mingmlvl_message; // Which message do we send when a GM can use a command, but mingmlvl map flag block it?
00374         int check_invalid_slot; // Do we check invalid slotted cards?
00375         int ruwach_range; // Set the range (number of squares/tiles around you) of 'ruwach' skill to detect invisible.
00376         int sight_range; // Set the range (number of squares/tiles around you) of 'sight' skill to detect invisible.
00377         int max_icewall; // Set maximum number of ice walls active at the same time.
00378 
00379         int atcommand_main_channel_at_start;
00380         int atcommand_main_channel_when_woe;
00381         int atcommand_min_GM_level_for_request;
00382         int atcommand_follow_stop_dead_target;
00383         int atcommand_add_local_message_info;
00384         int atcommand_storage_on_pvp_map;
00385         int atcommand_gstorage_on_pvp_map;
00386 
00387         int pm_gm_not_ignored; // GM minimum level to be not ignored in private message. [BeoWulf] (from freya's bug report)
00388         int char_disconnect_mode;
00389         int auto_muting;
00390         int full_castle_name;
00391         int mob_skill_delay;
00392         int mob_skill_success_chance;
00393         int item_sex_check;
00394 
00395 #ifdef USE_SQL /* SQL-only options */
00396         int mail_system; // [Valaris]
00397 #endif /* USE_SQL */
00398 } battle_config;
00399 
00400 int battle_config_read(const char *cfgName);
00401 extern int battle_set_value(char *, char *);
00402 
00403 #endif // _BATTLE_H_

Generated on Fri Apr 28 10:20:04 2006 for OpenAthena by  doxygen 1.4.4