- Joined
- Mar 23, 2008
- Messages
- 942
These two triggers are supposed to make a circular movement of two missiles in the direction of the target... But does nothing.
*I know that is still missing the event to stop the jass trigger from running, but first I need to make it work to later stop it xD
-
Kansho and Bakuya
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Kansho and Bakuya (based in channel)
-
Actions
- Set SpellPoint[0] = (Position of (Casting unit))
- Set SpellPoint[1] = (Position of (Target unit of ability being cast))
- Set SpellPoint[2] = (SpellPoint[1] offset by ((Distance between SpellPoint[0] and SpellPoint[1]) / 2.00) towards (Angle from SpellPoint[1] to SpellPoint[0]) degrees)
- Unit - Create 1 Kansho and Bakuya for Neutral Victim at SpellPoint[0] facing SpellPoint[1]
- Unit - Set Rally-Point for (Last created unit) to SpellPoint[2]
- Unit - Create 1 Kansho and Bakuya for Neutral Extra at SpellPoint[0] facing SpellPoint[1]
- Unit - Set Rally-Point for (Last created unit) to SpellPoint[2]
- Trigger - Turn on Kansho and Bakuya missile <gen>
- Custom script: call RemoveLocation(udg_SpellPoint[0])
- Custom script: call RemoveLocation(udg_SpellPoint[1])
- Custom script: call RemoveLocation(udg_SpellPoint[2])
-
Events
JASS:
function Trig_Kansho_and_Bakuya_missile_Func001001002 takes nothing returns boolean
return (GetUnitTypeId(GetFilterUnit()) == 'h00H')
endfunction
function Trig_Kansho_and_Bakuya_missile_Func001A takes nothing returns nothing
local location epos
local location center
local location x
local real r
local real angle
local real angleplus
local real fim
local real dist
if ((GetOwningPlayer(GetEnumUnit()) == Player(bj_PLAYER_NEUTRAL_VICTIM))) then
set center = GetUnitRallyPoint(GetEnumUnit())
set x = GetUnitLoc(GetEnumUnit())
set r = DistanceBetweenPoints(x, center)
set angle = AngleBetweenPoints(center, x)
set angleplus = (angle + (360 / 3.14159265*r))
call SetUnitPositionLoc(GetEnumUnit(), PolarProjectionBJ(center, r, angleplus))
else
set center = GetUnitRallyPoint(GetEnumUnit())
set x = GetUnitLoc(GetEnumUnit())
set r = DistanceBetweenPoints(x, center)
set angle = AngleBetweenPoints(center, x)
set angleplus = (angle - (360 / 3.14159265*r))
call SetUnitPositionLoc(GetEnumUnit(), PolarProjectionBJ(center, r, angleplus))
endif
endfunction
function Trig_Kansho_and_Bakuya_missile_Actions takes nothing returns nothing
set bj_wantDestroyGroup = true
call ForGroupBJ(GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function Trig_Kansho_and_Bakuya_missile_Func001001002)), function Trig_Kansho_and_Bakuya_missile_Func001A)
endfunction
//===========================================================================
function InitTrig_Kansho_and_Bakuya_missile takes nothing returns nothing
set gg_trg_Kansho_and_Bakuya_missile = CreateTrigger( )
call DisableTrigger( gg_trg_Kansho_and_Bakuya_missile )
call TriggerRegisterTimerEventPeriodic( gg_trg_Kansho_and_Bakuya_missile, 0.04 )
call TriggerAddAction( gg_trg_Kansho_and_Bakuya_missile, function Trig_Kansho_and_Bakuya_missile_Actions )
endfunction
*I know that is still missing the event to stop the jass trigger from running, but first I need to make it work to later stop it xD