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

How to sell items automatically

Status
Not open for further replies.
Level 2
Joined
Dec 28, 2010
Messages
21
I want to make a trigger to sell items automatically for there is so many items on the ground which will make a lag. Now i have two ideas.
1st:I can set the item's HP equal to it's price ,so i can add player's money
through item's HP.but the problem is that i have more than 300 types of
items in my map,this way may take me a lot of time....
2nd:i can set custom value of the item equal to it's price in map initialization,
..... it looks like i will use custom value of the item in other aspects,so this
is inappropriate,any better ideas??? thanks...:goblin_good_job::goblin_good_job:
 
Level 13
Joined
Oct 27, 2008
Messages
1,176
How about
  • Untitled Trigger 001
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Number of items carried by (Triggering unit)) Equal to 6
    • Actions
      • Set Testing = (Current life of (Item being manipulated))
Easiest way to do it.
 
Level 2
Joined
Dec 28, 2010
Messages
21
when a unit is killed,there may be an item created in the position where the unit died. And player can combine several items to the other item which will be more useful.
also you can sell the item which is unuseful.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
If this map of yours is Singleplayer, it has no conflicts, but if it's Multiplayer...
How would you know that the item is yours to auto sell it... ?
Unless, a "Soulbinding" system is in place

Nevertheless, you can just use your first idea, selling the item by using its HP = Gold

Test map attached
Gold Selling is based on its HP
Go to "Stats - Hit Points" for the Item Price of sold
 

Attachments

  • Item HP Is Gold.w3x
    14.1 KB · Views: 90
Level 33
Joined
Mar 27, 2008
Messages
8,035
the only problem with using HP is if the user attacks an item...

you can use item level, you just need to Shift+click on the level tab in the editor to put a high value...

or if ur using already the item level for other things like equipment sortment, you can create an integer array to save each item's sell price...

You can counter with making that item, Invulnerable =D
 
Level 2
Joined
Dec 28, 2010
Messages
21
If this map of yours is Singleplayer, it has no conflicts, but if it's Multiplayer...
How would you know that the item is yours to auto sell it... ?
Unless, a "Soulbinding" system is in place

Nevertheless, you can just use your first idea, selling the item by using its HP = Gold

Test map attached
Gold Selling is based on its HP
Go to "Stats - Hit Points" for the Item Price of sold

hmmm.... it's Multiplayer.my purpose is that when player 1 chat XX then items
on the ground can be deleted meanwhile dividing money equally to each player...
 
Status
Not open for further replies.
Top