Adding Items to Merchant

Red Beard

Part-Time helper.... Full Time Lurker
Reaction score
38
Righto

As a reward from a quest, the local potion shop sells a greater variety of potions

By using the Trigger

Event:
Neutral Building: Add <item> to <shop> with (x) in stock and max stock of (y)
The 'level' of success determines the amount in stock and its max stock.

However, regardless of how many are in stock, once purchased, the item is removed from the shop. This was not my intention.

Having considered many possibilities (Filling the <Items made> field, and searching for a perhaps conflicting trigger that removes them) I am at a loss as to why this is occuring?

The conflicting Trigger I had considered was the hero purchase, but as a hero is a unit this, and a boolean check of Hero, makes this seem impossible.

Has anyone come across this problem before?
Solutions to fix it?
 

DDRtists

ɹoʇɐɹǝpoɯ ɹǝdns
Reaction score
415
Red Beard said:
Righto

As a reward from a quest, the local potion shop sells a greater variety of potions

By using the Trigger

Event:
Neutral Building: Add <item> to <shop> with (x) in stock and max stock of (y)
The 'level' of success determines the amount in stock and its max stock.

However, regardless of how many are in stock, once purchased, the item is removed from the shop. This was not my intention.

Having considered many possibilities (Filling the <Items made> field, and searching for a perhaps conflicting trigger that removes them) I am at a loss as to why this is occuring?

The conflicting Trigger I had considered was the hero purchase, but as a hero is a unit this, and a boolean check of Hero, makes this seem impossible.

Has anyone come across this problem before?
Solutions to fix it?

Can you post the triggers?
 

Red Beard

Part-Time helper.... Full Time Lurker
Reaction score
38
Removed some length non essential stuff

Sure. Seeing as nobody has been able to solve this.

If there is a better way to organise different parts, feel free to suggest some methods.

Code:
quest 3 part c
    Events
        Time - Quest_Timer expires
    Conditions
    Actions
        Trigger - Turn off Multiboard Countdown <gen>
        Multiboard - Set the text for (Last created multiboard) item in column 1, row Multi_Quest_Title to Time Up
        Multiboard - Set the color for (Last created multiboard) item in column 1, row Multi_Quest_Update to (100.00%, 80.00%, 20.00%) with 0.00% transparency
        Cinematic - Ping minimap for (All players) at (Center of (Playable map area)) for 55.00 seconds
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Quest_Count + Quest_Count_2) Less than or equal to 5
            Then - Actions
                Quest - Mark Quest_3 as Failed
                Quest - Display to (All players) the Quest Failed message: You failed to find ...
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Quest_Count + Quest_Count_2) Equal to 6) or ((Quest_Count + Quest_Count_2) Equal to 7)
                    Then - Actions
                        Quest - Mark Quest_3 as Completed
                        Quest - Display to (All players) the Quest Completed message: You have found enou...
                        Neutral Building - Add Greater Potion of Healing to Goblin Merchant 0008 <gen> with 1 in stock and a max stock of 1
                        Neutral Building - Add Greater Potion of Mana to Goblin Merchant 0008 <gen> with 1 in stock and a max stock of 1
                        Neutral Building - Add Potion of Magical Influx to Goblin Merchant 0008 <gen> with 1 in stock and a max stock of 1
                        Neutral Building - Add Potion of Regeneration to Goblin Merchant 0008 <gen> with 1 in stock and a max stock of 1
                        Neutral Building - Add Potion of Rejuvenation to Goblin Merchant 0008 <gen> with 1 in stock and a max stock of 1
                        Neutral Building - Add Potion of Revitilisation to Goblin Merchant 0008 <gen> with 1 in stock and a max stock of 1
                        Neutral Building - Add Elixer of Life to Goblin Merchant 0008 <gen> with 1 in stock and a max stock of 1
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                ((Quest_Count + Quest_Count_2) Equal to 8) or ((Quest_Count + Quest_Count_2) Equal to 9)
                            Then - Actions
                                Quest - Mark Quest_3 as Completed
                                Quest - Display to (All players) the Quest Completed message: You have found enou...
                                Neutral Building - Add Greater Potion of Healing to Goblin Merchant 0008 <gen> with 3 in stock and a max stock of 3
                                Neutral Building - Add Greater Potion of Mana to Goblin Merchant 0008 <gen> with 3 in stock and a max stock of 3
                                Neutral Building - Add Potion of Magical Influx to Goblin Merchant 0008 <gen> with 3 in stock and a max stock of 3
                                Neutral Building - Add Potion of Regeneration to Goblin Merchant 0008 <gen> with 3 in stock and a max stock of 3
                                Neutral Building - Add Potion of Rejuvenation to Goblin Merchant 0008 <gen> with 3 in stock and a max stock of 3
                                Neutral Building - Add Potion of Revitilisation to Goblin Merchant 0008 <gen> with 3 in stock and a max stock of 3
                                Neutral Building - Add Elixer of Life to Goblin Merchant 0008 <gen> with 3 in stock and a max stock of 3
                            Else - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        (Quest_Count + Quest_Count_2) Equal to 10
                                    Then - Actions
                                        Quest - Mark Quest_3 as Completed
                                        Quest - Display to (All players) the Quest Completed message: You have found more...
                                        Neutral Building - Add Greater Potion of Healing to Goblin Merchant 0008 <gen> with 0 in stock and a max stock of 5
                                        Neutral Building - Add Greater Potion of Mana to Goblin Merchant 0008 <gen> with 5 in stock and a max stock of 5
                                        Neutral Building - Add Potion of Magical Influx to Goblin Merchant 0008 <gen> with 5 in stock and a max stock of 5
                                        Neutral Building - Add Potion of Regeneration to Goblin Merchant 0008 <gen> with 5 in stock and a max stock of 5
                                        Neutral Building - Add Potion of Rejuvenation to Goblin Merchant 0008 <gen> with 5 in stock and a max stock of 5
                                        Neutral Building - Add Potion of Revitilisation to Goblin Merchant 0008 <gen> with 5 in stock and a max stock of 5
                                        Neutral Building - Add Elixer of Life to Goblin Merchant 0008 <gen> with 5 in stock and a max stock of 5
                                    Else - Actions
 

Rad

...
Reaction score
228
Well although there may be a simpler way, you could set an integer variable to the number you can buy, when you buy it set it to -1 then add another, if its 0 then dont add one...
 

Red Beard

Part-Time helper.... Full Time Lurker
Reaction score
38
:confused:

Sorry, but how would i assign an integer variable to items sold in the Merchant?

The only triggers available that deal with neutral buildings are Add, add to all, remove, remove from all, limit item slots, limit item slots for all.

Unless you mean that scary "assign custom value" thingamajigger doovelaky hoogerwhatsit.
 

Rad

...
Reaction score
228
Um no, say you win with 100% so you get 10 items at the shop. the item you win is a potion of healing. You would set integer variable 'PotionOfHealing' to 10, then when you buy it set to (PotionOfHealing - 1), check how many are left. If 0 are left then do nothing, if more than 0 add another to the shop
 

Red Beard

Part-Time helper.... Full Time Lurker
Reaction score
38
The thing is, once you buy an added item. It is no longer SOLD at all. Blank square just like it was before they were added. Regardless of how many are in stock.

I could always do something like this
Code:
Event: Unit Sells an Item
Condition: Selling unit is Goblin Merchant
Action: Add <sold Item> to Goblin merchant

That would solve the problem of the item disappearing, but than stock delays become invalid, and so would the 'level of success', (Which basically is the amount of ingredients you find is directionally proportional to the amount of potions available.)
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> Neutral Building: Add <item> to <shop> with (x) in stock and max stock of (y)

You know, this action works just fine. And as you expect it to work.
But (you knew there'd be a but), only if the "neutral building" actually belongs to the player...

Slightly less "neutral" than expected. Don't ask me... ;)
 

Red Beard

Part-Time helper.... Full Time Lurker
Reaction score
38
?? week old post?

Grave digging Ace? :p

Ah.. Right, well that really sucks doesnt it.

I had the reward set for the code i put up above. Where the 'level of success' was the number of charges in the item sold.

But, seeing as you pointed this out.... (Thanks)
I could just make the Shop belong to the "allied computer" and all would be fine right?
 
C

crazedcougar

Guest
i have shops owned by neutral passive selling units(not items), it works.
 
H

heyimnotnoob

Guest
now im no expert but i think i might have an idea

you should have the shop that u wnat to add items to.
when the event that determines when your 'reward' happens, just replace the shop with another unit that you'll have to make

make the new unit have the updated potions...and you can continue doing that every update, if there is more..so thers no fancy triggers needed here.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top