- Joined
- Apr 6, 2008
- Messages
- 760
how can i make an effective stack (the more i cast it the more effect it will do)
e.g
i can do the H2I version but it wont be MUI
Edit:
what about this?
e.g
JASS:
call UnitDamageTarget(u,t,dmg*Stacks)
i can do the H2I version but it wont be MUI
Edit:
what about this?
JASS:
struct Data
unit caster
unit target
real duration
integer stacks
static integer array Ar
static integer Total = 0
static timer Time = CreateTimer()
//stuff
endstruct
functon OnCast takes nothing returns boolean
local Data Dat
local unit u
local unit t
local integer i = 0
local boolean Match = false
if GetSpellAbilityId()==Abil_id then
set u = GetTriggerUnit()
set t = GetSpellTargetUnit()
loop //here we check if any struct have the same caster and target
exitwhen i >= Dat.Total or Match
set Dat = Dat.Ar[i]
if Dat.target == t and Dat.caster == u then //if there is a match
if Dat.stacks < Max_Stacks then //check if we can stack it more
set Dat.stacks = Dat.stacks + 1
endif
set Dat.duration = Max_Duration //set the duration too full again
set Match = true //set the boolean true, meaning that we have found a match
endif
set i = i + 1
endloop
if not Match then //if we didnt find a match we create a new struct
set Dat = Data.create(u,t)
endif
set u = null
set t = null
endif
return false
endfunction
Last edited: