Idiotic shackle ward

LearningCode

New Member
Reaction score
24
This is the last attempt, if I can't get it, I give up -___-

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), 'h01O', lx, ly, bj_UNIT_FACING)
      call UnitAddAbility(ldummy, 'A022')
      call IssueTargetOrder(ldummy, "magicleash", lshackleTarget)
      call UnitApplyTimedLife(ldummy, 'BTLF', 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, 'A021')) * 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), 'h007', lx, ly, bj_UNIT_FACING)
   call BJDebugMsg("I got past this!")
   call UnitApplyTimedLife(ldummy, 'BTLF', 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() == 'A021'
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 -___-
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Take a look here:
JASS:
function ShackleAct takes nothing returns nothing
   call BJDebugMsg("No Errors")
   set lrange = I2R(GetUnitAbilityLevel(lcaster, 'A021')) * 100.00 // And "lcaster" has been set where ? You set it after you use it ?!
   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), 'h007', lx, ly, bj_UNIT_FACING)
   call BJDebugMsg("I got past this!")
   call UnitApplyTimedLife(ldummy, 'BTLF', 5.00)
   call GroupEnumUnitsInRange(lg, lx, ly, lrange, function ShackleGroup)
   call BJDebugMsg("I got past this, too!")
   set lward = null
   set lcaster = null
endfunction


That is what's breaking the whole thread...

Also, you don't need that "I2R" there ;)
 

LearningCode

New Member
Reaction score
24
Shit, my ordering is wrong, isn't it?
lol

[EDIT]
Damn..
It was the order...

Haha, thanks for pointing that out xD

*Bangs head*
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top