- Joined
- Oct 10, 2009
- Messages
- 1,426
Dang, I hate asking for help..., but I'm fairly new to jass and I really need help with a spell I'm making.
Okay, the spell I'm making pretty much get a random unit within 512 range of the caster and attacks him, whether he's allied or not.
Once I get this to work, I'm going to make the unit uncontrollable for X amount of seconds depending on the level of the spell,
but I still can't get the first part complete.
All it does now is he plays he resets his stand anim.
If one of you pro jassers out there could help out, I'd be very grateful.
Let me know if you need any additional info.
Okay, the spell I'm making pretty much get a random unit within 512 range of the caster and attacks him, whether he's allied or not.
Once I get this to work, I'm going to make the unit uncontrollable for X amount of seconds depending on the level of the spell,
but I still can't get the first part complete.
All it does now is he plays he resets his stand anim.
If one of you pro jassers out there could help out, I'd be very grateful.
Let me know if you need any additional info.
JASS:
function Condition takes nothing returns boolean
if GetSpellAbilityId() == 'ZZZZ' then
else
return false
endif
return true
endfunction
function UnitPick takes nothing returns nothing
local unit caster = GetTriggerUnit()
call GroupAddUnit(udg_T, GroupPickRandomUnit(GetUnitsInRangeOfLocAll(512, GetUnitLoc(caster))))
set udg_target = FirstOfGroup(udg_T)
call IssueTargetOrder(caster,"attack",udg_target)
set caster = null
set udg_target = null
call GroupRemoveUnit(udg_T,FirstOfGroup(udg_T))
endfunction
//===========================================================================
function InitTrig_SpellJass takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(t,Condition(function Condition))
call TriggerAddAction(t,function UnitPick)
endfunction