• 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 faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Modified Black arrow spell... How to make it?

Status
Not open for further replies.
Level 8
Joined
Nov 21, 2008
Messages
316
I want to make it so when my unit that has the ability black arrow and it kills an orc it spawns skeleton orc, when it kills a shaman it spawns skeleton mage. im confident on making that part, but how do i give it a % chance to spawn the unit. example

like 15% chance on kill it will spawn the unit?
 
You can do it like this:
Get Searing Arrows ability and:
  • Trigger1
  • Events
    • Unit - A unit is issued an order with no target
  • Conditions
    • (Issued order) Equal to (flamingarrows)
  • Actions
    • Unit - Set the custom value of (Triggering unit) to 1 //Use this, if you don't use custom values in your maps, else Hashtable - Save True as (Key(on)) of (Key(Triggering unit)) in Hashtable
  • Trigger2
  • Events
    • Unit - A unit is issued an order with no target
  • Conditions
    • (Issued order) Equal to (unflamingarrows)
  • Actions
    • Unit - Set the custom value of (Triggering unit) to 0 //Use this, if you don't use custom values in your maps, else Hashtable - Save False as (Key(on)) of (Key(Triggering unit)) in Hashtable
  • Trigger3
  • Events
    • Unit - A unit dies
  • Conditions
    • (Custom value of (Killing unit)) Equal to 1 //Use this if you chose to use Custom values, else (Load (Key(on)) of (Key(Killing Unit)) from Hashtable) Equal to True //Boolean comparison
  • Actions
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • (Random integer number between 1 and 100) Less than or Equal to 60 //Integer Comparison. Value "60" defines the chance. Currently, it has a 60% chance to occur
      • Then - Actions
        • Set Point1 = (Position of (Triggering unit))
        • If (All conditions are true) then do (Actions) else do (Actions)
          • If - Conditions
            • (Race of (Owner of (Triggering unit)) Equal to Orc
            • (Unit-type of (Triggering unit)) Not Equal to Shaman
          • Then - Actions
            • Unit - Create 1 Skeletal Orc for (Owner of (Killing unit)) at (Point1) facing default building degrees
          • Else - Actions
            • If (All conditions are true) then do (Actions) else do (Actions)
              • If - Conditions
                • (Unit-type of (Triggering unit)) Equal to Shaman
              • Then - Actions
                • Unit - Create 1 Skeleton Mage for (Owner of (Killing unit)) at Point1 facing default building degrees
              • Else - Actions
        • Custom script: call RemoveLocation (udg_Point1)
 
Status
Not open for further replies.
Top