- Joined
- Sep 14, 2012
- Messages
- 3,413
Hi everyone,
I have a problem.
Let's explain firstly the spells ( yes I got two spells which aren't working but it's the same problem XD ) :
Mass Hysteria : the hero launches a bouncing wave of shadows damaging all units touched. If the damaged unit got a buff called 'Banebow' they will not be able to cast/attack during some seconds.
Creeping Shadows : the hero launches a shadow in a line damaging all units in the path of the shadow. The damaged unit will be root. If the damaged unit got a buff called 'Banebow' they will be stun instead of root.
Ok now there is the current code :
- Mass Hysteria Start :
- Mass Hysteria Disable :
- Creeping Shadow Start :
- Creeping Shadow Disable :
Oh it isn't written in the trigger but the event unit takes damage has been added with a trigger adding every unit event takes damage.
The problem is that the wave / schockwave work as i wanted but the disables don't work at all :/
I have a problem.
Let's explain firstly the spells ( yes I got two spells which aren't working but it's the same problem XD ) :
Mass Hysteria : the hero launches a bouncing wave of shadows damaging all units touched. If the damaged unit got a buff called 'Banebow' they will not be able to cast/attack during some seconds.
Creeping Shadows : the hero launches a shadow in a line damaging all units in the path of the shadow. The damaged unit will be root. If the damaged unit got a buff called 'Banebow' they will be stun instead of root.
Ok now there is the current code :
- Mass Hysteria Start :
JASS:
function Trig_Mass_Hysteria_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A02S' ) ) then
return false
endif
return true
endfunction
function Trig_Mass_Hysteria_Actions takes nothing returns nothing
local unit a = GetSpellAbilityUnit()
local unit t = GetSpellTargetUnit()
local location l = GetUnitLoc(a)
set udg_Dummy_Hysteria = CreateUnitAtLoc( Player(0), 'h000', l, bj_UNIT_FACING )
call UnitAddAbility( udg_Dummy_Hysteria, 'A02T' )
call SetUnitAbilityLevel( udg_Dummy_Hysteria, 'A02T', GetUnitAbilityLevel( a, 'A02S' ) )
call IssueTargetOrder( udg_Dummy_Hysteria, "chainlightning", t )
call UnitApplyTimedLife( udg_Dummy_Hysteria, 'BTLF', 8 )
call TriggerSleepAction( 8 )
call RemoveLocation(l)
set l = null
set a = null
set t = null
set udg_Dummy_Hysteria = null
endfunction
//===========================================================================
function InitTrig_Mass_Hysteria takes nothing returns nothing
set gg_trg_Mass_Hysteria = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Mass_Hysteria, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Mass_Hysteria, Condition( function Trig_Mass_Hysteria_Conditions ) )
call TriggerAddAction( gg_trg_Mass_Hysteria, function Trig_Mass_Hysteria_Actions )
endfunction
- Mass Hysteria Disable :
JASS:
function Trig_Banebow_Q_Conditions takes nothing returns boolean
if ( not ( GetEventDamageSource() == udg_Dummy_Hysteria ) ) then
return false
endif
if ( not( GetUnitAbilityLevel( GetTriggerUnit(), 'B006') > 0 ) ) then
return false
endif
return true
endfunction
function Trig_Banebow_Q_Actions takes nothing returns nothing
local unit t = GetTriggerUnit()
local unit p = GetEventDamageSource()
local location l = GetUnitLoc(t)
local location v = GetUnitLoc(p)
local unit u = null
set u = CreateUnitAtLoc( Player(0), 'h000', v, bj_UNIT_FACING )
call UnitAddAbility( u, 'A035' )
call SetUnitAbilityLevel( u, 'A035', GetUnitAbilityLevel( udg_Shadow_Archer, 'A032' ) )
call IssuePointOrderLoc( u, "silence", l )
call UnitApplyTimedLife( u, 'BTLF', 1 )
call RemoveLocation(l)
set t = null
set l = null
set u = null
endfunction
//===========================================================================
function InitTrig_Banebow_Q takes nothing returns nothing
set gg_trg_Banebow_Q = CreateTrigger( )
call TriggerAddCondition( gg_trg_Banebow_Q, Condition( function Trig_Banebow_Q_Conditions ) )
call TriggerAddAction( gg_trg_Banebow_Q, function Trig_Banebow_Q_Actions )
endfunction
- Creeping Shadow Start :
JASS:
function Trig_Creeping_Shadows_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A02X' ) ) then
return false
endif
return true
endfunction
function Trig_Creeping_Shadows_Actions takes nothing returns nothing
local unit u = GetSpellAbilityUnit()
local location l = GetUnitLoc(u)
local location t = GetSpellTargetLoc()
set udg_Dummy_Creeping = CreateUnitAtLoc( Player(0), 'h000', l, bj_UNIT_FACING )
call UnitAddAbility( udg_Dummy_Creeping, 'A02Y' )
call SetUnitAbilityLevel( udg_Dummy_Creeping, 'A02Y', GetUnitAbilityLevel( udg_Dummy_Creeping, 'A02X' ) )
call IssuePointOrderLoc( udg_Dummy_Creeping, "shockwave", t )
call UnitApplyTimedLife( udg_Dummy_Creeping, 'BTLF', 7 )
call TriggerSleepAction( 7 )
call RemoveLocation(l)
call RemoveLocation(t)
set u = null
set l = null
set t = null
set udg_Dummy_Creeping = null
endfunction
//===========================================================================
function InitTrig_Creeping_Shadows takes nothing returns nothing
set gg_trg_Creeping_Shadows = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Creeping_Shadows, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Creeping_Shadows, Condition( function Trig_Creeping_Shadows_Conditions ) )
call TriggerAddAction( gg_trg_Creeping_Shadows, function Trig_Creeping_Shadows_Actions )
endfunction
- Creeping Shadow Disable :
JASS:
function Trig_Banebow_W_Conditions takes nothing returns boolean
if ( not ( GetEventDamageSource() == udg_Dummy_Creeping ) ) then
return false
endif
if ( not( GetUnitAbilityLevel( GetTriggerUnit(), 'B006') > 0 ) ) then
return false
endif
return true
endfunction
function Trig_Banebow_W_Actions takes nothing returns nothing
local unit t = GetTriggerUnit()
local location l = GetUnitLoc(t)
local unit u = CreateUnitAtLoc( Player(0), 'h000', l, bj_UNIT_FACING )
if ( GetUnitAbilityLevel( GetTriggerUnit(), 'B006' ) < 0 ) then
call UnitAddAbility( u, 'A036' )
call IssueTargetOrder( u, "entanglingroots", t )
else
call UnitAddAbility( u, 'A037' )
call SetUnitAbilityLevel( u, 'A037', GetUnitAbilityLevel( udg_Shadow_Archer, 'A032' ) )
call IssueTargetOrder( u, "thunderbolt", t )
endif
call UnitApplyTimedLife( u, 'BTLF', 1 )
call RemoveLocation(l)
set t = null
set l = null
set u = null
endfunction
//===========================================================================
function InitTrig_Banebow_W takes nothing returns nothing
set gg_trg_Banebow_W = CreateTrigger( )
call TriggerAddCondition( gg_trg_Banebow_W, Condition( function Trig_Banebow_W_Conditions ) )
call TriggerAddAction( gg_trg_Banebow_W, function Trig_Banebow_W_Actions )
endfunction
Oh it isn't written in the trigger but the event unit takes damage has been added with a trigger adding every unit event takes damage.
The problem is that the wave / schockwave work as i wanted but the disables don't work at all :/