HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Stat based spells

11-03-2005, 11:36 PM#1
Mystic Prophet
sorry if this has been asked before but the search function doesn't seem to be working.

I know how to make single target spells do damage based on a hero's stats, but I'm trying to figure out how to do it for area spells like shockwave and starfall, and also for more complex spells like immolation and hardened skin.

I'd prefer it to be in GUI format but if some need jass to do then I can attempt to work with that as well.
11-05-2005, 04:45 AM#2
Psyny
Hi,

Ive tryed to do it before... Its not hard, but will give u some work.

Ive failed to find a function to detect what units has been damaged by an AOE ability.

To solve this problem u will need to create your own AOE effecting tigger. For exemple:

Zorg is a hero that have the Explosion ability.

Explosion:
Level: 1
Damage: 2x Zorg's INT
AOE: 300

Level: 2
Damage: 4x Zorg's INT
AOE: 400

Level: 3
Damage: 6x Zorg's INT
AOE: 500

1 - U will need to create a spell thats not does damage... But have all the caracteriscs of the real spell ( Area, Mana Cost, Cooldown, all ) and do only the hard work via tigger.

2 - Make an Tigger Event that Detects when a unit casts the Explosion spell.

3 - Here stars the work, u will need to create an "For Each" event that picks all units in an area matching the unit condintion: Enemy, Not Invulnerable, and anything that thes spells affects or not.

4 - Inside the For Each Event create an event thats does X damage to the picked unit.

Ps.: Try to make the ability data "Math Friendly" to help u to create functions... In this case, in the "Picks all units in area X" this X will need to be 300 for level 1, 400 for level 2 and 500 for level 3.
U can simple make this X = 200 + 100 * Spell Level.
This avoid the creation of one event for each spell level. Its the reason to create a logical data for the spells... The same goes to damage, that will be in this case Zorgs INT * Spell Level * 2.

And finally, its easy for spells that the area is a circle, but to spells like the Shock Wave and Carrion Swarm u will need to discover a formula to calculate the area of effect... And spells like Chain Lightng i dnt even know how to detect the targets.

If u canot understand my english, plz feel free to post where u cannot understand :)

Bye, hope thats helps.
11-07-2005, 01:25 AM#3
Mystic Prophet
thanks. I think I can manage immolation by making a continuous trigger (don't know how much that might lag the game?) but i'll still need to find a way to do hardened skin and other defensive spells.

And how do you detect the level of a spell, I wasn't able tofind that.
11-07-2005, 05:44 AM#4
Ignitedstar
Conditions:
Integer - (Level of [Ability] for (Triggering unit)) Equal to [#]

Does that help?
11-07-2005, 05:33 PM#5
Mystic Prophet
that should work. thanks for your help.
Hmm I think I might need to make a dummy unit for shockwave. man this is going to require a lot of testing.