HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Change Unit/Hero Stats

09-14-2007, 08:37 PM#1
Salbrismind
How would i go about changing a units stats in-game? I would like to learn how to change a units/heroes stats like movement speed, attack damage, max damage. Also how to add effects like hp degen/regen and changing ability cooldowns. I want a action that can remove say a few secs of the cooldown not the whole cooldown. Any ideas? And don't tell me it's not possible i've searched and all the posts about this people always say it can't be done, yet it dota and such it happens.

If its a buff/ability that needs to do this then tell me that but i need to know how to change an abilities effects then.

Anyways Thanks if you can answer this, it is greatly appreciated.
09-14-2007, 09:34 PM#2
TaintedReality
For changing stats:

Most of them require adding item abilities that don't show up on the command card but affect stats. Most stat-modifying item abilities only work at level 1, meaning you have to have a bunch of different abilities. You would create them in powers of 2 then have a function that decides which to add. So if you're adding armor, you'd have +1 armor, +2 armor, +4, 8, 16, 32, etc. Then you can add combinations of them to get any value.

Some stats (such as health and mana) can be modified by adding tomes to the unit. Blade made a system that utilizes this.

For ability cooldowns:

This is a bit trickier. Resetting the cooldown of only one ability requires removing the ability and adding it again. So, when the ability is cast you can just start a timer for however long you want the cooldown to actually be, then when the timer expires remove/add the ability and set it to the same level as it was before. However, if you want it to be a multiplier of the original cooldown (like if you have faster cast speed, so get 5% faster cooldowns), then you need to know the original cooldown of the ability. You unfortunately can't get this without setting it to a variable by hand (so you can just create an array of reals with the cooldowns of all your abilities).

On the other hand, you could use Engineering Upgrade for that. That limits your capabilities and forces you to do everything by hand, but works fine. You've probably already thought of this though, and it doesn't work for all situations.
09-17-2007, 11:19 AM#3
Salbrismind
Quote:
Originally Posted by TaintedReality
For chaning stats:

Most of them require adding item abilities that don't show up on the command card but affect stats.

How do i add abilities? (Sorry this is why i'm asking, im a newb at this.)
Also where and how do i make new abilities etc.

Quote:
Some stats (such as health and mana) can be modified by adding tomes to the unit. Blade made a system that utilizes this.

Link please?

Quote:
This is a bit trickier. Resetting the cooldown of only one ability requires removing the ability and adding it again. So, when the ability is cast you can just start a timer for however long you want the cooldown to actually be, then when the timer expires remove/add the ability and set it to the same level as it was before. However, if you want it to be a multiplier of the original cooldown (like if you have faster cast speed, so get 5% faster cooldowns), then you need to know the original cooldown of the ability. You unfortunately can't get this without setting it to a variable by hand (so you can just create an array of reals with the cooldowns of all your abilities).

For my map i would like it if certain items have the ability to reduce cooldowntimes for all spells on the player. And i understand the rest of what you are saying but before i can make a system to change cooldowns i need to first get it all sorted out. Once i get my map up to working speed i'll test your suggestion right away thanks.
09-17-2007, 07:26 PM#4
TaintedReality
Quote:
Originally Posted by Salbrismind
How do i add abilities? (Sorry this is why i'm asking, im a newb at this.)
Also where and how do i make new abilities etc.

Seriously? oO. Use the Ability Editor to make new abilities. To add abilities use the Unit - Add Ability action in GUI, or UnitAddAbility(unit,abilityid) in JASS. To make a +damage ability you would base your new ability off of the Item Damage Bonus ability.

Quote:
Originally Posted by Salbrismind
Link please?

http://www.wc3campaigns.net/showthread.php?t=80490
09-17-2007, 10:46 PM#5
Salbrismind
Oh, its through the object editor i was under the impression that there were already made item abilities. So adding just any "item abilties" is fine as they dont take up any command card space/aren't shown? Also how would i then make a custom spell that does nothing but shows the buff on targets and players use to trigger the actual spell?
09-17-2007, 10:49 PM#6
TaintedReality
Quote:
Oh, its through the object editor i was under the impression that there were already made item abilities.

There are already made item abilities, that's what you base yours off of.

Quote:
So adding just any "item abilties" is fine as they dont take up any command card space/aren't shown?

Some of them seem to show their icon, I'm not sure why. You can always do the disabled spellbook trick with those. Mostly though, and always with the base stats such as attack speed, regen, health, etc, they won't show.

Quote:
Also how would i then make a custom spell that does nothing but shows the buff on targets and players use to trigger the actual spell?

The same way you would make any custom spell! You could use a modified version of an ability like Slow that has no effect but shows the buff, or you could use Channel and then use a Tornado Slow Aura buff.
09-18-2007, 12:51 AM#7
Salbrismind
Quote:
Originally Posted by TaintedReality
Some of them seem to show their icon, I'm not sure why. You can always do the disabled spellbook trick with those. Mostly though, and always with the base stats such as attack speed, regen, health, etc, they won't show.

Spell Trick? (U don't get it, im new to spells)

Quote:
The same way you would make any custom spell! You could use a modified version of an ability like Slow that has no effect but shows the buff, or you could use Channel and then use a Tornado Slow Aura buff.

I haven't figured out yet how to make spells with no effects. What else is needed to be done to make a newly created spell have no effects? (After i choose my base and name)

Again thanks for your help and Patience.
09-18-2007, 01:56 AM#8
TaintedReality
Ughhh. Sometimes you seem to know more advanced things, and othertimes you don't know the very basics. So I have trouble knowing how much to explain things ; ). I'll give it a shot.
Quote:
Originally Posted by Salbrismind
I haven't figured out yet how to make spells with no effects. What else is needed to be done to make a newly created spell have no effects? (After i choose my base and name)

So let's say you decide to use Slow as your base spell. In the ability editor Slow has some fields that determine how much the target is slowed. They're usually pretty obvious, so we just need to make the unit slowed by 0%. So, just look through the fields, and you'll see "Data - Attack Speed Factor" and "Data - Movement Speed Factor". Set these both to 0.0 and the target won't be slowed at all.

You can then change the other fields to suit your needs. It's pretty clear what they all do, the cooldown field changes the cooldown (in seconds), the duration field changes the duration (one is for heroes and one is for regular units), etc. You'll probably want to change the tooltips and the hotkey as well. You'll also want to change the buff to a custom buff. So you'll have to go to the Buff Editor and create a new buff based on the Slow buff. Then just change it to suit your needs - the tooltip, special effect (Art - Target), and icon.

The object editor is pretty clear most of the time, and is very forgiving. So just mess around with stuff until you get what you want.

Quote:
Originally Posted by Salbrismind
Spell Trick? (U don't get it, im new to spells)

I doubt you'll actually have to use it, but using a disabled spellbook you can hide passive abilities from the unit's command card. Here's a big tutorial on abilities with Spellbook included. http://www.wc3campaigns.net/showthread.php?t=81742 I would recommend reading through that whole thing, it contains a lot of cool tricks using abilities.
09-18-2007, 02:14 AM#9
Salbrismind
I understand what you say now but to conclude i need to connect the own idea with this with your last post:

So now that i understand that items abilities can control all the stats of a unit, now i need to understand how to apply this to a unit and make it's effects work. So lets say i have a spell that when used on a target makes the target lose 5 mana every sec in definetly (its an aura) how would i apply the ability to the enemy. (I understand the idea of picking units but i dont understand how the ability i made affects the enemy units picked in triggers.)
09-18-2007, 04:11 AM#10
Pyrogasm
You can modify a hero's Strength, Agility, and Intelligence using triggers, you know...
09-18-2007, 11:14 PM#11
Salbrismind
Ya, i know that already, any one should know that by just looking around the actions. And no it does not solve my problem thanks for trying.
09-19-2007, 01:36 AM#12
TaintedReality
Quote:
Ya, i know that already, any one should know that by just looking around the actions. And no it does not solve my problem thanks for trying.

In your original post you asked how to change a unit/hero's stats. Pyro was telling you how to change the stats of heroes.

To apply an ability to an enemy, you just add the ability to the unit. Unless you want a unit to cast an ability on another unit, in which case you order a unit with the ability to cast the ability on another unit.

It seems like you just need to mess around with things some. Many of these questions are extremely basic that can be learned just by looking around the WE.