HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Re: Making spells that get stronger with use

07-13-2004, 11:38 PM#1
Molten
ive been experimenting with using triggers to count the number of times a spell is used, and then grant the unit a more advanced level of the spell if the spell us used x number of times. the problem is i cant seem to get it to work properly, because either the trigger seems to work only once, or it keeps granting the the level 2 spell to the unit over and over.

also, is there a way to use the same trigger for more x number of units with the same spell, and if so, can i use the spell for different unit types?
07-13-2004, 11:48 PM#2
harshateja
Im not completely sure what your asking but of what i understand i think all you should do is :

Event: A unit begins casting an ability(or a unit starts the effect of an ability)

Condition: Ability being cast = Whatever

Action:
if: level of ability of whatever for casting unit = 1
then: numberoftimesused = numberoftimesused +1
else:
if: level of ability of whatever for casting unit = 2
then: numberoftimesused = numberoftimesused +2
Else:
You get what im doing



If you want it to change the level of that ability then instead of making the rate of numberoftimes used change, make stay as add one but you add an additional trigger to each then action. For example for the if statement checking for if the level is 1:

if: numberoftimesused <= 4 (or whatever is 4 times the level your are checking for)
then: set level of hero ability whatever to 2 (or whatever is 1 plus the level you are checking for)
else: donothing


Basically it records the amount used so you can use this for like the amount of summons or something. Also, with each level up of the ability, it gets stronger quicker. Hope this helps. If this is not what you wanted post back

OR:

You could just make like a different level version of the spell each time like a level 1 of that spell, a lvl 2 of that spell, a lvl 3 of that spell, etc and just check the number of times used and if it matches, just remove the old ability and add the new.


~HarshaTeja~
07-16-2004, 03:15 AM#3
Molten
this looks pretty close but is is possible to evaluate the number of times the spell is used then, when the unit has used the spell 4 times, grant him the level 2 of that spell, instead of relying on the actual level of that hero to purchase the spell with hero points. that way, the hero can have a spell at level 6 when the hero itself is only at level 4.
07-16-2004, 03:17 AM#4
Molten
wait nevermind, im slightly reterded. i think ive got it figured out. i didnt under stand the

"if: numberoftimesused <= 4 (or whatever is 4 times the level your are checking for)
then: set level of hero ability whatever to 2 (or whatever is 1 plus the level you are checking for)
else: donothing"

do i have to set up some sort of counter for this to reference?
07-16-2004, 09:48 AM#5
Anitarf
Well, if you want this to work for multiple units, then I suggest you use custom values for this.
Code:
Events:
  A unit starts the effect of an ability (do not use "begins casting", players could abuse that to get levels quickly)
Conditions:
  Ability being cast equal to Levelable ability
Actions:
  Set (custom value of casting unit) to ((custom value of casting unit) + 1)
  If - then - else multiple functions
    If - conditions:
      (custom value of casting unit) = 4
    Then - actions:
      - upgrade the ability -
    Else - actions:
      do nothing  
However, now that I think of it, this only allows you to level a single ability on a hero this way. To get it to work for multiple abilities, you would either have to combine multiple integers in 1 before you could store it to the custom value (for example, if all spells require to be cast 5 times to get to a higher level; in that case, if spell 1 has been cast 3 times, spell 2 4 times and spell 3 once, the custom value of the hero would be (3)+(4*6)+(1*36) ) or, you could try with a unit array to store the heroes and multiple integer arrays to store the number of times a spell has been cast, and then, whenever a spell is cast, go through the unit array untill you find the casting hero and then increase the according integer variable.