You must be logged in to post messages.
Please login or register

Scenario Design
Moderated by Yeebaagooon, TAG, nottud

Hop to:    
Welcome! You are not logged in. Please Login or Register.2502 replies, Closed
Age of Mythology Heaven » Forums » Scenario Design » Have a Trigger Request? Post it here!
Bottom
Topic Subject:Have a Trigger Request? Post it here!
« Previous Page  1 ··· 10 ··· 20 ··· 30 ··· 40 ··· 50 ··· 60 ··· 70 ··· 80 ··· 90 ··· 98 99 100  Next Page »
invent00r
Mortal
posted 04 October 2007 11:46 AM EDT (US)         
So you have a question trigger request?

You can post it here!



Hello and Welcome to the Trigger Request Thread (TRT). This thread purpose is only to place trigger request and discuss about them. If you have unrelated questions or need help with triggers, please use OmegasRage thread!



Before posting your request, it's always good to read the so-called FAQ.

  1. What is a FAQ?
    The term "FAQ" (when pronounced, it rhymes with "back") is an acronym for Frequently Asked Questions.
  2. How do I install a trigger?
    First of all, you need to have Age of Mythology installed. If you have that, then you are half away done. Now you will need to find your way to your AoM installation folder, and open the trigger folder or the trigger2 folder if you pretend to install the new trigger on The Titans (the expansion). With the notepad, open a file called, typetest.xml - at this point, you need to copy the trigger from this page and paste it there. If you requested a condition, then place it under or under if it was an effect you requested.

    Notes:
    1. Please put the trigger at the end of each list so you can easly remove them and keep the integrity of the typetest file.
    2. When copying the trigger from someone, please click the edit image (), and only then copy the respective effect or condition.
    3. If this is your 1st trigger you're installing, please backup the original typetest file.

  3. So.. How exactly are new triggers done?
    AoM has a built-in engine that can prase XS code. Triggers are programmed and interpreted using this language through a serious of existing functions. Since there are over 600 functions, and only a few are used by the default triggers, this leaves plenty of room for a whole new set of advanced, usefull triggers - but it does have some limitations...
  4. I want to learn triggers, how do I do that?
    It takes a quite some time, but if you really wish to learn triggers, I recommend fully understanding XS language before you start making triggers, and for that you need to go here - Master XS. If you want to skip all that, and you want to be able to do only simple triggers, read this guide.
  5. Help! My triggers have stopped working!
    Triggers Stop Working Guide. Also using run immediately, linking camera tracks, sound timers and decimals in conditions like Timer and Distance to Unit effect, might cause this. Moreover, typing an invalid name on the Victory Conditions will cause a trigger block. But post these sort of questions in the Great Question thread.



Resources

Recommended Downloads:
  1. Trigger Loader 2 + Quest Vars (AoM && TT) by invent00r and Mythic_Freak
  2. SomeNewXTriggers 3 (TT) & SomeNewTriggers 4 (AoM) by Reyk
  3. Proactive Triggers (TT & AoM) by invent00r
  4. Advanced Triggers Set (TT) by pftq
  5. New Custom Triggers (TT) by Baseballkid14
  6. New triggers for TT v3 by nottud
  7. Conditonal Effects (TT & AoM) by nottud
  8. Angry Levels (TT & AoM) by angryzor
  9. SIMSTools (TT) by angryzor
  10. A list of all guides sorted by Paperfriend




Posting a Request

So you have read the FAQ and want to post a request? Ok, go for it, just be sure to use the following format:

Name - This should be as straightforward as possible.
Description - Always describe the actions that you want the trigger to perform. Please give atleast one example of use.

Remember that not all triggers are possible but I - and anyone who wants to help me -, will try our best.

Enjoy. .
-invent00r

My Work: 1 2 3 4 5 6 7 8 9 10

WIP: Master XS Battle Micro AI
Paused: AI (%4.247)
Os segredos são de quem os souber guardar.

[This message has been edited by invent00r (edited 08-15-2008 @ 03:40 PM).]

AuthorReplies:
HailToTheOboe
Bitten by a radioactive ostrich
posted 26 January 2009 02:20 PM EDT (US)     2476 / 2502       
nottud
Hero
posted 28 January 2009 11:16 AM EDT (US)     2477 / 2502       
Important note:

Please DO NOT install your custom trigger conditions and effects as the first trigger effect/conditon. It will change your defaukt condition and effect AND it will make all triggered random maps sync online including mine. If you are having that problem download this patch to fix it.

http://aom.heavengames.com/downloads/showfile.php?fileid=7764


(inventoor: please add the above to the main post)

I am having big problems with people doing this and syncing online.

The boy with the mad imagination
Prepare for the ultimate duel!
Learn to use all my triggers and what you can do with them. Visit here.
Find out and download the transform trigger here.
Play some minigames I have created outside AOM including some 3D games here.
invent00r
Mortal
posted 28 January 2009 01:30 PM EDT (US)     2478 / 2502       
Hmm no.. That patch isn't really best the solution. AoM reads the trigger xml files alphabetically, and you have "typeA.xml". Meaning, any other user-created trigger file that starts with any of the 19 letters before t, will render it useless.

Anyways, I see your point, but if they just need to read note 1: Please put the trigger at the end of each list so you can easily remove them and keep the integrity of the typetest file.. .
-invent00r

My Work: 1 2 3 4 5 6 7 8 9 10

WIP: Master XS Battle Micro AI
Paused: AI (%4.247)
Os segredos são de quem os souber guardar.

[This message has been edited by invent00r (edited 01-28-2009 @ 01:31 PM).]

Mephiles
Mortal
(id: Titan602)
posted 28 January 2009 01:40 PM EDT (US)     2479 / 2502       
invent00r, remember that thing you were working on ages ago that lets the typewriter trigger have capital letters? Have you finished it?

MEPH
[Insert amazingly witty signature here.]

Me and Yeebaagooon's scenarios | Download The Corruptor
invent00r
Mortal
posted 28 January 2009 03:55 PM EDT (US)     2480 / 2502       
@:Mephiles
Yeah.. I had it finished.. Mythic_Freak was to do the implementation on that TW effect. He has an exam tomorrow so I did it for him:
<Effect name="Typewriter Dialog">
<Param name="Sound" dispName="$$22384$$Sound" varType="sound">default</Param>
<Param name="EventID" dispName="$$22362$$Trigger" varType="event">-1</Param>
<Param name="Person" dispName="Person" varType="string"> </Param>
<Param name="Subtitle" dispName="$$22385$$Subtitle" varType="stringid"></Param>
<Param name="Portrait" dispName="$$22386$$Portrait" varType="string"></Param>
<Param name="Int" dispName="Interval MS" varType="long">100</Param>
<Command>offset = 1;</Command>
<Command>length = -1;</Command>
<Command>speed = %Int%;</Command>
<Command>event = %EventID%;</Command>
<Command>portrait = "%Portrait%";</Command>
<Command>person = "%Person%";</Command>
<Command>text = "%Subtitle%";</Command>
<Command>length = String_length("%Subtitle%");</Command>
<Command>sound = getSound1("%Sound%");</Command>
<Command>xsEnableRule("typeWriter");</Command>
</Effect>

<Effect name="Typewriter Loader">
<Param name="mod" dispName="Don't touch this!" varType="strwing">%%</Param>
<Command>xsDisableSelf();}}</Command>
<Command>string String_AutoFormat(string sText = "")</Command>
<Command>{</Command>
<Command> if(sText == "")</Command>
<Command> return("");</Command>
<Command> if(String_length(sText) == 1)</Command>
<Command> return(String_toUpperCase(String_charAt(sText)));</Command>
<Command> int pos = 1;</Command>
<Command> int sSize = String_length(sText);</Command>
<Command> string currentChar = "";</Command>
<Command> string dText = "";</Command>
<Command> string retText = "";</Command>
<Command> if(String_charAt(sText, 1) != "@") {</Command>
<Command> dText = String_toUpperCase(String_charAt(sText, 1));</Command>
<Command> retText = dText;</Command>
<Command> } else</Command>
<Command> {</Command>
<Command> pos++;</Command>
<Command> retText = String_toLowerCase(String_charAt(sText, 2));</Command>
<Command> dText = "@"+retText;</Command>
<Command> }</Command>
<Command> bool needUpperCase = false;</Command>
<Command> bool useUpperCase = false;</Command>
<Command> while(true) // To infinity, and beyond!</Command>
<Command> {</Command>
<Command> if(dText == sText)</Command>
<Command> break;</Command>
<Command> currentChar = "";</Command>
<Command> pos++;</Command>
<Command> if(dText+" " > sText) { currentChar = ""; }</Command>
<Command> else if(dText+"!" > sText) { currentChar = " "; useUpperCase = true;}</Command>
<Command> else if(dText+"\"" > sText){ currentChar = "!"; needUpperCase = true; useUpperCase = true;}</Command>
<Command> else if(dText+"#" > sText) { currentChar = "\""; useUpperCase = true;}</Command>
<Command> else if(dText+"$" > sText) { currentChar = "#"; useUpperCase = true;}</Command>
<Command> else if(dText+"%mod%" > sText) { currentChar = "$"; useUpperCase = true;}</Command>
<Command><![CDATA[else if(dText+"&">sText){currentChar="%mod%"; useUpperCase = true;}]]></Command>
<Command><![CDATA[else if(dText+"'">sText){currentChar="&"; needUpperCase = true;}]]></Command>
<Command> else if(dText+"(" > sText) { currentChar = "'"; useUpperCase = true;}</Command>
<Command> else if(dText+")" > sText) { currentChar = "("; useUpperCase = true;}</Command>
<Command> else if(dText+"*" > sText) { currentChar = ")"; useUpperCase = true;}</Command>
<Command> else if(dText+"+" > sText) { currentChar = "*"; useUpperCase = true;}</Command>
<Command> else if(dText+"," > sText) { currentChar = "+"; useUpperCase = true;}</Command>
<Command> else if(dText+"-" > sText) { currentChar = ","; useUpperCase = true;}</Command>
<Command> else if(dText+"." > sText) { currentChar = "-"; useUpperCase = true;}</Command>
<Command> else if(dText+"/" > sText) { currentChar = "."; needUpperCase = true; useUpperCase = true;}</Command>
<Command> else if(dText+"0" > sText) { currentChar = "/"; useUpperCase = false;}</Command>
<Command> else if(dText+"1" > sText) { currentChar = "0"; useUpperCase = false;}</Command>
<Command> else if(dText+"2" > sText) { currentChar = "1"; useUpperCase = false;}</Command>
<Command> else if(dText+"3" > sText) { currentChar = "2"; useUpperCase = false;}</Command>
<Command> else if(dText+"4" > sText) { currentChar = "3"; useUpperCase = false;}</Command>
<Command> else if(dText+"5" > sText) { currentChar = "4"; useUpperCase = false;}</Command>
<Command> else if(dText+"6" > sText) { currentChar = "5"; useUpperCase = false;}</Command>
<Command> else if(dText+"7" > sText) { currentChar = "6"; useUpperCase = false;}</Command>
<Command> else if(dText+"8" > sText) { currentChar = "7"; useUpperCase = false;}</Command>
<Command> else if(dText+"9" > sText) { currentChar = "8"; useUpperCase = false;}</Command>
<Command> else if(dText+":" > sText) { currentChar = "9"; useUpperCase = false;}</Command>
<Command> else if(dText+";" > sText) { currentChar = ":"; useUpperCase = false;}</Command>
<Command><![CDATA[else if(dText+"<" > sText) { currentChar = ";"; useUpperCase = false;}]]></Command>
<Command><![CDATA[else if(dText+"=" > sText) { currentChar = "<"; useUpperCase = false;}]]></Command>
<Command> else if(dText+">" > sText) { currentChar = "="; useUpperCase = false;}</Command>
<Command> else if(dText+"?" > sText) { currentChar = ">"; useUpperCase = false;}</Command>
<Command> else if(dText+"@" > sText) { currentChar = "?"; needUpperCase = true;}</Command>
<Command> else if(dText+"a" > sText) { currentChar = "@"; needUpperCase = true; useUpperCase = true;}</Command>
<Command> else if(dText+"b" > sText) { currentChar = "a"; useUpperCase = false;}</Command>
<Command> else if(dText+"c" > sText) { currentChar = "b"; useUpperCase = false;}</Command>
<Command> else if(dText+"d" > sText) { currentChar = "c"; useUpperCase = false;}</Command>
<Command> else if(dText+"e" > sText) { currentChar = "d"; useUpperCase = false;}</Command>
<Command> else if(dText+"f" > sText) { currentChar = "e"; useUpperCase = false;}</Command>
<Command> else if(dText+"g" > sText) { currentChar = "f"; useUpperCase = false;}</Command>
<Command> else if(dText+"h" > sText) { currentChar = "g"; useUpperCase = false;}</Command>
<Command> else if(dText+"i" > sText) { currentChar = "h"; useUpperCase = false;}</Command>
<Command> else if(dText+"j" > sText) { currentChar = "i"; useUpperCase = false;}</Command>
<Command> else if(dText+"k" > sText) { currentChar = "j"; useUpperCase = false;}</Command>
<Command> else if(dText+"l" > sText) { currentChar = "k"; useUpperCase = false;}</Command>
<Command> else if(dText+"m" > sText) { currentChar = "l"; useUpperCase = false;}</Command>
<Command> else if(dText+"n" > sText) { currentChar = "m"; useUpperCase = false;}</Command>
<Command> else if(dText+"o" > sText) { currentChar = "n"; useUpperCase = false;}</Command>
<Command> else if(dText+"p" > sText) { currentChar = "o"; useUpperCase = false;}</Command>
<Command> else if(dText+"q" > sText) { currentChar = "p"; useUpperCase = false;}</Command>
<Command> else if(dText+"r" > sText) { currentChar = "q"; useUpperCase = false;}</Command>
<Command> else if(dText+"s" > sText) { currentChar = "r"; useUpperCase = false;}</Command>
<Command> else if(dText+"t" > sText) { currentChar = "s"; useUpperCase = false;}</Command>
<Command> else if(dText+"u" > sText) { currentChar = "t"; useUpperCase = false;}</Command>
<Command> else if(dText+"v" > sText) { currentChar = "u"; useUpperCase = false;}</Command>
<Command> else if(dText+"w" > sText) { currentChar = "v"; useUpperCase = false;}</Command>
<Command> else if(dText+"x" > sText) { currentChar = "w"; useUpperCase = false;}</Command>
<Command> else if(dText+"y" > sText) { currentChar = "x"; useUpperCase = false;}</Command>
<Command> else if(dText+"z" > sText) { currentChar = "y"; useUpperCase = false;}</Command>
<Command> else if(dText+"[" > sText) { currentChar = "z"; useUpperCase = false;}</Command>
<Command> else if(dText+"\\" > sText){ currentChar = "["; useUpperCase = false;}</Command>
<Command> else if(dText+"]" > sText) { currentChar = "\\"; useUpperCase = false;}</Command>
<Command> else if(dText+"[" > sText) { currentChar = "]"; useUpperCase = false;}</Command>
<Command> else if(dText+"^" > sText) { currentChar = "["; useUpperCase = false;}</Command>
<Command> else if(dText+"_" > sText) { currentChar = "^"; useUpperCase = false;}</Command>
<Command> else if(dText+"`" > sText) { currentChar = "_"; useUpperCase = false;}</Command>
<Command> else if(dText+"{" > sText) { currentChar = "`"; useUpperCase = false;}</Command>
<Command> else if(dText+"|" > sText) { currentChar = "{"; useUpperCase = false;}</Command>
<Command> else if(dText+"}" > sText) { currentChar = "|"; useUpperCase = false;}</Command>
<Command> else if(dText+"~" > sText) { currentChar = "}"; useUpperCase = false;}</Command>
<Command> else if(dText+"~~" > sText){ currentChar = "~"; useUpperCase = false;}</Command>
<Command><![CDATA[if((useUpperCase == false) && needUpperCase)]]></Command>
<Command> {</Command>
<Command> currentChar = String_toUpperCase(currentChar);</Command>
<Command> needUpperCase = false;</Command>
<Command> }</Command>
<Command> dText = dText + currentChar;</Command>
<Command> if(currentChar != "@")</Command>
<Command> retText = retText + currentChar;</Command>
<Command> if(currentChar == "")</Command>
<Command> return(retText+"__Error__");</Command>
<Command> }</Command>
<Command> return(retText);</Command>
<Command>}</Command>
<Command>int offset = -1;</Command>
<Command>int length = -1;</Command>
<Command>int speed = -1;</Command>
<Command>int event = -1;</Command>
<Command>string portrait = "";</Command>
<Command>string person = "";</Command>
<Command>string text = "";</Command>
<Command>string sound = "";</Command>
<Command>string getSound1(string sound1 = "", string sound2 = "") {return(sound1);}</Command>
<Command>rule typeWriter</Command>
<Command>inactive</Command>
<Command>{</Command>
<Command>static int timer = 0;</Command>
<Command>if(timer + speed > trTimeMS())</Command>
<Command>return;</Command>
<Command>timer = trTimeMS();</Command>
<Command>if(String_charAt(text, offset) == "@")</Command>
<Command>offset++;</Command>
<Command>trSoundPlayDialog(sound, "1", -1, false, person+": "+String_AutoFormat(String_substr(text, 0, offset+1)), portrait);</Command>
<Command>offset++;</Command>
<Command>if(offset-1 > length) {</Command>
<Command>trEventFire(event);</Command>
<Command>xsDisableSelf();</Command>
<Command>}</Command>
<Command>if(false) {</Command>
</Effect>
Please install the Trigger Loader and Typewriter Loader on the first trigger.
Now, to use the upper case letters, you just need to type @ before the letter comes in. It already does some automatic casing. It upper cases the first letter, and also the letters after full-stops and ! and also ?. Now I just added a tiny exception, so you can use @ as the first letter to not automatically uppercase it.

This code might get to be included on the next version of the Trigger Loader, in which case you just need to delete Typewriter Loader and place the new version of the Trigger Loader. .

Took me quite some time.. But there you go. My last trigger . Have fun.
-invent00r

My Work: 1 2 3 4 5 6 7 8 9 10

WIP: Master XS Battle Micro AI
Paused: AI (%4.247)
Os segredos são de quem os souber guardar.
HailToTheOboe
Bitten by a radioactive ostrich
posted 28 January 2009 06:09 PM EDT (US)     2481 / 2502       
sneaky_squirrel
Mortal
posted 29 January 2009 00:26 AM EDT (US)     2482 / 2502       
I am a wanderer of the deserts seeking knowledge in this paradise, I need to say and ask:

  • Invoke GP at Unit doesn't work (I have the LOS and the GP, and normal invoke GP worked while this did not), mind explaining why?, I seek to use the shockwave GP and yes I did kill all GPs shortly before granting it each time to avoid altantean reload.

  • Invoke GP near Unit, same as above.

  • I seek invoke GP at army and invoke GP near army, and would like to know if the previous 2 are either faulty or being used incorrectly, thanks.

    If not answered you will suffer the consequences, a thread about this problem 0_O

    The Gods have left us, therefore making the old world crumble and turn into ashes...

    But as the gods return, from the ashes of the old world, shall rise a more beautiful and powerful new world, and life will begin once more, if they hadn't closed...dang you ES.
  • HailToTheOboe
    Bitten by a radioactive ostrich
    posted 29 January 2009 00:35 AM EDT (US)     2483 / 2502       
    Can you double check to see if your invoke GP at/near unit triggers work for other GPs but not shockwave?

    I've heard of otherpeople having difficulty using it for shockwave, so if it's a shockwave specific problem maybe it needs a different fix.

    Something else to try could be "Unit (or Army) Position to QV Vector" and "Invoke Godpower at QV Vector" from the Trigger Loader.

    [This message has been edited by HailToTheOboe (edited 01-29-2009 @ 00:36 AM).]

    dwieeb
    Mortal
    posted 29 January 2009 01:17 AM EDT (US)     2484 / 2502       
    I request Unit Heading Towards Unit

    (makes a unit head towards another unit)
    sneaky_squirrel
    Mortal
    posted 30 January 2009 00:23 AM EDT (US)     2485 / 2502       
    Can you double check to see if your invoke GP at/near unit triggers work for other GPs but not shockwave?

    I've heard of other people having difficulty using it for shockwave, so if it's a shockwave specific problem maybe it needs a different fix.

    Something else to try could be "Unit (or Army) Position to QV Vector" and "Invoke Godpower at QV Vector" from the Trigger Loader.
    So Position to QV Vector would find where the hero is and invoke at vector will invoke at hero's location?, almost like locking a target before shooting it ;p, can you show me where I could find these triggers or their exact names, I can't find the in nottud's latest trigger file :S.

    Tested on all other GPs, failed :S.

    The Gods have left us, therefore making the old world crumble and turn into ashes...

    But as the gods return, from the ashes of the old world, shall rise a more beautiful and powerful new world, and life will begin once more, if they hadn't closed...dang you ES.

    [This message has been edited by sneaky_squirrel (edited 01-30-2009 @ 00:38 AM).]

    nottud
    Hero
    posted 30 January 2009 12:43 PM EDT (US)     2486 / 2502       
    I think there was a corrupt version of the ivoke near unit, etc that came out and you might have them. To prevent confusion to myself I downloaded the non corrupt version and then added pftq infront of the trigger effect.

    <?xml version = "1.0"?>
    <trigger version="2">

    <!--

    Advanced Triggers Set for AOM
    by pftq

    Please refer to the readme included with the download for detailed help on how to properly use these effects.

    www.pftq.com
    a pftq production!
    February 5 2007

    -->

    <Conditions>

    <Condition name = "QV Compare Group">
    <Param name = "blah" dispName="IMPORTANT:" varType="string">Measure unlimited QVs by inserting more conditions without enabling the reset box (make sure to check the same QV in "QV to Check"). Enable RESET to start a new check. Note that there may be multiple QVs with highest value.</Param>
    <Param name = "QVName1" dispName = "QV Name 1" varType ="string">QV1</Param>
    <Param name = "QVName2" dispName = "QV Name 2" varType ="string">QV2</Param>
    <Param name = "QVName3" dispName = "QV Name 3" varType ="string">QV3</Param>
    <Param name = "test" dispName = "QV to Check: " varType="string">QV4</Param>
    <Param name = "booler" dispName = "QV is (higher or lower)" varType="operator">></Param>
    <Param name = "reset" dispName = "Reset" varType="bool">true</Param>
    <Command>if(%reset%==true) trQuestVarSet("QVHighestLowestThing", 0);</Command>
    <Command>if(trQuestVarGet("%QVName1%") %booler% trQuestVarGet("QVHighestLowestThing")) trQuestVarSet("QVHighestLowestThing", trQuestVarGet("%QVName1%"));</Command>
    <Command>if(trQuestVarGet("%QVName2%") %booler% trQuestVarGet("QVHighestLowestThing")) trQuestVarSet("QVHighestLowestThing", trQuestVarGet("%QVName2%"));</Command>
    <Command>if(trQuestVarGet("%QVName3%") %booler% trQuestVarGet("QVHighestLowestThing")) trQuestVarSet("QVHighestLowestThing", trQuestVarGet("%QVName3%"));</Command>
    <Expression>trQuestVarGet("%test%") %booler% trQuestVarGet("QVHighestLowestThing")</Expression>
    </Condition>

    </Conditions>

    <Effects>
    <Effect name="pftq Change Name 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="Namer" dispName="Change Display Name" varType="string">Insert Name Here</Param>
    <Param name="Booler" dispName="Include Center Unit" 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>xsSetContextPlayer(0);</Command>
    <Command>kbLookAtAllUnitsOnMap();</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>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>trUnitChangeName("%Namer%");</Command>
    <Command>}}</Command>
    <Command>trQuestVarSet("i", trQuestVarGet("i")+1);}</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("lastpl"));</Command>
    </Effect>

    <Effect name="pftq Convert/Change 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="ToPlayer" dispName="To Player" varType="string">0</Param>
    <Param name="ChangeUnit" dispName="Change Protounit Type" varType="string">Do Not</Param>
    <Param name="Booler" dispName="Include Center Unit" 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%)) {</Command>
    <Command>trQuestVarSet("ffweho2", trQuestVarGet("ffweho")+1);}}</Command>
    <Command>if(trQuestVarGet("ffweho2")!=kbGetBlockID(""+1*%Object%)) {</Command>
    <Command>trUnitSelectClear();</Command>
    <Command>trUnitSelectByID(1*trQuestVarGet("ffweho"));</Command>
    <Command>trUnitConvert(%ToPlayer%);</Command>
    <Command>if("%ChangeUnit%"!="Do Not") trUnitChangeProtoUnit("%ChangeUnit%");</Command>
    <Command>}}</Command>
    <Command>trQuestVarSet("i", trQuestVarGet("i")+1);}</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("lastpl"));</Command>
    </Effect>

    <Effect name="pftq Copy in Area SP-Overlap (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 Number or 99 for ALL" varType="string">99</Param>
    <Param name="SrcArmy" dispName="Army" varType="group">default</Param>
    <Param name="location" dispName="Target Unit" varType="unit">default</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>xsSetContextPlayer(0);</Command>
    <Command>kbLookAtAllUnitsOnMap();</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>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(trQuestVarGet("ffweho2")!=kbGetBlockID(""+1*%Object%)) {</Command>
    <Command>trUnitSelectClear();</Command>
    <Command>trUnitSelectByID(1*trQuestVarGet("ffweho"));</Command>
    <Command>trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(kbGetBlockPosition(""+1*%location%)));</Command>
    <Command>if(%position%==true) trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(kbGetBlockPosition(""+1*%location%))- (xsVectorGetX(kbGetBlockPosition(""+1*%Object%))-xsVectorGetX(kbUnitGetPosition(1*trQuestVarGet ("ffweho")))));</Command>
    <Command>trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(kbGetBlockPosition(""+1*%location%)));</Command>
    <Command>if(%position%==true) trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(kbGetBlockPosition(""+1*%location%))- (xsVectorGetZ(kbGetBlockPosition(""+1*%Object%))-xsVectorGetZ(kbUnitGetPosition(1*trQuestVarGet ("ffweho")))));</Command>
    <Command>trArmyDispatch("%SrcArmy%", ""+kbGetProtoUnitName(kbGetUnitBaseTypeID(1*trQuestVarGet("ffweho"))), 1, trQuestVarGet("oiwghogwhywhlocx"), xsVectorGetY(kbGetBlockPosition(""+1*%location%)), trQuestVarGet("oiwghogwhywhlocz"), 0, true);</Command>
    <Command>trArmySelect("%SrcArmy%");</Command>
    <Command>trUnitConvert(trQuestVarGet("i"));</Command>
    <Command>if(%position%==true) {trUnitTeleport(1*trQuestVarGet("oiwghogwhywhlocx"), xsVectorGetY(kbGetBlockPosition(""+1*%location%)), 1*trQuestVarGet("oiwghogwhywhlocz"));}</Command>
    <Command>}}</Command>
    <Command>trQuestVarSet("i", trQuestVarGet("i")+1);}</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("lastpl"));</Command>
    </Effect>

    <Effect name="pftq Copy/Convert in Area SP-Overlap (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 Number or 99 for ALL" varType="string">99</Param>
    <Param name="SrcArmy" dispName="Army" varType="group">default</Param>
    <Param name="location" dispName="Target Unit" varType="unit">default</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>xsSetContextPlayer(0);</Command>
    <Command>kbLookAtAllUnitsOnMap();</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>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(trQuestVarGet("ffweho2")!=kbGetBlockID(""+1*%Object%)) {</Command>
    <Command>trUnitSelectClear();</Command>
    <Command>trUnitSelectByID(1*trQuestVarGet("ffweho"));</Command>
    <Command>trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(kbGetBlockPosition(""+1*%location%)));</Command>
    <Command>if(%position%==true) trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(kbGetBlockPosition(""+1*%location%))- (xsVectorGetX(kbGetBlockPosition(""+1*%Object%))-xsVectorGetX(kbUnitGetPosition(1*trQuestVarGet ("ffweho")))));</Command>
    <Command>trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(kbGetBlockPosition(""+1*%location%)));</Command>
    <Command>if(%position%==true) trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(kbGetBlockPosition(""+1*%location%))- (xsVectorGetZ(kbGetBlockPosition(""+1*%Object%))-xsVectorGetZ(kbUnitGetPosition(1*trQuestVarGet ("ffweho")))));</Command>
    <Command>trArmyDispatch("%SrcArmy%", ""+kbGetProtoUnitName(kbGetUnitBaseTypeID(1*trQuestVarGet("ffweho"))), 1, trQuestVarGet("oiwghogwhywhlocx"), xsVectorGetY(kbGetBlockPosition(""+1*%location%)), trQuestVarGet("oiwghogwhywhlocz"), 0, true);</Command>
    <Command>if(%position%==true) {trArmySelect("%SrcArmy%"); trUnitTeleport(1*trQuestVarGet("oiwghogwhywhlocx"), xsVectorGetY(kbGetBlockPosition(""+1*%location%)), 1*trQuestVarGet("oiwghogwhywhlocz"));}</Command>
    <Command>}}</Command>
    <Command>trQuestVarSet("i", trQuestVarGet("i")+1);}</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("lastpl"));</Command>
    </Effect>

    <Effect name="pftq Copy in Area MP (Center Unit)">
    <Param name="Object" dispName="Center Unit" varType="unit">default</Param>
    <Param name="Dst" dispName="Center Unit Radius" varType="string">10.0</Param>
    <Param name="UnitId" dispName="Unit Type ID (Optional)" varType="string">-1</Param>
    <Param name="FromPlayer" dispName="From Player Number or 99 for ALL" varType="string">99</Param>
    <Param name="SrcArmy" dispName="Army" varType="group">default</Param>
    <Param name="location" dispName="Target Unit" varType="unit">default</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>xsSetContextPlayer(0);</Command>
    <Command>kbLookAtAllUnitsOnMap();</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>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(trQuestVarGet("ffweho2")!=kbGetBlockID(""+1*%Object%)) {</Command>
    <Command>trUnitSelectClear();</Command>
    <Command>trUnitSelectByID(1*trQuestVarGet("ffweho"));</Command>
    <Command>trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(kbGetBlockPosition(""+1*%location%)));</Command>
    <Command>if(%position%==true) trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(kbGetBlockPosition(""+1*%location%))- (xsVectorGetX(kbGetBlockPosition(""+1*%Object%))-xsVectorGetX(kbUnitGetPosition(1*trQuestVarGet ("ffweho")))));</Command>
    <Command>trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(kbGetBlockPosition(""+1*%location%)));</Command>
    <Command>if(%position%==true) trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(kbGetBlockPosition(""+1*%location%))- (xsVectorGetZ(kbGetBlockPosition(""+1*%Object%))-xsVectorGetZ(kbUnitGetPosition(1*trQuestVarGet ("ffweho")))));</Command>
    <Command>trArmyDispatch("%SrcArmy%", ""+kbGetProtoUnitName(kbGetUnitBaseTypeID(1*trQuestVarGet("ffweho"))), 1, 1*trQuestVarGet("oiwghogwhywhlocx"), xsVectorGetY(kbGetBlockPosition(""+1*%location%)), 1*trQuestVarGet("oiwghogwhywhlocz"), 0, true);</Command>
    <Command>trArmySelect("%SrcArmy%");</Command>
    <Command>trUnitConvert(trQuestVarGet("i"));</Command>
    <Command>}}</Command>
    <Command>trQuestVarSet("i", trQuestVarGet("i")+1);}</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("lastpl"));</Command>
    </Effect>

    <Effect name="pftq Copy/Convert in Area MP (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 Number or 99 for ALL" varType="string">99</Param>
    <Param name="SrcArmy" dispName="Army" varType="group">default</Param>
    <Param name="location" dispName="Target Unit" varType="unit">default</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>xsSetContextPlayer(0);</Command>
    <Command>kbLookAtAllUnitsOnMap();</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>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(trQuestVarGet("ffweho2")!=kbGetBlockID(""+1*%Object%)) {</Command>
    <Command>trUnitSelectClear();</Command>
    <Command>trUnitSelectByID(1*trQuestVarGet("ffweho"));</Command>
    <Command>trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(kbGetBlockPosition(""+1*%location%)));</Command>
    <Command>if(%position%==true) trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(kbGetBlockPosition(""+1*%location%))- (xsVectorGetX(kbGetBlockPosition(""+1*%Object%))-xsVectorGetX(kbUnitGetPosition(1*trQuestVarGet ("ffweho")))));</Command>
    <Command>trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(kbGetBlockPosition(""+1*%location%)));</Command>
    <Command>if(%position%==true) trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(kbGetBlockPosition(""+1*%location%))- (xsVectorGetZ(kbGetBlockPosition(""+1*%Object%))-xsVectorGetZ(kbUnitGetPosition(1*trQuestVarGet ("ffweho")))));</Command>
    <Command>trArmyDispatch("%SrcArmy%", ""+kbGetProtoUnitName(kbGetUnitBaseTypeID(1*trQuestVarGet("ffweho"))), 1, 1*trQuestVarGet("oiwghogwhywhlocx"), xsVectorGetY(kbGetBlockPosition(""+1*%location%)), 1*trQuestVarGet("oiwghogwhywhlocz"), 0, true);</Command>
    <Command>}}</Command>
    <Command>trQuestVarSet("i", trQuestVarGet("i")+1);}</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("lastpl"));</Command>
    </Effect>

    <Effect name="pftq ID Viewer">
    <Param name="wa" dispName="README: " varType="string">This lets you search for a UNIT TYPE ID by listing the range you specify. It will only do one of the three, so specify only one.</Param>
    <Param name="wa" dispName="SEARCH FEATURE: " varType="string">Use the Search field below to scan for an ID that MATCHES the Unit Type you enter.</Param>
    <Param name="wa" dispName="TARGET FEATURE: " varType="string">Use this to find the specific PROTOTYPE ID of the selected unit (or just go to your proto file).</Param>
    <Param name="min" dispName="Start Range" varType="string">0</Param>
    <Param name="max" dispName="End Range" varType="string">999</Param>
    <Param name="search" dispName="Search for Unit Type" varType="string"></Param>
    <Param name="target" dispName="ProtoID Of Target" varType="unit">-1</Param>
    <Command>if(%target%==-1) {</Command>
    <Command>if("%search%"=="") {</Command>
    <Command>trChatSend(0, "RANGE OF %min% TO %max%....");</Command>
    <Command>trQuestVarSet("fytpw", %min%);</Command>
    <Command>while(%max%>=trQuestVarGet("fytpw")) {</Command>
    <Command>trChatSend(0, (1*trQuestVarGet("fytpw"))+" - "+kbGetUnitTypeName(trQuestVarGet("fytpw")));</Command>
    <Command>trQuestVarSet("fytpw", trQuestVarGet("fytpw")+1);}}</Command>
    <Command>if("%search%"!="") {</Command>
    <Command>trChatSend(0, "SEARCHING FOR \"%search%\"...");</Command>
    <Command>trQuestVarSet("fytpw", 0);</Command>
    <Command>while(999>=trQuestVarGet("fytpw")) {</Command>
    <Command>if(kbGetUnitTypeName(trQuestVarGet("fytpw"))=="%search%") trChatSend(0, "Found! Your id is: "+(1*trQuestVarGet("fytpw")));</Command>
    <Command>trQuestVarSet("fytpw", trQuestVarGet("fytpw")+1);}}}</Command>
    <Command>if(%target%!=-1) {</Command>
    <Command>trChatSend(0, "ID of Targeted "+kbGetUnitTypeName(kbGetUnitBaseTypeID(kbGetBlockID(""+1*%target%)))+": "+kbGetUnitBaseTypeID(kbGetBlockID(""+1*%target%)));}</Command>
    </Effect>

    <Effect name="pftq Move to Self 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="Booler" dispName="Include Center Unit" 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>xsSetContextPlayer(0);</Command>
    <Command>kbLookAtAllUnitsOnMap();</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>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>trUnitMoveToPoint(xsVectorGetX(kbUnitGetPosition(1*trQuestVa rGet("ffweho"))),xsVectorGetY(kbUnitGetPosition(1*trQuestVarGet("ffweho"))),xsVectorGetZ(kbUnitGetPosition(1*trQuestVarGet("ffweho"))), -1, false);</Command>
    <Command>}}</Command>
    <Command>trQuestVarSet("i", trQuestVarGet("i")+1);}</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("lastpl"));</Command>
    </Effect>

    <Effect name="pftq Army Deploy Near Unit">
    <Param name="SrcArmy" dispName="Army" varType="group">default</Param>
    <Param name="ProtoName" dispName="ProtoName" varType="protounit">Villager</Param>
    <Param name="Object" dispName="Target Unit" varType="unit">default</Param>
    <Param name="radius" dispName="Approx. Radius (slightly off)" varType="string">10</Param>
    <Param name="edge" dispName="Edge Only" varType="bool">false</Param>
    <Param name="Count" dispName="Count" varType="string">0</Param>
    <Param name="Clear" dispName="Clear Existing Units:" varType="bool">true</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>xsSetContextPlayer(0);</Command>
    <Command>kbLookAtAllUnitsOnMap();</Command>
    <Command>trQuestVarSetFromRand("hwfeoaifop", 0, 1, true);</Command>
    <Command>trQuestVarSetFromRand("wagogehmeas", 0, %radius%, true);</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==0) trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(kbGetBlockPosition(""+1*%Object%))+trQuestVarGet("wagogehmeas"));</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==1) trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(kbGetBlockPosition(""+1*%Object%))-trQuestVarGet("wagogehmeas"));</Command>
    <Command>trQuestVarSet("hwfeoaifopx", 0);</Command>
    <Command>if(íge%==true) trQuestVarSet("hwfeoaifopx", (%radius%-trQuestVarGet("wagogehmeas")));</Command>
    <Command>trQuestVarSetFromRand("wagogehmeas", trQuestVarGet("hwfeoaifopx"), (%radius%-trQuestVarGet("wagogehmeas")), true);</Command>
    <Command>trQuestVarSetFromRand("hwfeoaifop", 0, 1, true);</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==0) trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(kbGetBlockPosition(""+1*%Object%))+trQuestVarGet("wagogehmeas"));</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==1) trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(kbGetBlockPosition(""+1*%Object%))-trQuestVarGet("wagogehmeas"));</Command>
    <Command>trArmyDispatch("%SrcArmy%", "%ProtoName%", %Count%, trQuestVarGet("oiwghogwhywhlocx"),xsVectorGetY(kbGetBlockPosition(""+1*%Object%)),trQuestVarGet("oiwghogwhywhlocz"), 0, %Clear%);</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq Unit Create Near Unit">
    <Param name="PlayerID" dispName="Player" varType="string">0</Param>
    <Param name="ProtoName" dispName="ProtoName" varType="protounit">Villager</Param>
    <Param name="ScenName" dispName="Name" varType="string">Default</Param>
    <Param name="Object" dispName="Target Unit" varType="unit">default</Param>
    <Param name="radius" dispName="Approx. Radius (slightly off)" varType="string">10</Param>
    <Param name="edge" dispName="Edge Only" varType="bool">false</Param>
    <Param name="Heading" dispName="Heading" varType="string">0</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>xsSetContextPlayer(0);</Command>
    <Command>kbLookAtAllUnitsOnMap();</Command>
    <Command>trQuestVarSetFromRand("hwfeoaifop", 0, 1, true);</Command>
    <Command>trQuestVarSetFromRand("wagogehmeas", 0, %radius%, true);</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==0) trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(kbGetBlockPosition(""+1*%Object%))+trQuestVarGet("wagogehmeas"));</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==1) trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(kbGetBlockPosition(""+1*%Object%))-trQuestVarGet("wagogehmeas"));</Command>
    <Command>trQuestVarSet("hwfeoaifopx", 0);</Command>
    <Command>if(íge%==true) trQuestVarSet("hwfeoaifopx", (%radius%-trQuestVarGet("wagogehmeas")));</Command>
    <Command>trQuestVarSetFromRand("wagogehmeas", trQuestVarGet("hwfeoaifopx"), (%radius%-trQuestVarGet("wagogehmeas")), true);</Command>
    <Command>trQuestVarSetFromRand("hwfeoaifop", 0, 1, true);</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==0) trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(kbGetBlockPosition(""+1*%Object%))+trQuestVarGet("wagogehmeas"));</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==1) trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(kbGetBlockPosition(""+1*%Object%))-trQuestVarGet("wagogehmeas"));</Command>
    <Command>trUnitCreate("%ProtoName%", "%ScenName%", trQuestVarGet("oiwghogwhywhlocx"),xsVectorGetY(kbGetBlockPosition(""+1*%Object%)),trQuestVarGet("oiwghogwhywhlocz"), %Heading%, %PlayerID%);</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq Army Teleport Near Unit">
    <Param name="SrcArmy" dispName="Army" varType="group">default</Param>
    <Param name="Object" dispName="Target Unit" varType="unit">default</Param>
    <Param name="radius" dispName="Approx. Radius (slightly off)" varType="string">10</Param>
    <Param name="edge" dispName="Edge Only" varType="bool">false</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>xsSetContextPlayer(0);</Command>
    <Command>kbLookAtAllUnitsOnMap();</Command>
    <Command>trArmySelect("%SrcArmy%");</Command>
    <Command>trQuestVarSetFromRand("hwfeoaifop", 0, 1, true);</Command>
    <Command>trQuestVarSetFromRand("wagogehmeas", 0, %radius%, true);</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==0) trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(kbGetBlockPosition(""+1*%Object%))+trQuestVarGet("wagogehmeas"));</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==1) trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(kbGetBlockPosition(""+1*%Object%))-trQuestVarGet("wagogehmeas"));</Command>
    <Command>trQuestVarSet("hwfeoaifopx", 0);</Command>
    <Command>if(íge%==true) trQuestVarSet("hwfeoaifopx", (%radius%-trQuestVarGet("wagogehmeas")));</Command>
    <Command>trQuestVarSetFromRand("wagogehmeas", trQuestVarGet("hwfeoaifopx"), (%radius%-trQuestVarGet("wagogehmeas")), true);</Command>
    <Command>trQuestVarSetFromRand("hwfeoaifop", 0, 1, true);</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==0) trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(kbGetBlockPosition(""+1*%Object%))+trQuestVarGet("wagogehmeas"));</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==1) trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(kbGetBlockPosition(""+1*%Object%))-trQuestVarGet("wagogehmeas"));</Command>
    <Command>trUnitTeleport(trQuestVarGet("oiwghogwhywhlocx"), xsVectorGetY(kbGetBlockPosition(""+1*%Object%)), trQuestVarGet("oiwghogwhywhlocz"));</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq Army Build Building Near Unit">
    <Param name="SrcArmy" dispName="Army" varType="group">default</Param>
    <Param name="ProtoUnit" dispName="ProtoUnit To Build" varType="protounit">default</Param>
    <Param name="Object" dispName="Target Unit" varType="unit">default</Param>
    <Param name="radius" dispName="Approx. Radius (slightly off)" varType="string">10</Param>
    <Param name="edge" dispName="Edge Only" varType="bool">false</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>xsSetContextPlayer(0);</Command>
    <Command>kbLookAtAllUnitsOnMap();</Command>
    <Command>trArmySelect("%SrcArmy%");</Command>
    <Command>trQuestVarSetFromRand("hwfeoaifop", 0, 1, true);</Command>
    <Command>trQuestVarSetFromRand("wagogehmeas", 0, %radius%, true);</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==0) trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(kbGetBlockPosition(""+1*%Object%))+trQuestVarGet("wagogehmeas"));</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==1) trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(kbGetBlockPosition(""+1*%Object%))-trQuestVarGet("wagogehmeas"));</Command>
    <Command>trQuestVarSet("hwfeoaifopx", 0);</Command>
    <Command>if(íge%==true) trQuestVarSet("hwfeoaifopx", (%radius%-trQuestVarGet("wagogehmeas")));</Command>
    <Command>trQuestVarSetFromRand("wagogehmeas", trQuestVarGet("hwfeoaifopx"), (%radius%-trQuestVarGet("wagogehmeas")), true);</Command>
    <Command>trQuestVarSetFromRand("hwfeoaifop", 0, 1, true);</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==0) trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(kbGetBlockPosition(""+1*%Object%))+trQuestVarGet("wagogehmeas"));</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==1) trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(kbGetBlockPosition(""+1*%Object%))-trQuestVarGet("wagogehmeas"));</Command>
    <Command>trUnitBuildUnit("%ProtoUnit%", xsVectorSet(trQuestVarGet("oiwghogwhywhlocx"), xsVectorGetY(kbGetBlockPosition(""+1*%Object%)), trQuestVarGet("oiwghogwhywhlocz")));</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq Unit Build Building Near Unit">
    <Param name="SrcObject" dispName="Source Units" varType="unit">default</Param>
    <Param name="ProtoUnit" dispName="ProtoUnit To Build" varType="protounit">default</Param>
    <Param name="Object" dispName="Target Unit" varType="unit">default</Param>
    <Param name="radius" dispName="Approx. Radius (slightly off)" varType="string">10</Param>
    <Param name="edge" dispName="Edge Only" varType="bool">false</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>xsSetContextPlayer(0);</Command>
    <Command>kbLookAtAllUnitsOnMap();</Command>
    <Command>trUnitSelectClear();</Command>
    <Command loop="" loopParm="SrcObject">trUnitSelect("%SrcObject%");</Command>
    <Command>trQuestVarSetFromRand("hwfeoaifop", 0, 1, true);</Command>
    <Command>trQuestVarSetFromRand("wagogehmeas", 0, %radius%, true);</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==0) trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(kbGetBlockPosition(""+1*%Object%))+trQuestVarGet("wagogehmeas"));</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==1) trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(kbGetBlockPosition(""+1*%Object%))-trQuestVarGet("wagogehmeas"));</Command>
    <Command>trQuestVarSet("hwfeoaifopx", 0);</Command>
    <Command>if(íge%==true) trQuestVarSet("hwfeoaifopx", (%radius%-trQuestVarGet("wagogehmeas")));</Command>
    <Command>trQuestVarSetFromRand("wagogehmeas", trQuestVarGet("hwfeoaifopx"), (%radius%-trQuestVarGet("wagogehmeas")), true);</Command>
    <Command>trQuestVarSetFromRand("hwfeoaifop", 0, 1, true);</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==0) trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(kbGetBlockPosition(""+1*%Object%))+trQuestVarGet("wagogehmeas"));</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==1) trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(kbGetBlockPosition(""+1*%Object%))-trQuestVarGet("wagogehmeas"));</Command>
    <Command>trUnitBuildUnit("%ProtoUnit%", xsVectorSet(trQuestVarGet("oiwghogwhywhlocx"), xsVectorGetY(kbGetBlockPosition(""+1*%Object%)), trQuestVarGet("oiwghogwhywhlocz")));</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq Move From Area To Near Unit">
    <Param name="RefObject" dispName="Center Unit" varType="unit">default</Param>
    <Param name="UnitType" dispName="Type" varType="string">Unit</Param>
    <Param name="PlayerID" dispName="Player" varType="string">0</Param>
    <Param name="Radius" dispName="Radius" varType="string">10</Param>
    <Param name="Object" dispName="Target Unit" varType="unit">default</Param>
    <Param name="radius" dispName="Approx. Radius (slightly off)" varType="string">10</Param>
    <Param name="edge" dispName="Edge Only" varType="bool">false</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>xsSetContextPlayer(0);</Command>
    <Command>kbLookAtAllUnitsOnMap();</Command>
    <Command>trUnitSelectClear();</Command>
    <Command loop="" loopParm="RefObject">trUnitSelect("%RefObject%");</Command>
    <Command>trQuestVarSetFromRand("hwfeoaifop", 0, 1, true);</Command>
    <Command>trQuestVarSetFromRand("wagogehmeas", 0, %radius%, true);</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==0) trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(kbGetBlockPosition(""+1*%Object%))+trQuestVarGet("wagogehmeas"));</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==1) trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(kbGetBlockPosition(""+1*%Object%))-trQuestVarGet("wagogehmeas"));</Command>
    <Command>trQuestVarSet("hwfeoaifopx", 0);</Command>
    <Command>if(íge%==true) trQuestVarSet("hwfeoaifopx", (%radius%-trQuestVarGet("wagogehmeas")));</Command>
    <Command>trQuestVarSetFromRand("wagogehmeas", trQuestVarGet("hwfeoaifopx"), (%radius%-trQuestVarGet("wagogehmeas")), true);</Command>
    <Command>trQuestVarSetFromRand("hwfeoaifop", 0, 1, true);</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==0) trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(kbGetBlockPosition(""+1*%Object%))+trQuestVarGet("wagogehmeas"));</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==1) trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(kbGetBlockPosition(""+1*%Object%))-trQuestVarGet("wagogehmeas"));</Command>
    <Command>trUnitMoveFromArea(trQuestVarGet("oiwghogwhywhlocx"), xsVectorGetY(kbGetBlockPosition(""+1*%Object%)), trQuestVarGet("oiwghogwhywhlocz"), -1, false, %PlayerID%, "%UnitType%", %Radius%);</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq Teleport Units to Near Unit">
    <Param name="SrcObject" dispName="Source Units" varType="unit">default</Param>
    <Param name="Object" dispName="Target Unit" varType="unit">default</Param>
    <Param name="radius" dispName="Approx. Radius (slightly off)" varType="string">10</Param>
    <Param name="edge" dispName="Edge Only" varType="bool">false</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>xsSetContextPlayer(0);</Command>
    <Command>kbLookAtAllUnitsOnMap();</Command>
    <Command>trUnitSelectClear();</Command>
    <Command loop="" loopParm="SrcObject">trUnitSelect("%SrcObject%");</Command>
    <Command>trQuestVarSetFromRand("hwfeoaifop", 0, 1, true);</Command>
    <Command>trQuestVarSetFromRand("wagogehmeas", 0, %radius%, true);</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==0) trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(kbGetBlockPosition(""+1*%Object%))+trQuestVarGet("wagogehmeas"));</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==1) trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(kbGetBlockPosition(""+1*%Object%))-trQuestVarGet("wagogehmeas"));</Command>
    <Command>trQuestVarSet("hwfeoaifopx", 0);</Command>
    <Command>if(íge%==true) trQuestVarSet("hwfeoaifopx", (%radius%-trQuestVarGet("wagogehmeas")));</Command>
    <Command>trQuestVarSetFromRand("wagogehmeas", trQuestVarGet("hwfeoaifopx"), (%radius%-trQuestVarGet("wagogehmeas")), true);</Command>
    <Command>trQuestVarSetFromRand("hwfeoaifop", 0, 1, true);</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==0) trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(kbGetBlockPosition(""+1*%Object%))+trQuestVarGet("wagogehmeas"));</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==1) trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(kbGetBlockPosition(""+1*%Object%))-trQuestVarGet("wagogehmeas"));</Command>
    <Command>trUnitTeleport(trQuestVarGet("oiwghogwhywhlocx"), xsVectorGetY(kbGetBlockPosition(""+1*%Object%)), trQuestVarGet("oiwghogwhywhlocz"));</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq Move Near Unit">
    <Param name="SrcObject" dispName="Source Units" varType="unit">default</Param>
    <Param name="Object" dispName="Target Unit" varType="unit">default</Param>
    <Param name="radius" dispName="Approx. Radius (slightly off)" varType="string">10</Param>
    <Param name="edge" dispName="Edge Only" varType="bool">false</Param>
    <Param name="EventID" dispName="Trigger" varType="event">-1</Param>
    <Param name="AttackMove" dispName="Attack Move" varType="bool">false</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>xsSetContextPlayer(0);</Command>
    <Command>kbLookAtAllUnitsOnMap();</Command>
    <Command>trQuestVarSetFromRand("hwfeoaifop", 0, 1, true);</Command>
    <Command>trQuestVarSetFromRand("wagogehmeas", 0, %radius%, true);</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==0) trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(kbGetBlockPosition(""+1*%Object%))+trQuestVarGet("wagogehmeas"));</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==1) trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(kbGetBlockPosition(""+1*%Object%))-trQuestVarGet("wagogehmeas"));</Command>
    <Command>trQuestVarSet("hwfeoaifopx", 0);</Command>
    <Command>if(íge%==true) trQuestVarSet("hwfeoaifopx", (%radius%-trQuestVarGet("wagogehmeas")));</Command>
    <Command>trQuestVarSetFromRand("wagogehmeas", trQuestVarGet("hwfeoaifopx"), (%radius%-trQuestVarGet("wagogehmeas")), true);</Command>
    <Command>trQuestVarSetFromRand("hwfeoaifop", 0, 1, true);</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==0) trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(kbGetBlockPosition(""+1*%Object%))+trQuestVarGet("wagogehmeas"));</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==1) trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(kbGetBlockPosition(""+1*%Object%))-trQuestVarGet("wagogehmeas"));</Command>
    <Command>trUnitSelectClear();</Command>
    <Command loop="" loopParm="SrcObject">trUnitSelect("%SrcObject%");</Command>
    <Command>trUnitMoveToPoint(trQuestVarGet("oiwghogwhywhlocx"), xsVectorGetY(kbGetBlockPosition(""+1*%Object%)), trQuestVarGet("oiwghogwhywhlocz"), %EventID%, %AttackMove%);</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq Army Move Near Unit">
    <Param name="SrcArmy" dispName="Army" varType="group">default</Param>
    <Param name="Object" dispName="Target Unit" varType="unit">default</Param>
    <Param name="radius" dispName="Approx. Radius (slightly off)" varType="string">10</Param>
    <Param name="edge" dispName="Edge Only" varType="bool">false</Param>
    <Param name="EventID" dispName="Trigger" varType="event">-1</Param>
    <Param name="AttackMove" dispName="Attack Move" varType="bool">false</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>xsSetContextPlayer(0);</Command>
    <Command>kbLookAtAllUnitsOnMap();</Command>
    <Command>trQuestVarSetFromRand("hwfeoaifop", 0, 1, true);</Command>
    <Command>trQuestVarSetFromRand("wagogehmeas", 0, %radius%, true);</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==0) trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(kbGetBlockPosition(""+1*%Object%))+trQuestVarGet("wagogehmeas"));</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==1) trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(kbGetBlockPosition(""+1*%Object%))-trQuestVarGet("wagogehmeas"));</Command>
    <Command>trQuestVarSet("hwfeoaifopx", 0);</Command>
    <Command>if(íge%==true) trQuestVarSet("hwfeoaifopx", (%radius%-trQuestVarGet("wagogehmeas")));</Command>
    <Command>trQuestVarSetFromRand("wagogehmeas", trQuestVarGet("hwfeoaifopx"), (%radius%-trQuestVarGet("wagogehmeas")), true);</Command>
    <Command>trQuestVarSetFromRand("hwfeoaifop", 0, 1, true);</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==0) trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(kbGetBlockPosition(""+1*%Object%))+trQuestVarGet("wagogehmeas"));</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==1) trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(kbGetBlockPosition(""+1*%Object%))-trQuestVarGet("wagogehmeas"));</Command>
    <Command>trArmySelect("%SrcArmy%");</Command>
    <Command>trUnitMoveToPoint(trQuestVarGet("oiwghogwhywhlocx"), xsVectorGetY(kbGetBlockPosition(""+1*%Object%)), trQuestVarGet("oiwghogwhywhlocz"), %EventID%, %AttackMove%);</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name = "QV 1- Start Highest or Lowest">
    <Param name = "blah" dispName="IMPORTANT:" varType="string">Have this effect ONCE in the trigger BEFORE using any of "QV Save Highest or Lowest" effects.</Param>
    <Command>string QVerHighLow="";</Command>
    </Effect>

    <Effect name = "QV 2- Save Highest or Lowest">
    <Param name = "blah" dispName="IMPORTANT:" varType="string">The NAME of the QV with the highest or lowest value is saved to QVerHighLow (in same trigger only). Enter "+QVerHighLow+" in place of the QV name when you want to get the name of the QV with that value. Be sure to have the "QV Start Highest or Lowest" ONCE in the trigger BEFORE using this any number of times. Measure unlimited QVs in the same trigger by inserting more conditions without enabling the reset box (make sure to check the same QV in "QV to Check"). Enable RESET to start a new check. Note that there may be multiple QVs with highest or lowest value, in which the last QV will be used.</Param>
    <Param name = "QVName1" dispName = "QV Name 1" varType ="string">QV1</Param>
    <Param name = "QVName2" dispName = "QV Name 2" varType ="string">QV2</Param>
    <Param name = "QVName3" dispName = "QV Name 3" varType ="string">QV3</Param>
    <Param name = "QVName4" dispName = "QV Name 4" varType ="string">QV4</Param>
    <Param name = "booler" dispName = "Checked Var is (higher or lower)" varType="operator">></Param>
    <Param name = "reset" dispName = "Reset" varType="bool">true</Param>
    <Command>if(%reset%==true) trQuestVarSet("QVHighestLowestThing2", 0);</Command>
    <Command>trQuestVarSet("QVHighestLowestThing2blarar", 0);</Command>
    <Command>while(2>trQuestVarGet("QVHighestLowestThing2blarar")) {</Command>
    <Command>trQuestVarSet("QVHighestLowestThing2blarar", trQuestVarGet("QVHighestLowestThing2blarar")+1);</Command>
    <Command>if(trQuestVarGet("%QVName1%") %booler% trQuestVarGet("QVHighestLowestThing2")) { trQuestVarSet("QVHighestLowestThing2", trQuestVarGet("%QVName1%")); QVerHighLow="%QVName1%";}</Command>
    <Command>if(trQuestVarGet("%QVName2%") %booler% trQuestVarGet("QVHighestLowestThing2")) { trQuestVarSet("QVHighestLowestThing2", trQuestVarGet("%QVName2%")); QVerHighLow="%QVName2%";}</Command>
    <Command>if(trQuestVarGet("%QVName3%") %booler% trQuestVarGet("QVHighestLowestThing2")) { trQuestVarSet("QVHighestLowestThing2", trQuestVarGet("%QVName3%")); QVerHighLow="%QVName3%";}</Command>
    <Command>if(trQuestVarGet("%QVName4%") %booler% trQuestVarGet("QVHighestLowestThing2")) { trQuestVarSet("QVHighestLowestThing2", trQuestVarGet("%QVName4%")); QVerHighLow="%QVName4%";}}</Command>
    </Effect>

    <Effect name="pftq Scatter - Random in Area (Center Unit)">
    <Param name="Object" dispName="Center Unit" varType="unit">default</Param>
    <Param name="Dst" dispName="Center Unit Radius" varType="string">10.0</Param>
    <Param name="UnitId" dispName="Unit Type ID (Optional)" varType="string">-1</Param>
    <Param name="FromPlayer" dispName="From Player Number or 99 for ALL" varType="string">99</Param>
    <Param name="radius" dispName="Scatter Radius" varType="string">10</Param>
    <Param name="edge" dispName="Edge Only" varType="bool">false</Param>
    <Param name="attack" dispName="Attack Move" 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>xsSetContextPlayer(0);</Command>
    <Command>kbLookAtAllUnitsOnMap();</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>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(trQuestVarGet("ffweho2")!=kbGetBlockID(""+1*%Object%)) {</Command>
    <Command>trUnitSelectClear();</Command>
    <Command>trUnitSelectByID(1*trQuestVarGet("ffweho"));</Command>
    <Command>trQuestVarSetFromRand("hwfeoaifop", 0, 1, true);</Command>
    <Command>trQuestVarSetFromRand("wagogehmeas", 0, %radius%, true);</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==0) trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(kbGetBlockPosition(""+1*%Object%))+trQuestVarGet("wagogehmeas"));</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==1) trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(kbGetBlockPosition(""+1*%Object%))-trQuestVarGet("wagogehmeas"));</Command>
    <Command>trQuestVarSet("hwfeoaifopx", 0);</Command>
    <Command>if(íge%==true) trQuestVarSet("hwfeoaifopx", (%radius%-trQuestVarGet("wagogehmeas")));</Command>
    <Command>trQuestVarSetFromRand("wagogehmeas", trQuestVarGet("hwfeoaifopx"), (%radius%-trQuestVarGet("wagogehmeas")), true);</Command>
    <Command>trQuestVarSetFromRand("hwfeoaifop", 0, 1, true);</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==0) trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(kbGetBlockPosition(""+1*%Object%))+trQuestVarGet("wagogehmeas"));</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==1) trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(kbGetBlockPosition(""+1*%Object%))-trQuestVarGet("wagogehmeas"));</Command>
    <Command>trUnitMoveToPoint(trQuestVarGet("oiwghogwhywhlocx"), xsVectorGetY(kbGetBlockPosition(""+1*%Object%)), trQuestVarGet("oiwghogwhywhlocz"), -1, %attack%);</Command>
    <Command>}}</Command>
    <Command>trQuestVarSet("i", trQuestVarGet("i")+1);}</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("lastpl"));</Command>
    </Effect>

    <Effect name="pftq Scatter - From Orignal Location (Center Unit)">
    <Param name="Object" dispName="Center Unit" varType="unit">default</Param>
    <Param name="Dst" dispName="Center Unit Radius" varType="string">10.0</Param>
    <Param name="UnitId" dispName="Unit Type ID (Optional)" varType="string">-1</Param>
    <Param name="FromPlayer" dispName="From Player Number or 99 for ALL" varType="string">99</Param>
    <Param name="radius" dispName="Scatter Radius" varType="string">10</Param>
    <Param name="edge" dispName="Edge Only" varType="bool">false</Param>
    <Param name="attack" dispName="Attack Move" 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>xsSetContextPlayer(0);</Command>
    <Command>kbLookAtAllUnitsOnMap();</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>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(trQuestVarGet("ffweho2")!=kbGetBlockID(""+1*%Object%)) {</Command>
    <Command>trUnitSelectClear();</Command>
    <Command>trUnitSelectByID(1*trQuestVarGet("ffweho"));</Command>
    <Command>trQuestVarSetFromRand("hwfeoaifop", 0, 1, true);</Command>
    <Command>trQuestVarSetFromRand("wagogehmeas", 0, %radius%, true);</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==0) trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(kbUnitGetPosition(1*trQuestVarGet("ffweho")))+trQuestVarGet("wagogehmeas"));</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==1) trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(kbUnitGetPosition(1*trQuestVarGet("ffweho")))-trQuestVarGet("wagogehmeas"));</Command>
    <Command>trQuestVarSet("hwfeoaifopx", 0);</Command>
    <Command>if(íge%==true) trQuestVarSet("hwfeoaifopx", (%radius%-trQuestVarGet("wagogehmeas")));</Command>
    <Command>trQuestVarSetFromRand("wagogehmeas", trQuestVarGet("hwfeoaifopx"), (%radius%-trQuestVarGet("wagogehmeas")), true);</Command>
    <Command>trQuestVarSetFromRand("hwfeoaifop", 0, 1, true);</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==0) trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(kbUnitGetPosition(1*trQuestVarGet("ffweho")))+trQuestVarGet("wagogehmeas"));</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==1) trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(kbUnitGetPosition(1*trQuestVarGet("ffweho")))-trQuestVarGet("wagogehmeas"));</Command>
    <Command>trUnitMoveToPoint(trQuestVarGet("oiwghogwhywhlocx"), xsVectorGetY(kbUnitGetPosition(1*trQuestVarGet("ffweho"))), trQuestVarGet("oiwghogwhywhlocz"), -1, %attack%);</Command>
    <Command>}}</Command>
    <Command>trQuestVarSet("i", trQuestVarGet("i")+1);}</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("lastpl"));</Command>
    </Effect>

    <Effect name="pftq 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>

    <Effect name="pftq Army Deploy to Unit">
    <Param name="SrcArmy" dispName="Army" varType="group">default</Param>
    <Param name="ProtoName" dispName="ProtoName" varType="protounit">Villager</Param>
    <Param name="Object" dispName="Target Unit" varType="unit">default</Param>
    <Param name="Count" dispName="Count" varType="string">0</Param>
    <Param name="Heading" dispName="Heading" varType="string">0</Param>
    <Param name="Clear" dispName="Clear Existing Units:" varType="bool">true</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>xsSetContextPlayer(0);</Command>
    <Command>kbLookAtAllUnitsOnMap();</Command>
    <Command>trArmyDispatch("%SrcArmy%", "%ProtoName%", %Count%, xsVectorGetX(kbGetBlockPosition(""+1*%Object%)),xsVectorGetY(kbGetBlockPosition(""+1*%Object%)),xsVectorGetZ(kbGetBlockPosition(""+1*%Object%)), %Heading%, %Clear%);</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq Unit Create At Unit">
    <Param name="PlayerID" dispName="Player" varType="string">0</Param>
    <Param name="ProtoName" dispName="ProtoName" varType="protounit">Villager</Param>
    <Param name="ScenName" dispName="Name" varType="string">Default</Param>
    <Param name="Object" dispName="Target Unit" varType="unit">default</Param>
    <Param name="Heading" dispName="Heading" varType="string">0</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>xsSetContextPlayer(0);</Command>
    <Command>kbLookAtAllUnitsOnMap();</Command>
    <Command>trUnitCreate("%ProtoName%", "%ScenName%", xsVectorGetX(kbGetBlockPosition(""+1*%Object%)),xsVectorGetY(kbGetBlockPosition(""+1*%Object%)),xsVectorGetZ(kbGetBlockPosition(""+1*%Object%)), %Heading%, %PlayerID%);</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq Army Teleport To Unit">
    <Param name="SrcArmy" dispName="Army" varType="group">default</Param>
    <Param name="Object" dispName="Target Unit" varType="unit">default</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>xsSetContextPlayer(0);</Command>
    <Command>kbLookAtAllUnitsOnMap();</Command>
    <Command>trArmySelect("%SrcArmy%");</Command>
    <Command>trUnitTeleport(xsVectorGetX(kbGetBlockPosition(""+1*%Object%)),xsVectorGetY(kbGetBlockPosition(""+1*%Object%)),xsVectorGetZ(kbGetBlockPosition(""+1*%Object%)));</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq Army Build Building At Unit">
    <Param name="SrcArmy" dispName="Army" varType="group">default</Param>
    <Param name="ProtoUnit" dispName="ProtoUnit To Build" varType="protounit">default</Param>
    <Param name="Object" dispName="Target Unit" varType="unit">default</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>xsSetContextPlayer(0);</Command>
    <Command>kbLookAtAllUnitsOnMap();</Command>
    <Command>trArmySelect("%SrcArmy%");</Command>
    <Command>trUnitBuildUnit("%ProtoUnit%", kbGetBlockPosition(""+1*%Object%));</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq Unit Build Building At Unit">
    <Param name="SrcObject" dispName="Source Units" varType="unit">default</Param>
    <Param name="ProtoUnit" dispName="ProtoUnit To Build" varType="protounit">default</Param>
    <Param name="Object" dispName="Target Unit" varType="unit">default</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>xsSetContextPlayer(0);</Command>
    <Command>kbLookAtAllUnitsOnMap();</Command>
    <Command>trUnitSelectClear();</Command>
    <Command loop="" loopParm="SrcObject">trUnitSelect("%SrcObject%");</Command>
    <Command>trUnitBuildUnit("%ProtoUnit%", kbGetBlockPosition(""+1*%Object%));</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq Move From Area To Unit">
    <Param name="RefObject" dispName="Center Unit" varType="unit">default</Param>
    <Param name="UnitType" dispName="Type" varType="string">Unit</Param>
    <Param name="PlayerID" dispName="Player" varType="string">0</Param>
    <Param name="Radius" dispName="Radius" varType="string">10</Param>
    <Param name="Object" dispName="Target Unit" varType="unit">default</Param>
    <Param name="AttackMove" dispName="Attack Move" varType="bool">false</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>xsSetContextPlayer(0);</Command>
    <Command>kbLookAtAllUnitsOnMap();</Command>
    <Command>trUnitSelectClear();</Command>
    <Command loop="" loopParm="RefObject">trUnitSelect("%RefObject%");</Command>
    <Command>trUnitMoveFromArea(xsVectorGetX(kbGetBlockPosition(""+1*%Object%)), xsVectorGetY(kbGetBlockPosition(""+1*%Object%)), xsVectorGetZ(kbGetBlockPosition(""+1*%Object%)), -1, %AttackMove%, %PlayerID%, "%UnitType%", %Radius%);</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq Teleport Units to Unit">
    <Param name="SrcObject" dispName="Source Units" varType="unit">default</Param>
    <Param name="Object" dispName="Target Unit" varType="unit">default</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>xsSetContextPlayer(0);</Command>
    <Command>kbLookAtAllUnitsOnMap();</Command>
    <Command>trUnitSelectClear();</Command>
    <Command loop="" loopParm="SrcObject">trUnitSelect("%SrcObject%");</Command>
    <Command>trUnitTeleport(xsVectorGetX(kbGetBlockPosition(""+1*%Object%)), xsVectorGetY(kbGetBlockPosition(""+1*%Object%)), xsVectorGetZ(kbGetBlockPosition(""+1*%Object%)));</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq Teleport Units in Area (Center Unit) To 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="Objecto" dispName="Target Unit" varType="unit">default</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("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>xsSetContextPlayer(0);</Command>
    <Command>kbLookAtAllUnitsOnMap();</Command>
    <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>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(kbGetBlockPosition(""+1*%Objecto%)));</Command>
    <Command>if(%position%==true) trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(kbGetBlockPosition(""+1*%Objecto%))- (xsVectorGetX(kbGetBlockPosition(""+1*%Object%))-xsVectorGetX(kbUnitGetPosition(1*trQuestVarGet ("ffweho")))));</Command>
    <Command>trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(kbGetBlockPosition(""+1*%Objecto%)));</Command>
    <Command>if(%position%==true) trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(kbGetBlockPosition(""+1*%Objecto%))- (xsVectorGetZ(kbGetBlockPosition(""+1*%Object%))-xsVectorGetZ(kbUnitGetPosition(1*trQuestVarGet ("ffweho")))));</Command>
    <Command>trUnitTeleport(1*trQuestVarGet("oiwghogwhywhlocx"), xsVectorGetY(kbGetBlockPosition(""+1*%Objecto%)), 1*trQuestVarGet("oiwghogwhywhlocz"));</Command>
    <Command>}}</Command>
    <Command>trQuestVarSet("i", trQuestVarGet("i")+1);}</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq QV Set Distance to Unit">
    <Param name="SrcObject" dispName="Source Units" VarType="unit">default</Param>
    <Param name="DstObject" dispName="Target Unit" VarType="unit">default</Param>
    <Param name="QV" dispName="QV" VarType="string">QV1</Param>
    <Command>trUnitSelectClear();</Command>
    <Command loop="" loopParm="SrcObject">trUnitSelect("%SrcObject%");</Command>
    <Command>trQuestVarSet("%QV%", trUnitDistanceToUnit("%DstObject%"));</Command>
    </Effect>

    <Effect name="pftq QV Set Units in Area (Center Unit)">
    <Param name="Object" dispName="Center Unit" varType="unit">default</Param>
    <Param name="FromPlayer" dispName="Player (99 for ALL)" varType="string">99</Param>
    <Param name="UnitId" dispName="Unit Type ID (Optional)" varType="string">-1</Param>
    <Param name="unitstate" dispName="State ID (2=Alive, 255=Any, 4=Dead...)" varType="string">2</Param>
    <Param name="actionid" dispName="Action ID (Optional)" varType="string">-1</Param>
    <Param name="Dst" dispName="Radius" varType="string">10</Param>
    <Param name="QVName" dispName="QV" varType="string">QV1</Param>
    <Command>trQuestVarSet("convarea", 0);</Command>
    <Command>trQuestVarSet("ffweho",0);</Command>
    <Command>if(%FromPlayer%!=99) trQuestVarSet("vroom", %FromPlayer%);</Command>
    <Command>trQuestVarSet("%QVName%", 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>kbUnitQuerySetState(trQuestVarGet("convarea"), 1*%unitstate%);</Command>
    <Command>if(¬tionid%!=-1) kbUnitQuerySetActionType(trQuestVarGet("convarea"), 1*¬tionid%);</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("%QVName%", trQuestVarGet("%QVName%")+kbUnitQueryExecute(trQuestVarGet("convarea")));</Command>
    <Command>trQuestVarSet("i", trQuestVarGet("i")+1);}</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("lastpl"));</Command>
    </Effect>

    <Effect name="pftq QV Set Unit OBJECT ID in Area (Center Unit)">
    <Param name="QVName" dispName="QV" varType="string">QV1</Param>
    <Param name="index" dispName="Index (first unit is 0)" varType="string">0</Param>
    <Param name="Object" dispName="Center Unit" varType="unit">default</Param>
    <Param name="FromPlayer" dispName="Player (99 for ALL)" varType="string">99</Param>
    <Param name="UnitId" dispName="Unit Type ID (Optional)" varType="string">-1</Param>
    <Param name="actionid" dispName="Action ID (Optional)" varType="string">-1</Param>
    <Param name="Dst" dispName="Radius (-1 for ALL)" varType="string">10</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>kbUnitQuerySetState(trQuestVarGet("convarea"), 2);</Command>
    <Command>if(¬tionid%!=-1) kbUnitQuerySetActionType(trQuestVarGet("convarea"), 1*¬tionid%);</Command>
    <Command>if(%Dst%!=-1) {</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>if(trQuestVarGet("warthog")>0) {</Command>
    <Command>trQuestVarSet("%QVName%", kbUnitQueryGetResult(trQuestVarGet("convarea"), %index%));</Command>
    <Command>}</Command>
    <Command>trQuestVarSet("i", trQuestVarGet("i")+1);}</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("lastpl"));</Command>
    </Effect>

    <Effect name="pftq QV Set Army Unit OBJECT ID">
    <Param name="SrcArmy" dispName="Army Name" varType="group">default</Param>
    <Param name="Index" dispName="Unit Index (0 is first unit)" varType="string">0</Param>
    <Param name="QVName" dispName="QV to Record" varType="string">QV1</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>xsSetContextPlayer(xsVectorGetX(vector(%SrcArmy%,0)));</Command>
    <Command>trQuestVarSet("%QVName%", kbUnitNameID(kbArmyGetUnitID(xsVectorGetY(vector(%SrcArmy%,0)), %Index%)));</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq QV Set Army Num. Units">
    <Param name="SrcArmy" dispName="Army Name" varType="group">default</Param>
    <Param name="QVName" dispName="QV to Record" varType="string">QV1</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>xsSetContextPlayer(xsVectorGetX(vector(%SrcArmy%,0)));</Command>
    <Command>trQuestVarSet("%QVName%", kbArmyGetNumberUnits(xsVectorGetY(vector(%SrcArmy%,0))));</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq QV Set Army Current HP">
    <Param name="SrcArmy" dispName="Army Name" varType="group">default</Param>
    <Param name="QVName" dispName="QV to Record" varType="string">QV1</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>xsSetContextPlayer(xsVectorGetX(vector(%SrcArmy%,0)));</Command>
    <Command>trQuestVarSet("%QVName%", kbArmyGetCurrentHitpoints(xsVectorGetY(vector(%SrcArmy%,0))));</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq QV Set Army Max HP">
    <Param name="SrcArmy" dispName="Army Name" varType="group">default</Param>
    <Param name="QVName" dispName="QV to Record" varType="string">QV1</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>xsSetContextPlayer(xsVectorGetX(vector(%SrcArmy%,0)));</Command>
    <Command>trQuestVarSet("%QVName%", kbArmyGetMaximumHitpoints(xsVectorGetY(vector(%SrcArmy%,0))));</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq QV Set Army Health (Percent HP)">
    <Param name="SrcArmy" dispName="Army Name" varType="group">default</Param>
    <Param name="QVName" dispName="QV to Record" varType="string">QV1</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>xsSetContextPlayer(xsVectorGetX(vector(%SrcArmy%,0)));</Command>
    <Command>trQuestVarSet("%QVName%", kbArmyGetHealth(xsVectorGetY(vector(%SrcArmy%,0))));</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq QV Set Army Num. Units with Min. Health">
    <Param name="SrcArmy" dispName="Army Name" varType="group">default</Param>
    <Param name="MinHP" dispName="Min. Percent HP (Decimal) of Units" varType="string">0.50</Param>
    <Param name="QVName" dispName="QV to Record" varType="string">QV1</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>xsSetContextPlayer(xsVectorGetX(vector(%SrcArmy%,0)));</Command>
    <Command>trQuestVarSet("%QVName%", kbArmyGetNumberWithHealth(xsVectorGetY(vector(%SrcArmy%,0)), %MinHP%));</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq Army - Add/Remove Unit">
    <Param name="SrcArmy" dispName="Army Name" varType="group">default</Param>
    <Param name="UnitID" dispName="Unit" varType="unit">default</Param>
    <Param name="choice" dispName="ADD or REMOVE" varType="string">ADD</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>xsSetContextPlayer(xsVectorGetX(vector(%SrcArmy%,0)));</Command>
    <Command>if("%choice%"=="ADD") kbArmyAddUnit(xsVectorGetY(vector(%SrcArmy%,0)), kbGetBlockID(""+1*%UnitID%));</Command>
    <Command>if("%choice%"=="REMOVE") kbArmyRemoveUnit(xsVectorGetY(vector(%SrcArmy%,0)), kbGetBlockID(""+1*%UnitID%));</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq Army - Add/Remove Unit of Type">
    <Param name="ifyoudontreplyyouwilldie" dispName="About:" varType="string">This effect will add to the army, a unit of the type you specify. If multiple exist, use the Index to specify which to add. Index 0 is the first unit.</Param>
    <Param name="SrcArmy" dispName="Army Name" varType="group">default</Param>
    <Param name="UnitID" dispName="Unit Type ID" varType="string">0</Param>
    <Param name="unitstate" dispName="State ID (2=Alive, 255=Any, 4=Dead...)" varType="string">2</Param>
    <Param name="actionid" dispName="Action ID (Optional)" varType="string">-1</Param>
    <Param name="Index" dispName="Unit Index to Add (0 is first unit)" varType="string">0</Param>
    <Param name="choice" dispName="ADD or REMOVE" varType="string">ADD</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>xsSetContextPlayer(xsVectorGetX(vector(%SrcArmy%,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("convarea", kbUnitQueryCreate("convarea"));</Command>
    <Command>kbUnitQuerySetPlayerID(trQuestVarGet("convarea"), xsVectorGetX(vector(%SrcArmy%,0)));</Command>
    <Command>kbUnitQuerySetUnitType(trQuestVarGet("convarea"), trQuestVarGet("zeep"));</Command>
    <Command>kbUnitQuerySetState(trQuestVarGet("convarea"), 1*%unitstate%);</Command>
    <Command>if(¬tionid%!=-1) kbUnitQuerySetActionType(trQuestVarGet("convarea"), 1*¬tionid%);</Command>
    <Command>kbUnitQuerySetAscendingSort(trQuestVarGet("convarea"), true);</Command>
    <Command>kbUnitQueryResetResults(trQuestVarGet("convarea"));</Command>
    <Command>trQuestVarSet("warthog", kbUnitQueryExecute(trQuestVarGet("convarea")));</Command>
    <Command>trQuestVarSet("ffweho", kbUnitQueryGetResult(trQuestVarGet("convarea"), %Index%));</Command>
    <Command>if("%choice%"=="ADD") kbArmyAddUnit(xsVectorGetY(vector(%SrcArmy%,0)), trQuestVarGet("ffweho"));</Command>
    <Command>if("%choice%"=="REMOVE") kbArmyRemoveUnit(xsVectorGetY(vector(%SrcArmy%,0)), trQuestVarGet("ffweho"));</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq Army - Add/Remove Units in Area (Center Unit)">
    <Param name="SrcArmy" dispName="Army Name" varType="group">default</Param>
    <Param name="choice" dispName="ADD or REMOVE" varType="string">ADD</Param>
    <Param name="Object" dispName="Center Unit" varType="unit">default</Param>
    <Param name="Dst" dispName="Radius (-1 for ALL)" varType="string">10.0</Param>
    <Param name="UnitId" dispName="Unit Type ID (Optional)" varType="string">-1</Param>
    <Param name="unitstate" dispName="State ID (2=Alive, 255=Any, 4=Dead...)" varType="string">2</Param>
    <Param name="actionid" dispName="Action ID (Optional)" varType="string">-1</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>xsSetContextPlayer(0);</Command>
    <Command>kbLookAtAllUnitsOnMap();</Command>
    <Command>trQuestVarSet("convarea", 0);</Command>
    <Command>trQuestVarSet("ffweho",0);</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("convarea", kbUnitQueryCreate("convarea"));</Command>
    <Command>kbUnitQuerySetPlayerID(trQuestVarGet("convarea"), xsVectorGetX(vector(%SrcArmy%,0)));</Command>
    <Command>kbUnitQuerySetUnitType(trQuestVarGet("convarea"), trQuestVarGet("zeep"));</Command>
    <Command>kbUnitQuerySetState(trQuestVarGet("convarea"), 1*%unitstate%);</Command>
    <Command>if(¬tionid%!=-1) kbUnitQuerySetActionType(trQuestVarGet("convarea"), 1*¬tionid%);</Command>
    <Command>if(%Dst%!=-1) {</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>xsSetContextPlayer(0);</Command>
    <Command>trQuestVarSet("warthog", trQuestVarGet("warthog")-1);</Command>
    <Command>trQuestVarSet("ffweho", kbUnitQueryGetResult(trQuestVarGet("convarea"), trQuestVarGet("warthog")));</Command>
    <Command>xsSetContextPlayer(xsVectorGetX(vector(%SrcArmy%,0)));</Command>
    <Command>if("%choice%"=="ADD") kbArmyAddUnit(xsVectorGetY(vector(%SrcArmy%,0)), trQuestVarGet("ffweho"));</Command>
    <Command>if("%choice%"=="REMOVE") kbArmyRemoveUnit(xsVectorGetY(vector(%SrcArmy%,0)), trQuestVarGet("ffweho"));</Command>
    <Command>}</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq Army - Remove Units with HP">
    <Param name="SrcArmy" dispName="Army Name" varType="group">default</Param>
    <Param name="oper" dispName="Remove Units with HP " varType="operator">==</Param>
    <Param name="HP" dispName="than " varType="string">0</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>xsSetContextPlayer(xsVectorGetX(vector(%SrcArmy%,0)));</Command>
    <Command>trQuestVarSet("foiewrfh", 0);</Command>
    <Command>while(kbArmyGetNumberUnits(xsVectorGetY(vector(%SrcArmy%,0)))>trQuestVarGet("foiewrfh")) {</Command>
    <Command>trQuestVarSet("fewjoeuw", kbArmyGetUnitID(xsVectorGetY(vector(%SrcArmy%,0)), trQuestVarGet("foiewrfh")));</Command>
    <Command>if(kbUnitGetCurrentHitpoints(trQuestVarGet("fewjoeuw")) %oper% %HP%) {</Command>
    <Command>kbArmyRemoveUnit(xsVectorGetY(vector(%SrcArmy%,0)), trQuestVarGet("fewjoeuw")); trQuestVarSet("foiewrfh", trQuestVarGet("foiewrfh")-1);}</Command>
    <Command>trQuestVarSet("foiewrfh", trQuestVarGet("foiewrfh")+1);}</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq Army - Remove Units with Percent HP">
    <Param name="SrcArmy" dispName="Army Name" varType="group">default</Param>
    <Param name="oper" dispName="Remove Units with Percent HP " varType="operator">==</Param>
    <Param name="HP" dispName="than Percent (decimal)" varType="string">0.50</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>xsSetContextPlayer(xsVectorGetX(vector(%SrcArmy%,0)));</Command>
    <Command>trQuestVarSet("foiewrfh", 0);</Command>
    <Command>while(kbArmyGetNumberUnits(xsVectorGetY(vector(%SrcArmy%,0)))>trQuestVarGet("foiewrfh")) {</Command>
    <Command>trQuestVarSet("fewjoeuw", kbArmyGetUnitID(xsVectorGetY(vector(%SrcArmy%,0)), trQuestVarGet("foiewrfh")));</Command>
    <Command>if(kbUnitGetHealth(trQuestVarGet("fewjoeuw")) %oper% %HP%) {</Command>
    <Command>kbArmyRemoveUnit(xsVectorGetY(vector(%SrcArmy%,0)), trQuestVarGet("fewjoeuw")); trQuestVarSet("foiewrfh", trQuestVarGet("foiewrfh")-1);}</Command>
    <Command>trQuestVarSet("foiewrfh", trQuestVarGet("foiewrfh")+1);}</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq Army - Remove Units By Index">
    <Param name="SrcArmy" dispName="Army Name" varType="group">default</Param>
    <Param name="oper" dispName="Unit Index to Remove (0 is first unit)" varType="string">0</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>xsSetContextPlayer(xsVectorGetX(vector(%SrcArmy%,0)));</Command>
    <Command>kbArmyRemoveUnitByIndex(xsVectorGetY(vector(%SrcArmy%,0)), %oper%);</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq Army - Remove All Units (Clear)">
    <Param name="SrcArmy" dispName="Army Name" varType="group">default</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>xsSetContextPlayer(xsVectorGetX(vector(%SrcArmy%,0)));</Command>
    <Command>kbArmyRemoveUnits(xsVectorGetY(vector(%SrcArmy%,0)));</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq Army - Add Units From Army">
    <Param name="SrcArmy" dispName="From Army" varType="group">default</Param>
    <Param name="SrcArmy2" dispName="To Army" varType="group">default</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>xsSetContextPlayer(xsVectorGetX(vector(%SrcArmy%,0)));</Command>
    <Command>trQuestVarSet("foiewrfh", 0);</Command>
    <Command>while(kbArmyGetNumberUnits(xsVectorGetY(vector(%SrcArmy%,0)))>trQuestVarGet("foiewrfh")) {</Command>
    <Command>xsSetContextPlayer(xsVectorGetX(vector(%SrcArmy%,0)));</Command>
    <Command>trQuestVarSet("fewjoeuw", kbArmyGetUnitID(xsVectorGetY(vector(%SrcArmy%,0)), trQuestVarGet("foiewrfh")));</Command>
    <Command>xsSetContextPlayer(xsVectorGetX(vector(%SrcArmy2%,0)));</Command>
    <Command>kbArmyAddUnit(xsVectorGetY(vector(%SrcArmy2%,0)), trQuestVarGet("fewjoeuw"));</Command>
    <Command>trQuestVarSet("foiewrfh", trQuestVarGet("foiewrfh")+1);}</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq QV Set Unit Current HP">
    <Param name="Player" dispName="Player (if known, reduces lag)" varType="string">-1</Param>
    <Param name="UnitID" dispName="Unit" varType="unit">default</Param>
    <Param name="QVName" dispName="QV to Record" varType="string">QV1</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>if(%Player%==-1) {</Command>
    <Command>trQuestVarSet("jwfeoihgoewhowy222", 99);</Command>
    <Command>trUnitSelectClear(); trUnitSelect(""+1*%UnitID%);</Command>
    <Command>trQuestVarSet("fhewohfewowi3ru", 0);</Command>
    <Command>while(12>trQuestVarGet("fhewohfewowi3ru")) {</Command>
    <Command>if(trUnitIsOwnedBy(trQuestVarGet("fhewohfewowi3ru"))==true) trQuestVarSet("jwfeoihgoewhowy222", trQuestVarGet("fhewohfewowi3ru"));</Command>
    <Command>trQuestVarSet("fhewohfewowi3ru", trQuestVarGet("fhewohfewowi3ru")+1);}}</Command>
    <Command>if(%Player%>=0) trQuestVarSet("jwfeoihgoewhowy222", %Player%);</Command>
    <Command>if(trQuestVarGet("jwfeoihgoewhowy222")!=99) {</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("jwfeoihgoewhowy222"));</Command>
    <Command>trQuestVarSet("%QVName%", kbUnitGetCurrentHitpoints(kbGetBlockID(""+1*%UnitID%)));</Command>
    <Command>}</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>


    <Effect name="pftq QV Set Unit Max HP">
    <Param name="Player" dispName="Player (if known, reduces lag)" varType="string">-1</Param>
    <Param name="UnitID" dispName="Unit" varType="unit">default</Param>
    <Param name="QVName" dispName="QV to Record" varType="string">QV1</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>if(%Player%==-1) {</Command>
    <Command>trQuestVarSet("jwfeoihgoewhowy222", 99);</Command>
    <Command>trUnitSelectClear(); trUnitSelect(""+1*%UnitID%);</Command>
    <Command>trQuestVarSet("fhewohfewowi3ru", 0);</Command>
    <Command>while(12>trQuestVarGet("fhewohfewowi3ru")) {</Command>
    <Command>if(trUnitIsOwnedBy(trQuestVarGet("fhewohfewowi3ru"))==true) trQuestVarSet("jwfeoihgoewhowy222", trQuestVarGet("fhewohfewowi3ru"));</Command>
    <Command>trQuestVarSet("fhewohfewowi3ru", trQuestVarGet("fhewohfewowi3ru")+1);}}</Command>
    <Command>if(%Player%>=0) trQuestVarSet("jwfeoihgoewhowy222", %Player%);</Command>
    <Command>if(trQuestVarGet("jwfeoihgoewhowy222")!=99) {</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("jwfeoihgoewhowy222"));</Command>
    <Command>trQuestVarSet("%QVName%", kbUnitGetMaximumHitpoints(kbGetBlockID(""+1*%UnitID%)));</Command>
    <Command>}</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq QV Set Unit Health (Percent HP)">
    <Param name="UnitID" dispName="Unit" varType="unit">default</Param>
    <Param name="QVName" dispName="QV to Record" varType="string">QV1</Param>
    <Command>trUnitSelectClear(); trUnitSelect(""+1*%UnitID%);</Command>
    <Command>trQuestVarSet("%QVName%", (100-trUnitPercentDamaged())/100);</Command>
    </Effect>

    <Effect name="pftq QV Set Unit Action Type ID">
    <Param name="Player" dispName="Player (if known, reduces lag)" varType="string">-1</Param>
    <Param name="UnitID" dispName="Unit" varType="unit">default</Param>
    <Param name="QVName" dispName="QV to Record" varType="string">QV1</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>if(%Player%==-1) {</Command>
    <Command>trQuestVarSet("jwfeoihgoewhowy222", 99);</Command>
    <Command>trUnitSelectClear(); trUnitSelect(""+1*%UnitID%);</Command>
    <Command>trQuestVarSet("fhewohfewowi3ru", 0);</Command>
    <Command>while(12>trQuestVarGet("fhewohfewowi3ru")) {</Command>
    <Command>if(trUnitIsOwnedBy(trQuestVarGet("fhewohfewowi3ru"))==true) trQuestVarSet("jwfeoihgoewhowy222", trQuestVarGet("fhewohfewowi3ru"));</Command>
    <Command>trQuestVarSet("fhewohfewowi3ru", trQuestVarGet("fhewohfewowi3ru")+1);}}</Command>
    <Command>if(%Player%>=0) trQuestVarSet("jwfeoihgoewhowy222", %Player%);</Command>
    <Command>if(trQuestVarGet("jwfeoihgoewhowy222")!=99) {</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("jwfeoihgoewhowy222"));</Command>
    <Command>trQuestVarSet("%QVName%", kbUnitGetActionType(kbGetBlockID(""+1*%UnitID%)));</Command>
    <Command>}</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq QV Set Num. Workers on Unit">
    <Param name="Player" dispName="Player (if known, reduces lag)" varType="string">-1</Param>
    <Param name="UnitID" dispName="Unit" varType="unit">default</Param>
    <Param name="QVName" dispName="QV to Record" varType="string">QV1</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>if(%Player%==-1) {</Command>
    <Command>trQuestVarSet("jwfeoihgoewhowy222", 99);</Command>
    <Command>trUnitSelectClear(); trUnitSelect(""+1*%UnitID%);</Command>
    <Command>trQuestVarSet("fhewohfewowi3ru", 0);</Command>
    <Command>while(12>trQuestVarGet("fhewohfewowi3ru")) {</Command>
    <Command>if(trUnitIsOwnedBy(trQuestVarGet("fhewohfewowi3ru"))==true) trQuestVarSet("jwfeoihgoewhowy222", trQuestVarGet("fhewohfewowi3ru"));</Command>
    <Command>trQuestVarSet("fhewohfewowi3ru", trQuestVarGet("fhewohfewowi3ru")+1);}}</Command>
    <Command>if(%Player%>=0) trQuestVarSet("jwfeoihgoewhowy222", %Player%);</Command>
    <Command>if(trQuestVarGet("jwfeoihgoewhowy222")!=99) {</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("jwfeoihgoewhowy222"));</Command>
    <Command>trQuestVarSet("%QVName%", kbUnitGetNumberWorkers(kbGetBlockID(""+1*%UnitID%)));</Command>
    <Command>}</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq QV Set Unit's Target OBJECT ID">
    <Param name="Player" dispName="Player (if known, reduces lag)" varType="string">-1</Param>
    <Param name="UnitID" dispName="Unit" varType="unit">default</Param>
    <Param name="QVName" dispName="QV to Record" varType="string">QV1</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>if(%Player%==-1) {</Command>
    <Command>trQuestVarSet("jwfeoihgoewhowy222", 99);</Command>
    <Command>trUnitSelectClear(); trUnitSelect(""+1*%UnitID%);</Command>
    <Command>trQuestVarSet("fhewohfewowi3ru", 0);</Command>
    <Command>while(12>trQuestVarGet("fhewohfewowi3ru")) {</Command>
    <Command>if(trUnitIsOwnedBy(trQuestVarGet("fhewohfewowi3ru"))==true) trQuestVarSet("jwfeoihgoewhowy222", trQuestVarGet("fhewohfewowi3ru"));</Command>
    <Command>trQuestVarSet("fhewohfewowi3ru", trQuestVarGet("fhewohfewowi3ru")+1);}}</Command>
    <Command>if(%Player%>=0) trQuestVarSet("jwfeoihgoewhowy222", %Player%);</Command>
    <Command>if(trQuestVarGet("jwfeoihgoewhowy222")!=99) {</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("jwfeoihgoewhowy222"));</Command>
    <Command>trQuestVarSet("%QVName%", kbUnitGetTargetUnitID(kbGetBlockID(""+1*%UnitID%)));</Command>
    <Command>}</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq QV Set Unit OBJECT ID">
    <Param name="UnitID" dispName="Target Unit" varType="unit">default</Param>
    <Param name="QVName" dispName="QV to Record" varType="string">QV1</Param>
    <Command>trQuestVarSet("%QVName%", kbGetBlockID(""+1*%UnitID%));</Command>
    </Effect>

    <Effect name="pftq Invoke God Power Near Unit">
    <Param name="wa" dispName="Instructions: " varType="string">This invokes godpowers SUCH AS LIGHTNING that normally require area selections.</Param>
    <Param name="wala" dispName="IMPORTANT: " varType="string">Only designed for single selection GPs - do not use for GPs such as Shift Sands, which require 2 selections.</Param>
    <Param name="PlayerID" dispName="Player" varType="string">0</Param>
    <Param name="PowerName" dispName="Power" varType="godpower">default</Param>
    <Param name="Object" dispName="Target" varType="unit">default</Param>
    <Param name="radius" dispName="Approx. Radius (slightly off)" varType="string">10</Param>
    <Param name="edge" dispName="Edge Only" varType="bool">false</Param>
    <Command>trUnitSelectClear();</Command>
    <Command loop="" loopParm="Object">trUnitSelect("%Object%");</Command>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>xsSetContextPlayer(0);</Command>
    <Command>kbLookAtAllUnitsOnMap();</Command>
    <Command>trQuestVarSetFromRand("hwfeoaifop", 0, 1, true);</Command>
    <Command>trQuestVarSetFromRand("wagogehmeas", 0, %radius%, true);</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==0) trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(kbGetBlockPosition(""+1*%Object%))+trQuestVarGet("wagogehmeas"));</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==1) trQuestVarSet("oiwghogwhywhlocx", xsVectorGetX(kbGetBlockPosition(""+1*%Object%))-trQuestVarGet("wagogehmeas"));</Command>
    <Command>trQuestVarSet("hwfeoaifopx", 0);</Command>
    <Command>if(íge%==true) trQuestVarSet("hwfeoaifopx", (%radius%-trQuestVarGet("wagogehmeas")));</Command>
    <Command>trQuestVarSetFromRand("wagogehmeas", trQuestVarGet("hwfeoaifopx"), (%radius%-trQuestVarGet("wagogehmeas")), true);</Command>
    <Command>trQuestVarSetFromRand("hwfeoaifop", 0, 1, true);</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==0) trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(kbGetBlockPosition(""+1*%Object%))+trQuestVarGet("wagogehmeas"));</Command>
    <Command>if(trQuestVarGet("hwfeoaifop")==1) trQuestVarSet("oiwghogwhywhlocz", xsVectorGetZ(kbGetBlockPosition(""+1*%Object%))-trQuestVarGet("wagogehmeas"));</Command>
    <Command>trTechInvokeGodPower(%PlayerID%, "%PowerName%", xsVectorSet(trQuestVarGet("oiwghogwhywhlocx"), 1, trQuestVarGet("oiwghogwhywhlocz")), xsVectorSet(trQuestVarGet("oiwghogwhywhlocx"), 1, trQuestVarGet("oiwghogwhywhlocz")));</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    <Effect name="pftq Invoke God Power At Unit">
    <Param name="wa" dispName="Instructions: " varType="string">This invokes godpowers SUCH AS LIGHTNING that normally require area selections.</Param>
    <Param name="wala" dispName="IMPORTANT: " varType="string">Make sure have BOTH targets set (even if to the same unit).</Param>
    <Param name="PlayerID" dispName="Player" varType="string">0</Param>
    <Param name="PowerName" dispName="Power" varType="godpower">default</Param>
    <Param name="Object" dispName="Target Unit 1" varType="unit">default</Param>
    <Param name="Object2" dispName="Target Unit 2" varType="unit">default</Param>
    <Command>trQuestVarSet("fhweaohpgpagowhwa", xsGetContextPlayer());</Command>
    <Command>xsSetContextPlayer(0);</Command>
    <Command>kbLookAtAllUnitsOnMap();</Command>
    <Command>trUnitSelectClear();</Command>
    <Command loop="" loopParm="Object">trUnitSelect("%Object%");</Command>
    <Command>trTechInvokeGodPower(%PlayerID%, "%PowerName%", kbGetBlockPosition(""+1*%Object%), kbGetBlockPosition(""+1*%Object2%));</Command>
    <Command>xsSetContextPlayer(trQuestVarGet("fhweaohpgpagowhwa"));</Command>
    </Effect>

    </Effects>

    </trigger>

    The boy with the mad imagination
    Prepare for the ultimate duel!
    Learn to use all my triggers and what you can do with them. Visit here.
    Find out and download the transform trigger here.
    Play some minigames I have created outside AOM including some 3D games here.
    sneaky_squirrel
    Mortal
    posted 30 January 2009 06:36 PM EDT (US)     2487 / 2502       
    Thanks nottud ;p.

    Turns out it was corrupt, now everything works perfectly.

    Now all I need is an army version of these triggers...that's odd, it works on a blank map but not on mine, are there any factors that cancel these triggers?

    The Gods have left us, therefore making the old world crumble and turn into ashes...

    But as the gods return, from the ashes of the old world, shall rise a more beautiful and powerful new world, and life will begin once more, if they hadn't closed...dang you ES.

    [This message has been edited by sneaky_squirrel (edited 01-30-2009 @ 07:51 PM).]

    Mythic_Freak
    Mortal
    posted 31 January 2009 07:54 AM EDT (US)     2488 / 2502       
    @nottud:
    I think that post was unnecessairy. :/
    Could you upload it to some other server or the dl section and link to it?

    Anyway, I got some free time again so I might make some requested triggers I forgot about...

    If we knew what it was we were doing, it would not be called research, would it? - Einstein, A.
    Master XS - AoM Code Reference - Trigger Loader - Trigger Requests - Chess

    Wow, I never thought that I would actually know something before nottud did... it's actually not all that satisfying ~ Steak
    sneaky_squirrel
    Mortal
    posted 31 January 2009 03:08 PM EDT (US)     2489 / 2502       
    That's odd, now it won't work...again, in a blank map it works at start, but won't work the second time around, and it won't work on my map either.

    I am afraid this trigger is flawed, unless you guys could make it work on my map :/.

    The Gods have left us, therefore making the old world crumble and turn into ashes...

    But as the gods return, from the ashes of the old world, shall rise a more beautiful and powerful new world, and life will begin once more, if they hadn't closed...dang you ES.
    invent00r
    Mortal
    posted 31 January 2009 03:27 PM EDT (US)     2490 / 2502       
    @:nottud
    Well.. Thats a long post.. I can only thank you for using whisper.

    @:sneaky_squirrel
    Do what Oboeman said. The trigger loader can be found here.

    @:Mephiles
    Not to rush you much, but do mind giving some feedback?..

    Usually people atleast say "thank you". :|
    -invent00r

    My Work: 1 2 3 4 5 6 7 8 9 10

    WIP: Master XS Battle Micro AI
    Paused: AI (%4.247)
    Os segredos são de quem os souber guardar.
    sneaky_squirrel
    Mortal
    posted 31 January 2009 04:16 PM EDT (US)     2491 / 2502       
    Problem
    I started using these trigger loader triggs but I have a problem, here is my setup:

    Army Position to QV vector (I am guessing this sets the QV vector on the army's location)
    Army: P1 (Desired army)
    Vector Name: V1

    Invoke GP at QV vectors (I am guessing this means invoke GP at the position of the vector)
    Player: 6 (He has LOS and is enemy to unit)
    Power: Spy
    Vector 1: V1
    Vector 2: V1 (WTF 2 vectors?, mind explaining?)
    Source Unit (WTF I thought this invoked in the position of a vector, not on a unit, mind explaining?, because if I don't set a unit on it the triggers stop working and if I set it on a unit, the unit gets the spy eye and the army I want it to be invoked upon is not on the map :S.

    Oboe do you use TT or are pure vanilla?

    The Gods have left us, therefore making the old world crumble and turn into ashes...

    But as the gods return, from the ashes of the old world, shall rise a more beautiful and powerful new world, and life will begin once more, if they hadn't closed...dang you ES.

    [This message has been edited by sneaky_squirrel (edited 01-31-2009 @ 04:48 PM).]

    invent00r
    Mortal
    posted 31 January 2009 05:51 PM EDT (US)     2492 / 2502       
    Quoted from sneaky_squirrel:
    Vector 2: V1 (WTF 2 vectors?, mind explaining?)
    Most god powers will use one vector. Some will use none. Underworld passage will use 2 vectors. Thats why there's to vectors - so you can invoke a underworld passage using triggers.
    Quoted from sneaky_squirrel:
    I thought this invoked in the position of a vector, not on a unit, mind explaining?
    I don't mind. The unit you select is the one that is going to be spied uppon. Vectors don't really make any difference whatsoever. Spy only uses the unit ID. Same as Bolt and Flaming Weapons.

    Sooo, you can't use this method.. There might be a trigger some where that invokes on army units.
    -invent00r

    My Work: 1 2 3 4 5 6 7 8 9 10

    WIP: Master XS Battle Micro AI
    Paused: AI (%4.247)
    Os segredos são de quem os souber guardar.
    sneaky_squirrel
    Mortal
    posted 31 January 2009 05:59 PM EDT (US)     2493 / 2502       
    So I need another solution, well I guess I'll contact someone else for that.

    Oh but can I use Invoke GP at Vectors for GPs such as sand shift or lightning storm?, if so then do I have to set a unit as the source unit so the trigger doesn't mess up the map?

    The Gods have left us, therefore making the old world crumble and turn into ashes...

    But as the gods return, from the ashes of the old world, shall rise a more beautiful and powerful new world, and life will begin once more, if they hadn't closed...dang you ES.
    Nick The Hun
    Mortal
    (id: Nick_The_Hunn)
    posted 01 February 2009 04:07 AM EDT (US)     2494 / 2502       
    Is it possible to make a trigger for Ingame Unlocked Teams?
    Mythic_Freak
    Mortal
    posted 01 February 2009 08:33 AM EDT (US)     2495 / 2502       
    Is it possible to make a trigger for Ingame Unlocked Teams?
    Nope

    P.S.: Well, it seems I managed to kill my graphics card by messing with the low level AoM graphic options (Go me!), sooo... I can't play AoM for a few days, neither make triggers. -_-".

    Luckily I still have my old computer running Ubuntu. :-/

    If we knew what it was we were doing, it would not be called research, would it? - Einstein, A.
    Master XS - AoM Code Reference - Trigger Loader - Trigger Requests - Chess

    Wow, I never thought that I would actually know something before nottud did... it's actually not all that satisfying ~ Steak

    [This message has been edited by Mythic_Freak (edited 02-01-2009 @ 08:33 AM).]

    Nick The Hun
    Mortal
    (id: Nick_The_Hunn)
    posted 01 February 2009 08:42 AM EDT (US)     2496 / 2502       
    Nope
    Aww man!

    O and good luck with your graphics, have fun with Buntu xD
    sneaky_squirrel
    Mortal
    posted 01 February 2009 10:36 AM EDT (US)     2497 / 2502       
    Nooooooooooooo, that only leaves nottud to make my triggers lol.

    The Gods have left us, therefore making the old world crumble and turn into ashes...

    But as the gods return, from the ashes of the old world, shall rise a more beautiful and powerful new world, and life will begin once more, if they hadn't closed...dang you ES.
    Mythic_Freak
    Mortal
    posted 01 February 2009 11:05 AM EDT (US)     2498 / 2502       
    O and good luck with your graphics, have fun with Buntu xD
    TY

    If we knew what it was we were doing, it would not be called research, would it? - Einstein, A.
    Master XS - AoM Code Reference - Trigger Loader - Trigger Requests - Chess

    Wow, I never thought that I would actually know something before nottud did... it's actually not all that satisfying ~ Steak
    Mythic_Freak
    Mortal
    posted 01 February 2009 11:05 AM EDT (US)     2499 / 2502       
    Nooooooooooooo, that only leaves nottud to make my triggers lol.
    I'll be back soon...

    If we knew what it was we were doing, it would not be called research, would it? - Einstein, A.
    Master XS - AoM Code Reference - Trigger Loader - Trigger Requests - Chess

    Wow, I never thought that I would actually know something before nottud did... it's actually not all that satisfying ~ Steak
    Mythic_Freak
    Mortal
    posted 01 February 2009 11:06 AM EDT (US)     2500 / 2502       
    Muhaha

    If we knew what it was we were doing, it would not be called research, would it? - Einstein, A.
    Master XS - AoM Code Reference - Trigger Loader - Trigger Requests - Chess

    Wow, I never thought that I would actually know something before nottud did... it's actually not all that satisfying ~ Steak
    invent00r
    Mortal
    posted 01 February 2009 11:09 AM EDT (US)     2501 / 2502       
    Err. You're not allowed to triple post?..

    Vote ban, Mythic_Freak.
    -invent00r

    My Work: 1 2 3 4 5 6 7 8 9 10

    WIP: Master XS Battle Micro AI
    Paused: AI (%4.247)
    Os segredos são de quem os souber guardar.
    sneaky_squirrel
    Mortal
    posted 01 February 2009 11:39 AM EDT (US)     2502 / 2502       
    Hurray, thx guys but nottud came to the rescue, hurray.

    The Gods have left us, therefore making the old world crumble and turn into ashes...

    But as the gods return, from the ashes of the old world, shall rise a more beautiful and powerful new world, and life will begin once more, if they hadn't closed...dang you ES.
    « Previous Page  1 ··· 10 ··· 20 ··· 30 ··· 40 ··· 50 ··· 60 ··· 70 ··· 80 ··· 90 ··· 98 99 100  Next Page »
    You must be logged in to post messages.
    Please login or register

    Hop to:    

    Age of Mythology Heaven | HeavenGames