• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Need help converting Jass for 1.24b compatibble

Status
Not open for further replies.
Level 1
Joined
Nov 22, 2009
Messages
1
JASS:
function DebugError takes player ForPlayer, string msg returns nothing
    local sound error=CreateSoundFromLabel("InterfaceError",false,false,false,10,10)
    if (GetLocalPlayer() == ForPlayer) then
        if (msg!="") and (msg!=null) then
            call ClearTextMessages()
            call DisplayTimedTextToPlayer( ForPlayer, 0.52, -1.00, 2.00, "|cffffcc00"+msg+"|r" )
        endif
        call StartSound(error)
    endif
    call KillSoundWhenDone(error)
    set error=null
endfunction

// ==========================================================
function FilterIsEnemy takes nothing returns boolean
    return IsUnitEnemy(GetFilterUnit(), bj_groupEnumOwningPlayer)
endfunction

function DamageEnemiesArea takes unit whichUnit, real radius, real x, real y, real amount, boolean attack, boolean ranged, attacktype attackType, damagetype damageType, weapontype weaponType returns nothing
    local group g = CreateGroup()
    local boolexpr b = Condition(function FilterIsEnemy)
    local unit t
    set bj_groupEnumOwningPlayer = GetOwningPlayer(whichUnit)
    call GroupEnumUnitsInRange(g, x, y, radius, b)
    call DestroyBoolExpr(b)    
    loop
        set t = FirstOfGroup(g)
        exitwhen t == null
        call GroupRemoveUnit(g,t)
        call UnitDamageTarget(whichUnit,t,amount,attack, ranged,attackType,damageType,weaponType)
    endloop    
    call DestroyGroup(g)
    set g = null
    set b = null
endfunction


function H2I takes handle h returns integer
    return h
    return 0
endfunction

function H2U takes handle h returns unit
    return h
    return null
endfunction

function H2i takes handle h returns item
    return h
endfunction

function H2TC takes handle h returns triggercondition
    return h
endfunction


function Wait takes real duration returns nothing
    local timer t
    local real  timeRemaining

    if (duration > 0.00) then
        set t = CreateTimer ()
        call TimerStart     (t,duration,false,null)
        loop
            set timeRemaining       = TimerGetRemaining (t)
            exitwhen timeRemaining <= 0.00

            if (timeRemaining > 0.271828) then
                call TriggerSleepAction (timeRemaining / 10.00)
            else
                call TriggerSleepAction (0.10)
            endif
        endloop
        call PauseTimer   (t)
        call DestroyTimer (t)
    endif
    set t = null
endfunction



function LocalVars takes nothing returns gamecache
    if udg_cache==null then
        call FlushGameCache(InitGameCache("cache.w3v"))
        set udg_cache=InitGameCache("cache.w3v")
    endif
    return udg_cache
endfunction

//===========================================================================

function SetHandleHandle takes handle subject, string name, handle value returns nothing
    if value==null then
        call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name)
    else
        call StoreInteger(LocalVars(), I2S(H2I(subject)), name, H2I(value))
    endif
endfunction

function SetHandleInt takes handle subject, string name, integer value returns nothing
    if value==0 then
        call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name)
    else
        call StoreInteger(LocalVars(), I2S(H2I(subject)), name, value)
    endif
endfunction

function SetHandleBoolean takes handle subject, string name, boolean value returns nothing
    if value==false then
        call FlushStoredBoolean(LocalVars(),I2S(H2I(subject)),name)
    else
        call StoreBoolean(LocalVars(), I2S(H2I(subject)), name, value)
    endif
endfunction

function SetHandleReal takes handle subject, string name, real value returns nothing
    if value==0 then
        call FlushStoredReal(LocalVars(), I2S(H2I(subject)), name)
    else
        call StoreReal(LocalVars(), I2S(H2I(subject)), name, value)
    endif
endfunction

function SetHandleString takes handle subject, string name, string value returns nothing
    if value==null then
        call FlushStoredString(LocalVars(), I2S(H2I(subject)), name)
    else
        call StoreString(LocalVars(), I2S(H2I(subject)), name, value)
    endif
endfunction

//===========================================================================
function GetHandleHandle takes handle subject, string name returns handle
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleInt takes handle subject, string name returns integer
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleBoolean takes handle subject, string name returns boolean
    return GetStoredBoolean(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleReal takes handle subject, string name returns real
    return GetStoredReal(LocalVars(), I2S(H2I(subject)), name)
endfunction

function GetHandleString takes handle subject, string name returns string
    return GetStoredString(LocalVars(), I2S(H2I(subject)), name)
endfunction

function GetHandleUnit takes handle subject, string name returns unit
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleLocation takes handle subject, string name returns location
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleTimer takes handle subject, string name returns timer
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction

function GetHandleTimerDialog takes handle subject, string name returns timerdialog
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction

function GetHandleTextTag takes handle subject, string name returns texttag
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction

function GetHandleTrigger takes handle subject, string name returns trigger
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleEffect takes handle subject, string name returns effect
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleGroup takes handle subject, string name returns group
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleLightning takes handle subject, string name returns lightning
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleWidget takes handle subject, string name returns widget
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction

function GetHandleTA takes handle subject, string name returns triggeraction
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction

function FlushHandleLocals takes handle subject returns nothing
    call FlushStoredMission(LocalVars(), I2S(H2I(subject)) )
endfunction
//===========================================================================

If someone can convert that to 1.24b compatible it will be much apreciated,thanx
 
Status
Not open for further replies.
Top