Chocobo
White-Flower
- Reaction score
- 409
I added a questin (What is BJ?), Ground still doesn't work! Why?
BJ = Blizzard JASS, also called Swapper. It calls simply an another function (called native).
I added a questin (What is BJ?), Ground still doesn't work! Why?
function Trig_Air_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A000' ) ) then
return false
endif
return true
endfunction
function Trig_Air_Actions takes nothing returns nothing
local location AP1
local location AP2
local unit AT
local unit cast
local player AO
local real AR1
local real AR2
set cast = GetSpellAbilityUnit()
set AT = GetSpellTargetUnit()
set AP1 = GetUnitLoc(AT)
set AP2 = GetUnitLoc(cast)
set AO = GetOwningPlayer(cast)
set AR1 = GetUnitMoveSpeed(cast)
set AR2 = ( GetUnitFlyHeight(AT))
call SetUnitOwner( cast, Player(PLAYER_NEUTRAL_PASSIVE), false )
call SetUnitMoveSpeed( cast, ( GetUnitMoveSpeed(cast) + I2R(GetUnitAbilityLevelSwapped('A000', cast)) * 50.00 ) )
call SetUnitInvulnerable( cast, true )
call SetUnitPathing( cast, false )
call SetUnitVertexColorBJ( cast, 75.00, 75.00, 75.00, 65.00 )
call SetUnitTimeScalePercent( cast, ( 100.00 + ( I2R(GetUnitAbilityLevelSwapped('A000', cast)) * 50.00 ) ) )
[B] call SetUnitFlyHeightBJ( cast, AR2, ( DistanceBetweenPoints(AP1), (AP2)), / GetUnitMoveSpeed( cast) ) )[/B]
call IssuePointOrderLocBJ( cast, "move", AP1 )
call TriggerSleepAction( ( DistanceBetweenPoints(AP1, AP2) / GetUnitMoveSpeed(cast) ) )
call IssueTargetOrderBJ( cast, "attack", AT)
call UnitDamageTargetBJ( cast, AT, GetRandomReal(( I2R(GetUnitAbilityLevelSwapped('A000', GetTriggerUnit())) * 20.00 ), ( I2R(GetUnitAbilityLevelSwapped('A000', GetTriggerUnit())) * 25.00 )), ATTACK_TYPE_MAGIC, DAMAGE_TYPE_ENHANCED )
call SetUnitOwner( cast, AO, false )
call SetUnitInvulnerable( cast, false )
call SetUnitPathing( cast, true )
call SetUnitVertexColorBJ( cast, 100.00, 100, 100, 0 )
call SetUnitMoveSpeed( cast, AR1)
set AP1 = null
set AP2 = null
set cast = null
set AT = null
set AO = null
set AR1 = null
set AR2 = null
endfunction
//===========================================================================
function InitTrig_Air takes nothing returns nothing
set gg_trg_Air = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Air, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Air, Condition( function Trig_Air_Conditions ) )
call TriggerAddAction( gg_trg_Air, function Trig_Air_Actions )
endfunction
call SetUnitFlyHeightBJ(cast, AR2,DistanceBetweenPoints(AP1,AP2)/GetUnitMoveSpeed(cast))
call SetUnitFlyHeightBJ(cast,AR2,(DistanceBetweenPoints(AP1),(AP2)),/GetUnitMoveSpeed(cast)))
call SetUnitFlyHeightBJ(cast,AR2,DistanceBetweenPoints(AP1,AP2)/GetUnitMoveSpeed(cast))
Can you see the difference between the two?
Yours
Choco'sCode:call SetUnitFlyHeightBJ(cast,AR2,(DistanceBetweenPoints(AP1),(AP2)),/GetUnitMoveSpeed(cast)))
Code:call SetUnitFlyHeightBJ(cast,AR2,DistanceBetweenPoints(AP1,AP2)/GetUnitMoveSpeed(cast))
And...
Is your unit set to flying?
call SetUnitFlyHeightBJ(cast,AR2,(DistanceBetweenPoints(AP1),(AP2))[B][U],[/U][/B]/GetUnitMoveSpeed(cast)))
call SetUnitFlyHeightBJ(cast,AR2,DistanceBetweenPoints(AP1,AP2)/GetUnitMoveSpeed(cast))
Chovynz, what do you mean? In GUI you can set unit's flying hieght without any problems, and thanks I'll try that new line.
Edit: Nope, still doesn't work!
function Trig_Harden_Air_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A001' ) ) then
return false
endif
return true
endfunction
function Trig_Harden_Air_Func005A takes nothing returns nothing
call PauseUnitBJ( true, GetEnumUnit() )
endfunction
function Trig_Harden_Air_Func006Func001A takes nothing returns nothing
call UnitDamageTargetBJ( GetSpellAbilityUnit(), GetEnumUnit(), GetRandomReal(20.00, 25.00), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_FORCE )
call TriggerSleepAction( 2 )
endfunction
function Trig_Harden_Air_Func009A takes nothing returns nothing
call PauseUnitBJ( false, GetEnumUnit() )
endfunction
function Trig_Harden_Air_Actions takes nothing returns nothing
call Location HLoc
call group UnGr
call unit c
call unit HU
set c = GetSpellAbilityUnit()
set HLoc = GetSpellTargetLoc()
set HUnGr = GetUnitsInRangeOfLocAll(( I2R(GetUnitAbilityLevelSwapped('A001', GetSpellAbilityUnit())) * 200.00 ), c)
call CreateNUnitsAtLoc( 1, udg_UT[GetUnitAbilityLevelSwapped('A001', c)], Player(PLAYER_NEUTRAL_PASSIVE), HLoc, bj_UNIT_FACING )
set HU = GetLastCreatedUnit()
call ForGroupBJ( HUnGr, function Trig_Harden_Air_Func005A )
set bj_forLoopAIndex = 0
set bj_forLoopAIndexEnd = GetUnitAbilityLevelSwapped('A001', c)
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call ForGroupBJ( HUnGr, function Trig_Harden_Air_Func006Func001A )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call TriggerSleepAction( 1.00 )
call RemoveUnit( HU )
call ForGroupBJ( HUnGr, function Trig_Harden_Air_Func009A )
endfunction
//===========================================================================
function InitTrig_Harden_Air takes nothing returns nothing
set gg_trg_Harden_Air = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Harden_Air, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Harden_Air, Condition( function Trig_Harden_Air_Conditions ) )
call TriggerAddAction( gg_trg_Harden_Air, function Trig_Harden_Air_Actions )
endfunction
function Trig_Harden_Air_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A001' ) ) then
return false
endif
return true
endfunction
function Trig_Harden_Air_Func005A takes nothing returns nothing
call PauseUnitBJ( true, GetEnumUnit() )
endfunction
function Trig_Harden_Air_Func006Func001A takes nothing returns nothing
call UnitDamageTargetBJ( GetSpellAbilityUnit(), GetEnumUnit(), GetRandomReal(20.00, 25.00), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_FORCE )
call TriggerSleepAction( 2 )
endfunction
function Trig_Harden_Air_Func009A takes nothing returns nothing
call PauseUnitBJ( false, GetEnumUnit() )
endfunction
function Trig_Harden_Air_Actions takes nothing returns nothing
[COLOR="Red"]local location[/COLOR] HLoc
[COLOR="Red"]local group[/COLOR] [B][COLOR="Red"]UnGr[/COLOR][/B]
[COLOR="Red"]local unit[/COLOR] c
[COLOR="Red"]local unit[/COLOR] HU
set c = GetSpellAbilityUnit()
set HLoc = GetSpellTargetLoc()
set UnGr = GetUnitsInRangeOfLocAll(( I2R(GetUnitAbilityLevelSwapped('A001', GetSpellAbilityUnit())) * 200.00 ), [COLOR="Red"]GetUnitLoc(c)[/COLOR])
call CreateNUnitsAtLoc( 1, udg_UT[GetUnitAbilityLevelSwapped('A001', c)], Player(PLAYER_NEUTRAL_PASSIVE), HLoc, bj_UNIT_FACING )
set HU = GetLastCreatedUnit()
call ForGroupBJ( [B][COLOR="Red"]UnGr[/COLOR][/B], function Trig_Harden_Air_Func005A )
set bj_forLoopAIndex = 0
set bj_forLoopAIndexEnd = GetUnitAbilityLevelSwapped('A001', c)
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call ForGroupBJ( [B][COLOR="Red"]UnGr[/COLOR][/B], function Trig_Harden_Air_Func006Func001A )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call TriggerSleepAction( 1.00 )
call RemoveUnit( HU )
call ForGroupBJ( [B][COLOR="Red"]UnGr[/COLOR][/B], function Trig_Harden_Air_Func009A )
endfunction
//===========================================================================
function InitTrig_Harden_Air takes nothing returns nothing
set gg_trg_Harden_Air = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Harden_Air, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Harden_Air, Condition( function Trig_Harden_Air_Conditions ) )
call TriggerAddAction( gg_trg_Harden_Air, function Trig_Harden_Air_Actions )
endfunction
function Trig_Harden_Air_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A001' ) ) then
return false
endif
return true
endfunction
function Trig_Harden_Air_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A001'
endfunction
local location HLoc
local group UnGr
local unit c
local unit HU
set c = GetSpellAbilityUnit()
set HLoc = GetSpellTargetLoc()
set UnGr = GetUnitsInRangeOfLocAll(( I2R(GetUnitAbilityLevelSwapped('A001', GetSpellAbilityUnit())) * 200.00 ), GetUnitLoc(c))
call CreateNUnitsAtLoc( 1, udg_UT[GetUnitAbilityLevelSwapped('A001', c)], Player(PLAYER_NEUTRAL_PASSIVE), HLoc, bj_UNIT_FACING )
set HU = GetLastCreatedUnit()
local location HLoc = GetSpellTargetLoc()
local group UnGr = GetUnitsInRangeOfLocAll(( I2R(GetUnitAbilityLevelSwapped('A001', GetSpellAbilityUnit())) * 200.00 ), GetUnitLoc(c))
local unit c = GetSpellAbilityUnit()
local unit HU = CreateNUnitsAtLoc( 1, udg_UT[GetUnitAbilityLevelSwapped('A001', c)], Player(PLAYER_NEUTRAL_PASSIVE), HLoc, bj_UNIT_FACING )
function Trig_Air_Shield_Conditions takes nothing returns boolean
if ( not ( UnitHasBuffBJ(GetSpellTargetUnit(), 'B000') == true ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('ANab', GetSpellTargetUnit()) >= GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetSpellAbilityUnit()) ) ) then
return false
endif
return true
endfunction
function Trig_Air_Shield_Actions takes nothing returns nothing
local location AHLoc
local unit dum
local unit vic
local unit ref
if ( GetRandomInt(1, 100) <= ( GetUnitAbilityLevelSwapped('A002', GetSpellTargetUnit()) * 15 ) ) ) [B]then[/B]
set vic = GetSpellAbilityUnit()
set ref = GetSpellTargetUnit()
set AHLoc = GetUnitLoc(GetSpellTargetUnit())
call CreateNUnitsAtLoc( 1, 'h001', GetOwningPlayer(GetSpellTargetUnit()), AHLoc, GetUnitFacing(GetSpellTargetUnit()) )
set dum = GetLastCreatedUnit()
call UnitAddAbilityBJ( GetSpellAbilityId(), dum )
call SetUnitAbilityLevelSwapped( GetSpellAbilityId(), dum, GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetSpellAbilityUnit()) )
call TriggerSleepAction (1.00)
call SetUnitAnimation( ref, "cast" )
call IssueTargetOrderBJ( dum, AbilityId2String(GetSpellAbilityId()), vic)
[B] endif[/B]
endfunction
//===========================================================================
function InitTrig_Air_Shield takes nothing returns nothing
set gg_trg_Air_Shield = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Air_Shield, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Air_Shield, Condition( function Trig_Air_Shield_Conditions ) )
call TriggerAddAction( gg_trg_Air_Shield, function Trig_Air_Shield_Actions )
endfunction
function Trig_Air_Shield_Actions takes nothing returns nothing
local location AHLoc
local unit dum
local unit vic
local unit ref
if [B][COLOR="Red"](([/COLOR][/B]GetRandomInt(1, 100) <= (GetUnitAbilityLevelSwapped('A002', GetSpellTargetUnit()) * 15[B][COLOR="Red"])))[/COLOR][/B] then
set vic = GetSpellAbilityUnit()
set ref = GetSpellTargetUnit()
set AHLoc = GetUnitLoc(GetSpellTargetUnit())
call CreateNUnitsAtLoc( 1, 'h001', GetOwningPlayer(GetSpellTargetUnit()), AHLoc, GetUnitFacing(GetSpellTargetUnit()) )
set dum = GetLastCreatedUnit()
call UnitAddAbilityBJ( GetSpellAbilityId(), dum )
call SetUnitAbilityLevelSwapped( GetSpellAbilityId(), dum, GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetSpellAbilityUnit()) )
call TriggerSleepAction (1.00)
call SetUnitAnimation( ref, "cast" )
call IssueTargetOrderBJ( dum, AbilityId2String(GetSpellAbilityId()), vic)
endif
endfunction
function Trig_Air_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A000' ) ) then
return false
endif
return true
endfunction
function Trig_Air_Actions takes nothing returns nothing
local location AP1
local location AP2
local unit AT
local unit cast
local player AO
local real AR1
local real AR2
set cast = GetSpellAbilityUnit()
set AT = GetSpellTargetUnit()
set AP1 = GetUnitLoc(AT)
set AP2 = GetUnitLoc(cast)
set AO = GetOwningPlayer(cast)
set AR1 = GetUnitMoveSpeed(cast)
set AR2 = ( GetUnitFlyHeight(AT))
call SetUnitOwner( cast, Player(PLAYER_NEUTRAL_PASSIVE), false )
call SetUnitMoveSpeed( cast, ( GetUnitMoveSpeed(cast) + I2R(GetUnitAbilityLevelSwapped('A000', cast)) * 50.00 ) )
call SetUnitInvulnerable( cast, true )
call SetUnitPathing( cast, false )
call SetUnitVertexColorBJ( cast, 75.00, 75.00, 75.00, 65.00 )
call SetUnitTimeScalePercent( cast, ( 100.00 + ( I2R(GetUnitAbilityLevelSwapped('A000', cast)) * 50.00 ) ) )
call PauseUnit(AT, true)
call UnitShareVisionBJ( true, cast, AO )
call IssuePointOrderLocBJ( cast, "move", AP1 )
[B] call UnitAddAbilityBJ( 'Arav', cast )
call SetUnitFlyHeightBJ(cast,AR2,DistanceBetweenPoints(AP1,AP2)/GetUnitMoveSpeed(cast))[/B]
call TriggerSleepAction( ( DistanceBetweenPoints(AP1, AP2) / GetUnitMoveSpeed(cast) ) )
call PauseUnit(AT, false)
[B] call UnitRemoveAbilityBJ( 'Arav', cast )[/B]
call UnitDamageTargetBJ( cast, AT, GetRandomReal(( I2R(GetUnitAbilityLevelSwapped('A000', GetTriggerUnit())) * 20.00 ), ( I2R(GetUnitAbilityLevelSwapped('A000', GetTriggerUnit())) * 25.00 ) + 25), ATTACK_TYPE_MAGIC, DAMAGE_TYPE_ENHANCED )
call SetUnitOwner( cast, AO, false )
call SetUnitInvulnerable( cast, false )
call SetUnitPathing( cast, true )
call SetUnitVertexColorBJ( cast, 100.00, 100, 100, 0 )
call SetUnitMoveSpeed( cast, AR1)
set AP1 = null
set AP2 = null
set cast = null
set AT = null
set AO = null
set AR1 = 0.00
set AR2 = 0.00
endfunction
//===========================================================================
function InitTrig_Swift_Attack takes nothing returns nothing
set gg_trg_Swift_Attack = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Swift_Attack, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Swift_Attack, Condition( function Trig_Air_Conditions ) )
call TriggerAddAction( gg_trg_Swift_Attack, function Trig_Air_Actions )
endfunction
constant function [B]Swift_Rawcode[/B] takes nothing returns integer
return 'A000'
endfunction
function Example_Condition takes nothing returns boolean
return GetSpellAbilityId() == [B]Swift_Rawcode()[/B]
endfunction
function Example_Actions takes nothing returns nothing
local unit a = GetTriggerUnit()
local integer i = GetUnitAbilityLevel(a, [B]Swift_Rawcode()[/B] )
...
...
...
call SetUnitAbilityLevel( a, [B]Swift_Rawcode()[/B], i + 1 )
...
...
endfunction