• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Spell] Temporary Charm by Triggers

Status
Not open for further replies.
Level 4
Joined
Sep 23, 2014
Messages
53
Hi. I knw some people have done this before but i was wondering what I'm doing wrong and how i could fix it. Just a temporary charm effect, 5 seconds, and then it goes back to its original owner. I knw the spell causing the effect of this trigger has to be any target spell other than charm, no worries there.
 

Attachments

  • Temporary charm.png
    Temporary charm.png
    8.7 KB · Views: 193
If it's not going to multicast (usable by more than 1 unit),
You need two variables for this:
Bob = unit variable
BobPlayer = player variable

Events: A unit starts the effect of an ability
conditions: ability == mind control
Actions:
set Bob = target unit of ability being cast
set BobPlayer = owner of Bob
unit - change ownership of Bob to owner of triggering unit
wait 5 seconds
unit - change ownership of Bob to BobPlayer

It's not MUI and it's a hacky way of doing it but it's simple and works.
 
Wow....u guys work fast and efficient :D i knew i missed something just wasn't sure about setting the variables. THNK U SO MUCH :) Rep for all
 
HERES the MUI Version

  • Mind Control Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- SPECIAL EFFECT WILL USE --------
      • Set SpecialSFX = Abilities\Spells\Other\Charm\CharmTarget.mdl
      • -------- DURATION --------
      • Set Duration2 = 5.00
      • -------- IS A TARGET A HERO? FALSE = NOT --------
      • Set Hero = False
  • Mind Control
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mind Control
    • Actions
      • -------- --------------------------------------------- --------
      • -------- DONT TOUCH THIS --------
      • -------- --------------------------------------------- --------
      • Set Index = (Index + 1)
      • Set Caster[Index] = (Triggering unit)
      • Set Target[Index] = (Target unit of ability being cast)
      • Set TargetOwner[Index] = (Owner of Target[Index])
      • Set CasterOwner[Index] = (Owner of Caster[Index])
      • Set Duration[Index] = Duration2
      • -------- --------------------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Target[Index] is A Hero) Equal to Hero
        • Then - Actions
          • Special Effect - Create a special effect attached to the chest of Target[Index] using SpecialSFX
          • Special Effect - Destroy (Last created special effect)
          • Unit - Change ownership of Target[Index] to CasterOwner[Index] and Change color
        • Else - Actions
      • Wait Duration[Index] seconds
      • Set IndexRecycle = (IndexRecycle + 1)
      • Unit - Change ownership of Target[IndexRecycle] to TargetOwner[IndexRecycle] and Change color
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IndexRecycle Equal to Index
        • Then - Actions
          • Set Index = 0
          • Set IndexRecycle = 0
        • Else - Actions
AND KINDLY READ Tutorial for more info
https://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/mui-triggers-waits-218354/

HERES THE THE TEST MAP
 

Attachments

true

I remember doing this in my long lost map u take control of a hero for like 4-5 secs make it invulnerable and after that time goes back to the previous owner(original)
you could use spells items (almost forgot make items undroppable and after the duration reverse that (to prevent item abuse))

That's not a bad idea :D good call
 
Removing Item Drop

After following LordDz's instructions and taking mogulkhan1Axe's advice, i tried balancing this spell (which worked, thanks again btw) by making items UNDROPPABLE as was suggested. However, a new problem arose :P something is wrong in that only slot #1 is being marked undroppable, after testing i confirmed that despite having the loop integer 1 to 6 (as suggested on other forums), only slot #1 seems to be taking effect of this trigger. How can this be fixed? Please disregard the last action trigger i tried at the bottom. Thanks in advance :)
 

Attachments

  • item drops.png
    item drops.png
    14.6 KB · Views: 130
After following LordDz's instructions and taking mogulkhan1Axe's advice, i tried balancing this spell (which worked, thanks again btw) by making items UNDROPPABLE as was suggested. However, a new problem arose :P something is wrong in that only slot #1 is being marked undroppable, after testing i confirmed that despite having the loop integer 1 to 6 (as suggested on other forums), only slot #1 seems to be taking effect of this trigger. How can this be fixed? Please disregard the last action trigger i tried at the bottom. Thanks in advance :)

because its full of leaks :D

EDIT: i can make this mui if u want (so it can be used by multiple units at the same time without leaks (and by leaks i mean waits dont use that))
 
idk

because its full of leaks :D

EDIT: i can make this mui if u want (so it can be used by multiple units at the same time without leaks (and by leaks i mean waits dont use that))

the sad part is this baby works perfectly, until u want to fix the item drop issue :S i figured it would b as simple as just adding that little bit in the middle, guess not. u dnt have 2 go through the trouble m8 :) i guess i'll look for a similar spell like the ones suggested here or other.
 
Events: A unit starts the effect of an ability
conditions: ability == mind control
Actions:
set Bob = target unit of ability being cast
set BobPlayer = owner of Bob
unit - change ownership of Bob to owner of triggering unit
  • For each (Integer tempInt) from 1 to 6, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Item carried by Bob in slot tempInt) is Sellable) Equal to True
        • Then - Actions
          • Item - Make (Item carried by Bob in slot tempInt) Undroppable
        • Else - Actions
wait 5 seconds
  • For each (Integer tempInt) from 1 to 6, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Item carried by Bob in slot tempInt) is Sellable) Equal to True
        • Then - Actions
          • Item - Make (Item carried by Bob in slot tempInt) Droppable
        • Else - Actions
unit - change ownership of Bob to BobPlayer


I check if an item is sellable in case the item equipped cannot be dropped (as to not make it droppable after the hero has been charmed) so you might have to edit misc items that cannot be sold.
 
Status
Not open for further replies.
Back
Top