Issue information

Issue ID
#2513
Status
Fixed
Severity
None
Started
Hercules Elf Bot
Dec 4, 2008 9:10
Last Post
Hercules Elf Bot
Mar 5, 2012 16:50
Confirmation
N/A

Hercules Elf Bot - Dec 4, 2008 9:10

Originally posted by [b]PanA[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=2513

Situation
1. Character gets Full Chemical Protection
2. Character's hp < 1000
3. Character get damage from breaker Taro Card (1000 damag + breaks random equipment)

=> 4. Character dies and get one broken piece of equipment.

Is this bug?


Reason of this:
0. Character dies (hp < 0)
1. On death executes status_change_clear(...) (clear Full Chemical Protection)
2. Then executes breaker code from Taro Card

To fix it:

In skill.c should be:
CODE
    case CG_TAROTCARD:
...
                case 3:    // 1000 damage, random armor destroyed
                    {
                        int where[] = { EQP_ARMOR, EQP_SHIELD, EQP_HELM };
                        skill_break_equip(bl, where[rand()%3], 10000, BCT_ENEMY);
                        status_fix_damage(src, bl, 1000, 0);
                        clif_damage(src,bl,tick,0,0,1000,0,0,0);
                    }
...
                case 10:    // 6666 damage, atk matk halved, cursed
                    status_fix_damage(src, bl, 6666, 0);
                    clif_damage(src,bl,tick,0,0,6666,0,0,0);
                    if (!status_isdead(bl))
                    {
                        sc_start(bl,SC_INCATKRATE,100,-50,skill_get_time2(skillid,skilllv));
                        sc_start(bl,SC_INCMATKRATE,100,-50,skill_get_time2(skillid,skilllv));
                        sc_start(bl,SC_CURSE,skilllv,100,skill_get_time2(skillid,skilllv));
                    }
                    break;


Taro Card firstly break equipment and then inflict damage.

And like in skill_attack(...) with skill_additional_effect(...)
CODE
    if (!dmg.amotion) {
        status_fix_damage(src,bl,damage,dmg.dmotion); //Deal damage before knockback to allow stuff like firewall+storm gust combo.
        if (damage > 0) {
            if (!status_isdead(bl))
                skill_additional_effect(src,bl,skillid,skilllv,attack_type,tick);
            //Counter status effects [Skotlex]
            skill_counter_additional_effect(dsrc,bl,skillid,skilllv,attack_type,tick);
        }
    }

Sorry, my English is very bad.