summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/battle.c12
-rw-r--r--src/map/skill.c188
-rw-r--r--src/map/skill.h7
-rw-r--r--src/map/status.c2
-rw-r--r--src/map/status.h2
5 files changed, 80 insertions, 131 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index a1f0e2a90..34ff61ad2 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -314,7 +314,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i
rand()%100 < sc->data[SC_KAUPE].val2 &&
(src->type == BL_PC || !skill_num))
{ //Kaupe only blocks all skills of players.
- clif_skill_nodamage(bl,bl,SL_KAUPE,1,1);
+ clif_specialeffect(bl, 462, AREA);
if (--sc->data[SC_KAUPE].val3 <= 0) //We make it work like Safety Wall, even though it only blocks 1 time.
status_change_end(bl, SC_KAUPE, -1);
return 0;
@@ -322,7 +322,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i
if(sc->data[SC_UTSUSEMI].timer != -1 && !skill_num)
{
- clif_skill_nodamage(bl,bl,NJ_UTSUSEMI,1,1);
+ clif_specialeffect(bl, 462, AREA);
skill_blown (src, bl, sc->data[SC_UTSUSEMI].val3);
if (--sc->data[SC_UTSUSEMI].val2 <= 0)
status_change_end(bl, SC_UTSUSEMI, -1);
@@ -331,7 +331,6 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i
if(sc->data[SC_BUNSINJYUTSU].timer != -1 && (flag&(BF_WEAPON|BF_MISC)) )
{
- clif_skill_nodamage(bl,bl,NJ_BUNSINJYUTSU,1,1);
if (--sc->data[SC_BUNSINJYUTSU].val2 <= 0)
status_change_end(bl, SC_BUNSINJYUTSU, -1);
return 0;
@@ -2347,8 +2346,8 @@ struct Damage battle_calc_magic_attack(
case NJ_KOUENKA:
skillratio -= 10;
break;
- case NJ_HUUJIN:
- skillratio += 50 + 50*skill_lv; // extrapolation from a vid (unsure)
+ case NJ_KAENSIN:
+ skillratio -= 40; // extrapolation from a vid (seems correct +/- 10%)
break;
case NJ_BAKUENRYU:
skillratio += 50*(skill_lv-1); // recorrected after calculation from vids
@@ -2361,6 +2360,9 @@ struct Damage battle_calc_magic_attack(
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)
+ break;
case NJ_RAIGEKISAI:
skillratio += 60 + 40*skill_lv; // idem
break;
diff --git a/src/map/skill.c b/src/map/skill.c
index 2cd3ff4e6..3de357f22 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1827,11 +1827,12 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
if (attack_type&BF_MAGIC) {
if(sc && sc->data[SC_KAITE].timer != -1 && (dmg.damage || dmg.damage2)
- && !(sstatus->mode&MD_BOSS) && (sd || status_get_lv(dsrc) <= 80)
- ) { //Works on players or mobs with level under 80.
- clif_skill_nodamage(bl,bl,SL_KAITE,sc->data[SC_KAITE].val1,1);
+ && !(sstatus->mode&MD_BOSS) && (src->type == BL_PC || status_get_lv(src) <= 80) )
+ { //Works on players or mobs with level under 80.
+ clif_specialeffect(bl, 438, AREA);
if (--sc->data[SC_KAITE].val2 <= 0)
status_change_end(bl, SC_KAITE, -1);
+ clif_skill_nodamage(bl,src,skillid,skilllv,1);
bl = src; //Just make the skill attack yourself @.@
sc = status_get_sc(bl);
tsd = (bl->type == BL_PC)?(TBL_PC*)bl:NULL;
@@ -2010,7 +2011,7 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
if (ud && ud->skilltarget == bl->id)
dmg.dmotion = clif_skill_damage(dsrc,bl,tick,dmg.amotion,dmg.dmotion, damage, dmg.div_, skillid, (lv!=0)?lv:skilllv, type);
else
- dmg.dmotion = clif_skill_damage(dsrc,bl,tick,dmg.amotion,dmg.dmotion, damage, dmg.div_, skillid, -1, 5); //TODO: Check whether it's better to send -1 in skilllv or also send 0 as skillid, maybe even change this to a clif_damage packet?
+ dmg.dmotion = clif_damage(src,bl,tick,dmg.amotion,dmg.dmotion,damage,dmg.div_,8,dmg.damage2); // can't know why 8, but it works for all skills...
break;
}
case PA_GOSPEL: //Should look like Holy Cross [Skotlex]
@@ -2081,7 +2082,10 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
//Only knockback if it's still alive, otherwise a "ghost" is left behind. [Skotlex]
if (dmg.blewcount > 0 && !status_isdead(bl))
- skill_blown(dsrc,bl,dmg.blewcount);
+ {
+ if ( skillid != NJ_TATAMIGAESHI ) skill_blown(dsrc,bl,dmg.blewcount);
+ else skill_blown(src,bl,dmg.blewcount);
+ }
//Delayed damage must be dealt after the knockback (it needs to know actual position of target)
if (dmg.amotion)
@@ -2824,40 +2828,39 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int
break;
//Splash attack skills.
+ case AS_SPLASHER:
+ if ( (flag&1) && bl->id != skill_area_temp[1] )
+ {
+ skill_attack(skill_get_type(skillid), src, src, bl, skillid, skilllv, tick, 1);
+ break;
+ }
case AS_GRIMTOOTH:
case MC_CARTREVOLUTION:
case NPC_SPLASHATTACK:
- case AC_SHOWER: //Targetted skill implementation.
+ case AC_SHOWER:
+ case MG_NAPALMBEAT:
+ case MG_FIREBALL:
+ case HW_NAPALMVULCAN:
+ case HT_BLITZBEAT:
+ case NJ_HUUMA:
case NJ_BAKUENRYU:
- if(flag&1){
- if(bl->id!=skill_area_temp[1]){
- skill_attack(skill_get_type(skillid),src,src,bl,skillid,skilllv,tick,
- 0x0500);
- }
- } else {
- skill_area_temp[1]=bl->id;
- map_foreachinrange(skill_area_sub, bl,
- skill_get_splash(skillid, skilllv), BL_CHAR,
- src,skillid,skilllv,tick, flag|BCT_ENEMY|1,
- skill_castend_damage_id);
- //Skill-attack at the end in case it has knockback. [Skotlex]
- skill_attack(skill_get_type(skillid),src,src,bl,skillid,skilllv,tick,0);
- }
- break;
-
- case AS_SPLASHER:
if (flag & 1) { //Invoked from map_foreachinarea, skill_area_temp[0] holds number of targets to divide damage by.
- if (bl->id != skill_area_temp[0])
- skill_attack(BF_WEAPON, src, src, bl, skillid, skilllv, tick, 1);
+ skill_attack(skill_get_type(skillid), src, src, bl, skillid, skilllv, tick, skill_area_temp[0]);
} else {
- skill_area_temp[0] = bl->id;
+ if ( skillid == NJ_BAKUENRYU ) clif_skill_nodamage(src,bl,skillid,skilllv,1);
+ skill_area_temp[0] = 0;
+ skill_area_temp[1] = bl->id;
+ if ( (skill_get_nk(skillid)&NK_SPLASHSPLIT) || (skillid==HT_BLITZBEAT && flag&0xf00000) ) //Warning, 0x100000 is currently BCT_NEUTRAL, so don't mix it when asking for the enemy. [Skotlex]
+ map_foreachinrange(skill_area_sub, bl,
+ skill_get_splash(skillid, skilllv), BL_CHAR,
+ src, skillid, skilllv, tick, flag|BCT_ENEMY, skill_area_sub_count);
map_foreachinrange(skill_area_sub, bl,
skill_get_splash(skillid, skilllv), BL_CHAR,
- src, skillid, skilllv, tick, BCT_ENEMY|1,
+ src, skillid, skilllv, tick, flag|BCT_ENEMY|1,
skill_castend_damage_id);
- skill_attack(BF_WEAPON, src, src, bl, skillid, skilllv, tick, 0);
}
break;
+
case SM_MAGNUM:
if(flag&1)
skill_attack(BF_WEAPON,src,src,bl,skillid,skilllv,tick,flag);
@@ -3020,56 +3023,6 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int
skill_attack(BF_MAGIC, src, src, bl, skillid, skilllv, tick, flag);
break;
- case MG_NAPALMBEAT:
- case MG_FIREBALL:
- if (flag & 1) {
- if (bl->id == skill_area_temp[1])
- break;
- if(skillid == MG_FIREBALL) //Store distance.
- skill_area_temp[0] = distance_blxy(bl, skill_area_temp[2], skill_area_temp[3]);
- skill_attack(BF_MAGIC,src,src,bl,skillid,skilllv,tick, skill_area_temp[0]| 0x0500);
- } else {
- skill_area_temp[0]=0;
- skill_area_temp[1]=bl->id;
- switch (skillid) {
- case MG_NAPALMBEAT:
- map_foreachinrange(skill_area_sub, bl,
- skill_get_splash(skillid, skilllv),BL_CHAR,
- src,skillid,skilllv,tick,flag|BCT_ENEMY,
- skill_area_sub_count);
- break;
- case MG_FIREBALL:
- skill_area_temp[2]=bl->x;
- skill_area_temp[3]=bl->y;
- break;
- }
- skill_attack(BF_MAGIC,src,src,bl,skillid,skilllv,tick, skill_area_temp[0]);
- map_foreachinrange(skill_area_sub,bl,
- skill_get_splash(skillid, skilllv),BL_CHAR,
- src,skillid,skilllv,tick, flag|BCT_ENEMY|1,
- skill_castend_damage_id);
- }
- break;
-
- case HW_NAPALMVULCAN: // Fixed By SteelViruZ
- if (flag & 1) {
- if (bl->id != skill_area_temp[1])
- skill_attack(BF_MAGIC, src, src, bl, skillid, skilllv, tick, skill_area_temp[0]);
- } else {
- skill_area_temp[0] = 0;
- skill_area_temp[1] = bl->id;
- map_foreachinrange(skill_area_sub, bl,
- skill_get_splash(skillid, skilllv), BL_CHAR,
- src, skillid, skilllv, tick, flag|BCT_ENEMY,
- skill_area_sub_count);
- skill_attack(BF_MAGIC, src, src, bl, skillid, skilllv, tick, skill_area_temp[0]);
- map_foreachinrange(skill_area_sub, bl,
- skill_get_splash(skillid, skilllv), BL_CHAR,
- src, skillid, skilllv, tick, flag|BCT_ENEMY|1,
- skill_castend_damage_id);
- }
- break;
-
case SL_STIN:
case SL_STUN:
case SL_SMA:
@@ -3080,22 +3033,6 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int
}
skill_attack(BF_MAGIC,src,src,bl,skillid,skilllv,tick,flag);
break;
-
- case HT_BLITZBEAT:
- if (flag & 1) { //Invoked from map_foreachinarea, skill_area_temp[0] holds number of targets to divide damage by.
- skill_attack(BF_MISC, src, src, bl, skillid, skilllv, tick, skill_area_temp[0]);
- } else {
- skill_area_temp[0] = 0;
- if (flag & 0xf00000) //Warning, 0x100000 is currently BCT_NEUTRAL, so don't mix it when asking for the enemy. [Skotlex]
- map_foreachinrange(skill_area_sub, bl,
- skill_get_splash(skillid, skilllv), BL_CHAR,
- src, skillid, skilllv, tick, BCT_ENEMY, skill_area_sub_count);
- map_foreachinrange(skill_area_sub, bl,
- skill_get_splash(skillid, skilllv), BL_CHAR,
- src, skillid, skilllv, tick, BCT_ENEMY|1,
- skill_castend_damage_id);
- }
- break;
case NPC_DARKBREATH:
clif_emotion(src,7);
@@ -3162,33 +3099,18 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int
skill_castend_damage_id);
}
break;
- case NJ_HUUMA:
- if (flag & 1) {
- skill_attack(BF_WEAPON, src, src, bl, skillid, skilllv, tick, skill_area_temp[0]);
- } else {
- skill_area_temp[0] = 0;
- map_foreachinrange(skill_area_sub, bl,
- skill_get_splash(skillid, skilllv), BL_CHAR,
- src, skillid, skilllv, tick, flag|BCT_ENEMY,
- skill_area_sub_count);
- map_foreachinrange(skill_area_sub, bl,
- skill_get_splash(skillid, skilllv), BL_CHAR,
- src, skillid, skilllv, tick, flag|BCT_ENEMY|1,
- skill_castend_damage_id);
- }
- 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));
break;
case NJ_KIRIKAGE:
- status_change_end(src, SC_HIDING, -1);
- skill_attack(BF_WEAPON,src,src,bl,skillid,skilllv,tick,flag);
- if (unit_movepos(src, bl->x, bl->y, 0, 0))
- { //FIXME: Why are you sending a packet to LIE about where the character is?
- //If you want to place yourself adjacent to the target, do the proper coding..?
- int dir = unit_getdir(src);
- clif_slide(src,src->x - dirx[dir],src->y - diry[dir]);
+ {
+ int dir = map_calc_dir(src,bl->x,bl->y);
+ 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)) // fixed... sorry for this o_O
+ clif_slide(src,bl->x - dirx[dir],bl->y - diry[dir]);
}
break;
case NJ_ISSEN:
@@ -4065,6 +3987,9 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
skill_castend_damage_id);
break;
+ case NJ_HYOUSYOURAKU:
+ case NJ_RAIGEKISAI:
+ clif_skill_nodamage(src,bl,skillid,skilllv,1);
case WZ_FROSTNOVA:
map_foreachinrange(skill_attack_area, src,
skill_get_splash(skillid, skilllv), BL_CHAR,
@@ -6706,7 +6631,7 @@ struct skill_unit_group *skill_unitsetting (struct block_list *src, int skillid,
if (sd) val1 = sd->status.child;
break;
case NJ_KAENSIN:
- skill_clear_group(src, 4); //Delete previous Kaensins
+ skill_clear_group(src, 1); //Delete previous Kaensins
val2 = (skilllv+1)/2 + 4;
break;
@@ -7231,6 +7156,17 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
}
case UNT_TATAMIGAESHI:
+ {
+ struct skill_unit_group *sug; // better name needed :D
+
+ if ( (sug = map_find_skill_unit_oncell(bl,bl->x,bl->y,NJ_TATAMIGAESHI,NULL)->group) != NULL )
+ {
+ if ( DIFF_TICK(gettick(), sug->tick) <= skill_get_time2(sg->skill_id, sg->skill_lv) )
+ skill_attack(BF_WEAPON,ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick,0);
+ }
+ break;
+ }
+
case UNT_DEMONSTRATION:
skill_attack(BF_WEAPON,ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick,0);
break;
@@ -9207,11 +9143,8 @@ int skill_clear_group (struct block_list *bl, int flag)
case SA_VIOLENTGALE:
case SA_LANDPROTECTOR:
case NJ_SUITON:
- if (flag&1)
- group[count++]= ud->skillunit[i];
- break;
case NJ_KAENSIN:
- if (flag&4)
+ if (flag&1)
group[count++]= ud->skillunit[i];
break;
default:
@@ -9322,11 +9255,15 @@ 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:
switch (unit->group->skill_id)
{ //These override each other.
case SA_VOLCANO:
case SA_DELUGE:
case SA_VIOLENTGALE:
+ case NJ_SUITON:
+ case NJ_KAENSIN:
(*alive) = 0;
return 1;
}
@@ -10856,6 +10793,15 @@ void skill_init_unit_layout (void)
memcpy(skill_unit_layout[pos].dy,dy,sizeof(dy));
break;
}
+ case NJ_KAENSIN:
+ {
+ static const int dx[] = {-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,};
+ static const int dy[] = { 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 0, 0, 0, 0,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2,};
+ skill_unit_layout[pos].count = 24;
+ memcpy(skill_unit_layout[pos].dx,dx,sizeof(dx));
+ memcpy(skill_unit_layout[pos].dy,dy,sizeof(dy));
+ break;
+ }
case NJ_TATAMIGAESHI:
{
//Level 1 (count 4, cross of 3x3)
diff --git a/src/map/skill.h b/src/map/skill.h
index 48e88033d..b9e082a76 100644
--- a/src/map/skill.h
+++ b/src/map/skill.h
@@ -23,7 +23,8 @@
//Constants to identify a skill's nk value.
//The NK value applies only to non INF_GROUND_SKILL skills.
#define NK_NO_DAMAGE 0x1
-#define NK_SPLASH 0x2
+#define NK_SPLASH (0x2|0x4) // 0x4 = splash & split
+#define NK_SPLASHSPLIT 0x4
//A skill with 3 would be no damage + splash: area of effect.
//Constants to identify a skill's inf2 value.
#define INF2_QUEST_SKILL 1
@@ -938,9 +939,9 @@ enum {
UNT_SPIDERWEB,
UNT_GRAVITATION,
UNT_HERMODE,
- UNT_TATAMIGAESHI, //0xba //Temporary setting until correct value is found.
+ UNT_DESPERADO, //0xba //Temporary setting until correct value is found.
UNT_SUITON = 0xbb,
- UNT_DESPERADO, //NJ_TATAMIGAESHI is 0xbc as well?
+ UNT_TATAMIGAESHI,
UNT_KAENSIN,
//0xbe, 0xc0, 0xc1 //Maybe the other elements of Ground Drift?
UNT_GROUNDDRIFT = 0xc2,
diff --git a/src/map/status.c b/src/map/status.c
index 5ecb9a93b..9d8d5ac29 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -357,7 +357,7 @@ void initChangeTables(void) {
add_sc(NJ_HYOUSYOURAKU, SC_FREEZE);
set_sc(NJ_NEN, SC_NEN, SI_NEN, SCB_STR|SCB_INT);
set_sc(NJ_UTSUSEMI, SC_UTSUSEMI, SI_UTSUSEMI,SCB_NONE);
- set_sc(NJ_BUNSINJYUTSU, SC_BUNSINJYUTSU, SI_BLANK, SCB_NONE);
+ set_sc(NJ_BUNSINJYUTSU, SC_BUNSINJYUTSU, SI_BUNSINJYUTSU, SCB_NONE);
set_sc(CR_SHRINK, SC_SHRINK, SI_SHRINK, SCB_NONE);
set_sc(RG_CLOSECONFINE, SC_CLOSECONFINE2, SI_CLOSECONFINE2, SCB_NONE);
set_sc(RG_CLOSECONFINE, SC_CLOSECONFINE, SI_CLOSECONFINE, SCB_FLEE);
diff --git a/src/map/status.h b/src/map/status.h
index d35832836..ae30b5415 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -395,7 +395,7 @@ enum {
SI_GATLINGFEVER = 204,
SI_TKREST = 205, // 205 = Gloria again (but TK- Happy State looks like it)
SI_UTSUSEMI = 206,
- // 207 = crash (corresponds to SI_BUNSINJYUTSU). Must be fixed.
+ SI_BUNSINJYUTSU = 207,
SI_NEN = 208,
SI_ADJUSTMENT = 209,
SI_ACCURACY = 210