2 method, first one might be what you would prefer.
1. Add the unit the 'Locust' ability.
or
2. Give the unit ward classification.
I just tried this via "Add Ability" but I couldn't select Locust... How would I do that?!
call UnitAddAbility( wichunit, 039;Aloc039;)
why not just pause the unit?
library OrderLock initializer Init uses PUI
private struct Data
//! runtextmacro PUI()
static group g = CreateGroup()
static trigger t = CreateTrigger()
unit whichUnit
string order
widget wTar
location lTar
real xTar
real yTar
static method clear takes unit which returns nothing
local Data d = Data[which]
if d != 0 then
set d.order = null
set d.wTar = null
if d.lTar != null then
call RemoveLocation(d.lTar)
endif
set d.lTar = null
set d.xTar = 0
set d.yTar = 0
endif
endmethod
static method create takes unit which returns Data
local Data d = Data[which]
if d == 0 then
set d = Data.allocate()
set Data[which] = d
set d.xTar = 0
set d.yTar = 0
endif
call GroupAddUnit(Data.g,which)
return d
endmethod
endstruct
public function AddUnit takes unit whichUnit returns nothing
//Unit will not take any orders
call GroupAddUnit(Data.g,whichUnit)
endfunction
public function ClearUnit takes unit whichUnit returns nothing
//Unit will allow control again
call Data.clear(whichUnit)
call GroupRemoveUnit(Data.g,whichUnit)
endfunction
public function IssuePtOrderLoc takes unit whichUnit, string order, location where returns nothing
local Data d
call Data.clear(whichUnit)
set d = Data.create(whichUnit)
set d.order = order
set d.lTar = where
call IssuePointOrderLoc(whichUnit,order,where)
endfunction
public function IssueImOrder takes unit whichUnit, string order returns nothing
local Data d
call Data.clear(whichUnit)
set d = Data.create(whichUnit)
set d.order = order
call IssueImmediateOrder(whichUnit,order)
endfunction
public function IssuePtOrder takes unit whichUnit, string order, real x, real y returns nothing
local Data d
call Data.clear(whichUnit)
set d = Data.create(whichUnit)
set d.order = order
set d.xTar = x
set d.yTar = y
call IssuePointOrder(whichUnit,order,x,y)
endfunction
public function IssueTarOrder takes unit whichUnit, string order, widget targetWidget returns nothing
local Data d
call Data.clear(whichUnit)
set d = Data.create(whichUnit)
set d.order = order
set d.wTar = targetWidget
call IssueTargetOrder(whichUnit,order,targetWidget)
endfunction
public function ReIssueOrder takes unit whichUnit returns nothing
local Data d
if IsUnitInGroup(whichUnit,Data.g) == false then
return
endif
set d = Data.create(whichUnit)
call DisableTrigger(Data.t)
if d.wTar != null then
call IssueTargetOrder(whichUnit,d.order,d.wTar)
elseif d.lTar != null then
call IssuePointOrderLoc(whichUnit,d.order,d.lTar)
elseif d.xTar != 0 and d.yTar != 0 then
call IssuePointOrder(whichUnit,d.order,d.xTar,d.yTar)
elseif d.order != null then
call IssueImmediateOrder(whichUnit,d.order)
else
call IssueImmediateOrder(whichUnit,"stop")
endif
call EnableTrigger(Data.t)
endfunction
private function Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(),Data.g) //and OrderId2String(GetIssuedOrderId()) == "smart"
endfunction
private function Actions takes nothing returns nothing
call ReIssueOrder(GetTriggerUnit())
endfunction
private function Init takes nothing returns nothing
call TriggerRegisterAnyUnitEventBJ(Data.t,EVENT_PLAYER_UNIT_ISSUED_ORDER)
call TriggerAddCondition(Data.t,Condition(function Conditions))
call TriggerAddAction(Data.t,function Actions)
endfunction
endlibrary
call OrderLock_IssueTarOrder(whichUnit,"attack",Target_Unit)
Offtopic:
Simonake..... your Icon sucks.. Team Rocket is so much more win then Ash ;D
Why couldn't you add it locust ability and set movement speed to 0?
a unit is ordered an order.
pause unit
unpause unit
are you saying he will resume the order he was doing be4 the order that triggered the event?
Why couldn't you add it locust ability and set movement speed to 0?
Sorry i dont use to watch pokemon sorry. I don't know what you mean.