HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Spell help

03-28-2009, 09:36 AM#1
wing87
Well im trying to create this simple spell.
Well what i want my spell to do is the following:
Summoner hero is given this spell, when thay cast as spell we check if this has been learned if it has we lock for summoned units around the caster and when found we give them x random passive abilities.

Now to my problem well my idear as to add a buff to those units that have been given random abilites and check if thay have this buff before i give them any abilities so i dont give them abilities more then one time...

But im feeling that a buff is not the right way of doing this is there any better way?

Tnx alot
03-28-2009, 06:05 PM#2
ShadowWolf
The first thing you need to work on is clarity of speech.

If I understand correctly, you want a spell to do the following:

event - hero casts spell a

condition - hero has spell b

events -
set temploc = position of casting unit
set tempunitgroup = pick units within x radius of temploc matching (matching unit is a summoned unit)
pick all units in tempunitgroup and do give picked unit randomspell[random number 1 - x]
customscript - call RemoveLocation(udg_temploc)
customscript - call DestroyGroup(udg_tempunitgroup)

Where randomspell is an arrayed variable of passive abilities, each element initialized to a different spell. Sorry for the sloppy code, I'm too lazy to open the WE right now. Also, did you want those abilities to be permanent, or temporary? The above leaves them on the unit and does not remove them.