kallieblakie
New Member
- Reaction score
- 5
EDIT:
Fatal Error script.
What's wrong with this script? anyone can help?
Fatal Error script.
What's wrong with this script? anyone can help?
JASS:
function Trig_Arrow_Elunes_Arrow_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 039;AOsh039; ) ) then
return false
endif
return true
endfunction
function Arrow_Move takes nothing returns nothing
local timer Loop = GetExpiredTimer()
local unit arrow = H2U(GetHandleHandle(Loop, "arrow"))
local real Angle = GetHandleReal(Loop, "Angle")
local integer Range = GetHandleInt(Loop, "Range")
local real Speed = GetHandleReal(Loop, "Speed")
local integer PlayerNo = GetHandleInt(Loop, "PlayerNo")
local real distanceCurrent = GetHandleReal(Loop, "distanceCurrent")
local location C = GetUnitLoc(arrow)
local location Next
local real x
local real y
if (R2I(distanceCurrent) <= Range) then
set distanceCurrent = distanceCurrent + Speed
call SetHandleReal (Loop, "distanceCurrent", distanceCurrent)
set x = GetLocationX(C) + Speed*Cos(Angle*bj_DEGTORAD)
set y = GetLocationY(C) + Speed*Sin(Angle*bj_DEGTORAD)
call RemoveLocation(C)
set Next = Location(x,y)
call SetUnitPositionLoc( arrow, Next )
call RemoveLocation(Next)
set arrow = null
elseif (R2I(distanceCurrent) > Range) then
call KillUnit(arrow)
call PauseTimer(Loop)
call RemoveLocation(Next)
call RemoveLocation(C)
set arrow = null
call FlushHandleLocals(Loop)
call DestroyTimer(Loop)
call DisplayTextToForce( GetPlayersAll(), "OVER" )
endif
set x = 0.00
set y = 0.00
endfunction
function Trig_Arrow_Elunes_Arrow_Actions takes nothing returns nothing
local timer Loop = CreateTimer()
local unit caster = GetSpellAbilityUnit()
local location casterPosition = GetUnitLoc(caster)
local location targetPosition = GetSpellTargetLoc()
local integer PlayerNo = GetConvertedPlayerId(GetOwningPlayer(GetSpellAbilityUnit()))
local integer radius = udg_Radius[PlayerNo]
local real Angle = AngleBetweenPoints(casterPosition, targetPosition)
local real x = GetLocationX(casterPosition) + 88*Cos(Angle*bj_DEGTORAD)
local real y = GetLocationY(casterPosition) + 88*Sin(Angle*bj_DEGTORAD)
local real Scale = ( 100.00 * ( I2R(radius) / 80.00 ) )
local location shootPosition = Location(x,y)
local unit arrow = null
local integer Range = udg_Range[PlayerNo]
local real Speed = udg_Speed[PlayerNo]
call CreateNUnitsAtLoc( 1, 039;hpea039;, ConvertedPlayer(PlayerNo), shootPosition, Angle)
set arrow = GetLastCreatedUnit()
call SetUnitScalePercent( arrow, Scale, Scale, Scale )
call SetUnitPathing( arrow, false )
call RemoveLocation(shootPosition)
call RemoveLocation(casterPosition)
call RemoveLocation(targetPosition)
set x = 0.00
set y = 0.00
call SetHandleHandle(Loop, "arrow", arrow) //***********88
call SetHandleReal(Loop, "Angle", Angle) //***********88
call SetHandleInt(Loop, "Range", Range) //***********88
call SetHandleReal(Loop, "Speed", Speed) //***********88
call SetHandleInt(Loop, "PlayerNo", PlayerNo) //*********88
call TimerStart(Loop, 0.03, true, function Arrow_Move)
endfunction
function InitTrig_Arrow_Elunes_Arrow takes nothing returns nothing
set gg_trg_Arrow_Elunes_Arrow = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Arrow_Elunes_Arrow, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Arrow_Elunes_Arrow, Condition( function Trig_Arrow_Elunes_Arrow_Conditions ) )
call TriggerAddAction( gg_trg_Arrow_Elunes_Arrow, function Trig_Arrow_Elunes_Arrow_Actions )
endfunction