• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Vote for the theme of Hive's HD Modeling Contest #7! Click here to vote! - Please only vote if you plan on participating❗️

[JASS] Remove trading abilities

Status
Not open for further replies.
Level 27
Joined
Feb 2, 2006
Messages
1,592
Hey,
I want to share a unit which sells items and therefore I want to remove the trading abilities during the share. Afterwards the unit should sell items again:
JASS:
call UnitRemoveAbility(this.m_unit, 'Aneu')
				call UnitRemoveAbility(this.m_unit, 'Asid')
				call UnitRemoveAbility(this.m_unit, 'Apit')
				call SetItemTypeSlots(this.m_unit, 0)
does not prevent the unit from selling items. How do I remove the selling ability? Do I have to remove all item types manually from the stock?
The "select hero" abilitiy is always present as well as the sold items.
 
Level 27
Joined
Feb 2, 2006
Messages
1,592
Removing 'Aneu' only did not prevent the items from being shown to me.
As you can see I did remove it and the owner of the unit was a player with advanced shared control, so I could control the unit.
Whenever I selected the unit I still saw the sold items even without selecting a hero.

For now I use the workaround that there is another fixed unit (marketplace) which does the selling so I do not have to remove any abilities at all.
 
Another, perhaps more drastic solution:

Make two shops. One which can sell items, and one which can't. Make two abilities based on "chaos", one has "transformed unit type" set to the selling shop, and one to the non-selling. Remember to remove the tech requirements from the ability.

Whenever you want to disable it from selling, just add the ability morphing it to a non-selling shop, and vice versa.
 
Status
Not open for further replies.
Top