WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Developer's Corner > Triggers & Scripts
User Name
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar

Thread Tools Search this Thread
Old 12-22-2011, 02:34 AM   #1
Join Date: Dec 2011
Posts: 1

Exoudar has little to show at this moment (0)

Default How to make my spells also burn mana

Hello there,

I am trying to make a tower that has a special; enemy units who got hit by its spells also burn 1 point of mana.

I tried
Spell burns mana
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Chain Lightning (Spell Tower)
Collapse Actions
Unit - Set mana of (Target unit of ability being cast) to ((Mana of (Target unit of ability being cast)) - 1.00)

However it only burn mana from the first target.

It doesnt need to be something like chain mana burn, just any spell , breath of fire for example but any enemy unit who got hit will lose 1 mana.

Any help ?
Exoudar is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 01-03-2012, 09:53 AM   #2
Procrastination Incarnate

Development Director
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner


There is no simple way of doing this since there is no direct way to detect other targets that are hit by an area or chain spell. I can think of two ways this could be done indirectly:
  • Detect the damage dealt by the spell. This way, you can detect every target that gets hit rather than just the first. Since there is no generic unit takes damage event, you will need a damage detection system that simulates such a generic event by using a specific unit event for each unit.
    You will also need a way to tell if the damage was caused by your spell or something else. You could add the caster of the spell to a unit group when the spell is cast and remove him from that group after a short interval, that way when you detect damage you can check if the damage source is in your group, if it is then the damage was dealt by your spell.
    If you do this, you have to make sure that the time interval is long enough for the spell to damage all its targets, but short enough that the caster is not able to deal additional damage in that time with attacks or other spells.
  • Perhaps a better method would be to trigger your spell entirely. Instead of relying on an ingame chain spell, write a trigger that simulates it, same for line and area spells. If you have some experience, triggering such spells isn't really that hard and the end result is much more robust than the one you get with the method suggested above.
Anitarf is offline   Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT. The time now is 04:31 AM.

The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services