• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece!🔗 Click here to enter!

[Trigger] Spell, correcting selfdamage in healthpercentage

Status
Not open for further replies.

Esa

Esa

Level 4
Joined
Nov 10, 2010
Messages
79
Hi forum!

And sorry for posting multiple threads in the same week in this forum. I will create a dedicated thread for myself if that is preferred, where I can post all my questions.

ANYWAY, on to thread. :)

I've written a spell that works like a Windwalk, except that it spawns an explosion on the location of the user. Said explosion will deal a huge amount of damage to units (for this level, it is 290). Furthermore, it will stun units that have the buff "Shadowflames BUFF" for 3 seconds. The same units will also have the duration of the "Shadowflames BUFF" extended by 13 seconds. The caster will be rendered invulnerable for 2 seconds after having casted Flashfire (the spell I'm talking about), and invisible for 5. The spell costs 35% of total health at level 1, 65% of current health at level 2, and 40% of current health at level 3.

The trigger look like this:

  • Flashfire Selfdamage
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Flashfire
      • (Level of Flashfire for (Casting unit)) Equal to 1
    • Actions
      • Set HealthPercentageInteger = (Integer((Percentage life of (Casting unit))))
      • Unit - Cause (Casting unit) to damage (Casting unit), dealing ((Max life of (Casting unit)) - (Life of (Casting unit))) damage of attack type Spells and damage type Fire
      • Unit - Remove All buffs from (Casting unit)
      • Unit - Make (Casting unit) Invulnerable
      • Environment - Create a 7.00 second Temporary crater deformation at (Position of (Casting unit)) with radius 450.00 and depth 64.00
      • Special Effect - Create a special effect at ((Position of (Casting unit)) offset by (2.00, -2.00)) using Abilities\Spells\Human\FlameStrike\FlameStrike1.mdl
      • Special Effect - Create a special effect at (Position of (Casting unit)) using Abilities\Spells\Human\FlameStrike\FlameStrike1.mdl
      • Special Effect - Create a special effect at ((Position of (Casting unit)) offset by (-2.00, 2.00)) using Abilities\Spells\Human\FlameStrike\FlameStrike1.mdl
      • Wait 2.00 seconds
      • Unit - Make (Casting unit) Vulnerable
My main problems with this spell:
- I can't figure out how to deal aoe damage. Will I have to use dummies?
- I can't figure a way to extend the Shadowflames BUFF duration by 13 seconds.
- I can't figure how to do the health cost correctly. (At the moment I've picked a cheap choice, being the diff between max and current health.)

ps: I've left out the buff extending from the trigger, because I simply had no clue where to begin. I also tried to add some damage, but it just didn't work out. The "Set Variable" line in there is there simply because I had tried to use something like that and forgot to remove it.

Any help is greatly appreciated. And I would love to be able to do this spell in WC3 editor, without the use of Jass. If I need Jass tho, I might need a -very- thorough guide. :(
 
1)
  • Actions
    • Set Points[1] = (Position of (Triggering unit))
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units within 300.00 of Points[1] matching (((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Triggering player)) Equal to True)) and do (Actions)
      • Loop - Actions
        • Unit - Cause (Triggering unit) to damage (Picked unit) dealing 290.00 damage of Attack type Spells and Damage type Normal
        • If (All conditions are true) then do (Actions) else do (Actions)
          • If - Conditions
            • ((Picked unit) has buff Shadowflames) Equal to True
          • Then - Actions
            • Set Points[2] = (Position of (Picked unit))
            • Unit - Create 1 dummy for (Triggering player) at Points[2] facing Default building degrees
            • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Picked unit)
            • Unit - Add a 2.00 seconds Generic expiration timer to (Last created unit)
            • Custom script: call RemoveLocation (udg_Points[2])
          • Else - Actions
    • Custom script: call RemoveLocation (udg_Points[1])
Make a dummy unit, add the Mountain King's Storm Bolt ability (don't forget to remove mana cost, set cast range to 999999, set cooldown to 0, remove missile art and missile speed/arc and set Hero ability to "False").

2) You need to have the buff with a duration of 0.00 (so that it lasts forever) and a trigger to remove it. You will need Jass for this, so that you create a local timer for each affected unit. Then, when the timer expires, UnitRemoveAbility (unit, 'buffid').

3) The health formula doesn't make sense, because it's not escalating downwards or upwards; it uses 35, 65 and then 40. I will make you a formula, but for normal values, e.g.
for level 1, 65%, for level 2, 50%, for level 3, 35%. Here it is:
  • Set HealthCost = ((-15 x (Real(Level of (Ability being cast) for (Triggering unit)))) + 80)
  • Unit - Set life of (Triggering unit) to ((Percentage life of (Triggering unit)) - HealthCost)%
 

Esa

Esa

Level 4
Joined
Nov 10, 2010
Messages
79
The health formula escalates downwards, as it is at first 35% of MAXIMUM health, and then 65% of CURRENT, then finally 40% of current again. Where did you find that healthCost)% line in the editor?

And allrighty, a timer. Will try that.

Thanks for your quick response.
 

Esa

Esa

Level 4
Joined
Nov 10, 2010
Messages
79
Allright, I will try that. If I can't get it to work, I'll post the entire trigger here again in either a few hours or days :p
Thanks for the formula btw. :)
 

Esa

Esa

Level 4
Joined
Nov 10, 2010
Messages
79
Wait a minute, Jass is GUI in custom text???

If so, can I just import the jass triggers as text into the editor?
 
Status
Not open for further replies.
Top