- Joined
- Nov 19, 2008
- Messages
- 13
Hi!
I did a Backstabtrigger by using Pyrogasms Tutorial (Detecting a "Backstab" (GUI) - Wc3campaigns)
and I have a problem, cause it doesnt work!
Please help me!
Trigger 1
Trigger 2
I did a Backstabtrigger by using Pyrogasms Tutorial (Detecting a "Backstab" (GUI) - Wc3campaigns)
and I have a problem, cause it doesnt work!
Please help me!
Trigger 1
JASS:
function Backstab_GetAngleDifference takes real a1, real a2 returns real
local real x
// The Modulo will get the co-terminal angle if the angle is less than -360 or greater than 360.
set a1=ModuloReal(a1,360)
set a2=ModuloReal(a2,360)
// makes sure angle 1 is the smaller angle. If it isn't it switches them.
if a1>a2 then
set x=a1
set a1=a2
set a2=x
endif
// Subtracts 360, to get the first negative co-terminal angle, this is then used in a comparison to check if the angle is greater than 180
set x=a2-360
if a2-a1 > a1-x then
// If it is, use the negative angle instead
set a2=x
endif
// Now, get the difference between the 2 angles.
set x=a1-a2
// If the difference is negative, make it positive and return it. If its positive, return it.
if (x<0) then
return -x
endif
return x
endfunction
Trigger 2
-
Backstabtest
-
Ereignisse
- Einheit - A unit is attacked
-
Bedingungen
- (Level of Hinterhalt (Eigen-Schurkin) for (Attacking unit)) greater than 0
-
Aktionen
- Custom script: local real udg_Backstab_Angle
- Custom script: set udg_Backstab_Angle = Backstab_GetAngleDifference(GetUnitFacing(GetTriggerUnit()), GetUnitFacing(GetAttacker()))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Bedingungen
- Backstab_Angle less or equal to 60.00
-
'THEN'-Aktionen
- Einheit - Cause (Attacking unit) to damage (Triggering unit), dealing 300.00 damage of attack type Magie and damage type Normal
- Schwebender Text - Create floating text that reads (String(Backstab_Angle)) above (Attacking unit) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
- Schwebender Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
- Schwebender Text - Change (Last created floating text): Deaktivieren permanence
- Schwebender Text - Change the lifespan of (Last created floating text) to 2.25 seconds
- 'ELSE'-Aktionen
-
'IF'-Bedingungen
-
Ereignisse