- Joined
- Aug 14, 2006
- Messages
- 7,601
Hey.
I have a little problem with one of my newest systems. Idea of the system is to check if any of player boxes have specific items. If so, uses it(minus 1 charge or remove it) and heals character. Now only heal comes, but items won't lose any charge / won't be removed.
What's wrong? How I can fix?
I have a little problem with one of my newest systems. Idea of the system is to check if any of player boxes have specific items. If so, uses it(minus 1 charge or remove it) and heals character. Now only heal comes, but items won't lose any charge / won't be removed.
What's wrong? How I can fix?
-
Use Potion From Box
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
-
Or - Any (Conditions) are true
-
Conditions
- (Ability being cast) Equal to GUse Health Potion (PHODOM)
- (Ability being cast) Equal to GUse Mana Potion (PHODOM)
- (Ability being cast) Equal to GUse Health Scroll (PHODOM)
- (Ability being cast) Equal to GUse Mana Scroll (PHODOM)
-
Conditions
-
Or - Any (Conditions) are true
-
Actions
- -------- === PHODOM === --------
- Set TempUnit = AAAPhodom
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (AAAPhodom is alive) Equal to True
-
Then - Actions
- Set TempGroup = (Units owned by Player 1 (Red) matching (((Unit-type of (Matching unit)) is Mechanical) Equal to True))
- -------- === HEALING POTIONS === --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Ability being cast) Equal to GUse Health Potion (PHODOM)
-
Then - Actions
- Unit Group - Remove all units from TempGroup2
-
For each (Integer A) from 1 to 9, do (Actions)
-
Loop - Actions
-
Unit Group - Pick every unit in TempGroup and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Picked unit) has an item of type Restore_Panel_HealPot[TempInteger]) Equal to True
-
Then - Actions
- Unit Group - Add (Picked unit) to TempGroup2
- Set TempUnit2 = (Random unit from TempGroup2)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Charges remaining in (Item carried by TempUnit2 of type Restore_Panel_HealPot[(Integer A)])) Greater than 1
-
Then - Actions
- Item - Set charges remaining in (Item carried by TempUnit2 of type Restore_Panel_HealPot[(Integer A)]) to ((Charges remaining in (Item carried by TempUnit2 of type Restore_Panel_HealPot[(Integer A)])) - 1)
-
Else - Actions
- Item - Remove (Item carried by TempUnit2 of type Restore_Panel_HealPot[TempInteger])
-
If - Conditions
- Unit - Set life of TempUnit to ((Life of TempUnit) + (Real(Restore_Panel_HealPot_I[(Integer A)])))
- Unit - Set mana of TempUnit to ((Mana of TempUnit) + (Real(Restore_Panel_HealPot_I2[(Integer A)])))
- Special Effect - Create a special effect attached to the origin of TempUnit using Abilities\Spells\Items\AIlm\AIlmTarget.mdl
- Special Effect - Destroy (Last created special effect)
- Skip remaining actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
Unit Group - Pick every unit in TempGroup and do (Actions)
-
Loop - Actions
- Else - Actions
-
If - Conditions
-
If - Conditions
-
Events