Jump to content
  • 0
Sign in to follow this  
prism

Damage boost for basic attacks only

Question

Does anyone know of a way to do this? Currently I'm having to give huge critical hit damage bonuses to things I want to be focused on basic attacks. Maybe editing a mastery skill? I have unused ones since I don't use 3rd job on my server.

Share this post


Link to post
Share on other sites

10 answers to this question

Recommended Posts

  • 0

I made a breakthrough. I looked at the code for left and right hand mastery and found that they increase damage for nonskill attacks.

 

if(sd->status.weapon == W_KATAR && !skill_id) { //Katars (offhand damage only applies to normal attacks, tested on Aegis 10.2)
            temp = pc->checkskill(sd,TF_DOUBLE);
            wd.damage2 = wd.damage * (1 + (temp * 2))/100;

This part in bold makes it so that damage is increased when using a Katar or when not a skill. 

In Battle.C there is this area of code around critical hit damage bonuses. I dropped the bold text inside of it and it gave a global double damage bonus to players who are using basic attacks. Interestingly, it does affect Double Attack but not Sacrifice. Theoretically it should be possible to make this into an item bonus or have it be part of a skill as a passive giving x% damage bonus per level.

if(sd) {

if (!skill_id)
ATK_ADDRATE(100);


#ifndef RENEWAL
                    if (sd->bonus.atk_rate)
                        ATK_ADDRATE(sd->bonus.atk_rate);
#endif
                    if(flag.cri && sd->bonus.crit_atk_rate)
                        ATK_ADDRATE(sd->bonus.crit_atk_rate);
                    if(flag.cri && sc && sc->data[SC_MTF_CRIDAMAGE])
                        ATK_ADDRATE(25);// temporary it should be 'bonus.crit_atk_rate'
#ifndef RENEWAL

                    if(sd->status.party_id && (temp=pc->checkskill(sd,TK_POWER)) > 0){
                        if( (i = party->foreachsamemap(party->sub_count, sd, 0)) > 1 ) // exclude the player himself [Inkfish]
                            ATK_ADDRATE(2*temp*i);
                    }
#endif
                }
                break;
            } //End default case
        } //End switch(skill_id)

Share this post


Link to post
Share on other sites
  • 0

An item bonus or a skill passive would work. Basically something that I can give to a character that makes non-skill attacks do more damage(no Sacrifice). Ranged or melee. 

Share this post


Link to post
Share on other sites
  • 0

Just tested a bunch of crap, Ill need to try something else

*sigh*

 

test results : 

Spoiler

I could make something similar to sac but :

1) You wouldnt have sound effects that your weapon normally makes like gun sounds... 
But it would still be modifiable by element, have no limitations, infinite duration , and the damage would be easily modifiable... and most likely able to be able to be added as a permanent buff on equipment

2)I cant figure out how just change basic attack damage within the formula... Everything ive tried so far still effects skill damage on Pre Re

3)Left hand basic attacks look interesting and need to be looked at again

Maybe someone can help me read this , I added comments afters **********************

Spoiler

int64 battle_calc_base_damage2(struct status_data *st, struct weapon_atk *wa, struct status_change *sc, unsigned short t_size, struct map_session_data *sd, int flag) {
    unsigned int atkmin=0, atkmax=0;
    short type = 0;
    int64 damage = 0;

    nullpo_retr(damage, st);
    nullpo_retr(damage, wa);
    
    if (!sd) { //Mobs/Pets
        if(flag&4) {*******************************If magic crasher we consider it MATK
            atkmin = st->matk_min;
            atkmax = st->matk_max;
        } else {
            atkmin = wa->atk;
            atkmax = wa->atk2;
        }
        if (atkmin > atkmax)
            atkmin = atkmax;***this just means if your min atk is greater then max... itll take your max 
    } else { //PCs
        atkmax = wa->atk;
        type = (wa == &st->lhw)?EQI_HAND_L:EQI_HAND_R;

        if (!(flag&1) || (flag&2)) { //Normal attacks    *************** NOT CRIT but BOW attack
            atkmin = st->dex;

            if (sd->equip_index[type] >= 0 && sd->inventory_data[sd->equip_index[type]])
                atkmin = atkmin*(80 + sd->inventory_data[sd->equip_index[type]]->wlv*20)/100;

*****this means if you have anything equipped itll start searching for things that effect the formula

            if (atkmin > atkmax)
                atkmin = atkmax;

            if(flag&2 && !(flag&16)) { //Bows   *******BOWS NOT GUNS (seems like bows are really tight)
                atkmin = atkmin*atkmax/100;
                if (atkmin > atkmax)
                    atkmax = atkmin;
            }
        }
    }

    if (sc && sc->data[SC_MAXIMIZEPOWER])  ************BALANCE ATK
        atkmin = atkmax;

    //Weapon Damage calculation
    if (!(flag&1)) ********************************************NON Crit attack
        damage = (atkmax>atkmin? rnd()%((atkmax)-atkmin):0)+atkmin;
    else *****************CRIT ALWAYS DEAL MAX DAM
        damage = atkmax;

    if (sd) {
        //rodatazone says the range is 0~arrow_atk-1 for non crit
        if (flag&2 && sd->bonus.arrow_atk)
            damage += ( (flag&1) ? sd->bonus.arrow_atk : rnd()%sd->bonus.arrow_atk );

        //SizeFix only for players
        if (!(sd->special_state.no_sizefix || (flag&8)))
            damage = damage * ( type == EQI_HAND_L ? sd->left_weapon.atkmods[t_size] : sd->right_weapon.atkmods[t_size] ) / 100;
    }

    //Finally, add baseatk********************I dont know all the different ATKS but i guess this is from stat
    if(flag&4)*************************magic crasher
        damage += st->matk_min;
    else****************************Normal
        damage += st->batk;
            

    //rodatazone says that Overrefined bonuses are part of baseatk
    //Here we also apply the weapon_atk_rate bonus so it is correctly applied on left/right hands.
    if(sd) {
        if (type == EQI_HAND_L) {*************************refine bonuses or something
            if(sd->left_weapon.overrefine)
                damage += rnd()%sd->left_weapon.overrefine+1;
            if (sd->weapon_atk_rate[sd->weapontype2])
                damage += damage * sd->weapon_atk_rate[sd->weapontype2] / 100;
        } else { //Right hand
            if(sd->right_weapon.overrefine)
                damage += rnd()%sd->right_weapon.overrefine+1;
            if (sd->weapon_atk_rate[sd->weapontype1])
                damage += damage * sd->weapon_atk_rate[sd->weapontype1] / 100;
        }
    }
    return damage;
}

Maybe its in battle_calc_base_damage1 but it says its only applied in renewal? I deleted most renewal files but didnt touch src related stuff and when i changed back to renewal battle_calc_base_damage1 still did nothing..........Maybe its somewhere else completely

 

Ill have to redownload the herc database >___>

Edited by Sakurada

Share this post


Link to post
Share on other sites
  • 0
Spoiler

 

Ok after redownload hercules and trying out battle_calc_base_damage


/*==========================================
 * Calculates the standard damage of a normal attack assuming it hits,
 * it calculates nothing extra fancy, is needed for magnum breaks WATK_ELEMENT bonus. [Skotlex]
 *------------------------------------------
 * Pass damage2 as NULL to not calc it.
 * Flag values: // TODO: Check whether these values are correct (the flag parameter seems to be passed through to other functions), and replace them with an enum.
 * &1: Critical hit
 * &2: Arrow attack
 * &4: Skill is Magic Crasher
 * &8: Skip target size adjustment (Extremity Fist?)
 *&16: Arrow attack but BOW, REVOLVER, RIFLE, SHOTGUN, GATLING or GRENADE type weapon not equipped (i.e. shuriken, kunai and venom knives not affected by DEX)
 */
/* 'battle_calc_base_damage' is used on renewal, 'battle_calc_base_damage2' otherwise. */
// FIXME: Missing documentation for flag2
static int64 battle_calc_base_damage(struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int nk, bool n_ele, short s_ele, short s_ele_, int type, int flag, int flag2)
{
	int64 damage;
	struct status_data *st = status->get_status_data(src);
	struct status_change *sc = status->get_sc(src);
	const struct map_session_data *sd = NULL;
	nullpo_retr(0, src);

	sd = BL_CCAST(BL_PC, src);

	if ( !skill_id ) {
		s_ele = st->rhw.ele;
		s_ele_ = st->lhw.ele;
		if (sd != NULL) {
			if (sd->charm_type != CHARM_TYPE_NONE && sd->charm_count >= MAX_SPIRITCHARM) {
				s_ele = s_ele_ = sd->charm_type;
			}
			if (flag&2 && sd->bonus.arrow_ele != 0)
				s_ele = sd->bonus.arrow_ele;
		}
	}
	if (src->type == BL_PC) {
		int64 batk;
		// Property from mild wind bypasses it
		if (sc && sc->data[SC_TK_SEVENWIND])
			batk = battle->calc_elefix(src, bl, skill_id, skill_lv, status->calc_batk(bl, sc, st->batk, false), nk, n_ele, s_ele, s_ele_, false, flag)*3;
		else
			batk = battle->calc_elefix(src, bl, skill_id, skill_lv, status->calc_batk(bl, sc, st->batk, false), nk, n_ele, ELE_NEUTRAL, ELE_NEUTRAL, false, flag)*3;
		if (type == EQI_HAND_L)
			damage = batk + 3 * battle->calc_weapon_damage(src, bl, skill_id, skill_lv, &st->lhw, nk, n_ele, s_ele, s_ele_, status_get_size(bl), type, flag, flag2) / 4;
		else
			damage = (batk << 1) + battle->calc_weapon_damage(src, bl, skill_id, skill_lv, &st->rhw, nk, n_ele, s_ele, s_ele_, status_get_size(bl), type, flag, flag2)*3;
	} else {
		damage = st->batk + battle->calc_weapon_damage(src, bl, skill_id, skill_lv, &st->rhw, nk, n_ele, s_ele, s_ele_, status_get_size(bl), type, flag, flag2)*3;
	}

	return damage;
}

Im gonna assume that "a normal attack" is vaguely trying to say anything that isnt misc damage sort of thing

Because any changes i make here also effect skill damage. . . and cross referance with other code... they dont even use this anymore or its just moved

 

above is results of further testing

 

 

Anyways the only thing I can promise you is a skill that:

-could be a permanent buff

-only effects basic attack, and damage is easily modifiable.. also effect by weapon element

-ive seen a skill crit add on so i guess its possible for crit to work

However your gonna lose your weapon sounds and itll just sound like a skill cast and your character swinging its weapon...not sure if i can delete the text bubble either

 

 

Maybe ill figure something out later 

Edited by Sakurada

Share this post


Link to post
Share on other sites
  • 0

Could the bonus to damage scale with the skill level of the buff?

 

However your gonna lose your weapon sounds and itll just sound like a skill cast and your character swinging its weapon...not sure if i can delete the text bubble either

Can you explain this a little more? Do you mean what when the skill for the buff it cast weapon sounds won't work properly for the duration of it and the text will be floating there?

Share this post


Link to post
Share on other sites
  • 0
5 minutes ago, prism said:

Could the bonus to damage scale with the skill level of the buff?

 

However your gonna lose your weapon sounds and itll just sound like a skill cast and your character swinging its weapon...not sure if i can delete the text bubble either

Can you explain this a little more? Do you mean what when the skill for the buff it cast weapon sounds won't work properly for the duration of it and the text will be floating there?

 

 

my sprites are fucked cause im doing something on my server

 

But yeah this is a really dirty skill and i wouldnt use it - I would change all my skill damages before using this

1)no weapon sprite

2)no weapon sound

3)obnoxious skill cast animation ( I think i can find an id without this )

 

 

This is all I can figure out at the moment, maybe in a few years ill have something better :yes:

Ill give it to you if you want. . . 

Share this post


Link to post
Share on other sites
  • 0

Wowwee. That's a pretty serious side effect. Imagine at higher ASPD. How would a copy of Sacrifice that scales off ATK instead of HP with a buff timer instead of number of hits do? I could probably attach it to the player with sc_start in itemdb.

Edited by prism

Share this post


Link to post
Share on other sites
  • 0
1 hour ago, prism said:

Wowwee. That's a pretty serious side effect. Imagine at higher ASPD. How would a copy of Sacrifice that scales off ATK instead of HP with a buff timer instead of number of hits do? I could probably attach it to the player with sc_start in itemdb.

What I made does scale off attack, Im pretty sure i just set it to +100% ATK per level 

Itd still look the same, I could give it a toggle/timer instead of hits yeah(the video its just set to infinite). . . 

 

Another thing we could try is to re apply the thiefs double hit passive, Ill check that out tonight 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.