add ai behavior and fix bug with hero death