• 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.

Convert Units in an Area

Status
Not open for further replies.
Level 10
Joined
Nov 5, 2008
Messages
536
Each player has a caster and X number of Workers.
The caster can cast an Area of effect-spell on target area.
Up to 5 friendly Workers in that area are permanently converted into Warriors.

How do I do to make a spell like this?
 
Level 8
Joined
Dec 8, 2007
Messages
312
this should be what you want
  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to <<Your spell>>
    • Actions
      • Set Point1 = (Target point of ability being cast)
      • Set TempGroup = (Units within 202.00 of Point1 matching (((Owner of (Matching unit)) Equal to (Owner of (Triggering unit))) and ((Unit-type of (Matching unit)) Equal to Peasant)))
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in TempGroup) Greater than 0
            • Then - Actions
              • Set TempUnit = (Random unit from TempGroup)
              • Unit Group - Remove TempUnit from TempGroup
              • Unit - Replace TempUnit with a Footman using The old unit's relative life and mana
            • Else - Actions
      • Custom script: call RemoveLocation(udg_Point1)
      • Custom script: call DestroyGroup(udg_TempGroup)
 
Status
Not open for further replies.
Top