diff options
author | zephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-02-14 01:18:19 +0000 |
---|---|---|
committer | zephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-02-14 01:18:19 +0000 |
commit | bcb283d696d5ec4d7b6a2dfd2ba52cf2a3011fb4 (patch) | |
tree | 23d639da18bafca939801a7f19da655084e1ecc0 /src/map/battle.c | |
parent | f4d4a5e61a464944482c11daeeb379808445483c (diff) | |
download | hercules-bcb283d696d5ec4d7b6a2dfd2ba52cf2a3011fb4.tar.gz hercules-bcb283d696d5ec4d7b6a2dfd2ba52cf2a3011fb4.tar.bz2 hercules-bcb283d696d5ec4d7b6a2dfd2ba52cf2a3011fb4.tar.xz hercules-bcb283d696d5ec4d7b6a2dfd2ba52cf2a3011fb4.zip |
- Added some new config settings: homunculus_autoloot, idle_no_autoloot, max_guild_alliance.
- Added a code to activate a Kill Steal protection and the required mapflags.
* (I will explain this later on forums).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12203 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/battle.c')
-rw-r--r-- | src/map/battle.c | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index cd54a2e39..21c2c751d 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -259,6 +259,9 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i if (!damage) return 0; + if( mob_ksprotected(src, bl) ) + return 0; + if (bl->type == BL_PC) { sd=(struct map_session_data *)bl; //Special no damage states @@ -3139,23 +3142,22 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f case BL_PC: { TBL_PC *sd = (TBL_PC*) s_bl; - if (sd->state.killer && s_bl != t_bl) + if( s_bl != t_bl ) { - state |= BCT_ENEMY; //Is on a killing rampage :O - strip_enemy = 0; - } else - if (sd->duel_group && t_bl != s_bl && // Duel [LuzZza] - !( - (!battle_config.duel_allow_pvp && map[m].flag.pvp) || - (!battle_config.duel_allow_gvg && map_flag_gvg(m)) - )) - { - if (t_bl->type == BL_PC && - (sd->duel_group == ((TBL_PC*)t_bl)->duel_group)) - //Duel targets can ONLY be your enemy, nothing else. - return (BCT_ENEMY&flag)?1:-1; - else // You can't target anything out of your duel - return 0; + if( sd->state.killer ) + { + state |= BCT_ENEMY; //Is on a killing rampage :O + strip_enemy = 0; + } + else if( sd->duel_group && !((!battle_config.duel_allow_pvp && map[m].flag.pvp) || (!battle_config.duel_allow_gvg && map_flag_gvg(m))) ) + { + if (t_bl->type == BL_PC && + (sd->duel_group == ((TBL_PC*)t_bl)->duel_group)) + //Duel targets can ONLY be your enemy, nothing else. + return (BCT_ENEMY&flag)?1:-1; + else // You can't target anything out of your duel + return 0; + } } if (map_flag_gvg(m) && !sd->status.guild_id && t_bl->type == BL_MOB && ((TBL_MOB*)t_bl)->guardian_data) @@ -3650,6 +3652,10 @@ static const struct _battle_data { { "sg_miracle_skill_duration", &battle_config.sg_miracle_skill_duration, 3600000, 0, INT_MAX, }, { "hvan_explosion_intimate", &battle_config.hvan_explosion_intimate, 45000, 0, 100000, }, { "quest_exp_rate", &battle_config.quest_exp_rate, 100, 0, INT_MAX, }, + { "homunculus_autoloot", &battle_config.homunculus_autoloot, 0, 0, 1, }, + { "idle_no_autoloot", &battle_config.idle_no_autoloot, 0, 0, INT_MAX, }, + { "max_guild_alliance", &battle_config.max_guild_alliance, 3, 1, 3, }, + { "ksprotection", &battle_config.ksprotection, 5000, 0, INT_MAX, }, }; |