Skip to content

Commit

Permalink
Gunslinger Mine / Ground Drift (fixes #998)
Browse files Browse the repository at this point in the history
* Fixed knock back being 6 tiles instead of 3
* Stun duration is now 5 seconds
* Blind / Silence durations are now 30 seconds (pre-re) or 20 seconds (re)
* The damage is now delayed by aMotion; as the status effect kicks in immediately, damage will break Freeze
* The base chance for a status change is now 50% instead of 5%
* It is now a weapon skill, damage% increase/reductions are now considered, in renewal the skill can completely miss
* Damage in pre-renewal is 100% + fixed damage of 50*level
* Damage in renewal is 200%+20%*level
* Fixed sphere attack not being considered in the damage formula
* The ground effect disappears immediately after activation now
  • Loading branch information
Playtester committed Mar 6, 2016
1 parent b70b259 commit e7150ee
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 35 deletions.
4 changes: 2 additions & 2 deletions db/pre-re/skill_cast_db.txt
Expand Up @@ -859,8 +859,8 @@
518,1000,1000,0,0,0,0
//-- GS_FULLBUSTER
519,0,1200:1400:1600:1800:2000:2200:2400:2600:2800:3000,0,0,10000,0
//-- GS_GROUNDDRIFT
521,2000,0,0,3000:6000:9000:12000:15000:18000:21000:24000:27000:30000,10000,0
//-- GS_GROUNDDRIFT (Upkeep2 times are duration of: Stun(lv1), Blind(lv2), Poison(lv3) and Freeze(lv4))
521,2000,0,0,3000:6000:9000:12000:15000:18000:21000:24000:27000:30000,5000:30000:30000:12000,0
//==========================================


Expand Down
2 changes: 1 addition & 1 deletion db/pre-re/skill_db.txt
Expand Up @@ -743,7 +743,7 @@
518,2,6,1,-1,0,0,10,1,no,0,0,0,weapon,5,0x0, GS_DUST,Dust
519,-9,6,1,-1,0,0,10,1,yes,0,0,0,weapon,0,0x100, GS_FULLBUSTER,Full Buster
520,-9,6,1,-1,0x2,1:1:1:2:2:2:3:3:3:4,10,1,no,0,0,0,weapon,0,0x100, GS_SPREADATTACK,Spread Attack
521,-9,6,2,-1,0x40,1,10,1,no,0,0,0,misc,3,0x100, GS_GROUNDDRIFT,Ground Drift
521,-9,6,2,-1,0x42,1,10,1,no,0,0,0,weapon,3,0x100, GS_GROUNDDRIFT,Ground Drift

//****
// Ninja
Expand Down
4 changes: 2 additions & 2 deletions db/re/skill_cast_db.txt
Expand Up @@ -874,8 +874,8 @@
519,800,1200:1400:1600:1800:2000:2200:2400:2600:2800:3000,0,0,10000,0,200
//-- GS_SPREADATTACK
520,800,1000,0,0,0,0,200
//-- GS_GROUNDDRIFT
521,800,1000,0,3000:6000:9000:12000:15000:18000:21000:24000:27000:30000,10000,0,200
//-- GS_GROUNDDRIFT (Upkeep2 times are duration of: Stun(lv1), Blind(lv2), Poison(lv3) and Freeze(lv4))
521,800,1000,0,3000:6000:9000:12000:15000:18000:21000:24000:27000:30000,5000:20000:20000:30000,0,200
//==========================================


Expand Down
2 changes: 1 addition & 1 deletion db/re/skill_db.txt
Expand Up @@ -743,7 +743,7 @@
518,2,6,1,-1,0,0,10,1,no,0,0,0,weapon,5,0x0, GS_DUST,Dust
519,-9,6,1,-1,0,0,10,1,yes,0,0,0,weapon,0,0x100, GS_FULLBUSTER,Full Buster
520,-9,6,1,-1,0x2,1:1:1:2:2:2:3:3:3:4,10,1,no,0,0,0,weapon,0,0x100, GS_SPREADATTACK,Spread Attack
521,-9,6,2,-1,0x60,1,10,1,no,0,0,0,misc,3,0x100, GS_GROUNDDRIFT,Ground Drift
521,-9,6,2,-1,0x2,1,10,1,no,0,0,0,weapon,3,0x100, GS_GROUNDDRIFT,Ground Drift

//****
// Ninja
Expand Down
28 changes: 10 additions & 18 deletions src/map/battle.c
Expand Up @@ -2231,7 +2231,7 @@ static bool is_skill_using_arrow(struct block_list *src, int skill_id)
struct status_data *sstatus = status_get_status_data(src);
struct map_session_data *sd = BL_CAST(BL_PC, src);

return ((sd && sd->state.arrow_atk) || (!sd && ((skill_id && skill_get_ammotype(skill_id)) || sstatus->rhw.range>3)) || (skill_id == HT_PHANTASMIC));
return ((sd && sd->state.arrow_atk) || (!sd && ((skill_id && skill_get_ammotype(skill_id)) || sstatus->rhw.range>3)) || (skill_id == HT_PHANTASMIC) || (skill_id == GS_GROUNDDRIFT));
} else
return false;
}
Expand Down Expand Up @@ -3648,6 +3648,11 @@ static int battle_calc_attack_skill_ratio(struct Damage wd, struct block_list *s
skillratio += 20 * (skill_lv - 1);
#endif
break;
#ifdef RENEWAL
case GS_GROUNDDRIFT:
skillratio += 100 + 20 * skill_lv;
break;
#endif
case NJ_HUUMA:
skillratio += 50 + 150 * skill_lv;
break;
Expand Down Expand Up @@ -5048,6 +5053,8 @@ static struct Damage initialize_weapon_data(struct block_list *src, struct block
break;

case GS_GROUNDDRIFT:
wd.amotion = sstatus->amotion;
//Fall through
case KN_SPEARSTAB:
case KN_BOWLINGBASH:
case MS_BOWLINGBASH:
Expand Down Expand Up @@ -5318,6 +5325,8 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src, struct bl
ATK_ADD(wd.damage, wd.damage2, skill * 2);
if (skill_id == TF_POISON)
ATK_ADD(wd.damage, wd.damage2, 15 * skill_lv);
if (skill_id == GS_GROUNDDRIFT)
ATK_ADD(wd.damage, wd.damage2, 50 * skill_lv);
if (skill_id != CR_SHIELDBOOMERANG) //Only Shield boomerang doesn't takes the Star Crumbs bonus.
ATK_ADD2(wd.damage, wd.damage2, ((wd.div_ < 1) ? 1 : wd.div_) * sd->right_weapon.star, ((wd.div_ < 1) ? 1 : wd.div_) * sd->left_weapon.star);
if (skill_id != MC_CARTREVOLUTION && pc_checkskill(sd, BS_HILTBINDING) > 0)
Expand Down Expand Up @@ -6432,12 +6441,6 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
case GS_FLING:
md.damage = (sd ? sd->status.job_level : status_get_lv(src));
break;
case GS_GROUNDDRIFT:
// Official formula [helvetica]
// bonus damage = 50 * skill level (fixed damage)
s_ele = ELE_NEUTRAL;
md.damage = battle_attr_fix(src, target, 50 * skill_lv, s_ele, tstatus->def_ele, tstatus->ele_lv);
break;
case HVAN_EXPLOSION: //[orn]
md.damage = (int64)sstatus->max_hp * (50 + 50 * skill_lv) / 100;
break;
Expand Down Expand Up @@ -6572,17 +6575,6 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
pc_payzeny(sd,(int)cap_value(md.damage, INT_MIN, INT_MAX),LOG_TYPE_STEAL,NULL);
}
break;
case GS_GROUNDDRIFT:
{
struct Damage wd = battle_calc_weapon_attack(src,target,skill_id,skill_lv,mflag);
int blewcount = skill_get_blewcount(skill_id, skill_lv);

md.damage += wd.damage;
// Knockback only from Fire Element (except from bonuses?)
if (mflag != ELE_FIRE && md.blewcount >= blewcount)
md.blewcount -= blewcount;
}
break;
}

switch(skill_id) {
Expand Down
22 changes: 11 additions & 11 deletions src/map/skill.c
Expand Up @@ -3015,7 +3015,7 @@ int64 skill_attack (int attack_type, struct block_list* src, struct block_list *
dmg = battle_calc_attack(attack_type,src,bl,skill_id,skill_lv,flag&0xFFF);

//If the damage source is a unit, the damage is not delayed
if (src != dsrc)
if (src != dsrc && skill_id != GS_GROUNDDRIFT)
dmg.amotion = 0;

//! CHECKME: This check maybe breaks the battle_calc_attack, and maybe need better calculation.
Expand Down Expand Up @@ -13641,7 +13641,7 @@ int skill_unit_onplace_timer(struct skill_unit *unit, struct block_list *bl, uns
&unit->bl,tick);
sg->unit_id = UNT_USED_TRAPS;
//clif_changetraplook(&src->bl, UNT_FIREPILLAR_ACTIVE);
sg->limit=DIFF_TICK(tick,sg->tick)+1500;
sg->limit=DIFF_TICK(tick,sg->tick);
break;

case UNT_POISONSMOKE:
Expand Down Expand Up @@ -17003,23 +17003,23 @@ static int skill_trap_splash(struct block_list *bl, va_list ap)
skill_additional_effect(ss,bl,sg->skill_id,sg->skill_lv,BF_MISC,ATK_DEF,tick);
break;
case UNT_GROUNDDRIFT_WIND:
if(skill_attack(BF_MISC,ss,src,bl,sg->skill_id,sg->skill_lv,tick,sg->val1))
sc_start(ss,bl,SC_STUN,5,sg->skill_lv,skill_get_time2(sg->skill_id, sg->skill_lv));
if(skill_attack(skill_get_type(sg->skill_id),ss,src,bl,sg->skill_id,sg->skill_lv,tick,sg->val1))
sc_start(ss,bl,SC_STUN,50,sg->skill_lv,skill_get_time2(sg->skill_id, 1));
break;
case UNT_GROUNDDRIFT_DARK:
if(skill_attack(BF_MISC,ss,src,bl,sg->skill_id,sg->skill_lv,tick,sg->val1))
sc_start(ss,bl,SC_BLIND,5,sg->skill_lv,skill_get_time2(sg->skill_id, sg->skill_lv));
if(skill_attack(skill_get_type(sg->skill_id),ss,src,bl,sg->skill_id,sg->skill_lv,tick,sg->val1))
sc_start(ss,bl,SC_BLIND,50,sg->skill_lv,skill_get_time2(sg->skill_id, 2));
break;
case UNT_GROUNDDRIFT_POISON:
if(skill_attack(BF_MISC,ss,src,bl,sg->skill_id,sg->skill_lv,tick,sg->val1))
sc_start2(ss,bl,SC_POISON,5,sg->skill_lv,ss->id,skill_get_time2(sg->skill_id, sg->skill_lv));
if(skill_attack(skill_get_type(sg->skill_id),ss,src,bl,sg->skill_id,sg->skill_lv,tick,sg->val1))
sc_start2(ss,bl,SC_POISON,50,sg->skill_lv,ss->id,skill_get_time2(sg->skill_id, 3));
break;
case UNT_GROUNDDRIFT_WATER:
if(skill_attack(BF_MISC,ss,src,bl,sg->skill_id,sg->skill_lv,tick,sg->val1))
sc_start(ss,bl,SC_FREEZE,5,sg->skill_lv,skill_get_time2(sg->skill_id, sg->skill_lv));
if(skill_attack(skill_get_type(sg->skill_id),ss,src,bl,sg->skill_id,sg->skill_lv,tick,sg->val1))
sc_start(ss,bl,SC_FREEZE,50,sg->skill_lv,skill_get_time2(sg->skill_id, 4));
break;
case UNT_GROUNDDRIFT_FIRE:
if(skill_attack(BF_MISC,ss,src,bl,sg->skill_id,sg->skill_lv,tick,sg->val1))
if(skill_attack(skill_get_type(sg->skill_id),ss,src,bl,sg->skill_id,sg->skill_lv,tick,sg->val1))
skill_blown(src,bl,skill_get_blewcount(sg->skill_id,sg->skill_lv),-1,0);
break;
case UNT_ELECTRICSHOCKER:
Expand Down

1 comment on commit e7150ee

@Playtester
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I just realized that it's poison and not silence. Should have a different duration in pre-renewal.

Please sign in to comment.