NeuroToxin
New Member
- Reaction score
- 46
You're all on drugs? use Item Type, if Item Type is equal to Bow, and Unit Manipulating Item is not archer, then say error.
Absolutely not. Do something like this:Well then i have to make 1 trigger for every weapon
Absolutely not. Do something like this:
Trigger:
- Item VS Class Check
- Events
- Unit - A unit Is issued an order targeting an object
- Conditions
- (Target item of issued order) Not equal to No item
- Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Unit-type of (Triggering unit)) Not equal to Archer
- Or - Any (Conditions) are true
- Conditions
- (Item-type of (Target item of issued order)) Equal to Bow
- (Item-type of (Target item of issued order)) Equal to Great Bow
- (Item-type of (Target item of issued order)) Equal to Super Bow
- Then - Actions
- Game - Display to (Owner of (Triggering Unit)) the text: You can't wield Bows!
- Unit - Order (Triggering unit) to Stop
- Else - Actions
This checks if the unit is incompatible with the item it is ordered to pick up, and if so prevents the unit from even going to pick it up. You can use NeuroToxin's way if you don't mind forcing a unit to waste time walking over to an item, just to find out it can't be picked up. Copying this If/Then/Else in to the Else actions will make it work for any item.
function Trig_Backpack_Conditions takes nothing returns boolean
if ( not ( GetItemType(GetManipulatedItem()) == ITEM_TYPE_ARTIFACT ) ) then
return false
endif
return true
endfunction
function Trig_Backpack_Func002Func002Func002Func001001 takes nothing returns boolean
return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 2)) == ITEM_TYPE_ARTIFACT )
endfunction
function Trig_Backpack_Func002Func002Func002Func001002 takes nothing returns boolean
return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 2)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 1)) )
endfunction
function Trig_Backpack_Func002Func002Func002Func002001 takes nothing returns boolean
return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 3)) == ITEM_TYPE_ARTIFACT )
endfunction
function Trig_Backpack_Func002Func002Func002Func002002 takes nothing returns boolean
return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 3)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 1)) )
endfunction
function Trig_Backpack_Func002Func002Func002Func003001 takes nothing returns boolean
return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 4)) == ITEM_TYPE_ARTIFACT )
endfunction
function Trig_Backpack_Func002Func002Func002Func003002 takes nothing returns boolean
return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 4)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 1)) )
endfunction
function Trig_Backpack_Func002Func002Func002Func004001 takes nothing returns boolean
return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 5)) == ITEM_TYPE_ARTIFACT )
endfunction
function Trig_Backpack_Func002Func002Func002Func004002 takes nothing returns boolean
return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 5)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 1)) )
endfunction
function Trig_Backpack_Func002Func002Func002Func005001 takes nothing returns boolean
return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 6)) == ITEM_TYPE_ARTIFACT )
endfunction
function Trig_Backpack_Func002Func002Func002Func005002 takes nothing returns boolean
return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 6)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 1)) )
endfunction
function Trig_Backpack_Func002Func002Func002C takes nothing returns boolean
if ( GetBooleanAnd( Trig_Backpack_Func002Func002Func002Func001001(), Trig_Backpack_Func002Func002Func002Func001002() ) ) then
return true
endif
if ( GetBooleanAnd( Trig_Backpack_Func002Func002Func002Func002001(), Trig_Backpack_Func002Func002Func002Func002002() ) ) then
return true
endif
if ( GetBooleanAnd( Trig_Backpack_Func002Func002Func002Func003001(), Trig_Backpack_Func002Func002Func002Func003002() ) ) then
return true
endif
if ( GetBooleanAnd( Trig_Backpack_Func002Func002Func002Func004001(), Trig_Backpack_Func002Func002Func002Func004002() ) ) then
return true
endif
if ( GetBooleanAnd( Trig_Backpack_Func002Func002Func002Func005001(), Trig_Backpack_Func002Func002Func002Func005002() ) ) then
return true
endif
return false
endfunction
function Trig_Backpack_Func002Func002C takes nothing returns boolean
if ( not Trig_Backpack_Func002Func002Func002C() ) then
return false
endif
return true
endfunction
function Trig_Backpack_Func002C takes nothing returns boolean
if ( not ( GetManipulatedItem() == UnitItemInSlotBJ(GetManipulatingUnit(), 1) ) ) then
return false
endif
return true
endfunction
function Trig_Backpack_Func003Func002Func002Func001001 takes nothing returns boolean
return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 1)) == ITEM_TYPE_ARTIFACT )
endfunction
function Trig_Backpack_Func003Func002Func002Func001002 takes nothing returns boolean
return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 1)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 2)) )
endfunction
function Trig_Backpack_Func003Func002Func002Func002001 takes nothing returns boolean
return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 3)) == ITEM_TYPE_ARTIFACT )
endfunction
function Trig_Backpack_Func003Func002Func002Func002002 takes nothing returns boolean
return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 3)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 2)) )
endfunction
function Trig_Backpack_Func003Func002Func002Func003001 takes nothing returns boolean
return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 4)) == ITEM_TYPE_ARTIFACT )
endfunction
function Trig_Backpack_Func003Func002Func002Func003002 takes nothing returns boolean
return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 4)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 2)) )
endfunction
function Trig_Backpack_Func003Func002Func002Func004001 takes nothing returns boolean
return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 5)) == ITEM_TYPE_ARTIFACT )
endfunction
function Trig_Backpack_Func003Func002Func002Func004002 takes nothing returns boolean
return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 5)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 2)) )
endfunction
function Trig_Backpack_Func003Func002Func002Func005001 takes nothing returns boolean
return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 6)) == ITEM_TYPE_ARTIFACT )
endfunction
function Trig_Backpack_Func003Func002Func002Func005002 takes nothing returns boolean
return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 6)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 2)) )
endfunction
function Trig_Backpack_Func003Func002Func002C takes nothing returns boolean
if ( GetBooleanAnd( Trig_Backpack_Func003Func002Func002Func001001(), Trig_Backpack_Func003Func002Func002Func001002() ) ) then
return true
endif
if ( GetBooleanAnd( Trig_Backpack_Func003Func002Func002Func002001(), Trig_Backpack_Func003Func002Func002Func002002() ) ) then
return true
endif
if ( GetBooleanAnd( Trig_Backpack_Func003Func002Func002Func003001(), Trig_Backpack_Func003Func002Func002Func003002() ) ) then
return true
endif
if ( GetBooleanAnd( Trig_Backpack_Func003Func002Func002Func004001(), Trig_Backpack_Func003Func002Func002Func004002() ) ) then
return true
endif
if ( GetBooleanAnd( Trig_Backpack_Func003Func002Func002Func005001(), Trig_Backpack_Func003Func002Func002Func005002() ) ) then
return true
endif
return false
endfunction
function Trig_Backpack_Func003Func002C takes nothing returns boolean
if ( not Trig_Backpack_Func003Func002Func002C() ) then
return false
endif
return true
endfunction
function Trig_Backpack_Func003C takes nothing returns boolean
if ( not ( GetManipulatedItem() == UnitItemInSlotBJ(GetManipulatingUnit(), 2) ) ) then
return false
endif
return true
endfunction
function Trig_Backpack_Func004Func002Func002Func001001 takes nothing returns boolean
return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 1)) == ITEM_TYPE_ARTIFACT )
endfunction
function Trig_Backpack_Func004Func002Func002Func001002 takes nothing returns boolean
return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 1)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 3)) )
endfunction
function Trig_Backpack_Func004Func002Func002Func002001 takes nothing returns boolean
return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 2)) == ITEM_TYPE_ARTIFACT )
endfunction
function Trig_Backpack_Func004Func002Func002Func002002 takes nothing returns boolean
return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 2)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 3)) )
endfunction
function Trig_Backpack_Func004Func002Func002Func003001 takes nothing returns boolean
return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 4)) == ITEM_TYPE_ARTIFACT )
endfunction
function Trig_Backpack_Func004Func002Func002Func003002 takes nothing returns boolean
return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 4)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 3)) )
endfunction
function Trig_Backpack_Func004Func002Func002Func004001 takes nothing returns boolean
return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 5)) == ITEM_TYPE_ARTIFACT )
endfunction
function Trig_Backpack_Func004Func002Func002Func004002 takes nothing returns boolean
return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 5)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 3)) )
endfunction
function Trig_Backpack_Func004Func002Func002Func005001 takes nothing returns boolean
return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 6)) == ITEM_TYPE_ARTIFACT )
endfunction
function Trig_Backpack_Func004Func002Func002Func005002 takes nothing returns boolean
return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 6)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 3)) )
endfunction
function Trig_Backpack_Func004Func002Func002C takes nothing returns boolean
if ( GetBooleanAnd( Trig_Backpack_Func004Func002Func002Func001001(), Trig_Backpack_Func004Func002Func002Func001002() ) ) then
return true
endif
if ( GetBooleanAnd( Trig_Backpack_Func004Func002Func002Func002001(), Trig_Backpack_Func004Func002Func002Func002002() ) ) then
return true
endif
if ( GetBooleanAnd( Trig_Backpack_Func004Func002Func002Func003001(), Trig_Backpack_Func004Func002Func002Func003002() ) ) then
return true
endif
if ( GetBooleanAnd( Trig_Backpack_Func004Func002Func002Func004001(), Trig_Backpack_Func004Func002Func002Func004002() ) ) then
return true
endif
if ( GetBooleanAnd( Trig_Backpack_Func004Func002Func002Func005001(), Trig_Backpack_Func004Func002Func002Func005002() ) ) then
return true
endif
return false
endfunction
function Trig_Backpack_Func004Func002C takes nothing returns boolean
if ( not Trig_Backpack_Func004Func002Func002C() ) then
return false
endif
return true
endfunction
function Trig_Backpack_Func004C takes nothing returns boolean
if ( not ( GetManipulatedItem() == UnitItemInSlotBJ(GetManipulatingUnit(), 3) ) ) then
return false
endif
return true
endfunction
function Trig_Backpack_Func005Func002Func002Func001001 takes nothing returns boolean
return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 1)) == ITEM_TYPE_ARTIFACT )
endfunction
function Trig_Backpack_Func005Func002Func002Func001002 takes nothing returns boolean
return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 1)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 4)) )
endfunction
function Trig_Backpack_Func005Func002Func002Func002001 takes nothing returns boolean
return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 2)) == ITEM_TYPE_ARTIFACT )
endfunction
function Trig_Backpack_Func005Func002Func002Func002002 takes nothing returns boolean
return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 2)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 4)) )
endfunction
function Trig_Backpack_Func005Func002Func002Func003001 takes nothing returns boolean
return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 3)) == ITEM_TYPE_ARTIFACT )
endfunction
function Trig_Backpack_Func005Func002Func002Func003002 takes nothing returns boolean
return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 3)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 4)) )
endfunction
function Trig_Backpack_Func005Func002Func002Func004001 takes nothing returns boolean
return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 5)) == ITEM_TYPE_ARTIFACT )
endfunction
function Trig_Backpack_Func005Func002Func002Func004002 takes nothing returns boolean
return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 5)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 4)) )
endfunction
function Trig_Backpack_Func005Func002Func002Func005001 takes nothing returns boolean
return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 6)) == ITEM_TYPE_ARTIFACT )
endfunction
function Trig_Backpack_Func005Func002Func002Func005002 takes nothing returns boolean
return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 6)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 4)) )
endfunction
function Trig_Backpack_Func005Func002Func002C takes nothing returns boolean
if ( GetBooleanAnd( Trig_Backpack_Func005Func002Func002Func001001(), Trig_Backpack_Func005Func002Func002Func001002() ) ) then
return true
endif
if ( GetBooleanAnd( Trig_Backpack_Func005Func002Func002Func002001(), Trig_Backpack_Func005Func002Func002Func002002() ) ) then
return true
endif
if ( GetBooleanAnd( Trig_Backpack_Func005Func002Func002Func003001(), Trig_Backpack_Func005Func002Func002Func003002() ) ) then
return true
endif
if ( GetBooleanAnd( Trig_Backpack_Func005Func002Func002Func004001(), Trig_Backpack_Func005Func002Func002Func004002() ) ) then
return true
endif
if ( GetBooleanAnd( Trig_Backpack_Func005Func002Func002Func005001(), Trig_Backpack_Func005Func002Func002Func005002() ) ) then
return true
endif
return false
endfunction
function Trig_Backpack_Func005Func002C takes nothing returns boolean
if ( not Trig_Backpack_Func005Func002Func002C() ) then
return false
endif
return true
endfunction
function Trig_Backpack_Func005C takes nothing returns boolean
if ( not ( GetManipulatedItem() == UnitItemInSlotBJ(GetManipulatingUnit(), 4) ) ) then
return false
endif
return true
endfunction
function Trig_Backpack_Func006Func002Func002Func001001 takes nothing returns boolean
return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 1)) == ITEM_TYPE_ARTIFACT )
endfunction
function Trig_Backpack_Func006Func002Func002Func001002 takes nothing returns boolean
return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 1)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 5)) )
endfunction
function Trig_Backpack_Func006Func002Func002Func002001 takes nothing returns boolean
return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 2)) == ITEM_TYPE_ARTIFACT )
endfunction
function Trig_Backpack_Func006Func002Func002Func002002 takes nothing returns boolean
return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 2)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 5)) )
endfunction
function Trig_Backpack_Func006Func002Func002Func003001 takes nothing returns boolean
return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 3)) == ITEM_TYPE_ARTIFACT )
endfunction
function Trig_Backpack_Func006Func002Func002Func003002 takes nothing returns boolean
return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 3)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 5)) )
endfunction
function Trig_Backpack_Func006Func002Func002Func004001 takes nothing returns boolean
return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 4)) == ITEM_TYPE_ARTIFACT )
endfunction
function Trig_Backpack_Func006Func002Func002Func004002 takes nothing returns boolean
return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 4)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 5)) )
endfunction
function Trig_Backpack_Func006Func002Func002Func005001 takes nothing returns boolean
return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 6)) == ITEM_TYPE_ARTIFACT )
endfunction
function Trig_Backpack_Func006Func002Func002Func005002 takes nothing returns boolean
return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 6)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 5)) )
endfunction
function Trig_Backpack_Func006Func002Func002C takes nothing returns boolean
if ( GetBooleanAnd( Trig_Backpack_Func006Func002Func002Func001001(), Trig_Backpack_Func006Func002Func002Func001002() ) ) then
return true
endif
if ( GetBooleanAnd( Trig_Backpack_Func006Func002Func002Func002001(), Trig_Backpack_Func006Func002Func002Func002002() ) ) then
return true
endif
if ( GetBooleanAnd( Trig_Backpack_Func006Func002Func002Func003001(), Trig_Backpack_Func006Func002Func002Func003002() ) ) then
return true
endif
if ( GetBooleanAnd( Trig_Backpack_Func006Func002Func002Func004001(), Trig_Backpack_Func006Func002Func002Func004002() ) ) then
return true
endif
if ( GetBooleanAnd( Trig_Backpack_Func006Func002Func002Func005001(), Trig_Backpack_Func006Func002Func002Func005002() ) ) then
return true
endif
return false
endfunction
function Trig_Backpack_Func006Func002C takes nothing returns boolean
if ( not Trig_Backpack_Func006Func002Func002C() ) then
return false
endif
return true
endfunction
function Trig_Backpack_Func006C takes nothing returns boolean
if ( not ( GetManipulatedItem() == UnitItemInSlotBJ(GetManipulatingUnit(), 5) ) ) then
return false
endif
return true
endfunction
function Trig_Backpack_Func007Func002Func002Func001001 takes nothing returns boolean
return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 1)) == ITEM_TYPE_ARTIFACT )
endfunction
function Trig_Backpack_Func007Func002Func002Func001002 takes nothing returns boolean
return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 1)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 6)) )
endfunction
function Trig_Backpack_Func007Func002Func002Func002001 takes nothing returns boolean
return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 2)) == ITEM_TYPE_ARTIFACT )
endfunction
function Trig_Backpack_Func007Func002Func002Func002002 takes nothing returns boolean
return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 2)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 6)) )
endfunction
function Trig_Backpack_Func007Func002Func002Func003001 takes nothing returns boolean
return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 3)) == ITEM_TYPE_ARTIFACT )
endfunction
function Trig_Backpack_Func007Func002Func002Func003002 takes nothing returns boolean
return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 3)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 6)) )
endfunction
function Trig_Backpack_Func007Func002Func002Func004001 takes nothing returns boolean
return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 4)) == ITEM_TYPE_ARTIFACT )
endfunction
function Trig_Backpack_Func007Func002Func002Func004002 takes nothing returns boolean
return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 4)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 6)) )
endfunction
function Trig_Backpack_Func007Func002Func002Func005001 takes nothing returns boolean
return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 5)) == ITEM_TYPE_ARTIFACT )
endfunction
function Trig_Backpack_Func007Func002Func002Func005002 takes nothing returns boolean
return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 5)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 6)) )
endfunction
function Trig_Backpack_Func007Func002Func002C takes nothing returns boolean
if ( GetBooleanAnd( Trig_Backpack_Func007Func002Func002Func001001(), Trig_Backpack_Func007Func002Func002Func001002() ) ) then
return true
endif
if ( GetBooleanAnd( Trig_Backpack_Func007Func002Func002Func002001(), Trig_Backpack_Func007Func002Func002Func002002() ) ) then
return true
endif
if ( GetBooleanAnd( Trig_Backpack_Func007Func002Func002Func003001(), Trig_Backpack_Func007Func002Func002Func003002() ) ) then
return true
endif
if ( GetBooleanAnd( Trig_Backpack_Func007Func002Func002Func004001(), Trig_Backpack_Func007Func002Func002Func004002() ) ) then
return true
endif
if ( GetBooleanAnd( Trig_Backpack_Func007Func002Func002Func005001(), Trig_Backpack_Func007Func002Func002Func005002() ) ) then
return true
endif
return false
endfunction
function Trig_Backpack_Func007Func002C takes nothing returns boolean
if ( not Trig_Backpack_Func007Func002Func002C() ) then
return false
endif
return true
endfunction
function Trig_Backpack_Func007C takes nothing returns boolean
if ( not ( GetManipulatedItem() == UnitItemInSlotBJ(GetManipulatingUnit(), 6) ) ) then
return false
endif
return true
endfunction
function Trig_Backpack_Actions takes nothing returns nothing
if ( Trig_Backpack_Func002C() ) then
if ( Trig_Backpack_Func002Func002C() ) then
call UnitRemoveItemSwapped( GetManipulatedItem(), GetManipulatingUnit() )
else
call DoNothing( )
endif
else
call DoNothing( )
endif
if ( Trig_Backpack_Func003C() ) then
if ( Trig_Backpack_Func003Func002C() ) then
call UnitRemoveItemSwapped( GetManipulatedItem(), GetManipulatingUnit() )
else
call DoNothing( )
endif
else
call DoNothing( )
endif
if ( Trig_Backpack_Func004C() ) then
if ( Trig_Backpack_Func004Func002C() ) then
call UnitRemoveItemSwapped( GetManipulatedItem(), GetManipulatingUnit() )
else
call DoNothing( )
endif
else
call DoNothing( )
endif
if ( Trig_Backpack_Func005C() ) then
if ( Trig_Backpack_Func005Func002C() ) then
call UnitRemoveItemSwapped( GetManipulatedItem(), GetManipulatingUnit() )
else
call DoNothing( )
endif
else
call DoNothing( )
endif
if ( Trig_Backpack_Func006C() ) then
if ( Trig_Backpack_Func006Func002C() ) then
call UnitRemoveItemSwapped( GetManipulatedItem(), GetManipulatingUnit() )
else
call DoNothing( )
endif
else
call DoNothing( )
endif
if ( Trig_Backpack_Func007C() ) then
if ( Trig_Backpack_Func007Func002C() ) then
call UnitRemoveItemSwapped( GetManipulatedItem(), GetManipulatingUnit() )
else
call DoNothing( )
endif
else
call DoNothing( )
endif
endfunction
//===============================================================
function InitTrig_Backpack takes nothing returns nothing
set gg_trg_Backpack = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Backpack, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( gg_trg_Backpack, Condition( function Trig_Backpack_Conditions ) )
call TriggerAddAction( gg_trg_Backpack, function Trig_Backpack_Actions )
endfunction
HydraRancher said:I suppose you could have a "2" in front to retain the zeros.
My end goal is always to do it the most efficient way if at all possible without losing functionality.
It always will turn out to be the better option.
You're all on drugs?
The thing is it dosnt drop the item now.
Trigger:
- test
- Events
- Unit - A unit Is issued an order targeting an object
- Conditions
- (Item-type of (Target item of issued order)) Not equal to (Item-type of No item)
- Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Unit-type of (Triggering unit)) Not equal to Spearman
- Or - Any (Conditions) are true
- Conditions
- (Item-type of (Target item of issued order)) Equal to bow test
- Then - Actions
- Hero - Drop (Target item of issued order) from (Target unit of issued order)
- Quest - Display to (Player group((Owner of (Triggering unit)))) the Hint message: |cffff0000You can't...
- Unit - Order (Triggering unit) to Stop
- Else - Actions
sorry for the multipost but here is my trigger (its complicated but it works just fine)
JASS:function Trig_Backpack_Conditions takes nothing returns boolean if ( not ( GetItemType(GetManipulatedItem()) == ITEM_TYPE_ARTIFACT ) ) then return false endif return true endfunction function Trig_Backpack_Func002Func002Func002Func001001 takes nothing returns boolean return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 2)) == ITEM_TYPE_ARTIFACT ) endfunction function Trig_Backpack_Func002Func002Func002Func001002 takes nothing returns boolean return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 2)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 1)) ) endfunction function Trig_Backpack_Func002Func002Func002Func002001 takes nothing returns boolean return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 3)) == ITEM_TYPE_ARTIFACT ) endfunction function Trig_Backpack_Func002Func002Func002Func002002 takes nothing returns boolean return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 3)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 1)) ) endfunction function Trig_Backpack_Func002Func002Func002Func003001 takes nothing returns boolean return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 4)) == ITEM_TYPE_ARTIFACT ) endfunction function Trig_Backpack_Func002Func002Func002Func003002 takes nothing returns boolean return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 4)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 1)) ) endfunction function Trig_Backpack_Func002Func002Func002Func004001 takes nothing returns boolean return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 5)) == ITEM_TYPE_ARTIFACT ) endfunction function Trig_Backpack_Func002Func002Func002Func004002 takes nothing returns boolean return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 5)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 1)) ) endfunction function Trig_Backpack_Func002Func002Func002Func005001 takes nothing returns boolean return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 6)) == ITEM_TYPE_ARTIFACT ) endfunction function Trig_Backpack_Func002Func002Func002Func005002 takes nothing returns boolean return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 6)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 1)) ) endfunction function Trig_Backpack_Func002Func002Func002C takes nothing returns boolean if ( GetBooleanAnd( Trig_Backpack_Func002Func002Func002Func001001(), Trig_Backpack_Func002Func002Func002Func001002() ) ) then return true endif if ( GetBooleanAnd( Trig_Backpack_Func002Func002Func002Func002001(), Trig_Backpack_Func002Func002Func002Func002002() ) ) then return true endif if ( GetBooleanAnd( Trig_Backpack_Func002Func002Func002Func003001(), Trig_Backpack_Func002Func002Func002Func003002() ) ) then return true endif if ( GetBooleanAnd( Trig_Backpack_Func002Func002Func002Func004001(), Trig_Backpack_Func002Func002Func002Func004002() ) ) then return true endif if ( GetBooleanAnd( Trig_Backpack_Func002Func002Func002Func005001(), Trig_Backpack_Func002Func002Func002Func005002() ) ) then return true endif return false endfunction function Trig_Backpack_Func002Func002C takes nothing returns boolean if ( not Trig_Backpack_Func002Func002Func002C() ) then return false endif return true endfunction function Trig_Backpack_Func002C takes nothing returns boolean if ( not ( GetManipulatedItem() == UnitItemInSlotBJ(GetManipulatingUnit(), 1) ) ) then return false endif return true endfunction function Trig_Backpack_Func003Func002Func002Func001001 takes nothing returns boolean return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 1)) == ITEM_TYPE_ARTIFACT ) endfunction function Trig_Backpack_Func003Func002Func002Func001002 takes nothing returns boolean return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 1)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 2)) ) endfunction function Trig_Backpack_Func003Func002Func002Func002001 takes nothing returns boolean return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 3)) == ITEM_TYPE_ARTIFACT ) endfunction function Trig_Backpack_Func003Func002Func002Func002002 takes nothing returns boolean return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 3)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 2)) ) endfunction function Trig_Backpack_Func003Func002Func002Func003001 takes nothing returns boolean return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 4)) == ITEM_TYPE_ARTIFACT ) endfunction function Trig_Backpack_Func003Func002Func002Func003002 takes nothing returns boolean return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 4)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 2)) ) endfunction function Trig_Backpack_Func003Func002Func002Func004001 takes nothing returns boolean return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 5)) == ITEM_TYPE_ARTIFACT ) endfunction function Trig_Backpack_Func003Func002Func002Func004002 takes nothing returns boolean return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 5)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 2)) ) endfunction function Trig_Backpack_Func003Func002Func002Func005001 takes nothing returns boolean return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 6)) == ITEM_TYPE_ARTIFACT ) endfunction function Trig_Backpack_Func003Func002Func002Func005002 takes nothing returns boolean return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 6)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 2)) ) endfunction function Trig_Backpack_Func003Func002Func002C takes nothing returns boolean if ( GetBooleanAnd( Trig_Backpack_Func003Func002Func002Func001001(), Trig_Backpack_Func003Func002Func002Func001002() ) ) then return true endif if ( GetBooleanAnd( Trig_Backpack_Func003Func002Func002Func002001(), Trig_Backpack_Func003Func002Func002Func002002() ) ) then return true endif if ( GetBooleanAnd( Trig_Backpack_Func003Func002Func002Func003001(), Trig_Backpack_Func003Func002Func002Func003002() ) ) then return true endif if ( GetBooleanAnd( Trig_Backpack_Func003Func002Func002Func004001(), Trig_Backpack_Func003Func002Func002Func004002() ) ) then return true endif if ( GetBooleanAnd( Trig_Backpack_Func003Func002Func002Func005001(), Trig_Backpack_Func003Func002Func002Func005002() ) ) then return true endif return false endfunction function Trig_Backpack_Func003Func002C takes nothing returns boolean if ( not Trig_Backpack_Func003Func002Func002C() ) then return false endif return true endfunction function Trig_Backpack_Func003C takes nothing returns boolean if ( not ( GetManipulatedItem() == UnitItemInSlotBJ(GetManipulatingUnit(), 2) ) ) then return false endif return true endfunction function Trig_Backpack_Func004Func002Func002Func001001 takes nothing returns boolean return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 1)) == ITEM_TYPE_ARTIFACT ) endfunction function Trig_Backpack_Func004Func002Func002Func001002 takes nothing returns boolean return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 1)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 3)) ) endfunction function Trig_Backpack_Func004Func002Func002Func002001 takes nothing returns boolean return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 2)) == ITEM_TYPE_ARTIFACT ) endfunction function Trig_Backpack_Func004Func002Func002Func002002 takes nothing returns boolean return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 2)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 3)) ) endfunction function Trig_Backpack_Func004Func002Func002Func003001 takes nothing returns boolean return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 4)) == ITEM_TYPE_ARTIFACT ) endfunction function Trig_Backpack_Func004Func002Func002Func003002 takes nothing returns boolean return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 4)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 3)) ) endfunction function Trig_Backpack_Func004Func002Func002Func004001 takes nothing returns boolean return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 5)) == ITEM_TYPE_ARTIFACT ) endfunction function Trig_Backpack_Func004Func002Func002Func004002 takes nothing returns boolean return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 5)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 3)) ) endfunction function Trig_Backpack_Func004Func002Func002Func005001 takes nothing returns boolean return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 6)) == ITEM_TYPE_ARTIFACT ) endfunction function Trig_Backpack_Func004Func002Func002Func005002 takes nothing returns boolean return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 6)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 3)) ) endfunction function Trig_Backpack_Func004Func002Func002C takes nothing returns boolean if ( GetBooleanAnd( Trig_Backpack_Func004Func002Func002Func001001(), Trig_Backpack_Func004Func002Func002Func001002() ) ) then return true endif if ( GetBooleanAnd( Trig_Backpack_Func004Func002Func002Func002001(), Trig_Backpack_Func004Func002Func002Func002002() ) ) then return true endif if ( GetBooleanAnd( Trig_Backpack_Func004Func002Func002Func003001(), Trig_Backpack_Func004Func002Func002Func003002() ) ) then return true endif if ( GetBooleanAnd( Trig_Backpack_Func004Func002Func002Func004001(), Trig_Backpack_Func004Func002Func002Func004002() ) ) then return true endif if ( GetBooleanAnd( Trig_Backpack_Func004Func002Func002Func005001(), Trig_Backpack_Func004Func002Func002Func005002() ) ) then return true endif return false endfunction function Trig_Backpack_Func004Func002C takes nothing returns boolean if ( not Trig_Backpack_Func004Func002Func002C() ) then return false endif return true endfunction function Trig_Backpack_Func004C takes nothing returns boolean if ( not ( GetManipulatedItem() == UnitItemInSlotBJ(GetManipulatingUnit(), 3) ) ) then return false endif return true endfunction function Trig_Backpack_Func005Func002Func002Func001001 takes nothing returns boolean return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 1)) == ITEM_TYPE_ARTIFACT ) endfunction function Trig_Backpack_Func005Func002Func002Func001002 takes nothing returns boolean return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 1)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 4)) ) endfunction function Trig_Backpack_Func005Func002Func002Func002001 takes nothing returns boolean return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 2)) == ITEM_TYPE_ARTIFACT ) endfunction function Trig_Backpack_Func005Func002Func002Func002002 takes nothing returns boolean return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 2)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 4)) ) endfunction function Trig_Backpack_Func005Func002Func002Func003001 takes nothing returns boolean return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 3)) == ITEM_TYPE_ARTIFACT ) endfunction function Trig_Backpack_Func005Func002Func002Func003002 takes nothing returns boolean return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 3)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 4)) ) endfunction function Trig_Backpack_Func005Func002Func002Func004001 takes nothing returns boolean return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 5)) == ITEM_TYPE_ARTIFACT ) endfunction function Trig_Backpack_Func005Func002Func002Func004002 takes nothing returns boolean return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 5)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 4)) ) endfunction function Trig_Backpack_Func005Func002Func002Func005001 takes nothing returns boolean return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 6)) == ITEM_TYPE_ARTIFACT ) endfunction function Trig_Backpack_Func005Func002Func002Func005002 takes nothing returns boolean return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 6)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 4)) ) endfunction function Trig_Backpack_Func005Func002Func002C takes nothing returns boolean if ( GetBooleanAnd( Trig_Backpack_Func005Func002Func002Func001001(), Trig_Backpack_Func005Func002Func002Func001002() ) ) then return true endif if ( GetBooleanAnd( Trig_Backpack_Func005Func002Func002Func002001(), Trig_Backpack_Func005Func002Func002Func002002() ) ) then return true endif if ( GetBooleanAnd( Trig_Backpack_Func005Func002Func002Func003001(), Trig_Backpack_Func005Func002Func002Func003002() ) ) then return true endif if ( GetBooleanAnd( Trig_Backpack_Func005Func002Func002Func004001(), Trig_Backpack_Func005Func002Func002Func004002() ) ) then return true endif if ( GetBooleanAnd( Trig_Backpack_Func005Func002Func002Func005001(), Trig_Backpack_Func005Func002Func002Func005002() ) ) then return true endif return false endfunction function Trig_Backpack_Func005Func002C takes nothing returns boolean if ( not Trig_Backpack_Func005Func002Func002C() ) then return false endif return true endfunction function Trig_Backpack_Func005C takes nothing returns boolean if ( not ( GetManipulatedItem() == UnitItemInSlotBJ(GetManipulatingUnit(), 4) ) ) then return false endif return true endfunction function Trig_Backpack_Func006Func002Func002Func001001 takes nothing returns boolean return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 1)) == ITEM_TYPE_ARTIFACT ) endfunction function Trig_Backpack_Func006Func002Func002Func001002 takes nothing returns boolean return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 1)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 5)) ) endfunction function Trig_Backpack_Func006Func002Func002Func002001 takes nothing returns boolean return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 2)) == ITEM_TYPE_ARTIFACT ) endfunction function Trig_Backpack_Func006Func002Func002Func002002 takes nothing returns boolean return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 2)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 5)) ) endfunction function Trig_Backpack_Func006Func002Func002Func003001 takes nothing returns boolean return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 3)) == ITEM_TYPE_ARTIFACT ) endfunction function Trig_Backpack_Func006Func002Func002Func003002 takes nothing returns boolean return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 3)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 5)) ) endfunction function Trig_Backpack_Func006Func002Func002Func004001 takes nothing returns boolean return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 4)) == ITEM_TYPE_ARTIFACT ) endfunction function Trig_Backpack_Func006Func002Func002Func004002 takes nothing returns boolean return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 4)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 5)) ) endfunction function Trig_Backpack_Func006Func002Func002Func005001 takes nothing returns boolean return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 6)) == ITEM_TYPE_ARTIFACT ) endfunction function Trig_Backpack_Func006Func002Func002Func005002 takes nothing returns boolean return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 6)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 5)) ) endfunction function Trig_Backpack_Func006Func002Func002C takes nothing returns boolean if ( GetBooleanAnd( Trig_Backpack_Func006Func002Func002Func001001(), Trig_Backpack_Func006Func002Func002Func001002() ) ) then return true endif if ( GetBooleanAnd( Trig_Backpack_Func006Func002Func002Func002001(), Trig_Backpack_Func006Func002Func002Func002002() ) ) then return true endif if ( GetBooleanAnd( Trig_Backpack_Func006Func002Func002Func003001(), Trig_Backpack_Func006Func002Func002Func003002() ) ) then return true endif if ( GetBooleanAnd( Trig_Backpack_Func006Func002Func002Func004001(), Trig_Backpack_Func006Func002Func002Func004002() ) ) then return true endif if ( GetBooleanAnd( Trig_Backpack_Func006Func002Func002Func005001(), Trig_Backpack_Func006Func002Func002Func005002() ) ) then return true endif return false endfunction function Trig_Backpack_Func006Func002C takes nothing returns boolean if ( not Trig_Backpack_Func006Func002Func002C() ) then return false endif return true endfunction function Trig_Backpack_Func006C takes nothing returns boolean if ( not ( GetManipulatedItem() == UnitItemInSlotBJ(GetManipulatingUnit(), 5) ) ) then return false endif return true endfunction function Trig_Backpack_Func007Func002Func002Func001001 takes nothing returns boolean return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 1)) == ITEM_TYPE_ARTIFACT ) endfunction function Trig_Backpack_Func007Func002Func002Func001002 takes nothing returns boolean return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 1)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 6)) ) endfunction function Trig_Backpack_Func007Func002Func002Func002001 takes nothing returns boolean return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 2)) == ITEM_TYPE_ARTIFACT ) endfunction function Trig_Backpack_Func007Func002Func002Func002002 takes nothing returns boolean return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 2)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 6)) ) endfunction function Trig_Backpack_Func007Func002Func002Func003001 takes nothing returns boolean return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 3)) == ITEM_TYPE_ARTIFACT ) endfunction function Trig_Backpack_Func007Func002Func002Func003002 takes nothing returns boolean return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 3)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 6)) ) endfunction function Trig_Backpack_Func007Func002Func002Func004001 takes nothing returns boolean return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 4)) == ITEM_TYPE_ARTIFACT ) endfunction function Trig_Backpack_Func007Func002Func002Func004002 takes nothing returns boolean return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 4)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 6)) ) endfunction function Trig_Backpack_Func007Func002Func002Func005001 takes nothing returns boolean return ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), 5)) == ITEM_TYPE_ARTIFACT ) endfunction function Trig_Backpack_Func007Func002Func002Func005002 takes nothing returns boolean return ( GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 5)) == GetItemLevel(UnitItemInSlotBJ(GetManipulatingUnit(), 6)) ) endfunction function Trig_Backpack_Func007Func002Func002C takes nothing returns boolean if ( GetBooleanAnd( Trig_Backpack_Func007Func002Func002Func001001(), Trig_Backpack_Func007Func002Func002Func001002() ) ) then return true endif if ( GetBooleanAnd( Trig_Backpack_Func007Func002Func002Func002001(), Trig_Backpack_Func007Func002Func002Func002002() ) ) then return true endif if ( GetBooleanAnd( Trig_Backpack_Func007Func002Func002Func003001(), Trig_Backpack_Func007Func002Func002Func003002() ) ) then return true endif if ( GetBooleanAnd( Trig_Backpack_Func007Func002Func002Func004001(), Trig_Backpack_Func007Func002Func002Func004002() ) ) then return true endif if ( GetBooleanAnd( Trig_Backpack_Func007Func002Func002Func005001(), Trig_Backpack_Func007Func002Func002Func005002() ) ) then return true endif return false endfunction function Trig_Backpack_Func007Func002C takes nothing returns boolean if ( not Trig_Backpack_Func007Func002Func002C() ) then return false endif return true endfunction function Trig_Backpack_Func007C takes nothing returns boolean if ( not ( GetManipulatedItem() == UnitItemInSlotBJ(GetManipulatingUnit(), 6) ) ) then return false endif return true endfunction function Trig_Backpack_Actions takes nothing returns nothing if ( Trig_Backpack_Func002C() ) then if ( Trig_Backpack_Func002Func002C() ) then call UnitRemoveItemSwapped( GetManipulatedItem(), GetManipulatingUnit() ) else call DoNothing( ) endif else call DoNothing( ) endif if ( Trig_Backpack_Func003C() ) then if ( Trig_Backpack_Func003Func002C() ) then call UnitRemoveItemSwapped( GetManipulatedItem(), GetManipulatingUnit() ) else call DoNothing( ) endif else call DoNothing( ) endif if ( Trig_Backpack_Func004C() ) then if ( Trig_Backpack_Func004Func002C() ) then call UnitRemoveItemSwapped( GetManipulatedItem(), GetManipulatingUnit() ) else call DoNothing( ) endif else call DoNothing( ) endif if ( Trig_Backpack_Func005C() ) then if ( Trig_Backpack_Func005Func002C() ) then call UnitRemoveItemSwapped( GetManipulatedItem(), GetManipulatingUnit() ) else call DoNothing( ) endif else call DoNothing( ) endif if ( Trig_Backpack_Func006C() ) then if ( Trig_Backpack_Func006Func002C() ) then call UnitRemoveItemSwapped( GetManipulatedItem(), GetManipulatingUnit() ) else call DoNothing( ) endif else call DoNothing( ) endif if ( Trig_Backpack_Func007C() ) then if ( Trig_Backpack_Func007Func002C() ) then call UnitRemoveItemSwapped( GetManipulatedItem(), GetManipulatingUnit() ) else call DoNothing( ) endif else call DoNothing( ) endif endfunction //=============================================================== function InitTrig_Backpack takes nothing returns nothing set gg_trg_Backpack = CreateTrigger( ) call TriggerRegisterAnyUnitEventBJ( gg_trg_Backpack, EVENT_PLAYER_UNIT_PICKUP_ITEM ) call TriggerAddCondition( gg_trg_Backpack, Condition( function Trig_Backpack_Conditions ) ) call TriggerAddAction( gg_trg_Backpack, function Trig_Backpack_Actions ) endfunction
Here is what i did. I moved all the items from Artifacts and filled it with items I wanted to be controled. I set the levels of weapons to 1, shields to 2 etc.
this is just boolean madness so copy it. If you dont know how to use jass just create an empty trigger and convert it to text/jass, paste this and you are fine
ok forget the jass thing (i made that quite long ago and converted it). Set the custom value for each item for a unit type to a number
1 - Archer
2 - Rogue
3 - Defender...
After that add all the items to one item group (Artifact cause its the smallest) and set their levels:
1 - mainhand - weapons
2 - secondhand - shield
3 - head - helm
4 - chest - armour, cloacks.
You could also set the units (i mean the unit type:footman,swordsman,druid) custom value as the items (makes it easier) like
Skeletal archer - 1 (like the items sorted to archer)
Swordsman - 3 (like defender class items)...
Once a unit picks up an item... check if the units custom value is like the the items (we check the class) - if not drop it.
we solved the archer cant pick up sword thing...
now if you want to prevent multiple weapon carried to be disabeled check if there is any item in the inventory that has the same level as the picked up one (we clasiefied the levels as item classes remember...) if there is drop the picked up one. if you want I could make a demo map for this