• 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.
  • It's time for the first HD Modeling Contest of 2025. Join the theme discussion for Hive's HD Modeling Contest #7! Click here to post your idea!

Converting GUI to JASS

Status
Not open for further replies.
Level 4
Joined
Dec 10, 2008
Messages
25
I just starting out learning about JASS. can someone help me convert this one so i can see a clear example.
attachment.php
 

Attachments

  • GUI.jpg
    GUI.jpg
    298 KB · Views: 269
Level 40
Joined
Dec 14, 2005
Messages
10,532
Plain JASS (Trigger name: CounterHelix):

You should have a global Unit Group called enumGrp declared.

JASS:
function CounterHelixConditions takes nothing returns boolean
    return GetRandomInt(1,100) <= 15 and GetUnitAbilityLevel(GetTriggerUnit(), 'BFID') > 0
    //replace BFID with your spell's rawcode
endfunction

function CounterHelixFilter takes nothing returns boolean
    local unit u = GetTriggerUnit()
    local unit t = GetFilterUnit()
    if IsUnitEnemy(t,GetOwningPlayer(u)) and not IsUnitType(t,UNIT_TYPE_DEAD) then
        call UnitDamageTarget(u,t,75.+25.*GetUnitAbilityLevel(u,'SPID'),true,false,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,null)
         //replace SPID with your counter helix spell rawcode
        call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl",t,"origin"))
    endif
    set u = null
    set t = null
    return false
endfunction

function CounterHelixActions takes nothing returns nothing
    local unit u = GetTriggerUnit()
    call GroupEnumUnitsInRange(udg_enumGrp,GetUnitX(u),GetUnitY(u),200.,Filter(function CounterHelixFilter))
    call SetUnitAnimation(u,"spin")
    call DisableTrigger(GetTriggeringTrigger())
    call TriggerSleepAction(.25)
    call EnableTrigger(GetTriggeringTrigger())
    call SetUnitAnimation(u,"stand")
    set u = null
endfunction

function InitTrig_CounterHelix takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_ATTACKED)
    call TriggerAddCondition(t,Condition(function CounterHelixConditions))
    call TriggerAddAction(t,function CounterHelixActions)
endfunction
 
Status
Not open for further replies.
Top