HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Suicide Spell help

08-11-2006, 07:43 AM#1
WTFish
Im having some trouble creating a certain spell, and was hoping someone might be able to help me.

I am trying to create an ability that when cast will detonate the caster, damaging enemy units in an area around the caster equal to the casters life (before detonation ) divided by the number of enemies in that area,

while simultaneously healing allied units in the same way.

Also, I was wondering if anyone knew how to make this spell work so that more than one person can cast at the same time, or the same person can detonate multiple units.

Thanks.
08-11-2006, 08:46 AM#2
Rui
You mean, instantly kill the caster? Well, that can be done by using a variable to save the number of units in the area, and then ordering the unit to damage the area : the number of units.
08-11-2006, 10:44 AM#3
The)TideHunter(
I would help, but i have my own spell to make.
Once i'v made that i'll help you.
08-11-2006, 12:12 PM#4
Fireeye
I would make it with a dummy spell, your choice if targeted or non-targeted.
Store the life in a variable, then count the number of units within x Range to the Caster and add them to a temp Group
Afterwards you pick every unit in your temp Group and order the caster to damage the picked unit with (Health / Number of Units counted) if it's an enemy and to heal use the same formula with the set hp command.
P.S.: Sry, my comp crashed and i didn't install WC3 yet. So there could be some probs, i'll install WC3 in a few moments and look if it will work that way.
08-11-2006, 09:04 PM#5
WTFish
Thanks for all the replys. I havn't mapped wc3 in a while so I'm not sure exactly how to do what you said. If someone could give me the exact triggers to make, that would be greatly appreciated.
08-12-2006, 01:11 AM#6
darkwulfv
Kaboom? I dunno if thats targetting or not...
08-12-2006, 03:09 AM#7
Wyvernoid
Hello^^
Kaboom is targetable.
And... You can use a enemy-allowed Blizzard and a friend-allowed Healing Spray from aside.
08-12-2006, 11:14 PM#8
darkwulfv
hehe... didn't know... Haven't been using WC I've been camping... ^_^"
08-13-2006, 12:40 AM#9
WTFish
Umm... I'm trying to make the damage/heal be the health the caster had divided by the number of units in the area (as in my first post). I can make a spell that does blizzard and healing spray lol, but I'm not sure the exact triggers for the one I'm looking for.
08-19-2006, 10:59 PM#10
WTFish
Sorry to have to post again, but my problem is still not resolved, and everyone seems to have forgotten about it, lol . If someone could be kind enough to post the code in [trigger] tags, it would be greatly appreciated.

Ty.
08-20-2006, 12:10 AM#11
Ignitedstar
Oh well. I think a lot of people prefer you do it yourself.

So, you want to kill caster and in return, you want to hit all enemies within a certain area, dealing damage equal to the caster's HP divided by the number of enemies in the area?

Something like this?

Trigger:
AOE Death Spell
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to [Your Ability]
Collapse Actions
Set Caster = (Triggering unit)
Set Temp_Group = (Units within (Your Area) of (Position of Caster) matching (((Matching unit) belongs to an enemy of (Owner of Caster)) Equal to True))
Set SpellDamage = ((Integer((Life of Caster))) / (Number of units in Temp_Group))
Collapse Unit Group - Pick every unit in Temp_Group and do (Actions)
Collapse Loop - Actions
Unit - Cause Caster to damage (Picked unit), dealing (Real(SpellDamage)) damage of attack type Spells and damage type Normal
Special Effect - Create a special effect at (Position of Caster) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
-------- Special effect just there to make it look like the caster didn't die from nothing --------
Unit - Kill Caster
Custom script: set udg_Caster=null
Custom script: set udg_Temp_Group=null
Custom script: set udg_SpellDamage=null

I'm not sure if those Custom script parts are right(everyone tells me that putting all of the variables to null makes the trigger not leak memory), but I think this is what you were looking for.
08-20-2006, 12:24 AM#12
WTFish
Sweet, thanks for the reply. A few questions:

How could you make it so it heals the allies in the area in the same way it damages the enemies? Do Ijust duplicate the damage one and set the damage dealt to be ( -1 x (Spelldamage)) ?

Is that multi-instanceable?

Ty.
08-20-2006, 12:51 AM#13
Ignitedstar
Well, Multi-Instancability can only really be done why using local variables instead of global ones, or something like that. I've seen a lot of examples of how to do it, but it still doesn't make sense to me.

To do the healing thing, I think doing what you suggested is right. But, then you'll need to change the Temp_Group or make another group that- instead of counting the number of enemies in the area, it counts the number of allies in the area.

I'm not sure if you can use one group, then change it, and use it again in the same trigger(never did it before). Try it and see if it works.

Btw, for some strange reason when I was testing the AOE thing, it said that "set udg_SpellDamage=null" was unreadable? Integers can't be nulled? Or is there no need to?
08-20-2006, 01:16 AM#14
WTFish
I'm not at a computer where I can access warcraft at the moment, but hopefully using one group twice in a single trigger works, lol. I'm not too sure about multi-instancability and memory leaks etc, so when I can get access to warcraft, I'll just try it and see how it works.

BTW: It is possible to use local variables through custom script in GUI, or does the whole spell need to be done in JASS?

Thanks again.
08-20-2006, 01:25 AM#15
Ignitedstar
Nah. You call them by using the "Custom Script" that GUI has. The custom script IS JASS.