Spell Not properly working

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Well i have a proplem with this spell im creating.
Here is the code
JASS:
scope TS initializer Init

    globals
        private constant integer AbilId = 'A001'
        private constant integer LightningId = 'A004'
        private constant integer ClapId = 'A005'
        private constant integer CurseId = 'A006'
        private constant integer DumyId = 'u001'
        private constant integer CrowId = 'Arav'
    endglobals
    
    private function Check takes nothing returns boolean
        return GetSpellAbilityId() == AbilId
    endfunction
    
    private function Actions takes nothing returns nothing
        local unit u = GetTriggerUnit()
        local integer lvl = GetUnitAbilityLevel(u, AbilId)
        local real tx = GetSpellTargetX()
        local real ty = GetSpellTargetY()
        local unit d1 = CreateUnit(GetOwningPlayer(u),DumyId,tx,ty,0)
        local unit d2 = CreateUnit(GetOwningPlayer(u),DumyId,tx,ty,0)
        call UnitAddAbility(d1, CrowId)
        call UnitRemoveAbility(d1, CrowId)
        call UnitAddAbility(d1, LightningId)
        call UnitAddAbility(d2, CurseId)
        call UnitAddAbility(d2, ClapId)
        call SetUnitFlyHeight(d1, 650, .10)
        call SetUnitAbilityLevel(d1, LightningId, lvl)
        call SetUnitAbilityLevel(d2, ClapId, lvl)
        call IssueTargetOrder(d1, "chainlightning", d2)
        call TriggerSleepAction(.10)
        call IssueImmediateOrder(d2, "thunderclap")
    endfunction
    
    private function Init takes nothing returns nothing
        local trigger t = CreateTrigger()
        call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
        call TriggerAddCondition(t, Condition( function Check))
        call TriggerAddAction(t, function Actions)
    endfunction

endscope


The problem is that d1 never changes hight or casts chain lightning. The second dummy is working fine.
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Well it is modefied to target allies and does negative damage so it will heal.
 
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