spell have leak?

velnias

New Member
Reaction score
13
i have made spell. here the triggers:

Code:
fire
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Fire 
    Actions
        [U]Set triggeringunit = (Triggering unit)[/U]
        Unit Group - Add (Target unit of ability being cast) to fireg
        Special Effect - Create a special effect attached to the origin of (Target unit of ability being cast) using Abilities\Weapons\RedDragonBreath\RedDragonMissile.mdl
        Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Mana of (Triggering unit)) damage of attack type Spells and damage type Fire
        Special Effect - Destroy (Last created special effect)

Code:
magecheck
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in fireg and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) has buff Fire ) Equal to True
                    Then - Actions
                        Unit - Cause [U]triggeringunit[/U] to damage (Picked unit), dealing ((Mana of [U]triggeringunit[/U]) / 20.00) damage of attack type Spells and damage type Fire
                    Else - Actions
                        Unit Group - Remove (Picked unit) from fireg

i want to ask. if this spell would be used by two or more players, spell would work correctly?
 

Squishy

You can change this now in User CP.
Reaction score
127
It would all work correctly, but units will end up taking damage from the wrong unit if the spell is cast twice. Also, in the second trigger, you need to pick every unit before you can check if they have the buff.
 

velnias

New Member
Reaction score
13
it work for 1 player correctly now

EDIT: oh sry i deleted a bit lines from this trigger and for accident i have deleted pick from unit group
EDIT: how can i fix this problem:
"units will end up taking damage from the wrong unit if the spell is cast twice"fix
 

Squishy

You can change this now in User CP.
Reaction score
127
You could make a unit array, and make each unit's custom value different. Then, when units are added into your group, do something like this:
Code:
Set Unit_Array_Variable[(Custom value of (Target unit of ability being cast))] = (Triggering unit)
Then use the variable array and the custom value again when dealing damage.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top