Skip to content

Commit

Permalink
Corrected HT_POWER behaviour, combo and type of skill, and fixed TK-c…
Browse files Browse the repository at this point in the history
  • Loading branch information
panikon committed Jul 5, 2014
1 parent 91057aa commit 3d87a99
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 17 deletions.
2 changes: 1 addition & 1 deletion db/re/skill_db.txt
Expand Up @@ -542,7 +542,7 @@
496,0,6,4,0,0x1,0,1,0,no,0,0x8,0,none,0, AM_TWILIGHT1,Twilight Alchemy 1
497,0,6,4,0,0x1,0,1,0,no,0,0x8,0,none,0, AM_TWILIGHT2,Twilight Alchemy 2
498,0,6,4,0,0x1,0,1,0,no,0,0x8,0,none,0, AM_TWILIGHT3,Twilight Alchemy 3
499,-9,8,4,-1,0,0,1,2,no,0,0x208,0,weapon,0, HT_POWER,Beast Strafing
499,-9,8,1,-1,0,0,1,2,no,0,0x8,0,weapon,0, HT_POWER,Beast Strafing
500,0,6,4,0,0x40,0,5,1,no,0,0,0,misc,0, GS_GLITTERING,Flip the Coin
501,9,6,1,-1,0x50,0,1,1,no,0,0,0,misc,0, GS_FLING,Fling
502,-9,8,1,-1,0,0,1,3,no,0,0,0,weapon,0, GS_TRIPLEACTION,Triple Action
Expand Down
24 changes: 16 additions & 8 deletions src/map/skill.c
Expand Up @@ -762,15 +762,18 @@ int skill_additional_effect(struct block_list* src, struct block_list *bl, uint1
// Chance to trigger Taekwon kicks [Dralnu]
if(sc && !sc->data[SC_COMBOATTACK]) {
if(sc->data[SC_STORMKICK_READY] &&
sc_start(src,src,SC_COMBOATTACK, 15, TK_STORMKICK,
sc_start4(src,src,SC_COMBOATTACK, 15, TK_STORMKICK,
bl->id, 2, 0,
(2000 - 4*sstatus->agi - 2*sstatus->dex)))
; //Stance triggered
else if(sc->data[SC_DOWNKICK_READY] &&
sc_start(src,src,SC_COMBOATTACK, 15, TK_DOWNKICK,
sc_start4(src,src,SC_COMBOATTACK, 15, TK_DOWNKICK,
bl->id, 2, 0,
(2000 - 4*sstatus->agi - 2*sstatus->dex)))
; //Stance triggered
else if(sc->data[SC_TURNKICK_READY] &&
sc_start(src,src,SC_COMBOATTACK, 15, TK_TURNKICK,
sc_start4(src,src,SC_COMBOATTACK, 15, TK_TURNKICK,
bl->id, 2, 0,
(2000 - 4*sstatus->agi - 2*sstatus->dex)))
; //Stance triggered
else if (sc->data[SC_COUNTERKICK_READY]) { //additional chance from SG_FRIEND [Komurka]
Expand Down Expand Up @@ -2339,10 +2342,11 @@ int skill_attack(int attack_type, struct block_list* src, struct block_list *dsr
combo=1;
break;
case AC_DOUBLE:
if( (tstatus->race == RC_BRUTE || tstatus->race == RC_INSECT) && pc->checkskill(sd, HT_POWER))
{
//TODO: This code was taken from Triple Blows, is this even how it should be? [Skotlex]
sc_start2(NULL,src,SC_COMBOATTACK,100,HT_POWER,bl->id,2000);
// AC_DOUBLE can start the combo with other monster types, but the
// monster that's going to be hit by HT_POWER should be RC_BRUTE or RC_INSECT [Panikon]
if( pc->checkskill(sd, HT_POWER) )
{
sc_start4(NULL,src,SC_COMBOATTACK,100,HT_POWER,0,1,0,2000);
clif->combo_delay(src,2000);
}
break;
Expand Down Expand Up @@ -3509,7 +3513,6 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
case WS_CARTTERMINATION: // Cart Termination
case AS_VENOMKNIFE:
case HT_PHANTASMIC:
case HT_POWER:
case TK_DOWNKICK:
case TK_COUNTER:
case GS_CHAINACTION:
Expand Down Expand Up @@ -3731,6 +3734,11 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
}
break;

case HT_POWER:
if( tstatus->race == RC_BRUTE || tstatus->race == RC_INSECT )
skill->attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag);
break;

//Splash attack skills.
case AS_GRIMTOOTH:
case MC_CARTREVOLUTION:
Expand Down
13 changes: 8 additions & 5 deletions src/map/status.c
Expand Up @@ -8095,22 +8095,25 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
}
break;

case SC_COMBOATTACK: {
case SC_COMBOATTACK:
{
//val1: Skill ID
//val2: When given, target (for autotargetting skills)
//val3: When set, this combo time should NOT delay attack/movement
//val3: If set to 2 this combo will delay ONLY attack
//val3: TK: Last used kick
//val4: TK: Combo time
struct unit_data *ud = unit->bl2ud(bl);
if (ud && !val3) {
if( ud && (!val3 || val3 == 2) ) {
tick += 300 * battle_config.combo_delay_rate/100;
ud->attackabletime = timer->gettick()+tick;
unit->set_walkdelay(bl, timer->gettick(), tick, 1);
if( !val3 )
unit->set_walkdelay(bl, timer->gettick(), tick, 1);
}
val3 = 0;
val4 = tick;
}
break;
break;
}
case SC_EARTHSCROLL:
val2 = 11-val1; //Chance to consume: 11-skill_lv%
break;
Expand Down
10 changes: 7 additions & 3 deletions src/map/unit.c
Expand Up @@ -380,8 +380,12 @@ int unit_walktoxy( struct block_list *bl, short x, short y, int flag)
unit->set_target(ud, 0);

sc = status->get_sc(bl);
if (sc && (sc->data[SC_CONFUSION] || sc->data[SC__CHAOS])) //Randomize the target position
map->random_dir(bl, &ud->to_x, &ud->to_y);
if( sc ) {
if( sc->data[SC_CONFUSION] || sc->data[SC__CHAOS] ) //Randomize the target position
map->random_dir(bl, &ud->to_x, &ud->to_y);
if( sc->data[SC_COMBOATTACK] )
status_change_end(bl, SC_COMBOATTACK, INVALID_TIMER);
}

if(ud->walktimer != INVALID_TIMER) {
// When you come to the center of the grid because the change of destination while you're walking right now
Expand Down Expand Up @@ -1103,7 +1107,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui
) {
if (sc->data[SC_COMBOATTACK]->val2)
target_id = sc->data[SC_COMBOATTACK]->val2;
else
else if( skill->get_inf(skill_id) != 1 ) // Only non-targetable skills should use auto target
target_id = ud->target;

if( skill->get_inf(skill_id)&INF_SELF_SKILL && skill->get_nk(skill_id)&NK_NO_DAMAGE )// exploit fix
Expand Down

0 comments on commit 3d87a99

Please sign in to comment.