Hi
I will try to keep it short. In my map I want a loot system which allows the player to have:
1:
One piece of helmet, armor and misc.
2:
A one-handed weapon and a shield, 2 one-handed or 1 two-handed.
3:
I have made attachable models for each weapon and by default all item drops will be left handed. However, what I want is when you have a one-handed (left-handed) equipped, and equip yet another one-handed weapon, it will be removed and exchanged by a right-handed weapon. I have made clones of each one-handed weapon to make this possible. This must not accour if the Hero has a shield, a two-handed weapon or already has 2 one-handed weapons equipped.
So far I have tried myself, but I find it difficult to see how to solve this trigger.
This trigger does NOT work:
Second attempt (does not work either):
The problem here is for some reason it will not create an item for the Hero, but just acquires the item that was looted in the first place...
I have already made it work with the armor and shield triggering, since I have asked this type of question before.
This trigger works:
I will try to keep it short. In my map I want a loot system which allows the player to have:
1:
One piece of helmet, armor and misc.
2:
A one-handed weapon and a shield, 2 one-handed or 1 two-handed.
3:
I have made attachable models for each weapon and by default all item drops will be left handed. However, what I want is when you have a one-handed (left-handed) equipped, and equip yet another one-handed weapon, it will be removed and exchanged by a right-handed weapon. I have made clones of each one-handed weapon to make this possible. This must not accour if the Hero has a shield, a two-handed weapon or already has 2 one-handed weapons equipped.
So far I have tried myself, but I find it difficult to see how to solve this trigger.
This trigger does NOT work:
Weapon Item Levels
Events
Unit - A unit Acquires an item
Conditions
Or - Any (Conditions) are true
Conditions
(Item level of (Item being manipulated)) Equal to 1
(Item level of (Item being manipulated)) Equal to 2
(Item-type of (Item being manipulated)) Not equal to Captain Vanguard
(Item-type of (Item being manipulated)) Not equal to Druid Buckler
(Item-type of (Item being manipulated)) Not equal to Necromancer Bulwark
Actions
Set Item_Limiter = 0
Set Item = (Item being manipulated)
Set Item_Level = (Item level of Item)
Set Item_TriggeringUnit = (Triggering unit)
Set Item_UnitInventory = (Size of inventory for Item_TriggeringUnit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item level of Item) Equal to 1
Then - Actions
For each (Integer Item_Loop) from 1 to Item_UnitInventory, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item level of (Item carried by Item_TriggeringUnit in slot Item_Loop)) Equal to 1
Then - Actions
Set Item_Limiter = (Item_Limiter + 1)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Item_Limiter Greater than 1
Then - Actions
Set Item_Limiter = 0
For each (Integer Item_Loop) from 1 to Item_UnitInventory, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item level of (Item carried by Item_TriggeringUnit in slot Item_Loop)) Equal to 2
Then - Actions
Set Item_Limiter = (Item_Limiter + 1)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Item_Limiter Greater than 1
Then - Actions
Hero - Drop Item from Item_TriggeringUnit
Game - Display to (Player group((Owner of Item_TriggeringUnit))) for 2.00 seconds the text: You are already wea...
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of Item) Equal to Anvil Hammer (Left)
Then - Actions
Hero - Create Anvil Hammer (Right) and give it to Item_TriggeringUnit
Else - Actions
Item - Remove Item
Else - Actions
Else - Actions
Second attempt (does not work either):
The problem here is for some reason it will not create an item for the Hero, but just acquires the item that was looted in the first place...
-
Weapon Item Levels
-
Events
-
Unit - A unit Acquires an item
-
-
Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
(Item level of (Item being manipulated)) Equal to 1
-
(Item level of (Item being manipulated)) Equal to 2
-
(Item level of (Item being manipulated)) Equal to 3
-
-
-
(Item-type of (Item being manipulated)) Not equal to Captain Vanguard
-
(Item-type of (Item being manipulated)) Not equal to Druid Buckler
-
(Item-type of (Item being manipulated)) Not equal to Necromancer Bulwark
-
-
Actions
-
Set Item_HandLeft = 0
-
Set Item_HandRight = 0
-
Set Item_HandTwo = 0
-
Set Item = (Item being manipulated)
-
Set Item_Level = (Item level of Item)
-
Set Item_TriggeringUnit = (Triggering unit)
-
Set Item_UnitInventory = (Size of inventory for Item_TriggeringUnit)
-
-------- --------
-
-------- Count Items --------
-
-------- --------
-
For each (Integer Item_Loop) from 1 to Item_UnitInventory, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Item level of (Item carried by Item_TriggeringUnit in slot Item_Loop)) Equal to 1
-
-
Then - Actions
-
Set Item_HandLeft = (Item_HandLeft + 1)
-
-
Else - Actions
-
-
-
-
For each (Integer Item_Loop) from 1 to Item_UnitInventory, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Item level of (Item carried by Item_TriggeringUnit in slot Item_Loop)) Equal to 2
-
-
Then - Actions
-
Set Item_HandRight = (Item_HandRight + 1)
-
-
Else - Actions
-
-
-
-
For each (Integer Item_Loop) from 1 to Item_UnitInventory, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Item level of (Item carried by Item_TriggeringUnit in slot Item_Loop)) Equal to 3
-
-
Then - Actions
-
Set Item_HandTwo = (Item_HandTwo + 1)
-
-
Else - Actions
-
-
-
-
-------- --------
-
-------- Give Item --------
-
-------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Item_HandRight Greater than or equal to 1
-
Item_HandLeft Equal to 0
-
Item_HandTwo Equal to 0
-
(Item level of Item) Equal to 1
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Item-type of Item) Equal to Anvil Hammer (Left)
-
-
Then - Actions
-
Hero - Create Anvil Hammer (Right) and give it to Item_TriggeringUnit
-
-
Else - Actions
-
-
Skip remaining actions
-
-
Else - Actions
-
-
-------- --------
-
-------- Drop Item --------
-
-------- --------
-
-
I have already made it work with the armor and shield triggering, since I have asked this type of question before.
This trigger works:
Armor and Shield Item Levels
Events
Unit - A unit Acquires an item
Conditions
Or - Any (Conditions) are true
Conditions
(Item level of (Item being manipulated)) Equal to 3
(Item level of (Item being manipulated)) Equal to 4
(Item level of (Item being manipulated)) Equal to 5
(Item-type of (Item being manipulated)) Equal to Captain Vanguard
(Item-type of (Item being manipulated)) Equal to Druid Buckler
(Item-type of (Item being manipulated)) Equal to Necromancer Bulwark
Actions
Set Item_Limiter = 0
Set Item = (Item being manipulated)
Set Item_Level = (Item level of Item)
Set Item_TriggeringUnit = (Triggering unit)
Set Item_UnitInventory = (Size of inventory for Item_TriggeringUnit)
For each (Integer Item_Loop) from 1 to Item_UnitInventory, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item level of (Item carried by Item_TriggeringUnit in slot Item_Loop)) Equal to Item_Level
Then - Actions
Set Item_Limiter = (Item_Limiter + 1)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Item_Limiter Greater than 1
Then - Actions
Hero - Drop Item from Item_TriggeringUnit
Game - Display to (Player group((Owner of Item_TriggeringUnit))) for 2.00 seconds the text: You are already wea...
Else - Actions
Last edited: