hey there,
here is a spell I made which is supposed to create a ward that saps gold from owners of nearby buildings. It's not working. (using bribe's unit indexer).
Player Group - Pick every player in BankForce[CV] and do (Actions)...
what did I do wrong?
(I made it this way bc I want to be able to have multiple wards on one enemy building, but I don't want one ward to take gold twice from the same player if next to two buildings...)
(also the unit called "banking tunnel" is summoned via a serpent ward based ability)
thanks!
here is a spell I made which is supposed to create a ward that saps gold from owners of nearby buildings. It's not working. (using bribe's unit indexer).
-
bank tunnel
-
Events
- Unit - A unit enters (Playable map area)
-
Conditions
- (Unit-type of (Triggering unit)) Equal to Banking Tunnel (Level 1)
-
Actions
- Unit Group - Add (Triggering unit) to BankGroup
- Game - Display to (All players) for 5.00 seconds the text: unit added
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (bank loop <gen> is on) Equal to False
-
Then - Actions
- Trigger - Turn on bank loop <gen>
- Else - Actions
-
If - Conditions
-
Events
-
bank loop
-
Events
- Time - Every 1.00 seconds of game time
- Conditions
-
Actions
-
Unit Group - Pick every unit in BankGroup and do (Actions)
-
Loop - Actions
- Set CV = (Custom value of (Picked unit))
- Set BankTunnel[CV] = (Picked unit)
- Set TempPoint = (Position of BankTunnel[CV])
- Game - Display to (All players) for 5.00 seconds the text: unit and point set
-
Unit Group - Pick every unit in (Units within 200.00 of TempPoint matching (((Matching unit) is A structure) Equal to True)) and do (Actions)
-
Loop - Actions
- Game - Display to (All players) for 5.00 seconds the text: picked buildings
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Owner of (Picked unit)) is in BankForce[CV]) Equal to False
-
Then - Actions
- Player Group - Add (Owner of (Picked unit)) to BankForce[CV]
- Game - Display to (All players) for 5.00 seconds the text: player added
- Else - Actions
-
If - Conditions
-
Player Group - Pick every player in BankForce[CV] and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Picked player) Current gold) Greater than 0
-
Then - Actions
- Game - Display to (All players) for 5.00 seconds the text: enough gold
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Unit-type of BankTunnel[CV]) Equal to Banking Tunnel (Level 1)
-
Then - Actions
- Player - Add -1 to (Picked player) Current gold
- Player - Add 1 to (Owner of BankTunnel[CV]) Current gold
- Game - Display to (All players) for 5.00 seconds the text: stolen!
-
Else - Actions
- Player - Add -3 to (Picked player) Current gold
- Player - Add 3 to (Owner of BankTunnel[CV]) Current gold
-
If - Conditions
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
Loop - Actions
- Custom script: call RemoveLocation (udg_TempPoint)
-
Loop - Actions
- If ((BankGroup is empty) Equal to True) then do (Trigger - Turn off (This trigger)) else do (Do nothing)
-
Unit Group - Pick every unit in BankGroup and do (Actions)
-
Events
-
kill bank
-
Events
- Unit - A unit Dies
-
Conditions
- (Unit-type of (Triggering unit)) Equal to Banking Tunnel (Level 1)
-
Actions
- Set CV = (Custom value of (Triggering unit))
- Player Group - Remove all players from BankForce[CV]
- Game - Display to (All players) for 5.00 seconds the text: group emptied
-
Events
Player Group - Pick every player in BankForce[CV] and do (Actions)...
what did I do wrong?
(I made it this way bc I want to be able to have multiple wards on one enemy building, but I don't want one ward to take gold twice from the same player if next to two buildings...)
(also the unit called "banking tunnel" is summoned via a serpent ward based ability)
thanks!