I am testing out quite a few systems on a test map to see which ones I like and which ones I don't. For some reason my item equipment system has a major bug. I need to know why my abilities fail to work when I reach a certain area in the map. Here are the triggers, then I'll explain:
This trigger uses a channel ability called "Equip Item" in order to Equip items depending on what they are. There is a part in the map where when you enter a cave, it moves the entering unit instantly to a different point in the map:
After teleporting to this location, the ability "Equip Item" no longer works. My other abilities do function. If you equip an item before entering the cave, the item will unequip after with the unequip ability:
Since I figured my crappy GUI was messing up, I spawned my hero way far away from the teleport location and tried equipping. It worked. When I made my hero walk to the spot where the cave teleports you, the abilities no longer worked, no matter how far away I got afterwords.
This problem is very weird and I've never had this problem with any other map.
Trigger:
- Equip
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Equip Item
- Actions
- -------- Weapons --------
- -------- Staffs --------
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Item-type of (Target item of ability being cast)) Equal to |cff8B8378Charred Walking Staff|r
- EquipWeaponCheck[(Player number of (Owner of (Casting unit)))] Not equal to True
- Then - Actions
- Set PlyrGrpTmp = (Player group((Owner of (Casting unit))))
- Set EquipWeaponItem[(Player number of (Owner of (Casting unit)))] = (Item-type of (Target item of ability being cast))
- Hero - Drop (Target item of ability being cast) from (Casting unit)
- Game - Display to PlyrGrpTmp the text: (|cff00ff00System|r: + ((Name of (Last dropped item)) + has been equipped!))
- Item - Remove (Last dropped item)
- Set EquipWeaponCheck[(Player number of (Owner of (Casting unit)))] = True
- Unit - Add Item Damage Bonus (+1) to (Casting unit)
- Custom script: call DestroyForce (udg_PlyrGrpTmp)
- Else - Actions
- If - Conditions
- -------- Blades --------
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Item-type of (Target item of ability being cast)) Equal to |c00c0c0c0Short Dagger|r
- EquipWeaponCheck[(Player number of (Owner of (Casting unit)))] Not equal to True
- (Unit-type of (Casting unit)) Equal to Sneakster
- Then - Actions
- Set PlyrGrpTmp = (Player group((Owner of (Casting unit))))
- Set EquipWeaponItem[(Player number of (Owner of (Casting unit)))] = (Item-type of (Target item of ability being cast))
- Hero - Drop (Target item of ability being cast) from (Casting unit)
- Game - Display to PlyrGrpTmp the text: (|cff00ff00System|r: + ((Name of (Last dropped item)) + has been equipped!))
- Item - Remove (Last dropped item)
- Set EquipWeaponCheck[(Player number of (Owner of (Casting unit)))] = True
- Unit - Add Item Damage Bonus (+2) to (Casting unit)
- Custom script: call DestroyForce (udg_PlyrGrpTmp)
- Else - Actions
- If - Conditions
- Events
This trigger uses a channel ability called "Equip Item" in order to Equip items depending on what they are. There is a part in the map where when you enter a cave, it moves the entering unit instantly to a different point in the map:
Trigger:
- Tele to Reynold
- Events
- Unit - A unit enters Enter Cave <gen>
- Conditions
- Actions
- Set StartLocTemp = (Random point in Tele From StartCave <gen>)
- Unit - Move (Entering unit) instantly to StartLocTemp
- Camera - Pan camera as necessary for (Owner of (Entering unit)) to StartLocTemp over 1.00 seconds
- Custom script: call RemoveLocation(udg_StartLocTemp)
- Events
After teleporting to this location, the ability "Equip Item" no longer works. My other abilities do function. If you equip an item before entering the cave, the item will unequip after with the unequip ability:
Trigger:
- UnequipWeapons
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Unequip Weapon
- EquipWeaponCheck[(Player number of (Owner of (Casting unit)))] Equal to True
- Actions
- -------- Staff --------
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- EquipWeaponItem[(Player number of (Owner of (Casting unit)))] Equal to |cff8B8378Charred Walking Staff|r
- Then - Actions
- Set PlyrGrpTmp = (Player group((Owner of (Casting unit))))
- Unit - Remove Item Damage Bonus (+1) from (Casting unit)
- Set EquipWeaponCheck[(Player number of (Owner of (Casting unit)))] = False
- Hero - Create EquipWeaponItem[(Player number of (Owner of (Casting unit)))] and give it to (Casting unit)
- Game - Display to PlyrGrpTmp the text: (|cff00ff00System|r: + ((Name of (Last created item)) + has been unequipped!))
- Custom script: call DestroyForce (udg_PlyrGrpTmp)
- Else - Actions
- If - Conditions
- -------- Blade --------
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- EquipWeaponItem[(Player number of (Owner of (Casting unit)))] Equal to |c00c0c0c0Short Dagger|r
- Then - Actions
- Set PlyrGrpTmp = (Player group((Owner of (Casting unit))))
- Unit - Remove Item Damage Bonus (+2) from (Casting unit)
- Set EquipWeaponCheck[(Player number of (Owner of (Casting unit)))] = False
- Hero - Create EquipWeaponItem[(Player number of (Owner of (Casting unit)))] and give it to (Casting unit)
- Game - Display to PlyrGrpTmp the text: (|cff00ff00System|r: + ((Name of (Last created item)) + has been unequipped!))
- Custom script: call DestroyForce (udg_PlyrGrpTmp)
- Else - Actions
- If - Conditions
- Events
Since I figured my crappy GUI was messing up, I spawned my hero way far away from the teleport location and tried equipping. It worked. When I made my hero walk to the spot where the cave teleports you, the abilities no longer worked, no matter how far away I got afterwords.
This problem is very weird and I've never had this problem with any other map.