- Joined
- Jan 16, 2006
- Messages
- 5
Hello everybody.
I'm make a spell called INEPTITUD; when the unit with the buff attacks, it recieves some damage and is stunned (well i'm create a unit and order storm bolt it), there is my code:
When the unit with the buff attacks some unit controled by me, the spell works fine. But when the unit with the buff attacks some unit controled by the computed doesn't works... What happends???
Thanks in advance
I'm make a spell called INEPTITUD; when the unit with the buff attacks, it recieves some damage and is stunned (well i'm create a unit and order storm bolt it), there is my code:
JASS:
function Trig_Ineptitud_Attack_Conditions takes nothing returns boolean
if ( not ( UnitHasBuffBJ(GetAttacker(), 'B00O') == true ) ) then
return false
endif
return true
endfunction
function Trig_Ineptitud_Attack_Actions takes nothing returns nothing
local real x = GetUnitX(GetAttacker())
local real y = GetUnitY(GetAttacker())
call CreateNUnitsAtLoc( 1, 'h00C', GetOwningPlayer(GetAttackedUnitBJ()), Location(x,y), bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A08A', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "thunderbolt", GetAttacker() )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
endfunction
//===========================================================================
function InitTrig_Ineptitud_Attack takes nothing returns nothing
set gg_trg_Ineptitud_Attack = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Ineptitud_Attack, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Ineptitud_Attack, Condition( function Trig_Ineptitud_Attack_Conditions ) )
call TriggerAddAction( gg_trg_Ineptitud_Attack, function Trig_Ineptitud_Attack_Actions )
endfunction
When the unit with the buff attacks some unit controled by me, the spell works fine. But when the unit with the buff attacks some unit controled by the computed doesn't works... What happends???
Thanks in advance