Moderator
M
Moderator
Bribe -
Destroying NotAllowedHeroes group? Why? This whole things needs a re-write, likely in JASS.
Destroying NotAllowedHeroes group? Why? This whole things needs a re-write, likely in JASS.
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)