im fairly new to JASS, but i needed to convert a non-MUI GUI code to MUI so ive been working on my JASS. I basically re-wrote it from scratch looking at my old code for some ideas trying to keep it leek free etc.
the skill basically creates cyclones around a point and has kinda a toilet bowl effect (soon to be finished) with a final big cyclone that grows in size at the end.
now my GUI version worked fine, just non-MUI and it's probably a 6 second long skill so there is a good chance for it to get messed up. anyway the beast is:
ive been trying to de-bug it and it seems to loop one time, and loop the counter without re-looping the whole top section. anyone spot what's wrong with it?
another quick question, the
i dont think i have correct, what is the 2nd param suppose to be?
(as ive said im new to jass so any help would be appreciated)
thanks ahead of time
YO_MA_MA
PS: ill be on tomorrow, hope to hear from ya then
the skill basically creates cyclones around a point and has kinda a toilet bowl effect (soon to be finished) with a final big cyclone that grows in size at the end.
now my GUI version worked fine, just non-MUI and it's probably a 6 second long skill so there is a good chance for it to get messed up. anyway the beast is:
JASS:
function Trig_Tornado_JASS_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00Y' ) ) then
return false
endif
return true
endfunction
function Trig_Tornado_JASS_Actions takes nothing returns nothing
local unit Caster = GetTriggerUnit()
local location CasterPoint = GetUnitLoc(Caster)
local location TargetPoint = GetSpellTargetLoc()
local location TorSpawnPoint
local unit DummyUnit
local unit TempUnit
local group enemies = CreateGroup()
local integer i = 4
local integer j = 0
local integer k = 0
loop
set i = i - 1
exitwhen i < 1
call GroupEnumUnitsInRangeOfLoc(enemies, TargetPoint, 200.0, null)
loop
set TempUnit = FirstOfGroup(enemies)
if IsUnitEnemy(TempUnit, GetOwningPlayer(Caster)) then
call SetUnitLifeBJ (TempUnit, (GetUnitStateSwap(UNIT_STATE_LIFE, TempUnit) * 0.50 ) )
endif
call GroupRemoveUnit(enemies, TempUnit)
exitwhen TempUnit == null
endloop
loop
exitwhen j > 24
set TorSpawnPoint = PolarProjectionBJ(TargetPoint, ( I2R(i) * 50.00 ), ( I2R(j) * 15.00 ))
call CreateUnitAtLoc (GetOwningPlayer(Caster), 'h00D', TorSpawnPoint, 270.0)
set DummyUnit = GetLastCreatedUnit()
call UnitApplyTimedLife (DummyUnit, 'null', 1.00)
call TriggerSleepAction( 0.00 )
set DummyUnit = null
call RemoveLocation(TorSpawnPoint)
set j = j + 1
call DisplayTimedTextToForce( GetPlayersAll(), 10.00, ( "i is : " + I2S(i) ) )
call DisplayTimedTextToForce( GetPlayersAll(), 10.00, ( "j is : " + I2S(j) ) )
endloop
call DisplayTimedTextToForce( GetPlayersAll(), 10.00, ( "i2 is : " + I2S(i) ) )
endloop
call CreateUnitAtLoc (GetOwningPlayer(Caster), 'h00D', TorSpawnPoint, 270.0)
set DummyUnit = GetLastCreatedUnit()
call UnitApplyTimedLife (DummyUnit, 'null', 3.50)
loop
exitwhen k > 20
call GroupEnumUnitsInRangeOfLoc(enemies, TargetPoint, ( I2R(i) * 05.00 ), null)
if IsUnitEnemy(TempUnit, GetOwningPlayer(Caster)) then
call SetUnitLifeBJ (TempUnit, (GetUnitStateSwap(UNIT_STATE_LIFE, TempUnit) * 0.95 ) )
endif
call SetUnitScalePercent( DummyUnit, ( I2R(k) * 15.00 ), ( I2R(k) * 15.00 ), ( I2R(k) * 10.00 ) )
call TriggerSleepAction( 0.00 )
call DisplayTimedTextToForce( GetPlayersAll(), 10.00, ( "k is : " + I2S(k) ) )
set k = k + 1
endloop
set CasterPoint = null
set TargetPoint = null
set TorSpawnPoint = null
call DestroyGroup(enemies)
call RemoveLocation(CasterPoint)
call RemoveLocation(TargetPoint)
call RemoveLocation(TorSpawnPoint)
set Caster = null
set DummyUnit = null
set TempUnit = null
endfunction
//===========================================================================
function InitTrig_Tornado_JASS takes nothing returns nothing
set gg_trg_Tornado_JASS = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Tornado_JASS, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Tornado_JASS, Condition( function Trig_Tornado_JASS_Conditions ) )
call TriggerAddAction( gg_trg_Tornado_JASS, function Trig_Tornado_JASS_Actions )
endfunction
ive been trying to de-bug it and it seems to loop one time, and loop the counter without re-looping the whole top section. anyone spot what's wrong with it?
another quick question, the
JASS:
call UnitApplyTimedLife (DummyUnit, 'null', 3.50)
(as ive said im new to jass so any help would be appreciated)
thanks ahead of time
YO_MA_MA
PS: ill be on tomorrow, hope to hear from ya then