- Joined
- Feb 11, 2011
- Messages
- 1,860
Hello,
I am requesting your help once again. Since I am learning vJASS, I am trying to 'upgrade' all of my spells to vJASS. I made this rather complicated one using normal JASS. However, now I am having trouble getting it to work, mainly because using
Notes:
Feel free to ask me for more information, because this sounds quite complicated. Thanks for any help!
I am requesting your help once again. Since I am learning vJASS, I am trying to 'upgrade' all of my spells to vJASS. I made this rather complicated one using normal JASS. However, now I am having trouble getting it to work, mainly because using
TriggerSleepAction
and PolledWait
don't work. Here is the script:
JASS:
scope EnergyFissure initializer InitTrigger
globals
unit Effect
timer Timer
real Distance
endglobals
private function kill takes nothing returns nothing
call KillUnit(Effect)
endfunction
private function group_act takes nothing returns nothing
local real x = GetUnitX(Effect)
local real y = GetUnitY(Effect)
set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(Effect), 'h003', x, y, bj_UNIT_FACING)
call RemoveGuardPosition(bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit, 'A04V')
call SetUnitAbilityLevel(bj_lastCreatedUnit, 'A04V', udg_int)
call IssueTargetOrder(bj_lastCreatedUnit, "manaburn", GetEnumUnit())
call UnitApplyTimedLife(bj_lastCreatedUnit, 'BTLF', 1)
endfunction
private function group_cond takes nothing returns boolean
return IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(GetTriggerUnit())) == true
endfunction
private function act_2 takes nothing returns nothing
call GroupEnumUnitsInRange(bj_lastCreatedGroup, GetUnitX(Effect), GetUnitY(Effect), Distance, Condition(function group_cond))
call ForGroup(bj_lastCreatedGroup, function group_act)
endfunction
private function act_1 takes nothing returns nothing
local real x = GetUnitX(Effect)
local real y = GetUnitY(Effect)
local real x2
local real y2
local integer i = 1
local integer i2 = 1
local real wait_time
local group ug = CreateGroup()
local boolean b = false
loop
exitwhen i == 4
set Distance = (150 * i) + 100
set wait_time = Distance / 300
loop
exitwhen i2 == 9
set x2 = (x + 100) * Cos(i2 * 45 * bj_DEGTORAD)
set y2 = (y + 100) * Sin(i2 * 45 * bj_DEGTORAD)
set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(Effect), 'h003', x, y, bj_UNIT_FACING)
call RemoveGuardPosition(bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit, 'A015')
call SetUnitAbilityLevel(bj_lastCreatedUnit, 'A015', i)
if (IsTerrainPathable(x2, y2, PATHING_TYPE_WALKABILITY)) == true then
call SetTerrainPathable(x2, y2, PATHING_TYPE_WALKABILITY, true)
set b = true
endif
call IssuePointOrder(bj_lastCreatedUnit, "carrionswarm", x2, y2)
if (b == true) then
call SetTerrainPathable(x2, y2, PATHING_TYPE_WALKABILITY, false)
endif
call UnitApplyTimedLife(bj_lastCreatedUnit, 'BTLF', 1)
set i2 = i2 + 1
endloop
call TimerStart(Timer, wait_time, false, function act_2)
call TriggerSleepAction(wait_time)
set i = i + 1
set i2 = 1
endloop
call TimerStart(Timer, 1, false, function kill)
endfunction
private function cond takes nothing returns boolean
if (GetSpellAbilityId() == 'A04R') then
set Effect = CreateUnit(GetTriggerPlayer(), 'h00J', GetSpellTargetX(), GetSpellTargetY(), bj_UNIT_FACING)
call RemoveGuardPosition(Effect)
call TimerStart(Timer, 1, false, function act)
endif
return false
endfunction
private function InitTrigger takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Condition(function cond))
set t = null
endfunction
endscope
ExplanationEnergy Fissure:
Creates a void of energy at the target location. After 1 second, it sends out three pulses around the void. Once the pulses reach their maximum distance, they dissipate and all units that are within the distance lose some mana.Each pulse travels further than the previous one and zaps more mana.
Pulse 1: 250 distance, 100 mana burned.
Pulse 2: 400 distance, 200 mana burned.
Pulse 3: 550 distance, 300 mana burned.
- Does not need to be MUI.
- Waves are a purple version of Crushing Wave.
- 8 of these waves create 1 pulse.
- Mana is only burned when each pulse reaches its maximum distance.
- The next pulse triggers when the previous one reaches its maximum distance.
- The waves' speed is 300.
This is the effect that is created when you cast the spell. The pulses come out of here.
This shows what the pulses look like.
This shows what happens when the pulses reach their maximum range.
This shows what the pulses look like.
This shows what happens when the pulses reach their maximum range.
Feel free to ask me for more information, because this sounds quite complicated. Thanks for any help!