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

Stop Selling System v1.06 [Updated]

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
  • Like
Reactions: Masken
This system can:
-stop players to buy from other players
-stop hero-type to buy item-type
(for example you can make mages unable to buy swords)
(you can also stop selling units by disableing gold/wood/food cap for owner of Picked Unit and setting gold/wood/food cap back to normal at second trigger)
(you can also make hero not to buy something based to any conditions you want)

for example:
If you want to display gold/lumber in your game even if hero is not near shop than do
-increase range of "Select Hero" / "Shop Sharing" ability in your shop
-make unit unable to buy if disatance from shop and hero is to long




  • STOP SELLING ITEM TYPE
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Level of Select Hero for (Triggering unit)) Equal to 1
    • Actions
      • Custom script: set udg_ITEM = (GetIssuedOrderId())
      • -------- first we set this group for all heroes --------
      • Set NotAllowedHeroes = (Units in (Playable map area) matching (((Matching unit) is A Hero) Equal to True))
      • -------- here,heroes that can buy the item can be removed from "NotAllowedHeroes" group --------
      • -------- this all conditions will need to be changed to your own needs --------
      • Unit Group - Pick every unit in NotAllowedHeroes and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) is selected by (Owner of (Picked unit))) Equal to True
              • Or - Any (Conditions) are true
                • Conditions
                  • And - All (Conditions) are true
                    • Conditions
                      • (Unit-type of (Picked unit)) Equal to Nut,i want NUT !,
                      • ITEM Not equal to Nut
                  • And - All (Conditions) are true
                    • Conditions
                      • (Unit-type of (Picked unit)) Equal to I wanna Cheese
                      • ITEM Not equal to Cheese
                  • And - All (Conditions) are true
                    • Conditions
                      • (Unit-type of (Picked unit)) Equal to Just dont give me Cheese
                      • ITEM Equal to Cheese
                  • And - All (Conditions) are true
                    • Conditions
                      • (Unit-type of (Picked unit)) Equal to give me a weapon from my shop
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Owner of (Triggering unit)) Not equal to (Owner of (Picked unit))
                          • And - All (Conditions) are true
                            • Conditions
                              • ITEM Not equal to Sword
                              • ITEM Not equal to Axe
                  • (Owner of (Triggering unit)) Equal to Player 5 (Yellow)
            • Then - Actions
              • -------- this picked unti is not allowed to buy the item,his inventory will be "disabled" --------
              • Unit - Set level of Inventory [Hero,has 2 levels] for (Picked unit) to 2
            • Else - Actions
              • -------- this picked unit is allowed to buy the item,he can be removed from the group --------
              • Unit Group - Remove (Picked unit) from NotAllowedHeroes
      • Countdown Timer - Start TIMER as a One-shot timer that will expire in 0.00 seconds
      • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- TRIGGER INFO: --------
      • -------- you can use any kind of conditions to sell or not to sell the buying item --------
      • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- you cannot detect player that wants to buy item from shop (this is bad only because you cannot send text massage to player when buying) --------
      • -------- you cannot detect unit that wants to buy item from shop (this is bad only because you cannot send text massage to player when buying) --------
      • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- first "Or - Any (Conditions) are true" are conditions for all Hero types/Players ...etc,you weill need to change that to your needs --------
      • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
  • UNSTOP selling item type
    • Events
      • Time - TIMER expires
    • Conditions
    • Actions
      • -------- this will make hero´s inventory back to normal --------
      • Unit Group - Pick every unit in NotAllowedHeroes and do (Actions)
        • Loop - Actions
          • Unit - Set level of Inventory [Hero,has 2 levels] for (Picked unit) to 1
      • Custom script: call DestroyGroup(udg_NotAllowedHeroes)










1.01
- Fixed and Updated some descriptions
1.02
- Screen shop updated
- "Buying unit" detection removed
- Fixed "STOP HERO TO BUY ITEM TYPE" trigger
-some small changes of description and triggers
1.04
- System made more simple and with less triggers
- Screenshot updated
1.05
-said to Trigger Happy that boolean is here for a reson (not really an update)
1.06
-boolean removed
-for each variable from 1 to 12 removed
-hero does not have to be stored in HERO[X] variable , (HERO[X] variable is removed)
-unit group "NotAllowedHeroes" added
-system now works for all heroes
-fixed and updated some descriptions
-screenshot updated














Keywords:
stop, disable, selling, sharing, shopping, buying, sell, share, shop, buy, system
Contents

STOP SELLING SYSTEM (Map)

Reviews
Bribe - Destroying NotAllowedHeroes group? Why? This whole things needs a re-write, likely in JASS.

Moderator

M

Moderator

Bribe -
Destroying NotAllowedHeroes group? Why? This whole things needs a re-write, likely in JASS.
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
It`s global variable so it may bug if there is run second trigger with loop for each int A. But that`s really a big problem if there are waits in loop.
ok i can understand that its a problem if you use waits...
but i dunno why is it bad like this

how do you create your own integer variable that can be used for integer actions from x to x ??

will i need custom script / jass trigger for that ?

btw are you sure i need to avoid normal integer action??
 
Level 14
Joined
Mar 30, 2009
Messages
971
as far as i remembered there were 2 different shop abilities:
one (e.g. from goblin merchant) that sells to all players
another one (e.g. from arcane vault) that only sells to allied players.

i think im right, but i might be wrong. but i still think that im right and that this resource is obsolete. :/
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
Anyway, theres 2 abilities, one that target only heroes and one that target only units.. but you can always select what type of units it can select (ex: friendly, enemy, etc.)

My point here, ALiEN95 was that the system is not useful since these 2 abilities prevent players to buy items from the enemy shop(s).
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
as far as i remembered there were 2 different shop abilities:
one (e.g. from goblin merchant) that sells to all players
another one (e.g. from arcane vault) that only sells to allied players.

i think im right, but i might be wrong. but i still think that im right and that this resource is obsolete. :/
im not sure but....
i think its just because arcane vault has item´s list at items made not items sold,however you cannot have "start replenish interval" (it is the time needed for item to be available) when items are at items made list

the other thing is that allies can buy from your shop witch can be stopped with this system

btw: you can stop item-type from buying witch should be useful...
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
This is useless,as far as i know,arcane vault only sells to allied units as karland said.

Did you even test it? -.-
Did you read this?

This system can:
-stop players to buy from other players
-stop hero-type to buy item-type
(for example you can make mages unable to buy swords)
(you can also stop selling units by disableing gold/wood/food cap for owner of HERO[(Integer A)]) and setting gold/wood/food cap back to normal at second trigger)
(you can also make hero not to buy something based to any conditions you want)

for example:
If you want to display gold/lumber in your game even if hero is not near shop than do
-increase range of "Select Hero" / "Shop Sharing" ability in your shop
-make unit unable to buy if disatance from shop and hero is to long

...you can make any conditions you want to sell or not sell item to unit and that was impossible
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
Whole system is overcomplicated. You just have to check item classification to prevent mages from buying swords. And to prevent certain units from buying,just save true boolean in hashtable with unit ID as key,and destroy item each time unit with true boolean buys item.
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
Whole system is overcomplicated. You just have to check item classification to prevent mages from buying swords. And to prevent certain units from buying,just save true boolean in hashtable with unit ID as key,and destroy item each time unit with true boolean buys item.
why dont you try it and see if it works -.-

there is just not way to detect unit that is buying the item!,not with this event in trigger

this system is disableing any hero that should not buy the item (hero´s player must have shop selected too)
 
Last edited:
Level 13
Joined
Mar 4, 2009
Messages
1,156
Using
  • (Load 0 of (Key (Buying unit)) from (Last created hashtable)) Equal to True
you can check if a boolean is true,as i said in last post.

THERE IS NO WAY TO DETECT BUYING UNIT,PLEASE TEST SOMETHING BEFORE ANY MORE POSTING!

IM ALMOUSE SURE TAHT TEHRE IS NO EASIER WAY TO SOLVE THIS (and better dont try it)


i dont underestand,but even some mods are saying something before testing if they are write or wrong
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
You're the one that should test it.
Since you still don't believe me,check this: View attachment 85573
Sorry,you aren't right.
omg,stop selling comments please
i said "peace"

...
WITH THAT EVENT ITEM IS ALREADY SOLD SO THERE IS NO WAY TO STOP ITEM FROM BEING SOLD TO HERO

and please...you dont have to be offended....

again....im not a noob -.-,i know what im doing
 
Last edited:

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,191
I do not get exatly what this system is meant to do. When I tested it I managed to feed cheese to the do not give cheese hero. It also looks like a triggering mess and I can not see any form of logical data table structure to it. I see no use for this system in its current state.

In its current state it looks like a proof of concept map rather than anything practicle or usable.

What is really needed is for this to be combined with an item restriction system so you can set up data set and it will apply to the units for both purchases and pickups. Such a system would be highly useful for RPGs and could save a lot of hassle.

To make MUI will probably be difficult but really is important for the usability of such systems. I advise looking at how other parameters behave with the units involved. You might find some pattern or corolation that will let you make it MUI. I am aware this can be painful it can be, something as simple as a building construction detection system took me a long time to design and make.
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
I do not get exatly what this system is meant to do. When I tested it I managed to feed cheese to the do not give cheese hero. It also looks like a triggering mess and I can not see any form of logical data table structure to it. I see no use for this system in its current state.

In its current state it looks like a proof of concept map rather than anything practicle or usable.

What is really needed is for this to be combined with an item restriction system so you can set up data set and it will apply to the units for both purchases and pickups. Such a system would be highly useful for RPGs and could save a lot of hassle.

To make MUI will probably be difficult but really is important for the usability of such systems. I advise looking at how other parameters behave with the units involved. You might find some pattern or corolation that will let you make it MUI. I am aware this can be painful it can be, something as simple as a building construction detection system took me a long time to design and make.
"I do not get exatly what this system is meant to do. When I tested it I managed to feed cheese to the do not give cheese hero."
(that would not happen in games with one hero by player)
-they system only works for hero stored in HERO[X] variable and that hero gets big,so maybe shop didnt target the big hero big hero...anyway that mess will not happen when i update this

Edit:
i can make it fast for v1.06 (Done)

variables - 3
timer varaiable - ITEM
UnitGroup - "NotAllowedHeroes" (heroes that should not buy the item)
Item-Type - "ITEM"
-now it will work for all players and hero does not have to be stored in HERO[X] variable
-the system will not be able to detect the buying unit (as it never did) but it will work for the buying units
-should it get it approved?



[system description:
the system disables all heroes that should not buy the item
(so if you dont want mages to buy axe than you disable all mages)
also there is a "shop is selected by player" condition
so if you have 6 mages and 2 players have the shop selected only 2 mages could be they buying unit and they will be disabled
when i say disabled i mean
it increases level of inventory ability to 2 and on that level hero is unable to get items,after 0.00 seconds (timer expireing) they will again be able to get items ]

(and btw,not sure if you need it or if you already did it...
but you can use channel ability with 100 range and when unit is issued to build order him to use channel at that point instead and save the building,when unit begins casting channel order him to build the saved building,i heard that you could not detect the builder if 2 players targeted the same point but now its possible because builder is the casting unit xD )
 
Last edited:
Top