help with item code

feistaghelm

New Member
Reaction score
2
So I have the quest item in my inventory.... How do I write a code so that I take said item and turn it in to the questgiver.

(this isn't a real trigger)

Event
Player 1 gives quest item to questgiver
Condition
Item is equal to (whatever is needed)
Action
Mark quest complete
Hero gets exp
Player gets cash
Turn this trigger off

I am tired and really need your help.
 

TomTTT

New Member
Reaction score
44
Well, there is no such a command. You simply remove the item from the hero's inventory.
Trigger:
  • QUEST
    • Events
      • Unit - A unit enters Region 000 <gen>
    • Conditions
      • (Item carried by (Triggering unit) in slot 1) Equal to ITEM
    • Actions
      • Quest - Mark QUEST as Completed
      • Quest - Display to Player Group - Player 1 (Red) the Quest Completed message: WTF FTW XD LOLZ OMF...
      • Hero - Add 200 experience to (Triggering unit), Show level-up graphics
      • Player - Add 500 to Player 1 (Red) Current gold
      • Trigger - Turn off (This trigger)

Changeable things:
Region 000 <gen> = is a region i created, around the unit you want to return the item to.

QUEST = a quest variable, when you make a quest, do set QUEST = Last created quest.

ITEM = the item needed. It's an Item variable, when you create the item, do set ITEM = Last created Item.

Item carried in Slot 1 = Depend on what slot is he carrying the item. you can make a codition Or and do from 1 - 6.
Good Luck! :)
 

feistaghelm

New Member
Reaction score
2
I have the turn in quest already done but the item stays in my inventory whether I try: remove item/hide item and using item-type/item being manipulated/item in slot 1.... It is an item I made and I made an item variable. Is it supposed to be another type of variable?
 

NeuroToxin

New Member
Reaction score
46
Tom, your condition should be
Trigger:
  • (Item type of (Acquired Item) == to Your Item

Also, the add 500 to Player 1 Red should be triggering unit, and you have to remove the item, do this
Trigger:
  • Item - Remove (Acquired Item) from (Triggering unit)
 

TomTTT

New Member
Reaction score
44
Tom, your condition should be
Trigger:
  • (Item type of (Acquired Item) == to Your Item

Also, the add 500 to Player 1 Red should be triggering unit, and you have to remove the item, do this
Trigger:
  • Item - Remove (Acquired Item) from (Triggering unit)

He didnt say whenever a unit gets the item, he said when the unit comes near another with the item needed.
 

feistaghelm

New Member
Reaction score
2
Here are my triggers for the item quest. I can't find (aquired item) in the last trigger code. Is that because the item is aquired in an earlier trigger?

Trigger:
  • Thomas
    • Events
      • Unit - A unit comes within 75.00 of Thomas 0015 &lt;gen&gt;
    • Conditions
      • ((Entering unit) is A Hero) Equal to True
      • (This trigger) Equal to Thomas &lt;gen&gt;
      • (Owner of (Triggering unit)) Equal to Player 1 (Red)
      • (Region 003 &lt;gen&gt; contains (Triggering unit)) Equal to True
    • Actions
      • Special Effect - Destroy SpecialEffects[1]
      • Quest - Display to (All players) the Quest Update message: I was playing near ...
      • Quest - Create a Required quest titled Lost Jewel with the description Find the stone for ..., using icon path ReplaceableTextures\CommandButtons\BTNAmbush.blp
      • Set Quests[1] = (Last created quest)
      • Camera - Apply Camera 002 &lt;gen&gt; for Player 1 (Red) over 5.00 seconds
      • Animation - Play Thomas 0015 &lt;gen&gt;&#039;s Walk animation
      • Trigger - Turn off (This trigger)

then...
Trigger:
  • Lost Jewel
    • Events
      • Unit - A unit owned by Player 1 (Red) Acquires an item
    • Conditions
      • (Quests[1] is enabled) Equal to True
      • (Item-type of (Item being manipulated)) Equal to Shiny Stone
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Hero manipulating item)) Equal to Player 1 (Red)
        • Then - Actions
          • Quest - Display to (All players) the Quest Update message: You recovered the s...
          • Trigger - Turn off (This trigger)
        • Else - Actions

and last...
Trigger:
  • LJ Turn In
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Target unit of issued order) Equal to Thomas 0015 &lt;gen&gt;
      • (Owner of (Triggering unit)) Equal to Player 1 (Red)
      • (Region 003 &lt;gen&gt; contains (Triggering unit)) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) has an item of type Shiny Stone) Equal to True
        • Then - Actions
          • Item - Remove (Item carried by (Hero manipulating item) in slot 1)
          • Quest - Mark Quests[1] as Completed
          • Quest - Display to (All players) the Quest Update message: Thank you so much! ...
          • Player - Add 200 to Player 1 (Red) Current gold
          • Hero - Add 175 experience to (Triggering unit), Show level-up graphics
          • Trigger - Turn off (This trigger)
        • Else - Actions


I know I'm missing something simple. I just can't figure it out.


No dice with yout codes either da1nOnlyEd. It just gives the item away and doesn't complete.
 

LurkerAspect

Now officially a Super Lurker
Reaction score
118
Use an item variable to refer to your quest item (in this case, Quest_Item is the variable)
Trigger:
  • Lost Jewel
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to (==) Shiny Stone
      • (Owner of (Hero manipulating item)) Equal to (==) Player 1 (Red)
      • (Quest[1] is enabled) Equal to (==) True
    • Actions
      • Set Quest_Item = (Item being manipulated)
      • Trigger - Turn off (This trigger)

Use another variable to always refer to your hero.
Then to return the item:
Trigger:
  • Turn In
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item being manipulated) Equal to (==) Quest_Item
      • (Triggering unit) Equal to (==) Thomas 0015 &lt;gen&gt;
      • (Region 003 &lt;gen&gt; contains (Your Hero &lt;variable&gt;) Equal to (==) True
    • Actions
      • Quest - Mark Quests[1] as Completed
      • Quest - Display to (All players) the Quest Update message: Thank you so much! ...
      • Player - Add 200 to Player 1 (Red) Current gold
      • Hero - Add 175 experience to (Your Hero &lt;variable&gt;), Show level-up graphics
      • Trigger - Turn off (This trigger)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top