#1
function Trig_doublehit_Conditions takes nothing returns boolean
if ( ( GetUnitAbilityLevelSwapped('XXXX', GetAttacker()) > 0 ) ) then
return true
else
return false
endif
endfunction
function Trig_doublehit_Actions takes nothing returns nothing
local integer i = GetRandomInt(1, 100)
if ( ( i <= ( GetUnitAbilityLevelSwapped('XXXX', GetAttacker()) * 5 ) ) ) then
call SetUnitLifeBJ( GetAttackedUnitBJ(), ( GetUnitStateSwap(UNIT_STATE_LIFE, GetAttackedUnitBJ()) - GetEventDamage() ) )
endif
endfunction
//===========================================================================
function InitTrig_doublehit takes nothing returns nothing
set gg_trg_doublehit = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_doublehit, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_doublehit, Condition( function Trig_doublehit_Conditions ) )
call TriggerAddAction( gg_trg_doublehit, function Trig_doublehit_Actions )
endfunction
raulsorry dude just saw the topic and posted, i was kinda weary that evening
in JASS:function Trig_doublehit_Conditions takes nothing returns boolean if ( ( GetUnitAbilityLevelSwapped('XXXX', GetAttacker()) > 0 ) ) then return true else return false endif endfunction function Trig_doublehit_Actions takes nothing returns nothing local integer i = GetRandomInt(1, 100) if ( ( i <= ( GetUnitAbilityLevelSwapped('XXXX', GetAttacker()) * 5 ) ) ) then call SetUnitLifeBJ( GetAttackedUnitBJ(), ( GetUnitStateSwap(UNIT_STATE_LIFE, GetAttackedUnitBJ()) - GetEventDamage() ) ) endif endfunction //=========================================================================== function InitTrig_doublehit takes nothing returns nothing set gg_trg_doublehit = CreateTrigger( ) call TriggerRegisterAnyUnitEventBJ( gg_trg_doublehit, EVENT_PLAYER_UNIT_ATTACKED ) call TriggerAddCondition( gg_trg_doublehit, Condition( function Trig_doublehit_Conditions ) ) call TriggerAddAction( gg_trg_doublehit, function Trig_doublehit_Actions ) endfunction
All you have to do is to change the 'XXXX' values with the ability raw code of your passive skill and change the values for the chance (I set it to 5% per level).
function Trig_doublehit_Conditions takes nothing returns boolean
if ( ( GetUnitAbilityLevelSwapped('XXXX', GetAttacker()) > 0 ) ) then
return true
else
return false
endif
endfunction
//should be
function Trig_doublehit_Conditions takes nothing returns boolean
return GetUnitAbilityLevelSwapped('XXXX', GetAttacker()) > 0
endfunctionraulmy code was correct
function Trig_doublehit_Conditions takes nothing returns boolean if ( ( GetUnitAbilityLevelSwapped('XXXX', GetAttacker()) > 0 ) ) then return true else return false endif endfunction //should be function Trig_doublehit_Conditions takes nothing returns boolean return GetUnitAbilityLevelSwapped('XXXX', GetAttacker()) > 0 endfunction
and as you might have read I noticed my mistake and also suggested a solution
also that BJ whatever you mean by it is a part of the native that returns the attacking unit and I have no idea what you find as "converted" in it
I maybe am not the best JASSer around but ur for sure the most arrogant and I'm sure ur also not the best...
P.S. I tested the condition like I wrote it returning the time taken for the trigger and there was no difference to ur version, dude....
Why dont you show off at ur smaller brother.
and as you might have read I noticed my mistake and also suggested a solution. . .
also that BJ whatever you mean by it is a part of the native that returns the attacking unit. . .
I tested the condition like I wrote it returning the time taken for the trigger and there was no difference to ur version. . .
I maybe am not the best JASSer around but ur for sure the most arrogant and I'm sure ur also not the best. . .
. . . Why dont you show off at ur smaller brother.
Your grammars attrotious and your perseption of the world is selfish.
"HORIABLE" "Worse this" "obovious" "Its obovious to anyone who has even played with GUI triggers and even people who have played WC3 alot that GetUnitDamage() or whatever only works with the single unit takes damage" "necssary" " lituraly" "supperior" "phicialy" "imbarresed" "do not under stand" "attrotious" "perseption"
Your talking rubish raul. . .
Your grammars attrotious...
your perseption of the world is selfish