Hi!
I was thinking about make an aura that gives chance to transform nearby enemies into sheep or whatever else. I have no idea how to create it .
Thanks!:thup:
Do something like this:
Trigger:
- Voodoo Aura
- Events
- Time - Every 1.00 seconds of game time
- Conditions
- Actions
- Set TempGroup = (Units in (Playable map area) matching (((Matching unit) has buff Voodoo Aura) Equal to True))
- Unit Group - Pick every unit in TempGroup and do (Actions)
- Loop - Actions
- Unit - Create 1 Dummy for Neutral Hostile at (Position of (Picked unit)) facing Default building facing degrees
- Unit - Add a 2.50 second Generic expiration timer to (Last created unit)
- Unit - Add Polymorph to (Last created unit)
- Unit - Order (Last created unit) to Human Sorceress - Polymorph (Picked unit)
- Custom script: call DestroyGroup(udg_TempGroup)
Do something like this:
Trigger:
- Voodoo Aura
- Events
- Time - Every 1.00 seconds of game time
- Conditions
- Actions
- Set TempGroup = (Units in (Playable map area) matching (((Matching unit) has buff Voodoo Aura) Equal to True))
- Unit Group - Pick every unit in TempGroup and do (Actions)
- Loop - Actions
- Unit - Create 1 Dummy for Neutral Hostile at (Position of (Picked unit)) facing Default building facing degrees
- Unit - Add a 2.50 second Generic expiration timer to (Last created unit)
- Unit - Add Polymorph to (Last created unit)
- Unit - Order (Last created unit) to Human Sorceress - Polymorph (Picked unit)
- Custom script: call DestroyGroup(udg_TempGroup)
this trigger in its current form will most likely end up in mass lagg.
you call it every 1.00 seconds but the dummys stay for 2.50 seconds.
it does also create dummys for units which are already hexed.
there is much to be improved. (of course i know you just quickly wrote something done as an example, i just want to state clearly that this is not the trigger in its final form)
Simply, just FYI that would be a 10% chance.I thought he wanted it chance based? Like maybe 10% chance to get hexed every second?
Trigger:
- Unit Group - Pick every unit in TempGroup and do (Actions)
- Loop - Actions
- Set TempInt = Random integer between 1 and 100
- if-then-else
- if
- TempInt Less than or equal to 10
- then
- Set TempPoint = (Position of (Picked Unit))
- Unit - Create 1 Dummy for Neutral Hostile at TempPoint facing Default building facing degrees
- Unit - Add a 1 second Generic expiration timer to (Last created unit)
- Unit - Add Polymorph to (Last created unit)
- Unit - Order (Last created unit) to Human Sorceress - Polymorph (Picked unit)
- call RemoveLocation(udg_TempPoint)
- else
Sorry, freehanded the chance thingy.
Basically, create an integer variable to act as the chance, set it to a random number between 1 and 100 for every unit that has the aura and is not polymorphed. If the number is <= 10, hex it.
I thought he wanted it chance based? Like maybe 10% chance to get hexed every second?
That's right, I wanted it! I'll try it so. Thanx for all
Wow great! When I get home I'll try it! I'll post how it was.:thup:
Thanks a lot!
Firstly, just to inform you. Its not MUI.
Second you might wanna check the target field.
Third you might wanna check the ur custom spell is based off polymorph.
Fourth, maybe try giving the ability to the unit beforehand in the object editor or increase the timer by just a little?
Try inserting messages in between the trigger like game: display to all players: Part 1 is working. So in game, you know what is working and what not. 5% chance is really low, so maybe, just maybe it just hasn't activated? Also are the units enemy of the caster?
Maybe post your map so we can check it out.
My bad, i didn't see they were two different buffs ^^
I'm sure it will work now ^^