• 🏆 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!

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