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

[Trigger] Increase the mana/Hp pool "Carac based"

Status
Not open for further replies.
Level 6
Joined
Oct 31, 2014
Messages
170
Hello !

I would like to know if there is a way to increase the Mana/Hp by using a percentage of a carac via an item.

basically, is there a way to have an item like:

[ITEM]: Increase your Health Point by (10% of the owner's agility)

I already have my Values running every 5 secondes to check on the values of my heroes (for my spells) But I can't find any way to use it for this kind of item.
 
Level 6
Joined
May 20, 2014
Messages
228
I tried to do such myself but wasn't really able to get it working, however I googled and found something similar like this. Post #6 has a map attached that does what you're looking for, I believe.

Looks nifty, actually.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Well you need something to tell how much health the unit should have.
Lets use a hashtable.

When a unit acquires your item and is not inside "MyItem_Group".
Add it to a pre-made group called "MyItem_Group".
When it loses that item and it hasn't got an item of that type.
Remove that unit from "MyItem_Group".

Every second (and when a unit acquires that item), you pick every unit in that group and calculate it's current (Agility * 0.1).
Then you load an integer from the hashtable that is saved under the unit.
Then you calculate the difference between those two.
You add the difference to the unit's maximum health.
Then you save the integer in the hashtable to (Agility * 0.1)

When you remove the unit from the group, you also set that value to 0 and remove the bonus health.
 
Level 6
Joined
Oct 31, 2014
Messages
170
Yes but that unit is a hero ! the only values you can touch are strenght agility and intelligence ! ... mmmh maybe I can run a calcul of his hp using the strenght+basic HP then.

Did you think of a hero Wietlol? Im gonna check this map Alright thanks !
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Yes but that unit is a hero ! the only values you can touch are strenght agility and intelligence ! ... mmmh maybe I can run a calcul of his hp using the strenght+basic HP then.

Did you think of a hero Wietlol? Im gonna check this map Alright thanks !

So what values can you touch on normal units???
I really wonder.

What I am talking about is a custom custom-value.
call SaveInteger(Hashtable, GetHandleId(MyHero), 0, R2I(Agility*0.1))
GUI can do it too but I have no editor opened.

Before the save you do this:
set Difference = Agility*0.1 - LoadInteger(Hashtable, GetHandleId(MyHero), 0)
Add <Difference> HP.

To add HP to a unit you need the Item Ability for HP.
There is this bug with those abilities that you can increase max hp and mp to every possible unit.
 
Level 6
Joined
Oct 31, 2014
Messages
170
Add <Difference> HP.

[/URL]

That's the problem indeed. where is that ? Because on a hero, the HP are based on " hp base "+" % strenght "

But I haven't found any way to add hp to a heros but using an item.

I'm not sure I anderstood what you meant then.. ^^"
 
Level 6
Joined
Oct 31, 2014
Messages
170
http://www.hiveworkshop.com/forums/2227551-post4.html

I used this technic but now I have another problem.

Used it to increase my hero mana by 50 when one of his ability was level up. But now instead of my spell description I have a weird "YgoOo or YgO=O Or Ygoty ect ect" showing and changing every time my hero attacks.

This technic is obviously weird but did it cause those weird descriptions ?

Any idea?
 
Level 6
Joined
Oct 31, 2014
Messages
170
So here is a screen of the bug, each attack changes the "YGol" text :

b8GsOLX.jpg


and you can check the map, The trigger is in Spells Heroes/Magma ulti level up

The spell is called "Magma ulti" in Custom/humans/heroes. Nothing weird about the Spell btw I didn't even have to trigger it I'm just using a custom human priest "inner fire" blessing. The weird bug appeared just after the trigger to add 50 mana.
 

Attachments

  • Insects rpg PROGRESS.w3x
    17.2 MB · Views: 29
Level 24
Joined
Aug 1, 2013
Messages
4,657
This one is weird

I removed all triggers except "Fire Mage Pick", "Difficulty Settings" and "Melee Initialization" and used a copied version of the "Magma Ulti", but the problem is still there.

I suggest you to remake that ability and use a different parent ability.
 
Level 6
Joined
Oct 31, 2014
Messages
170
did you also remove the (+50 mana per lvl) trigger ?

(Spells Heroes/Magma ulti level up)

It's very weird but I'm wondering If there would be a way to control this, could be interesting !
 
Level 6
Joined
Oct 31, 2014
Messages
170
Okay well, thanks for your help, at least I know I'm not insane ^^

I was thinking of changing this spell anyways ...
 
Status
Not open for further replies.
Top