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

Making NPC to steal random items.

Status
Not open for further replies.
Level 12
Joined
Feb 13, 2009
Messages
386
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