- Joined
- Aug 7, 2013
- Messages
- 1,338
Hi,
Suppose I have a trigger that checks when a unit picks up an item, as I need to make sure I can allow that unit to hold said item.
But say also picking up some items can start a quest for a player.
These are two entirely different results from the same event. Do I just make one set of if statements that iterate over all such possibilities? I suppose I can be clever and assign certain point values to items that start quests, but it still has to look like this:
Suppose I have a trigger that checks when a unit picks up an item, as I need to make sure I can allow that unit to hold said item.
But say also picking up some items can start a quest for a player.
These are two entirely different results from the same event. Do I just make one set of if statements that iterate over all such possibilities? I suppose I can be clever and assign certain point values to items that start quests, but it still has to look like this:
JASS:
Player picks up some item
If item is an equippable item
If player is strong enough to use item
do nothing
else unequip item, display message "Not ready to use item"
elseif item is a quest starting item
if item is == QuestItemA
start QuestA
if item is == QuestItemB
start QuestB
...