summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorrud0lp20 <rud0lp20@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-07-28 13:20:00 +0000
committerrud0lp20 <rud0lp20@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-07-28 13:20:00 +0000
commitb746ecdef2ed9b57db672f43842f2434da4c79f8 (patch)
treed806065951ebba476cf5bb45bbf4380f29db6598 /src/map/battle.c
parent3071aad50f5cab693678372c5d7c2285800bb5d9 (diff)
downloadhercules-b746ecdef2ed9b57db672f43842f2434da4c79f8.tar.gz
hercules-b746ecdef2ed9b57db672f43842f2434da4c79f8.tar.bz2
hercules-b746ecdef2ed9b57db672f43842f2434da4c79f8.tar.xz
hercules-b746ecdef2ed9b57db672f43842f2434da4c79f8.zip
Updated some skills to its RE behavior(AL_ANGELUS, RG_BACKSTAP, WZ_GRAVITATION, NJ_RAIGEKISAI).(bugreport:6342, bugreport:6336, bugreport:6339, bugreport:6331)
Added some Kagerou/Oboro skills. Special mega thanks to Judas :) (KO_HUUMARANKA,KO_MEIKYOUSISUI,KO_ZANZOU,KO_KYOUGAKU,KO_JYUSATSU,KO_KAHU_ENTEN,KO_HYOUHU_HUBUKI,KO_KAZEHU_SEIRAN,KO_DOHU_KOUKAI) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16520 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c41
1 files changed, 35 insertions, 6 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 34946aec6..a4f5985bd 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -351,6 +351,19 @@ int battle_attr_fix(struct block_list *src, struct block_list *target, int damag
status_change_end(target, SC_CRYSTALIZE, INVALID_TIMER);
}
}
+ if( src->type == BL_PC || target->type == BL_PC ){
+ struct map_session_data *sd = BL_CAST(BL_PC, src);
+ struct map_session_data *tsd = BL_CAST(BL_PC, target);
+ int s, t;
+
+ ARR_FIND(1, 6, s, sd->talisman[s] > 0);
+ ARR_FIND(1, 6, t, tsd->talisman[t] > 0);
+
+ if( s < 5 && atk_elem == s )
+ ratio += sd->talisman[s] * 2; // +2% custom value
+ if( t < 5 && atk_elem == t )
+ damage -= damage * tsd->talisman[t] * 3 / 100; // -3% custom value
+ }
return damage*ratio/100;
}
@@ -705,6 +718,10 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
status_change_end(bl, SC_KYRIE, INVALID_TIMER);
}
+ if( sc->data[SC_MEIKYOUSISUI] && rand()%100 < 40 ) // custom value
+ damage = 0;
+
+
if (!damage) return 0;
if( (sce = sc->data[SC_LIGHTNINGWALK]) && flag&BF_LONG && rnd()%100 < sce->val1 ) {
@@ -1398,6 +1415,10 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
{ //Take weapon's element
s_ele = sstatus->rhw.ele;
s_ele_ = sstatus->lhw.ele;
+ if( sd ){ //Summoning 10 talisman will endow your weapon.
+ ARR_FIND(1, 6, i, sd->talisman[i] >= 10);
+ if( i < 5) s_ele = s_ele_ = i;
+ }
if( flag.arrow && sd && sd->bonus.arrow_ele )
s_ele = sd->bonus.arrow_ele;
if( battle_config.attack_attr_none&src->type )
@@ -3310,9 +3331,13 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
//Initialize variables that will be used afterwards
s_ele = skill_get_ele(skill_num, skill_lv);
- if (s_ele == -1) // pl=-1 : the skill takes the weapon's element
+ if (s_ele == -1){ // pl=-1 : the skill takes the weapon's element
s_ele = sstatus->rhw.ele;
- else if (s_ele == -2) //Use status element
+ if( sd ){ //Summoning 10 talisman will endow your weapon
+ ARR_FIND(1, 6, i, sd->talisman[i] > 0);
+ if( i < 5) s_ele = i;
+ }
+ }else if (s_ele == -2) //Use status element
s_ele = status_get_attack_sc_element(src,status_get_sc(src));
else if( s_ele == -3 ) //Use random element
s_ele = rnd()%ELE_MAX;
@@ -4173,6 +4198,9 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
md.damage -= totaldef;
}
break;
+ case KO_MAKIBISHI:
+ md.damage = 20 * skill_lv;
+ break;
}
if (nk&NK_SPLASHSPLIT){ // Divide ATK among targets
@@ -4928,9 +4956,9 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
}
break;
case BL_MOB:
- if((((TBL_MOB*)target)->special_state.ai == 2 || //Marine Spheres
+ if(((((TBL_MOB*)target)->special_state.ai == 2 || //Marine Spheres
(((TBL_MOB*)target)->special_state.ai == 3 && battle_config.summon_flora&1)) && //Floras
- s_bl->type == BL_PC && src->type != BL_MOB)
+ s_bl->type == BL_PC && src->type != BL_MOB) || ((TBL_MOB*)target)->special_state.ai == 4) //Zanzoe
{ //Targettable by players
state |= BCT_ENEMY;
strip_enemy = 0;
@@ -5094,8 +5122,9 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
return 0; // Disable guardians/emperium owned by Guilds on non-woe times.
if( !md->special_state.ai )
- { //Normal mobs.
- if( t_bl->type == BL_MOB && !((TBL_MOB*)t_bl)->special_state.ai )
+ { //Normal mobs
+ if( (target->type == BL_MOB && t_bl->type == BL_PC && ((TBL_MOB*)target)->special_state.ai < 4) ||
+ ( t_bl->type == BL_MOB && !((TBL_MOB*)t_bl)->special_state.ai ) )
state |= BCT_PARTY; //Normal mobs with no ai are friends.
else
state |= BCT_ENEMY; //However, all else are enemies.