- Joined
- Apr 16, 2011
- Messages
- 158
hay
I have a spell for dummy ("Starfall") and a spell for the hero cast
but the function IssueTargetOrder() requires a target
the goal and do "Starfall" so that the hero does not have to keep casting
how make?
the second quest is about GroupRemoveUnit()
in which of these two sites is correct?
ty for help
I knew the answers: ((
but I was long forgotten ~~back to programing
I have a spell for dummy ("Starfall") and a spell for the hero cast
but the function IssueTargetOrder() requires a target
the goal and do "Starfall" so that the hero does not have to keep casting
how make?
JASS:
library SlowTime initializer init requires SpellEffectEvent
globals
private constant integer ABILITY_ID = 'A005'
private constant integer ABILITY_DUMMY = 'A004'
private constant integer DUMMY_ID = 'u000'
private constant real RADIUS = 1.000
endglobals
private function run takes nothing returns nothing
local unit u = GetTriggerUnit()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local unit d
local integer i = GetUnitAbilityLevel(u, ABILITY_ID)
set d = CreateUnit(GetTriggerPlayer(), DUMMY_ID, GetUnitX(u), GetUnitY(u), 0)
call UnitAddAbility(d, ABILITY_DUMMY)
call SetUnitAbilityLevel(d,ABILITY_DUMMY, i)
call IssueTargetOrder(d, "starfall",///HERRRR!@@1!// )
call UnitApplyTimedLife(d, 'BTLF', .10)
set u = null
set d = null
endfunction
private function init takes nothing returns nothing
call RegisterSpellEffectEvent(ABILITY_ID, function run)
endfunction
endlibrary
the second quest is about GroupRemoveUnit()
in which of these two sites is correct?
JASS:
call GroupEnumUnitsInRange(bj_lastCreatedGroup, x, y, RADIUS, null)
loop
set j = FirstOfGroup(bj_lastCreatedGroup)
exitwhen j == null
call GroupRemoveUnit(bj_lastCreatedGroup, j) // here ?
if IsUnitEnemy(j, p) and not IsUnitType(j, UNIT_TYPE_DEAD) and not IsUnitType(j, UNIT_TYPE_STRUCTURE) and not IsUnitType(j, UNIT_TYPE_MAGIC_IMMUNE) then
// ....
endif
// or here ?
endloop
ty for help
I knew the answers: ((
but I was long forgotten ~~back to programing