| 05-12-2005, 12:18 AM | #1 |
I am attempting to make triggers that limit the number of a kind of item a hero can carry. For example, I want to make sure a hero cannot carry two or more swords at one time (same thing applies to shields and other armor). I have tried numerous triggers and combinations, but no luck... any help? |
| 05-12-2005, 12:42 AM | #2 |
Guest | Code:
Events
Unit - A unit Acquires an item
Conditions
(Item-type of (Item being manipulated)) Equal to (Item-type of (Item carried by (Hero manipulating item) in slot (Min(2, 6))))
Actions
Item - Move (Item being manipulated) to (Position of (Hero manipulating item))Peace Destruction |
| 05-12-2005, 01:30 PM | #3 | |
Quote:
This trigger should work properly, it uses item classes (for example permanent, artifact, purchaseable,...), so you should put all swords in one category, all shields in another... if you have more types of items than there are class categories, use life of items or something like that instead: Code:
Events:
a unit acquires an item
Conditions:
actions:
for each Integer A from 1 to 6 do actions
loop - actions:
if - then - else multiple functions
if - conditions:
item class of (item being manipulated) equal to item class of (item carried by hero in slot (Integer A))
(item being manipulated) not equal to item carried by hero in slot (Integer A)
then - actions:
hero - drop (item being manipulated) from (hero manipulating item)
skip remaining actions
else - actions:
do nothing |
| 05-12-2005, 08:07 PM | #4 |
*praises Anitarf* Thanks a ton! This trigger's been bugging me for the past couple of weeks (again). |
