Stats and spells

Status
Not open for further replies.
Level 2
Joined
Sep 28, 2011
Messages
23
Hey

I was just wondering how can I make stats ( for example intelligence ) effect spells?

Like we all know that when hero gains more strength, auto attacks deal more damage. Atleast that's how it is normally but how can I make intelligence increase spell damage or healing?

If someone knows there's already system like this please link it.
Or if someone can explain how can I do one.
 
Level 2
Joined
Sep 28, 2011
Messages
23
I don't know how to create all that. I tried and i got something but couldn't make it completely. Could you make more in detail trigger? I'm not really good with these.
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
  • Untitled Trigger 063
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Storm Bolt
    • Actions
      • Set r1 = ((50.00 + (25.00 x (Real((Level of (Ability being cast) for (Triggering unit)))))) x ((Real((Strength of (Triggering unit) (Include bonuses)))) / 20.00))
      • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing r1 damage of attack type Spells and damage type Normal
You need to use Arithmetic function and also Conversion - convert integer to real. Ability level and strenght (hero attribute) are integers.
 
Level 2
Joined
Sep 28, 2011
Messages
23
Thx it works but i noticed right away a problem with this. I can't use any heals. Heals currently kill everyone instead heal them :)

Any ideas how I can get this to work so that damaging spells do more damage with higher intelligence and healing spells heal more?
 
Level 4
Joined
Apr 7, 2012
Messages
63
You can easily do this in vjass or even jass, though if you do not understand that just set variables, everytime a hero levels or gains an ability, of his stats (agility, intelligence strength etc.) Not sure what it is caled in GUI but normally I would use SetWidgetLife(unit which unit, real, etc.) I think it might be under the unit selection in GUI.
 

sentrywiz

S

sentrywiz

You can make effects of spells deal/heal damage/health with the stats.

hx it works but i noticed right away a problem with this. I can't use any heals. Heals currently kill everyone instead heal them :)

Like SeriousEnemy said, your math is wrong.
You should create heals like:

Unit's Current Health + Healing instead of setting it.

If you want to heal with percentage of max health for example you can do the math like:

Unit's Current Health + Unit's Current Health * 0.X where X is the percentage.

If you want to heal with stats you can do:

Unit's Current Health +-/* Triggering Unit's Strength/Agility/Intelligence

You can use the action "Damage Target" to heal/damage target for whatever you want.
I'd advise against using the action "Damage Area" since there is no way to pick who you want to damage or heal.

Instead you can pick units from unit-groups, damage them separately.
This is a big subject but if you can make static abilities, you can make the dynamic easily.
Just search around the forum you will find many tutorials!
 
Status
Not open for further replies.
Top