• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

Script "Unit Experience"

Status
Not open for further replies.
Level 7
Joined
Jul 25, 2008
Messages
292
I have been working on a map and as part of the map I want normal not-hero units to get experience from fighting. I do not want them to level up or get bigger or get new spells I just want them to get +1 health +1 attack and +0.01 attack speed for every kill the unit gets. I am sure this is possible because pudge from dota has a similar thing... the only problem is I suck at triggers :p

so... any ideas?
 
Pudge from DotA gains Strength, which is easy to customize, since there is the action: "Hero - Modify Hero attribute". To do what you want, you will need 3 abilities with way too many levels. One will be "Item Life Bonus", second will be "Item Damage Bonus" and the third will be "Gloves of Haste". Note: In order to level up Gloves of Haste, you need to put this ability in a spell book. Go to Abilities, press Ctrl + F and type "spell book"(space between spell and book). You will find it. Press Copy - Paste and you'll have your custom spellbook. Go to the field Data - Minimum Spells and set it from 3 to 1. Repeat this with Data - Maximum Spells. Then go to "Data - Spell list" and give it the modified "Gloves of Haste" ability. Then, give this item to your unit, by getting to the Units tab, find your unit, and go to the field "Abilities - Normal". Add the custom spellbook you made (It's in the Items' abilities, not Units'). Then, have this trigger:
  • Melee Initialization
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • For each (Integer A) from 1 to 12, do (Actions)
      • Loop - Actions
        • Player - Disable (<your custom spellbook ability>) for Player(IntegerA)
The action is "Player - Disable/Enable Ability" and the Player(IntegerA) is from "Conversion - Convert Player Index to Player", once you press the player you want altered in the action above.

For the rest two abilities, just add them in your units, like above, Abilities - Normal, and do this:
  • Abilities
  • Events
    • Unit - A unit dies
  • Conditions
    • (Unit-type of (Killing unit)) Equal to X
  • Actions
    • Unit - Increase level of (Item Damage Bonus) for (Killing unit)
    • Unit - Increase level of (Item Life Bonus) for (Killing unit)
Oh, you might wonder, why Gloves of Haste should be in a spell book, while the other two are not. Well, it's because the Gloves of Haste ability cannot be leveled without it being in a spell book.
 
Status
Not open for further replies.
Top