- Joined
- Jun 10, 2007
- Messages
- 780
Can someone modify these codes so that instead of making units slide on northrend ice to slide on lordaeron summer dirt?
Can you please change this one to lordaeron summer dirt as well?
JASS:
function Trig_Slides_Actions takes nothing returns nothing
local group g1
local group g2
local location p
local location p2
local unit u
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 11
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set g1 = GetUnitsOfPlayerAndTypeId(ConvertedPlayer(GetForLoopIndexA()), 'hpea')
set u = GroupPickRandomUnit(g1)
set p = GetUnitLoc(u)
if ( IsUnitAliveBJ(u) == true ) then
if ( GetTerrainTypeBJ(p) == 'Nice' ) then
set p2 = PolarProjectionBJ(p,7, GetUnitFacing(u))
call SetUnitPositionLoc( u, p2 )
call RemoveLocation( p2 )
endif
endif
call RemoveLocation( p )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
endfunction
function InitTrig_Slides takes nothing returns nothing
set gg_trg_Slides = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Slides, 0.02 )
call TriggerAddAction( gg_trg_Slides, function Trig_Slides_Actions )
endfunction
Can you please change this one to lordaeron summer dirt as well?
JASS:
function Trig_Skate_Conditions takes nothing returns boolean
if ( GetBooleanOr( GetIssuedOrderIdBJ() == String2OrderIdBJ("smart") , GetIssuedOrderIdBJ() == String2OrderIdBJ("move") ) ) then
return true
endif
return false
endfunction
function Trig_Skate_Actions takes nothing returns nothing
local location p
local location p2
set p = GetUnitLoc(GetOrderedUnit())
if ( GetTerrainTypeBJ(p) == 'Nice' ) then
set p2 = GetOrderPointLoc()
call SetUnitPositionLocFacingBJ( GetTriggerUnit(), PolarProjectionBJ(p, 1.00, DistanceBetweenPoints(p, p2)), AngleBetweenPoints(p, p2) )
call RemoveLocation( p2 )
endif
call RemoveLocation( p )
endfunction
function InitTrig_Skate takes nothing returns nothing
set gg_trg_Skate = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Skate, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
call TriggerAddCondition( gg_trg_Skate, Condition( function Trig_Skate_Conditions ) )
call TriggerAddAction( gg_trg_Skate, function Trig_Skate_Actions )
endfunction
Last edited by a moderator: