summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-10-16 19:07:24 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-10-16 19:07:24 +0000
commitfb635209b4dff794db3f3df8fdb62478c797b882 (patch)
tree88ff7ffd48fce99701837fd4b0bea1cd067a80eb /src/map
parent143e5d0790f5b8eb7e79b275ac37188b5bac7362 (diff)
downloadhercules-fb635209b4dff794db3f3df8fdb62478c797b882.tar.gz
hercules-fb635209b4dff794db3f3df8fdb62478c797b882.tar.bz2
hercules-fb635209b4dff794db3f3df8fdb62478c797b882.tar.xz
hercules-fb635209b4dff794db3f3df8fdb62478c797b882.zip
- Applied most of Mpeg's work on Ninja Skills. For information see: http://gpegon.free.fr/ea/ninja_10-15-06_mpeg.txt
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8999 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/battle.c73
-rw-r--r--src/map/skill.c49
-rw-r--r--src/map/status.c36
3 files changed, 76 insertions, 82 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index b138e651b..878f9e322 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -322,9 +322,31 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i
return 0;
}
- if(sc->data[SC_BUNSINJYUTSU].timer != -1 && (flag&(BF_WEAPON|BF_MISC)) )
+ if ((sc->data[SC_UTSUSEMI].timer != -1 || sc->data[SC_BUNSINJYUTSU].timer != -1)
+ && (flag&(BF_WEAPON|BF_MISC))
+/* FIXME: This check is awful, there has to be some kind of logic behind this!
+ && (
+ // there is no rule for that, only some exceptions.. which I listed according to many tests and says
+ skill_num != ASC_BREAKER &&
+ skill_num != NJ_KUNAI &&
+ skill_num != SN_FALCONASSAULT &&
+ skill_num != MO_BALKYOUNG &&
+ skill_num != HT_BLITZBEAT &&
+ skill_num != NJ_SYURIKEN
+ )
+*/
+ )
{
- if (--sc->data[SC_BUNSINJYUTSU].val2 <= 0)
+ if (sc->data[SC_UTSUSEMI].timer != -1) {
+ clif_specialeffect(bl, 462, AREA);
+ skill_blown (src, bl, sc->data[SC_UTSUSEMI].val3);
+ };
+ //Both need to be consumed if they are active.
+ if (sc->data[SC_UTSUSEMI].timer != -1 &&
+ --sc->data[SC_UTSUSEMI].val2 <= 0)
+ status_change_end(bl, SC_UTSUSEMI, -1);
+ if (sc->data[SC_BUNSINJYUTSU].timer != -1 &&
+ --sc->data[SC_BUNSINJYUTSU].val2 <= 0)
status_change_end(bl, SC_BUNSINJYUTSU, -1);
return 0;
}
@@ -497,6 +519,7 @@ int battle_calc_gvg_damage(struct block_list *src,struct block_list *bl,int dama
//Skills with no damage reduction.
case PA_PRESSURE:
case HW_GRAVITATION:
+ case NJ_ZENYNAGE:
break;
default:
if (md && md->guardian_data) {
@@ -877,7 +900,7 @@ static struct Damage battle_calc_weapon_attack(
case CR_GRANDCROSS:
case NPC_GRANDDARKNESS:
case NJ_HUUMA:
- case GS_FLING:
+ case NJ_ISSEN:
case GS_TRIPLEACTION:
case GS_BULLSEYE:
case GS_MAGICALBULLET:
@@ -1048,7 +1071,8 @@ static struct Damage battle_calc_weapon_attack(
case NPC_ENERGYDRAIN:
case NPC_MENTALBREAKER:
case GS_GROUNDDRIFT:
- case NJ_TATAMIGAESHI:
+ case NJ_SYURIKEN:
+ case NJ_KUNAI:
case NJ_ISSEN:
flag.hit = 1;
break;
@@ -1151,7 +1175,7 @@ static struct Damage battle_calc_weapon_attack(
switch (skill_num)
{ //Calc base damage according to skill
case NJ_ISSEN:
- wd.damage = 80*sstatus->str +skill_lv*sstatus->hp*8/100;
+ wd.damage = 40*sstatus->str +skill_lv*(sstatus->hp/10 + 35);
wd.damage2 = 0;
status_set_hp(src, 1, 0);
break;
@@ -1781,11 +1805,10 @@ static struct Damage battle_calc_weapon_attack(
skillratio /= 12-3*skill;
ATK_ADDRATE(skillratio);
}
- // Added Tobidougu bonus on throwing weapon ninja skills if not wearing a Fuuma shuriken (bonus already added in battle_addmastery)
- if ((skill_num == NJ_SYURIKEN || skill_num == NJ_KUNAI) &&
- sd->status.weapon != W_HUUMA &&
- (skill = pc_checkskill(sd,NJ_TOBIDOUGU)) > 0)
+ if (skill_num == NJ_SYURIKEN && (skill = pc_checkskill(sd,NJ_TOBIDOUGU)) > 0)
ATK_ADD(3*skill);
+ if (skill_num == NJ_KUNAI)
+ ATK_ADD(60);
}
} //Here ends flag.hit section, the rest of the function applies to both hitting and missing attacks
else if(wd.div_ < 0) //Since the attack missed...
@@ -2098,7 +2121,6 @@ struct Damage battle_calc_magic_attack(
struct map_session_data *sd, *tsd;
struct Damage ad;
- struct status_change *tsc;
struct status_data *sstatus = status_get_status_data(src);
struct status_data *tstatus = status_get_status_data(target);
struct {
@@ -2212,8 +2234,6 @@ struct Damage battle_calc_magic_attack(
//Adds an absolute value to damage. 100 = +100 damage
#define MATK_ADD( a ) { ad.damage+= a; }
- tsc= status_get_sc(target); // used for NJ_SUITON increasing NJ_HYOUSENSOU damages
-
switch (skill_num)
{ //Calc base damage according to skill
case AL_HEAL:
@@ -2321,27 +2341,19 @@ struct Damage battle_calc_magic_attack(
skillratio -= 10;
break;
case NJ_KAENSIN:
- skillratio -= 40; // extrapolation from a vid (seems correct +/- 10%)
+ skillratio -= 50;
break;
case NJ_BAKUENRYU:
- skillratio += 50*(skill_lv-1); // recorrected after calculation from vids
- break;
- case NJ_HYOUSENSOU:
- skillratio -= 30;
- if (tsc && tsc->data[SC_SUITON].timer != -1)
- skillratio += tsc->data[SC_SUITON].val4;
+ skillratio += 50*(skill_lv-1);
break;
case NJ_HYOUSYOURAKU:
- skillratio += 50*skill_lv; // recorrected after calculation from vids
- break;
- case NJ_HUUJIN:
- skillratio += 50 + 50*skill_lv; // extrapolation from a vid (unsure)
+ skillratio += 50*skill_lv;
break;
case NJ_RAIGEKISAI:
- skillratio += 60 + 40*skill_lv; // idem
+ skillratio += 60 + 40*skill_lv;
break;
case NJ_KAMAITACHI:
- skillratio += 100*skill_lv; // idem
+ skillratio += 100*skill_lv;
break;
}
@@ -2621,8 +2633,8 @@ struct Damage battle_calc_misc_attack(
pc_payzeny(sd, md.damage);
}
- if(is_boss(target) || tsd)
- md.damage=md.damage*60/100;
+ if(is_boss(target) || tsd || map_flag_gvg2(target->m))
+ md.damage=md.damage/3;
break;
case GS_FLING:
md.damage = sd?sd->status.job_level:status_get_lv(src);
@@ -2947,13 +2959,6 @@ int battle_weapon_attack( struct block_list *src,struct block_list *target,
return 0;
}
}
- if (tsc->data[SC_UTSUSEMI].timer != -1) {
- clif_specialeffect(target, 462, AREA);
- skill_blown (src, target, tsc->data[SC_UTSUSEMI].val3);
- if (--tsc->data[SC_UTSUSEMI].val2 <= 0)
- status_change_end(target, SC_UTSUSEMI, -1);
- return 0;
- }
}
//Recycled the damage variable rather than use a new one... [Skotlex]
if(sd && (damage = pc_checkskill(sd,MO_TRIPLEATTACK)) > 0)
diff --git a/src/map/skill.c b/src/map/skill.c
index d60d4c653..5e1a87606 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -2834,8 +2834,15 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int
status_change_end(src,SC_BLADESTOP,-1);
break;
+ case NJ_ISSEN:
+ if (sc) {
+ if (sc->data[SC_NEN].timer != -1)
+ status_change_end(src,SC_NEN,-1);
+ if (sc->data[SC_HIDING].timer != -1)
+ status_change_end(src,SC_HIDING,-1);
+ }
case MO_EXTREMITYFIST:
- if (sc)
+ if (sc && skillid == MO_EXTREMITYFIST)
{
if (sc->data[SC_EXPLOSIONSPIRITS].timer != -1)
status_change_end(src, SC_EXPLOSIONSPIRITS, -1);
@@ -2847,13 +2854,13 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int
struct unit_data *ud = unit_bl2ud(src);
short dx,dy;
int i,speed;
-
+ i = skillid == MO_EXTREMITYFIST?1:2; //Move 2 cells for Issen, 1 for Asura
dx = bl->x - src->x;
dy = bl->y - src->y;
- if (dx < 0) dx--;
- else if (dx > 0) dx++;
- if (dy < 0) dy--;
- else if (dy > 0) dy++;
+ if (dx < 0) dx-=i;
+ else if (dx > 0) dx+=i;
+ if (dy < 0) dy-=i;
+ else if (dy > 0) dy+=i;
if (!dx && !dy) dy++;
if (map_getcell(src->m, src->x+dx, src->y+dy, CELL_CHKNOPASS))
{
@@ -3151,23 +3158,19 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int
break;
case NJ_KASUMIKIRI:
- skill_attack(BF_WEAPON,src,src,bl,skillid,skilllv,tick,flag);
- sc_start(src,SC_HIDING,100,skilllv,skill_get_time(skillid,skilllv));
+ if (skill_attack(BF_WEAPON,src,src,bl,skillid,skilllv,tick,flag) > 0)
+ sc_start(src,SC_HIDING,100,skilllv,skill_get_time(skillid,skilllv));
break;
case NJ_KIRIKAGE:
{
- int dir = map_calc_dir(src,bl->x,bl->y);
+ short x, y;
+ map_search_freecell(bl, 0, &x, &y, 1, 1, 0);
status_change_end(src, SC_HIDING, -1);
- skill_attack(BF_WEAPON,src,src,bl,skillid,skilllv,tick,flag);
- if (unit_movepos(src, bl->x - dirx[dir], bl->y - diry[dir], 0, 0))
+ if (unit_movepos(src, x, y, 0, 0))
clif_slide(src,src->x,src->y);
+ skill_attack(BF_WEAPON,src,src,bl,skillid,skilllv,tick,flag);
}
break;
- case NJ_ISSEN:
- skill_attack(BF_WEAPON,src,src,bl,skillid,skilllv,tick,flag);
- if (sc && sc->data[SC_NEN].timer != -1)
- status_change_end(src,SC_NEN,-1);
- break;
case 0:
if(sd) {
if (flag & 3){
@@ -6089,7 +6092,6 @@ int skill_castend_pos2 (struct block_list *src, int x, int y, int skillid, int s
case NJ_SHADOWJUMP:
{
unit_movepos(src, x, y, 1, 0);
- unit_setdir(src, (unit_getdir(src) + 4)%8);
clif_slide(src,x,y);
if (sc && sc->data[SC_HIDING].timer != -1)
@@ -8304,6 +8306,10 @@ int skill_check_condition (struct map_session_data *sd, int skill, int lv, int t
break;
case NJ_ISSEN:
+ if (status->hp < 2) {
+ clif_skill_fail(sd,skill,0,0);
+ return 0;
+ }
case NJ_BUNSINJYUTSU:
if (!sc || sc->data[SC_NEN].timer==-1) {
clif_skill_fail(sd,skill,0,0);
@@ -9307,15 +9313,16 @@ int skill_landprotector (struct block_list *bl, va_list ap)
case SA_VOLCANO:
case SA_DELUGE:
case SA_VIOLENTGALE:
- case NJ_SUITON:
- case NJ_KAENSIN:
+// Suiton/Kaensin CAN super-impose on each another.
+// case NJ_SUITON:
+// case NJ_KAENSIN:
switch (unit->group->skill_id)
{ //These cannot override each other.
case SA_VOLCANO:
case SA_DELUGE:
case SA_VIOLENTGALE:
- case NJ_SUITON:
- case NJ_KAENSIN:
+// case NJ_SUITON:
+// case NJ_KAENSIN:
(*alive) = 0;
return 1;
}
diff --git a/src/map/status.c b/src/map/status.c
index 246b90817..a31848e94 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -1060,7 +1060,8 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, int
{
if(!skill_num && !(status->mode&MD_BOSS) && tsc->data[SC_TRICKDEAD].timer != -1)
return 0;
- if(skill_num == WZ_STORMGUST && tsc->data[SC_FREEZE].timer != -1)
+ if((skill_num == WZ_STORMGUST || skill_num == NJ_HYOUSYOURAKU)
+ && tsc->data[SC_FREEZE].timer != -1)
return 0;
if(skill_num == PR_LEXAETERNA && (tsc->data[SC_FREEZE].timer != -1 || (tsc->data[SC_STONE].timer != -1 && tsc->opt1 == OPT1_STONE)))
return 0;
@@ -4923,33 +4924,14 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
val2 = 0;
break;
case SC_SUITON:
- val2 = 0; //Agi penalty
+ val2 = 0; //Agi penalty
val3 = 0; //Walk speed penalty
- val4 = 2*val1; //NJ_HYOUSENSOU damage bonus.
-
- if (status_get_class(bl) == JOB_NINJA || ( bl->type == BL_PC && !map_flag_vs(bl->m)) )
- break;
- else {
- val3 = 50;
-
- switch ((val1+1)/3) {
- case 3:
- val2 = 8;
- break;
- case 2:
- val2 = 5;
- break;
- case 1:
- val2 = 3;
+ if (status_get_class(bl) == JOB_NINJA ||
+ (sd && !map_flag_vs(bl->m)))
break;
- case 0:
- val2 = 0;
- break;
- default:
- val2 = 3*((val1+1)/3);
- break;
- }
- }
+ val3 = 50;
+ val2 = 3*((val1+1)/3);
+ if (val1 > 4) val2--;
break;
case SC_ONEHAND:
case SC_TWOHANDQUICKEN:
@@ -6788,7 +6770,7 @@ int status_change_timer_sub(struct block_list *bl, va_list ap )
case SC_SIGHTBLASTER:
if (battle_check_target( src, bl, BCT_ENEMY ) > 0 &&
status_check_skilluse(src, bl, WZ_SIGHTBLASTER, 2))
- {
+ {
skill_attack(BF_MAGIC,src,src,bl,WZ_SIGHTBLASTER,1,tick,0);
if (sc) sc->data[type].val2 = 0; //This signals it to end.
}