Decreasing attack speed/mana regeneration

Level 12
Joined
Apr 15, 2008
Messages
1,063
Hi guys, I recently came upon a problem in my map: the abilities "Item Attack Speed bonus" and "Item mana regeneration bonus" don't work with levels (their effect work as if they were on the first level, even if they'r higher).
The thing is, I need some way of permanently decreasing attack speed and mana regeneration (separately), but these decrements has to be scaleable (about 20 levels), so creating new ability for each of these "levels" won't work.
So what I need is:
a way to fix the first-level-only rule on those abilities
OR
another way to permanenty decrease attack speed and mana regen

EDIT: Attack speed bonus scales with level as any other skill, I was wrong there

Thanks in advance
 
Last edited:
Well, i have never heard of this problem before, maybe because i wanted no permanent decrease effect. To be honest, attack speed is something i must look deeper to get you a solution. For the mana regeneration rate decrease, i would go for a trigger.
In that case, you will need to detect mana regeneration of that specific unit and once your actions are made (e.g. you cast a spell / fail in a quest / whatever the action is), you creat e a formula, applied on the trigger of the mana regeneration. Let's have an example:

  • Mana Regeneration
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ManaCount Equal to True
        • Then - Actions
          • Set Picked = 0
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions) [OR whatever your group is]
            • Loop - Actions
              • Set Picked = (Picked + 1)
              • Set Unit[Picked] = (Picked unit)
              • Set Mana[Picked] = (Mana of Unit[Picked])
          • Set ManaCount = False
        • Else - Actions
          • For each (Integer A) from 1 to (Picked), do (Actions)
            • Loop - Actions
              • Set ManaRegen = (((Mana of Unit[(Integer A)]) - Mana[(Integer A)]))
          • Set ManaCount = True
This is how mana regeneration is calculated every second.
Let's say you have an ability that permanently decreases the mana regeneration.
You have for example this formula: "ManaDecrease = ((ManaRegen) / (Level of (Mana Decrease) for (Triggering unit)" The triggering unit refers to the casting unit.
Then, you get this:
  • Trigger1
  • Events
    • A unit starts the effect of an ability
  • Conditions
    • Ability being cast Equal to Mana Decrease
  • Actions
    • Set Unit_Mana = (Target unit of ability being cast)
    • Set ManaDecrease = ((ManaRegen) / (Level of (Mana Decrease) for (Triggering unit))
    • Trigger - Turn off (Mana Regeneration <gen>)
    • Trigger - Turn on (Mana Regeneration New <gen>)
  • Mana Regeneration New
  • Events
    • Time - Every 1.00 seconds of game-time
  • Conditions
  • Actions
    • Unit - Set mana of (Unit_Mana) to ((Mana of (Unit_Mana) - (ManaDecrease))
 
Last edited:
Yeah, pray for me later on. :p I found the solution; believe it or not, the Spell Book will do the trick. Have a custom spell book and add the ability Gloves of Haste. Don't change the Gloves of Haste ability and the Spell Book one into "Unit ability" or "Hero"; leave it as Item ability.

Then,
  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit - Add Spell Book to Archmage 0001 <gen>
      • Player - Disable Spell Book for Player 1 (Red)
To test it:

  • Untitled Trigger 004
    • Events
      • Player - Player 1 (Red) types a chat message containing -o as An exact match
    • Conditions
    • Actions
      • Trigger - Turn on Untitled Trigger 005 <gen>
  • Untitled Trigger 005
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Increase level of Item Attack Speed Bonus (Gloves of Haste) for Archmage 0001 <gen>
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Item Attack Speed Bonus (Gloves of Haste) for Archmage 0001 <gen>) Equal to 10
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
The last trigger is a Non initially enabled one.
 
Level 12
Joined
Apr 15, 2008
Messages
1,063
I haven't tried it yet, but in case it worked, it would allow to use level on ALL abilities this way, which would just be AWESOME!!

EDIT: sorry for misleading, the "Attack Speed Bonus" uses level without needing any "tricks". Thanks for help everyone. If i forgot to rep anyone who deserves it, please PM me :grin:
 
Last edited:
Top