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

How to make a spell like this...

Status
Not open for further replies.
Level 6
Joined
Mar 28, 2018
Messages
128
Name Ability: Dark Power

Give Active:
Level 1: Restore mana and lose 20% of my life
Level 2: Restore mana and lose 30% of my life
Level 3: Restore mana and lose 40% of my life
Give Passive:
Level 1: give 100 mana permanent
Level 2: give 100 mana permanent
Level 3: give 100 mana permanent
 
Level 39
Joined
Feb 27, 2007
Messages
5,010
Make 2 abilities, both hero. One based on Item Mana Bonus, with 2 levels, level 1 gives 0 (ZERO) bonus mana, level 2 gives -100 (NEGATIVE) bonus mana; this is a dummy skill we add to the unit and remove to abuse the bug with item hp/mp boosting abilities. The skill you actually level up is the active part of the spell, and you can base it on any non-targeted spell you want. You need 2 triggers:
  • Events
    • Unit - A unit begins the effect of an ability
  • Conditions
    • (Ability being cast) equal to YOUR_ABIL
  • Actions
    • Set TempU = (Triggering Unit)
    • Set TempI = Level of (YOUR_ABIL) for (TempU)
    • Set TempR1 = (Life of (TempU))
    • Set TempR2 = (Mana of (TempU))
    • Unit - Set TempU current mana to 100% //you didn't specify how much mana to regen
    • Unit - Set TempU current health to (TempR1 x (1.00 - 0.20)) //showing how the number is calculated if it costs 20% current hp
    • Unit - Set TempU current health to (TempR1 - (TempR1 x 0.20)) //showing how the number is calculated if it costs 20% max hp
  • -------- --------
  • Events
    • Unit - A unit learns a skill
  • Conditions
    • (Learned Hero Skill) Equal to YOUR_ABIL
  • Actions
    • Set TempU = (Triggering Unit)
    • Unit - Add DUMMY_ABIL to TempU //adds 0 bonus mana at level 1
    • Unit - Set level of (DUMMY ABIL) for (TempU) to 2 //because of the bug this doesn't give the unit -100 bonus mana at level 2
    • Unit - Remove (DUMMY_ABIL) from (TempU) //Removes "-100" bonus mana from the unit, give it 100 bonus mana every time this happens.
 
Level 39
Joined
Feb 27, 2007
Messages
5,010
Your title specified "How to make" so I told you how... to... make... it. What happens the next time you have a spell idea and need it? Do you try yourself once or twice, or do you immediately come post another thread here without so much as making a renamed copy of a basic ability and giving it to your unit(s). When someone like me writes a trigger out (usually with explanations and links to further explanations as I did) will you go to the trigger editor and at least try to make the trigger they suggested you do?

If you can show me you tried and something went wrong or you are confused or there's a bug or my code doesn't work or I told you a GUI function that doesn't exist, then I will gladly help you out. I'll troubleshoot your map! I post here to help you learn how to map. So that you may take your knowledge and make awesome wc3 shit wherever you go even if these sites all die out and you can't post on the internet for strangers to make your ideas reality. By learning to do this yourself here are the skills you might acquire:
  1. converting item to unit abilities
  2. making dummy cast abilities
  3. basics of variable manipulation, and how that can be used effectively to improve code efficiency even in GUI
  4. how to abuse game bugs to your advantage
  5. AND MORE!
So I could make you a test map, but I won't. Try and I'll help you some more. I guarantee you'll learn something useful!
 
Level 39
Joined
Feb 27, 2007
Messages
5,010
I made an error before, it was a static 20%, not 20-40% based on level.
  • Unit - Set TempU current health to (TempR1 x (1.00 - (0.10 + (0.10 x TempI)))) //showing how the number is calculated if it costs 20-40% current hp
  • Unit - Set TempU current health to (TempR1 - ((max life of TempU) x (0.10 + (0.10 x TempI)))) //showing how the number is calculated if it costs 20-40% max hp
 
Level 11
Joined
May 16, 2016
Messages
730
Name Ability: Dark Power

Give Active:
Level 1: Restore mana and lose 20% of my life
Level 2: Restore mana and lose 30% of my life
Level 3: Restore mana and lose 40% of my life
Give Passive:
Level 1: give 100 mana permanent
Level 2: give 100 mana permanent
Level 3: give 100 mana permanent

The conversion from life to mana has some issues. For example it could kill you if your health is lesser than conversion required. from the other side how it calculate life required if your mana is nearly full. Here is a MUI system that don't let the hero to kill self and don't take much health if the mana restoration is higher that difference between max mana and current mana. Also, the permanent effect is added. The system tracks all ways to gain/lose the ability.
 

Attachments

  • Dark Power.w3x
    23.4 KB · Views: 30
Status
Not open for further replies.
Top