- Joined
- Apr 16, 2011
- Messages
- 158
Ok I'll explain what I'm trying to do
My unit has three passive skill
I intend to make an ultimate than the opposite effect of each passive that it has.
The ultimate must interact with the level of passive and return to the opposite passive.
passives has 4 levels
Ultimate 3
passive should only interact until level 3
-
for this I did:
3 passive and 3 buff
3 passive unlike and 3 buff
I'm using SpellEffectEvent
-
I did this very precariously:
*with this system you can only update once ^ ^
*the second time I have no updates according to the level of buffs
*would be interesting to not use so many "if"
*another problem, the skills are added to my main unit, which becomes bad because it occupies space and takes the place of other spells
*I'm thinking how to do it right, without these problems
help me with what can,I'm confused
My unit has three passive skill
I intend to make an ultimate than the opposite effect of each passive that it has.
The ultimate must interact with the level of passive and return to the opposite passive.
passives has 4 levels
Ultimate 3
passive should only interact until level 3
-
for this I did:
3 passive and 3 buff
3 passive unlike and 3 buff
I'm using SpellEffectEvent
-
I did this very precariously:
*with this system you can only update once ^ ^
*the second time I have no updates according to the level of buffs
*would be interesting to not use so many "if"
*another problem, the skills are added to my main unit, which becomes bad because it occupies space and takes the place of other spells
*I'm thinking how to do it right, without these problems
help me with what can,I'm confused
JASS:
library NegativeSpirit initializer onInit uses SpellEffectEvent
globals
private constant integer SPELL_MAIN = 'A00B' // spell
private constant integer PASSIVE_ID_1 = 'A005' // Passive 1
private constant integer PASSIVE_ID_2 = 'A004' // Passive 2
private constant integer PASSIVE_ID_3 = 'A002' // Passive 3
private constant integer NEGATIVE_ID_1 = 'A00C' // Negative Passive 1
private constant integer NEGATIVE_ID_2 = 'A00D' // Negative Passive 2
private constant integer NEGATIVE_ID_3 = 'A00E' // Negative Passive 3
endglobals
private function onCast takes nothing returns nothing
local unit u = GetTriggerUnit()
loop
if GetUnitAbilityLevel(u, 'B001') > 0 then
call UnitAddAbility(u, NEGATIVE_ID_1)
call SetUnitAbilityLevel(u, NEGATIVE_ID_1, GetUnitAbilityLevel(u, PASSIVE_ID_1))
endif
if GetUnitAbilityLevel(u, 'B002') > 0 then
call UnitAddAbility(u, NEGATIVE_ID_2)
call UnitAddAbility(u, 'B003')
call SetUnitAbilityLevel(u, NEGATIVE_ID_2, GetUnitAbilityLevel(u, PASSIVE_ID_2))
endif
if GetUnitAbilityLevel(u, 'B006') > 0 then
call UnitAddAbility(u, NEGATIVE_ID_3)
call SetUnitAbilityLevel(u, NEGATIVE_ID_3, GetUnitAbilityLevel(u,PASSIVE_ID_3))
endif
endloop
set u = null
endfunction
private function onInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_MAIN, function onCast)
endfunction
endlibrary
Last edited: