WolfieeifloW
WEHZ Helper
- Reaction score
- 372
I have no idea what changed that could have wrecked this system.
It was working completely fine, and now it doesn't.
What's supposed to happen:
A unit uses a certain spell (Mangle or Claw) and gets a 'combo point'.
Combo points range from 0-5.
So, I made 6 spells with different icons/descriptions/models to represent these combo points.
When the hero uses Mangle/Claw, it's combo points get increased by 1 up to a maximum of 5.
The system removes the current combo point ability, and gives it the next rank (Again, up to 5).
The problem?
On the first attack, it just stays with the 0 ability.
On the second attack, it keeps the 0 ability, AND gives the hero the 1 ability.
On the third, it keeps 0, 1, and gives the hero the 2 ability.
However, according to the BJDebug's, it should be working perfectly:
The outcome of the debugs for the first cast are:
According to these, it should be removing the current ability, and replacing it with the next one up, which it's not.
It was working completely fine, and now it doesn't.
What's supposed to happen:
A unit uses a certain spell (Mangle or Claw) and gets a 'combo point'.
Combo points range from 0-5.
So, I made 6 spells with different icons/descriptions/models to represent these combo points.
When the hero uses Mangle/Claw, it's combo points get increased by 1 up to a maximum of 5.
The system removes the current combo point ability, and gives it the next rank (Again, up to 5).
The problem?
On the first attack, it just stays with the 0 ability.
On the second attack, it keeps the 0 ability, AND gives the hero the 1 ability.
On the third, it keeps 0, 1, and gives the hero the 2 ability.
However, according to the BJDebug's, it should be working perfectly:
JASS:
scope ComboPoints initializer CPInit
globals
integer array combo
endglobals
private function Conditions takes nothing returns boolean
local unit u
local integer ud
call BJDebugMsg("Running")
if (GetUnitTypeId(GetTriggerUnit()) == feralDruid and GetSpellAbilityId() == mangle or GetSpellAbilityId() == claw) then
call BJDebugMsg("Passed")
set u = GetTriggerUnit()
set ud = GetUnitUserData(u)
call BJDebugMsg("Before UD- " + I2S(ud))
if (ud != 5) then
call BJDebugMsg("Passed2")
call UnitRemoveAbility(u, combo[ud])
call SetUnitUserData(u, ud + 1)
call BJDebugMsg("After UD- " + I2S(GetUnitUserData(u)))
call UnitAddAbility(u, combo[ud])
endif
endif
set u = null
return false
endfunction
private function CPInit takes nothing returns nothing
local trigger t = CreateTrigger()
local integer index = 0
loop
call TriggerRegisterPlayerUnitEvent(t, Player(index), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
set index = index + 1
exitwhen index == bj_MAX_PLAYER_SLOTS
endloop
call TriggerAddCondition(t, Condition(function Conditions))
set t = null
endfunction
endscope
The outcome of the debugs for the first cast are:
And for the second cast:Running
Passed
Before UD- 0
Passed2
After UD- 1
And so on.Running
Passed
Before UD- 1
Passed2
After UD- 2
According to these, it should be removing the current ability, and replacing it with the next one up, which it's not.