• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] Unknow error

Status
Not open for further replies.
Level 24
Joined
Jun 26, 2020
Messages
1,915
I made this spell
JASS:
function Trig_Throw_Axe_spell_Conditions takes nothing returns boolean
    return GetBooleanOr(GetSpellAbilityId()=='A02S',GetSpellAbilityId()=='A03A')
endfunction

function axedmg takes nothing returns boolean
    if IsUnitAlly(GetFilterUnit(),udg_Temp_Player) then
        return false
    elseif IsUnitDeadBJ(GetFilterUnit()) then
        return false
    elseif IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) then
        return false
    endif
    return true
endfunction

function ThrowAxeMove takes nothing returns nothing
    local timer t=GetExpiredTimer()
    local integer i=GetHandleId(t)
    local unit caster=LoadUnitHandle(udg_Throw_Axe_Stats,1,i)
    local location l1
    local location l2
    local real speed=LoadReal(udg_Throw_Axe_Stats,2,i)-3.00
    local integer max=LoadInteger(udg_Throw_Axe_Stats,3,i)
    local hashtable axes=LoadHashtableHandle(udg_Throw_Axe_Stats,6,i)
    local unit a
    local unit u
    local group g=CreateGroup()
    local integer j=1
    set udg_Temp_Player=GetOwningPlayer(caster)
    loop
        exitwhen j>max
        set a=LoadUnitHandle(axes,i,j)
        set l1=GetUnitLoc(a)
        set l2=PolarProjectionBJ(l1,speed,GetUnitFacing(a))
        call SetUnitPositionLoc(a,l2)
        call GroupEnumUnitsInRange(g,GetLocationX(l2),GetLocationY(l2),LoadReal(udg_Throw_Axe_Stats,4,i),function axedmg)
        loop
            set u=FirstOfGroup(g)
            exitwhen u==null
            call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl",u,"chest"))
            call UnitDamageTargetBJ(caster,u,LoadReal(udg_Throw_Axe_Stats,5,i),ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL)
            call GroupRemoveUnit(g,u)
        endloop
        call BreakTrees(l2,50,true)
        call RemoveLocation(l1)
        call RemoveLocation(l2)
        set j=j+1
    endloop
    call SaveReal(udg_Throw_Axe_Stats,2,i,speed)
    if speed<=-60.00 then
        set j=1
        loop
            exitwhen j>max
            call RemoveUnit(LoadUnitHandle(axes,i,j))
            set j=j+1
        endloop
        call FlushParentHashtable(axes)
        call RemoveSavedHandle(udg_Throw_Axe_Stats,1,i)
        call RemoveSavedReal(udg_Throw_Axe_Stats,2,i)
        call RemoveSavedInteger(udg_Throw_Axe_Stats,3,i)
        call RemoveSavedReal(udg_Throw_Axe_Stats,4,i)
        call RemoveSavedReal(udg_Throw_Axe_Stats,5,i)
        call RemoveSavedHandle(udg_Throw_Axe_Stats,6,i)
        call PauseTimer(t)
        call DestroyTimer(t)
    endif
    call DestroyGroup(g)
    set t=null
    set caster=null
    set l1=null
    set l2=null
    set axes=null
    set a=null
    set g=null
endfunction

function Trig_Throw_Axe_spell_Actions takes nothing returns nothing
    local timer t=CreateTimer()
    local integer i=GetHandleId(t)
    local unit u=GetSpellAbilityUnit()
    local location l=GetUnitLoc(u)
    local real r1
    local real r2
    local integer j=1
    local hashtable h
    call SaveUnitHandle(udg_Throw_Axe_Stats,1,i,u)
    call SaveReal(udg_Throw_Axe_Stats,2,i,60.00)
    if GetSpellAbilityId()=='A02S' then
        if GetUnitAbilityLevel(u,'A02S')==1 then
            call SaveInteger(udg_Throw_Axe_Stats,3,i,1)
            call SaveReal(udg_Throw_Axe_Stats,4,i,150.00)
            call SaveReal(udg_Throw_Axe_Stats,5,i,15.00)
            set r1=0.00
            set r2=0.00
        else
            call SaveInteger(udg_Throw_Axe_Stats,3,i,8)
            call SaveReal(udg_Throw_Axe_Stats,4,i,110.00)
            call SaveReal(udg_Throw_Axe_Stats,5,i,20.00)
            set r1=0.00
            set r2=45.00
        endif
    else
        call SaveInteger(udg_Throw_Axe_Stats,3,i,3)
        call SaveReal(udg_Throw_Axe_Stats,4,i,110.00)
        call SaveReal(udg_Throw_Axe_Stats,5,i,7.00+3*I2R(GetUnitAbilityLevel(u,'A03A')))
        set r1=60.00
        set r2=30.00
    endif
    set h=InitHashtable()
    call SaveHashtableHandle(udg_Throw_Axe_Stats,6,i,h)
    loop
        exitwhen j>LoadInteger(udg_Throw_Axe_Stats,3,i)
        call SaveUnitHandle(h,i,j,CreateUnitAtLoc(GetOwningPlayer(u),'h008',l,GetUnitFacing(u)-r1+r2*j))
        set j=j+1
    endloop
    call RemoveLocation(l)
    call TimerStart(t,0.04,true,function ThrowAxeMove)
    set t=null
    set u=null
    set l=null
    set h=null
endfunction

//===========================================================================
function InitTrig_Throw_Axe_spell takes nothing returns nothing
    set gg_trg_Throw_Axe_spell=CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(gg_trg_Throw_Axe_spell,EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(gg_trg_Throw_Axe_spell,Condition( function Trig_Throw_Axe_spell_Conditions))
    call TriggerAddAction(gg_trg_Throw_Axe_spell,function Trig_Throw_Axe_spell_Actions )
endfunction
But the game display me this error:
upload_2020-12-14_23-34-8.png

Why?
 
Status
Not open for further replies.
Top