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

Manastorm Spellbase

Status
Not open for further replies.
Level 7
Joined
Apr 12, 2011
Messages
124
Manastorm Spellbase [Feedback]

Here it is. My project im working on.
It's basically one spell, but where you can customize the spell alot.
I had issues of what to make of the spell at first, there is so many cool visual effects you can use. So this is what i came up with.

Manastorm:
The Hero unleashes his full power creating a manastorm which damages units within 300/350/400 yards and deals 100/200/300 damage per unit. It also ignites the mana of the units affected, burning 10%/15%/20% of the victims mana and leaves the victim with a debuff that slows movementspeed for 7/10/14 seconds.

Please tell me what you think in comment.
If you find any bugs/leaks please tell me
<Triggers posted may be inaccurate>

  • Startup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- ======================================================================= --------
      • -------- DON'T TOUCH THIS --------
      • -------- ======================================================================= --------
      • Hashtable - Create a hashtable
      • Set WS_Hashtable = (Last created hashtable)
      • -------- WS_DummyMonsoon --------
      • Set WS_DummyMonsoon = Lightning Dummy (Visual Monsoon)
      • -------- WS_DummyThunderclap --------
      • Set WS_DummyThunderclap = Lightning Dummy (Visual Thunderclap)
      • -------- WS_Dummy --------
      • Set WS_Dummy = Dummy
      • -------- ======================================================================= --------
      • -------- CUSTOMISE THIS --------
      • -------- You can customise the rest of the ability in Trigger "Manastorm Cast" --------
      • -------- Some visual effects are in the object editor (spells, buffs, units) --------
      • -------- ======================================================================= --------
      • -------- Number of Lightnings / Number of times Loop is repeated --------
      • Set WS_Loops = 20
      • -------- Lightning Type --------
      • Set WS_LightningType = Mana Burn
      • -------- Specifies the effect which appears at the lightning strike point --------
      • Set WS_Impact = (Art path of Manastorm (Dummy) Target Art (index 0))
      • -------- Lightning Duration in seconds --------
      • Set WS_LightningDuration = 0.80
      • -------- --------



  • Manastorm Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Manastorm
    • Actions
      • -------- --------
      • -------- READ ME! --------
      • -------- --------
      • -------- Manasurge's Manastorm! --------
      • -------- Provides a base of triggers with multiple exchangeable values to maximize the different way to combine this spell --------
      • -------- --------
      • -------- Tooltip --------
      • -------- Manastorm --------
      • -------- Damages units within 300/350/400 yards and deals 100/200/300 damage per unit. It also ignites the mana of the units affected, burning 10%/15%/20% and leaves the victim with a debuff that slows movementspeed for 7/10/14 seconds. --------
      • -------- --------
      • -------- To get this spell to your map you need to copy and paste these: --------
      • -------- NOTE: Make sure your map has "Automatically create unknown variables while pasting trigger data" box checked --------
      • -------- --------
      • -------- Units: Dummy, Lightning Dummy (Visual Monsoon), Lightning Dummy (Visual Thunderclap) --------
      • -------- Spells: Shock (Dummy), Manastorm (Dummy), Manastorm --------
      • -------- Buffs: Mana Residue --------
      • -------- Triggers: Startup, Manastorm Cast, Lightning Clear --------
      • -------- All Special Effects (except Lightning andLightning impact) is in the Object Editor spells. --------
      • -------- --------
      • -------- You can customise: --------
      • -------- --------
      • -------- Number of Lightnings --------
      • -------- Number of Levels (in the spell in object editor and Manastorm Cast trigger, change the lvl check on Mana Burn, DamageRange and Range --------
      • -------- Lightning type --------
      • -------- Damage --------
      • -------- End Damage --------
      • -------- Mana Burned --------
      • -------- Range of Damage --------
      • -------- Range of the Effects --------
      • -------- Mana Cost ( In object editor ) --------
      • -------- Cooldown (In the spell in Object Editor) --------
      • -------- Visual Effects (In the spells themselfes in Object Editor, 2 of the effects are units with a effect model: Dummy (Visual Monsoon) and Dummy (Visual Thunderclap)) --------
      • -------- Duration of the Slow (This is modified in the Object Editor) --------
      • -------- --------
      • -------- ======================================================================= --------
      • -------- ======================================================================= --------
      • -------- ///////////////// Do NOT change this //////////////////// --------
      • -------- ======================================================================= --------
      • -------- ======================================================================= --------
      • -------- --------
      • -------- Determins who is the triggering unit, (Caster) --------
      • Set WS_Caster = (Triggering unit)
      • -------- Determins who owns the triggering unit, (Owner of Caster) --------
      • Set WS_Owner = (Owner of WS_Caster)
      • -------- Determins what level the ability cast is. (Thunderstorm) --------
      • Set WS_Lvl = (Level of (Ability being cast) for WS_Caster)
      • -------- Fixates the position of the caster to originate all effects --------
      • Set WS_Point[1] = (Position of WS_Caster)
      • -------- Recycle WS_Real --------
      • Set WS_Real = 0.00
      • -------- --------
      • -------- ======================================================================= --------
      • -------- ======================================================================= --------
      • -------- --------
      • -------- ////////////////////////////////////////////////////////////// --------
      • -------- BELOW THIS LINE YOU CAN CUSTOMISE SOME THE ABILITY --------
      • -------- YOU CAN CUSTOMISE THE REST AT Trigger "Startup" --------
      • -------- Some visual effects are in the object editor (spells, buffs, units) --------
      • -------- ////////////////////////////////////////////////////////////// --------
      • -------- --------
      • -------- Determins the range of which units take damage, originating from the caster (WS_Caster) --------
      • Set WS_DamageRange = (250.00 + (50.00 x (Real(WS_Lvl))))
      • -------- --------
      • -------- Determins range of the shockwave type effect. (This is only for visual effect) --------
      • Set WS_Range = (250.00 + (50.00 x (Real(WS_Lvl))))
      • -------- --------
      • -------- Determins initial damage ( now: Lvl x 100 Damage, 100, 200, 300 damage) --------
      • Set WS_Damage = ((Real(WS_Lvl)) x 100.00)
      • -------- --------
      • -------- Determins damage dealt to units that got their mana burned to 0 --------
      • Set WS_EndDamage = ((Real(WS_Lvl)) x 100.00)
      • -------- --------
      • -------- To change Duration of Slow effect Modify the spell Electrified (Dummy) --------
      • -------- Slows for 7/10/14 seconds --------
      • -------- --------
      • -------- Mana Burned --------
      • -------- Current: 10%, 15%, 20% --------
      • Set WS_Manaburn = (5 + (5 x WS_Lvl))
      • -------- --------
      • -------- ////////////////////////////////////////////////////////////// --------
      • -------- DO NOT CUSTOMISE ANYTHING BELOW THIS LINE --------
      • -------- ////////////////////////////////////////////////////////////// --------
      • -------- Creates Visual Dummy --------
      • Unit - Create 1 WS_DummyMonsoon for WS_Owner at WS_Point[1] facing Default building facing degrees
      • Unit - Make (Last created unit) Explode on death
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • -------- Creates Visual Dummy --------
      • Unit - Create 1 WS_DummyThunderclap for WS_Owner at WS_Point[1] facing Default building facing degrees
      • Unit - Make (Last created unit) Explode on death
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • -------- Starts Integer Loop to create lightnings and effects --------
      • For each (Integer WS_Integer) from 1 to WS_Loops, do (Actions)
        • Loop - Actions
          • -------- Determins the point where the lightning starts and targets --------
          • Set WS_Point[3] = (WS_Point[1] offset by WS_DamageRange towards WS_Real degrees)
          • -------- Creates the Lightning Effect and a small impact effect --------
          • Lightning - Create a WS_LightningType lightning effect from source WS_Point[1] to target WS_Point[3]
          • Special Effect - Create a special effect at WS_Point[3] using WS_Impact
          • Special Effect - Destroy (Last created special effect)
          • -------- Activates timed life of Lightning Effects --------
          • Unit - Create 1 WS_Dummy for WS_Owner at WS_Point[1] facing Default building facing degrees
          • Unit - Make (Last created unit) Explode on death
          • Unit - Add a WS_LightningDuration second Generic expiration timer to (Last created unit)
          • Unit Group - Add (Last created unit) to WS_LightningGroup
          • Hashtable - Save Handle Of(Last created lightning effect) as 0 of (Key (Last created unit)) in WS_Hashtable
          • Set WS_Point[2] = (WS_Point[1] offset by WS_Range towards WS_Real degrees)
          • -------- Creates Dummy For ability Effect --------
          • Unit - Create 1 WS_Dummy for WS_Owner at WS_Point[3] facing Default building facing degrees
          • Unit - Add Manastorm (Dummy) to (Last created unit)
          • Unit - Set level of Manastorm (Dummy) for (Last created unit) to WS_Lvl
          • Unit - Order (Last created unit) to Undead Dreadlord - Carrion Swarm WS_Point[1]
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Unit - Make (Last created unit) Explode on death
          • Set WS_Real = (WS_Real + (360.00 / (Real(WS_Loops))))
          • -------- Clears location leaks --------
          • Custom script: call RemoveLocation(udg_WS_Point[2])
          • Custom script: call RemoveLocation(udg_WS_Point[3])
  • Set WS_Unitgroup = (Units within WS_DamageRange of WS_Point[1] matching ((((Matching unit) belongs to an enemy of WS_Owner) Equal to True) and ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and (((Matching unit) is alive))))
    • Unit Group - Pick every unit in WS_Unitgroup and do (Actions)
      • Loop - Actions
        • Unit - Cause WS_Caster to damage (Picked unit), dealing WS_Damage damage of attack type Spells and damage type Normal
        • Unit - Create 1 WS_Dummy for WS_Owner at WS_Point[1] facing Default building facing degrees
        • Unit - Make (Last created unit) Explode on death
        • Unit - Add Shocked (Dummy) to (Last created unit)
        • Unit - Set level of Shocked (Dummy) for (Last created unit) to WS_Lvl
        • Unit - Order (Last created unit) to Orc Shaman - Purge (Picked unit)
        • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
        • -------- Calculates mana that will be burned --------
        • Set WS_BurnedMana1 = ((Max mana of (Picked unit)) / 100.00)
        • Set WS_BurnedMana = ((Mana of (Picked unit)) - (WS_BurnedMana1 x (Real(WS_Manaburn))))
        • -------- Checking if any mana was burned and --------
        • -------- Applies the calculated burn --------
        • Unit - Set mana of (Picked unit) to WS_BurnedMana
        • Set WS_CurrentMana = (Mana of (Picked unit))
        • Set WS_BurnedmessageInteger = ((Integer(WS_BurnedMana1)) x WS_Manaburn)
        • Set WS_BurnedMessage = (- + (String(WS_BurnedmessageInteger)))
        • -------- Creates the Floating Text effect reflecting the burned amount --------
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • WS_BurnedmessageInteger Greater than 0
          • Then - Actions
            • Floating Text - Create floating text that reads WS_BurnedMessage above (Picked unit) with Z offset 0.00, using font size 8.00, color (50.00%, 50.00%, 100.00%), and 0.00% transparency
            • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
            • Floating Text - Change (Last created floating text): Disable permanence
            • Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
            • Floating Text - Change the fading age of (Last created floating text) to 1.20 seconds
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • WS_CurrentMana Less than or equal to 0.00
              • Then - Actions
                • Unit - Cause WS_Caster to damage (Picked unit), dealing WS_EndDamage damage of attack type Spells and damage type Normal
                • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Undead\CarrionSwarm\CarrionSwarmDamage.mdl
                • Special Effect - Destroy (Last created special effect)
              • Else - Actions
          • Else - Actions
    • -------- Clear Lightning leak in Trigger "Lightning Clear" --------
    • -------- Clears location leaks --------
    • Custom script: call RemoveLocation(udg_WS_Point[1])
    • -------- Clears unitgroup leaks --------
    • Custom script: call DestroyGroup(udg_WS_Unitgroup)



  • Lightning Clear
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is in WS_LightningGroup) Equal to True
    • Actions
      • Unit Group - Remove (Triggering unit) from WS_LightningGroup
      • Lightning - Destroy (Load 0 of (Key (Triggering unit)) in WS_Hashtable)
      • Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in WS_Hashtable



That's all :D
Tell me in Comment what you guys think
Please if you find any bugs/leaks tell me

Im keeping old uploads so others can learn and also see how i developed it (if it's against any rule tell me :X)
Latest version is furthest down in the list


Im off on vacation, comments will be read and responsed to on the 27th April

Updated
- Fixed leaks
- removed excess commentary
- made mana burn and range easier to configure
Updated
- Now checks for structure and spellimmunity
- Made all create actions use unit type variable
- Tooltip updated
 

Attachments

  • Manastorm img1.jpg
    Manastorm img1.jpg
    656.4 KB · Views: 78
  • [Mana] Manastorm Spellbase.w3x
    42.4 KB · Views: 58
  • [Mana] Manastorm Spellbase 1.1b.w3x
    42.5 KB · Views: 80
  • [Mana] Manastorm Spellbase 1.2.w3x
    43.6 KB · Views: 54
  • [Mana] Manastorm Spellbase 1.2b.w3x
    43.1 KB · Views: 93
  • [Mana] Manastorm Spellbase 1.3.w3x
    48.3 KB · Views: 46
Last edited:
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

=== Startup Trigger ===
- (Playable map area) leaks, when you pick all units, also the pick all units is a unit group leak, also it's useless to pick every unit in playable map area here ...

- Also you don't need to set there the point variables. It's enough, if there are set in the cast trigger.

=== Manastorm Cast Trigger ==
  • Set WS_Unitgroup = (Units within WS_DamageRange of WS_Point[1] matching (((Matching unit) belongs to an enemy of WS_Owner) Equal to True))
- You need more filters there: If unit is alive, if it's a structure or magic immune.

- Damage variable can be set like this: 250 + 50 * level, so you don't need the level if's. Same with burned mana: 5 + 5 * level

- Ws_BurnedMana and Ws_BurnedMana1 should be REAL variables not Integer (So you don't need to convert them from integer to real)

  • Hashtable - Save Handle Of(Last created lightning effect) as 0 of (Key (Last created unit)) in (Last created hashtable)
- Why you use there (Last created hashtable)? You should use the variable WS_hashtable here.

=== Lightning Clear Trigger ===
- Well you need to remove the unit from the group too.

Notes:
Well, actually you don't need the "ES_Owner and WS_Lvl" variables. You can that them directly into the actions
As far as I know, you don't need recycle a real variable, reals overwrite them self anyway.

Greetings and Peace
Dr. Boom
 
Level 16
Joined
Jun 24, 2009
Messages
1,409
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • WS_Lvl Equal to 1
  • Then - Actions
  • -------- Change This --------
  • Set WS_Manaburn = 10
  • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • WS_Lvl Equal to 2
  • Then - Actions
  • -------- Change This --------
  • Set WS_Manaburn = 15
  • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • WS_Lvl Equal to 3
  • Then - Actions
  • -------- Change This --------
  • Set WS_Manaburn = 20
  • Else - Actions
instead of this just do this:

  • Set WS_Manaburn = 5+5*WS_Lvl
and instead of this

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • WS_Lvl Equal to 1
  • Then - Actions
  • -------- Change This --------
  • Set WS_DamageRange = 300.00
  • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • WS_Lvl Equal to 2
  • Then - Actions
  • -------- Change This --------
  • Set WS_DamageRange = 350.00
  • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • WS_Lvl Equal to 3
  • Then - Actions
  • -------- Change This --------
  • Set WS_DamageRange = 400.00
  • Else - Actions
do this

  • Set WS_DamageRange = 250.00+50*WS_Lvl
whut's dat?

  • Map Init
  • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Unit Group - Add (Picked unit) to WS_Unitgroup)
  • Set WS_Point[1] = (Center of (Playable map area))
  • Set WS_Point[2] = (Center of (Playable map area))
  • Set WS_Point[3] = (Center of (Playable map area))
  • Custom script: call DestroyGroup(udg_WS_Unitgroup)
  • Custom script: call RemoveLocation(udg_WS_Point[1])
  • Custom script: call RemoveLocation(udg_WS_Point[2])
  • Custom script: call RemoveLocation(udg_WS_Point[3])
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Your commenting.... is excessive. It is not a good idea that the code densisity drops to under half the lines as it becomes hard to follow the program.

Your startup trigger creates 3 different locations representing the same point on the map which it does nothing with then immediatly removes them... Is there a paticular reason for that or you just trying to waste clock cycles?

Instead of a lookup table implimented using flow control statements. Try using a mathematical formula or an array backed lookup table. Both these solutions have an execution order of O(1) unlike the current which has a comparsion order proportional to the number of entries ( O(n) ).

An array backed lookup table is probably the fastest for complex formula and allows for implimentations which do not have a continious relationship with spell level.
For simple formula where the result is an offset added to a multiple of ability level (like this), a formula is better as it scales and impliments more easilly.
 
Level 7
Joined
Apr 12, 2011
Messages
124
Fix'n'Update

Your commenting.... is excessive. It is not a good idea that the code densisity drops to under half the lines as it becomes hard to follow the program.

Your startup trigger creates 3 different locations representing the same point on the map which it does nothing with then immediatly removes them... Is there a paticular reason for that or you just trying to waste clock cycles?

Instead of a lookup table implimented using flow control statements. Try using a mathematical formula or an array backed lookup table. Both these solutions have an execution order of O(1) unlike the current which has a comparsion order proportional to the number of entries ( O(n) ).

An array backed lookup table is probably the fastest for complex formula and allows for implimentations which do not have a continious relationship with spell level.
For simple formula where the result is an offset added to a multiple of ability level (like this), a formula is better as it scales and impliments more easilly.

ye, im quite new at this so im pretty much guessing my way to a result, but thank you for pointing it out.
And all the commenting was to make it easier to find parts of the trigger when i work with it.


@ Dr. Boom
- Fixed

@ Marsal2000
- Fixed
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
These should be at the init trigger, so that you don't set them every time the spell is cast:
Set WS_Loops = 20
Set WS_LightningType = Mana Burn
Set WS_Impact = (Art path of Manastorm (Dummy) Target Art (index 0))
Set WS_LightningDuration = 0.80

The damage, range and mana burn values should be made variables which are set at map initialization. Then calculate the damage when the spell is cast.

Someone (DSG?) said that killing a unit with expiration will cause a leak. Making it explode on death (Unit - explode on death) will make the leak go away.

It's a good idea to set dummy types into a variable and define the variables in the init trigger.

About the tooltip, distance in WC3 is not measured in yards. Actually there's no real distance unit. Just use 300 distance instead of 300 yards.

The tooltip data should also be level-spesific, meaning when it's at level 1, you don't list "does 300/400/500 damage". Just make it say "does 300 damage".

Make the floating text optional with a boolean value.

Experiment with Floating text - Change fading age. Try 1.2 seconds, maybe it will look better when it fades instead of instantly disappearing.

Instead of setting the group into a variable, you can do this:
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units within WS_DamageRange of WS_Point[1] matching ((((Matching unit)...)
    • Loop - Actions
The boolean will make the group be destroyed after all units have been looped through.

Lightning clear trigger should be turned on/off. It will fire when any unit dies even when there are no lightning dummies around.

Set the dummies to Can't raise, does not decay. That way they will get removed after a few seconds. If they are set to decay, the will be removed after ~90 seconds.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
This leaks too? Learned from DSG only, that REMOVING unit causes a leak ..

Apparently, removing units via triggers is itself a leak. People say that it does not deallocate some of the memory and the handle ID the unit uses. Instead they advise making the unit explode on death and then killing it.

http://www.hiveworkshop.com/forums/triggers-scripts-269/leak-related-190250/#post1852954

I think you're right, there's no remove unit here.
 
Level 7
Joined
Apr 12, 2011
Messages
124
These should be at the init trigger, so that you don't set them every time the spell is cast:
Set WS_Loops = 20
Set WS_LightningType = Mana Burn
Set WS_Impact = (Art path of Manastorm (Dummy) Target Art (index 0))
Set WS_LightningDuration = 0.80

The damage, range and mana burn values should be made variables which are set at map initialization. Then calculate the damage when the spell is cast.

Someone (DSG?) said that killing a unit with expiration will cause a leak. Making it explode on death (Unit - explode on death) will make the leak go away.

It's a good idea to set dummy types into a variable and define the variables in the init trigger.

About the tooltip, distance in WC3 is not measured in yards. Actually there's no real distance unit. Just use 300 distance instead of 300 yards.

The tooltip data should also be level-spesific, meaning when it's at level 1, you don't list "does 300/400/500 damage". Just make it say "does 300 damage".

Make the floating text optional with a boolean value.

Experiment with Floating text - Change fading age. Try 1.2 seconds, maybe it will look better when it fades instead of instantly disappearing.

Instead of setting the group into a variable, you can do this:
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units within WS_DamageRange of WS_Point[1] matching ((((Matching unit)...)
    • Loop - Actions
The boolean will make the group be destroyed after all units have been looped through.

Lightning clear trigger should be turned on/off. It will fire when any unit dies even when there are no lightning dummies around.

Set the dummies to Can't raise, does not decay. That way they will get removed after a few seconds. If they are set to decay, the will be removed after ~90 seconds.

Idk about the variable settings, i would want them in the same place so you don't have to jump around between the triggers to cusomise the values. Some of them requires to be in the cast trigger since they depend on other variables determined in the cast.

Dummys - Done
Dummy Variable - Working on it
Floating text change - begins fading at 1.3 seconds (Disappears at 1.5) and does not show if target have no mana.
 
Level 7
Joined
Apr 12, 2011
Messages
124
@ Maker

Yes, but these
  • Set WS_DamageRange = (250.00 + (50.00 x (Real(WS_Lvl))))
  • Set WS_Range = (250.00 + (50.00 x (Real(WS_Lvl))))
  • Set WS_Damage = ((Real(WS_Lvl)) x 100.00)
  • Set WS_EndDamage = ((Real(WS_Lvl)) x 100.00)
  • Set WS_Manaburn = (5 + (5 x WS_Lvl))
Won't work if i put it in the init trigger since they rely on these
  • Set WS_Caster = (Triggering unit)
  • Set WS_Owner = (Owner of WS_Caster)
  • Set WS_Lvl = (Level of (Ability being cast) for WS_Caster)
  • Set WS_Point[1] = (Position of WS_Caster)
Those i could move i moved to Startup trigger.
 
Level 16
Joined
May 1, 2008
Messages
1,605
Yes that's the plan, when he say "init trigger" he think of your "cast trigger". Well in GUI there are in most cases only 2 triggers for a spell, the init trigger, which init all needed stuff and the loop trigger, where every 0.04 seconds happens some action

So in fact but everything in this trigger, where the event is "Unit - Start an effect of an ability"
You can look at other GUI spells in the spell section, where they always put the variables and learn from it and please (DSG said it already) reduce your harass of comment actions XD

EDIT: It was an example -_-; =)
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
@ Maker

Yes, but these
  • Set WS_DamageRange = (250.00 + (50.00 x (Real(WS_Lvl))))
  • Set WS_Range = (250.00 + (50.00 x (Real(WS_Lvl))))
  • Set WS_Damage = ((Real(WS_Lvl)) x 100.00)
  • Set WS_EndDamage = ((Real(WS_Lvl)) x 100.00)
  • Set WS_Manaburn = (5 + (5 x WS_Lvl))
Won't work if i put it in the init trigger since they rely on these
  • Set WS_Caster = (Triggering unit)
  • Set WS_Owner = (Owner of WS_Caster)
  • Set WS_Lvl = (Level of (Ability being cast) for WS_Caster)
  • Set WS_Point[1] = (Position of WS_Caster)
Those i could move i moved to Startup trigger.

Let's take the range as an example.

Create two variables and define them in the initialization trigger:
WS_RangeBase = 200
WS_RangeBonus = 50

Then in the casting trigger you can use:
Set WS_Range = (WS_RangeBase + (WS_RangeBonus x (Real(WS_Lvl))))

If you do it like this, then the user can define everything in the initialization trigger and doesn't have to touch the casting trigger.

Yes that's the plan, when he say "init trigger" he think of your "cast trigger".

No, I meant the initializaton trigger, not the casting trigger.
 
Level 7
Joined
Apr 12, 2011
Messages
124
Let's take the range as an example.

Create two variables and define them in the initialization trigger:
WS_RangeBase = 200
WS_RangeBonus = 50

Then in the casting trigger you can use:
Set WS_Range = (WS_RangeBase + (WS_RangeBonus x (Real(WS_Lvl))))

If you do it like this, then the user can define everything in the initialization trigger and doesn't have to touch the casting trigger.

Thank You!!!
Perfect, i got a good feeling about this now :) + rep
 
Level 7
Joined
Apr 12, 2011
Messages
124
New issue >.<

Moved all customisation to Startup trigger, problem is it doesn't work. can't figure it out (Dumb, i know).

  • Startup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- ======================================================================= --------
      • -------- DON'T TOUCH THIS --------
      • -------- ======================================================================= --------
      • Hashtable - Create a hashtable
      • Set WS_Hashtable = (Last created hashtable)
      • -------- WS_DummyMonsoon --------
      • Set WS_DummyMonsoon = Lightning Dummy (Visual Monsoon)
      • -------- WS_DummyThunderclap --------
      • Set WS_DummyThunderclap = Lightning Dummy (Visual Thunderclap)
      • -------- WS_Dummy --------
      • Set WS_Dummy = Dummy
      • -------- ======================================================================= --------
      • -------- CUSTOMISE THIS --------
      • -------- You can customise the rest of the ability in Trigger "Manastorm Cast" --------
      • -------- Some visual effects are in the object editor (spells, buffs, units) --------
      • -------- ======================================================================= --------
      • -------- Number of Lightnings / Number of times Loop is repeated --------
      • Set WS_Loops = 20
      • -------- Lightning Type --------
      • Set WS_LightningType = Drain Mana
      • -------- Specifies the effect which appears at the lightning strike point --------
      • Set WS_Impact = (Art path of Manastorm (Dummy) Target Art (index 0))
      • -------- Lightning Duration in seconds --------
      • Set WS_LightningDuration = 0.80
      • -------- --------
      • -------- Base Range --------
      • Set WS_BaseDamageRange = 200.00
      • -------- Bonus Range (This is added to the base range each new level) --------
      • Set WS_BaseDamageRange = 50.00
      • -------- Base Range Visual Effect --------
      • Set WS_BaseEffectRange = 200.00
      • -------- Bonus Range Visual Effect (This is added to the base range each new level) --------
      • Set WS_BonusEffectRange = 50.00
      • -------- Base Damage --------
      • Set WS_BaseDamage = 100.00
      • -------- --------
      • -------- Base Damage Dealt when a unit with mana gets burned to 0 --------
      • Set WS_BaseEnddamage = 100.00
      • -------- --------
      • -------- Base Mana Burned ( IN PERCENT(%)) --------
      • Set WS_BaseManaBurn = 5.00
      • -------- Bonus Mana Burned ( IN PERCENT(%)) --------
      • Set WS_BonusManaBurn = 5.00
      • -------- --------
      • -------- Cooldown can be customised in the Object Editor --------
      • -------- Default Cooldown is 10 seconds at all levels --------
      • -------- Mana Cost can be customised in the Object Editor --------
      • -------- Default Mana Cost 120/160/180 --------



  • Manastorm Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Manastorm
    • Actions
      • -------- --------
      • -------- READ ME! --------
      • -------- --------
      • -------- Manasurge's Manastorm! --------
      • -------- Provides a base of triggers with multiple exchangeable values to maximize the different way to combine this spell --------
      • -------- --------
      • -------- Tooltip --------
      • -------- Manastorm --------
      • -------- Damages units within 300/350/400 yards and deals 100/200/300 damage per unit. It also ignites the mana of the units affected, burning 10%/15%/20% and leaves the victim with a debuff that slows movementspeed for 7/10/14 seconds. --------
      • -------- --------
      • -------- To get this spell to your map you need to copy and paste these: --------
      • -------- NOTE: Make sure your map has "Automatically create unknown variables while pasting trigger data" box checked --------
      • -------- --------
      • -------- Units: Dummy, Lightning Dummy (Visual Monsoon), Lightning Dummy (Visual Thunderclap) --------
      • -------- Spells: Shock (Dummy), Manastorm (Dummy), Manastorm --------
      • -------- Buffs: Mana Residue --------
      • -------- Triggers: Startup, Manastorm Cast, Lightning Clear --------
      • -------- All Special Effects (except Lightning andLightning impact) is in the Object Editor spells. --------
      • -------- --------
      • -------- You can customise: --------
      • -------- --------
      • -------- Number of Lightnings --------
      • -------- Number of Levels (in the spell in object editor and Manastorm Cast trigger, change the lvl check on Mana Burn, DamageRange and Range --------
      • -------- Lightning type --------
      • -------- Damage --------
      • -------- End Damage --------
      • -------- Mana Burned --------
      • -------- Range of Damage --------
      • -------- Range of the Effects --------
      • -------- Mana Cost ( In object editor ) --------
      • -------- Cooldown (In the spell in Object Editor) --------
      • -------- Visual Effects (In the spells themselfes in Object Editor, 2 of the effects are units with a effect model: Dummy (Visual Monsoon) and Dummy (Visual Thunderclap)) --------
      • -------- Duration of the Slow (This is modified in the Object Editor) --------
      • -------- --------
      • -------- ======================================================================= --------
      • -------- ======================================================================= --------
      • -------- ///////////////// DO NOT CHANGE ANYTHING IN THIS TRIGGER! //////////////////// --------
      • -------- ///////////////// DO NOT CHANGE ANYTHING IN THIS TRIGGER! //////////////////// --------
      • -------- ///////////////// DO NOT CHANGE ANYTHING IN THIS TRIGGER! //////////////////// --------
      • -------- ======================================================================= --------
      • -------- ======================================================================= --------
      • -------- --------
      • -------- Determins who is the triggering unit, (Caster) --------
      • Set WS_Caster = (Triggering unit)
      • -------- Determins who owns the triggering unit, (Owner of Caster) --------
      • Set WS_Owner = (Owner of WS_Caster)
      • -------- Determins what level the ability cast is. (Thunderstorm) --------
      • Set WS_Lvl = (Level of (Ability being cast) for WS_Caster)
      • -------- Fixates the position of the caster to originate all effects --------
      • Set WS_Point[1] = (Position of WS_Caster)
      • -------- Recycle WS_Real --------
      • Set WS_Real = 0.00
      • Set WS_DamageRange = (WS_BaseDamageRange + (WS_BonusDamageRange x (Real(WS_Lvl))))
      • Set WS_Range = (WS_BaseEffectRange + (WS_BonusEffectRange x (Real(WS_Lvl))))
      • Set WS_Damage = ((Real(WS_Lvl)) x WS_BaseDamage)
      • Set WS_EndDamage = ((Real(WS_Lvl)) x WS_BaseEnddamage)
      • -------- Default slow duration is 7/10/14 seconds --------
      • Set WS_Manaburn = ((Integer(WS_BaseManaBurn)) + ((Integer(WS_BonusManaBurn)) x WS_Lvl))
      • -------- Creates Visual Dummy --------
      • Unit - Create 1 WS_DummyMonsoon for WS_Owner at WS_Point[1] facing Default building facing degrees
      • Unit - Make (Last created unit) Explode on death
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • -------- Creates Visual Dummy --------
      • Unit - Create 1 WS_DummyThunderclap for WS_Owner at WS_Point[1] facing Default building facing degrees
      • Unit - Make (Last created unit) Explode on death
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • -------- Starts Integer Loop to create lightnings and effects --------
      • For each (Integer WS_Integer) from 1 to WS_Loops, do (Actions)
        • Loop - Actions
          • -------- Determins the point where the lightning starts and targets --------
          • Set WS_Point[3] = (WS_Point[1] offset by WS_DamageRange towards WS_Real degrees)
          • -------- Creates the Lightning Effect and a small impact effect --------
          • Lightning - Create a WS_LightningType lightning effect from source WS_Point[3] to target WS_Point[1]
          • Special Effect - Create a special effect at WS_Point[3] using WS_Impact
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect at WS_Point[1] using war3mapImported\LightningWrath.mdx
          • Special Effect - Destroy (Last created special effect)
          • -------- Activates timed life of Lightning Effects --------
          • Unit - Create 1 WS_Dummy for WS_Owner at WS_Point[1] facing Default building facing degrees
          • Unit - Make (Last created unit) Explode on death
          • Unit - Add a WS_LightningDuration second Generic expiration timer to (Last created unit)
          • Unit Group - Add (Last created unit) to WS_LightningGroup
          • Hashtable - Save Handle Of(Last created lightning effect) as 0 of (Key (Last created unit)) in WS_Hashtable
          • Set WS_Point[2] = (WS_Point[1] offset by WS_Range towards WS_Real degrees)
          • -------- Creates Dummy For ability Effect --------
          • Unit - Create 1 WS_Dummy for WS_Owner at WS_Point[3] facing Default building facing degrees
          • Unit - Add Manastorm (Dummy) to (Last created unit)
          • Unit - Set level of Manastorm (Dummy) for (Last created unit) to WS_Lvl
          • Unit - Order (Last created unit) to Undead Dreadlord - Carrion Swarm WS_Point[1]
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Unit - Make (Last created unit) Explode on death
          • Set WS_Real = (WS_Real + (360.00 / (Real(WS_Loops))))
          • -------- Clears location leaks --------
          • Custom script: call RemoveLocation(udg_WS_Point[2])
          • Custom script: call RemoveLocation(udg_WS_Point[3])
      • Set WS_Unitgroup = (Units within WS_DamageRange of WS_Point[1] matching ((((Matching unit) belongs to an enemy of WS_Owner) Equal to True) and ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and (((Matching unit) is ali
      • Unit Group - Pick every unit in WS_Unitgroup and do (Actions)
        • Loop - Actions
          • Unit - Cause WS_Caster to damage (Picked unit), dealing WS_Damage damage of attack type Spells and damage type Normal
          • Unit - Create 1 WS_Dummy for WS_Owner at WS_Point[1] facing Default building facing degrees
          • Unit - Make (Last created unit) Explode on death
          • Unit - Add Shocked (Dummy) to (Last created unit)
          • Unit - Set level of Shocked (Dummy) for (Last created unit) to WS_Lvl
          • Unit - Order (Last created unit) to Orc Shaman - Purge (Picked unit)
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • -------- Calculates mana that will be burned --------
          • Set WS_BurnedMana1 = ((Max mana of (Picked unit)) / 100.00)
          • Set WS_BurnedMana = ((Mana of (Picked unit)) - (WS_BurnedMana1 x (Real(WS_Manaburn))))
          • -------- Checking if any mana was burned and --------
          • -------- Applies the calculated burn --------
          • Unit - Set mana of (Picked unit) to WS_BurnedMana
          • Set WS_CurrentMana = (Mana of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • WS_CurrentMana Greater than 0.00
            • Then - Actions
              • Set WS_BurnedmessageInteger = ((Integer(WS_BurnedMana1)) x WS_Manaburn)
              • Set WS_BurnedMessage = (- + (String(WS_BurnedmessageInteger)))
            • Else - Actions
              • Set WS_BurnedMessage = (- + (String(WS_Damage)))
              • Set WS_DisplayOverdrain = ((Integer(WS_Damage)) + (Integer(WS_EndDamage)))
          • -------- Creates the Floating Text effect reflecting the burned amount --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Integer(WS_BurnedMana1)) Greater than 0
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • WS_BurnedmessageInteger Greater than 0
                  • WS_CurrentMana Less than or equal to 0.00
                • Then - Actions
                  • Unit - Cause WS_Caster to damage (Picked unit), dealing WS_EndDamage damage of attack type Chaos and damage type Normal
                  • Special Effect - Create a special effect at (Position of (Picked unit)) using Units\Undead\Abomination\AbominationExplosion.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Floating Text - Create floating text that reads (String(WS_DisplayOverdrain)) above (Picked unit) with Z offset 0.00, using font size 8.00, color (100.00%, 50.00%, 50.00%), and 0.00% transparency
                  • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
                  • Floating Text - Change (Last created floating text): Disable permanence
                  • Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
                  • Floating Text - Change the fading age of (Last created floating text) to 1.20 seconds
                • Else - Actions
                  • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Human\DispelMagic\DispelMagicTarget.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Floating Text - Create floating text that reads WS_BurnedMessage above (Picked unit) with Z offset 0.00, using font size 8.00, color (50.00%, 50.00%, 100.00%), and 0.00% transparency
                  • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
                  • Floating Text - Change (Last created floating text): Disable permanence
                  • Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
                  • Floating Text - Change the fading age of (Last created floating text) to 1.20 seconds
            • Else - Actions
      • -------- Clear Lightning leak in Trigger "Lightning Clear" --------
      • -------- Clears location leaks --------
      • Custom script: call RemoveLocation(udg_WS_Point[1])
      • -------- Clears unitgroup leaks --------
      • Custom script: call DestroyGroup(udg_WS_Unitgroup)


Anyone know what i did wrong? :vw_wtf:

EDIT: figured it out: I set the WS_BaseDamageRange twice, first to 200 then to 50
Just shows i need to slow down and look things through.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Propably.

Leak:
  • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Human\DispelMagic\DispelMagicTarget.mdl
Maybe decrease the default loop amount. You're spamming the effects and creating 40 dummies per cast currently.
Turn the dying detection trigger on/off.
You could use the unit group destroying method I told about.
Some of the actions in the floating text section are inside both then and else branches. Such actions should be positioned outside the branch since they get executed anyway.
 
Level 7
Joined
Apr 12, 2011
Messages
124
Ok, will do a quick run trough of the spell on Monday and then upload if i don't hit an obstacle. Tyvm for all your help :)

EDIT: And btw, the floating text isn't the same, it's 1 for mana burned if there's any mana to burn and 1 for the extra damage dealt if there's no mana left (or not enough) to burn

EDIT2: I appearantly changed their string integer to be the same, but there's still 1 difference and that is color and size.
The Mana burn string is 8 size and blue, the dmg string is 10 size and red

EDIT3: Im gonna upload it today, and then on monday check comment for any improvments to get additional time for "Leaks/improvement ideas" to be found by the people viewing.
 
Last edited:
Status
Not open for further replies.
Top