LearningCode
New Member
- Reaction score
- 24
This is the last attempt, if I can't get it, I give up -___-
It will not work.
Displays messages:
ShackleWard Cast
No Error
Doesn't display anything after that, despite my BJDebugMessage spammage.
Doesn't create unit either -___-
JASS:
globals
unit lcaster
unit lshackleTarget
unit ldummy
unit lward
real lx
real ly
group lg = CreateGroup()
real lrange
endglobals
function ShackleGroup takes nothing returns boolean
call BJDebugMsg("I got past this, tree!")
set lshackleTarget = GetFilterUnit()
call BJDebugMsg(R2S(lx))
if IsUnitEnemy(lshackleTarget, GetOwningPlayer(lcaster)) == true then
set ldummy = CreateUnit(GetOwningPlayer(lcaster), 039;h01O039;, lx, ly, bj_UNIT_FACING)
call UnitAddAbility(ldummy, 039;A022039;)
call IssueTargetOrder(ldummy, "magicleash", lshackleTarget)
call UnitApplyTimedLife(ldummy, 039;BTLF039;, 6.00)
set lshackleTarget = null
set ldummy = null
endif
return false
endfunction
function ShackleAct takes nothing returns nothing
call BJDebugMsg("No Errors")
set lrange = I2R(GetUnitAbilityLevel(lcaster, 039;A021039;)) * 100.00
call BJDebugMsg(R2S(lrange))
set lx = GetSpellTargetX()
call BJDebugMsg(R2S(lx))
set ly = GetSpellTargetY()
call BJDebugMsg(R2S(ly))
set lcaster = GetTriggerUnit()
set lward = CreateUnit(GetOwningPlayer(lcaster), 039;h007039;, lx, ly, bj_UNIT_FACING)
call BJDebugMsg("I got past this!")
call UnitApplyTimedLife(ldummy, 039;BTLF039;, 5.00)
call GroupEnumUnitsInRange(lg, lx, ly, lrange, function ShackleGroup)
call BJDebugMsg("I got past this, too!")
set lward = null
set lcaster = null
endfunction
function ShackleCond takes nothing returns boolean
call BJDebugMsg("ShackleWard Cast")
return GetSpellAbilityId() == 039;A021039;
endfunction
//===========================================================================
function InitTrig_ShackleWard takes nothing returns nothing
local trigger t = CreateTrigger( )
local integer i = 0
loop
exitwhen i == 8
call TriggerRegisterPlayerUnitEvent(t, Player(i), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
set i = i+1
endloop
call TriggerAddCondition(t, Condition(function ShackleCond))
call TriggerAddAction( t, function ShackleAct )
endfunction
It will not work.
Displays messages:
ShackleWard Cast
No Error
Doesn't display anything after that, despite my BJDebugMessage spammage.
Doesn't create unit either -___-