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

Sword Expert v1.02

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
  • Like
Reactions: Nightmare Moon
This is my first spell on the Hive.
I made this because it can be useful in any map. It's like the Murloc's Essence Shift in Dota.
The spell is in GUI and fully MUI.
I hope you like it. :grin:

skill-1.jpg

The Hero thinks over his strategy and performs a new one with every hit. All attacks of the Hero gives him 1 bonus to all stats.
Level 1- Maximum 11 stat bonus.
Level 2 - Maximum 12 stat bonus.
Level 3 - Maximum 13 stat bonus.
Level 4 - Maximum 14 stat bonus.
Level 5 - Maximum 15 stat bonus.
Lasts 10/20/30/40/50 seconds.

  • Sword Expert Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- --------------------------- --------
      • -------- DO NOT TOUCH THIS! --------
      • -------- --------------------------- --------
      • -------- Creates the hashtable. --------
      • Hashtable - Create a hashtable
      • -------- And stores it in a variable. --------
      • Set Sword_Expert_Hash = (Last created hashtable)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Trigger - Add to Sword Expert <gen> the event (Unit - (Picked unit) Takes damage)
          • Unit Group - Add (Picked unit) to Addinunitsinthedmgdetect
      • Custom script: call DestroyTrigger(GetTriggeringTrigger())
  • Sword Expert Addons
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • ((Triggering unit) is in Addinunitsinthedmgdetect) Not equal to True
    • Actions
      • Trigger - Add to Sword Expert <gen> the event (Unit - (Triggering unit) Takes damage)
      • Unit Group - Add (Triggering unit) to Addinunitsinthedmgdetect
  • Sword Expert
    • Events
    • Conditions
      • (Level of Sword Expert for (Damage source)) Greater than 0
    • Actions
      • -------- Now it's time to start the spell: --------
      • -------- Setting variables: --------
      • Set Key = (Key (Damage source))
      • Set Sword_Expert_Attacker = (Damage source)
      • -------- This will add every unit into a group who has the spell and attacks. --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Sword_Expert_Attacker is in Sword_Expert_Group) Equal to False
        • Then - Actions
          • Unit Group - Add Sword_Expert_Attacker to Sword_Expert_Group
        • Else - Actions
      • -------- Maximum stat the hero can gain by the spell. --------
      • Set Sword_Expert_Max_Stat = ((Level of Sword Expert for Sword_Expert_Attacker) + 10)
      • -------- The duration of each bonus stat. --------
      • Set Sword_Expert_Max_Dur = ((Real((Level of Sword Expert for Sword_Expert_Attacker))) x 10.00)
      • -------- Bonus stat gained for each attack. --------
      • Set Sword_Expert_Stat_Bonus = 1
      • -------- These below saves the data in the hashtable. --------
      • Hashtable - Save Handle OfSword_Expert_Attacker as 0 of Key in Sword_Expert_Hash
      • Hashtable - Save Sword_Expert_Max_Stat as 1 of Key in Sword_Expert_Hash
      • Hashtable - Save Sword_Expert_Max_Dur as 2 of Key in Sword_Expert_Hash
      • Hashtable - Save Sword_Expert_Stat_Bonus as 3 of Key in Sword_Expert_Hash
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Load 4 of Key from Sword_Expert_Hash) Not equal to (Load 1 of Key from Sword_Expert_Hash)
        • Then - Actions
          • Set Sword_Expert_Stat_Level = ((Load 4 of Key from Sword_Expert_Hash) + 1)
          • Hashtable - Save Sword_Expert_Stat_Level as 4 of Key in Sword_Expert_Hash
          • -------- The bonus stat gained by each attack. --------
          • Hero - Modify Strength of Sword_Expert_Attacker: Add (Load 3 of Key from Sword_Expert_Hash)
          • Hero - Modify Agility of Sword_Expert_Attacker: Add (Load 3 of Key from Sword_Expert_Hash)
          • Hero - Modify Intelligence of Sword_Expert_Attacker: Add (Load 3 of Key from Sword_Expert_Hash)
          • -------- And finally a nice effect. --------
          • Special Effect - Create a special effect attached to the origin of Sword_Expert_Attacker using Abilities\Spells\Items\AIsm\AIsmTarget.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
  • Sword Expert Loop
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
      • (Number of units in Sword_Expert_Group) Greater than 0
    • Actions
      • Unit Group - Pick every unit in Sword_Expert_Group and do (Actions)
        • Loop - Actions
          • -------- --------------------------- --------
          • -------- DO NOT TOUCH THIS! --------
          • -------- --------------------------- --------
          • Set Key = (Key (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load 4 of Key from Sword_Expert_Hash) Greater than 0
            • Then - Actions
              • Set TempInt = 4
              • Custom script: loop
              • Set TempInt = (TempInt + 1)
              • Hashtable - Save ((Load TempInt of Key from Sword_Expert_Hash) + 0.05) as TempInt of Key in Sword_Expert_Hash
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load TempInt of Key from Sword_Expert_Hash) Equal to (Load 2 of Key from Sword_Expert_Hash)
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Load 4 of Key from Sword_Expert_Hash) Greater than 1
                    • Then - Actions
                      • For each (Integer A) from 5 to ((Load 4 of Key from Sword_Expert_Hash) + 3), do (Actions)
                        • Loop - Actions
                          • Hashtable - Save (Load ((Integer A) + 1) of Key from Sword_Expert_Hash) as (Integer A) of Key in Sword_Expert_Hash
                      • Hashtable - Save 0.00 as ((Load 4 of Key from Sword_Expert_Hash) + 4) of Key in Sword_Expert_Hash
                      • Set TempInt = 4
                    • Else - Actions
                      • Hashtable - Save 0.00 as TempInt of Key in Sword_Expert_Hash
                  • Hashtable - Save ((Load 4 of Key from Sword_Expert_Hash) - 1) as 4 of Key in Sword_Expert_Hash
                  • Hero - Modify Strength of (Load 0 of Key in Sword_Expert_Hash): Subtract (Load 3 of Key from Sword_Expert_Hash)
                  • Hero - Modify Agility of (Load 0 of Key in Sword_Expert_Hash): Subtract (Load 3 of Key from Sword_Expert_Hash)
                  • Hero - Modify Intelligence of (Load 0 of Key in Sword_Expert_Hash): Subtract (Load 3 of Key from Sword_Expert_Hash)
                • Else - Actions
              • Custom script: exitwhen udg_TempInt == LoadIntegerBJ(4, udg_Key, udg_Sword_Expert_Hash)+4
              • Custom script: endloop
            • Else - Actions

v1.0- Uploaded.
v1.01- Changed the Unit is attacked event with a damage detection system.
v1.02- Removed the Custom script: call DestroyGroup(bj_lastCreatedGroup) line.


Keywords:
strength, agility, intelligence, str, agi, int, stat, allstat, sword, expert
Contents

Sword Expert (Map)

Reviews
12th Dec 2015 IcemanBo: For long time as NeedsFix. Rejected. Bribe: Custom script: call DestroyGroup(bj_lastCreatedGroup) This line needs to be removed as it will break a million things that depend on it. bj_lastCreatedGroup is never...

Moderator

M

Moderator

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

Bribe:

Custom script: call DestroyGroup(bj_lastCreatedGroup)

This line needs to be removed as it will break a million things that depend on it. bj_lastCreatedGroup is never destroyed or re-created, and needs to be kept that way. What leak did you think you were cleaning with this?

Maker:
I think 0.05 period is too low for this, and you should turn the looping trigger initially off. Turn the looping trigger off when the group is empty.
Saving the unit's handle for itself is useless.
 
Level 12
Joined
Apr 16, 2010
Messages
584
Now it looks a lot better! BUT you could add few variables into trigger "Sword Expert Init" as settings. Like setting maximum stat limit, how much you steal per hit, what stat to steal; well you know, make it more configurable! I love the spells that are easy to configure, as anybody else i guess.
4/5 since it's not so original!
 
Level 8
Joined
Jul 14, 2010
Messages
235
Shouldnt this spell refresh every time it hits? 10 sec after the first hit, it starts draining faster than you can build up, so you never really get max stat bonus.

Maybe it should fade away fast after 10 sec out of combat?
 
Level 3
Joined
Feb 1, 2010
Messages
16
Shouldnt this spell refresh every time it hits? 10 sec after the first hit, it starts draining faster than you can build up, so you never really get max stat bonus.

Maybe it should fade away fast after 10 sec out of combat?

Yeah, it's a great idea, a lot better than the current version, thanks for sharing it.
I will update it in a few days.

EDIT: Okay, I can't make it like that.
 
Top