• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Spell] Temporary Charm by Triggers

Status
Not open for further replies.
Level 3
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: 145
Level 25
Joined
May 11, 2007
Messages
4,651
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.
 
Level 3
Joined
Sep 23, 2014
Messages
53
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
 
Level 7
Joined
Mar 6, 2014
Messages
203
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
http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/mui-triggers-waits-218354/

HERES THE THE TEST MAP
 

Attachments

  • MIND CONTROL.w3x
    18.3 KB · Views: 77
Level 8
Joined
Nov 9, 2011
Messages
326
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))
 
Level 3
Joined
Sep 23, 2014
Messages
53
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
 
Level 3
Joined
Sep 23, 2014
Messages
53
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: 86
Level 8
Joined
Nov 9, 2011
Messages
326
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))
 
Level 3
Joined
Sep 23, 2014
Messages
53
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.
 
Level 25
Joined
May 11, 2007
Messages
4,651
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.
 
Level 3
Joined
Sep 23, 2014
Messages
53
Once again

gr8 job again LordDZ, as for the non-sellable items issue it wont be a problem the map is melee. Thanks again :D flawless
 
Status
Not open for further replies.
Top