RPG Problem (Diffrent Armor/Weapon for diffrent classes)

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.
 
It doesn't matter though, you're all making it over complicated.
Trigger:
  • Untitled Trigger 001
    • Events
      • Unit - A unit acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Sword
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Archer
        • Then - Actions
          • Game - Display to (All players) the text: NO!
          • Hero - Drop (Item being manipulated) from (Triggering unit)
        • Else - Actions
 
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.
 
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.

I assume the idea of using custom values was because of the potential multiple archer units, therefore the complication of triggering and the need to index custom values and such.
 
Then adding other possible unit types under another Or Condition would do - if the unit isn't any Archer-type unit and the item is a Bow-type item (however many possibilities there are), then the unit stops. Using custom values seems to complicated for him in any case.
 
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
 
ok here is what you do. In the Object editor find your item and set its level to some value like i did
1-main hand weapon
2-Shield
3-Armour
4-Helm etc
Once you do that use conditions like:
level of item in slot 1 equal to level of item being manipulated
do this for 6 slots and if its true drop it. Just be careful cause it may drop the manipulated item too so add it once its done dropping stuff from the inventory. Ask if you need the trigger
 
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
 
Let's make this clear, Converted GUI != Good JASS.

HydraRancher said:
I suppose you could have a "2" in front to retain the zeros.

You could, but then that raises the need to use strings.

An alternative is to use the sum.

0 = Sword
1 = Bow
2 = Staff
4 = Dagger
8 = Lance
16 = Blueberry Waffle

And say you set the custom value of the unit to 7. That way you can do some parsing to find that the unit is able to wield Daggers, Staffs, Bows, and Swords.

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.
 
Sorry, that was a bit harsh. But still the item type is easiest. You all jumped immediately to one of the harder solutions. Ahaha. I love this website.
 
Well as Sevion says, it's the most efficient method without losing functionality, even if it is far more complex then it should be. :p
 
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

bump

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

What should i change? i dont know jass.
 
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
 
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

If you could do a demo map it would be awsome :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    I'm now realizing I could have cut out like 99% of this print and it would have been fine cuz I just need to see if a frame will fit over an LCD
  • Varine Varine:
    Oh well
  • Varine Varine:
    I'm not an engineer
  • Varine Varine:
    Although this filament is kind of expensive, I should probably be a bit more wary of that.
  • The Helper The Helper:
    I love the whole concept of 3D Printers and am very happy you have one so I can hear about them
  • The Helper The Helper:
  • Varine Varine:
    I have a couple of them, but I only have room for one to be set up at the moment
  • Varine Varine:
    So I picked the biggest one. When I bought it, I didn't realize that they used a lot of proprietary parts. So, I want to use these Volcano nozzles that are really cheap and easy to find instead of what they have, which are like, modified Volcano nozzles
  • Varine Varine:
    They are just a little bit longer than the regular ones. Like, we're talking .5mm or some shit. But that little bit makes the nozzle just long enough to extrude past the rest of the hardware on the extrusion system, I can't find my notes on it but I think it's like a .25mm gap from the end of the nozzle to the bed mesh sensor. Very small.
  • Varine Varine:
    So I bought a bunch of different parts to try and figure out how to make this work, and in the process changed some of the electrical components like the thermistors, but never got around to figuring out how to make the firmware account for the different hardware. Resulting in it not interpreting the voltage change to mean that the thermistor was above temperature, so it didn't shut off the heating core and it just kept pumping heat out
  • Varine Varine:
    I have most of the stuff I need to build an enclosure so I can heat the chamber for different plastics that need to have a pretty consistent temperature through the whole model, and then I can get my other ones set up too. I have a shitty Ender but that one is super easy to modify, but it's also very outdated and kind of a nightmare to work with. I think I'm going to cannibalize it for parts and just run my big one and another little one.
  • Varine Varine:
    I think I solved my problem with digitizing reels tho!
  • Varine Varine:
    Like Super 8 reels. Actual equipment to do it is like, thousands and thousands of dollars, and the cheap ones are useless, so I'm trying to build one so I can just use the same camera I use for slides and negatives. Much cheaper
  • Varine Varine:
    Anyway, it kind of works, but the take up reel is kind of tricky because you need to spin it directly to wind the tape onto it. And as it fills, you need to slow it down, and that's kind of complicated. More complicated than I wanted to try and account for, anyway.
  • Varine Varine:
    So I have the first motor that has gearing pull it from the original reel, through a set of pullies to keep some tension, and then a second motor synced with the first to guide it through the projection port so I can capture the images
  • Varine Varine:
    All that's easy enough, I just need to make sure I don't get too much force onto the film itself so I don't accidentally tear it.
  • Varine Varine:
    Then I think my solution to the take up reel is to have a kind of dancing lever on a spring in between two limit switches
  • Varine Varine:
    So, as the tape comes towards the take up reel and makes slack, that lever is pulled up by a spring to keep the tension on the film, it hits a limit switch to engage the take up reel motor at some point, and as that winds in the film, the film pushes the lever back down to a second limit switch to disengage the motor again. Slack builds up, spring pulls it back, ad infinitum
  • Varine Varine:
    Well, until the reel is empty anyway.
  • Varine Varine:
    I'm guessing it's going to be much harder than I feel like it is going to be right now, but I think it's a pretty elegant solution that doesn't rely on software to control it. The less software I need to use the better
  • Varine Varine:
    I'm just not a very good programmer, as much as I want to be I suck at it
  • The Helper The Helper:
    Programming that printer is going to be similar to programming a big machine like in a machine shop. There is good money in programming CNC machines.
  • The Helper The Helper:
    +1
  • Varine Varine:
    They are pretty similar, but this one is much less involved than a real CNC. A lot less moving parts
    +1
  • The Helper The Helper:
    Happy Monday!

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top