• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Spell] Spell Problem

Status
Not open for further replies.
Level 2
Joined
Mar 27, 2013
Messages
19
I made a skill that gives you a 15% chance each time you kill a unit, that summons an imp at the position of the dying unit. The imp's stats differ depending on the level of the skill. The problem is it does absolutely nothing.
  • Summon
    • Events
      • Unit - A unit Dies
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Unit-type of (Killing unit)) Equal to Colossal Legionnaire
    • Actions
      • Set Immoral_Corruption_CASTER = (Killing unit)
      • Set Immoral_Corruption_TARGET = (Dying unit)
      • Set Immoral_Corruption_LEVEL = (Level of Immoral Corruption for (Killing unit))
      • Set Immoral_Corruption_CHANCE = (Random integer number between 1 and 100)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Immoral_Corruption_CHANCE Equal to (Random integer number between 1 and 15)
          • Immoral_Corruption_LEVEL Equal to 1
        • Then - Actions
          • Unit - Create 1 Minion (Level 1) for (Owner of Immoral_Corruption_CASTER) at (Position of Immoral_Corruption_TARGET) facing Default building facing degrees
          • Set Immoral_Corruption_MINION = (Last created unit)
          • Special Effect - Create a special effect at (Position of Immoral_Corruption_TARGET) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
          • Wait 30.00 seconds
          • Special Effect - Create a special effect at (Position of Immoral_Corruption_TARGET) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
          • Unit - Remove Immoral_Corruption_MINION from the game
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Immoral_Corruption_CHANCE Equal to (Random integer number between 1 and 15)
          • Immoral_Corruption_LEVEL Equal to 2
        • Then - Actions
          • Unit - Create 1 Minion (Level 2) for (Owner of Immoral_Corruption_CASTER) at (Position of Immoral_Corruption_TARGET) facing Default building facing degrees
          • Set Immoral_Corruption_MINION = (Last created unit)
          • Special Effect - Create a special effect at (Position of Immoral_Corruption_TARGET) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
          • Wait 30.00 seconds
          • Special Effect - Create a special effect at (Position of Immoral_Corruption_TARGET) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
          • Unit - Remove Immoral_Corruption_MINION from the game
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Immoral_Corruption_CHANCE Equal to (Random integer number between 1 and 15)
          • Immoral_Corruption_LEVEL Equal to 3
        • Then - Actions
          • Unit - Create 1 Minion (Level 3) for (Owner of Immoral_Corruption_CASTER) at (Position of Immoral_Corruption_TARGET) facing Default building facing degrees
          • Set Immoral_Corruption_MINION = (Last created unit)
          • Special Effect - Create a special effect at (Position of Immoral_Corruption_TARGET) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
          • Wait 30.00 seconds
          • Special Effect - Create a special effect at (Position of Immoral_Corruption_TARGET) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
          • Unit - Remove Immoral_Corruption_MINION from the game
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Immoral_Corruption_CHANCE Equal to (Random integer number between 1 and 15)
          • Immoral_Corruption_LEVEL Equal to 4
        • Then - Actions
          • Unit - Create 1 Minion (Level 4) for (Owner of Immoral_Corruption_CASTER) at (Position of Immoral_Corruption_TARGET) facing Default building facing degrees
          • Set Immoral_Corruption_MINION = (Last created unit)
          • Special Effect - Create a special effect at (Position of Immoral_Corruption_TARGET) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
          • Wait 30.00 seconds
          • Special Effect - Create a special effect at (Position of Immoral_Corruption_TARGET) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
          • Unit - Remove Immoral_Corruption_MINION from the game
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Immoral_Corruption_CHANCE Equal to (Random integer number between 1 and 15)
          • Immoral_Corruption_LEVEL Equal to 5
        • Then - Actions
          • Unit - Create 1 Minion (Level 5) for (Owner of Immoral_Corruption_CASTER) at (Position of Immoral_Corruption_TARGET) facing Default building facing degrees
          • Set Immoral_Corruption_MINION = (Last created unit)
          • Special Effect - Create a special effect at (Position of Immoral_Corruption_TARGET) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
          • Wait 30.00 seconds
          • Special Effect - Create a special effect at (Position of Immoral_Corruption_TARGET) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
          • Unit - Remove Immoral_Corruption_MINION from the game
        • Else - Actions
 
Level 18
Joined
May 11, 2012
Messages
2,103
why and all conditions true? Remove that and place condition normally

15% change is this: Random number between 1 and 100 less than or equal to 15. Your problem is in "Equal to"m it will hardly be exact number

Also, you have leaks. Use tempPoint variable and set it as position of dying unit and then use that variable as point to cr8 minion and special effect. Spell is not MUI so if you cast it more than 1 in under 30 seconds, it will bug
 
Level 18
Joined
May 11, 2012
Messages
2,103
Thanks.. Can you show me the correct trigger?

Yes I can.
  • Summon
  • Events
    • Unit - A unit Dies
  • Conditions
    • (Unit-type of (Killing unit)) Equal to Colossal Legionnaire
  • Actions
    • Set Immoral_Corruption_CASTER = (Killing unit)
    • Set Immoral_Corruption_TARGET = (Dying unit)
    • Set TempPoint = (Position of (Dying Unit)) Set Immoral_Corruption_LEVEL = (Level of Immoral Corruption for (Killing unit))
    • Set Immoral_Corruption_CHANCE = (Random integer number between 1 and 100)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Immoral_Corruption_CHANCE Less Than or Equal to 15)
      • Immoral_Corruption_LEVEL Equal to 1
    • Then - Actions
      • Unit - Create 1 Minion (Level 1) for (Owner of Immoral_Corruption_CASTER) at (TempPoint) facing Default building facing degrees
      • Set Immoral_Corruption_MINION = (Last created unit)
      • Special Effect - Create a special effect at (TempPoint) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy Last Created Special Effect
      • Wait 30.00 seconds
      • Special Effect - Create a special effect at (TempPoint) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy Last Created Special Effect
        • Unit - Remove Immoral_Corruption_MINION from the game
      • Else - Actions
Call RemoveLocation(udg_TempPoint)
set udg_TempPoint = null
set udg_Set Immoral_Corruption_TARGET = null
set udg_Set Immoral_Corruption_CASTER = null

I would increase the cd of spell to 30 or more because of a wait. Or you can add 30 seconds Expiration Timer to that unit and remove wait and when Immoral_Corruption_MINION dies, again set temp point and cr8 special effect at temppoint in new trigger...
 
Level 2
Joined
Mar 27, 2013
Messages
19
Thanks.. now it works.. Is 'TempPoint' a Region Variable? I don't see how I can make it 'Position of Dying Unit'
 
Level 8
Joined
Apr 23, 2011
Messages
322
You should also use "Expiration timer" instead of "Wait" if you want your minion to last for 30 sec.
trigger (WE dead, can't write in triggers):

Unit - Create 1 Minion (Level 1) for (Owner of Immoral_Corruption_CASTER) at (TempPoint) facing Default building facing degrees

Set Immoral_Corruption_MINION = (Last created unit)

*set expiration timer for Immoral_Corruption_MINION to 30 sec*(something like that)

+1 trigger:

event-Unit dies

condition-dying unit equal to imm.corr. MINION

actions- Set TempPoint = (Position of (Dying Unit))

Special Effect - Create a special effect at (TempPoint) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl

Special Effect - Destroy Last Created Special Effect

Call RemoveLocation(udg_TempPoint)
 
Level 18
Joined
May 11, 2012
Messages
2,103
You should also use "Expiration timer" instead of "Wait" if you want your minion to last for 30 sec.
trigger (WE dead, can't write in triggers):

Unit - Create 1 Minion (Level 1) for (Owner of Immoral_Corruption_CASTER) at (TempPoint) facing Default building facing degrees

Set Immoral_Corruption_MINION = (Last created unit)

*set expiration timer for Immoral_Corruption_MINION to 30 sec*(something like that)

+1 trigger:

event-Unit dies

condition-dying unit equal to imm.corr. MINION

actions- Set TempPoint = (Position of (Dying Unit))

Special Effect - Create a special effect at (TempPoint) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl

Special Effect - Destroy Last Created Special Effect

Call RemoveLocation(udg_TempPoint)

That's exactly what I said....
 
This will make it multi-unit instancable:
  • Summon
  • Events
    • Unit - A unit Dies
  • Conditions
    • (Unit-type of (Killing unit)) Equal to Colossal Legionnaire
  • Actions
    • Custom script: local unit udg_Immoral_Corruption_CASTER = GetKillingUnit()
    • Custom script: local unit udg_Immoral_Corruption_TARGET = GetTriggerUnit()
    • Custom script: local unit udg_Immoral_Corruption_MINION
    • Custom script: local location udg_TempPoint
    • Set TempPoint = (Position of (Dying Unit)) Set Immoral_Corruption_LEVEL = (Level of Immoral Corruption for (Killing unit))
    • Set Immoral_Corruption_CHANCE = (Random integer number between 1 and 100)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Immoral_Corruption_CHANCE Less Than or Equal to 15)
      • Immoral_Corruption_LEVEL Equal to 1
    • Then - Actions
      • Unit - Create 1 Minion (Level 1) for (Owner of Immoral_Corruption_CASTER) at (TempPoint) facing Default building facing degrees
      • Set Immoral_Corruption_MINION = (Last created unit)
      • Special Effect - Create a special effect at (TempPoint) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy Last Created Special Effect
      • Wait 30.00 seconds
      • Special Effect - Create a special effect at (TempPoint) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy Last Created Special Effect
      • Unit - Remove Immoral_Corruption_MINION from the game
      • Else - Actions
    • Custom script: Call RemoveLocation(udg_TempPoint)
    • Custom script: set udg_TempPoint = null
    • Custom script: set udg_Set Immoral_Corruption_TARGET = null
    • Custom script: set udg_Set Immoral_Corruption_CASTER = null
    • Custom script: set udg_Set Immoral_Corruption_MINION = null
 
The only thing u should watch out for when using waits is when the waiting for player dialog box comes up in a multiplayer game the wait continues to count down.
So lets say me and u are playing a game. I lose Internet for 30 seconds right after the summon starts. If I lose connection for over 30 seconds then when I gain connection back ur summon would of ended and done nothing.
 
Status
Not open for further replies.
Top