HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Custom Jass AI - Hero buy items

03-25-2006, 03:27 PM#1
BertTheJasser
Hi there!
I'm currently working on an AI in jass for my hero arena and I want them to buy them items at their start location. I figured out that each item has it's specific buy order id but the order id even depends on the building(I think so).

So I just want to know if there is a diffrent way to make them buy items or at least simulate buying items.

Thx for reply
03-25-2006, 03:35 PM#2
Zoxc
You can put all items and prices in an array. When the heroes are close loop though to see if anything is worth buying. Compare free slots, gametime, etc. Then remove the price from player gold/lumber and give the hero the item.
03-26-2006, 10:31 AM#3
BertTheJasser
Ok, I thought of this, but some items have an 'cooldown', so you can't buy them twice in a period of time and you even don't see the shadow over the icon of the item for the cooldown if it was the last you bought.In Vex's HeroArena everything works well.... so there must be an alternative way to do this. btw Thx for reply
04-02-2006, 10:03 PM#4
Vexorian
Collapse JASS:
native IssueNeutralImmediateOrderById   takes player forWhichPlayer,unit neutralStructure, integer unitId returns boolean

hmnn, you are bert, that should be enough of an answer
04-03-2006, 11:32 AM#5
BertTheJasser
Does this work with player owned structures too?
Btw. Thx for reply +Rep
04-03-2006, 12:21 PM#6
Vexorian
I don't know, that would be a good experiment to make
04-03-2006, 03:22 PM#7
BertTheJasser
I've just tested it and... it works perfect. You just have to make sure that the unit is in range to buy items. Thx again.