grumblerbear
Chieftain
- Joined
- Sep 7, 2013
- Messages
- 17
I have
It work, but AI ignore this command
Code:
function SetUnitState (unit, mission_type, target_plot)
if (target_plot == nil) then
target_plot = unit:GetPlot();
end
unit:PopMission();
unit:PushMission(mission_type, target_plot:GetX(), target_plot:GetY(), 0, 0, 1, mission_type, target_plot, unit);
-- Game.SelectionListGameNetMessage(GameMessageTypes.GAMEMESSAGE_PUSH_MISSION, mission_type, target_plot:GetX(), target_plot:GetY(), 0, false, false);
end
local mission_type;
if (not player:IsBarbarian()) then
mission_type = MissionTypes.MISSION_HEAL;
else
mission_type = MissionTypes.MISSION_HOLD;
end
SetUnitState(unit, mission_type);
It work, but AI ignore this command
