"Outer Functions" Help

Demi666

New Member
Reaction score
127
ok so im making a spell for my spellpack and i thought before i made anything more on it..

Can outerfunctions know what " GetEnumUnit " and " GetSpellAbilityUnit " is?

here is my code ( unfinished )
and it wont work if outer functions doesent know what it is, couse i cant use handlevars yet

please tell me :)

JASS:
function Trig_Electric_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A004'
endfunction

function Spell takes nothing returns integer
return 'A004'
endfunction

function Dummy_Spell takes nothing returns integer
return 'A005'
// edit here for your rawcode
endfunction

function Is_Dead_Or_Not takes nothing returns boolean
return (IsUnitType(GetFilterUnit(), UNIT_TYPE_DEAD) == false)
endfunction

function Is_Unit_Ally takes unit caster returns boolean
return ( IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(caster)))
endfunction

function groupFilter takes nothing returns boolean
    return Is_Unit_Ally(GetTriggerUnit()) and Is_Dead_Or_Not()
endfunction

function Buff takes nothing returns integer
 return 'BSTN'
// Edit here for the Wait Until Condition buff
endfunction

function Unit_Has_Buff takes nothing returns boolean
 return UnitHasBuffBJ(GetSpellTargetUnit(),Buff()) == true
endfunction

constant function Wait_For_ConD takes nothing returns real
 return 0.27
// Edit here for the cheking between intervals
endfunction 

function Dummy takes nothing returns integer
 return 'h000'
//Edit here for your dummy unit
endfunction

function Spell_Thingy takes nothing returns nothing
  local location temp_point = GetUnitLoc(GetEnumUnit())
  local location y = GetUnitY(GetEnumUnit())
  local location x = GetUnitX(GetEnumUnit())
 
 call CreateUnitAtLoc(GetOwningPlayer
endfunction



function Trig_Electric_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local unit target = GetSpellTargetUnit()
local location loc = GetUnitLoc(target)
local group Group


loop
exitwhen(Unit_Has_Buff())
 call TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL, Wait_For_ConD()))
endloop

set Group = GetUnitsInRangeOfLocMatching(150*(GetUnitAbilityLevel(target,Spell())),loc,Condition(function groupFilter))
call ForGroup(Group,Spell_Thingy())

endfunction

//===========================================================================
function InitTrig_Electric takes nothing returns nothing
    set gg_trg_Electric = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Electric, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Electric, Condition( function Trig_Electric_Conditions ) )
    call TriggerAddAction( gg_trg_Electric, function Trig_Electric_Actions )
endfunction
 

Arkan

Nobody rides for free
Reaction score
92
GetEnumUnit() only works in a function that is called with ForGroup().
 

The_Kingpin

Member (Who are you and why should I care?)
Reaction score
40
Note that the called function must take nothing and return nothing.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top