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

Sage's Lore [1.7]

A Spells Contest #20 Entry (Vengeancekael)
Based on:
ability1_128.jpg
The Vindicator unleashes forgotten lore,
causing enemy units to lose health and mana until they cast a spell.
Tooltip:
The Caster unleashes forgotten lore, causing enemy units to lose health and mana until they cast a spell.

Level 1 - [30] HP/MP Loss
Level 2 - [35] HP/MP Loss
Level 3 - [50] HP/MP Loss
  • Sages Lore Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: set udg_SL_CasterHashtable = InitHashtable()
      • -------- The SFX Buff Id: --------
      • Custom script: set udg_SL_ABILITYID = 'B002'
      • -------- Spell Configurations --------
      • -------- Duration --------
      • Set SL_Duration = 6.00
      • -------- Damage Type --------
      • Set SL_DamageType = Normal
      • -------- Attack Type --------
      • Set SL_AttackType = Spells
      • -------- Area of Effect --------
      • -------- !!!! If you change the default AOE, remember to also change the AOE of the spell in the object editor !!!! --------
      • Set SL_AOE = 256.00
  • Sages Lore Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Sage's Lore
    • Actions
      • -------- Setup Spell --------
      • -------- Casting Unit --------
      • Set SL_Caster = (Triggering unit)
      • -------- The Amount of Damage dealt to the target --------
      • Set SL_Damage = (25.00 + (5.00 + (Real((Level of (Ability being cast) for SL_Caster)))))
      • -------- Area of ability being cast at --------
      • Set SL_Point = (Target point of ability being cast)
      • -------- Effects --------
      • Special Effect - Create a special effect at SL_Point using Abilities\Spells\Human\DispelMagic\DispelMagicTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at SL_Point using Abilities\Spells\Other\Charm\CharmTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • -------- Effects --------
      • -------- DO NOT EDIT BELOW --------
      • -------- Add Units at SL_Point[0] to a unit group --------
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within SL_AOE of SL_Point matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) belongs to an enemy of (Triggering player)) Equal to True) and (((Matching unit) is in SL_UnitGroup) Equal to False)))) and do (Actions)
        • Loop - Actions
          • Custom script: set udg_SL_PickUnits = GetEnumUnit()
          • Custom script: set udg_SL_PickInt = GetHandleId(udg_SL_PickUnits)
          • Hashtable - Save Handle OfSL_Caster as 0 of SL_PickInt in SL_CasterHashtable
          • Hashtable - Save SL_Duration as 1 of SL_PickInt in SL_CasterHashtable
          • Hashtable - Save SL_Damage as 2 of SL_PickInt in SL_CasterHashtable
          • Unit Group - Add SL_PickUnits to SL_UnitGroup
          • Set SL_EnemyPoint = (Position of SL_PickUnits)
          • Unit - Create 1 SL_Dummy for (Triggering player) at SL_EnemyPoint facing Default building facing degrees
          • Set SL_CastingDummy = (Last created unit)
          • Unit - Hide SL_CastingDummy
          • Unit - Order SL_CastingDummy to Orc Shaman - Bloodlust SL_PickUnits
          • Unit - Add a 2.00 second Generic expiration timer to SL_CastingDummy
          • Custom script: call RemoveLocation(udg_SL_EnemyPoint)
      • Trigger - Turn on Sages Lore Over Time <gen>
      • -------- Remove leaks --------
      • Custom script: call RemoveLocation(udg_SL_Point)
  • Sages Lore Over Time
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • -------- DO NOT EDIT BELOW --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (SL_UnitGroup is empty) Equal to False
        • Then - Actions
          • Unit Group - Pick every unit in SL_UnitGroup and do (Actions)
            • Loop - Actions
              • Set SL_PickUnits = (Picked unit)
              • Custom script: set udg_SL_PickInt = GetHandleId(udg_SL_PickUnits)
              • Set SL_Caster = (Load 0 of SL_PickInt in SL_CasterHashtable)
              • Set SL_LoadDuration = (Load 1 of SL_PickInt from SL_CasterHashtable)
              • -------- Units that still have the Sage's Lore Buff will take damage --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • SL_LoadDuration Greater than 0.00
                • Then - Actions
                  • Hashtable - Save (SL_LoadDuration - 1.00) as 1 of SL_PickInt in SL_CasterHashtable
                  • -------- Position of unit that has buff --------
                  • Set SL_Point = (Position of SL_PickUnits)
                  • -------- Effects --------
                  • Special Effect - Create a special effect at SL_Point using Abilities\Spells\Other\Silence\SilenceAreaBirth.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • -------- Effects --------
                  • -------- Damage --------
                  • Set SL_DamageLoad = (Load 2 of SL_PickInt from SL_CasterHashtable)
                  • Unit - Cause SL_Caster to damage SL_PickUnits, dealing SL_DamageLoad damage of attack type SL_AttackType and damage type SL_DamageType
                  • Unit - Set mana of SL_PickUnits to ((Mana of SL_PickUnits) - SL_DamageLoad)
                  • -------- Damage --------
                  • -------- Remove Leaks --------
                  • Custom script: call RemoveLocation(udg_SL_Point)
                • Else - Actions
                  • Unit Group - Remove SL_PickUnits from SL_UnitGroup
                  • Custom script: call UnitRemoveAbility (udg_SL_PickUnits, udg_SL_ABILITYID)
                  • Hashtable - Clear all child hashtables of child SL_PickInt in SL_CasterHashtable
        • Else - Actions
          • Trigger - Turn off (This trigger)
[hidden='Sages Lore Unit Cast]
  • Sages Lore Unit Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • ((Triggering unit) is in SL_UnitGroup) Equal to True
    • Actions
      • Set SL_CastingUnit = (Triggering unit)
      • Custom script: set udg_SL_ID = GetHandleId(udg_SL_CastingUnit)
      • -------- Remove unit from SL Unit group when ability is cast --------
      • Unit Group - Remove SL_CastingUnit from SL_UnitGroup
      • Custom script: call UnitRemoveAbility (udg_SL_CastingUnit, udg_SL_ABILITYID)
      • -------- Remove unit from SL Unit group when ability is cast --------
      • -------- Position of the casting unit --------
      • Set SL_Point = (Position of SL_CastingUnit)
      • -------- Effects (editable) --------
      • Special Effect - Create a special effect at SL_Point using Abilities\Spells\Human\Slow\SlowCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at SL_Point using Abilities\Spells\Other\Doom\DoomDeath.mdl
      • Special Effect - Destroy (Last created special effect)
      • -------- Sounds --------
      • -------- Sounds --------
      • -------- Remove Leaks --------
      • Custom script: call RemoveLocation(udg_SL_Point)
      • Hashtable - Clear all child hashtables of child SL_ID in SL_CasterHashtable
      • -------- Remove Leaks --------
[/hidden]
Thanks to Pharaoh_ , Maker and baassee, Maghteridon96

Changelog:

1.1: More efficient
1.2: Even more efficient
1.3:
Damage Type can now be configured
Attack Type can now be configured
More efficient
Area of Effect can now be configured
1.4: More efficient
1.5: AOE is now a real
Added a custom dummy
Removed some unnecessary actions
1.6:
'Sages Lore Unit Cast shouldn't be on all the time.
Set the dummy to can't raise, does not decay so it is removed faster from the game. The dummy also gives vision.'
Fixed
1.7:
New variable for dummy unit type
Updated instructions&tooltip

Keywords:
sage's lore, hon, HoN, heroes of newerth, cool
Contents

Sage's Lore [1.7] (Map)

Reviews
09:18, 20th Jul 2011 Maker: Approved. Fix the tooltips. In the importing instructions, mention that one need to set the dummy unit type in Unit - Create dummy. You could create a variable for the dummy unit type, and set it in the init trigger.

Moderator

M

Moderator

09:18, 20th Jul 2011
Maker:
Approved.
Fix the tooltips.
In the importing instructions, mention that one need to set the dummy unit type in Unit - Create dummy. You could create a variable for the dummy unit type, and set it in the init trigger.
 
It looks pretty good :)
GUI always hurts my eyes, but surprising, looking at your triggers didn't hurt at all ^^
4/5

edit
In the second trigger, for efficiency, you could save (Picked Unit) in a variable so you don't have to repeatedly call GetEnumUnit()
For the Key(Picked Unit) part, you should save the picked unit's handle in an integer variable.
 
Hmm so you mean like that?
  • Sages Lore Over Time
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • -------- DO NOT EDIT BELOW --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (SL_UnitGroup is empty) Equal to False
        • Then - Actions
          • Unit Group - Pick every unit in SL_UnitGroup and do (Actions)
            • Loop - Actions
              • Set SL_PickedUnit = (Picked unit)
              • Set SL_PickedUnitInt = (Key (Picked Unit))
          • Set SL_Caster = (Load 0 of SL_PickedUnitInt in SL_CasterHashtable)
          • Set SL_LoadDuration = (Load 1 of SL_PickedUnitInt from SL_CasterHashtable)
          • -------- Units that still have the Sage's Lore Buff will take damage --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SL_LoadDuration Greater than 0.00
            • Then - Actions
              • Hashtable - Save (SL_LoadDuration - 1.00) as 1 of SL_PickedUnitInt in SL_CasterHashtable
              • -------- Position of unit that has buff --------
              • Set SL_Point = (Position of (Picked unit))
              • -------- Effects --------
              • Special Effect - Create a special effect at SL_Point using Abilities\Spells\Other\Silence\SilenceAreaBirth.mdl
              • Special Effect - Destroy (Last created special effect)
              • -------- Effects --------
              • -------- Damage --------
              • Set SL_DamageLoad = (Load 2 of SL_PickedUnitInt from SL_CasterHashtable)
              • Unit - Cause SL_Caster to damage (Picked unit), dealing SL_DamageLoad damage of attack type Spells and damage type Normal
              • Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) - SL_DamageLoad)
              • -------- Damage --------
              • -------- Remove Leaks --------
              • Custom script: call RemoveLocation(udg_SL_Point)
            • Else - Actions
              • Unit Group - Remove (Picked unit) from SL_UnitGroup
              • Custom script: call UnitRemoveAbility (GetEnumUnit(), udg_SL_ABILITYID)
              • Hashtable - Clear all child hashtables of child SL_PickedUnitInt in SL_CasterHashtable
        • Else - Actions
          • Trigger - Turn off (This trigger)
 
Sort of... But all the code that involves the picked unit should be under the loop (Pick every unit...)

edit
You shouldn't change anything at all when it comes to the structure in the current version, just create 2 new variables:
- Unit: PickU
- Integer: PickI

In the Pick every unit block, just set those variables to PickedUnit and GetHandleId(udg_PickedUnit) respectively.
Then use those variables everywhere below :)
 
You could probably do the same thing for Key(Picked Unit) in the first trigger.
Same for (Picked Unit)
Also, instead of repeating (Triggering Unit), you could save it in a variable to increase efficiency.
Let's see ... Owner of Triggering Unit is the same as Triggering Player
In the third trigger, you should also save triggering unit in a variable :)
 
There are some things that could be improved.
Save (Last Created Unit) in a variable in the first trigger (Do the same thing ANYWHERE if you're repeating the same "function")
Move the Set SL_Duration = 6.00 line to another trigger that will run at map initialization.

In the third trigger, in the custom script, don't use GetTriggerUnit(). Change it to udg_SLCastingUnit.
After that, this spell should be good to go :)
 
Level 22
Joined
Nov 14, 2008
Messages
3,256
Custom script: set udg_SL_PickUnits = GetEnumUnit()

No need to be custom script, there is one in GUI that is equal to this.

Unit - Order (Last created unit) to Orc Shaman - Bloodlust (Picked unit)

You forgot to cast it at your variable.

-You can of course set the last created unit into a variable as well. Will save you a few calls as it calls "GetLastCreatedUnit()" BJ which only returns a variable.

-This Set SL_CastingUnit = (Triggering unit)

Should be above this Set SL_ID = (Key (Triggering Unit))

-Doesnt use its variable

Custom script: call UnitRemoveAbility (GetTriggerUnit(), udg_SL_ABILITYID)
 
Ok Vengeancekael, sorry I forgot to mention this earlier, but:
  • Custom script: call UnitRemoveAbility (GetEnumUnit(), udg_SL_ABILITYID)
Instead of GetEnumUnit(), you could use udg_SL_PickedUnit :)

I know.. updating for something that small is annoying, but efficiency is important :L

edit
By the way, I changed my rating to 5/5 ;)
 
Level 1
Joined
Jun 25, 2011
Messages
1
:ogre_haosis::vw_love::vw_wtf:

Hey! Grateful if you tell me how to make my own characters. Thank you. :)
 
Last edited by a moderator:
Top