• 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] Casting chance (aura like)

Status
Not open for further replies.
Level 28
Joined
Mar 25, 2008
Messages
2,955
An aura.. uhm.. well i can try:
  • Aura
  • Events
    • Unit - A unit learns a skill
  • Conditions
    • (Learned hero skill) equal to *your skill*
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • 'IF'-Conditions
        • Player Number of (Owner of Triggering unit) equal to 1
      • 'THEN'-Actions
        • Set aura_caster[1] equal to (Triggering unit)
        • Trigger - Run Trig1 <gen>
      • 'ELSE'-Actions
  • Trig1
  • Events
    • Time - Every 0.5s
  • Conditions
  • Actions
    • Set temppoint[1] = Position of aura_caster[1]
    • Set temprect[1] = Region centered at temppoint[1] with size x;y
    • Set tempgrp[1] = units in temprect owned by (Owner of aura_caster[1]
    • Pick every unit in tempgrp and do *things*
    • Custom script - call RemoveLocation(udg_temppoint[1])
    • Custom script - call RemoveRect(udg_temprect[1])
    • Custom script - call DestroyGroup(udg_tempgrp[1])
This shall give you the idea to complete the trigger(s) yourself for all players
 
Level 17
Joined
Jan 21, 2007
Messages
2,014
Events
Every second of game time.
Conditions
random number between 1 and 100 is less than or equal to 15
Actions
pick all units in (playable map area) matching (level of (ability(aura)) for (matching unit is greater than or equal to 1)
Set variable (Auraunit) to (picked unit)
Pick random 1 unit(s) in 500 range of (Auraunit) matching (matching unit is an enemy/ally) to (Auraunit)
Create 1 (dummy) for owner of (Auraunit) at position of (picked unit)
add (dummyability) to (last created unit)
set level of (dummyabilty) to level of (ability(aura))
issue order (last created unit) to (base order id of dummy ability) (picked unit)
Add a 1.5 seconds default expiration timer to (last created unit)


Please not that this leaks, and that im not totally sure about the (pick all units in 500 range) but there should be something like it.
Although with a little fixing with the variable this is MUI.

And to Squiggy: you forgot the 15% chance.
 
Last edited:
Level 9
Joined
Jan 23, 2008
Messages
384
a friend of mine view the post and telled me that is possible to work pretty well but i didn't understand T.T

  • Genjutsu
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Human Archmage - Blizzard
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player number of (Owner of (Triggering unit))) Equal to 1
        • Then - Actions
          • Set Gen_Caster = (Triggering unit)
          • Trigger - Run Genjutsu Act <gen> (checking conditions)
        • Else - Actions
  • Genjutsu Act
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • (Random real number between 1.00 and 100.00) Less than or equal to 10.00
    • Actions
      • Set Gen_Point = (Position of Gen_Caster)
      • Set Gen_Reg = (Region centered at Gen_Point with size (500.00, 500.00))
      • Set Gen_Group = (Units in Gen_Reg owned by (Random player from (All allies of Player 6 (Orange))))
      • Custom script: call RemoveLocation(udg_Gen_Point)
      • Custom script: call RemoveLocation(udg_Gen_Reg)
      • Custom script: call DestroyGroup(udg_Gen_Group)
And now i want to pick a random unit from the group not all of them :hohum: can you help me ... i do not want you to do the ability cause you might be busy ... if you can help me i'm ok but if you want to do it for me ... :cute: so very thank you :thumbs_up:
 
Level 17
Joined
Jan 21, 2007
Messages
2,014
Here it is. Set Random N units to 1 random unit.
 

Attachments

  • Random N units.jpg
    Random N units.jpg
    51 KB · Views: 170
Level 17
Joined
Jan 21, 2007
Messages
2,014
It often happens that either the questioning or answering person may do some little error, and the whole trigger doesn't work.

Btw, the spell works. I used the idea of sleeping the enemy, so i also added a condition so that it does not sleep a sleeped unit(bug found when testing it:razz:)

Here it is:
 

Attachments

  • Aura with Chance.w3x
    18.4 KB · Views: 50
Last edited:
Level 17
Joined
May 6, 2008
Messages
1,598
An aura.. uhm.. well i can try:
  • Aura
  • Events
    • Unit - A unit learns a skill
  • Conditions
    • (Learned hero skill) equal to *your skill*
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • 'IF'-Conditions
        • Player Number of (Owner of Triggering unit) equal to 1
      • 'THEN'-Actions
        • Set aura_caster[1] equal to (Triggering unit)
        • Trigger - Run Trig1 <gen>
      • 'ELSE'-Actions
  • Trig1
  • Events
    • Time - Every 0.5s
  • Conditions
  • Actions
    • Set temppoint[1] = Position of aura_caster[1]
    • Set temprect[1] = Region centered at temppoint[1] with size x;y
    • Set tempgrp[1] = units in temprect owned by (Owner of aura_caster[1]
    • Pick every unit in tempgrp and do *things*
    • Custom script - call RemoveLocation(udg_temppoint[1])
    • Custom script - call RemoveRect(udg_temprect[1])
    • Custom script - call DestroyGroup(udg_tempgrp[1])
This shall give you the idea to complete the trigger(s) yourself for all players
Why did you put arrays?
 
Status
Not open for further replies.
Top