Full Command Cart is:
Jass code handler:
and
Object trick (included as demo map) (Channel spell with smart order)
This allow you to have unit (or multiple up to unlimited number) with full command cart filled with spells without spellbooks (total 12).
And possible advanced controls (like double click handling, left mouse button handling and other - NOT INCLUDED this version).
Jass code handler:
JASS:
library FCC initializer INIT
//FullCommandCart
globals
unit WHO
destructable DES
item ITM
unit UNT
real X
real Y
timer TT = CreateTimer()
trigger MZ = CreateTrigger()
endglobals
function order takes nothing returns nothing
if DES != null then
call IssueTargetOrder(WHO,"smart",DES)
elseif ITM != null then
call IssueTargetOrder(WHO,"smart",ITM)
elseif UNT != null then
if IsUnitAlly(UNT,GetOwningPlayer(WHO)) then
call IssueTargetOrder(WHO,"smart",UNT)
else
call IssueTargetOrder(WHO,"attack",UNT)
endif
else
call IssuePointOrder(WHO,"move",X,Y)
endif
call UnitAddAbility(WHO,039;A000039;)
call EnableTrigger(MZ)
endfunction
function FCC_MAIN takes nothing returns nothing
if GetIssuedOrderId() != OrderId("smart") then
return
endif
set WHO = GetTriggerUnit()
set DES = GetOrderTargetDestructable()
set ITM = GetOrderTargetItem()
set UNT = GetOrderTargetUnit()
set X = GetOrderPointX()
set Y = GetOrderPointY()
call DisableTrigger(MZ)
call UnitRemoveAbility(WHO,039;A000039;)
call TimerStart(TT,0.0,false,function order)
endfunction
function INIT takes nothing returns nothing
//This calls will block standart command cart buttorns for player 0
call SetPlayerAlliance(Player(0), Player(0), ALLIANCE_SHARED_ADVANCED_CONTROL, false)
call SetPlayerAlliance(Player(0), Player(0), ALLIANCE_SHARED_CONTROL, false)
//this calls will disable attack notifications
call SetPlayerAlliance(Player(0), Player(0), ALLIANCE_HELP_REQUEST, true)
call SetPlayerAlliance(Player(0), Player(0), ALLIANCE_HELP_RESPONSE, true)
//Remove "share control" message
call ClearTextMessages()
//register event for channel hit
call TriggerRegisterAnyUnitEventBJ( MZ, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )
call TriggerRegisterAnyUnitEventBJ( MZ, EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerRegisterAnyUnitEventBJ( MZ, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
call TriggerAddAction( MZ, function FCC_MAIN )
endfunction
endlibrary
and
Object trick (included as demo map) (Channel spell with smart order)
This allow you to have unit (or multiple up to unlimited number) with full command cart filled with spells without spellbooks (total 12).
And possible advanced controls (like double click handling, left mouse button handling and other - NOT INCLUDED this version).