WolfieeifloW
WEHZ Helper
- Reaction score
- 372
I figured this out in GUI easy, but I can't in JASS.
It creates X Peons around the hero for X seconds;
Where X depends on the level of the spell.
The problem?
It only creates 1 single peon at 0 degrees.
JASS:
scope PeonCircle initializer PCInit
globals
private constant integer PCID = 039;A000039;
endglobals
private function Conditions takes nothing returns boolean
return GetSpellAbilityId() == PCID
endfunction
private function Actions takes nothing returns nothing
local unit Caster = GetTriggerUnit()
local unit u
local integer zz = 0
local integer z = 0
local real x
local real y
loop
exitwhen z == 10
//set x = PolarProjectionBJ(GetUnitLoc(Caster), 300, I2R((i * 36)))
set x = GetLocationX(GetUnitLoc(Caster)) + 300 * Cos((z * 36) * bj_DEGTORAD)
//set y = PolarProjectionBJ(GetUnitLoc(Caster), 300, I2R((i * 36)))
set y = GetLocationY(GetUnitLoc(Caster)) + 300 * Sin((z * 36) * bj_DEGTORAD)
loop
exitwhen zz == GetUnitAbilityLevel(Caster, PCID)
set u = CreateUnit(GetOwningPlayer(Caster), 039;o000039;, x, y, GetUnitFacing(Caster))
call IssuePointOrder(u, "attack", x, y)
call UnitApplyTimedLife(u, 039;BTLF039;, (2 + I2R(GetUnitAbilityLevel(Caster, PCID))))
set u = null
set zz = zz + 1
endloop
set z = z + 1
endloop
set Caster = null
endfunction
//====================================================================================================
private function PCInit takes nothing returns nothing
local trigger t = CreateTrigger()
local integer i = 0
loop
call TriggerRegisterPlayerUnitEvent(t, Player(i), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
set i = i + 1
exitwhen i == bj_MAX_PLAYER_SLOTS
endloop
call TriggerAddCondition(t, Condition(function Conditions))
call TriggerAddAction(t, function Actions)
endfunction
endscope
It creates X Peons around the hero for X seconds;
Where X depends on the level of the spell.
The problem?
It only creates 1 single peon at 0 degrees.