- Joined
- Jun 6, 2006
- Messages
- 14
JASS:
function Trig_Bloodline_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A05K'
endfunction
function Bloodline_Effects takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit u = GetHandleUnit(t, "u")
local unit v = GetHandleUnit(t, "v")
local location l = GetHandleLocation(t,"l")
local integer i = GetHandleInt(t, "i")
call SetUnitLifeBJ( u, GetUnitStateSwap(UNIT_STATE_LIFE, u) + ( (.04 * i ) * DistanceBetweenPoints(GetUnitLoc(v), l) ) )
if UnitHasBuffBJ(v, 'B012') == true then
if GetBooleanOr(GetLocationX(GetUnitLoc(v)) != GetLocationX(l),GetLocationY(GetUnitLoc(v)) != GetLocationY(l)) then
call DestroyEffect(AddSpecialEffectTarget("Objects\\Spawnmodels\\Human\\HumanBlood\\BloodElfSpellThiefBlood.mdl",v,"chest"))
endif
endif
set l = GetUnitLoc(v)
call SetHandleHandle(t, "l", l)
set t = null
set u = null
set v = null
endfunction
function Trig_Bloodline_Actions takes nothing returns nothing
local timer t = CreateTimer()
local unit u = GetTriggerUnit()
local unit v = GetSpellTargetUnit()
local integer i = GetUnitAbilityLevelSwapped('A05K', u)
local location l = GetUnitLoc(v)
call SetHandleHandle(t, "u", u)
call SetHandleHandle(t, "v", v)
call SetHandleInt(t, "i", i)
call SetHandleHandle(t, "l", l)
call TimerStart(t, 0.04, true, function Bloodline_Effects)
call TriggerSleepAction( ( ( 5.00 * I2R(i) ) )
call FlushHandleLocals(t)
call PauseTimer(t)
call DestroyTimer(t)
set t = null
set u = null
set v = null
call RemoveLocation(l)
set l = null
endfunction
//===========================================================================
function InitTrig_Bloodline takes nothing returns nothing
set gg_trg_Bloodline = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Bloodline, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Bloodline, Condition( function Trig_Bloodline_Conditions ) )
call TriggerAddAction( gg_trg_Bloodline, function Trig_Bloodline_Actions )
endfunction
I am very new to Jass, and this is the first trigger I have made, but when I save it, all that happens is a bunch of errors come up saying "Expected endif" "Expected name" etc. Can someone help me fix up this code? (The code is supposed to target a unit, and check every .04 seconds on how far they have moved and heal the caster of the spell by that much distance, lasting 5 seconds per level.)
Last edited by a moderator: