02-20-2008, 12:38 AM
|
#1 (permalink)
|
daehtorraP
Join Date: Jun 2007
Posts: 695
|
Modify Code
Can someone modify these codes so that instead of making units slide on northrend ice to slide on lordaeron summer dirt?
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 endloopendfunctionfunction 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?
function Trig_Skate_Conditions takes nothing returns boolean if ( GetBooleanOr ( GetIssuedOrderIdBJ () == String2OrderIdBJ ("smart") , GetIssuedOrderIdBJ () == String2OrderIdBJ ("move") ) ) then return true endif return falseendfunctionfunction 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 )endfunctionfunction 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 Dr Super Good; 02-20-2008 at 01:08 AM..
Reason: Use JASS tags please.
|
|
|