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

Storing Hero Skills and random use of it

Status
Not open for further replies.
Level 4
Joined
Dec 5, 2011
Messages
75
Hi guys im trying to find a way to store my hero skills im not sure how do i do it but my guess is

  • Set HEROSKILLS = (Learned Hero Skill)
after i store the skills, the idea of my spell is to cast a random skill stored that my hero has ( it has 4 skills ) and cast it on enemy when he has been hit..
my problem is i have no idea how to pick my skills on random after i stored it

my guess is that it is not possible, the only way i thought it is pre set the skills that my hero has on variables then random pick it for use

thanks guys !
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
So you have only 1 dummy spell at your unit that act as a trigger to initiate at random, 4 of those saved spells ?

So I assume all 4 spells has same target-mechanism ?

If Target-unit, all must be Target-unit.
If Point-target, all must be Point-target.
If Instant-target, all must be Instant-target.

Is it ?
 
Level 4
Joined
Dec 5, 2011
Messages
75
Yes, all 4 skills have the same mechanics(area) and 3 levels .Yes, i have a dummy that will cast a random skill that was saved. but how do save the exatly level of my hero skill and use it later?
Example:
my hero has
Ice lvl 1
Fire lvl 3
thunder lvl 2

he randomly cast ice(lvl1) or fire(lvl3) or thunder(lvl2)
 
Level 18
Joined
Dec 17, 2009
Messages
1,114
Make an integer when the hero learned it,

A hero learned skill

OR-
Learned ability Ice
leared ability fire
Learned ability thunder

ACtion

If learned ability equal to ice
then
set ice[player number of owner of (triggering unit)] = ice[player number of owner of (triggering unit)] + 1
else
If learned ability equal to fire
then
set fire[player number of owner of (triggering unit)] = fire[player number of owner of (triggering unit)] + 1
else
If learned ability equal to thunder
then
set thunder[player number of owner of (triggering unit)] = thunder[player number of owner of (triggering unit)] + 1

to make the ability cast the spell when attacked you should make atrigger that checks whether he is attacked, then create a dummy to cast the spell to the position of the attacked unit.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Wait, when your Hero learns a spell, where does it go ?
You said the unit only has 1 dummy spell at the unit, nothing else.

And how does your Hero learns a skill ?
By default Warcraft III method ? (you know, press red marks and click the spell you want to learn/level up)

If by doing that method, your spell should have appear on the UI of that unit.
 
Level 18
Joined
Dec 17, 2009
Messages
1,114
Use "Spellbook" to hide the skill and when the hero is attacked make a trigger to cmmand it to cast the spell, i tried it, an active skill in a spellbook, and it's hidden within a spellbook, we can't manually cast it, but it can be cast using triggers, even if it's hidden.

if that's what you meant defskull, i don't really know the point though :/
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Use "Spellbook" to hide the skill and when the hero is attacked make a trigger to cmmand it to cast the spell, i tried it, an active skill in a spellbook, and it's hidden within a spellbook, we can't manually cast it, but it can be cast using triggers, even if it's hidden.

if that's what you meant defskull, i don't really know the point though :/
Does not answer my question at all.

What I meant was, okay let's say you have a dummy spell that will randomly cast one of 4 from your spell.

So, at your unit, there can be only 1 spell (which is the dummy) is used to cast at random one from those 4 spells.

Okay, you said that these 4 spells have levels, do they ?
If they have levels, certainly they can be learned, right ?

I just want to know how/what method did you use to let the unit learn/level up those spells.

If you use the default method (learn/level up via red mark over at the UI of a unit), the spell would appear on the UI of that unit, therefore the unit has 2 spells now (where it should have only 1 (dummy spell)).
 
Status
Not open for further replies.
Top