NeuroToxin
New Member
- Reaction score
- 46
Okay, so here's what I have.
All its supposed to do, is summon X Units at targeted spot, and im gonna add some graphics. Im gonna add more to it after I can get this much working, but im confused as to how to make it MUI, and if I have to loop through each of the spells in order to check if any of them are the right one? And what do I use as a variable in order to say the ability ID? like 'A006'
JASS:
library Summons
//==========================================================================
//================================SETUP=====================================
//==========================================================================
globals
private ability array SummonAbility[1] = 039;AHfs039;//The summon ability, *Note, if you want to add more, just copy this line,
//Then just change the [1] to a [2] or a [3] etc. and add 1 number to i, *Note, only add 1 to i when you add another ability.
private unit array Unit_Id[1] = 039;e00A039;//Same as the "SummonAbility" variable, just copy and paste the line.
private real array NumSummoned[1] = 2//The number of summoned Units of X type.
private integer i = 1//Needed for the loops.
private integer m = i//Needed once again.
endglobals
//===========================================================================
//=============================ENDSETUP======================================
//===========================================================================
private function WhatSpells takes nothing returns boolean
for
exitwhen 1 >= i
if GetSpellAbilityId() == SummonAbility<i> then
return true
endif
set i = i - 1
endfunction
struct
private real x
private real y
private location temploc
private method CreateUnits takes nothing returns nothing
set i = m
local player p = GetOwningPlayer(GetTriggerUnit())
call WhatSpells()
set temploc = GetSpellTargetLoc()
set x = GetLocationX(temploc)
set y = GetLocationY(temploc)
for
exitwhen 1 >= i
for
exitwhen 1 >= i
CreateUnit(p, Unit_Id, x, y, 270)
set i = i - 1
endmethod
endstruct
//===========================================================================
function InitTrig_Summons_System takes nothing returns nothing
set gg_trg_Summons_System = CreateTrigger( )
call TriggerAddAction( gg_trg_Summons_System, function Trig_Start_Actions )
endfunction
endlibrary
</i>
All its supposed to do, is summon X Units at targeted spot, and im gonna add some graphics. Im gonna add more to it after I can get this much working, but im confused as to how to make it MUI, and if I have to loop through each of the spells in order to check if any of them are the right one? And what do I use as a variable in order to say the ability ID? like 'A006'