• 🏆 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!

[JASS] Convert GUI to Jass (MUI)

Status
Not open for further replies.
Hi! Can some1 convert this GUI into Jass MUI? I would be really pleased!

  • Crucio
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Crucio
    • Actions
      • Wait until (((Target unit of ability being cast) has buff Crucio ) Equal to True), checking every 0.10 seconds
      • Set Target_Crucio = (Target unit of ability being cast)
      • Unit - Add Cargo Hold (Orc Burrow) to Target_Crucio
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Target_Crucio is dead) Equal to True
        • Then - Actions
          • Unit - Remove Cargo Hold (Orc Burrow) from Target_Crucio
        • Else - Actions
      • Wait 10.00 seconds
      • Unit - Remove Cargo Hold (Orc Burrow) from Target_Crucio
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
JASS:
function CrucioID takes nothing returns integer
   return 'A000' // Change to our ability id!!
endfunction
function OrcBurrowID takes nothing returns integer
   return 'A001' // Change to Orc Burrow ID!!
endfunction
function CrucioBUFF takes nothing returns integer
   return 'B000' // Change to your BUFF ID!!
endfunction
function CRUCIO takes nothing returns nothing
   local unit t = GetSpellTargetUnit()
   local unit c = GetSpellAbilityUnit()
   local real r = 0.00
   loop
      exitwhen GetUnitAbilityLevel(t, CrucioBUFF()) > 0
      call PolledWait(0.25)
   endloop
   call UnitAddAbility(t, OrcBurrowID())
   loop
      exitwhen r >= 10.00 or GetUnitState(t, UNIT_STATE_LIFE) <= 0
      call PolledWait(0.25)
      set r = r + 0.25
   endif
   call UnitRemoveAbility(t, OrcBurrowID())
   set t = null
   set u = null
endfunction
function INIT takes nothing returns nothing
   local trigger t = CreateTrigger()
   local integer i = 0
   call TriggerAddAction(t, function CRUCIO)
   loop
      call TriggerRegisterPlayerUnitEvent(t, Player(i), EVENT_UNIT_SPELL_EFFECT, Condition(function CrucioID))
      set i = i + 1
   endloop
endfunction
this should work, i think,, just edit the ID things,, no vJass, so easily implentable

EDITED, now it removes the ability as soon as it is dead or time is up,,
Though you should do something else than PolledWait, since it leaks!,, but TriggerSleepAction sucks,,
 
Last edited:
Status
Not open for further replies.
Top