tommerbob
Minecraft. :D
- Reaction score
- 110
Got a "camouflage" skill that makes a unit invisible as long as it remains still. I'm using Permanent Invisibility and Ghost abilities for the invis (so that he can still cast spells while invisible), and using a dummy buff based on inner fire.
Now here's my problem: The skill works fine the first time it is cast, but every time after the first cast, the dummy buff is not applied and the unit does not get permanent invis or ghost. I have no idea why this is happening, I'm guessing its something really simple that I have overlooked. I added a debug message to make sure the trigger was actually running, and it is, but no buff is applied and no abilities are given.
Thanks in advance for any help.
Codes:
Now here's my problem: The skill works fine the first time it is cast, but every time after the first cast, the dummy buff is not applied and the unit does not get permanent invis or ghost. I have no idea why this is happening, I'm guessing its something really simple that I have overlooked. I added a debug message to make sure the trigger was actually running, and it is, but no buff is applied and no abilities are given.
Thanks in advance for any help.
Codes:
Trigger:
- Camouflage cast
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Camouflage
- Actions
- -------- GLOBALS --------
- Set Camouflage_Caster = (Triggering unit)
- Set Camouflage_Point = (Position of Camouflage_Caster)
- -------- hit points healed per second --------
- Set Camouflage_HealAmount = (Hero_SpellPower x 0.50)
- -------- spell duration --------
- Set Camouflage_Duration = (15.00 + (5.00 x (Real((Level of Camouflage for Camouflage_Caster)))))
- -------- detection chance --------
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Aspect_Learned Equal to True
- Then - Actions
- Set Camouflage_DetectChance = ((45.00 - (5.00 x (Real((Level of Camouflage for Camouflage_Caster))))) - (2.00 x (Real((Level of Aspect of the Hunter for Camouflage_Caster)))))
- Else - Actions
- Set Camouflage_DetectChance = (45.00 - (5.00 x (Real((Level of Camouflage for Camouflage_Caster)))))
- If - Conditions
- -------- detection range --------
- Set Camouflage_DetectAOE = 400.00
- -------- end globals --------
- Game - Display to (All players) the text: Camouflage is cast
- Unit - Add Camouflage (dummy buff) to Spell_Caster
- Unit - Order Spell_Caster to Human Priest - Inner Fire Camouflage_Caster
- Unit - Remove Camouflage (dummy buff) from Spell_Caster
- Unit - Add Permanent Invisibility to Camouflage_Caster
- Unit - Add Ghost to Camouflage_Caster
- Unit - Pause Camouflage_Caster
- Unit - Order Camouflage_Caster to Hold Position
- Unit - Unpause Camouflage_Caster
- Trigger - Turn on Camouflage timer <gen>
- Trigger - Turn on Camouflage damage detect <gen>
- Events
Trigger:
- Camouflage timer
- Events
- Time - Every 1.00 seconds of game time
- Conditions
- Actions
- Set Camouflage_Duration = (Camouflage_Duration - 1.00)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Camouflage_Caster has buff Camouflage ) Equal to True
- Then - Actions
- Else - Actions
- Trigger - Turn off (This trigger)
- Unit - Remove Ghost from Camouflage_Caster
- Unit - Remove Permanent Invisibility from Camouflage_Caster
- Custom script: call RemoveLocation(udg_Camouflage_Point)
- Skip remaining actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (X of (Position of Camouflage_Caster)) Equal to (X of Camouflage_Point)
- (Y of (Position of Camouflage_Caster)) Equal to (Y of Camouflage_Point)
- Then - Actions
- Unit - Set life of Camouflage_Caster to ((Life of Camouflage_Caster) + Camouflage_HealAmount)
- Floating Text - Create floating text that reads (+ + (String((Integer(Camouflage_HealAmount))))) above Camouflage_Caster with Z offset 10.00, using font size 10.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Set the velocity of (Last created floating text) to 96.00 towards (Random real number between 45.00 and 160.00) degrees
- Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
- Floating Text - Change the fading age of (Last created floating text) to 0.00 seconds
- Else - Actions
- Trigger - Turn off (This trigger)
- Unit - Remove Camouflage buff from Camouflage_Caster
- Unit - Remove Ghost from Camouflage_Caster
- Unit - Remove Permanent Invisibility from Camouflage_Caster
- Custom script: call RemoveLocation(udg_Camouflage_Point)
- Skip remaining actions
- If - Conditions
- -------- ENEMIES MUST BE WITHIN RANGE TO DETECT --------
- Set Camouflage_DetectGroup = (Units within Camouflage_DetectAOE of Camouflage_Point matching (((((Matching unit) is A structure) Not equal to True) and (((Matching unit) is alive) Equal to True)) and (((Matching unit) belongs to an enemy of (Owner of Camouflage_Caster)) Equal to True)))
- -------- ENEMY MUST BE ABLE TO SEE PROWLER --------
- Unit Group - Pick every unit in Camouflage_DetectGroup and do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Camouflage_Point is visible to (Owner of (Picked unit))) Not equal to True
- Then - Actions
- Unit Group - Remove (Picked unit) from Camouflage_DetectGroup
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- Set Camouflage_DetectGroupCount = (Number of units in Camouflage_DetectGroup)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Camouflage_DetectGroupCount Less than or equal to 0
- Then - Actions
- Else - Actions
- Unit Group - Pick every unit in Camouflage_DetectGroup and do (Actions)
- Loop - Actions
- Set Camouflage_DetectPoint[0] = (Position of (Picked unit))
- Set Camouflage_DetectPoint[1] = (Camouflage_DetectPoint[0] offset by 500.00 towards (Facing of (Picked unit)) degrees)
- Loop - Actions
- -------- CAN DETECT IF ENEMY IS FACING --------
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Distance between Camouflage_Point and Camouflage_DetectPoint[1]) Less than (Distance between Camouflage_DetectPoint[0] and Camouflage_DetectPoint[1])
- Then - Actions
- Set Camouflage_DetectRoll = (Random real number between 1.00 and 100.00)
- -------- CASTER DETECTED --------
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Camouflage_DetectRoll Less than or equal to Camouflage_DetectChance
- Then - Actions
- Trigger - Turn off (This trigger)
- Unit - Remove Camouflage buff from Camouflage_Caster
- Unit - Remove Ghost from Camouflage_Caster
- Unit - Remove Permanent Invisibility from Camouflage_Caster
- Custom script: call DestroyGroup(udg_Camouflage_DetectGroup)
- Custom script: call RemoveLocation(udg_Camouflage_Point)
- Else - Actions
- If - Conditions
- Else - Actions
- If - Conditions
- Unit Group - Pick every unit in Camouflage_DetectGroup and do (Actions)
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Camouflage_Duration Less than or equal to 0.00
- Then - Actions
- Trigger - Turn off (This trigger)
- Unit - Remove Camouflage buff from Camouflage_Caster
- Unit - Remove Ghost from Camouflage_Caster
- Unit - Remove Permanent Invisibility from Camouflage_Caster
- Custom script: call DestroyGroup(udg_Camouflage_DetectGroup)
- Custom script: call RemoveLocation(udg_Camouflage_Point)
- Else - Actions
- If - Conditions
- Custom script: call RemoveLocation(udg_Camouflage_DetectPoint[0])
- Custom script: call RemoveLocation(udg_Camouflage_DetectPoint[1])
- Events