• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

[General] Items for NPC

Status
Not open for further replies.
Level 6
Joined
Jan 31, 2014
Messages
67
I'm creating a NPC who goes from place to place(done this).
Takes items and comes back to his spawn place to deliver them.
I need help with NPC taking the items.(Items are dropped with trigger)
Like- A hunter comes to wolf, kills it and takes his meat (Meat is dropped with trigger).
 
Level 23
Joined
Feb 6, 2014
Messages
2,466
You need to trigger the unit to pick an item within range.
STEPS:
- Create a trigger (lets call it pickItem)
- Create a region within the NPC
- Pick every item in the region
- Order NPC to pick the item
  • Events
  • Conditions
  • Actions
    • Set tempPoint = Position of NPC
    • Set yourRegion = Region centered at tempPoint with size (600, 600)
    • Item - Pick every item in yourRegion and do (Actions)
      • Loop - Actions
        • Unit - Order NPC to Right-Click (Picked Item)
    • Custom script: call RemoveLocation(udg_tempPoint)
    • Custom script: call RemoveRect(udg_yourRegion)
Basically, running
  • Trigger - Run pickItem <gen> (ignoring conditions)
will make your NPC look for items nearby.

Just putting the "Trigger - Run pickItem <gen> (ignoring conditions)" in a trigger will make the NPC pick items.
Or you can put a periodic event in the pickItem trigger if you want.
 
Last edited:
Status
Not open for further replies.
Top