Right, so I've got a number of game-breaking problems, and can't make much more progress on my project without figuring these out:
Problem #1: Here I have a neutral passive building, that I want any selected units to attack if you right-click on it. Unfortunately I can't seem to find the correct right-click order.
Problem #2: The whole trigger is a bit long but this is the part that isn't working. It's a basic loop that checks whether the hero is carrying a list of items. If the hero is carrying any of those items, display an error message and skip remaining actions. Problem is, the error message is showing, but the trigger does not skip the remaining actions, it seems to ignore that line and continue with its actions regardless.
Problem #3: I have a spell that is duplicated upon casting. In this case it is duplicated 30 times. The problem is that the trigger only duplicates it once, meaning instead of doing 30 times the damage, it only does 2 times as much.
edit: added the missing conditions
Problem #4: This one should be more simple. I have implemented a command to swap between three different inventories. I looked on thehelper.net for triggers to do this but the methods I found were either in Jass or not to my liking, so I ended up coding it myself, and so far it is working flawlessly. Except for one thing: Transferring a multi-charge item (potion, for instance) causes the number of charges to drop to 1 when you return to that inventory. It would be really cool if someone could help me figure out how to allow multi-charge items to transfer correctly. Here is the trigger:
Problem #1: Here I have a neutral passive building, that I want any selected units to attack if you right-click on it. Unfortunately I can't seem to find the correct right-click order.
Trigger:
- Right Click
- Events
- Unit - A unit Is issued an order targeting an object
- Conditions
- (Issued order) Equal to (Order(right click))
- (Unit-type of (Target unit of issued order)) Equal to Farm
- Actions
- Unit - Order (Ordered unit) to Attack (Target unit of issued order)
- Events
Problem #2: The whole trigger is a bit long but this is the part that isn't working. It's a basic loop that checks whether the hero is carrying a list of items. If the hero is carrying any of those items, display an error message and skip remaining actions. Problem is, the error message is showing, but the trigger does not skip the remaining actions, it seems to ignore that line and continue with its actions regardless.
Trigger:
- Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
- Loop - Actions
- For each (Integer InventorySwapSpellBookCheck) from 1 to 6, do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Or - Any (Conditions) are true
- Conditions
- (Item carried by (Picked unit) in slot InventorySwapSpellBookCheck) Equal to (Item carried by (Picked unit) of type Book of Blink Stomp)
- (Item carried by (Picked unit) in slot InventorySwapSpellBookCheck) Equal to (Item carried by (Picked unit) of type Book of Blizzard)
- (Item carried by (Picked unit) in slot InventorySwapSpellBookCheck) Equal to (Item carried by (Picked unit) of type Book of Explosive Potion)
- (Item carried by (Picked unit) in slot InventorySwapSpellBookCheck) Equal to (Item carried by (Picked unit) of type Book of Fireblast)
- Conditions
- Or - Any (Conditions) are true
- Then - Actions
- Game - Display to (Player group((Triggering player))) for 10.00 seconds the text: Cannot transfer spe...
- Skip remaining actions
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- For each (Integer InventorySwapSpellBookCheck) from 1 to 6, do (Actions)
- Loop - Actions
Problem #3: I have a spell that is duplicated upon casting. In this case it is duplicated 30 times. The problem is that the trigger only duplicates it once, meaning instead of doing 30 times the damage, it only does 2 times as much.
edit: added the missing conditions
Trigger:
- Fireblast
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((Item carried by (Triggering unit) of type |cff66cc00Toviac|r) is owned) Equal to True
- Then - Actions
- Set SpellMultiplier = ToviacMultiplier
- Else - Actions
- Set SpellMultiplier = 1
- Skip remaining actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Ability being cast) Equal to Fireblast lvl 1
- Then - Actions
- For each (Integer A) from 1 to (SpellMultiplier - 1), do (Actions)
- Loop - Actions
- Unit - Create 1 Sheep (Dummy Unit) for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
- Unit - Add a 4.00 second Generic expiration timer to (Last created unit)
- Unit - Add Fireblast lvl 1 to (Last created unit)
- Unit - Order (Last created unit) to Neutral Pandaren Brewmaster - Breath Of Fire (Target point of ability being cast)
- Loop - Actions
- For each (Integer A) from 1 to (SpellMultiplier - 1), do (Actions)
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Events
Problem #4: This one should be more simple. I have implemented a command to swap between three different inventories. I looked on thehelper.net for triggers to do this but the methods I found were either in Jass or not to my liking, so I ended up coding it myself, and so far it is working flawlessly. Except for one thing: Transferring a multi-charge item (potion, for instance) causes the number of charges to drop to 1 when you return to that inventory. It would be really cool if someone could help me figure out how to allow multi-charge items to transfer correctly. Here is the trigger:
Trigger:
- Inventory Swap
- Events
- Player - Player 1 (Red) types a chat message containing swap as A substring
- Conditions
- And - All (Conditions) are true
- Conditions
- Inventory[(Player number of (Triggering player))] Not equal to (Integer((Substring((Entered chat string), 6, 1))))
- (Integer((Substring((Entered chat string), 6, 1)))) Greater than or equal to 1
- (Integer((Substring((Entered chat string), 6, 1)))) Less than or equal to 3
- Conditions
- And - All (Conditions) are true
- Actions
- Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
- Loop - Actions
- Set Slot_1[Inventory[(Player number of (Triggering player))]] = (Item-type of (Item carried by (Picked unit) in slot 1))
- Set Slot_2[Inventory[(Player number of (Triggering player))]] = (Item-type of (Item carried by (Picked unit) in slot 2))
- Set Slot_3[Inventory[(Player number of (Triggering player))]] = (Item-type of (Item carried by (Picked unit) in slot 3))
- Set Slot_4[Inventory[(Player number of (Triggering player))]] = (Item-type of (Item carried by (Picked unit) in slot 4))
- Set Slot_5[Inventory[(Player number of (Triggering player))]] = (Item-type of (Item carried by (Picked unit) in slot 5))
- Set Slot_6[Inventory[(Player number of (Triggering player))]] = (Item-type of (Item carried by (Picked unit) in slot 6))
- Item - Remove (Item carried by (Picked unit) in slot 1)
- Item - Remove (Item carried by (Picked unit) in slot 2)
- Item - Remove (Item carried by (Picked unit) in slot 3)
- Item - Remove (Item carried by (Picked unit) in slot 4)
- Item - Remove (Item carried by (Picked unit) in slot 5)
- Item - Remove (Item carried by (Picked unit) in slot 6)
- Hero - Create Slot_1[(Integer((Substring((Entered chat string), 6, 1))))] and give it to (Picked unit)
- Hero - Create Slot_2[(Integer((Substring((Entered chat string), 6, 1))))] and give it to (Picked unit)
- Hero - Create Slot_3[(Integer((Substring((Entered chat string), 6, 1))))] and give it to (Picked unit)
- Hero - Create Slot_4[(Integer((Substring((Entered chat string), 6, 1))))] and give it to (Picked unit)
- Hero - Create Slot_5[(Integer((Substring((Entered chat string), 6, 1))))] and give it to (Picked unit)
- Hero - Create Slot_6[(Integer((Substring((Entered chat string), 6, 1))))] and give it to (Picked unit)
- Loop - Actions
- Set Inventory[(Player number of (Triggering player))] = (Integer((Substring((Entered chat string), 6, 1))))
- Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
- Events