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

Items

Status
Not open for further replies.
Level 4
Joined
Apr 25, 2008
Messages
60
I need trigger which would stop specific units from buying items from specific shop and same thing with buying nuetral units.

Example: Peasant comes to neutral shop and tries to buy "Claws of Attack" and then text comes out: "You can't buy this item, because it is only for Footman".(Peasant can't take the item, it remains in shop, no money lost).
P.S. Let's say those 2 units have inventories.
 
Level 2
Joined
Dec 23, 2009
Messages
15
hmm well theres not really many conditions for items i guess you can make it so if a unit tries to buy the claws it removes the item and refunds gold

  • Unit Aquires Item
Unit type conparison = peasants
remove aquired item
add gold to playyer (gold of item)

thats the only think i can think off
 
Level 3
Joined
Apr 29, 2009
Messages
32
  • Events
    • Unit - A unit Sells an item (from shop)
  • Conditions
    • (Item-type of (Sold Item)) Equal to Claws of Attack
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Unit-type of (Buying unit)) Equal to Footman
      • Then - Actions
      • Else - Actions
        • Player - Add X to (Owner of (Buying unit)) Current gold
        • Item - Remove (Sold Item)
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
Maybe anyone know other way? It's stupid to write trigger for every item, I will need about 30...
yes i know....
but you will need one 1 region for each shop big enough to place all items type that your shop is selling

later you can remove that regions for shops


and you will need one free spot for dummy region that is enough big so that shop and his items can be inside

and one more smallest region called Shop Position

i made the triggers to work on items like this

if there is in shop 7 available items of some type and your not allowed unit is trying to buy it nothing will happen

-there will stay 7 available items

-player will not lose any gold or lumber

-has no delay

you need 2 trigger for disable item buying and one (at map initialization) to add items in region to your shop

(if you really think that dummy region would be bad i could make it not needing dummy region)

and one more thing,set your item level or hp (better level) to his Stock maximum value
(press shift + enter to type any value)
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
ALiEn95 can you give me triggers without dummy region?

Or can anyone offer any other way :p ?

other way would be to set requirements for item and put all item to items made (not items sold)
actuall i think that would be easier,but ever unit must have his dummy unit
that you set dummy unti to a variable
DUMMY UNIT [1] = DUMMY FOR PALADIN
DUMMY UNIT [2] = DUMMY FOR LEACH KING
.....

than set point value/flying high of you units to number of variable
PALADIN - point value/flying height = 1
LECH KING - point value/flying height = 2
...

(flying height is not visible on any structures or units that have movement type foot/none)
than when player selects a shop with PALADIN

replace DUMMY UNIT with DUMMY UNIT [pint value/flying height of (PALADIN)]
this way will have hard some issues but they can be solved!

(than all other item that require other unit will not be available to buy)

(sorry but i cant find my map with the firs way...)

btw..about how many shops and heroes do you have in your map?
 
Level 4
Joined
Apr 25, 2008
Messages
60
3 heroes 4 units with inventory and 6 shops. If you write trigger please write it in code(or insert a new map with that trigger) with examples so I can try it. You know it's hard to understand what you said your way :D.
 
Last edited:
Level 13
Joined
Mar 4, 2009
Messages
1,156
there is a problem

firstly i need to know can player have more than one hero
(it will be easier if not)

how much is max number of item type available/remaining in shop ? (for example there is a shop with 5 mama potions available,if you buy one than it will be 4)


and its hard to detect who bought the item
accept if your trigger works on event unit sells an item




i know one way but you will need

unit that has model of shop (but is fake)

real shops under fake shop for each player xD

real shops would be selected by players and they would have no model
 
Status
Not open for further replies.
Top