"I don't see what diffrence that would make=/ Also he thinks that it's a real value for some reason..."
Hm no diffrence... The functions still isn't called =/
With "he" I ment the world editor .The idea was to be able to pass the struct unit to the Effect function, then use it from there because I thought there was a wait in Effect (which would've fucked up the MUI, unless the function took a second unit argument)
Hm no diffrence... The functions still isn't called =/
JASS:
library HAILInit requires HAIL
//! runtextmacro HAIL_CreateProperty ("Data", "integer", "")
endlibrary
scope Lightnings initializer Lightning
globals
group z
private constant integer raw = 039;A001039;
real damage = 200
unit unitx = GetTriggerUnit()
endglobals
private struct TestStruct
unit dummy
unit target
real tx
real ty
timer SlideTimer
unit caster
endstruct
private function Conditions takes nothing returns boolean
return GetSpellAbilityId() == raw
endfunction
function Trig_Lightnings_FilterCondition takes nothing returns boolean
return GetWidgetLife( GetFilterUnit() ) > 0.405 and IsUnitEnemy( GetFilterUnit(), GetOwningPlayer( unitx ) ) == true
endfunction
function Trig_Lightnings_Func001A takes nothing returns nothing
call BJDebugMsg("damage1")
call UnitDamageTarget(unitx, GetEnumUnit(), damage,true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS)
call BJDebugMsg("damage")
endfunction
private function Effect takes real myX, real myY, unit Target returns nothing
local real x
local real y
local real x2
local real y2
local real real1 = 0
local unit dummy
set x = myX + 300 * Cos((45) * bj_DEGTORAD)
set y = myY + 300 * Sin((45) * bj_DEGTORAD)
set x2 = myX + 300 * Cos((315) * bj_DEGTORAD)
set y2 = myY + 300 * Sin((315) * bj_DEGTORAD)
call TimedLightning ("CLPB", x2, y2, 0, myX, myY, 0, 2., true, 1, 0)
call TimedLightning ("CLPB", x, y, 0, myX, myY, 0, 2., true, 1, 0)
set x = myX + 300 * Cos((125) * bj_DEGTORAD)
set y = myY + 300 * Sin((125) * bj_DEGTORAD)
set x2 = myX + 300 * Cos((225) * bj_DEGTORAD)
set y2 = myY + 300 * Sin((225) * bj_DEGTORAD)
call TimedLightning ("CLPB", x2, y2, 0, myX, myY, 0, 2., true, 1, 0)
call TimedLightning ("CLPB", x, y, 0, myX, myY, 0, 2., true, 1, 0)
call PauseUnit(Target,false)
set z = GetUnitsInRangeOfLocMatching(500, GetUnitLoc(GetTriggerUnit()), Condition(function Trig_Lightnings_FilterCondition))
call ForGroup( z, function Trig_Lightnings_Func001A )
call AddSpecialEffect("Abilities\\Spells\\Other\\Monsoon\\MonsoonBoltTarget.mdl",myX,myY)
endfunction
private function Slide takes nothing returns nothing
local TestStruct data = GetData (GetExpiredTimer ())
local real x = GetUnitX(data.dummy)
local real y = GetUnitY(data.dummy)
local real newX
local real newY
local real angle
local real distance
local real real1=45
local real x2
local real y2
set data.tx = GetUnitX(data.target)
set data.ty = GetUnitY(data.target)
set angle = Atan2(data.ty-y,data.tx-x)
set newX = x + 10 *Cos(angle)
set newY = y + 10 *Sin(angle)
call SetUnitPosition(data.dummy,newX,newY)
set distance=SquareRoot( (x-data.tx)*(x-data.tx) + (y-data.ty)*(y-data.ty) )
if distance < 20 then
call PauseTimer (data.SlideTimer)
call ResetData (data.SlideTimer)
call DestroyTimer (data.SlideTimer)
call PauseUnit (data.target,true)
call RemoveUnit(data.dummy)
call data.destroy ()
set data.caster = unitx
call Effect( data.tx, data.ty, data.target)
endif
endfunction
private function Actions takes nothing returns nothing
local TestStruct data = TestStruct.create ()
local unit Unit = GetTriggerUnit()
local real real1 = GetUnitFacing(GetTriggerUnit())
local real x = GetUnitX(GetTriggerUnit())
local real y = GetUnitY(GetTriggerUnit())
local real x2 = x + 300 * Cos((real1+145)*bj_DEGTORAD)
local real y2 = y + 300 * Sin((real1+145)*bj_DEGTORAD)
local real x3 = x + 300 * Cos((real1+180)*bj_DEGTORAD)
local real y3 = y + 300 * Sin((real1+180)*bj_DEGTORAD)
local real x4 = x + 300 * Cos((real1+215)*bj_DEGTORAD)
local real y4 = y + 300 * Sin((real1+215)*bj_DEGTORAD)
local effect special1
set data.SlideTimer = CreateTimer()
set data.target = (GetSpellTargetUnit())
set special1 = AddSpecialEffect("Abilities\\Spells\\NightElf\\Starfall\\StarfallCaster.mdl",x,y)
call TriggerSleepAction (0.1)
call AddSpecialEffect("Abilities\\Weapons\\Bolt\\BoltImpact.mdl",x2,y2)
call AddSpecialEffect("Abilities\\Weapons\\Bolt\\BoltImpact.mdl",x3,y3)
call AddSpecialEffect("Abilities\\Weapons\\Bolt\\BoltImpact.mdl",x4,y4)
call AddSpecialEffect("Abilities\\Spells\\Other\\Monsoon\\MonsoonBoltTarget.mdl",x,y)
call PauseUnit (Unit, true)
call TimedLightning ("CLPB", x, y, 0, x2, y2, 0, 2., true, 1, 0)
call TimedLightning ("CLPB", x, y, 0, x3, y3, 0, 2., true, 1, 0)
call TimedLightning ("CLPB", x, y, 0, x4, y4, 0, 2., true, 1, 0)
call TriggerSleepAction (1)
call DestroyEffect(special1)
set data.dummy = CreateUnit (GetOwningPlayer(Unit),039;h001039;,x,y,0)
call SetUnitPathing(data.dummy, false )
call PauseUnit (Unit, false)
call TimerStart (data.SlideTimer,0.05,true, function Slide)
call SetData (data.SlideTimer, data)
set Unit = null
endfunction
//===========================================================================
private function SafeFilt takes nothing returns boolean
return true
endfunction
private function Lightning takes nothing returns nothing
local trigger trig = CreateTrigger()
local integer i = 0
loop
exitwhen i > 15
call TriggerRegisterPlayerUnitEvent(trig,Player(i),EVENT_PLAYER_UNIT_SPELL_EFFECT,Condition(function SafeFilt))
set i = i + 1
endloop
call TriggerAddCondition (trig, Condition (function Conditions ) )
call TriggerAddAction (trig, function Actions )
set trig = null
endfunction
endscope