View Single Post
Old 01-27-2010, 02:32 AM   #41
Sinnergy
User
 
Sinnergy's Avatar
 
Join Date: Apr 2009
Posts: 173

Sinnergy has little to show at this moment (8)

Default

ok I have this skill that increases the damage on whatever damage she dealt to enemy units (10/20/30% amplify damage), base spell is from berserk, and the timer inside the trigger checks if the unit still has the berserk buff, else destroy damage modifiers.

I doubt that this trigger doesn't work, why? because I have another spell that deals 300 damage (attack type normal, damage type normal) that when tested to a 330 life unit with 0 armor, the spell left the target with 23 life without the damage modifiers applied, again tested the spell now with damage modifiers applied, now the spell left the target with 19 life, while 300 * 30% = 90 = 390 damage in total, which must kill the target instantly.

So here's the code.
Collapse Zinc:
//! zinc
library ArcaneBless requires TimerUtils, DamageModifiers, SpellEvent{
    constant integer spell = 'A01Y';
    constant integer bap = 'B00K';
    
    struct abDamage extends DamageModifier{
        integer l;
        method onDamageDealt(unit t, real dmg)->real{
            return dmg*(l*0.1);
        }
    }
    
    struct data{
        unit c;
        abDamage dm;
    }
    
    function act(){
        unit c = SpellEvent.CastingUnit;
        timer t = NewTimer();
        data d = data.create();
        d.c = c;
        d.dm = abDamage.create(c,0);
        SetTimerData(t,d);
        TimerStart(t,0.035,true,function(){
            timer t = GetExpiredTimer();
            data d = GetTimerData(t);
            if(GetUnitAbilityLevel(d.c,bap) <= 0 || GetWidgetLife(d.c) <= 0.405){
                d.dm.destroy();
                ReleaseTimer(t);
                d.destroy();
            }
            t = null;
        });
        t = null;
        c = null;
    }
    
    function onInit(){
        RegisterSpellEffectResponse(spell,act);
    }
}
//! endzinc
__________________
Current Project:
Rise of Sinnergy v1.00
Sinnergy is offline   Reply With Quote