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

[Mui] [Gui] [Aura] Martyr's Memorandum v1.10

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.

Martyr's Memorandum

smemorandumscreen.jpg
Describtion
Gives additional mana regeneration to nearby friendly units. The unit learning this skill and units below 150 mana will regenerate twice as fast.


Level 1 1 Manapoint per second with 350 AoE
Level 2 2 Manapoints per second with 400 AoE

Level 3
3 Manapoints per second with 450 AoE
Pros:infl_thumbs_up:
Mui Leakless Lagless
High amount of describtion
Easy to edit and customize
Completely stackable with each other and standard wc3 Auras
No credits needed

Contra:angry:
May cause issues with other floating texts, because the wc3 engine only allows a limited amount of floating texts to be displayed.


Note: Custom describtion removed.

[trigger=MM Constants]MM Constants
Events
Map initialization
Conditions
Actions
Hashtable - Create a hashtable
Set MM_Hashtable = (Last created hashtable)
Set MM_ShowAll = False
Set MM_Extra_Regeneration_Factor = 2.00
Set MM_Fast_Regeneration_Limit = 150.00
Set MM_MinSize = 8.00
Set MM_MaxSize = 16.00
Set MM_MinColourBlue = 65.00
Set MM_MaxColourBlue = 90.00
Set MM_MinColourGreen = 15.00
Set MM_MaxColourGreen = 50.00
Set MM_MinColourRed = 0.00
Set MM_MaxColourRed = 5.00
Set MM_MinTransparency = 60.00
Set MM_MaxTransparency = 85.00
Set MM_MinFadingAge = 1.00
Set MM_MaxFadingAge = 3.00
Set MM_TargetMinFadingAge = 0.00
Set MM_TargetMaxFadingAge = 0.50
Set MM_MinLifespan = 1.00
Set MM_MaxLifespan = 5.00
Set MM_TargetMinLifespan = 1.50
Set MM_TargetMaxLifespan = 2.00
Set MM_MinVelocity = 45.00
Set MM_MaxVelocity = 80.00
Set MM_TargetMinVelocity = 30.00
Set MM_TargetMaxVelocity = 45.00
Set MM_Area_of_Effect[1] = 350.00
Set MM_Area_of_Effect[2] = 400.00
Set MM_Area_of_Effect[3] = 450.00
Set MM_ManaRegeneration[1] = 0.20
Set MM_ManaRegeneration[2] = 0.40
Set MM_ManaRegeneration[3] = 0.60

[/trigger]

[trigger=MM Init]Martyrs Memorandum Init
Events
Unit - A unit Learns a skill
Conditions
(Level of Martyr's Memorandum for (Triggering unit)) Greater than 0
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in MM_Group) Equal to 0
Then - Actions
Trigger - Turn on Martyrs Memorandum Loop <gen>
Else - Actions
Set MM_Ability_Level = (Level of Martyr's Memorandum for (Triggering unit))
Hashtable - Save MM_ManaRegeneration[MM_Ability_Level] as 1 of (Key (Triggering unit)) in MM_Hashtable
Unit Group - Add (Triggering unit) to MM_Group

[/trigger]

[trigger=MM Loop]Martyrs Memorandum Loop
Events
Time - Every 0.20 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in MM_Group and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) is alive) Equal to True
Then - Actions
Set MM_AuraUnit = (Picked unit)
Set MM_ManaRegLoop = (Load 1 of (Key (Picked unit)) from MM_Hashtable)
Unit - Set mana of MM_AuraUnit to ((Mana of MM_AuraUnit) + (MM_Extra_Regeneration_Factor x MM_ManaRegLoop))
Floating Text - Create floating text that reads + above MM_AuraUnit with Z offset -150.00, using font size (Random real number between MM_MinSize and MM_MaxSize), color ((Random real number between MM_MinColourRed and MM_MaxColourRed)%,
(Random real number between MM_MinColourGreen and MM_MaxColourGreen)%, (Random real number between MM_MinColourBlue and MM_MaxColourBlue)%),
and (Random real number between MM_MinTransparency and MM_MaxTransparency)% transparency
Floating Text - Set the velocity of (Last created floating text) to (Random real number between MM_MinVelocity and MM_MaxVelocity) towards (Random real number between 0.00 and 360.00) degrees
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to (Random real number between MM_MinLifespan and MM_MaxLifespan) seconds
Floating Text - Change the fading age of (Last created floating text) to (Random real number between MM_MinFadingAge and MM_MaxFadingAge) seconds
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MM_ShowAll Equal to False
Then - Actions
Set MM_ForceLeak = (All allies of (Owner of MM_AuraUnit))
Floating Text - Hide (Last created floating text) for (All players)
Floating Text - Show (Last created floating text) for MM_ForceLeak
Custom script: call DestroyForce (udg_MM_ForceLeak)
Else - Actions
Set MM_Point = (Position of MM_AuraUnit)
Set MM_Refresh_Group = (Units within MM_Area_of_Effect[MM_Ability_Level] of MM_Point matching ((((Matching unit) is A structure) Not equal to True)
and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an ally of (Owner of (Picked unit))) Equal to True)
Unit Group - Pick every unit in MM_Refresh_Group and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Mana of (Picked unit)) Less than or equal to MM_Fast_Regeneration_Limit
Then - Actions
Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) + (MM_Extra_Regeneration_Factor x MM_ManaRegLoop))
Else - Actions
Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) + MM_ManaRegLoop)
Floating Text - Create floating text that reads + above (Picked unit) with Z offset -150.00, using font size (Random real number between MM_MinSize and MM_MaxSize), color ((Random real number between MM_MinColourRed and MM_MaxColourRed)%,
(Random real number between MM_MinColourGreen and MM_MaxColourGreen)%, (Random real number between MM_MinColourBlue and MM_MaxColourBlue)%),
and (Random real number between MM_MinTransparency and MM_MaxTransparency)% transparency
Floating Text - Set the velocity of (Last created floating text) to (Random real number between MM_TargetMinVelocity and MM_TargetMaxVelocity) towards (Random real number between 0.00 and 360.00) degrees
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to (Random real number between MM_TargetMinLifespan and MM_TargetMaxLifespan) seconds
Floating Text - Change the fading age of (Last created floating text) to (Random real number between MM_TargetMinFadingAge and MM_TargetMaxFadingAge) seconds
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MM_ShowAll Equal to False
Then - Actions
Set MM_ForceLeak = (All allies of (Owner of (Picked unit)))
Floating Text - Hide (Last created floating text) for (All players)
Floating Text - Show (Last created floating text) for MM_ForceLeak
Custom script: call DestroyForce (udg_MM_ForceLeak)
Else - Actions
Custom script: call DestroyGroup (udg_MM_Refresh_Group)
Custom script: call RemoveLocation (udg_MM_Point)
Else - Actions

[/trigger]


Note

  • I appreciate critism on the code, layout, presentation and idea.
  • I appreciate pointing out grammar or spelling issues.
  • I appreciate any rating, comment and +rep.

Changelog

v1.00 Release
v1.10 Code Improvements and deleted unused variables

Keywords:
Gui, Mui, Aura, Martyr, Memorandum, Floating Text, Mana, Regeneration, Stackable, +.
Contents

Martyr's Memorandum (Map)

Reviews
12th Dec 2015 IcemanBo: Too long time as NeedsFix. Rejected. 10:43, 31st May 2011 Maker: Looks good, but units that are dead should be removed from the group, have the child hashtable cleared and the trigger turned off if there are no units in...

Moderator

M

Moderator

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

10:43, 31st May 2011
Maker: Looks good, but units that are dead should be removed from the group, have the child hashtable cleared and the trigger turned off if there are no units in the group.

Otherwise leaks occur if the unit is not revived.

You could re-add a hero into the group when it is revived.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
*All players doesn't leak
*Don't use an array for the location

The floating texts actually look quite good.

You could do this in a better way:

  • Unit - Set mana of MM_AuraUnit to ((Mana of MM_AuraUnit) + (MM_Extra_Regeneration_Factor x (MM_ManaRegeneration[MM_Ability_Level] / (1.00 / 0.20))))


Instead of storing the inxed to point to the array value, save the actual regeneration value. Or save the whole "value / (1.00 / 0.2)" , which in turn reduces to value * 5.
 
Level 30
Joined
Jul 31, 2010
Messages
5,246
The floating text is so unique! love it but yeh your right, it some how leaks with other floating text, but that's a good work you got there, maybe try making a custom attachment that has a look-alike with the floating text and then implement it, just a suggestion keep up the good work! :grin:
 
Top