• 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.

[Trigger] fix so my spell wont cast on Magic immune heroes

Status
Not open for further replies.
Level 3
Joined
Jul 27, 2010
Messages
35
hi, im making a spell that is able to control other heroes and units, using
"mind control systems by redscores V1.01"

Question: How do i disable so that my spell wont be able to be casted on a magic immune heroes?

  • custom spell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Possess unit
    • Actions
      • If (((Targeted unit) is Magic Immune) Equal to True) then do (Skip remaining actions) else do (Do nothing)
      • -------- Sets the unit which possesses the target unit on his side. --------
      • Set MCS_Caster1 = (Triggering unit)
      • -------- Sets the target of the mind control. --------
      • Set MCS_Target1 = (Target unit of ability being cast)
      • -------- Sets the duration of the mind control --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Possess unit for (Casting unit)) Equal to 1
        • Then - Actions
          • If (((Targeted unit) is Magic Immune) Equal to True) then do (Skip remaining actions) else do (Do nothing)
          • Set MCS_Duration1 = 1.00
          • -------- Sets the string of a special effect which is shown at the end of the mind control. --------
          • Set MCS_SfxAtEndString = Abilities\Spells\Orc\AncestralSpirit\AncestralSpiritCaster.mdl
          • -------- Sets the string of a special effect which is shown at the start of the mind control. --------
          • Set MCS_SfxAtStartString = Abilities\Spells\Items\AIre\AIreTarget.mdl
          • -------- Sets the string of a special effect which is shown at MCS_AttachmentPoint1 for the whole mind control time. --------
          • Set MCS_SfxContinous1String = Abilities\Weapons\IllidanMissile\IllidanMissile.mdl
          • -------- Sets the string of a special effect which is shown at MCS_AttachmentPoint2 for the whole mind control time. --------
          • Set MCS_SfxContinous2String = Abilities\Weapons\IllidanMissile\IllidanMissile.mdl
          • -------- Sets the attachment point for the MCS_SfxContinous1 SFX. --------
          • Set MCS_AttachmentPoint1 = hand, left
          • -------- Sets the attachment point for the MCS_SfxContinous2 SFX. --------
          • Set MCS_AttachmentPoint2 = hand, right
          • -------- The function below is always recommended. --------
          • Trigger - Run PossessAUnit <gen> (checking conditions)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Possess unit for (Casting unit)) Equal to 2
        • Then - Actions
          • If (((Targeted unit) is Magic Immune) Equal to True) then do (Skip remaining actions) else do (Do nothing)
          • Set MCS_Duration1 = 5.00
          • -------- Sets the string of a special effect which is shown at the end of the mind control. --------
          • Set MCS_SfxAtEndString = Abilities\Spells\Orc\AncestralSpirit\AncestralSpiritCaster.mdl
          • -------- Sets the string of a special effect which is shown at the start of the mind control. --------
          • Set MCS_SfxAtStartString = Abilities\Spells\Items\AIre\AIreTarget.mdl
          • -------- Sets the string of a special effect which is shown at MCS_AttachmentPoint1 for the whole mind control time. --------
          • Set MCS_SfxContinous1String = Abilities\Weapons\IllidanMissile\IllidanMissile.mdl
          • -------- Sets the string of a special effect which is shown at MCS_AttachmentPoint2 for the whole mind control time. --------
          • Set MCS_SfxContinous2String = Abilities\Weapons\IllidanMissile\IllidanMissile.mdl
          • -------- Sets the attachment point for the MCS_SfxContinous1 SFX. --------
          • Set MCS_AttachmentPoint1 = hand, left
          • -------- Sets the attachment point for the MCS_SfxContinous2 SFX. --------
          • Set MCS_AttachmentPoint2 = hand, right
          • -------- The function below is always recommended. --------
          • Trigger - Run PossessAUnit <gen> (checking conditions)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Possess unit for (Casting unit)) Equal to 3
        • Then - Actions
          • If (((Targeted unit) is Magic Immune) Equal to True) then do (Skip remaining actions) else do (Do nothing)
          • Set MCS_Duration1 = 15.00
          • -------- Sets the string of a special effect which is shown at the end of the mind control. --------
          • Set MCS_SfxAtEndString = Abilities\Spells\Orc\AncestralSpirit\AncestralSpiritCaster.mdl
          • -------- Sets the string of a special effect which is shown at the start of the mind control. --------
          • Set MCS_SfxAtStartString = Abilities\Spells\Items\AIre\AIreTarget.mdl
          • -------- Sets the string of a special effect which is shown at MCS_AttachmentPoint1 for the whole mind control time. --------
          • Set MCS_SfxContinous1String = Abilities\Weapons\IllidanMissile\IllidanMissile.mdl
          • -------- Sets the string of a special effect which is shown at MCS_AttachmentPoint2 for the whole mind control time. --------
          • Set MCS_SfxContinous2String = Abilities\Weapons\IllidanMissile\IllidanMissile.mdl
          • -------- Sets the attachment point for the MCS_SfxContinous1 SFX. --------
          • Set MCS_AttachmentPoint1 = hand, left
          • -------- Sets the attachment point for the MCS_SfxContinous2 SFX. --------
          • Set MCS_AttachmentPoint2 = hand, right
          • -------- The function below is always recommended. --------
          • Trigger - Run PossessAUnit <gen> (checking conditions)
        • Else - Actions
          • Do nothing
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
You need another trigger which fires when unit begins casting an ability (this trigger will fire before mana is consumed, before cooldown starts, before spell takes effect)
  • Untitled Trigger 001
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Your_Spell
      • ((Target unit of ability being cast) is Magic Immune) Equal to True
      • - and maybe the condition below -
      • ((Target unit of ability being cast) is A Hero) Equal to True
    • Actions
      • Set u = (Triggering unit)
      • Unit - Pause u
      • Unit - Order u to Stop
      • Unit - Unpause u
      • Set u = No unit
      • -------- You can add your custom error message here --------
"u" is a unit variable. You can do this without unit variable, but it may not be as effective.

At the conditions, you wrote you want it to ignore magic-immune heroes. Without the 3rd condition, you will be unable to cast it on even normal units that have magic immunity. So if you want only magic-immune heroes to be untargetable by this spell, then have the 3rd condition there as well. If you want all magic immune targets to be untargetable by this, delete the 3rd condition.


Edit: I belive it can be also done via order events and it may even look better than the trigger I posted.
 

Wrda

Spell Reviewer
Level 28
Joined
Nov 18, 2012
Messages
1,993
  • -------- Sets the string of a special effect which is shown at the end of the mind control. --------
  • Set MCS_SfxAtEndString = Abilities\Spells\Orc\AncestralSpirit\AncestralSpiritCaster.mdl
  • -------- Sets the string of a special effect which is shown at the start of the mind control. --------
  • Set MCS_SfxAtStartString = Abilities\Spells\Items\AIre\AIreTarget.mdl
  • -------- Sets the string of a special effect which is shown at MCS_AttachmentPoint1 for the whole mind control time. --------
  • Set MCS_SfxContinous1String = Abilities\Weapons\IllidanMissile\IllidanMissile.mdl
  • -------- Sets the string of a special effect which is shown at MCS_AttachmentPoint2 for the whole mind control time. --------
  • Set MCS_SfxContinous2String = Abilities\Weapons\IllidanMissile\IllidanMissile.mdl
  • -------- Sets the attachment point for the MCS_SfxContinous1 SFX. --------
  • Set MCS_AttachmentPoint1 = hand, left
  • -------- Sets the attachment point for the MCS_SfxContinous2 SFX. --------
  • Set MCS_AttachmentPoint2 = hand, right
  • -------- The function below is always recommended. --------
This SHOULDN'T be in the if block, you put before the first if block.
And this:
  • Trigger - Run PossessAUnit <gen> (checking conditions)
put at the end of the trigger and delete the ones in the if block, also the Do Nothing actions.
 
never use the do nothing action. it is useless. it slows ur triggers and makes them inefficient.

dont use casting unit / dying unit / entering unit use triggering unit instead of all of these.

in ur ITEs i believe u need to use target unit of ability being cast.
change the targeted unit to the variable that u set as target unit of ability being cast. change the triggering unit at the top to the variable that u set below it. So u have to move the variable above the first ITE

ITE is if then else.

Also check out my tutorial things a guier should know it will help u a lot with triggering
 
Level 3
Joined
Jul 27, 2010
Messages
35
Thx for help guys! i will sure check out your tutorial, i got alot to learn :p
my spell is based of a spell template from the spell pack "mind control systems by redscores V1.01"


cleaned some stuff up and its now look like this:

  • Mind Control
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Possess unit
    • Actions
      • -------- Sets the unit which possesses the target unit on his side. --------
      • Set MCS_Caster1 = (Triggering unit)
      • -------- Sets the target of the mind control. --------
      • Set MCS_Target1 = (Target unit of ability being cast)
      • -------- Sets the duration of the mind control --------
      • -------- Sets the string of a special effect which is shown at the end of the mind control. --------
      • Set MCS_SfxAtEndString = Abilities\Spells\Orc\AncestralSpirit\AncestralSpiritCaster.mdl
      • -------- Sets the string of a special effect which is shown at the start of the mind control. --------
      • Set MCS_SfxAtStartString = Abilities\Spells\Items\AIre\AIreTarget.mdl
      • -------- Sets the string of a special effect which is shown at MCS_AttachmentPoint1 for the whole mind control time. --------
      • Set MCS_SfxContinous1String = Abilities\Weapons\IllidanMissile\IllidanMissile.mdl
      • -------- Sets the string of a special effect which is shown at MCS_AttachmentPoint2 for the whole mind control time. --------
      • Set MCS_SfxContinous2String = Abilities\Weapons\IllidanMissile\IllidanMissile.mdl
      • -------- Sets the attachment point for the MCS_SfxContinous1 SFX. --------
      • Set MCS_AttachmentPoint1 = hand, left
      • -------- Sets the attachment point for the MCS_SfxContinous2 SFX. --------
      • Set MCS_AttachmentPoint2 = hand, right
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Possess unit for (Casting unit)) Equal to 1
        • Then - Actions
          • -------- Set the mindcontrol duration at rank 1 --------
          • Set MCS_Duration1 = 1.00
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Possess unit for (Casting unit)) Equal to 2
        • Then - Actions
          • -------- Set the mindcontrol duration at rank 2 --------
          • Set MCS_Duration1 = 5.00
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Possess unit for (Casting unit)) Equal to 3
        • Then - Actions
          • -------- Set the mindcontrol duration at rank 3 --------
          • Set MCS_Duration1 = 15.00
          • -------- The function below is always recommended. --------
          • Trigger - Run PossessAUnit <gen> (checking conditions)
        • Else - Actions


And the effect spell:

  • Mind Control Effect
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Possess unit
      • ((Target unit of ability being cast) is Magic Immune) Equal to True
    • Actions
      • Set MindControlUnit = (Triggering unit)
      • Unit - Pause MindControlUnit
      • Unit - Order MindControlUnit to Stop
      • Unit - Unpause MindControlUnit
      • Set MindControlUnit = No unit
      • -------- --------------------Error Message------------------------- --------
      • Set MindControlFloatingText = (Last created floating text)
      • Floating Text - Create floating text that reads That target is immu... above (Target unit of ability being cast) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Set the velocity of MindControlFloatingText to 64.00 towards 90.00 degrees
      • Floating Text - Change MindControlFloatingText: Disable permanence
      • Floating Text - Change the lifespan of MindControlFloatingText to 5.00 seconds
      • Floating Text - Change the fading age of MindControlFloatingText to 1.00 seconds
 
Last edited:

Wrda

Spell Reviewer
Level 28
Joined
Nov 18, 2012
Messages
1,993
  • Mind Control
  • Events
  • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Possess unit
  • Actions
    • -------- Sets the unit which possesses the target unit on his side. --------
    • Set MCS_Caster1 = (Triggering unit)
    • -------- Sets the target of the mind control. --------
    • Set MCS_Target1 = (Target unit of ability being cast)
    • Conditions
      • (Ability being cast) Equal to Possess unit
      • (MCS_Target1 is Magic Immune) Equal to True
    • Then - Actions
      • // Your message here. just make a custom script like this: call DisplayTextToPlayer(GetTriggerPlayer(),0,0, "Your Message") //Replace [Your message] with what you want.
    • Else - Actions
      • -------- Sets the string of a special effect which is shown at the end of the mind control. --------
      • Set MCS_SfxAtEndString = Abilities\Spells\Orc\AncestralSpirit\AncestralSpiritCaster.mdl
      • -------- Sets the string of a special effect which is shown at the start of the mind control. --------
      • Set MCS_SfxAtStartString = Abilities\Spells\Items\AIre\AIreTarget.mdl
      • -------- Sets the string of a special effect which is shown at MCS_AttachmentPoint1 for the whole mind control time. --------
      • Set MCS_SfxContinous1String = Abilities\Weapons\IllidanMissile\IllidanMissile.mdl
      • -------- Sets the string of a special effect which is shown at MCS_AttachmentPoint2 for the whole mind control time. --------
      • Set MCS_SfxContinous2String = Abilities\Weapons\IllidanMissile\IllidanMissile.mdl
      • -------- Sets the attachment point for the MCS_SfxContinous1 SFX. --------
      • Set MCS_AttachmentPoint1 = hand, left
      • -------- Sets the attachment point for the MCS_SfxContinous2 SFX. --------
      • Set MCS_AttachmentPoint2 = hand, right
      • -------- Sets the duration of the mind control --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Level of Possess unit for MCS_Caster1) Equal to 1
        • Then - Actions
          • -------- Set the mindcontrol duration at rank 1 --------
          • Set MCS_Duration1 = 1.00
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Level of Possess unit for MCS_Caster1) Equal to 2
            • Then - Actions
              • -------- Set the mindcontrol duration at rank 2 --------
              • Set MCS_Duration1 = 5.00
              • Else - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Possess unit for MCS_Caster1) Equal to 3
                    • Then - Actions
                      • -------- Set the mindcontrol duration at rank 3 --------
                      • Set MCS_Duration1 = 15.00
                      • -------- The function below is always recommended. --------
                • Else - Actions
  • Trigger - Run PossessAUnit <gen> (checking conditions)
Your trigger should be like this.
 
Last edited:
Level 28
Joined
Sep 26, 2009
Messages
2,520
Also, that does not stop the caster from wasting the cast on immunes.
It does, since the "A unit Begins casting an ability" event fires before mana is consumed, before cd starts and before spell takes effect. If you stop unit in the "begin casting" process, he won't waste cast.

The only downside of this, when compared to the "issued order" event I mentioned before, is that with the "begin casting" event casting unit will run towards the target and begin casting the spell, then it stops, while if you do it via "issued order", that unit will not even run towards the target.
 
Level 3
Joined
Jul 27, 2010
Messages
35
Hello, this is how far i've come so far!

let me explain a little :p


The main goal of the spell:

The spell has 3 ranks, each level the duration is changed, if the target of the spell is a unit, the spells duration is longer, if the target is a hero, the spell will be shorther.

The caster is able to use the spell on both units and on enemy heroes. But he will not be able to drop items, use items or cast the ,second, third or the ultimate abilities on the targeted hero. If the target hero or unit is magic immune, a error message will pop up and nothing will happend.

So what happends when he use it, he can move the hero, at rank 1, he can use the first spell on the target hero, like the Blademasters "windwalk"

At rank 2, only the duration is changed.

At rank 3, he can use the second spell on the enemy hero.
example, the Blademasters "Mirror image"

So what the first trigger does is:

If casted on a unit which is not a hero, the duration will be:

Rank 1 - 15.00 Seconds.
Rank 2 - 20.00 Seconds.
Rank 3 - 25.00 Seconds.


Status:

This trigger is completed and work like intented.
  • MindControl Unit
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Possess unit
    • Actions
      • -------- Sets the unit which possesses the target unit on his side. --------
      • Set MCS_Caster1 = (Triggering unit)
      • -------- Sets the target of the mind control. --------
      • Set MCS_Target1 = (Target unit of ability being cast)
      • -------- Sets the string of a special effect which is shown at the end of the mind control. --------
      • Set MCS_SfxAtEndString = Abilities\Spells\Orc\AncestralSpirit\AncestralSpiritCaster.mdl
      • -------- Sets the string of a special effect which is shown at the start of the mind control. --------
      • Set MCS_SfxAtStartString = Abilities\Spells\Items\AIre\AIreTarget.mdl
      • -------- Sets the string of a special effect which is shown at MCS_AttachmentPoint1 for the whole mind control time. --------
      • Set MCS_SfxContinous1String = Abilities\Weapons\IllidanMissile\IllidanMissile.mdl
      • -------- Sets the string of a special effect which is shown at MCS_AttachmentPoint2 for the whole mind control time. --------
      • Set MCS_SfxContinous2String = Abilities\Weapons\IllidanMissile\IllidanMissile.mdl
      • -------- Sets the attachment point for the MCS_SfxContinous1 SFX. --------
      • Set MCS_AttachmentPoint1 = hand, left
      • -------- Sets the attachment point for the MCS_SfxContinous2 SFX. --------
      • Set MCS_AttachmentPoint2 = hand, right
      • -------- -------- Sets the duration of mind control ------- --------
      • -------- ----------Spell Rank 1------------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Possess unit for MCS_Caster1) Equal to 1
        • Then - Actions
          • -------- Set the mindcontrol duration at rank 1 --------
          • Set MCS_Duration1 = 15.00
        • Else - Actions
      • -------- ----------Spell Rank 2------------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Possess unit for MCS_Caster1) Equal to 2
        • Then - Actions
          • -------- Set the mindcontrol duration at rank 2 --------
          • Set MCS_Duration1 = 20.00
        • Else - Actions
      • -------- ----------Spell Rank 3------------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Possess unit for MCS_Caster1) Equal to 3
        • Then - Actions
          • -------- Set the mindcontrol duration at rank 3 --------
          • Set MCS_Duration1 = 25.00
        • Else - Actions
      • -------- The function below is always recommended. --------
      • Trigger - Run PossessAUnit <gen> (checking conditions)
If the target is in fact a hero, the duration will be:

Rank 1 - 6.00 Seconds.
Rank 2 - 8.00 Seconds.
Rank 3 - 12.00 Seconds.

Status:

When i test this one, the caster wont do anything.
  • MindControl Hero
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (MCS_Target1 is A Hero) Equal to True
      • (Ability being cast) Equal to Possess unit
    • Actions
      • Trigger - Turn off MindControl Unit <gen>
      • -------- Sets the unit which possesses the target unit on his side. --------
      • Set MCS_Caster1 = (Triggering unit)
      • -------- Sets the target of the mind control. --------
      • Set MCS_Target1 = (Target unit of ability being cast)
      • -------- Sets the string of a special effect which is shown at the end of the mind control. --------
      • Set MCS_SfxAtEndString = Abilities\Spells\Orc\AncestralSpirit\AncestralSpiritCaster.mdl
      • -------- Sets the string of a special effect which is shown at the start of the mind control. --------
      • Set MCS_SfxAtStartString = Abilities\Spells\Items\AIre\AIreTarget.mdl
      • -------- Sets the string of a special effect which is shown at MCS_AttachmentPoint1 for the whole mind control time. --------
      • Set MCS_SfxContinous1String = Abilities\Weapons\IllidanMissile\IllidanMissile.mdl
      • -------- Sets the string of a special effect which is shown at MCS_AttachmentPoint2 for the whole mind control time. --------
      • Set MCS_SfxContinous2String = Abilities\Weapons\IllidanMissile\IllidanMissile.mdl
      • -------- Sets the attachment point for the MCS_SfxContinous1 SFX. --------
      • Set MCS_AttachmentPoint1 = hand, left
      • -------- Sets the attachment point for the MCS_SfxContinous2 SFX. --------
      • Set MCS_AttachmentPoint2 = hand, right
      • -------- -------- Sets the duration of mind control ------- --------
      • -------- ----------Spell Rank 1------------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Possess unit for MCS_Caster1) Equal to 1
        • Then - Actions
          • -------- Set the mindcontrol duration at rank 1 --------
          • Set MCS_Duration1 = 6.00
        • Else - Actions
      • -------- ----------Spell Rank 2------------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Possess unit for MCS_Caster1) Equal to 2
        • Then - Actions
          • -------- Set the mindcontrol duration at rank 2 --------
          • Set MCS_Duration1 = 8.00
        • Else - Actions
      • -------- ----------Spell Rank 3------------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Possess unit for MCS_Caster1) Equal to 3
        • Then - Actions
          • -------- Set the mindcontrol duration at rank 3 --------
          • Set MCS_Duration1 = 12.00
        • Else - Actions
      • -------- The function below is always recommended. --------
      • Trigger - Run PossessAUnit <gen> (checking conditions)
This trigger restricts so the spell have no effect and cant be casted on magic immune heroes or units. It will also display a error message.

Status:

Trigger is completed and is functioning as intented.

  • Mind Control Restrict immune
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Possess unit
      • (MCS_Target1 is Magic Immune) Equal to True
    • Actions
      • Set MCS_Target1 = (Target unit of ability being cast)
      • Set MCS_Caster1 = (Triggering unit)
      • Unit - Pause MCS_Caster1
      • Unit - Order MCS_Caster1 to Stop
      • Unit - Unpause MCS_Caster1
      • Set MCS_Caster1 = No unit
      • Custom script: call DisplayTextToPlayer(GetTriggerPlayer(),0,0, "That target is magic immune")
      • Trigger - Run PossessAUnit <gen> (checking conditions)
This is a try to make the target unit unable to drop any items while
the spell is active.

Status:

Im quite sure its working, if i set the same duration as the effect will last,and use the spell on a hero and while i have disabled the "Mindcontrol Hero" and the "Mindcontrol restrict item hero" triggers, i cant drop any items.
but i have only tested it on a hero and not on a unit. (its probaly no diffrent but who nows).

  • Mind Control Restrict item Unit
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Possess unit
    • Actions
      • Set MCS_Target1 = (Target unit of ability being cast)
      • Set MCS_Caster1 = (Triggering unit)
      • -------- ----------Spell Rank 1------------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Possess unit for MCS_Caster1) Equal to 1
        • Then - Actions
          • Item - Make (Item carried by MCS_Target1 in slot 1) Undroppable
          • Item - Make (Item carried by MCS_Target1 in slot 2) Undroppable
          • Item - Make (Item carried by MCS_Target1 in slot 3) Undroppable
          • Item - Make (Item carried by MCS_Target1 in slot 4) Undroppable
          • Item - Make (Item carried by MCS_Target1 in slot 5) Undroppable
          • Item - Make (Item carried by MCS_Target1 in slot 6) Undroppable
          • Wait 15.00 seconds
          • Item - Make (Item carried by MCS_Target1 in slot 1) Droppable
          • Item - Make (Item carried by MCS_Target1 in slot 2) Droppable
          • Item - Make (Item carried by MCS_Target1 in slot 3) Droppable
          • Item - Make (Item carried by MCS_Target1 in slot 4) Droppable
          • Item - Make (Item carried by MCS_Target1 in slot 5) Droppable
          • Item - Make (Item carried by MCS_Target1 in slot 6) Droppable
        • Else - Actions
      • -------- ----------Spell Rank 2------------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Possess unit for MCS_Caster1) Equal to 2
        • Then - Actions
          • Wait 0.01 seconds
          • Item - Make (Item carried by MCS_Target1 in slot 1) Undroppable
          • Item - Make (Item carried by MCS_Target1 in slot 2) Undroppable
          • Item - Make (Item carried by MCS_Target1 in slot 3) Undroppable
          • Item - Make (Item carried by MCS_Target1 in slot 4) Undroppable
          • Item - Make (Item carried by MCS_Target1 in slot 5) Undroppable
          • Item - Make (Item carried by MCS_Target1 in slot 6) Undroppable
          • Wait 20.00 seconds
          • Item - Make (Item carried by MCS_Target1 in slot 1) Droppable
          • Item - Make (Item carried by MCS_Target1 in slot 2) Droppable
          • Item - Make (Item carried by MCS_Target1 in slot 3) Droppable
          • Item - Make (Item carried by MCS_Target1 in slot 4) Droppable
          • Item - Make (Item carried by MCS_Target1 in slot 5) Droppable
          • Item - Make (Item carried by MCS_Target1 in slot 6) Droppable
        • Else - Actions
      • -------- ----------Spell Rank 3------------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Possess unit for MCS_Caster1) Equal to 3
        • Then - Actions
          • Item - Make (Item carried by MCS_Target1 in slot 1) Undroppable
          • Item - Make (Item carried by MCS_Target1 in slot 2) Undroppable
          • Item - Make (Item carried by MCS_Target1 in slot 3) Undroppable
          • Item - Make (Item carried by MCS_Target1 in slot 4) Undroppable
          • Item - Make (Item carried by MCS_Target1 in slot 5) Undroppable
          • Item - Make (Item carried by MCS_Target1 in slot 6) Undroppable
          • Wait 25.00 seconds
          • Item - Make (Item carried by MCS_Target1 in slot 1) Droppable
          • Item - Make (Item carried by MCS_Target1 in slot 2) Droppable
          • Item - Make (Item carried by MCS_Target1 in slot 3) Droppable
          • Item - Make (Item carried by MCS_Target1 in slot 4) Droppable
          • Item - Make (Item carried by MCS_Target1 in slot 5) Droppable
          • Item - Make (Item carried by MCS_Target1 in slot 6) Droppable
        • Else - Actions
          • -------- The function below is always recommended. --------
          • Trigger - Run PossessAUnit <gen> (checking conditions)
This trigger restrict the target heroes inventory
so no items is droppable while the spell is active. (more or less the same)
but i havent tested it yet since the "Mindcontrol Hero" is not functioning.

  • Mind Control Restrict item Hero
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (MCS_Target1 is A Hero) Equal to True
      • (Ability being cast) Equal to Possess unit
    • Actions
      • Trigger - Turn off Mind Control Restrict item Unit <gen>
      • Set MCS_Target1 = (Target unit of ability being cast)
      • Set MCS_Caster1 = (Triggering unit)
      • -------- ----------Spell Rank 1------------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Possess unit for MCS_Caster1) Equal to 1
        • Then - Actions
          • Item - Make (Item carried by MCS_Target1 in slot 1) Undroppable
          • Item - Make (Item carried by MCS_Target1 in slot 2) Undroppable
          • Item - Make (Item carried by MCS_Target1 in slot 3) Undroppable
          • Item - Make (Item carried by MCS_Target1 in slot 4) Undroppable
          • Item - Make (Item carried by MCS_Target1 in slot 5) Undroppable
          • Item - Make (Item carried by MCS_Target1 in slot 6) Undroppable
          • Wait 6.00 seconds
          • Item - Make (Item carried by MCS_Target1 in slot 1) Droppable
          • Item - Make (Item carried by MCS_Target1 in slot 2) Droppable
          • Item - Make (Item carried by MCS_Target1 in slot 3) Droppable
          • Item - Make (Item carried by MCS_Target1 in slot 4) Droppable
          • Item - Make (Item carried by MCS_Target1 in slot 5) Droppable
          • Item - Make (Item carried by MCS_Target1 in slot 6) Droppable
        • Else - Actions
      • -------- ----------Spell Rank 2------------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Possess unit for MCS_Caster1) Equal to 2
        • Then - Actions
          • Wait 0.01 seconds
          • Item - Make (Item carried by MCS_Target1 in slot 1) Undroppable
          • Item - Make (Item carried by MCS_Target1 in slot 2) Undroppable
          • Item - Make (Item carried by MCS_Target1 in slot 3) Undroppable
          • Item - Make (Item carried by MCS_Target1 in slot 4) Undroppable
          • Item - Make (Item carried by MCS_Target1 in slot 5) Undroppable
          • Item - Make (Item carried by MCS_Target1 in slot 6) Undroppable
          • Wait 8.00 seconds
          • Item - Make (Item carried by MCS_Target1 in slot 1) Droppable
          • Item - Make (Item carried by MCS_Target1 in slot 2) Droppable
          • Item - Make (Item carried by MCS_Target1 in slot 3) Droppable
          • Item - Make (Item carried by MCS_Target1 in slot 4) Droppable
          • Item - Make (Item carried by MCS_Target1 in slot 5) Droppable
          • Item - Make (Item carried by MCS_Target1 in slot 6) Droppable
        • Else - Actions
      • -------- ----------Spell Rank 3------------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Possess unit for MCS_Caster1) Equal to 3
        • Then - Actions
          • Item - Make (Item carried by MCS_Target1 in slot 1) Undroppable
          • Item - Make (Item carried by MCS_Target1 in slot 2) Undroppable
          • Item - Make (Item carried by MCS_Target1 in slot 3) Undroppable
          • Item - Make (Item carried by MCS_Target1 in slot 4) Undroppable
          • Item - Make (Item carried by MCS_Target1 in slot 5) Undroppable
          • Item - Make (Item carried by MCS_Target1 in slot 6) Undroppable
          • Wait 12.00 seconds
          • Item - Make (Item carried by MCS_Target1 in slot 1) Droppable
          • Item - Make (Item carried by MCS_Target1 in slot 2) Droppable
          • Item - Make (Item carried by MCS_Target1 in slot 3) Droppable
          • Item - Make (Item carried by MCS_Target1 in slot 4) Droppable
          • Item - Make (Item carried by MCS_Target1 in slot 5) Droppable
          • Item - Make (Item carried by MCS_Target1 in slot 6) Droppable
        • Else - Actions
          • -------- The function below is always recommended. --------
          • Trigger - Run PossessAUnit <gen> (checking conditions)
And here should my final trigger be and restrict the targeted heros spells while under effect of the spell, accordingly.

Rank 1 - Restrict the second, third and the ultimate spells.
Rank 2 - Restrict same as above.
Rank 3 - Restrict the third and the ultimate spells.

That is all, sorry for my bad language and
Thx for reading this long post!

If you have any ideas about adding effects to make the spell more intresting, feel free to suggest :)
 
Status
Not open for further replies.
Top