<Effect name="Teleport Units in Area (Center Unit)">
<Param name="Object" dispName="Center Unit" varType="unit">default</Param>
<Param name="Dst" dispName="Radius" varType="string">10.0</Param>
<Param name="UnitId" dispName="Unit Type ID (Optional)" varType="string">-1</Param>
<Param name="FromPlayer" dispName="From Player or 99 for ALL" varType="string">99</Param>
<Param name="Area" dispName="" varType="area">0, 0, 0</Param>
<Param name="Booler" dispName="Include Center Unit" varType="bool">false</Param>
<Param name="position" dispName="Retain Unit Positions" varType="bool">false</Param>
<Command>trQuestVarSet("convarea", 0);</Command>
<Command>trQuestVarSet("ffweho",0);</Command>
<Command>if(%FromPlayer%!=99) trQuestVarSet("vroom", %FromPlayer%);</Command>
<Command>trQuestVarSet("warthog", 0);</Command>
<Command>trQuestVarSet("zeep", 0);</Command>
<Command>if(%UnitId%>=0) {</Command>
<Command>trQuestVarSet("zeep", %UnitId%);</Command>
<Command>}</Command>
<Command>if(0>%UnitId%) {</Command>
<Command>while(kbGetUnitTypeName(trQuestVarGet("zeep"))!="All") {</Command>
<Command>trQuestVarSet("zeep", trQuestVarGet("zeep")+1);</Command>
<Command>}}</Command>
<Command>trQuestVarSet("lastpl", xsGetContextPlayer());</Command>
<Command>if(%FromPlayer%!=99) trQuestVarSet("blarg",%FromPlayer%);</Command>
<Command>if(%FromPlayer%==99) {</Command>
<Command>trQuestVarSet("blarg",0);</Command>
<Command>trQuestVarSet("vroom",12);</Command>
<Command>}</Command>
<Command>trQuestVarSet("i",trQuestVarGet("blarg"));</Command>
<Command>while(trQuestVarGet("vroom")>=trQuestVarGet("i")) {</Command>
<Command>xsSetContextPlayer(trQuestVarGet("i"));</Command>
<Command>kbLookAtAllUnitsOnMap();</Command>
<Command>trQuestVarSet("convarea", kbUnitQueryCreate("convarea"));</Command>
<Command>kbUnitQuerySetPlayerID(trQuestVarGet("convarea"), trQuestVarGet("i"));</Command>
<Command>kbUnitQuerySetUnitType(trQuestVarGet("convarea"), trQuestVarGet("zeep"));</Command>
<Command>kbUnitQuerySetPosition(trQuestVarGet("convarea"), kbGetBlockPosition(""+1*%Object%));</Command>
<Command>kbUnitQuerySetMaximumDistance(trQuestVarGet("convarea"), %Dst%);</Command>
<Command>kbUnitQuerySetAscendingSort(trQuestVarGet("convarea"), true);</Command>
<Command>kbUnitQueryResetResults(trQuestVarGet("convarea"));</Command>
<Command>trQuestVarSet("warthog", kbUnitQueryExecute(trQuestVarGet("convarea")));</Command>
<Command>while(trQuestVarGet("warthog")>0) {</Command>
<Command>trQuestVarSet("warthog", trQuestVarGet("warthog")-1);</Command>
<Command>trQuestVarSet("ffweho", kbUnitQueryGetResult(trQuestVarGet("convarea"), trQuestVarGet("warthog")));</Command>
<Command>trQuestVarSet("ffweho2", trQuestVarGet("ffweho"));</Command>
<Command>if(%Booler%==true) {</Command>
<Command>if(trQuestVarGet("ffweho2")==kbGetBlockID(""+1*%Object%)) {trQuestVarSet("ffweho2", trQuestVarGet("ffweho")+1);}}</Command>
<Command>if(trQuestVarGet("ffweho2")!=kbGetBlockID(""+1*%Object%)) {</Command>
<Command>trUnitSelectClear();</Command>
<Command>trUnitSelectByID(1*trQuestVarGet("ffweho"));</Command>
<Command>trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(vector(%Area%)));</Command>
<Command>if(%position%==true) trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(vector(%Area%))- (xsVectorGetX(kbGetBlockPosition(""+1*%Object%))-xsVectorGetX(kbUnitGetPosition(1*trQuestVarGet("ffweho")))));</Command>
<Command>trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(vector(%Area%)));</Command>
<Command>if(%position%==true) trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(vector(%Area%))- (xsVectorGetZ(kbGetBlockPosition(""+1*%Object%))-xsVectorGetZ(kbUnitGetPosition(1*trQuestVarGet("ffweho")))));</Command>
<Command>trUnitTeleport(1*trQuestVarGet("oiwghogwhywhlocx"), xsVectorGetY(vector(%Area%)), 1*trQuestVarGet("oiwghogwhywhlocz"));</Command>
<Command>}}</Command>
<Command>trQuestVarSet("i", trQuestVarGet("i")+1);}</Command>
<Command>xsSetContextPlayer(trQuestVarGet("lastpl"));</Command>
</Effect>
unit ID =-1 ->teleports everything
in case you wanna have units and groups name you can use
teleport units in area (simple) *TL* which requires Typeloader to be used once before (both can be found in Consti's Triggerpack). For player range you can use
Teleport Units in Area Player Range *TL*
which is based on the other one from Const's Triggerpack.
Notice the *TL*? It means these triggers need typeloader to be used once before (recommend is first trigger you create)[This message has been edited by Mister SCP (edited 03-12-2011 @ 05:37 AM).]