- Joined
- Nov 13, 2006
- Messages
- 1,814
1st of all, i want say for me the speed important and not really the accurated delays/wait between actions
Info:
-Alot seperated spell trigger
-They arent different kind (dot, spamable heal over time, missile ability like firebolt, buff like add x=1 and after y second x=0[group or just 1 unit buffs])
-every case exclude missle spells, i used a TSA with a loop and till duration end i checked if unit died/caster died or no, if yes then exit from loop, destroy special effect on caster or target and change a variable value/or just stop the dot/heal
-few case i used unit group, few case just 1 target unit
all got condition like this:
then action, but i got a advice to use only condition and in condition i can use if and return allways false but my question is, if i must declare alot thing like
and in few ability case just
so if i wanna merge every ability to 1 single trigger then everytime maybe i must declare useless locals (because example few ability is no target ability, few single target, few aoe target also few got 1 effect another 10 etc)
local declaretions slowdown something, or better the useing the separated triggers for each spell 1 triggers coz difference in speed is similiar than merge but declare all variable even its not needed?
Another thing, if i make a single periodic trigger and for each spell make unit group and with if i check what spell then check every unit group in periodic trigger is better than use TSA with loop in each trigger spell in faster trigger view?
i use sometime loop only for this
single unit version
Info:
-Alot seperated spell trigger
-They arent different kind (dot, spamable heal over time, missile ability like firebolt, buff like add x=1 and after y second x=0[group or just 1 unit buffs])
-every case exclude missle spells, i used a TSA with a loop and till duration end i checked if unit died/caster died or no, if yes then exit from loop, destroy special effect on caster or target and change a variable value/or just stop the dot/heal
-few case i used unit group, few case just 1 target unit
all got condition like this:
JASS:
function Trig_Dotw_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A02L'
endfunction
then action, but i got a advice to use only condition and in condition i can use if and return allways false but my question is, if i must declare alot thing like
JASS:
local unit uc = GetTriggerUnit()
local unit u = GetSpellTargetUnit()
local unit u1
local unit u2
local unit u3
local unit u4
local unit u5
local integer a = 0
local integer h1 = 330
local integer h2 = 320
local integer d = 10
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local real g = (3.14159/180)
local real x1 = x + 300 * Cos(g * 0)
local real y1 = y + 300 * Sin(g * 0)
local real x2 = x + 300 * Cos(g * 72)
local real y2 = y + 300 * Sin(g * 72)
local real x3 = x + 300 * Cos(g * 144)
local real y3 = y + 300 * Sin(g * 144)
local real x4 = x + 300 * Cos(g * 216)
local real y4 = y + 300 * Sin(g * 216)
local real x5 = x + 300 * Cos(g * 288)
local real y5 = y + 300 * Sin(g * 288)
local real sp = 100
local real lhp = GetUnitAbilityLevel(uc, 'A02S')*5+10
local real hp = GetWidgetLife(u)
local real chp = hp
local real cchp = GetWidgetLife(uc)
local real mhp = hp/lhp
local lightning l1
local lightning l2
local lightning l3
local lightning l4
local lightning l5
local lightning l6
local lightning l7
local lightning l8
local lightning l9
local lightning l10
local player p = GetTriggerPlayer()
local string s1 = udg_Effects[5]
local effect f = AddSpecialEffectTarget(s1, u, "origin")
and in few ability case just
JASS:
local unit pu
local unit u = GetTriggerUnit()
local player p = GetTriggerPlayer()
local real xt = GetSpellTargetX()
local real yt = GetSpellTargetY()
local real dmg = GetUnitAbilityLevel(u, 'A03A') * GetHeroLevel(u) + udg_TotalSpellPower[GetPlayerId(p)+1]/5
local real hdmg = dmg/2
local string array s
local effect f
local group gr = bj_lastCreatedGroup
so if i wanna merge every ability to 1 single trigger then everytime maybe i must declare useless locals (because example few ability is no target ability, few single target, few aoe target also few got 1 effect another 10 etc)
local declaretions slowdown something, or better the useing the separated triggers for each spell 1 triggers coz difference in speed is similiar than merge but declare all variable even its not needed?
Another thing, if i make a single periodic trigger and for each spell make unit group and with if i check what spell then check every unit group in periodic trigger is better than use TSA with loop in each trigger spell in faster trigger view?
i use sometime loop only for this
JASS:
loop
exitwhen (a==bdur)
call TriggerSleepAction(1)
loop
exitwhen (i==d)
if IsUnitType(ua[i], UNIT_TYPE_DEAD) then
call DestroyEffect(df[i])
set e = LoadInteger(udg_Buff_Table, 3, GetUnitUserData(ua[i]))
call SaveInteger( udg_Buff_Table, 3, GetUnitUserData(ua[i]), e - rate )
set df[i] = null
set ua[i] = null
endif
set i = i + 1
endloop
set i = 0
set a = a + 1
endloop
JASS:
loop
exitwhen IsUnitType(u, UNIT_TYPE_DEAD) or i==dur
call TriggerSleepAction(1)
set i = i + 1
endloop
Last edited: