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

Making NPC to steal random items.

Status
Not open for further replies.
Level 12
Joined
Feb 13, 2009
Messages
388
Greetings!

I need to randomly spawn thieves from outside of map which should pick a random item within a set area and try to steal it (pick it up and leave the map through entering a "leaving" region).

It seems easy to do but I somehow struggle to produce a working trigger, because every time they refuse to pick items...


Help me with it please. :)



[EDIT] After a few more tries it looks like the "race" affects their behaviour >.>

When I had them "neutral", NPC units canceled their task and returned where they are (even while under control of a hostile AI player!).

When I set the race to "orc", they happily stole items and ran away.

I didn't know a simple "race" field affects so much o_O.
 
  • Events
    • Unit - A unit leaves (Playable map area)
  • Conditions
    • Unit type of (Triggering unit) Equal to Thief
  • Actions
    • Create a thief for (Neutral hostile) at (Random point in (Playable map area)) facing 0.00 degrees
    • Order (last created unit) to pick up (Random item in (Playable map area)
  • Events
    • Time - Every 2 seconds of game time
  • Conditons
  • Actions
    • Pick every unit in (Playable map area) matching unit type of (Matching unit) equals Thief and Matching unit's current order not equals to "smart" do actions:
      • order (Picked unit) to Take (Random item in (Playable map area))
  • Events
    • Unit - A unit aquires an item
  • conditions
    • Unit type of triggering unit equals Thief
  • Actions
    • Remove (Triggering unit)
  • Remove point leaks and unit group leaks and TADAH!
  • replace (Playable map area) with your "rect" (region in gui)
 
Status
Not open for further replies.
Top