• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

DPS Spells

Status
Not open for further replies.
Level 6
Joined
Oct 26, 2005
Messages
190
Please if someone can help me with the triggering of two spells, both are similar but each one works different.

When activated, the 1st spell starts to drain the health of the allies, at the same time damaging nearby enemies by same amount. Non-channeling, Last 6 seconds and 500 AoE.

When activated, the 2nd spell starts to drain the health of the enemies, at the same time healing nearby allies by same amount. Non-channeling, Last 4 seconds and 500 AoE.

Also I like to do the Siphon Mana target animation for the 1st spell, and Life Drain for second spell.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Here's the good ol' GUI, not MUI way.

Note - Italics are notes.

Trigger 1
Events
A Unit Starts the Effect of an Ability
Conditions
Ability Being Cast = Add Your Ability Here
Actions
set Caster = Triggering Unit
set CurrentLifeDrained = 0.00
Turn on (trigger 2)
Wait Y Seconds
Turn off (trigger 2)
Custom Script: set bj_wantDestroyGroup = true
Unit Group - Pick every unit within Area of Effect of your Spell of Caster matching Add Filter Here and do actions
Loop - Actions
Unit - Cause Caster to damage Picked Unit for Damage, Using Attack Type Attack Type and Damage Type Damage Type
end of Unit Group
end of trigger

Trigger 2
Events
Every 1 second of game time
Conditions
none
Actions
For each integer A from 1 to 9999, do actions
Loop - Actions
Destroy SFXArray[indexCounter]
Custom Script: exitwhen udg_indexCounter == 0
set indexCounter = indexCounter - 1
end of For loop
Custom Script: set bj_wantDestroyGroup = true
Unit Group - Pick every unit within AOE Of Spell of Caster matching Add Filter Here and do actions
Loop - Actions
set CurrentLifeDrained = CurrentLifeDrained + Damage
Unit - cause Caster to damage Picked Unit for Damage damage, attack type Attack Type and damage type Damage Type
Create an effect attached to Picked Unit with model SFX Model, attached to attachment point Attachment
Set SFXArray[indexCounter] = Last Created Effect
end of Unit Group
end of trigger
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
hmm, maybe my exitwhen line is ebil. Try cleaning up the SFX (the For loop at the start of trigger 2) in a different manner.

If the game is still crashing, I'll have another look.

And arc, to heal allies, just change the line in Trigger 1 that says UnitDamageTarget to add to their life for the correct amount instead

PurplePoot are you sure this works? There are two 'exitwhen...' lines inside the loop.
Also indexCounter is 0 at the beginning...

Now i guess it probably DOESNT work :p

A) about indexCounter, that shouldnt matter as there will just be no SFX to destroy, so it will instantly exit

B) you should be able to have any number of exitwhen statements at once. They are basically the conditions of a loop
 
Status
Not open for further replies.
Top