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

Need help with fervor-like ability

Status
Not open for further replies.
Level 3
Joined
Sep 25, 2008
Messages
50
Hello Hive,
I need help with creating an ability that is kind of like fervor.
This is the ability info...

When an enemy attacks the Rouge's combat mastery allows her to quickly find the enemy's weak points. Each continuous attack from the enemy allows her to find another weaker point and strike with greater precision.

So blahblah everytime the rouge gets hit her crit is increased a level (max of 20 levels)
However I have a problem. I want it that whenever she attacks a different target she loses her critical (goes back to level 1)..but when she attacks the unit again she regains the critical level.

Any help? sorry for the bad grammar and stuff had to rush! ):
 
You need hashtables. I don't know how you are detecting the damage, e.g. with Unit - A unit is attacked (not suggested) or a damage detection system (suggested), but I will use the first one as an example, since it saves some time for now:
  • Tr
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Hashtable - Create a hashtable
    • Set Hashtable = (Last created hashtable)
  • Trigger
  • Events
    • Unit - A unit is attacked
  • Conditions
  • Actions
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • (Key(on) is stored as a Handle of (Key(Attacking unit)) in Hashtable) Equal to True
      • Then - Actions
        • If (All conditions are true) then do (Actions) else do (Actions)
          • If - Conditions
            • (Attacked unit) Equal to (Load Key(on) of (Key(Attacking unit)) from Hashtable)
          • Then - Actions
            • Unit - Set level of Critical Strike for (Attacking unit) to (Level of Critical Strike for (Attacking unit) + 1)
          • Else - Actions
            • Unit - Set level of Critical Strike for (Attacking unit) to 1
            • Hashtable - Clear all child hashtables of (Key(Attacking unit)) from Hashtable
      • Else - Actions
        • Hashtable - Save handle of (Attacked unit) as Key(on) of (Key(Attacking unit)) in Hashtable
Key(on): when it asks you for a Handle ID, scroll to String ID instead and type whatever you want, just make sure to memorize it; I used "on".

References:
http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/hashtables-mui-133407/
 
Level 3
Joined
Sep 25, 2008
Messages
50
Wait pharaoh does this increase the level of critical strike when she gets attacked by an enemy?
Because I see that it increases the level of critical strike for the ATTACKING unit,
its supposed to increase when she gets hit by an enemy,
:eek:
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
No, she has a revelation and goes Super Saiyan, moments from death; sound familiar?

If you were to use AutoIndex and BonusMod you could do this so easily, though typically GUI users do not have JNGP.
 
Level 3
Joined
Sep 25, 2008
Messages
50
I made the changes and it did not work, then i tried to do the original, and it works until critical strike is at its last. it crits for a couple attacks then it stops. The tooltip says its at max but the rouge is not crit-ing at all.
Here's the map !
 

Attachments

  • Survival of the Last Alliance v1.0.w3x
    236.2 KB · Views: 68
Level 3
Joined
Sep 25, 2008
Messages
50
I'm already using that, and comprehend this right. I am not in any way DETECTING damage. I am just trying to raise the level of critical strike everytime the Rouge is attacked and then set the level back to 1 when she switches targets.
 
Status
Not open for further replies.
Top