• 🏆 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!

Berserker Rage 1.1

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Simple Spell that increaces caster's strength over time until it reaches full bonus. Caster will maintain that bonus for chosen time after strength increacement expiress. After that the efect expires and bonus strength is lost.

This is my first MUI Spell which i uploaded just for comments, sugestions, ideas for making it more complex and worthy of administrator's approval.





Map initialization:
  • Berserker Rage init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set BerserkerRage_Hash = (Last created hashtable)
      • -------- Set Duration of Periodic Strength Gain --------
      • Set BerserkerRage_StrGainDuration = 10.00
      • -------- Set Duration of Fixed Bonus --------
      • Set BerserkerRage_FixedStrDuration = 3.00
      • -------- Set Strength Gained --------
      • Set BerserkerRage_StrGained = 100
Spell Cast:
  • Berserker Rage Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Berserker Rage
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is in BerserkerRage_UnitGRP) Equal to False
        • Then - Actions
          • Hashtable - Save (BerserkerRage_FixedStrDuration + BerserkerRage_StrGainDuration) as 0 of (Key (Triggering unit)) in BerserkerRage_Hash
          • Hashtable - Save (Strength of (Triggering unit) (Include bonuses)) as 1 of (Key (Triggering unit)) in BerserkerRage_Hash
          • Unit Group - Add (Triggering unit) to BerserkerRage_UnitGRP
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • (Berserker Rage Loop <gen> is on) Equal to False
                  • ((Triggering unit) is in BerserkerRage_UnitGRP) Equal to True
            • Then - Actions
              • Trigger - Turn on Berserker Rage Loop <gen>
            • Else - Actions
        • Else - Actions
Spell Loop:
  • Berserker Rage Loop
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in BerserkerRage_UnitGRP and do (Actions)
        • Loop - Actions
          • Set BerserkerRage_TempUnit = (Picked unit)
          • Custom script: set udg_BerserkerRage_TempInt = GetHandleId(udg_BerserkerRage_TempUnit)
          • Set BerserkerRage_Duration = (Load 0 of BerserkerRage_TempInt from BerserkerRage_Hash)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • BerserkerRage_Duration Greater than BerserkerRage_FixedStrDuration
            • Then - Actions
              • Hero - Modify Strength of BerserkerRage_TempUnit: Add ((BerserkerRage_StrGained / (Integer(BerserkerRage_StrGainDuration))) / 10)
              • Hashtable - Save (BerserkerRage_Duration - 0.10) as 0 of BerserkerRage_TempInt in BerserkerRage_Hash
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BerserkerRage_Duration Less than or equal to 0.00
                • Then - Actions
                  • Hero - Modify Strength of BerserkerRage_TempUnit: Set to (Load 1 of BerserkerRage_TempInt from BerserkerRage_Hash)
                  • Unit Group - Remove BerserkerRage_TempUnit from BerserkerRage_UnitGRP
                  • Hashtable - Clear all child hashtables of child BerserkerRage_TempInt in BerserkerRage_Hash
                • Else - Actions
                  • Hashtable - Save (BerserkerRage_Duration - 0.10) as 0 of BerserkerRage_TempInt in BerserkerRage_Hash
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (BerserkerRage_UnitGRP is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions


1.0:
Uploaded.

1.1:
Fixed all bugs that are pointed to me in this thread.




Everyone who helped upgrading!
wyrmlord - for making excellent guide for Hashtables:
http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/hashtables-mui-133407/


Keywords:
Rage, Strength, Simple, Periodic.
Contents

Berserker Rage (Map)

Reviews
12th Dec 2015 IcemanBo: Too long as NeedsFix. Rejected. Berserker Rage 1.1 | Reviewed by Maker | 18th Feb 2013 Needs Fix Required changes Abilities must support levels Delete the "And - All (Conditions) are true". Put the conditions...

Moderator

M

Moderator

12th Dec 2015
IcemanBo: Too long as NeedsFix. Rejected.


Berserker Rage 1.1 | Reviewed by Maker | 18th Feb 2013
Needs Fix

Required changes
  • Abilities must support levels
  • Delete the "And - All (Conditions) are true". Put the conditions directly
    under "If - conditions"
    Triggering unit is in group condition is not needed
  • If the unit is dead, remove it from the group
  • Check (BerserkerRage_UnitGRP is empty) Equal to True only after you remove
    a unit from the group
  • If the unit gains permanent strength bonus while the spell is active,
    it will lose the gained strength when the spell is over
Suggested changes
  • The loop could update a bit less often
[td]
[/td]


02:32, 9th Feb 2013
Magtheridon96:

  • Constant values like the strength bonus max should be configurable in the Init trigger so users don't have to modify your spell code directly. This will also make the modification of the spell much easier.
  • (Last created hashtable) should be changed. Use BerserkerRage_Hash instead.
  • In the Start trigger, you should only attempt to turn on the trigger if a unit was added successfully to the group.
  • Casting unit -> Triggering unit
  • In the loop trigger, you should store the picked unit into a variable at the top of the Loop - Actions of the Unit Group picker. Repeating it is inefficient. To get rid of Key((Picked unit)), what you would need to do is use an integer variable and set it as follows:
    • Custom script: set udg_TempInteger = GetHandleId(udg_TempUnit)
    This is assuming TempUnit is a unit variable set to (Picked unit) just above that line of code.
    TempInteger is, you guessed it, an integer variable.
  • You can use proper, relevant durations here. Instead of using 100 and 30, and subtracting 1, you can subtract 0.1. This will make it easier for you because when you put the duration up for configuration in the Init trigger, you won't have to instruct the user to multiply it by 10.
 
You reference "Last created hashtable" needs a configuration setup for strength boost/subtraction (and duration) You also should cache (triggering unit) and (picked unit) you also reference "casting unit" don't bother go straight with your cached (triggering unit)

Really simple, prehaps when strength is increased, you can store the amount that's increased in your hashtable, then simply subtract that value rather than a block amount? would make it easier to configure and control
 
Level 2
Joined
Sep 26, 2011
Messages
10
Rasha92,but why you increase the strength of hero +1 every 0.03 not +70 every unit cast???

What i want from spell is that it increace Strength periodicly, not to just give huge burst of strength. And its not fixed amount to 70 anymore, it can be modified now.

You still haven't covered the unit death event. Just add a secondary death-check condition under

  • BerserkerRage_Duration Less than or equal to 0.00

I tryed puting that condition, but its being ignored.
And without that condition unit still get back to normal strength.
 
Last edited by a moderator:
Top