[Trigger]Turning a very Complicated Ability Simple

Darkfish

Level 3
I am trying to make an ability that passively gives you 10/20/30 Intelligence and 200/400/600 HP, but is also an active that gives you 15%/30%/45% of your max HP per second for 20/40/60 seconds, but makes you lose your passive for that duration. I attempted that with my map but thoroughly failed. Any help would be appreciated. I attempted to copy a different ability that I imported to check for the level of the ability. I want the passive ability to be replaced with the regeneration ability for aesthetics only.

• Blood Pact Cast
• Events
• Unit - A unit Starts the effect of an ability
• Conditions
• (Ability being cast) Equal to Blood Pact (Active)
• Actions
• Trigger - Turn on Blood Pact Loop <gen>
• Set BP_Index[0] = (BP_Index[0] + 1)
• Set BP_Index[1] = (BP_Index[1] + 1)
• Set BP_Caster[BP_Index[1]] = (Casting unit)
• Set BP_CasterSingle = (Casting unit)
• Set BP_Level[BP_Array[1]] = (Level of (Ability being cast) for BP_Caster[BP_Index[1]])
• Unit - Add Blood Pact (Regen) to BP_CasterSingle
• Unit - Remove Blood Pact (Passive) from (Triggering unit)
• Unit - Remove Blood Pact Intelligence from (Triggering unit)
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• If - Conditions
• BP_Level[BP_Index[1]] Equal to 1
• Then - Actions
• Wait until (BP_Time Equal to 20), checking every 0.10 seconds
• Trigger - Turn off Blood Pact Loop <gen>
• Unit - Remove Blood Pact (Regen) from (Triggering unit)
• Unit - Add Blood Pact (Passive) to (Triggering unit)
• Unit - Set level of Blood Pact (Passive) for BP_CasterSingle to BP_Level[BP_Index[1]]
• Unit - Add Blood Pact Intelligence to (Triggering unit)
• Unit - Set level of Blood Pact Intelligence for BP_CasterSingle to BP_Level[BP_Index[1]]
• Set BP_Time = 0
• Else - Actions
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• If - Conditions
• BP_Level[BP_Index[1]] Equal to 2
• Then - Actions
• Wait until (BP_Time Equal to 40), checking every 0.10 seconds
• Trigger - Turn off Blood Pact Loop <gen>
• Unit - Remove Blood Pact (Regen) from (Triggering unit)
• Unit - Add Blood Pact (Passive) to (Triggering unit)
• Unit - Set level of Blood Pact (Passive) for BP_CasterSingle to BP_Level[BP_Index[1]]
• Unit - Add Blood Pact Intelligence to (Triggering unit)
• Unit - Set level of Blood Pact Intelligence for BP_CasterSingle to BP_Level[BP_Index[1]]
• Set BP_Time = 0
• Else - Actions
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• If - Conditions
• BP_Level[BP_Index[1]] Equal to 3
• Then - Actions
• Wait until (BP_Time Equal to 60), checking every 0.10 seconds
• Trigger - Turn off Blood Pact Loop <gen>
• Unit - Remove Blood Pact (Regen) from (Triggering unit)
• Unit - Add Blood Pact (Passive) to (Triggering unit)
• Unit - Set level of Blood Pact (Passive) for BP_CasterSingle to BP_Level[BP_Index[1]]
• Unit - Add Blood Pact Intelligence to (Triggering unit)
• Unit - Set level of Blood Pact Intelligence for BP_CasterSingle to BP_Level[BP_Index[1]]
• Set BP_Time = 0
• Else - Actions
• Blood Pact Loop
• Events
• Time - Every 1.00 seconds of game time
• Conditions
• Actions
• Unit - Set life of BP_CasterSingle to ((Life of BP_CasterSingle) + 45.00)
• Set BP_Time = (BP_Time + 1)
• Level
• Events
• Unit - A unit Learns a skill
• Conditions
• (Learned Hero Skill) Equal to Blood Pact (Active)
• Actions
• Unit - Add Blood Pact (Passive) to (Triggering unit)
• Unit - Add Blood Pact Intelligence to (Triggering unit)
• Unit - Set level of Blood Pact (Passive) for BP_CasterSingle to BP_Level[BP_Index[1]]
• Unit - Set level of Blood Pact Intelligence for BP_CasterSingle to BP_Level[BP_Index[1]]
EDIT: Solved

Last edited:

msongyboi

Level 7
i'm assuming it has to be in GUI right?

edit: site crashed while editing :<

You have indexing issues, BP_SingleCaster will be replaced everytime a unit casts the spell.
Dont use wait or waitUntils, do all your timedEffects in your Blood Pact Loop.

I.E.
Every BP_Period of game time

loop BP_CurrentIndex from 1 to BP_Index
if BP_TimeLeft[BP_CurrentIndex] <= 0. then
remove BP_PassiveIntAbility
remove BP_PassiveHpAbility
... deIndex
BP_Index = BP_Index - 1
else
UnitSetLife(GetUnitLife(BP_Caster[BP_CurrentIndex])) + BP_Bonus[BP_CurrentIndex])
BP_TimeLeft[BP_CurrentIndex] = BP_TimeLeft[BP_CurrentIndex] - BP_Period
endif
endloop

dynamic indexing

Last edited:

Darkfish

Level 3
Ah I managed to make it work, thanks anyways msongyboi. Any idea how to close the thread?

msongyboi

Level 7
a mod will come by and mark it as solved, just put all your initial post in a hidden box
and leave a edit message like "edit: solved" or sth

Replies
40
Views
1K
Replies
27
Views
977
Replies
6
Views
534
Replies
4
Views
282
Replies
10
Views
537