inevit4ble
Well-Known Member
- Reaction score
- 38
Hi Every1,
Just starting out with jass and was going good until this lightning effect won't change color or destroy. I assume I'm setting the variable incorrectly. Could someone correct me please?
PS. This is my first jass trigger I've made so if there are additional errors or things I should be doing please inform me so I can learn the right way from the beginning.
THANKS
Just starting out with jass and was going good until this lightning effect won't change color or destroy. I assume I'm setting the variable incorrectly. Could someone correct me please?
JASS:
scope HealingBolt initializer Cast
function Missile takes location l, location ll returns nothing
local lightning g
call AddLightningEx("AFOD", true, GetLocationX(l), GetLocationY(l), GetLocationZ(l), GetLocationX(ll), GetLocationY(ll), GetLocationZ(ll))
set g = bj_lastCreatedLightning
call SetLightningColor( g, 0, 1, 0, 1)
call TriggerSleepAction(0.1)
call DestroyLightning(g)
endfunction
function Heal takes real r, real rr returns real
return r+rr
endfunction
function AbiCheck takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 039;A000039; ) ) then
return false
endif
return true
endfunction
function Effects takes nothing returns nothing
local real newhp
local location from = GetUnitLoc(GetTriggerUnit())
local location to = GetUnitLoc(GetSpellTargetUnit())
call AddSpecialEffectTarget("Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl", GetTriggerUnit(), "origin")
call DestroyEffect(bj_lastCreatedEffect)
call Missile(from, to)
call UnitDamageTarget(GetTriggerUnit(), GetSpellTargetUnit(), 300.00, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
set newhp = Heal(GetUnitState(GetTriggerUnit(), UNIT_STATE_LIFE), 50.00)
call SetUnitState(GetTriggerUnit(), UNIT_STATE_LIFE, newhp)
endfunction
function Cast takes nothing returns nothing
local trigger t
local trigger tt
local integer i = 0
set t = CreateTrigger()
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 AbiCheck ) )
call TriggerAddAction( t, function Effects )
endfunction
endscope
PS. This is my first jass trigger I've made so if there are additional errors or things I should be doing please inform me so I can learn the right way from the beginning.
THANKS