• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[SOLVED] [3.3.5]Spell::EffectWeaponDmg(SpellEffIndex effIndex) BUG

Status
Not open for further replies.

jimteck

Emulation Addict
Actually that's question
in HandleModDamagePercentDone not correct Central goes , he instead put the interest multiplies them ( not entirely correctly)
Here is the code of
Code SpellAuraEffect.cpp
Code:
void AuraEffect::HandleModDamagePercentDone(AuraApplication const* aurApp, uint8 mode, bool apply) const
{
if (!(mode & (AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK | AURA_EFFECT_HANDLE_STAT)))
return;

Unit* target = aurApp->GetTarget();
if (!target)
    return;

if (target->GetTypeId() == TYPEID_PLAYER)
{
    for (int i = 0; i < MAX_ATTACK; ++i)
        if (Item* item = target->ToPlayer()->GetWeaponForAttack(WeaponAttackType(i), false))
            target->ToPlayer()->_ApplyWeaponDependentAuraDamageMod(item, WeaponAttackType(i), this, apply);
}

if ((GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL) && (GetSpellInfo()->EquippedItemClass == -1 || target->GetTypeId() != TYPEID_PLAYER))
{
    target->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND,         TOTAL_PCT, float (GetAmount()), apply);
    target->HandleStatModifier(UNIT_MOD_DAMAGE_OFFHAND,          TOTAL_PCT, float (GetAmount()), apply);
    target->HandleStatModifier(UNIT_MOD_DAMAGE_RANGED,           TOTAL_PCT, float (GetAmount()), apply);

    if (target->GetTypeId() == TYPEID_PLAYER)
        target->ToPlayer()->ApplyPercentModFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT, float (GetAmount()), apply);
}
else
{
    // done in Player::_ApplyWeaponDependentAuraMods for SPELL_SCHOOL_MASK_NORMAL && EquippedItemClass != -1 and also for wand case
}
}
or this code not correctly work

void AuraEffect::HandleModDamagePercentDone(AuraApplication const* aurApp, uint8 mode, bool apply) const
{
if (!(mode & (AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK | AURA_EFFECT_HANDLE_STAT)))
return;

Unit* target = aurApp->GetTarget();
int32 spellGroupVal = target->GetHighestExclusiveSameEffectSpellGroupValue(this, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
if (abs(spellGroupVal) >= abs(GetAmount()))
    return;

if (target->GetTypeId() == TYPEID_PLAYER)
{
    for (int i = 0; i < MAX_ATTACK; ++i)
        if (Item* item = target->ToPlayer()->GetWeaponForAttack(WeaponAttackType(i), false))
            target->ToPlayer()->_ApplyWeaponDependentAuraDamageMod(item, WeaponAttackType(i), this, apply);
}

if ((GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL) && (GetSpellInfo()->EquippedItemClass == -1 || target->GetTypeId() != TYPEID_PLAYER))
{
    if (spellGroupVal)
    {
        target->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, float(spellGroupVal), !apply);
        target->HandleStatModifier(UNIT_MOD_DAMAGE_OFFHAND, TOTAL_PCT, float(spellGroupVal), !apply);
        target->HandleStatModifier(UNIT_MOD_DAMAGE_RANGED, TOTAL_PCT, float(spellGroupVal), !apply);
    }
    target->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, float(GetAmount()), apply);
    target->HandleStatModifier(UNIT_MOD_DAMAGE_OFFHAND,  TOTAL_PCT, float(GetAmount()), apply);
    target->HandleStatModifier(UNIT_MOD_DAMAGE_RANGED,   TOTAL_PCT, float(GetAmount()), apply);

    if (Player* player = target->ToPlayer())
    {
        if (spellGroupVal)
            player->ApplyPercentModFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT, float(spellGroupVal), !apply);

        player->ApplyPercentModFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT, float(GetAmount()), apply);
    }
}
else
{
    // done in Player::_ApplyWeaponDependentAuraMods for SPELL_SCHOOL_MASK_NORMAL && EquippedItemClass != -1 and also for wand case
}
}
When use Berserk 500% = 600% damage and when use 1 more berserk 500% = 3600%

https://github.com/TrinityCore/TrinityCore/issues/16755
 

Tommy

Founder
Well this is posted in that issue on TinityCore's project. Not much we can do, it is their issue to fix.
 

jimteck

Emulation Addict
Yes, but they are in no hurry to fix spelling , but I just need to know where to dig into the source code

"When use Berserk 500% = 600% damage and when use 1 more berserk 500% = 3600%" this is bull shit(cant add zerk in game more spells stucks)
 
Status
Not open for further replies.
Top