waaaks!
Zinctified
- Reaction score
- 256
This don't works
ive got the first trigger to work, but the second one dont? i dont know why
it even dont launch the missile unit...
JASS:
scope EtheralDagger
globals
private constant integer EDSPELL_ID = 039;A006039;
private constant real EDRANGE = 1000.0
private constant real EDCOLLISION = 300.0
private constant real EDSPEED = 1000.0
private constant real EDZ_OFFSET = 50.0
private constant real EDSCALE = 3.0
private constant real EDDMG = 50.0
private constant string EDSFX = "Abilities\\Weapons\\BloodElfMissile\\BloodElfMissile.mdl"
private constant string EDSFX1 = "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl"
private constant string EDSFX2 = "Abilities\\Spells\\Human\\Resurrect\\ResurrectTarget.mdl"
endglobals
private struct data
unit caster
endstruct
private function EDImpact takes nothing returns nothing
local unit targ = GetTriggerUnit()
local unit m = GetTriggerCollisionMissile()
local data E= data(CollisionMissile_GetTag(GetTriggerCollisionMissile()))
local location loc
local location loc2
local integer l
if (targ==null) then
call E.destroy()
return
endif
set loc = GetUnitLoc(E.caster)
set loc2 = GetUnitLoc(targ)
call SetUnitScale(m, EDSCALE, EDSCALE, EDSCALE)
set l = GetUnitAbilityLevel(E.caster, EDSPELL_ID)
if IsUnitEnemy(targ, GetOwningPlayer(E.caster)) == true and IsUnitAliveBJ(targ) == true then
call UnitDamageTargetBJ(E.caster, targ, l*EDDMG, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL)
call DestroyEffect(AddSpecialEffectLoc(EDSFX1, loc2))
else
if IsUnitEnemy(targ, GetOwningPlayer(E.caster)) == false and IsUnitAliveBJ(targ) == true then
call SetUnitLifeBJ(targ, l*EDDMG)
call DestroyEffect(AddSpecialEffectLoc(EDSFX2, loc2))
endif
endif
call RemoveLocation(loc)
call RemoveLocation(loc2)
set loc = null
set loc2 = null
set targ = null
endfunction
private function EDStart takes nothing returns nothing
local unit cast = GetTriggerUnit()
local data E= data.create()
local location loc1 = GetUnitLoc(cast)
local location loc2 = GetSpellTargetLoc()
local real face = AngleBetweenPoints(loc1, loc2)
local unit m
set E.caster = cast
set m = CollisionMissile_CreateLoc(EDSFX, loc1, face, EDSPEED, 0.0, EDRANGE, EDZ_OFFSET, false, EDCOLLISION, function EDImpact)
call CollisionMissile_SetTag(m, integer(E))
call RemoveLocation(loc1)
call RemoveLocation(loc2)
set loc1 = null
set loc2 = null
set cast = null
set m = null
endfunction
//===========================================================================
public function InitTrig_EtheralDagger takes nothing returns nothing
call OnAbilityEffect(EDSPELL_ID, SCOPE_PRIVATE+"EDStart")
endfunction
endscope
ive got the first trigger to work, but the second one dont? i dont know why
it even dont launch the missile unit...