WolfieeifloW
WEHZ Helper
- Reaction score
- 372
I have a dummy unit that's flying so that when he casts the Healing Wave it comes down, hence the reason why God is in the name of this spell.
When the spell is cast, the caster gets healed but the heal doesn't bounce to nearby allies.
I've no clue if it's the coding or the spell/dummy itself.
If needed, I can upload the map.
When the spell is cast, the caster gets healed but the heal doesn't bounce to nearby allies.
I've no clue if it's the coding or the spell/dummy itself.
If needed, I can upload the map.
JASS:
scope GodsRightHand initializer GRInit
globals
private constant integer GR_ID = 039;A000039;
private constant integer WH_ID = 039;A001039;
private constant integer DUM_ID = 039;n000039;
private constant string WHORDER = "healingwave"
endglobals
private function HEAL takes integer level returns integer
return (level * 50)
endfunction
private function GRConditions takes nothing returns boolean
return (GetSpellAbilityId() == GR_ID)
endfunction
private function GRActions takes nothing returns nothing
local unit tu = GetTriggerUnit()
local integer QT = GetUnitAbilityLevel(tu, GR_ID)
local unit u
set u = CreateUnit(GetOwningPlayer(tu), DUM_ID, GetUnitX(tu), GetUnitY(tu), bj_UNIT_FACING)
call UnitAddAbility(u, WH_ID)
call SetUnitAbilityLevel(u, WH_ID, QT)
call IssueTargetOrder(u, WHORDER, tu)
call UnitRemoveAbility(u, WH_ID)
call UnitApplyTimedLife(u, 039;BTLF039;, 2.00)
call SetUnitState(tu, UNIT_STATE_LIFE, GetUnitState(tu, UNIT_STATE_LIFE) + HEAL(QT))
set u = null
set tu = null
endfunction
//====================================================================================================
private function GRInit takes nothing returns nothing
local trigger t = CreateTrigger()
local integer i = 0
loop
call TriggerRegisterPlayerUnitEvent(t, Player(i), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
set i = i + 1
exitwhen i == bj_MAX_PLAYER_SLOTS
endloop
call TriggerAddCondition(t, Condition(function GRConditions))
call TriggerAddAction(t, function GRActions)
endfunction
endscope