HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Learning Spells in an Area

06-18-2004, 06:53 PM#1
Ordin
In my map my heros start off with no abilities. Instead I want them to be able to slowly learn them. I want them to learn spells when they are in a certain proximity to a spell being cast. If they are they would learn say 5% needed for the spell, each time the spell is cast near them they would learn a further 5% and so on. Once they reach 100% in a spell they would actually aquire the ability. I imagine this will involve variables for each hero and spell but I am not sure what triggers to use to detect when a creature is near a spell being cast. Any help is appreciated!
06-18-2004, 08:19 PM#2
CynicalYouth
You are going to need a bunch of variables to make this work, arrays would make it easier.

As for the event you would have to use the unit begins casting an ability event. Then see if the hero is within a certain range of the unit and if he is add to his learn variable. With another trigger that checks if that variable gets to 100 and if it does give the hero the spell.
06-18-2004, 08:47 PM#3
Anitarf
Use "starts the effect of an ability" instead of "begins casting". The "begins casting" event can be abused by ordering the unit to cast the spell, stop the unit before the spell is cast, and then order it again, with no mana lost and no cooldown to wait.
06-18-2004, 10:54 PM#4
Ordin
Thanks for the help so far, I think I should be able to do the variables but my problem now is what condition to use to detect that the hero is near where the ability is being cast. I know how to detect if the ability is being cast on my hero but not near. Any idea on what condition could do this?
06-19-2004, 08:11 AM#5
Anitarf
Well, you could do it like this: When a unit casts a spell, you pick every unit in range of the casting unit matching condition (matching unit is a hero equal to true) and then add to the percentage of all picked heroes' skill-learning-variable.
06-19-2004, 01:09 PM#6
linkmaster23
Hey, this sounds cool. I'll make a map for ya!
06-20-2004, 02:04 AM#7
linkmaster23
Here ya go... Have fun!
06-20-2004, 07:21 AM#8
Ordin
Wow, thanks a lot linkmaster23, I will implement your trigger right away :D

Edit: Got it working after giving each hero a variable on training to make it easier to identify them. Thanks for the trigger again linkmaster23, its much better than the one i came up with :D

Edit 2: Every spell seems to be working except for two, my ability based on Forked Lightning and Monsoon seem to be acting stranegly. If I cast Forked Lightning it displays two values, the Forked lightning one and another showing 15% increases. If I cast Monsoon it works normally adding 25% but then if i cast Forked Lightning it seems to also add onto Monsoon as well as itself. I've looked through the triggers and it looks as though they should be working fine, anyone know if its something to do with the two abilities thats affecting the trigger?

Edit 3: I replaced the Monsoon ability with another and now they do not seem to be affecting each other so I'm guessing it must be something to do with the abilities themselves. Can anyone confirm this?
06-20-2004, 01:32 PM#9
Ordin
Hmm I was also wondering if it is possible to add abilities to a specific units spell book instead of just giving the ability. There will likely be to many abilities for one hero alone and unless I can specifiy an ability to be put into a spell book my heros will be limited :(