Jump to content

deitalk

Members
  • Posts

    14
  • Joined

  • Last visited

Posts posted by deitalk

  1. Hey, I know it is an offical behavior (reflecting damage even if the attack misses on these skills), but I'd like to know how to change items which apply short_weapon_damage_return in order to not apply damage reflect upon ATK_MISS anymore.

    battle.cpp line 6891:

    Spoiler

    if ( (skill_get_inf2(skill_id)&INF2_TRAP || !status_reflect) && sd && sd->bonus.short_weapon_damage_return ) {
                rdamage += damage * sd->bonus.short_weapon_damage_return / 100;
                rdamage = i64max(rdamage,1);

    Can anyone help me? Thanks.

  2. Actually I'm running pre-re setup, so yeah, I'd appreciate that. I've made some tests and couldn't even force directly ratio (therefore damage) to assume negative values. Even when I put damage = -ratio; it seems to revert negative to positive (ok) and when it tries to revert positives I get 0/1 damage

  3. I'm running the newest rathena on pre-re and negative values for elemental damage are being read as 1 or miss even with attribute_recover set to 1

    battle.conf:

    Spoiler

    attribute_recover: yes

    ratio on battle.cpp should determine if damage is a positive or negative value

    battle.cpp:

    Spoiler

    int64 battle_attr_fix(struct block_list *src, struct block_list *target, int64 damage,int atk_elem,int def_type, int def_lv)
    {
        struct status_change *sc = NULL, *tsc = NULL;
        int ratio;

        if (src) sc = status_get_sc(src);
        if (target) tsc = status_get_sc(target);

        if (!CHK_ELEMENT(atk_elem))
            atk_elem = rnd()%ELE_ALL;

        if (!CHK_ELEMENT(def_type) || !CHK_ELEMENT_LEVEL(def_lv)) {
            ShowError("battle_attr_fix: unknown attribute type: atk=%d def_type=%d def_lv=%d\n",atk_elem,def_type,def_lv);
            return damage;
        }

        ratio = attr_fix_table[def_lv-1][atk_elem][def_type];

    battle.cpp:

    Spoiler

    if (battle_config.attr_recover == 0 && ratio < 0)
            ratio = 0;

    #ifdef RENEWAL
        //In renewal, reductions are always rounded down so damage can never reach 0 unless ratio is 0
        damage = damage - (int64)((damage * (100 - ratio)) / 100);
    #else
        damage = (int64)((damage*ratio)/100);
    #endif

        //Damage can be negative, see battle_config.attr_recover
        return damage;

    status.cpp:

    Spoiler

    while (fgets(line, sizeof(line), fp)) {
            int lv, i, j;
            if (line[0] == '/' && line[1] == '/')
                continue;

            lv = atoi(line);
            if (!CHK_ELEMENT_LEVEL(lv))
                continue;

            for (i = 0; i < ELE_ALL;) {
                char *p;
                if (!fgets(line, sizeof(line), fp))
                    break;
                if (line[0]=='/' && line[1]=='/')
                    continue;

                for (j = 0, p = line; j < ELE_ALL && p; j++) {
                    while (*p == 32) //skipping space (32=' ')
                        p++;
                                    //TODO seem unsafe to continue without check
                    attr_fix_table[lv-1][j] = atoi(p);
                    p = strchr(p,',');
                    if(p)
                        *p++=0;
                }

                i++;
            }
            entries++;
        }

    What should I change in order to read attr_fix_table/ratio/damage negative values and make them heal target's HP?

  4. I'd like to know a way to check if a player dealt damage (any positive amount, any target) and use it as a condition to cast certain buff on skill.c. The check would reset if the player warps to another map, dies or receives dispell.

  5. Hi, I'd like to know if is there a way to make deal damage (any positive value) as a condition to use Comfort and Warm of the Sun/Moon/Stars skills instead of being in a certain map memorized bye Feeling skill. Plus, I'd like it to make damage dealing flag reset after warping or being sucessfully dispelled. Could anyone help me?

×
×
  • Create New...

Important Information

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