need trigger fix

Status
Not open for further replies.
Level 18
Joined
May 11, 2012
Messages
2,103
It doesn't do damage and effect

  • Finger of Death
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Finger of Death
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • Set Damage[1] = 25000.00
          • Set Damage[1] = 50000.00
          • Set TempInteger = (Level of Finger of Death for (Triggering unit))
          • Set TempUnit = (Target unit of ability being cast)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (((Target unit of ability being cast) is A structure) Equal to True) and ((((Target unit of ability being cast) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and (((Target unit of ability being cast) is alive) Equal to True))
            • Then - Actions
              • Special Effect - Create a special effect attached to the head of (Target unit of ability being cast) using Abilities\Spells\Demon\DemonBoltImpact\DemonBoltImpact.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Cause (Triggering unit) to damage TempUnit, dealing Damage[TempInteger] damage of attack type Spells and damage type Normal
            • Else - Actions
        • Else - Actions
 
Level 8
Joined
Dec 30, 2011
Messages
134
Replace this
  • (((Target unit of ability being cast) is A structure) Equal to True) and ((((Target unit of ability being cast) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and (((Target unit of ability being cast) is alive) Equal to True))
With this
  • ((TempUnit is A structure) Equal to False) and (((TempUnit belongs to an enemy of (TriggerPlayer)) Equal to True) and ((TempUnit is alive) Equal to True))
NOTE: You can replace many functions with a variable, it's more effient:

Instead of:
(Target unit of ability being cast)
Use:
set TempUnit = (Target unif of ability being cast)

Your mistakes are too simple. Watch the trigger 2 or more times before make a thread about it..

I see another mistake:

Damage[1] = X
Damage[1] = Y???

Maybe you want this:

Damage[1] = X
Damage[2] = Y
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,243
If (All Conditions are True) then do (Then Actions) else do (Else Actions)

If - Conditions
Then - Actions
You have no condition for that flow control statement...

Set Damage[1] = 25000.00
Set Damage[1] = 50000.00
You also set the same memory location twice (pointless first set).

Not sure if it solves the problem but is an optimization problem.
 
Level 18
Joined
May 11, 2012
Messages
2,103
i have another question.

How to make trigger: attacked unit get buff medium building fire

when hero who has this spell attack enemy unit


  • Fire Sword
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Fire Sword
    • Actions
      • Special Effect - Create a special effect attached to the weapon of (Learning Hero) using Environment\LargeBuildingFire\LargeBuildingFire2.mdl
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
boolean unit condition- attacked unit has buff whichbuff equal to true, uts actually one of last unit boolean conditions on GUI
also you should do condition level of fire sword for triggerng unit = 1 because otherwise if it has like 5 levels and you level up 5 times you will have 5 effects attached to the unit :D

hope it helps and answers your question
 
Level 18
Joined
May 11, 2012
Messages
2,103
and will it deal damage to the attacked unit if I set action

  • Unit - Cause (Triggering unit) to damage (Attacked unit), dealing ((Real((Agility of (Triggering unit) (Include bonuses)))) / 2.00) damage of attack type Spells and damage type Normal
This trigger should work?

  • Fire Sword
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Fire Sword
    • Actions
      • Special Effect - Create a special effect attached to the weapon of (Learning Hero) using Environment\LargeBuildingFire\LargeBuildingFire2.mdl
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Attacked unit) has buff Building Damage - Human Large) Equal to True
          • (((Attacked unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and ((((Attacked unit) is A structure) Equal to False) and (((Attacked unit) is alive) Equal to True))
          • (Level of Fire Sword for (Triggering unit)) Equal to 1
        • Then - Actions
          • Special Effect - Create a special effect attached to the origin of (Attacked unit) using Environment\LargeBuildingFire\LargeBuildingFire1.mdl
          • Unit - Cause (Triggering unit) to damage (Attacked unit), dealing ((Real((Agility of (Triggering unit) (Include bonuses)))) / 2.00) damage of attack type Spells and damage type Normal
        • Else - Actions
          • Do nothing
 
Last edited:
Level 18
Joined
May 11, 2012
Messages
2,103
  • Fire Sword
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Fire Sword
    • Actions
      • Special Effect - Create a special effect attached to the weapon of (Learning Hero) using Environment\LargeBuildingFire\LargeBuildingFire2.mdl
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Attacked unit) has buff Building Damage - Human Large) Equal to True
          • (((Attacked unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and ((((Attacked unit) is A structure) Equal to False) and (((Attacked unit) is alive) Equal to True))
        • Then - Actions
          • Special Effect - Create a special effect attached to the origin of (Attacked unit) using Environment\LargeBuildingFire\LargeBuildingFire1.mdl
          • Unit - Cause (Triggering unit) to damage (Attacked unit), dealing ((Real((Level of Fire Sword for (Triggering unit)))) / 2.00) damage of attack type Spells and damage type Normal
        • Else - Actions
          • Do nothing
It still doesn't show the fire effect on unit and doesn't deal damage
 
Level 18
Joined
May 11, 2012
Messages
2,103
do I need to make 2 triggers for it to work?

because this still doesn't work

  • Fire Sword
    • Events
      • Unit - A unit Learns a skill
      • Unit - A unit Is attacked
    • Conditions
      • (Learned Hero Skill) Equal to Fire Sword
    • Actions
      • Special Effect - Create a special effect attached to the weapon of (Learning Hero) using Environment\LargeBuildingFire\LargeBuildingFire2.mdl
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Attacked unit) has buff Building Damage - Human Large) Equal to True
          • (((Attacked unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and ((((Attacked unit) is A structure) Equal to False) and (((Attacked unit) is alive) Equal to True))
        • Then - Actions
          • Special Effect - Create a special effect attached to the origin of (Attacked unit) using Environment\LargeBuildingFire\LargeBuildingFire1.mdl
          • Unit - Cause (Triggering unit) to damage (Attacked unit), dealing ((Real((Level of Fire Sword for (Triggering unit)))) / 2.00) damage of attack type Spells and damage type Normal
        • Else - Actions
          • Do nothing
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
yes, you need
  • Fire Sword
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Fire Sword
      • Level of Fire Sword for Triggering Unit is equal to 1(integer comparation)
      • The condition above is to prevent special effect leaking so when you lean the spell and you already have it it wont create another one on top of that
    • Actions
      • Special Effect - Create a special effect attached to the weapon of (Learning Hero) using Environment\LargeBuildingFire\LargeBuildingFire2.mdl
and another one is
  • Fire Sword Damage
  • Events
    • Unit - A unit is attacked
  • Condition
    • Level of Fire Sword for Attacking unit > 0(integer comparation)
    • Attacked unit has a buff Building Damage - Human Large Equal to true(boolean comparation)
  • Actions
    • Special Effect - Create a Special effect attached to the origin of (Attacked unit) using Environment\LargeBuildingFire\LargeBuildingFire1.mdl.
    • Special Effect - Destroy Last Created Special effect(to prevent leaks and fps drops)
    • Unit - Cause (Triggering unit) to damage (Attacked unit), dealing 50*((Real((Level of Fire Sword for (Triggering unit)))) / 2.00) damage of attack type Spells and damage type Normal
    • -----the formula is not good, it will deal 0.5 damage at level one :D so I added 50 times there-----
Hope this works, I wrote it from my head and didnt test it as I dont have time for that right now.
Remember that this is abusable if you order your unit to attack the unit with that buff and just spam stop it will destroy that unit because event Unit - Unit is attacked fires when you start the animation of attack.
For nonabusable version you would need damage detection system but this is not that bad if noone knows about it :) .
 
Level 18
Joined
May 11, 2012
Messages
2,103
  • Fire Sword
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Fire Sword
      • (Level of Fire Sword for (Triggering unit)) Equal to 1
    • Actions
      • Special Effect - Create a special effect attached to the weapon of (Learning Hero) using Environment\LargeBuildingFire\LargeBuildingFire2.mdl
  • Fire Sword damage
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of Fire Sword for (Attacking unit)) Equal to 0
      • ((Attacked unit) has buff Building Damage - Human Large) Equal to True
    • Actions
      • Special Effect - Create a special effect attached to the origin of (Attacked unit) using Environment\LargeBuildingFire\LargeBuildingFire1.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Cause (Triggering unit) to damage (Attacked unit), dealing ((Real((Agility of (Attacking unit) (Include bonuses)))) / 2.00) damage of attack type Spells and damage type Normal
IT STILL DOESN'T WORK :// WHY???
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
wait breaks MUI-ness of spell, it would work with one unit at a time.
Using arrays you could achieve MPI with little effort.
You would need some unit indexer or using hashtables to get it MUI with wait.
I'll try to create the trigger when I have time(today but now I'm busy with something :( )
 

nGy

nGy

Level 11
Joined
Apr 15, 2011
Messages
123
Although this will not fix the trigger, you might want to exchange Attacked unit with Triggering unit (as the triggering unit of an 'a unit is attacked' event always is the attacked unit) and Triggering unit with Attacking unit.

the effect and the trigger still doesn't work

Did you apply this change?
(Level of Fire Sword for (Attacking unit)) Equal to 0
should be greater than
 

nGy

nGy

Level 11
Joined
Apr 15, 2011
Messages
123
  • ((Attacked unit) has buff Building Damage - Human Large) Equal to True
I'm not sure, if you're aware that this line decides wether the following actions are executed or not. So if you don't apply the specified buff to any unit, this trigger will never run.
If I got you right, you want to add a buff to the attacked unit, that makes it visually burn. To achieve this, use a dummy unit that casts an ability.

Also, I saw you had a lot of different dummy unit types in your map. You can very easily avoid this by creating one dummy unit using some kind of dummy model and attaching a special effect to it.
 
Last edited:
Status
Not open for further replies.
Top