• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Turning a very Complicated Ability Simple

Status
Not open for further replies.
Level 3
Joined
Mar 20, 2010
Messages
40
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:
Level 8
Joined
Feb 3, 2013
Messages
277
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:
Status
Not open for further replies.
Top