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
The problem is that d1 never changes hight or casts chain lightning. The second dummy is working fine.
Here is the code
JASS:
scope TS initializer Init
globals
private constant integer AbilId = 039;A001039;
private constant integer LightningId = 039;A004039;
private constant integer ClapId = 039;A005039;
private constant integer CurseId = 039;A006039;
private constant integer DumyId = 039;u001039;
private constant integer CrowId = 039;Arav039;
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.