• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

Convert to JASS

Status
Not open for further replies.
Level 4
Joined
Jul 16, 2009
Messages
42
can someone help me check for leak int his script and convert it to JASS. +rep and credit in my map :)

hardtrig.jpg

JASS:
function Trig_abilityFreezingField_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A00A' ) ) then
        return false
    endif
    return true
endfunction

function Trig_abilityFreezingField_Actions takes nothing returns nothing
    set udg_casterFreezingFeild = GetSpellAbilityUnit()
    set bj_forLoopAIndex = 1
    set bj_forLoopAIndexEnd = 2
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        call CreateNUnitsAtLoc( 1, 'h001', GetOwningPlayer(udg_casterFreezingFeild), PolarProjectionBJ(GetUnitLoc(udg_casterFreezingFeild), 300.00, ( 0.00 + ( 180.00 * I2R(GetForLoopIndexA()) ) )), bj_UNIT_FACING )
        call SetUnitUserData( GetLastCreatedUnit(), R2I(AngleBetweenPoints(GetUnitLoc(udg_casterFreezingFeild), GetUnitLoc(GetLastCreatedUnit()))) )
        call SetUnitLifeBJ( GetLastCreatedUnit(), DistanceBetweenPoints(GetUnitLoc(udg_casterFreezingFeild), GetUnitLoc(GetLastCreatedUnit())) )
        call UnitAddAbilityBJ( udg_abilityFreezingFeildLvl[GetUnitAbilityLevelSwapped('A00A', udg_casterFreezingFeild)], GetLastCreatedUnit() )
        call SetUnitFlyHeightBJ( GetLastCreatedUnit(), 10.00, 1000000000.00 )
        call UnitApplyTimedLifeBJ( 30.00, 'BTLF', GetLastCreatedUnit() )
        call CreateNUnitsAtLoc( 1, 'h001', GetOwningPlayer(udg_casterFreezingFeild), PolarProjectionBJ(GetUnitLoc(udg_casterFreezingFeild), 290.00, ( 60.00 + ( 180.00 * I2R(GetForLoopIndexA()) ) )), bj_UNIT_FACING )
        call SetUnitUserData( GetLastCreatedUnit(), R2I(AngleBetweenPoints(GetUnitLoc(udg_casterFreezingFeild), GetUnitLoc(GetLastCreatedUnit()))) )
        call SetUnitLifeBJ( GetLastCreatedUnit(), DistanceBetweenPoints(GetUnitLoc(udg_casterFreezingFeild), GetUnitLoc(GetLastCreatedUnit())) )
        call UnitAddAbilityBJ( udg_abilityFreezingFeildLvl[GetUnitAbilityLevelSwapped('A00A', udg_casterFreezingFeild)], GetLastCreatedUnit() )
        call SetUnitFlyHeightBJ( GetLastCreatedUnit(), 88.00, 1000000000.00 )
        call UnitApplyTimedLifeBJ( 30.00, 'BTLF', GetLastCreatedUnit() )
        call CreateNUnitsAtLoc( 1, 'h001', GetOwningPlayer(udg_casterFreezingFeild), PolarProjectionBJ(GetUnitLoc(udg_casterFreezingFeild), 260.00, ( 120.00 + ( 180.00 * I2R(GetForLoopIndexA()) ) )), bj_UNIT_FACING )
        call SetUnitUserData( GetLastCreatedUnit(), R2I(AngleBetweenPoints(GetUnitLoc(udg_casterFreezingFeild), GetUnitLoc(GetLastCreatedUnit()))) )
        call SetUnitLifeBJ( GetLastCreatedUnit(), DistanceBetweenPoints(GetUnitLoc(udg_casterFreezingFeild), GetUnitLoc(GetLastCreatedUnit())) )
        call UnitAddAbilityBJ( udg_abilityFreezingFeildLvl[GetUnitAbilityLevelSwapped('A00A', udg_casterFreezingFeild)], GetLastCreatedUnit() )
        call SetUnitFlyHeightBJ( GetLastCreatedUnit(), 160.00, 1000000000.00 )
        call UnitApplyTimedLifeBJ( 30.00, 'BTLF', GetLastCreatedUnit() )
        call CreateNUnitsAtLoc( 1, 'h001', GetOwningPlayer(udg_casterFreezingFeild), PolarProjectionBJ(GetUnitLoc(udg_casterFreezingFeild), 212.00, ( 180.00 + ( 180.00 * I2R(GetForLoopIndexA()) ) )), bj_UNIT_FACING )
        call SetUnitUserData( GetLastCreatedUnit(), R2I(AngleBetweenPoints(GetUnitLoc(udg_casterFreezingFeild), GetUnitLoc(GetLastCreatedUnit()))) )
        call SetUnitLifeBJ( GetLastCreatedUnit(), DistanceBetweenPoints(GetUnitLoc(udg_casterFreezingFeild), GetUnitLoc(GetLastCreatedUnit())) )
        call UnitAddAbilityBJ( udg_abilityFreezingFeildLvl[GetUnitAbilityLevelSwapped('A00A', udg_casterFreezingFeild)], GetLastCreatedUnit() )
        call SetUnitFlyHeightBJ( GetLastCreatedUnit(), 222.00, 1000000000.00 )
        call UnitApplyTimedLifeBJ( 30.00, 'BTLF', GetLastCreatedUnit() )
        call CreateNUnitsAtLoc( 1, 'h001', GetOwningPlayer(udg_casterFreezingFeild), PolarProjectionBJ(GetUnitLoc(udg_casterFreezingFeild), 150.00, ( 240.00 + ( 180.00 * I2R(GetForLoopIndexA()) ) )), bj_UNIT_FACING )
        call SetUnitUserData( GetLastCreatedUnit(), R2I(AngleBetweenPoints(GetUnitLoc(udg_casterFreezingFeild), GetUnitLoc(GetLastCreatedUnit()))) )
        call UnitAddAbilityBJ( udg_abilityFreezingFeildLvl[GetUnitAbilityLevelSwapped('A00A', udg_casterFreezingFeild)], GetLastCreatedUnit() )
        call SetUnitFlyHeightBJ( GetLastCreatedUnit(), 270.00, 1000000000.00 )
        call SetUnitLifeBJ( GetLastCreatedUnit(), DistanceBetweenPoints(GetUnitLoc(udg_casterFreezingFeild), GetUnitLoc(GetLastCreatedUnit())) )
        call UnitApplyTimedLifeBJ( 30.00, 'BTLF', GetLastCreatedUnit() )
        call CreateNUnitsAtLoc( 1, 'h001', GetOwningPlayer(udg_casterFreezingFeild), PolarProjectionBJ(GetUnitLoc(udg_casterFreezingFeild), 77.00, ( 300.00 + ( 180.00 * I2R(GetForLoopIndexA()) ) )), bj_UNIT_FACING )
        call SetUnitUserData( GetLastCreatedUnit(), R2I(AngleBetweenPoints(GetUnitLoc(udg_casterFreezingFeild), GetUnitLoc(GetLastCreatedUnit()))) )
        call SetUnitLifeBJ( GetLastCreatedUnit(), DistanceBetweenPoints(GetUnitLoc(udg_casterFreezingFeild), GetUnitLoc(GetLastCreatedUnit())) )
        call UnitAddAbilityBJ( udg_abilityFreezingFeildLvl[GetUnitAbilityLevelSwapped('A00A', udg_casterFreezingFeild)], GetLastCreatedUnit() )
        call SetUnitFlyHeightBJ( GetLastCreatedUnit(), 300.00, 1000000000.00 )
        call UnitApplyTimedLifeBJ( 30.00, 'BTLF', GetLastCreatedUnit() )
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
endfunction

//===========================================================================
function InitTrig_abilityFreezingField takes nothing returns nothing
    set gg_trg_abilityFreezingField = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_abilityFreezingField, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_abilityFreezingField, Condition( function Trig_abilityFreezingField_Conditions ) )
    call TriggerAddAction( gg_trg_abilityFreezingField, function Trig_abilityFreezingField_Actions )
endfunction
 
Last edited:
Level 3
Joined
May 18, 2008
Messages
28
CreateNUnitsAtLoc
UnitApplyTimedLifeBJ
UnitAddAbilityBJ
SetUnitLifeBJ
SetUnitFlyHeightBJ

you got alot of BJ's to fix i suggest downloding a jass text editor or newgen wichs will help you for that matter, also there are location leaks and you could use locals for it,

local location temp = Location((locX),(locY))

local's has to be declared at the top of the function they are used in.. sorry i don't got time for a better description and i think you should learn how to do it urself or atleast try ;)
 
Status
Not open for further replies.
Top