Advertisement
Guest User

Untitled

a guest
Apr 14th, 2015
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 323.14 KB | None | 0 0
  1. function RPGchat(%client, %team, %message, %senderName)
  2. {
  3.     if(%client.IsInvalid) {
  4.         return;
  5.     }
  6.    
  7.     if(isobject(%client) == false) {
  8.         return;
  9.     }
  10.    
  11.     //-------------------------//
  12.     %TrueClientId = %client;
  13.    
  14.     if(%senderName !$= "")
  15.     {
  16.         %client = 2048;
  17.         %clientToServerAdminLevel = $BlockOwnerAdminLevel[%senderName];
  18.     }
  19.     else
  20.     {
  21.         %senderName = %client.nameBase;
  22.         %clientToServerAdminLevel = mfloor(%client.adminLevel);
  23.     }
  24.    
  25.     if(%client.isAIControlled()) {
  26.         %clientToServerAdminLevel = 3;
  27.     }
  28.    
  29.     if(%TrueClientId $= 2048) {
  30.         %echoOff = true;
  31.     }
  32.     else {
  33.         %echoOff = %TrueClientId.echoOff;
  34.     }
  35.    
  36.     %TCsenderName = %TrueClientId.rpgName;
  37.    
  38.     //If %senderName is empty, the rest of this function will continue normally, as both %TrueClientId and %client
  39.     //are identical.  However, if %senderName is NOT empty, messages that the server should hear will be under %client,
  40.     //and messages that the client RUNNING the script needs to hear will be under %TrueClientId.
  41.     //During %senderName being NOT empty, basic player command messages are sent to the server.  These commands shouldn't
  42.     //normally be invoked anyway, unless the scripter forces it somehow.  Block management commands should use
  43.     //%TrueClientId because they can only be run WHILE the client is in-game, so the messages should be sent to him.
  44.     //The rest of the commands should use %client because those are the ones that the server will be calling.
  45.    
  46.     //An easy to way to distinguish the tasks between client and server is that the client runs the commands that
  47.     //manage, while the server runs the commands that do actions.
  48.    
  49.     //- %TrueClientId should be assigned to things that require client access, and need to send a message
  50.     //  (like a confirmation or error message) to someone.
  51.     //- %client should be assigned to things that do actions.
  52.    
  53.     //%TrueClientId will only become 2048 if the client leaves the game.
  54.    
  55.     //Remember that if a client disconnects, the %TrueClientId will become 2048, the same as %client.  This means
  56.     //that the server will then be receiving all these messages.
  57.    
  58.     //I had to write this little commentary because I was getting confused myself...
  59.    
  60.     //NEW:
  61.     //- %TrueClientId should be assigned to things that involve the player at hand
  62.     //- %client should be assigned to things that involve control
  63.     //-------------------------//
  64.    
  65.     %time = getTime();
  66.    
  67.     if(%time - %client.lastSayTime <= $sayDelay && !(%clientToServerAdminLevel >= 1)) {
  68.         return;
  69.     }
  70.    
  71.     %client.lastSayTime = %time;
  72.    
  73.     //check for a bulknum-type of message
  74.     if(%message $= mfloor(%message))
  75.     {
  76.         if(%client.currentShop !$= "" || %client.currentBank !$= "")
  77.         {
  78.             if(%message < 1) {
  79.                 %message = 1;
  80.             }
  81.            
  82.             if(%message > 100) {
  83.                 %message = 100;
  84.             }
  85.         }
  86.        
  87.         %TrueClientId.bulkNum = %message;
  88.     }
  89.    
  90.     //parse message
  91.     %botTalk = false;
  92.     %isCommand = false;
  93.    
  94.     if(getsubstr(%message, 0, 1) !$= "#")
  95.     {
  96.         if(%team $= 1) {
  97.             %message = "#zone " @ %message;
  98.         }
  99.         else {
  100.             %message = fetchData(%TrueClientId, "defaultTalk") @ " " @ %message;
  101.         }
  102.     }
  103.    
  104.     if(getsubstr(%message, 0, 1) $= "#") {
  105.         %isCommand = true;
  106.     }
  107.    
  108.     if($exportChat)
  109.     {
  110.         %ip = %TrueClientId.getAddress();
  111.        
  112.         if(%TrueClientId.doExport)
  113.         {
  114.             $log::msg["[\"" @ %TCsenderName @ "\"]"] = %message;
  115.             export("log::msg[\"" @ %TCsenderName @ "\"*", "temp\\log-" @ %TCsenderName @ ".cs", true);
  116.             $log::msg["[\"" @ %TCsenderName @ "\"]"] = "";//memory
  117.         }
  118.     }
  119.    
  120.     %w1 = GetWord(%message, 0);
  121.    
  122.     //========== Redirect block commands into memory =============================================
  123.     if(fetchData(%TrueClientId, "BlockInputFlag") !$= "" && stricmp(%w1, "#endblock") !$= 0 && %w1 !$= -1 && %message !$= "")
  124.     {
  125.         //Entering block information into memory
  126.         %tmpBlockCnt = fetchData(%TrueClientId, "tmpBlockCnt") + 1;
  127.         storeData(%TrueClientId, "tmpBlockCnt", %tmpBlockCnt);
  128.         $BlockData[%TCsenderName, fetchData(%TrueClientId, "BlockInputFlag"), %tmpBlockCnt] = %message;
  129.         return 0;
  130.     }
  131.    
  132.     //============================================================================================
  133.    
  134.     %cropped = getsubstr(%message, (strlen(%w1)+1), 99999);
  135.    
  136.     if(%isCommand)
  137.     {
  138.         switch$(%w1)
  139.         {
  140.             case "#say":
  141.                 if(SkillCanUse(%TrueClientId, "#say"))
  142.                 {
  143.                     if(%TrueClientID.player)// does player exist
  144.                     {
  145.                    
  146.                         %count = ClientGroup.getCount();
  147.                        
  148.                         for(%icl = 0; %icl < %count; %icl++)
  149.                         {
  150.                             %cl = ClientGroup.getObject(%icl);
  151.                            
  152.                             if(isobject(%cl.player))
  153.                             {
  154.                                 %talkingPos = %TrueClientId.player.getPosition();
  155.                                 %receivingPos = %cl.player.getPosition();
  156.                                 %distVec = VectorDist(%talkingPos, %receivingPos);
  157.                                
  158.                                 if(%distVec <= $maxSAYdistVec)
  159.                                 {
  160.                                     //%newmsg = FadeMsg(%cropped, %distVec, $maxSAYdistVec);
  161.                                     %newmsg = %cropped;
  162.                                    
  163.                                     if(!%cl.muted[%TrueClientId] && %cl !$= %TrueClientId) {
  164.                                         messageClient(%cl, 'RPGchatCallback', %TCsenderName @ " says, \"" @ %newmsg @ "\"");
  165.                                     }
  166.                                 }
  167.                             }
  168.                         }
  169.                        
  170.                         messageClient(%TrueClientId, 'RPGchatCallback', "You say, \"" @ %cropped @ "\"");
  171.                         UseSkill(%TrueClientId, $SkillSpeech, true, true);
  172.                        
  173.                         %botTalk = true;
  174.                     }
  175.                 }
  176.                 else
  177.                 {
  178.                     messageClient(%TrueClientId, 'RPGchatCallback', "You lack the necessary skills to use this command.");
  179.                     UseSkill(%TrueClientId, $SkillSpeech, false, true);
  180.                 }
  181.                
  182.             case "#shout":
  183.                 if(SkillCanUse(%TrueClientId, "#shout"))
  184.                 {
  185.                     %count = ClientGroup.getCount();
  186.                    
  187.                     for(%icl = 0; %icl < %count; %icl++)
  188.                     {
  189.                         %cl = ClientGroup.getObject(%icl);
  190.                        
  191.                         %talkingPos = %TrueClientId.player.getPosition();
  192.                         %receivingPos = %cl.player.getPosition();
  193.                         %distVec = VectorDist(%talkingPos, %receivingPos);
  194.                        
  195.                         if(%distVec <= $maxSHOUTdistVec)
  196.                         {
  197.                             //%newmsg = FadeMsg(%cropped, %distVec, $maxSHOUTdistVec);
  198.                             %newmsg = %cropped;
  199.                            
  200.                             if(!%cl.muted[%TrueClientId] && %cl !$= %TrueClientId) {
  201.                                 messageClient(%cl, 'RPGchatCallback', %TCsenderName @ " shouts, \"" @ %newmsg @ "\"");
  202.                             }
  203.                         }
  204.                     }
  205.                    
  206.                     messageClient(%TrueClientId, 'RPGchatCallback', "You shouted, \"" @ %cropped @ "\"");
  207.                     UseSkill(%TrueClientId, $SkillSpeech, true, true);
  208.                    
  209.                     %botTalk = true;
  210.                 }
  211.                 else
  212.                 {
  213.                     messageClient(%TrueClientId, 'RPGchatCallback', "You lack the necessary skills to use this command.");
  214.                     UseSkill(%TrueClientId, $SkillSpeech, false, true);
  215.                 }
  216.                
  217.             case "#whisper":
  218.                 if(SkillCanUse(%TrueClientId, "#whisper"))
  219.                 {
  220.                     %count = ClientGroup.getCount();
  221.                    
  222.                     for(%icl = 0; %icl < %count; %icl++)
  223.                     {
  224.                         %cl = ClientGroup.getObject(%icl);
  225.                        
  226.                         %talkingPos = %TrueClientId.player.getPosition();
  227.                         %receivingPos = %cl.player.getPosition();
  228.                         %distVec = VectorDist(%talkingPos, %receivingPos);
  229.                        
  230.                         if(%distVec <= $maxWHISPERdistVec)
  231.                         {
  232.                             //%newmsg = FadeMsg(%cropped, %distVec, $maxWHISPERdistVec);
  233.                             %newmsg = %cropped;
  234.                            
  235.                             if(!%cl.muted[%TrueClientId] && %cl !$= %TrueClientId) {
  236.                                 messageClient(%cl, 'RPGchatCallback', %TCsenderName @ " whispers, \"" @ %newmsg @ "\"");
  237.                             }
  238.                         }
  239.                     }
  240.                    
  241.                     messageClient(%TrueClientId, 'RPGchatCallback', "You whisper, \"" @ %cropped @ "\"");
  242.                     UseSkill(%TrueClientId, $SkillSpeech, true, true);
  243.                    
  244.                     %botTalk = true;
  245.                 }
  246.                 else
  247.                 {
  248.                     messageClient(%TrueClientId, 'RPGchatCallback', "You lack the necessary skills to use this command.");
  249.                     UseSkill(%TrueClientId, $SkillSpeech, false, true);
  250.                 }
  251.         }
  252.        
  253.         if(Game.IsJailed(%TrueClientId) && %clienttoServeradminlevel < 5) {
  254.             return;
  255.         }
  256.        
  257.         switch$(%w1)
  258.         {
  259.             case "#tell":
  260.                 if(SkillCanUse(%TrueClientId, "#tell"))
  261.                 {
  262.                     if(%cropped $= "")
  263.                     {
  264.                         messageClient(%TrueClientId, 'RPGchatCallback', "syntax: #tell whoever, message");
  265.                     }
  266.                     else
  267.                     {
  268.                         %pos1 = 0;
  269.                         %pos2 = strstr(%cropped, ",");
  270.                         %name = getsubstr(%cropped, %pos1, %pos2-%pos1);
  271.                         %final = getsubstr(%cropped, %pos2 + 2, strlen(%cropped)-%pos2-2);
  272.                         %cl = getClientByName(%name);
  273.                        
  274.                         if(%cl !$= -1)
  275.                         {
  276.                             %n = %cl.nameBase;  //capitalize the name properly
  277.                            
  278.                             if(!%cl.muted[%TrueClientId])
  279.                             {
  280.                                 messageClient(%cl, 'RPGchatCallback', %TCsenderName @ " tells you, \"" @ %final @ "\"");
  281.                                
  282.                                 if(%cl !$= %TrueClientId) {
  283.                                     messageClient(%TrueClientId, 'RPGchatCallback', "You tell " @ %n @ ", \"" @ %final @ "\"");
  284.                                 }
  285.                                
  286.                                 %cl.replyTo = %TCsenderName;
  287.                                
  288.                                 UseSkill(%TrueClientId, $SkillSpeech, true, true);
  289.                             }
  290.                             else {
  291.                                 messageClient(%TrueClientId, 'RPGchatCallback', %n @ " has muted you.");
  292.                             }
  293.                         }
  294.                         else {
  295.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  296.                         }
  297.                     }
  298.                    
  299.                     %botTalk = true;
  300.                 }
  301.                 else
  302.                 {
  303.                     messageClient(%TrueClientId, 'RPGchatCallback', "You lack the necessary skills to use this command.");
  304.                     UseSkill(%TrueClientId, $SkillSpeech, false, true);
  305.                 }
  306.                
  307.             case "#r":
  308.                 if(SkillCanUse(%TrueClientId, "#tell"))
  309.                 {
  310.                     if(%cropped $= "") {
  311.                         messageClient(%TrueClientId, 'RPGchatCallback', "syntax: #r message");
  312.                     }
  313.                     else
  314.                     {
  315.                         %name = %TrueClientId.replyTo;
  316.                        
  317.                         if(%name !$= "")
  318.                         {
  319.                             %cl = getClientByName(%name);
  320.                            
  321.                             if(%cl !$= -1)
  322.                             {
  323.                                 if(!%cl.muted[%TrueClientId])
  324.                                 {
  325.                                     messageClient(%cl, 'RPGchatCallback', %TCsenderName @ " replies, \"" @ %cropped @ "\"");
  326.                                    
  327.                                     if(%cl !$= %TrueClientId) {
  328.                                         messageClient(%TrueClientId, 'RPGchatCallback', "You reply to " @ %name @ ", \"" @ %cropped @ "\"");
  329.                                     }
  330.                                    
  331.                                     %cl.replyTo = %TCsenderName;
  332.                                    
  333.                                     //UseSkill(%TrueClientId, $SkillSpeech, true, true);
  334.                                 }
  335.                             }
  336.                             else {
  337.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  338.                             }
  339.                            
  340.                             %botTalk = true;
  341.                         }
  342.                         else {
  343.                             messageClient(%TrueClientId, 'RPGchatCallback', "You haven't received a #tell to reply to yet.");
  344.                         }
  345.                     }
  346.                 }
  347.                 else
  348.                 {
  349.                     messageClient(%TrueClientId, 'RPGchatCallback', "You lack the necessary skills to use this command.");
  350.                     UseSkill(%TrueClientId, $SkillSpeech, false, true);
  351.                 }
  352.                
  353.                 return;
  354.                
  355.             case "#global" or "#g":
  356.                 if(SkillCanUse(%TrueClientId, "#global"))
  357.                 {
  358.                     if(!fetchData(%TrueClientId, "ignoreGlobal"))
  359.                     {
  360.                         %count = ClientGroup.getCount();
  361.                        
  362.                         for(%icl = 0; %icl < %count; %icl++)
  363.                         {
  364.                             %cl = ClientGroup.getObject(%icl);
  365.                            
  366.                             if(!%cl.muted[%TrueClientId] && %cl !$= %TrueClientId && !fetchData(%cl, "ignoreGlobal")) {
  367.                                 messageClient(%cl, 'RPGchatCallback', "[GLBL] " @ %TCsenderName @ " \"" @ %cropped @ "\"");
  368.                             }
  369.                         }
  370.                        
  371.                         messageClient(%TrueClientId, 'RPGchatCallback', "[GLBL] \"" @ %cropped @ "\"");
  372.                        
  373.                         //UseSkill(%TrueClientId, $SkillSpeech, true, true);
  374.                     }
  375.                     else {
  376.                         messageClient(%TrueClientId, 'RPGchatCallback', "You can't send a Global message when ignoring other Global messages.");
  377.                     }
  378.                 }
  379.                 else
  380.                 {
  381.                     messageClient(%TrueClientId, 'RPGchatCallback', "You lack the necessary skills to use this command.");
  382.                     UseSkill(%TrueClientId, $SkillSpeech, false, true);
  383.                 }
  384.                
  385.                 return;
  386.                
  387.             case "#guild" or "#gu":
  388.                 if(SkillCanUse(%TrueClientId, "#guild"))
  389.                 {
  390.                     %guildid = IsInWhatGuild(%client);
  391.                     %guild = GuildGroup.GetObject(%guildid);
  392.                    
  393.                     if(%guildid != -1 || %guild.GetGUIDRank(%TrueClientId.guid) == 0)
  394.                     {
  395.                         //ok user is in a guild so we get the guild and obtain the list.
  396.                        
  397.                        
  398.                        
  399.                         %count = ClientGroup.getCount();
  400.                        
  401.                         for(%icl = 0; %icl < %count; %icl++)
  402.                         {
  403.                             %cl = ClientGroup.getObject(%icl);
  404.                            
  405.                             if(%cl.isAiControlled()) {
  406.                                 continue;    //skip bots
  407.                             }
  408.                            
  409.                             if(%guild.GUIDinGuild(%cl.guid) && %guild.GetGUIDRank(%cl.guid) > 0 && (!%cl.muted[%TrueClientId] && %cl !$= %TrueClientId)) {
  410.                                 messageClient(%cl, 'RPGchatCallback'  ,"[GUILD] " @ %TCsenderName @ " \"" @ %cropped @ "\"");
  411.                             }
  412.                            
  413.                         }
  414.                        
  415.                         messageClient(%TrueClientID, 'RPGchatCallback', "[GUILD] \"" @ %cropped @ "\"");
  416.                         UseSkill(%TrueClientId, $SkillSpeech, true, true);
  417.                     }
  418.                     else {
  419.                         messageClient(%TrueClientID, 'RPGchatcallback', "You are not in a guild.");
  420.                     }
  421.                    
  422.                    
  423.                 }
  424.                 else {
  425.                     messageClient(%TrueClientID, 'RPGchatCallback', "You lack the necessary skills to use this command.");
  426.                 }
  427.                
  428.                 return;
  429.                
  430.             case "#zone" or "#z":
  431.                 if(SkillCanUse(%TrueClientId, "#zone"))
  432.                 {
  433.                     %count = ClientGroup.getCount();
  434.                    
  435.                     for(%icl = 0; %icl < %count; %icl++)
  436.                     {
  437.                         %cl = ClientGroup.getObject(%icl);
  438.                        
  439.                         if(!%cl.muted[%TrueClientId] && %cl !$= %TrueClientId && fetchData(%cl, "zone") $= fetchData(%TrueClientId, "zone")) {
  440.                             messageClient(%cl, 'RPGchatCallback', "[ZONE] " @ %TCsenderName @ " \"" @ %cropped @ "\"");
  441.                         }
  442.                     }
  443.                    
  444.                     messageClient(%TrueClientId, 'RPGchatCallback', "[ZONE] \"" @ %cropped @ "\"");
  445.                    
  446.                     UseSkill(%TrueClientId, $SkillSpeech, true, true);
  447.                 }
  448.                 else
  449.                 {
  450.                     messageClient(%TrueClientId, 'RPGchatCallback', "You lack the necessary skills to use this command.");
  451.                     UseSkill(%TrueClientId, $SkillSpeech, false, true);
  452.                 }
  453.                
  454.                 return;
  455.                
  456.             case "#group":
  457.                 if(SkillCanUse(%TrueClientId, "#group"))
  458.                 {
  459.                     %count = ClientGroup.getCount();
  460.                    
  461.                     for(%icl = 0; %icl < %count; %icl++)
  462.                     {
  463.                         %cl = ClientGroup.getObject(%icl);
  464.                        
  465.                         if(!%cl.muted[%TrueClientId] && %cl !$= %TrueClientId && IsInGroupList(%TrueClientId, %cl))
  466.                         {
  467.                             if(IsInGroupList(%cl, %TrueClientId)) {
  468.                                 messageClient(%cl, 'RPGchatCallback', "[GRP] " @ %TCsenderName @ " \"" @ %cropped @ "\"");
  469.                             }
  470.                             else {
  471.                                 messageClient(%TrueClientId, 'RPGchatCallback', %cl.nameBase @ " does not have you on his/her group-list.");
  472.                             }
  473.                         }
  474.                     }
  475.                    
  476.                     messageClient(%TrueClientId, 'RPGchatCallback', "[GRP] \"" @ %cropped @ "\"");
  477.                     UseSkill(%TrueClientId, $SkillSpeech, true, true);
  478.                 }
  479.                 else
  480.                 {
  481.                     messageClient(%TrueClientId, 'RPGchatCallback', "You lack the necessary skills to use this command.");
  482.                     UseSkill(%TrueClientId, $SkillSpeech, false, true);
  483.                 }
  484.                
  485.                 return;
  486.                
  487.             case "#party" or "#p":
  488.                 if(SkillCanUse(%TrueClientId, "#party"))
  489.                 {
  490.                     %list = GetPartyListIAmIn(%TrueClientId);
  491.                    
  492.                     for(%p = strstr(%list, ","); (%p = strstr(%list, ",")) !$= -1; %list = getsubstr(%list, %p+1, 99999))
  493.                     {
  494.                         %cl = getsubstr(%list, 0, %p);
  495.                        
  496.                         if(!%cl.muted[%TrueClientId] && %cl !$= %TrueClientId) {
  497.                             messageClient(%cl, 'RPGchatCallback', "[PRTY] " @ %TCsenderName @ " \"" @ %cropped @ "\"");
  498.                         }
  499.                     }
  500.                    
  501.                     messageClient(%TrueClientId, 'RPGchatCallback', "[PRTY] \"" @ %cropped @ "\"");
  502.                     UseSkill(%TrueClientId, $SkillSpeech, true, true);
  503.                 }
  504.                 else
  505.                 {
  506.                     messageClient(%TrueClientId, 'RPGchatCallback', "You lack the necessary skills to use this command.");
  507.                     UseSkill(%TrueClientId, $SkillSpeech, false, true);
  508.                 }
  509.                
  510.                 return;
  511.                
  512.             case "#leavearena":
  513.                 if(inArenaroster(%TrueClientId))
  514.                 {
  515.                     leaveArena(%TrueClientId);
  516.                    
  517.                 }
  518.                 else {
  519.                     messageClient(%TrueClientId, 'RPGchatCallback', "You must be in the arena wait room in order to leave it");
  520.                 }
  521.         }
  522.        
  523.         if(IsDead(%TrueClientId) && %TrueClientId !$= 2048) {
  524.             return;
  525.         }
  526.        
  527.         //check for onHear events
  528.         if(%botTalk)
  529.         {
  530.             %count = ClientGroup.getCount();
  531.            
  532.             for(%icl = 0; %icl < %count; %icl++)
  533.             {
  534.                 %oid = ClientGroup.getObject(%icl);
  535.                
  536.                 %time = getTime();
  537.                
  538.                 if(%time - fetchData(%oid, "nextOnHear") > 0.05)
  539.                 {
  540.                     storeData(%oid, "nextOnHear", %time);
  541.                    
  542.                     %oname = %oid.nameBase;
  543.                    
  544.                     %index = GetEventCommandIndex(%oid, "onHear");
  545.                    
  546.                     if(%index !$= -1)
  547.                     {
  548.                         for(%i2 = 0; (%index2 = GetWord(%index, %i2)) !$= ""; %i2++)
  549.                         {
  550.                             %ec = $EventCommand[%oid, %index2];
  551.                            
  552.                             %hearName = GetWord(%ec, 2);
  553.                             %radius = GetWord(%ec, 3);
  554.                            
  555.                             if(VectorDist(%oid.player.getPosition(), %TrueClientId.player.getPosition()) <= %radius)
  556.                             {
  557.                                 %targetname = GetWord(%ec, 5);
  558.                                
  559.                                 if(stricmp(%targetname, "all") !$= 0) {
  560.                                     %targetId = getClientByName(%targetname);
  561.                                 }
  562.                                
  563.                                 if(stricmp(%targetname, "all") $= 0 || %targetId $= %TrueClientId)
  564.                                 {
  565.                                     %sname = GetWord(%ec, 0);
  566.                                     %type = GetWord(%ec, 1);
  567.                                     %keep = GetWord(%ec, 4);
  568.                                     %var = GetWord(%ec, 6);
  569.                                    
  570.                                     if(stricmp(%var, "var") $= 0) {
  571.                                         %var = true;
  572.                                     }
  573.                                     else
  574.                                     {
  575.                                         %div1 = strstr(%ec, "|");
  576.                                         %div2 = String::ofindSubStr(%ec, "|", %div1+1);
  577.                                         %text = getsubstr(%ec, %div1+1, %div2);
  578.                                         %oec = getsubstr(%ec, %div1+%div2+2, 99999);
  579.                                     }
  580.                                    
  581.                                     if(stricmp(%cropped, %text) $= 0 || %var)
  582.                                     {
  583.                                         if((%cl = getClientByName(%sname)) $= -1) {
  584.                                             %cl = 2048;
  585.                                         }
  586.                                        
  587.                                         %cmd = getsubstr($EventCommand[%oid, %index2], strstr($EventCommand[%oid, %index2], ">")+1, 99999);
  588.                                        
  589.                                         if(%var) {
  590.                                             %cmd = strreplace(%cmd, "^var", %cropped);
  591.                                         }
  592.                                        
  593.                                         %pcmd = ParseBlockData(%cmd, %TrueClientId, "");
  594.                                        
  595.                                         if(!%keep) {
  596.                                             $EventCommand[%oid, %index2] = "";
  597.                                         }
  598.                                        
  599.                                         RPGchat(%cl, 0, %pcmd); //, %sname);
  600.                                     }
  601.                                 }
  602.                             }
  603.                         }
  604.                     }
  605.                 }
  606.             }
  607.         }
  608.        
  609.         //=================================================
  610.         // Beginning of commands
  611.         // (player can't use any of these while dead)
  612.         //=================================================
  613.        
  614.         switch$(%w1)
  615.         {
  616.             case "#steal":
  617.                 %time = getTime();
  618.                
  619.                 if(%time - %TrueClientId.lastStealTime > $stealDelay)
  620.                 {
  621.                     %TrueClientId.lastStealTime = %time;
  622.                    
  623.                     if((%reason = AllowedToSteal(%TrueClientId)) $= "true")
  624.                     {
  625.                         if(SkillCanUse(%TrueClientId, "#steal"))
  626.                         {
  627.                             if(getLOSinfo(%TrueClientId, 1))
  628.                             {
  629.                                 %id = $los::object.client;
  630.                                
  631.                                 if($los::object.getClassName() $= "Player")
  632.                                 {
  633.                                     %victimName = %id.nameBase;
  634.                                     %stealerName = %TCsenderName;
  635.                                     %victimCoins = fetchData(%id, "COINS");
  636.                                     %fail = false;
  637.                                    
  638.                                     if(%victimCoins > 0)
  639.                                     {
  640.                                         %r1 = GetRpgRoll("1r" @(%TrueClientId.PlayerSkill[$SkillStealing] * (4/5)));
  641.                                         %r2 = GetRpgRoll("1r" @ %id.PlayerSkill[$SkillStealing]);
  642.                                         %a = %r1 - %r2;
  643.                                        
  644.                                         if(%a > 0)
  645.                                         {
  646.                                             %amount = mfloor(%a * getRandom() * 1.2);
  647.                                            
  648.                                             if(%amount > %victimCoins) {
  649.                                                 %amount = %victimCoins;
  650.                                             }
  651.                                            
  652.                                             if(%amount > 0)
  653.                                             {
  654.                                                 storeData(%TrueClientId, "COINS", %amount, "inc");
  655.                                                 storeData(%id, "COINS", %amount, "dec");
  656.                                                 PerhapsPlayStealSound(%TrueClientId, 0);
  657.                                                
  658.                                                 messageClient(%TrueClientId, 'RPGchatCallback', "You successfully stole " @ %amount @ " coins from " @ %victimName @ "!");
  659.                                                
  660.                                                 RefreshAll(%TrueClientId);
  661.                                                 RefreshAll(%id);
  662.                                                
  663.                                                 UseSkill(%TrueClientId, $SkillStealing, true, true);
  664.                                                 PostSteal(%TrueClientId, true, 0);
  665.                                             }
  666.                                             else {
  667.                                                 %fail = true;
  668.                                             }
  669.                                         }
  670.                                         else {
  671.                                             %fail = true;
  672.                                         }
  673.                                        
  674.                                         if(%fail)
  675.                                         {
  676.                                             messageClient(%TrueClientId, 'RPGchatCallback', "You failed to steal from " @ %victimName @ "!");
  677.                                             messageClient(%id, 'RPGchatCallback', %stealerName @ " just failed to steal from you!");
  678.                                            
  679.                                             UseSkill(%TrueClientId, $SkillStealing, false, true);
  680.                                             PostSteal(%TrueClientId, false, 0);
  681.                                         }
  682.                                     }
  683.                                     else
  684.                                     {
  685.                                         messageClient(%TrueClientId, 'RPGchatCallback', %victimName @ " doesn't appear to be carrying any coins...");
  686.                                     }
  687.                                 }
  688.                             }
  689.                         }
  690.                         else
  691.                         {
  692.                             messageClient(%TrueClientId, 'RPGchatCallback', "You can't steal because you lack the necessary skills.");
  693.                             UseSkill(%TrueClientId, $SkillStealing, false, true);
  694.                         }
  695.                     }
  696.                     else {
  697.                         messageClient(%TrueClientId, 'RPGchatCallback', %reason);
  698.                     }
  699.                 }
  700.                
  701.                 return;
  702.                
  703.             case "#savecharacter":
  704.                 if(%clientToServerAdminLevel >= 4)
  705.                 {
  706.                     if(%cropped $= "")
  707.                     {
  708.                         %r = SaveCharacter(%TrueClientId);
  709.                         messageClient(%TrueClientId, 'RPGchatCallback', "Saving self (" @ %TrueClientId @ "): success = " @ %r);
  710.                     }
  711.                     else
  712.                     {
  713.                         %id = getClientByName(%cropped);
  714.                        
  715.                         if(%id)
  716.                         {
  717.                             %r = SaveCharacter(%id);
  718.                             messageClient(%TrueClientId, 'RPGchatCallback', "Saving " @ %id.nameBase @ " (" @ %id @ "): success = " @ %r);
  719.                         }
  720.                         else {
  721.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  722.                         }
  723.                     }
  724.                 }
  725.                 else
  726.                 {
  727.                     %time = getTime();
  728.                    
  729.                     if(%time - %TrueClientId.lastSaveCharTime > 10)
  730.                     {
  731.                         %TrueClientId.lastSaveCharTime = %time;
  732.                        
  733.                         %r = SaveCharacter(%TrueClientId);
  734.                         messageClient(%TrueClientId, 'RPGchatCallback', "Saving self (" @ %TrueClientId @ "): success = " @ %r);
  735.                     }
  736.                 }
  737.                
  738.                 return;
  739.                
  740.             case "#whatismyclientid":
  741.                 messageClient(%TrueClientId, 'RPGchatCallback', "Your clientId is " @ %TrueClientId);
  742.                 return;
  743.                
  744.             case "#whatismyuniqueid":
  745.                 messageClient(%TrueClientId, 'RPGchatCallback', "Your Global Unique ID is" SPC %TrueClientId.guid);
  746.                
  747.             case "#whatismyplayerid":
  748.                 messageClient(%TrueClientId, 'RPGchatCallback', "Your playerId is " @ %TrueClientId.player);
  749.                 return;
  750.                
  751.             case "#dropcoins":
  752.                 %cropped = GetWord(%cropped, 0);
  753.                
  754.                 if(%cropped $= "all") {
  755.                     %cropped = fetchData(%TrueClientId, "COINS");
  756.                 }
  757.                 else {
  758.                     %cropped = mfloor(%cropped);
  759.                 }
  760.                
  761.                 if(fetchData(%TrueClientId, "COINS") >= %cropped || %clientToServerAdminLevel >= 4)
  762.                 {
  763.                     if(%cropped > 0)
  764.                     {
  765.                         if(!(%clientToServerAdminLevel >= 4)) {
  766.                             storeData(%TrueClientId, "COINS", %cropped, "dec");
  767.                         }
  768.                        
  769.                         %toss = GetTypicalTossStrength(%TrueClientId);
  770.                        
  771.                         TossLootbag(%TrueClientId, "", %cropped, 0);
  772.                         RefreshAll(%TrueClientId);
  773.                        
  774.                         messageClient(%TrueClientId, 'RPGchatCallback', "You dropped " @ %cropped @ " coins.");
  775.                         %TrueClientId.player.playAudio(0, SoundMoney1);
  776.                     }
  777.                 }
  778.                 else
  779.                 {
  780.                     messageClient(%TrueClientId, 'RPGchatCallback', "You don't even have that many coins!");
  781.                 }
  782.                
  783.                 return;
  784.                
  785.             case "#compass":
  786.            
  787.                 if(%cropped $= "") {
  788.                     messageClient(%TrueClientId, 'RPGchatCallback', "Use #compass town or #compass dungeon. (Do not specify which, simply write town or dungeon)");
  789.                 }
  790.                 else
  791.                 {
  792.                     if(SkillCanUse(%TrueClientId, "#compass"))
  793.                     {
  794.                         %mpos = GetNearestZone(%TrueClientId, %cropped, 4);
  795.                        
  796.                         if(%mpos !$= false && (%cropped $= "town" || %cropped $= "dungeon"))    // only allow town and dungeon queries.
  797.                         {
  798.                             %d = GetNESW(%TrueClientId.player.getPosition(), %mpos);
  799.                             UseSkill(%TrueClientId, $SkillSenseHeading, true, true);
  800.                            
  801.                             messageClient(%TrueClientId, 'RPGchatCallback', "The nearest " @ %cropped @ " is " @ %d @ " of here.");
  802.                         }
  803.                         else {
  804.                             messageClient(%TrueClientId, 1, "Error finding a zone!");
  805.                         }
  806.                     }
  807.                     else
  808.                     {
  809.                         messageClient(%TrueClientId, 'RPGchatCallback', "You can't use your compass because you lack the necessary skills.");
  810.                         UseSkill(%TrueClientId, $SkillSenseHeading, false, true);
  811.                     }
  812.                 }
  813.                
  814.                 return;
  815.                
  816.             case "#getinfo":
  817.                 %cropped = %cropped;
  818.                
  819.                 if(%cropped $= "") {
  820.                     messageClient(%TrueClientId, 'RPGchatCallback', "Please specify a name.");
  821.                 }
  822.                 else
  823.                 {
  824.                     %id = getClientByName(%cropped);
  825.                    
  826.                     if(%id !$= -1) {
  827.                         DisplayGetInfo(%TrueClientId, %id);
  828.                     }
  829.                     else {
  830.                         messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  831.                     }
  832.                 }
  833.                
  834.                 return;
  835.                
  836.             case "#setinfo":
  837.                 if(%cropped $= "") {
  838.                     messageClient(%TrueClientId, 'RPGchatCallback', "Please specify text.");
  839.                 }
  840.                 else
  841.                 {
  842.                     storeData(%TrueClientId, "PlayerInfo", %cropped);
  843.                     messageClient(%TrueClientId, 'RPGchatCallback', "Info set.  Use #getinfo [name] to retrieve this type of information.");
  844.                 }
  845.                
  846.                 return;
  847.                
  848.             case "#addinfo":
  849.                 if(%cropped $= "") {
  850.                     messageClient(%TrueClientId, 'RPGchatCallback', "Please specify text.");
  851.                 }
  852.                 else
  853.                 {
  854.                     storeData(%TrueClientId, "PlayerInfo", %cropped, "strinc");
  855.                     messageClient(%TrueClientId, 'RPGchatCallback', "Info added to the end of previous info.");
  856.                 }
  857.                
  858.                 return;
  859.                
  860.             case "#w" or "#whatis":
  861.            
  862.                 %item = %cropped;
  863.                
  864.                 if(%item $= "") {
  865.                     messageClient(%TrueClientId, 'RPGchatCallback', "Please specify an item (ex: Small Rock = SmallRock).");
  866.                 }
  867.                 else
  868.                 {
  869.                     %msg = WhatIs(%item);
  870.                    
  871.                     if(%msg !$= "") {
  872.                         sendRPGbottomprint(%TrueClientId, mfloor(strlen(%msg) / 10)+1, Getword(%msg, 0), getwords(%msg, 1));
  873.                     }
  874.                 }
  875.                
  876.                 return;
  877.                
  878.             case "#spell" or "#cast":
  879.            
  880.                 if(fetchData(%TrueClientId, "SpellCastStep") $= 1) {
  881.                     messageClient(%TrueClientId, 'RPGchatCallback', "You are already casting a spell!");
  882.                 }
  883.                 else if(fetchData(%TrueClientId, "SpellCastStep") $= 2) {
  884.                     messageClient(%TrueClientId, 'RPGchatCallback', "You are still recovering from your last spell cast.");
  885.                 }
  886.                 else if(%TrueClientId.sleepMode !$= "" && %TrueClientId.sleepMode !$= false) {
  887.                     messageClient(%TrueClientId, 'RPGchatCallback', "You can not cast a spell while sleeping or meditating.");
  888.                 }
  889.                 else if(IsDead(%TrueClientId)) {
  890.                     messageClient(%TrueClientId, 'RPGchatCallback', "You can not cast a spell when dead.");
  891.                 }
  892.                 else if(inArenaRoster(%TrueClientID))
  893.                 {
  894.                     messageClient(%TrueClientId, 'RPGchatCallback', "Some force is preventing you to cast a spell in this area. Wait till you enter the arena!");
  895.                 }
  896.                 else
  897.                 {
  898.                     if(%cropped $= "") {
  899.                         messageClient(%TrueClientId, 'RPGchatCallback', "Specify a spell.");
  900.                     }
  901.                     else
  902.                     {
  903.                         if(fetchdata(%client, "Mana") >= $spelldata[%cropped, Cost])
  904.                         {
  905.                             if(SkillCanUse(%TrueclientId, getword(%cropped, 0))) {
  906.                                 BeginCastSpell(%TrueClientId, %cropped);
  907.                             }
  908.                             else {
  909.                                 messageClient(%TrueClientId, 'RPGchatCallback', "You do not have the required skill for this spell. " @ $skillDesc[$spelldata[GetWord(%cropped, 0), Skill]] @ ":" @ GetWord($skillRestriction[GetWord(%cropped, 0)],1));
  910.                             }
  911.                         }
  912.                         else {
  913.                             messageClient(%TrueClientId, 'RPGchatCallback', "You do not have the required amount of mana for this spell");
  914.                         }
  915.                     }
  916.                 }
  917.                
  918.                 return;
  919.                
  920.             case "#recall":
  921.                 if(inarena(%Trueclientid)) {
  922.                     return;
  923.                 }
  924.                
  925.                 %zvel = mfloor(getWord(%TrueClientId.player.getVelocity, 2));
  926.                 messageClient(%TrueClientId, 'RPGchatCallback', "ATTEMPTING RECALL");
  927.                
  928.                 if(%zvel <= -350 || %zvel >= 350)
  929.                 {
  930.                     FellOffMap(%TrueClientId);
  931.                     CheckAndBootFromArena(%TrueClientId);
  932.                    
  933.                     %zv = "PASS";
  934.                 }
  935.                 else {
  936.                     %zv = "FAIL";
  937.                 }
  938.                
  939.                 messageClient(%TrueClientId, 'RPGchatCallback', "Z-Velocity check: " @ %zv);
  940.                
  941.                 if(%zv !$= "PASS" && !fetchData(%TrueClientId, "tmprecall"))
  942.                 {
  943.                     %seconds = $recallDelay;
  944.                     storeData(%TrueClientId, "tmprecall", true);
  945.                     %client.recall = schedule(%seconds * 1000, 0, "checkrecall", %TrueClientId, %TrueClientID.player.GetPosition());
  946.                     messageClient(%TrueClientId, 'RPGchatCallback', "Stay at your current position for the next " @ %seconds @ " seconds to recall.");
  947.                    
  948.                 }
  949.                
  950.                 return;
  951.                
  952.             case "#track":
  953.            
  954.                 //%cropped = GetWord(%cropped, 0);
  955.                
  956.                 if(%cropped $= "") {
  957.                     messageClient(%TrueClientId, 'RPGchatCallback', "Please specify a name.");
  958.                 }
  959.                 else
  960.                 {
  961.                     if(SkillCanUse(%TrueClientId, "#track"))
  962.                     {
  963.                         %id = getClientByName(%cropped);
  964.                        
  965.                         if(%id !$= -1)
  966.                         {
  967.                             %clientpos = %TrueClientId.player.getPosition();
  968.                             %idpos = %id.player.getPosition();
  969.                            
  970.                             %dist = round(VectorDist(%clientpos, %idpos));
  971.                            
  972.                             if(Cap(%TrueClientId.PlayerSkill[$Skill::SenseHeading] * 7.5, 100, "inf") >= %dist)
  973.                             {
  974.                                 %d = GetNESW(%clientpos, %idpos);
  975.                                 messageClient(%TrueClientId, 'RPGchatCallback', %cropped @ " is " @ %d @ " of here, " @ %dist @ " meters away.");
  976.                                 UseSkill(%TrueClientId, $Skill::SenseHeading, true, true);
  977.                                
  978.                                 if(%dist <= 10) {
  979.                                     Client::unhide(%id);    //counter counter!
  980.                                 }
  981.                             }
  982.                             else
  983.                             {
  984.                                 messageClient(%TrueClientId, 'RPGchatCallback', %cropped @ " is too far from you to track with your current sense heading skills.");
  985.                                 UseSkill(%TrueClientId, $Skill::SenseHeading, false, true);
  986.                             }
  987.                         }
  988.                         else {
  989.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  990.                         }
  991.                     }
  992.                     else
  993.                     {
  994.                         messageClient(%TrueClientId, 'RPGchatCallback', "You can't track because you lack the necessary skills.");
  995.                         UseSkill(%TrueClientId, $Skill::SenseHeading, false, true);
  996.                     }
  997.                 }
  998.                
  999.                 return;
  1000.                
  1001.             case "#trackpack":
  1002.                 return;
  1003.                 %cropped = GetWord(%cropped, 0);
  1004.                
  1005.                 if(%cropped $= "") {
  1006.                     messageClient(%TrueClientId, 'RPGchatCallback', "Please specify a name.");
  1007.                 }
  1008.                 else
  1009.                 {
  1010.                     if(SkillCanUse(%TrueClientId, "#trackpack"))
  1011.                     {
  1012.                         %id = getClientByName(%cropped);
  1013.                        
  1014.                         if(%id !$= -1)
  1015.                         {
  1016.                             %cropped = %id.nameBase;    //properly capitalize name
  1017.                            
  1018.                             %closest = 5000000;
  1019.                             %closestId = -1;
  1020.                             %clientpos = %TrueClientId.player.getPosition();
  1021.                             %list = fetchData(%id, "lootbaglist");
  1022.                            
  1023.                             for(%i = strstr(%list, ","); strstr(%list, ",") !$= -1; %list = getsubstr(%list, %i+1, 99999))
  1024.                             {
  1025.                                 %id = getsubstr(%list, 0, %i);
  1026.                                 %idpos = %id.player.getPosition();
  1027.                                 %dist = round(VectorDist(%clientpos, %idpos));
  1028.                                
  1029.                                 if(%dist < %closest)
  1030.                                 {
  1031.                                     %closest = %dist;
  1032.                                     %closestId = %id;
  1033.                                 }
  1034.                             }
  1035.                            
  1036.                             if(%closestId !$= -1)
  1037.                             {
  1038.                                 %idpos = %closestId.player.getPosition();
  1039.                                
  1040.                                 if(Cap(%TrueClientId.PlayerSkill[$SkillSenseHeading] * 15, 100, "inf") >= %closest)
  1041.                                 {
  1042.                                     %d = GetNESW(%clientpos, %idpos);
  1043.                                     messageClient(%TrueClientId, 'RPGchatCallback', %cropped @ "'s nearest backpack is " @ %d @ " of here, " @ %closest @ " meters away.");
  1044.                                     UseSkill(%TrueClientId, $SkillSenseHeading, true, true);
  1045.                                 }
  1046.                                 else
  1047.                                 {
  1048.                                     messageClient(%TrueClientId, 'RPGchatCallback', %cropped @ "'s nearest backpack is too far from you to track with your current sense heading skills.");
  1049.                                     UseSkill(%TrueClientId, $SkillSenseHeading, false, true);
  1050.                                 }
  1051.                             }
  1052.                             else
  1053.                             {
  1054.                                 messageClient(%TrueClientId, 'RPGchatCallback', %cropped @ " doesn't have any dropped backpacks.");
  1055.                                 UseSkill(%TrueClientId, $SkillSenseHeading, false, true);
  1056.                             }
  1057.                         }
  1058.                         else {
  1059.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  1060.                         }
  1061.                     }
  1062.                     else
  1063.                     {
  1064.                         messageClient(%TrueClientId, 'RPGchatCallback', "You can't track a backpack because you lack the necessary skills.");
  1065.                         UseSkill(%TrueClientId, $SkillSenseHeading, false, true);
  1066.                     }
  1067.                 }
  1068.                
  1069.                 return;
  1070.                
  1071.             case "#sharepack":
  1072.                 return;
  1073.                 %time = getTime();
  1074.                
  1075.                 if(%time - %TrueClientId.lastSharePackTime > 5)
  1076.                 {
  1077.                     %TrueClientId.lastSharePackTime = %time;
  1078.                    
  1079.                     %c1 = GetWord(%cropped, 0);
  1080.                     %c2 = GetWord(%cropped, 1);
  1081.                    
  1082.                     if(%c1 !$= -1 && %c2 !$= -1)
  1083.                     {
  1084.                         %id = getClientByName(%c1);
  1085.                        
  1086.                         if(%id !$= -1 && %id.nameBase !$= %senderName)
  1087.                         {
  1088.                             %c1 = %id.nameBase; //properly capitalize name
  1089.                            
  1090.                             if(mfloor(%c2) !$= 0 || %c2 $= "*")
  1091.                             {
  1092.                                 %flag = "";
  1093.                                 %cnt = 0;
  1094.                                 %list = fetchData(%TrueClientId, "lootbaglist");
  1095.                                
  1096.                                 for(%i = strstr(%list, ","); strstr(%list, ",") !$= -1; %list = getsubstr(%list, %i+1, 99999))
  1097.                                 {
  1098.                                     %cnt++;
  1099.                                     %bid = getsubstr(%list, 0, %i);
  1100.                                    
  1101.                                     if(%cnt $= %c2 || %c2 $= "*")
  1102.                                     {
  1103.                                         %flag++;
  1104.                                        
  1105.                                         %nl = GetWord($loot[%bid], 1);
  1106.                                        
  1107.                                         if(%nl !$= "*")
  1108.                                         {
  1109.                                             $loot[%bid] = strreplace($loot[%bid], %nl, AddToCommaList(%nl, %c1));
  1110.                                             messageClient(%TrueClientId, 'RPGchatCallback', "Adding " @ %c1 @ " to backpack #" @ %cnt @ " (" @ %bid @ ")'s share list.");
  1111.                                             messageClient(%id, 'RPGchatCallback', %TCsenderName @ " is sharing his/her backpack #" @ %cnt @ " with you.");
  1112.                                         }
  1113.                                         else {
  1114.                                             messageClient(%TrueClientId, 'RPGchatCallback', "Backpack #" @ %cnt @ " is already publicly available.");
  1115.                                         }
  1116.                                     }
  1117.                                 }
  1118.                                
  1119.                                 if(%flag $= "") {
  1120.                                     messageClient(%TrueClientId, 'RPGchatCallback', "Invalid backpack number.");
  1121.                                 }
  1122.                             }
  1123.                             else {
  1124.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Please specify a backpack number (1, 2, 3, etc, or * for all)");
  1125.                             }
  1126.                         }
  1127.                         else {
  1128.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name or same player name.");
  1129.                         }
  1130.                     }
  1131.                     else {
  1132.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name & data.");
  1133.                     }
  1134.                 }
  1135.                
  1136.                 return;
  1137.                
  1138.             case "#unsharepack":
  1139.                 return;
  1140.                 %c1 = GetWord(%cropped, 0);
  1141.                 %c2 = GetWord(%cropped, 1);
  1142.                
  1143.                 if(%c1 !$= -1 && %c2 !$= -1)
  1144.                 {
  1145.                     %id = getClientByName(%c1);
  1146.                    
  1147.                     if(%id !$= -1 && %id.nameBase !$= %senderName)
  1148.                     {
  1149.                         %c1 = %id.nameBase; //properly capitalize name
  1150.                        
  1151.                         if(mfloor(%c2) !$= 0 || %c2 $= "*")
  1152.                         {
  1153.                             %flag = "";
  1154.                             %cnt = 0;
  1155.                             %list = fetchData(%TrueClientId, "lootbaglist");
  1156.                            
  1157.                             for(%i = strstr(%list, ","); strstr(%list, ",") !$= -1; %list = getsubstr(%list, %i+1, 99999))
  1158.                             {
  1159.                                 %cnt++;
  1160.                                 %bid = getsubstr(%list, 0, %i);
  1161.                                
  1162.                                 if(%cnt $= %c2 || %c2 $= "*")
  1163.                                 {
  1164.                                     %flag++;
  1165.                                    
  1166.                                     %nl = GetWord($loot[%bid], 1);
  1167.                                    
  1168.                                     if(%nl !$= "*")
  1169.                                     {
  1170.                                         $loot[%bid] = strreplace($loot[%bid], %nl, RemoveFromCommaList(%nl, %c1));
  1171.                                         messageClient(%TrueClientId, 'RPGchatCallback', "Removing " @ %c1 @ " from backpack #" @ %cnt @ " (" @ %bid @ ")'s share list.");
  1172.                                         messageClient(%id, 'RPGchatCallback', %TCsenderName @ " has removed you from his/her backpack #" @ %cnt @ " share list.");
  1173.                                     }
  1174.                                     else {
  1175.                                         messageClient(%TrueClientId, 'RPGchatCallback', "Backpack #" @ %cnt @ " is already publicly available.  Its share list can not be changed.");
  1176.                                     }
  1177.                                 }
  1178.                             }
  1179.                            
  1180.                             if(%flag $= "") {
  1181.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Invalid backpack number.");
  1182.                             }
  1183.                         }
  1184.                         else {
  1185.                             messageClient(%TrueClientId, 'RPGchatCallback', "Please specify a backpack number (1, 2, 3, etc, or * for all)");
  1186.                         }
  1187.                     }
  1188.                     else {
  1189.                         messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name or same player name.");
  1190.                     }
  1191.                 }
  1192.                 else {
  1193.                     messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name & data.");
  1194.                 }
  1195.                
  1196.                 return;
  1197.                
  1198.             case "#packsummary":
  1199.                 return;
  1200.                
  1201.                 if(%clientToServerAdminLevel >= 1)
  1202.                 {
  1203.                     if(%cropped !$= "")
  1204.                     {
  1205.                         %id = getClientByName(%cropped);
  1206.                         %cropped = %id.nameBase;    //properly capitalize name
  1207.                        
  1208.                         %cnt = mfloor(CountObjInCommaList(fetchData(%id, "lootbaglist")));
  1209.                         messageClient(%TrueClientId, 'RPGchatCallback', %cropped @ " has " @ %cnt @ " dropped backpacks.");
  1210.                     }
  1211.                     else
  1212.                     {
  1213.                         %list = GetPlayerIdList();
  1214.                        
  1215.                         for(%i = 0; (%id = GetWord(%list, %i)) !$= ""; %i++)
  1216.                         {
  1217.                             %cnt = CountObjInCommaList(fetchData(%id, "lootbaglist"));
  1218.                            
  1219.                             if(%cnt > 0) {
  1220.                                 messageClient(%TrueClientId, 'RPGchatCallback', %id.nameBase @ " has " @ %cnt @ " dropped backpacks.");
  1221.                             }
  1222.                         }
  1223.                     }
  1224.                 }
  1225.                 else if(%cropped $= "")
  1226.                 {
  1227.                     %cnt = mfloor(CountObjInCommaList(fetchData(%TrueClientId, "lootbaglist")));
  1228.                     messageClient(%TrueClientId, 'RPGchatCallback', "You have a total of " @ %cnt @ " currently dropped backpacks.");
  1229.                 }
  1230.                
  1231.                 return;
  1232.                
  1233.             case "#mypassword":
  1234.                 return; //no password for characters!
  1235.                 %c1 = GetWord(%cropped, 0);
  1236.                
  1237.                 if(%c1 !$= -1)
  1238.                 {
  1239.                     storeData(%TrueClientId, "password", %c1);
  1240.                     messageClient(%TrueClientId, 'RPGchatCallback', "Changed personal password to " @ fetchData(%TrueClientId, "password") @ ".");
  1241.                 }
  1242.                 else {
  1243.                     messageClient(%TrueClientId, 'RPGchatCallback', "Please specify a one-word password.");
  1244.                 }
  1245.                
  1246.                 return;
  1247.                
  1248.             case "#sleep":
  1249.            
  1250.                 //return; //BROKEN will be fixed later
  1251.                 if(fetchData(%TrueClientId, "InSleepZone") == true && %TrueClientId.sleepMode $= "" && !IsDead(%TrueClientId)) {
  1252.                     %flag = true;
  1253.                 }
  1254.                
  1255.                 echo(fetchData(%trueclientid, "InSleepZone"));
  1256.                
  1257.                 if(%flag)
  1258.                 {
  1259.                     %TrueClientId.sleepMode = 1;
  1260.                     %TrueClientId.camera.setTransform(%transform);
  1261.                     %TrueClientId.camera.client = %clientid;
  1262.                     %TrueClientId.camera.setOrbitMode(%TrueClientId.player, %TrueClientId.player.getTransform(), 0.5, 4.5, 4.5);
  1263.                     %TrueClientId.setControlObject(%TrueClientId.camera);
  1264.                     refreshHPREGEN(%TrueClientId);
  1265.                     refreshMANAREGEN(%TrueClientId);
  1266.                    
  1267.                     messageClient(%TrueClientId, 'RPGchatCallback', "You fall asleep...  Use #wake to wake up.");
  1268.                 }
  1269.                 else {
  1270.                     messageClient(%TrueClientId, 'RPGchatCallback', "You can't seem to fall asleep here.");
  1271.                 }
  1272.                
  1273.                 return;
  1274.                
  1275.             case "#meditate":
  1276.                 if(%TrueClientId.sleepMode $= "" && !IsDead(%TrueClientId) && $possessedBy[%TrueClientId].possessId !$= %TrueClientId)
  1277.                 {
  1278.                     %TrueClientId.sleepMode = 2;
  1279.                     %transform = %TrueClientId.player.getTransform();
  1280.                    
  1281.                     //note, AI's don't have a camera...
  1282.                     if(isObject(%TrueClientId.camera))
  1283.                     {
  1284.                         %TrueClientId.camera.setTransform(%transform);
  1285.                         %TrueClientId.camera.client = %clientid;
  1286.                         %TrueClientId.camera.setOrbitMode(%TrueClientId.player, %TrueClientId.player.getTransform(), 0.5, 4.5, 4.5);
  1287.                         %TrueClientId.setControlObject(%TrueClientId.camera);
  1288.                     }
  1289.                    
  1290.                     //Client::setControlObject(%TrueClientId, Client::getObserverCamera(%TrueClientId));
  1291.                     //Observer::setOrbitObject(%TrueClientId, Client::getOwnedObject(%TrueClientId), 30, 30, 30);
  1292.                     refreshHPREGEN(%TrueClientId);
  1293.                     refreshMANAREGEN(%TrueClientId);
  1294.                    
  1295.                     messageClient(%TrueClientId, 'RPGchatCallback', "You begin to meditate.  Use #wake to stop meditating.");
  1296.                 }
  1297.                 else {
  1298.                     messageClient(%TrueClientId, 'RPGchatCallback', "You can't seem to meditate.");
  1299.                 }
  1300.                
  1301.                 return;
  1302.                
  1303.             case "#wake":
  1304.                 if(%TrueClientId.sleepMode !$= "")
  1305.                 {
  1306.                     %TrueClientId.sleepMode = "";
  1307.                     %TrueClientId.setControlObject(%TrueClientId.player);
  1308.                     refreshHPREGEN(%TrueClientId);
  1309.                     refreshMANAREGEN(%TrueClientId);
  1310.                    
  1311.                     messageClient(%TrueClientId, 'RPGchatCallback', "You awaken.");
  1312.                 }
  1313.                 else {
  1314.                     messageClient(%TrueClientId, 'RPGchatCallback', "You are not sleeping or meditating.");
  1315.                 }
  1316.                
  1317.                 return;
  1318.                
  1319.             case "#roll":
  1320.                 %c1 = GetWord(%cropped, 0);
  1321.                
  1322.                 if(%c1 !$= -1) {
  1323.                     messageClient(%TrueClientId, 'RPGchatCallback', %c1 @ ": " @ GetRpgRoll(%c1));
  1324.                 }
  1325.                 else {
  1326.                     messageClient(%TrueClientId, 'RPGchatCallback', "Please specify a roll (example: 1d6)");
  1327.                 }
  1328.                
  1329.                 return;
  1330.                
  1331.             case "#hide":
  1332.            
  1333.                 if(SkillCanUse(%TrueClientId, "#hide"))
  1334.                 {
  1335.                     if(!fetchData(%TrueClientId, "invisible") && !fetchData(%TrueClientId, "blockHide") && %Trueclientid.lasthide + 5000 < getSimTime())
  1336.                     {
  1337.                         %closeEnoughToWall = Cap(%TrueClientId.PlayerSkill[$SkillHiding] / 125, 3.5, 8);
  1338.                        
  1339.                         %pos = %TrueClientId.player.getPosition();
  1340.                        
  1341.                         %closest = 10000;
  1342.                        
  1343.                         for(%i = 0; %i <= 6.283; %i+= 0.52)
  1344.                         {
  1345.                             getLOSinfo(%TrueClientId, 25, "", "0 0 " @ %i);
  1346.                             %dist = VectorDist(%pos, $los::position);
  1347.                            
  1348.                             if(%dist < %closest && $los::position !$= "0 0 0" && $los::position !$= "") {
  1349.                                 %closest = %dist;
  1350.                             }
  1351.                         }
  1352.                        
  1353.                         if(%closest <= %closeEnoughToWall)
  1354.                         {
  1355.                             messageClient(%TrueClientId, 'RPGchatCallback', "You are successful at Hide In Shadows.");
  1356.                            
  1357.                             Client::hide(%TrueClientID);
  1358.                             //GameBase::startFadeOut(%TrueClientId);
  1359.                             //storeData(%TrueClientId, "invisible", true);
  1360.                            
  1361.                             %grace = Cap(%TrueClientId.PlayerSkill[$SkillHiding] / 20, 5, 100);
  1362.                             WalkSlowInvisLoop(%TrueClientId, 5, %grace);
  1363.                             %Trueclientid.lasthide = getSimTime();
  1364.                             UseSkill(%TrueClientId, $Skill::Hiding, true, true);
  1365.                         }
  1366.                         else
  1367.                         {
  1368.                             messageClient(%TrueClientId, 'RPGchatCallback', "You were unsuccessful at Hide In Shadows.");
  1369.                             UseSkill(%TrueClientId, $Skill::Hiding, false, true);
  1370.                         }
  1371.                     }
  1372.                 }
  1373.                 else
  1374.                 {
  1375.                     messageClient(%TrueClientId, 'RPGchatCallback', "You can't hide because you lack the necessary skills.");
  1376.                     //UseSkill(%TrueClientId, $Skill::Hiding, false, true);
  1377.                 }
  1378.                
  1379.                 return;
  1380.                
  1381.             case "#bash":
  1382.            
  1383.                 if(SkillCanUse(%TrueClientId, "#bash"))
  1384.                 {
  1385.                     if(!(fetchdata(%trueClientId, "NextHitBash") || fetchdata(%trueClientId, "blockBash")))
  1386.                     {
  1387.                         messageClient(%TrueClientId, 'RPGchatCallback', "You are ready to bash!");
  1388.                         storeData(%TrueClientId, "NextHitBash", true);
  1389.                         storeData(%TrueClientId, "blockBash", true);
  1390.                     }
  1391.                     else if(fetchdata(%TrueClientId, "NextHitBash")) {
  1392.                         messageClient(%TrueClientId, 'RPGchatCallback', "You are already ready to bash");
  1393.                     }
  1394.                     else {
  1395.                         messageClient(%TrueClientId, 'RPGchatCallback', "You are too tired to bash again, wait a bit");
  1396.                     }
  1397.                 }
  1398.                 else
  1399.                 {
  1400.                     messageClient(%TrueClientId, 'RPGchatCallback', "You can't bash because you lack the necessary skills.");
  1401.                     //UseSkill(%TrueClientId, $SkillBashing, false, true);
  1402.                 }
  1403.                
  1404.                 return;
  1405.                
  1406.             case "#disrupt":
  1407.                 if(SkillCanUse(%TrueClientId, "#disrupt"))
  1408.                 {
  1409.                     if(!(fetchdata(%TrueClientId, "NextHitDisrupt") || fetchdata(%TrueClientId, "BlockDisrupt")))
  1410.                     {
  1411.                    
  1412.                         storedata(%TrueClientId, "NextHitDisrupt", true);
  1413.                         storedata(%TrueClientId, "blockdisrupt", true);
  1414.                         messageClient(%TrueClientID, 'RPGchatCallback', "You are ready to disrupt!");
  1415.                        
  1416.                     }
  1417.                     else if(fetchdata(%TrueClientId, "NextHitDisrupt")) {
  1418.                         messageClient(%TrueClientId, 'RPGchatCallback', "You are already ready to disrupt.");
  1419.                     }
  1420.                     else {
  1421.                         messageClient(%TrueClientId, 'RPGchatCallback', "You are too tired to Disrupt again, wait a bit");
  1422.                     }
  1423.                    
  1424.                    
  1425.                 }
  1426.                 else {
  1427.                     messageClient(%TrueClientId, 'RPGchatCallback', "You can't Disrupt because you lack the necessary skills.");
  1428.                 }
  1429.                
  1430.             case "#focus":
  1431.            
  1432.                 if(SkillCanUse(%TrueClientId, "#focus"))
  1433.                 {
  1434.                     if(!(fetchdata(%trueClientId, "NextHitFocus") || fetchdata(%trueClientId, "blockFocus")))
  1435.                     {
  1436.                         messageClient(%TrueClientId, 'RPGchatCallback', "You focus your energy!");
  1437.                         storeData(%TrueClientId, "NextHitFocus", true);
  1438.                         storeData(%TrueClientId, "blockFocus", true);
  1439.                     }
  1440.                     else if(fetchdata(%TrueClientId, "NextHitFocus")) {
  1441.                         messageClient(%TrueClientId, 'RPGchatCallback', "You are already focused.");
  1442.                     }
  1443.                     else {
  1444.                         messageClient(%TrueClientId, 'RPGchatCallback', "You are too strained to focus, wait a bit.");
  1445.                     }
  1446.                 }
  1447.                 else
  1448.                 {
  1449.                     messageClient(%TrueClientId, 'RPGchatCallback', "You can't focus because you lack the necessary skills.");
  1450.                     //UseSkill(%TrueClientId, $SkillBashing, false, true);
  1451.                 }
  1452.                
  1453.                 return;
  1454.                
  1455.             case "#cleave":
  1456.            
  1457.                 if(SkillCanUse(%TrueClientId, "#cleave"))
  1458.                 {
  1459.                     if(!(fetchdata(%trueClientId, "NextHitCleave") || fetchdata(%trueClientId, "blockCleave")))
  1460.                     {
  1461.                         messageClient(%TrueClientId, 'RPGchatCallback', "You are ready to Cleave!");
  1462.                         storeData(%TrueClientId, "NextHitCleave", true);
  1463.                         storeData(%TrueClientId, "blockCleave", true);
  1464.                     }
  1465.                     else if(fetchdata(%TrueClientId, "NextHitCleave")) {
  1466.                         messageClient(%TrueClientId, 'RPGchatCallback', "You are already ready to cleave.");
  1467.                     }
  1468.                     else {
  1469.                         messageClient(%TrueClientId, 'RPGchatCallback', "You are too tired to cleave again, wait a bit");
  1470.                     }
  1471.                 }
  1472.                 else
  1473.                 {
  1474.                     messageClient(%TrueClientId, 'RPGchatCallback', "You can't cleave because you lack the necessary skills.");
  1475.                     //UseSkill(%TrueClientId, $SkillBashing, false, true);
  1476.                 }
  1477.                
  1478.                 return;
  1479.                
  1480.             case "#shock":
  1481.                 if(SkillCanUse(%TrueClientId, "#shock"))
  1482.                 {
  1483.                
  1484.                
  1485.                
  1486.                
  1487.                 }
  1488.                 else
  1489.                 {
  1490.                     messageClient(%TrueClientID, 'RPGchatCallback', "You can't shock because you lack the necessary skills.");
  1491.                 }
  1492.                
  1493.             case "#stun":
  1494.                 if(SkillCanUse(%TrueClientId, "#stun"))
  1495.                 {
  1496.                     if(!(fetchdata(%trueClientId, "NextHitStun") || fetchdata(%trueClientId, "blockStun")))
  1497.                     {
  1498.                         messageClient(%TrueClientId, 'RPGchatCallback', "You are ready to Stun!");
  1499.                         storeData(%TrueClientId, "NextHitStun", true);
  1500.                         storeData(%TrueClientId, "blockStun", true);
  1501.                     }
  1502.                     else if(fetchdata(%TrueClientId, "NextHitStun")) {
  1503.                         messageClient(%TrueClientId, 'RPGchatCallback', "You are already ready to Stun.");
  1504.                     }
  1505.                     else {
  1506.                         messageClient(%TrueClientId, 'RPGchatCallback', "You are too tired to Stun again, wait a bit");
  1507.                     }
  1508.                    
  1509.                 }
  1510.                 else
  1511.                 {
  1512.                     messageClient(%TrueClientID, 'RPGchatCallback', "You can't stun because you lack the necessary skills.");
  1513.                 }
  1514.                
  1515.             case "#targetleg":
  1516.                 if(SkillCanUse(%TrueClientId, "#targetleg"))
  1517.                 {
  1518.                     if(!(fetchdata(%trueClientId, "NextHitLeg") || fetchdata(%trueClientId, "blockLeg")))
  1519.                     {
  1520.                         messageClient(%TrueClientId, 'RPGchatCallback', "You are ready to Target Leg!");
  1521.                         storeData(%TrueClientId, "NextHitLeg", true);
  1522.                         storeData(%TrueClientId, "blockLeg", true);
  1523.                     }
  1524.                     else if(fetchdata(%TrueClientId, "NextHitLeg")) {
  1525.                         messageClient(%TrueClientId, 'RPGchatCallback', "You are already ready to Target Leg.");
  1526.                     }
  1527.                     else {
  1528.                         messageClient(%TrueClientId, 'RPGchatCallback', "You are too tired to Target Leg again, wait a bit");
  1529.                     }
  1530.                 }
  1531.                 else
  1532.                 {
  1533.                     MessageClient(%trueClientId, 'RPGchatCallBack', "You can't target leg because you lack the necessary skills.");
  1534.                 }
  1535.                
  1536.             case "#encumber":
  1537.            
  1538.                 if(SkillCanUse(%TrueClientId, "#encumber"))
  1539.                 {
  1540.                     if(!(fetchdata(%trueClientId, "NextHitencumber") || fetchdata(%trueClientId, "blockEncumber")))
  1541.                     {
  1542.                         messageClient(%TrueClientId, 'RPGchatCallback', "You are ready to Encumber!");
  1543.                         storeData(%TrueClientId, "NextHitencumber", true);
  1544.                         storeData(%TrueClientId, "blockencumber", true);
  1545.                     }
  1546.                     else if(fetchdata(%TrueClientId, "NextHitEncumber")) {
  1547.                         messageClient(%TrueClientId, 'RPGchatCallback', "You are already ready to Encumber.");
  1548.                     }
  1549.                     else {
  1550.                         messageClient(%TrueClientId, 'RPGchatCallback', "You are too tired to Encumber again, wait a bit");
  1551.                     }
  1552.                 }
  1553.                 else
  1554.                 {
  1555.                     MessageClient(%trueClientId, 'RPGchatCallBack', "You can't encumber because you lack the necessary skills.");
  1556.                 }
  1557.                
  1558.             case "#backstab":
  1559.            
  1560.                 if(SkillCanUse(%TrueClientId, "#backstab"))
  1561.                 {
  1562.                     if(!(fetchdata(%trueClientId, "NextHitBackStab") || fetchdata(%trueClientId, "BlockBackStab")))
  1563.                     {
  1564.                         messageClient(%TrueClientId, 'RPGchatCallback', "You are ready to backstab!");
  1565.                         storeData(%TrueClientId, "NextHitBackStab", true);
  1566.                         storeData(%TrueClientId, "blockBackStab", true);
  1567.                     }
  1568.                     else if(fetchdata(%TrueClientId, "NextHitBackStab")) {
  1569.                         messageClient(%TrueClientId, 'RPGchatCallback', "You are already ready to backstab.");
  1570.                     }
  1571.                     else {
  1572.                         messageClient(%TrueClientId, 'RPGchatCallback', "You are too tired to backstab again, wait a bit");
  1573.                     }
  1574.                 }
  1575.                 else
  1576.                 {
  1577.                     messageClient(%TrueClientId, 'RPGchatCallback', "You can't backstab because you lack the necessary skills.");
  1578.                     //UseSkill(%TrueClientId, $SkillBashing, false, true);
  1579.                 }
  1580.                
  1581.                 return;
  1582.                
  1583.             case "#surge":
  1584.                 if(SkillCanUse(%TrueClientId, "#surge"))
  1585.                 {
  1586.                     if(!(fetchdata(%TrueClientId, "blockSurge")))
  1587.                     {
  1588.                         //storedata(%TrueClientId, "Surge", true);
  1589.                         AddBonusState(%TrueClientId, "12 10", 5, "Surge");
  1590.                         storedata(%TrueClientId, "BlockSurge", true);
  1591.                         weightcall(%TrueClientId, false);
  1592.                         debugBonusState(%TrueClientId);
  1593.                         schedule(5000, %client, "endsurge", %client);
  1594.                         messageClient(%TrueClientid, 'RPGchatCallback', "You begin to surge!");
  1595.                        
  1596.                     }
  1597.                     else {
  1598.                         messageClient(%TrueClientId, 'RPGchatCallback', "You are too tired to boost your speed.");
  1599.                     }
  1600.                    
  1601.                 }
  1602.                 else {
  1603.                     messageClient(%TrueClientId, 'RPGchatCallback', "You can't surge because you lack the necessary skills.");
  1604.                 }
  1605.                
  1606.             case "#berserk":
  1607.                 if(SkillCanuse(%trueclientid, "#berserk"))
  1608.                 {
  1609.                     if(!(fetchdata(%TrueClientId, "blockberserk") || fetchdata(%TrueClientId, "Surge")))
  1610.                     {
  1611.                         storedata(%TrueClientId, "Surge", true);
  1612.                         weightcall(%TrueClientId, false);
  1613.                         storedata(%TrueClientId, "BlockBerserk", true);
  1614.                         schedule(5000, %client, "endberserk", %client);
  1615.                         messageClient(%TrueClientId, 'RPGchatCallBack', "You go Berserk!");
  1616.                     }
  1617.                    
  1618.                 }
  1619.                 else {
  1620.                     messageClient(%TrueClientId, 'RPGchatCallback', "You can't berserk because you lack the necessary skills.");
  1621.                 }
  1622.                
  1623.             case "#ignite":
  1624.            
  1625.                 if(SkillCanUse(%TrueClientId, "#ignite"))
  1626.                 {
  1627.                     if(!(fetchdata(%trueClientId, "NextHitignite") || fetchdata(%trueClientId, "Blockignite")))
  1628.                     {
  1629.                         messageClient(%TrueClientId, 'RPGchatCallback', "You light your projectile!");
  1630.                         storeData(%TrueClientId, "NextHitignite", true);
  1631.                         storeData(%TrueClientId, "blockignite", true);
  1632.                     }
  1633.                     else if(fetchdata(%TrueClientId, "NextHitignite")) {
  1634.                         messageClient(%TrueClientId, 'RPGchatCallback', "You are already ready to ignite.");
  1635.                     }
  1636.                     else {
  1637.                         messageClient(%TrueClientId, 'RPGchatCallback', "You are too tired to ignite again, wait a bit");
  1638.                     }
  1639.                 }
  1640.                 else
  1641.                 {
  1642.                     messageClient(%TrueClientId, 'RPGchatCallback', "You can't ignite arrows because you lack the necessary skills.");
  1643.                     //UseSkill(%TrueClientId, $SkillBashing, false, true);
  1644.                 }
  1645.                
  1646.                 return;
  1647.                
  1648.             case "#shove":
  1649.                 %time = getTime();
  1650.                
  1651.                 if(%time - %TrueClientId.lastShoveTime > 1.5)
  1652.                 {
  1653.                     %TrueClientId.lastShoveTime = %time;
  1654.                    
  1655.                     if(SkillCanUse(%TrueClientId, "#shove"))
  1656.                     {
  1657.                         %player = %trueClientId.player;
  1658.                        
  1659.                         if(getLOSinfo(%TrueClientId, 5))
  1660.                         {
  1661.                             %pl = $los::object;
  1662.                             %id = %pl.client;
  1663.                            
  1664.                             if(%TrueClientId.adminLevel > %id.adminLevel || %id.adminLevel < 1 && %id != 0)
  1665.                             {
  1666.                                 %b = %TrueClientId.player.rotation;
  1667.                                 %c1 = Cap(20 + fetchData(%TrueClientId, "LVL"), 0, 250);
  1668.                                 %c2 = %c1 / 4;
  1669.                                 %muzzlevec = %client.player.getMuzzleVector(1);
  1670.                                 %vel = %id.player.getVelocity();
  1671.                                 %mom = GetWord(%muzzlevec, 0)*20+GetWord(%vel, 0) SPC GetWord(%muzzlevec, 1)*20+GetWord(%vel, 1) SPC GetWord(%muzzlevec, 2)*20+GetWord(%vel, 2);
  1672.                                 %id.player.setVelocity(%mom);
  1673.                                
  1674.                             }
  1675.                         }
  1676.                     }
  1677.                     else {
  1678.                         messageClient(%TrueClientId, 'RPGchatCallback', "You can't shove because you lack the necessary skills.");
  1679.                     }
  1680.                 }
  1681.                
  1682.                 return;
  1683.                
  1684.             case "#defaulttalk":
  1685.                 if(%cropped !$= "")
  1686.                 {
  1687.                     storeData(%TrueClientId, "defaultTalk", %cropped);
  1688.                     messageClient(%TrueClientId, 'RPGchatCallback', "Changed Default Talk to " @ fetchData(%TrueClientId, "defaultTalk") @ ".");
  1689.                 }
  1690.                 else {
  1691.                     messageClient(%TrueClientId, 'RPGchatCallback', "Please specify what will be added to the beginning of each of your messages.");
  1692.                 }
  1693.                
  1694.                 return;
  1695.                
  1696.             case "#zonelist":
  1697.                 if(SkillCanUse(%TrueClientId, "#zonelist"))
  1698.                 {
  1699.                     %c1 = GetWord(%cropped, 0);
  1700.                    
  1701.                     if(%c1 !$= -1)
  1702.                     {
  1703.                         if(stricmp(%c1, "all") $= 0) {
  1704.                             %t = 1;
  1705.                         }
  1706.                         else if(stricmp(%c1, "players") $= 0) {
  1707.                             %t = 2;
  1708.                         }
  1709.                         else if(stricmp(%c1, "enemies") $= 0) {
  1710.                             %t = 3;
  1711.                         }
  1712.                        
  1713.                         %list = Zone::getPlayerList(fetchData(%TrueClientId, "zone"), %t);
  1714.                        
  1715.                         if(%list !$= "")
  1716.                         {
  1717.                             for(%i = 0; (%id = GetWord(%list, %i)) !$= ""; %i++) {
  1718.                                 messageClient(%TrueClientId, 'RPGchatCallback', %id.nameBase);
  1719.                             }
  1720.                         }
  1721.                         else {
  1722.                             messageClient(%TrueClientId, 'RPGchatCallback', "[none]");
  1723.                         }
  1724.                     }
  1725.                     else {
  1726.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify 'players', 'enemies', or 'all'");
  1727.                     }
  1728.                 }
  1729.                 else
  1730.                 {
  1731.                     messageClient(%TrueClientId, 'RPGchatCallback', "You can't zonelist because you lack the necessary skills.");
  1732.                     UseSkill(%TrueClientId, $SkillSenseHeading, false, true);
  1733.                 }
  1734.                
  1735.                 return;
  1736.                
  1737.             case "#pickpocket":
  1738.            
  1739.                 %time = getTime();//ok pickpocket will only steal small items, user really wont have a choice to what they steal either unlike tribes rpg.
  1740.                
  1741.                 if(%time - %TrueClientId.lastStealTime > $stealDelay)
  1742.                 {
  1743.                     %TrueClientId.lastStealTime = %time;
  1744.                    
  1745.                     if((%reason = AllowedToSteal(%TrueClientId)) $= "true")
  1746.                     {
  1747.                         if(SkillCanUse(%TrueClientId, "#pickpocket"))
  1748.                         {
  1749.                             if(getLOSinfo(%TrueClientId, 1))
  1750.                             {
  1751.                                 %id = $los::object.client;
  1752.                                 %pos = $los::position;
  1753.                                
  1754.                                 if($los::object.getClassName() $= "Player")
  1755.                                 {
  1756.                                     %damloc = %id.player.getDamageLocation(%pos);
  1757.                                     %tciskill = %TrueClientID.PlayerSkill[$SkillStealing] * 4/5;
  1758.                                     %idskill = %id.playerSkill[$skillStealing];
  1759.                                    
  1760.                                     //echo(%damloc);
  1761.                                     //%TrueClientId.stealType = 1;
  1762.                                     //SetupInvSteal(%TrueClientId, %id);
  1763.                                     //attempt to steal
  1764.                                     %inv = fetchdata(%id, "inventory");
  1765.                                     %num = getwordcount(%inv);
  1766.                                     //randomly select an item
  1767.                                     %itemid = GetWord(%inv, getrandom(0,%num-1));
  1768.                                    
  1769.                                     if(%itemid)
  1770.                                     {
  1771.                                         %item = getItem(%itemid);
  1772.                                        
  1773.                                         if($itemtype[%item] $= "armor" || $itemType[%item] $= "weapon")
  1774.                                         {
  1775.                                             //error cannot steal
  1776.                                             %fail = true;
  1777.                                         }
  1778.                                         else
  1779.                                         {
  1780.                                             %backfront = getword(%damloc, 1);
  1781.                                            
  1782.                                             if(%backfront $= "back_right" || %backfront $= "back" || %backfront $= "back_left" || %backfront $= "middle_back") {
  1783.                                                 %multi = 1;
  1784.                                             }
  1785.                                             else {
  1786.                                                 %multi = 0.5;    //odds of stealing 1/2
  1787.                                             }
  1788.                                            
  1789.                                             if(!id.isAIControlled()) {
  1790.                                                 %oddcalc = %num - 10;
  1791.                                             }
  1792.                                             else {
  1793.                                                 %oddcalc = %num;
  1794.                                             }
  1795.                                            
  1796.                                             if(%oddcalc < 0) {
  1797.                                                 %oddcalc = 0;
  1798.                                             }
  1799.                                            
  1800.                                             %ooddcalc = %oddcalc * %tciskill * %multi;
  1801.                                             %doddcalc = 35 * %idskill + 10;
  1802.                                             %success = getRandom(-%doddcalc, %ooddcalc);
  1803.                                            
  1804.                                             if(%success > 0) {
  1805.                                                 %fail = false;
  1806.                                             }
  1807.                                             else {
  1808.                                                 %fail = true;
  1809.                                             }
  1810.                                         }
  1811.                                        
  1812.                                         echo("PICKPOCKET:" SPC -%doddcalc SPC %ooddcalc SPC %success SPC %tciskill SPC %idskill);
  1813.                                        
  1814.                                         if(!%fail)
  1815.                                         {
  1816.                                             RemoveFromInventory(%id, %itemid);
  1817.                                             AddToInventory(%TrueClientId, %itemid);
  1818.                                             messageClient(%TrueClientId, 'RPGchatCallback', "You sucessfully stole a" SPC GetFullItemName(%itemid));
  1819.                                             MessageClient(%TrueClientID, 'RPGchatcallback', "DEBUG, ODDS TO STEAL:" SPC -%doddcalc SPC " to " SPC %ooddcalc SPC "NUMBER:" SPC %success);
  1820.                                         }
  1821.                                         else
  1822.                                         {
  1823.                                             messageClient(%TrueClientId, 'RPGchatCallback', "You failed to steal from" SPC %id.rpgname @ "!");
  1824.                                             MessageClient(%TrueClientID, 'RPGchatcallback', "DEBUG, ODDS TO STEAL:" SPC -%doddcalc SPC " to " SPC %ooddcalc SPC "NUMBER:" SPC %success);
  1825.                                             messageClient(%id, 'RPGchatCallback', %TrueClientid.rpgname SPC "failed to steal from you!");
  1826.                                             //failed to steal, notify victim? lashback?
  1827.                                         }
  1828.                                        
  1829.                                     }
  1830.                                     else {
  1831.                                         messageClient(%TrueClientId, 'RPGchatCallback', "Your target has no items on him");
  1832.                                     }
  1833.                                 }
  1834.                             }
  1835.                         }
  1836.                         else
  1837.                         {
  1838.                             messageClient(%TrueClientId, 'RPGchatCallback', "You can't pickpocket because you lack the necessary skills.");
  1839.                             UseSkill(%TrueClientId, $SkillStealing, false, true);
  1840.                         }
  1841.                     }
  1842.                     else {
  1843.                         messageClient(%TrueClientId, 'RPGchatCallback', %reason);
  1844.                     }
  1845.                 }
  1846.                
  1847.                 return;
  1848.                
  1849.             case "#mug":
  1850.            
  1851.                 //can steal ANYTHING unequiped at a higher success rate, however player must be in your target list to attempt!
  1852.                 %time = getTime();
  1853.                
  1854.                 if(%time - %TrueClientId.lastStealTime > $stealDelay)
  1855.                 {
  1856.                     %TrueClientId.lastStealTime = %time;
  1857.                    
  1858.                     if(skillcanuse(%TrueClientId, "#mug"))
  1859.                     {
  1860.                         if(fetchdata(%TrueClientId, "NextHitMug"))
  1861.                         {
  1862.                             messageClient(%TrueClientId, 'RPGchatCallback', "You are already ready to mug");
  1863.                         }
  1864.                         else if(fetchdata(%TrueClientId, "blockHitMug"))
  1865.                         {
  1866.                             messageClient(%TrueClientId, 'RPGchatCallback', "You are not ready to mug");
  1867.                         }
  1868.                         else
  1869.                         {
  1870.                             storedata(%TrueClientId, "blockhitmug", true);
  1871.                             storedata(%TrueClientId, "NextHitMug", true);
  1872.                             messageClient(%TrueClientId, 'RPGchatCallback', "You are ready to mug.");
  1873.                            
  1874.                         }
  1875.                        
  1876.                        
  1877.                     }
  1878.                     else {
  1879.                         messageClient(%TrueClientId, 'RPGchatCallback', "You do not have enough skill to mug");
  1880.                     }
  1881.                    
  1882.                 }
  1883.                
  1884.                 return;
  1885.                
  1886.             case "#createpack":
  1887.                 return;
  1888.                
  1889.                 if(fetchData(%TrueClientId, "TempPack") !$= "")
  1890.                 {
  1891.                     if(HasThisStuff(%TrueClientId, fetchData(%TrueClientId, "TempPack")))
  1892.                     {
  1893.                         TakeThisStuff(%TrueClientId, fetchData(%TrueClientId, "TempPack"));
  1894.                         %namelist = %TCsenderName @ ",";
  1895.                         TossLootbag(%TrueClientId, fetchData(%TrueClientId, "TempPack"), 5, %namelist, 0);
  1896.                         RefreshAll(%TrueClientId);
  1897.                        
  1898.                         remotePlayMode(%TrueClientId);
  1899.                     }
  1900.                 }
  1901.                
  1902.                 return;
  1903.                
  1904.             case "#camp":
  1905.                 return;
  1906.                
  1907.                 if(Player::getItemCount(%TrueClientId, Tent))
  1908.                 {
  1909.                     %camp = nameToId("MissionCleanup/Camp" @ %TrueClientId);
  1910.                    
  1911.                     if(%camp $= -1)
  1912.                     {
  1913.                         if(fetchData(%TrueClientId, "zone") $= "")
  1914.                         {
  1915.                             messageClient(%TrueClientId, 'RPGchatCallback', "Setting up camp...");
  1916.                            
  1917.                             %pos = %TrueClientId.player.getPosition();
  1918.                            
  1919.                             Player::decItemCount(%TrueClientId, Tent);
  1920.                             RefreshAll(%TrueClientId);
  1921.                             %group = newObject("Camp" @ %TrueClientId, SimGroup);
  1922.                             addToSet("MissionCleanup", %group);
  1923.                            
  1924.                             schedule(2000, "DoCampSetup(" @ %TrueClientId @ ", 1, \"" @ %pos @ "\");");
  1925.                             schedule(10000, "DoCampSetup(" @ %TrueClientId @ ", 2, \"" @ %pos @ "\");");
  1926.                             schedule(17000, "DoCampSetup(" @ %TrueClientId @ ", 3, \"" @ %pos @ "\");");
  1927.                             schedule(20000, "DoCampSetup(" @ %TrueClientId @ ", 4, \"" @ %pos @ "\");");
  1928.                         }
  1929.                         else {
  1930.                             messageClient(%TrueClientId, 'RPGchatCallback', "You can't set up a camp here.");
  1931.                         }
  1932.                     }
  1933.                     else {
  1934.                         messageClient(%TrueClientId, 'RPGchatCallback', "You already have a camp setup somewhere.");
  1935.                     }
  1936.                 }
  1937.                 else {
  1938.                     messageClient(%TrueClientId, 'RPGchatCallback', "You aren't carrying a tent.");
  1939.                 }
  1940.                
  1941.                 return;
  1942.                
  1943.             case "#uncamp":
  1944.                 return;
  1945.                 %camp = nameToId("MissionCleanup/Camp" @ %TrueClientId);
  1946.                
  1947.                 if(%camp !$= -1)
  1948.                 {
  1949.                     %obj = nameToId("MissionCleanup/Camp" @ %TrueClientId @ "/woodfire");
  1950.                    
  1951.                     if(VectorDist(%TrueClientId.player.getPosition(), %obj.getPosition()) <= 10)
  1952.                     {
  1953.                         DoCampSetup(%TrueClientId, 5);
  1954.                         messageClient(%TrueClientId, 'RPGchatCallback', "Camp has been packed up.");
  1955.                     }
  1956.                     else {
  1957.                         messageClient(%TrueClientId, 'RPGchatCallback', "You are too far from your camp.");
  1958.                     }
  1959.                 }
  1960.                 else {
  1961.                     messageClient(%TrueClientId, 'RPGchatCallback', "You don't have a camp.");
  1962.                 }
  1963.                
  1964.                 return;
  1965.                
  1966.             case "#advcompass":
  1967.                 if(%cropped $= "") {
  1968.                     messageClient(%TrueClientId, 'RPGchatCallback', "Use #advcompass zone keyword");
  1969.                 }
  1970.                 else
  1971.                 {
  1972.                     if(SkillCanUse(%TrueClientId, "#advcompass"))
  1973.                     {
  1974.                         %obj = GetZoneByKeywords(%TrueClientId, %cropped, 3);
  1975.                        
  1976.                         if(%obj !$= false)
  1977.                         {
  1978.                             %mpos = Zone::getMarker(%obj);
  1979.                            
  1980.                             %d = GetNESW(%TrueClientId.player.getPosition(), %mpos);
  1981.                             UseSkill(%TrueClientId, $SkillSenseHeading, true, true);
  1982.                            
  1983.                             messageClient(%TrueClientId, 'RPGchatCallback', Zone::getDesc(%obj) @ " is " @ %d @ " of here.");
  1984.                         }
  1985.                         else {
  1986.                             messageClient(%TrueClientId, 1, "Couldn't fine a zone to match those keywords.");
  1987.                         }
  1988.                     }
  1989.                     else
  1990.                     {
  1991.                         messageClient(%TrueClientId, 'RPGchatCallback', "You can't use #advcompass because you lack the necessary skills.");
  1992.                         UseSkill(%TrueClientId, $SkillSenseHeading, false, true);
  1993.                     }
  1994.                 }
  1995.                
  1996.                 return;
  1997.                
  1998.             case "#smith":
  1999.                 %ret = getLOSInfo(%TrueClientId, 10);
  2000.                 %obj = GetWord(%ret, 0);
  2001.                
  2002.                 if(%obj.special !$= "Smith")
  2003.                 {
  2004.                     MessageClient(%TrueClientId, 'RPGchatCallback', "You need to be looking at an anvil to smith");
  2005.                     return false;
  2006.                 }
  2007.                
  2008.                 if(!%TrueClientId.IsSmithing)
  2009.                 {
  2010.                     %TrueClientId.IsSmithing = true;
  2011.                     %command = GetWord(%cropped, 0);
  2012.                     %nitem = GetWord(%cropped, 1);
  2013.                     %from = GetWord(%cropped, 2);
  2014.                     Game.smith(%TrueClientID, %command, %nitem, %from);
  2015.                     %TrueClientId.IsSmithing = false;
  2016.                 }
  2017.                
  2018.             case "#myexp":
  2019.                 messageClient(%TrueClientId, 'RPGchatCallback', "Your EXP:" SPC fetchdata(%TrueClientId, "EXP"));
  2020.                
  2021.             case "#mylevel":
  2022.                 messageClient(%TrueClientId, 'RPGchatCallback', "Your Level:" SPC fetchdata(%TrueClientId, "LVL"));
  2023.                
  2024.             case "#quickbind":
  2025.                 if(%cropped !$= "")
  2026.                 {
  2027.                     %number = GetWord(%cropped, 0);
  2028.                     %rest = GetWords(%cropped, 1, 99);
  2029.                     %number = mfloor(%number);
  2030.                    
  2031.                     if(%number > 0 && %number <= 6)
  2032.                     {
  2033.                         %number--;
  2034.                         storedata(%client, "QuickBind" @ %number, %rest);
  2035.                     }
  2036.                     else {
  2037.                         messageClient(%TrueClientId, 'RPGchatCallBack', "Incorrect usage, syntax: #QuickBind [number 1-6] [#command...] example #quickbind 1 #cast thorn");
  2038.                     }
  2039.                 }
  2040.                 else {
  2041.                     messageClient(%TrueClientId, 'RPGchatCallBack', "Incorrect usage, syntax: #QuickBind [number 1-6] [#command...] example #quickbind 1 #cast thorn");
  2042.                 }
  2043.                
  2044.             case "#resetplayer":
  2045.                 %race = fetchdata(%TrueClientID, "RACE");
  2046.                
  2047.                 %race = "MaleHuman";//until femalehuman is put in
  2048.                 %apm = "Armor";
  2049.                 %dbname = %race @ %apm @ %TrueClientID.cweight;
  2050.                 %e = %TrueClientID.player.getEnergyLevel();
  2051.                 %d = %TrueClientID.player.getDamageLevel();
  2052.                 %TrueClientID.player.setDataBlock(MaleHuman);
  2053.                 %TrueClientID.player.setdatablock(%dbname);
  2054.                 %TrueClientID.player.setEnergyLevel(%e);
  2055.                 %TrueClientID.player.setDamageLevel(%d);
  2056.                 MessageClient(%TrueClientId, 'RPGchatCallBack', "Player Reset");
  2057.                
  2058.             case "#mount":
  2059.                 //getlosinfo
  2060.                 %obj = getword(getlosinfo(%TrueClientId, 10), 0);
  2061.                 %dataBlock = %obj.getDataBlock();
  2062.                 %className = %dataBlock.className;
  2063.                 %player = %TrueClientID.player;
  2064.                
  2065.                 if(%forceVehicleNode !$= "" || (%className $= WheeledVehicleData || %className $= FlyingVehicleData || %className $= HoverVehicleData) &&
  2066.                                          %player.mountVehicle && %player.getState() $= "Move" && %obj.getDamageState() !$= "Destroyed")
  2067.                 {
  2068.                     if(%TrueClientID.isAIControlled())
  2069.                     {
  2070.                         %transform = %col.getTransform();
  2071.                        
  2072.                         //either the AI is *required* to pilot, or they'll pick the first available passenger seat
  2073.                         if(%client.pilotVehicle)
  2074.                         {
  2075.                             //make sure the bot is in light armor
  2076.                             if(%player.getArmorSize() $= "Light")
  2077.                             {
  2078.                                 //make sure the pilot seat is empty
  2079.                                 if(!%obj.getMountNodeObject(0)) {
  2080.                                     %node = 0;
  2081.                                 }
  2082.                             }
  2083.                         }
  2084.                         else {
  2085.                             %node = findAIEmptySeat(%obj, %player);
  2086.                         }
  2087.                     }
  2088.                     else {
  2089.                         %node = findEmptySeat(%obj, %player);
  2090.                     }
  2091.                    
  2092.                     //now mount the player in the vehicle
  2093.                     if(%node >= 0)
  2094.                     {
  2095.                    
  2096.                         %obj.mountObject(%player,%node);
  2097.                         %obj.playAudio(0, MountVehicleSound);
  2098.                         %player.mVehicle = %obj;
  2099.                        
  2100.                         //%player.mountnode = %node;
  2101.                         // if player is repairing something, stop it
  2102.                         if(%player.repairing) {
  2103.                             stopRepairing(%player);
  2104.                         }
  2105.                        
  2106.                         //this will setup the huds as well...
  2107.                         // %dataBlock.playerMounted(%obj,%player, %node);
  2108.                     }
  2109.                 }
  2110.                 else {
  2111.                     messageClient(%TrueClientId, 'RPGchatCallback', "You cannot mount this object");
  2112.                 }
  2113.         }
  2114.        
  2115.         //another break...
  2116. //============================
  2117. //Guild commands==============
  2118. //============================
  2119.         switch$(%w1)
  2120.         {
  2121.             case "#claim":
  2122.                 %guildid = IsInWhatGuild(%TrueClientId);
  2123.                 %guild = GuildGroup.getObject(%guildid);
  2124.                
  2125.                 if(%guildid == -1 || %guild.getGUIDRank(%TrueClientId.guid) < 1)
  2126.                 {
  2127.                     MessageClient(%TrueClientId, 'MessageClaimFail', "You have to be in a guild to claim land.");
  2128.                     return;
  2129.                 }
  2130.                
  2131.                 %zone = fetchdata(%TrueClientId, "zone");
  2132.                
  2133.                 if(%zone.type $= "GuildZone")
  2134.                 {
  2135.                     if(%zone.owned)
  2136.                     {
  2137.                         if(%zone.owner == %guild)
  2138.                         {
  2139.                             MessageClient(%TrueClientId, 'MessageClaimFail', "Your guild already owns this zone.");
  2140.                         }
  2141.                         else
  2142.                         {
  2143.                             MessageClient(%TrueClientId, 'MessageClaimFail', "You cannot claim this zone because it is owned by a guild, in order to obtain it you must #challenge the current owner.");
  2144.                         }
  2145.                     }
  2146.                     else
  2147.                     {
  2148.                         %list = Zone::getPlayerList(fetchData(%TrueClientId, "zone"), 2);
  2149.                         %flag = true;
  2150.                        
  2151.                         for(%i = 0; GetWord(%list, %i); %i++)
  2152.                         {
  2153.                             %id = GetWord(%list, %i);
  2154.                            
  2155.                             if(%id != %TrueClientId)
  2156.                             {
  2157.                                 %gid = IsInWhatGuild(%id);
  2158.                                
  2159.                                 if(%gid != -1 && %gid != %guildid)
  2160.                                 {
  2161.                                
  2162.                                     %flag = false;
  2163.                                     break;
  2164.                                 }
  2165.                             }
  2166.                         }
  2167.                        
  2168.                         if(%flag)
  2169.                         {
  2170.                             if(GetWordCount(%guild.getzonelist()) < $guildownerzonelimit)
  2171.                             {
  2172.                                 //check to see if there are any other guild members in this zone.
  2173.                                 MessageClient(%TrueClientId, 'MessageClaim', "You claim this zone in the name of" SPC %guild.getName() @ "!");
  2174.                                 %guild.addZone(%zone);
  2175.                                 %zone.owned = true;
  2176.                                 %zone.owner = %guild;
  2177.                                 SaveServerGuilds();
  2178.                             }
  2179.                             else {
  2180.                                 MessageClient(%TrueClientId, 'MessageClaim', "Your guild already owns too many zones");
  2181.                             }
  2182.                         }
  2183.                         else {
  2184.                             MessageClient(%TrueClientId, 'MessageClaimFail', "You cannot claim this zone until you are the only guild in this zone.");
  2185.                         }
  2186.                     }
  2187.                 }
  2188.                 else {
  2189.                     MessageClient(%TrueClientId, 'MessageClaimFail', "You must be in a guild zone to claim it.");
  2190.                 }
  2191.                
  2192.             case "#challenge":
  2193.                 %guildid = IsInWhatGuild(%Trueclientid);
  2194.                 %guild = GuildGroup.getObject(%guildid);
  2195.                 %zone = fetchdata(%TrueClientId, "Zone");
  2196.                
  2197.                 if(%guildid == -1 || %guild.getGUIDRank(%TrueClientId.guid) <= 1)
  2198.                 {
  2199.                     if(%guildid == -1) {
  2200.                         MessageClient(%TrueClientId, 'RPGchatcallback', "Error, you must be in a guild to use this command");
  2201.                     }
  2202.                     else {
  2203.                         MessageClient(%TrueClientId, 'RPGchatCallback', "You are not of sufficent rank to start a challenge with another guild");
  2204.                     }
  2205.                    
  2206.                     return;
  2207.                 }
  2208.                
  2209.                 if(%zone.type $= "GuildZone")
  2210.                 {
  2211.                     if(%zone.owned)
  2212.                     {
  2213.                         if(%zone.owner == %guild)
  2214.                         {
  2215.                             MessageClient(%TrueClientId, 'RPGchatcallback', "Error, your guild already owns this zone!");
  2216.                         }
  2217.                         else
  2218.                         {
  2219.                             if(%zone.challenged)
  2220.                             {
  2221.                                 MessageClient(%TrueClientId, 'RPGchatCallback', "Error, someone has already challenged this zone");
  2222.                             }
  2223.                             else
  2224.                             {
  2225.                                 if(GetWordCount(%guild.getzonelist()) < $guildownerzonelimit)
  2226.                                 {
  2227.                                     //success
  2228.                                     MessageClient(%TrueClientId, 'RPGchatcallback', "Success, registering challenge...");
  2229.                                     %zone.owner.startChallenge(%zone, %guild);
  2230.                                    
  2231.                                 }
  2232.                                 else {
  2233.                                     MessageClient(%TrueClientId, 'RPGchatcallback', "Your guild already has too many zones");
  2234.                                 }
  2235.                             }
  2236.                         }
  2237.                        
  2238.                     }
  2239.                     else {
  2240.                         MessageClient(%TrueClientId, 'RPGchatCallback', "Zone is unclaimed, #claim to gain possession of it");
  2241.                     }
  2242.                    
  2243.                 }
  2244.                 else {
  2245.                     MessageClient(%TrueClientId, 'RPGchatCallback', "You must be in an enemy guild's zone to challenge it.");
  2246.                 }
  2247.                
  2248.             case "#accept":
  2249.                 %guildid = IsInWhatGuild(%Trueclientid);
  2250.                 %guild = GuildGroup.getObject(%guildid);
  2251.                 %zone = %guild.challengedzone;
  2252.                
  2253.                 if(%guildid == -1 || %guild.getGUIDRank(%TrueClientId.guid) <= 1)
  2254.                 {
  2255.                     if(%guildid == -1) {
  2256.                         MessageClient(%TrueClientId, 'RPGchatcallback', "Error, you must be in a guild to use this command");
  2257.                     }
  2258.                     else {
  2259.                         MessageClient(%TrueClientId, 'RPGchatCallback', "You are not of sufficent rank to accept a challenge with another guild");
  2260.                     }
  2261.                    
  2262.                     return;
  2263.                 }
  2264.                
  2265.                 //find state...
  2266.                 if(%zone.owner == %guild && %zone.canacceptchallenge)
  2267.                 {
  2268.                     %count = ClientGroup.getCount();
  2269.                    
  2270.                     for(%icl = 0; %icl < %count; %icl++)
  2271.                     {
  2272.                         %cl = ClientGroup.getObject(%icl);
  2273.                        
  2274.                         if(%cl.isAiControlled()) {
  2275.                             continue;    //skip bots
  2276.                         }
  2277.                        
  2278.                         if(%guild.GUIDinGuild(%cl.guid) && %guild.GetGUIDRank(%cl.guid) > 0) {
  2279.                             %home++;
  2280.                         }
  2281.                         else if(%zone.challenger.GUIDinGuild(%cl.guid)  && %zone.challenger.getGUIDRank(%cl.guid) > 0) {
  2282.                             %away++;
  2283.                         }
  2284.                     }
  2285.                    
  2286.                     if(IsEventPending(%zone.challengeEvent) && %away >= %zone.minchallenger)
  2287.                     {
  2288.                         cancel(%zone.challengeEvent);
  2289.                         %guild.PrepareChallenge(%zone, %zone.challenger, 0);
  2290.                     }
  2291.                 }
  2292.                 else {
  2293.                     MessageClient(%TrueClientId, 'RPGchatcallback', "There is no challenge to accept");
  2294.                 }
  2295.         }
  2296.        
  2297.         switch$(%w1)
  2298.         {
  2299. //============================
  2300. //ADMIN COMMANDS =============
  2301. //============================
  2302.  
  2303.             case "#anon":
  2304.                 if(%clientToServerAdminLevel >= 3)
  2305.                 {
  2306.                     %aname = GetWord(%cropped, 0);
  2307.                     %cn = mfloor(GetWord(%cropped, 1));
  2308.                    
  2309.                     if(%cn !$= -1 && %aname !$= -1)
  2310.                     {
  2311.                         %anonmsg = getsubstr(%cropped, strstr(%cropped, %cn)+strlen(%cn)+1, 99999);
  2312.                        
  2313.                         if(%aname $= "all")
  2314.                         {
  2315.                             %count = ClientGroup.getCount();
  2316.                            
  2317.                             for(%icl = 0; %icl < %count; %icl++)
  2318.                             {
  2319.                                 %cl = ClientGroup.getObject(%icl);
  2320.                                
  2321.                                 if(mfloor(%cl.adminLevel) >= mfloor(%clientToServerAdminLevel)) {
  2322.                                     messageClient(%cl, %cn, "[ANON] " @ %TCsenderName @ ": " @ %anonmsg);
  2323.                                 }
  2324.                                 else {
  2325.                                     messageClient(%cl, %cn, %anonmsg);
  2326.                                 }
  2327.                             }
  2328.                         }
  2329.                         else
  2330.                         {
  2331.                             %id = getClientByName(%aname);
  2332.                            
  2333.                             if(%id !$= -1)
  2334.                             {
  2335.                                 if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel)) {
  2336.                                     messageClient(%id, %cn, "[ANON] " @ %TCsenderName @ ": " @ %anonmsg);
  2337.                                 }
  2338.                                 else {
  2339.                                     messageClient(%id, %cn, %anonmsg);
  2340.                                 }
  2341.                             }
  2342.                             else {
  2343.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  2344.                             }
  2345.                         }
  2346.                     }
  2347.                     else {
  2348.                         messageClient(%TrueClientId, 'RPGchatCallback', "Syntax: #anon name/all colorNumber message");
  2349.                     }
  2350.                 }
  2351.                
  2352.                 return;
  2353.                
  2354.             case "#fw":
  2355.                 %c1 = GetWord(%cropped, 0);
  2356.                
  2357.                 if(%c1 !$= -1)
  2358.                 {
  2359.                     %id = getClientByName(%c1);
  2360.                    
  2361.                     if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id !$= %TrueClientId && mfloor(%id.adminLevel) !$= 0) {
  2362.                         messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  2363.                     }
  2364.                     else if(%id !$= -1)
  2365.                     {
  2366.                         if(%clientToServerAdminLevel >= 3)
  2367.                         {
  2368.                             %rest = getsubstr(%cropped, (strlen(%c1)+1), strlen(%cropped)-(strlen(%c1)+1));
  2369.                             RPGchat(%id, 0, %rest); //, %senderName);
  2370.                            
  2371.                             if(!%echoOff) {
  2372.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Sent a forwarded message to " @ %id @ ".");
  2373.                             }
  2374.                         }
  2375.                     }
  2376.                     else if(!%echoOff) {
  2377.                         messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name, or name is of a superAdmin.");
  2378.                     }
  2379.                 }
  2380.                 else {
  2381.                     messageClient(%TrueClientId, 'RPGchatCallback', "Please specify name, command and text.");
  2382.                 }
  2383.                
  2384.                 return;
  2385.                
  2386.             case "#forcespawn":
  2387.                 if(%clientToServerAdminLevel >= 1)
  2388.                 {
  2389.                     if(%cropped $= "") {
  2390.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  2391.                     }
  2392.                     else
  2393.                     {
  2394.                         %id = getClientByName(%cropped);
  2395.                        
  2396.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  2397.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  2398.                         }
  2399.                         else if(%id !$= -1)
  2400.                         {
  2401.                             if(IsDead(%id))
  2402.                             {
  2403.                                 Game.playerSpawn(%id, true);
  2404.                                
  2405.                                 if(!%echoOff) {
  2406.                                     messageClient(%TrueClientId, 'RPGchatCallback', "Forced " @ %cropped @ " to spawn.");
  2407.                                 }
  2408.                             }
  2409.                             else if(!%echoOff) {
  2410.                                 messageClient(%TrueClientId, 'RPGchatCallback', %cropped @ " isn't dead.");
  2411.                             }
  2412.                         }
  2413.                         else {
  2414.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  2415.                         }
  2416.                     }
  2417.                 }
  2418.                
  2419.                 return;
  2420.                
  2421.             case "#attacklos":
  2422.                 if(%cropped $= "") {
  2423.                     messageClient(%TrueClientId, 'RPGchatCallback', "Please specify a bot name.");
  2424.                 }
  2425.                 else
  2426.                 {
  2427.                     %event = strstr(%cropped, ">");
  2428.                    
  2429.                     if(%event !$= -1)
  2430.                     {
  2431.                         %info = getsubstr(%cropped, 0, %event);
  2432.                         %cmd = getsubstr(%cropped, %event, 99999);
  2433.                     }
  2434.                     else {
  2435.                         %info = %cropped;
  2436.                     }
  2437.                    
  2438.                     %c1 = getWord(%info, 0);
  2439.                     %ox = GetWord(%info, 1);
  2440.                     %oy = GetWord(%info, 2);
  2441.                     %oz = GetWord(%info, 3);
  2442.                     %id = getClientByName(%c1);
  2443.                    
  2444.                     if(%id !$= -1)
  2445.                     {
  2446.                         if(IsInCommaList(fetchData(%TrueClientId, "PersonalPetList"), %id) || %clientToServerAdminLevel >= 1)
  2447.                         {
  2448.                             if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id !$= %TrueClientId && mfloor(%id.adminLevel) !$= 0) {
  2449.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  2450.                             }
  2451.                             else if(%id.isAiControlled())
  2452.                             {
  2453.                                 %player = %TrueClientId.player;
  2454.                                
  2455.                                 if(%ox $= -1 && %oy $= -1 && %oz $= -1)
  2456.                                 {
  2457.                                     getLOSinfo(%TrueClientId, 50000);
  2458.                                     %pos = $los::position;
  2459.                                 }
  2460.                                 else {
  2461.                                     %pos = %ox @ " " @ %oy @ " " @ %oz;
  2462.                                 }
  2463.                                
  2464.                                 if(%event !$= -1) {
  2465.                                     AddEventCommand(%id, %senderName, "onPosCloseEnough " @ %pos, %cmd);
  2466.                                 }
  2467.                                
  2468.                                 if(!%echoOff) {
  2469.                                     messageClient(%TrueClientId, 'RPGchatCallback', %c1 @ " (" @ %id @ ") is attacking position " @ %pos @ ".");
  2470.                                 }
  2471.                                
  2472.                                 storeData(%id, "botAttackMode", 3);
  2473.                                 storeData(%id, "tmpbotdata", %pos);
  2474.                             }
  2475.                             else {
  2476.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Player must be a bot.");
  2477.                             }
  2478.                         }
  2479.                     }
  2480.                     else {
  2481.                         messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  2482.                     }
  2483.                 }
  2484.                
  2485.                 return;
  2486.                
  2487.             case "#botnormal":
  2488.                 if(%cropped $= "") {
  2489.                     messageClient(%TrueClientId, 'RPGchatCallback', "Please specify a bot name.");
  2490.                 }
  2491.                 else
  2492.                 {
  2493.                     %id = getClientByName(%cropped);
  2494.                    
  2495.                     if(%id !$= -1)
  2496.                     {
  2497.                         if(IsInCommaList(fetchData(%TrueClientId, "PersonalPetList"), %id) || %clientToServerAdminLevel >= 1)
  2498.                         {
  2499.                             if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id !$= %TrueClientId && mfloor(%id.adminLevel) !$= 0) {
  2500.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  2501.                             }
  2502.                             else if(%id.isAiControlled())
  2503.                             {
  2504.                                 if(!%echoOff) {
  2505.                                     messageClient(%TrueClientId, 'RPGchatCallback', "Bot is now in normal attack mode.");
  2506.                                 }
  2507.                                
  2508.                                 storeData(%id, "botAttackMode", 1);
  2509.                                 AI::newDirectiveRemove(fetchData(%id, "BotInfoAiName"), 99);
  2510.                                 storeData(%id, "tmpbotdata", "");
  2511.                                
  2512.                                 if(fetchData(%id, "petowner") !$= "")
  2513.                                 {
  2514.                                     storeData(%id, "botAttackMode", 2);
  2515.                                     storeData(%id, "tmpbotdata", fetchData(%id, "petowner"));
  2516.                                 }
  2517.                             }
  2518.                             else {
  2519.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Player must be a bot.");
  2520.                             }
  2521.                         }
  2522.                     }
  2523.                     else {
  2524.                         messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  2525.                     }
  2526.                 }
  2527.                
  2528.                 return;
  2529.                
  2530.             case "#createbotgroup":
  2531.                 if(%clientToServerAdminLevel >= 1)
  2532.                 {
  2533.                     if(%cropped $= "") {
  2534.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify a one-word BotGroup name.");
  2535.                     }
  2536.                     else
  2537.                     {
  2538.                         if(GetWord(%cropped, 1) $= "")
  2539.                         {
  2540.                             %g = GetWord(%cropped, 0);
  2541.                             %n = AI::CountBotGroupMembers(%g);
  2542.                            
  2543.                             if(!AI::BotGroupExists(%g))
  2544.                             {
  2545.                                 if(!%echoOff) {
  2546.                                     messageClient(%TrueClientId, 'RPGchatCallback', "Created BotGroup '" @ %g @ "'.");
  2547.                                 }
  2548.                                
  2549.                                 AI::CreateBotGroup(%g);
  2550.                             }
  2551.                             else {
  2552.                                 messageClient(%TrueClientId, 'RPGchatCallback', "BotGroup already exists and contains " @ %n @ " members.  Use #discardbotgroup to delete a BotGroup.");
  2553.                             }
  2554.                         }
  2555.                         else {
  2556.                             messageClient(%TrueClientId, 'RPGchatCallback', "Please specify a ONE-WORD BotGroup name.");
  2557.                         }
  2558.                     }
  2559.                 }
  2560.                
  2561.                 return;
  2562.                
  2563.             case "#discardbotgroup":
  2564.                 if(%clientToServerAdminLevel >= 1)
  2565.                 {
  2566.                     if(%cropped $= "") {
  2567.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify a one-word BotGroup name.");
  2568.                     }
  2569.                     else
  2570.                     {
  2571.                         if(GetWord(%cropped, 1) $= "")
  2572.                         {
  2573.                             %g = GetWord(%cropped, 0);
  2574.                            
  2575.                             if(AI::BotGroupExists(%g))
  2576.                             {
  2577.                                 if(!%echoOff) {
  2578.                                     messageClient(%TrueClientId, 'RPGchatCallback', "Discarded BotGroup '" @ %g @ "'.");
  2579.                                 }
  2580.                                
  2581.                                 AI::DiscardBotGroup(%g);
  2582.                             }
  2583.                             else {
  2584.                                 messageClient(%TrueClientId, 'RPGchatCallback', "BotGroup does not exist.");
  2585.                             }
  2586.                         }
  2587.                         else {
  2588.                             messageClient(%TrueClientId, 'RPGchatCallback', "Please specify a ONE-WORD BotGroup name.");
  2589.                         }
  2590.                     }
  2591.                 }
  2592.                
  2593.                 return;
  2594.                
  2595.             case "#getbotgroupleader":
  2596.                 if(%clientToServerAdminLevel >= 1)
  2597.                 {
  2598.                     if(%cropped $= "") {
  2599.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify a one-word BotGroup name.");
  2600.                     }
  2601.                     else
  2602.                     {
  2603.                         if(GetWord(%cropped, 1) $= "")
  2604.                         {
  2605.                             %g = GetWord(%cropped, 0);
  2606.                            
  2607.                             if(AI::BotGroupExists(%g))
  2608.                             {
  2609.                                 %tl = GetWord($tmpBotGroup[%g], 0);
  2610.                                 %tln = %tl.nameBase;
  2611.                                 messageClient(%TrueClientId, 'RPGchatCallback', "BotGroup leader is " @ %tln @ " (" @ %tl @ ").");
  2612.                             }
  2613.                             else {
  2614.                                 messageClient(%TrueClientId, 'RPGchatCallback', "BotGroup does not exist.");
  2615.                             }
  2616.                         }
  2617.                         else {
  2618.                             messageClient(%TrueClientId, 'RPGchatCallback', "Please specify a ONE-WORD BotGroup name.");
  2619.                         }
  2620.                     }
  2621.                 }
  2622.                
  2623.                 return;
  2624.                
  2625.             case "#botgroup":
  2626.                 if(%clientToServerAdminLevel >= 1)
  2627.                 {
  2628.                     %c1 = GetWord(%cropped, 0);
  2629.                     %c2 = GetWord(%cropped, 1);
  2630.                    
  2631.                     if(%c1 !$= -1 && %c2 !$= -1)
  2632.                     {
  2633.                         %id = getClientByName(%c1);
  2634.                        
  2635.                         if(%id !$= -1)
  2636.                         {
  2637.                             if(%id.isAiControlled())
  2638.                             {
  2639.                                 if(AI::BotGroupExists(%c2))
  2640.                                 {
  2641.                                     %b = AI::IsInWhichBotGroup(%id);
  2642.                                    
  2643.                                     if(%b $= -1)
  2644.                                     {
  2645.                                         if(!%echoOff) {
  2646.                                             messageClient(%TrueClientId, 'RPGchatCallback', "Adding minion " @ %c1 @ " (" @ %id @ ") to BotGroup '" @ %c2 @ "'.");
  2647.                                         }
  2648.                                        
  2649.                                         AI::AddBotToBotGroup(%id, %c2);
  2650.                                     }
  2651.                                     else {
  2652.                                         messageClient(%TrueClientId, 'RPGchatCallback', "This bot already belongs to the BotGroup '" @ %b @ "'.  Use #rbotgroup to remove a bot from a BotGroup.");
  2653.                                     }
  2654.                                 }
  2655.                                 else {
  2656.                                     messageClient(%TrueClientId, 'RPGchatCallback', "BotGroup '" @ %c2 @ "' does not exist.  Use #createbotgroup to create a BotGroup.");
  2657.                                 }
  2658.                             }
  2659.                             else {
  2660.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Name must be a bot.");
  2661.                             }
  2662.                         }
  2663.                         else {
  2664.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  2665.                         }
  2666.                     }
  2667.                     else {
  2668.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name & data.");
  2669.                     }
  2670.                 }
  2671.                
  2672.                 return;
  2673.                
  2674.             case "#rbotgroup":
  2675.                 if(%clientToServerAdminLevel >= 1)
  2676.                 {
  2677.                     %c1 = GetWord(%cropped, 0);
  2678.                    
  2679.                     if(%c1 !$= -1)
  2680.                     {
  2681.                         %id = getClientByName(%c1);
  2682.                        
  2683.                         if(%id !$= -1)
  2684.                         {
  2685.                             if(%id.isAiControlled())
  2686.                             {
  2687.                                 %b = AI::IsInWhichBotGroup(%id);
  2688.                                
  2689.                                 if(%b !$= -1)
  2690.                                 {
  2691.                                     if(!%echoOff) {
  2692.                                         messageClient(%TrueClientId, 'RPGchatCallback', "Removing minion " @ %c1 @ " (" @ %id @ ") from BotGroup '" @ %b @ "'.");
  2693.                                     }
  2694.                                    
  2695.                                     AI::RemoveBotFromBotGroup(%id, %b);
  2696.                                 }
  2697.                                 else {
  2698.                                     messageClient(%TrueClientId, 'RPGchatCallback', "This bot does not belong to a BotGroup.");
  2699.                                 }
  2700.                             }
  2701.                             else {
  2702.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Name must be a bot.");
  2703.                             }
  2704.                         }
  2705.                         else {
  2706.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  2707.                         }
  2708.                     }
  2709.                     else {
  2710.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name & data.");
  2711.                     }
  2712.                 }
  2713.                
  2714.                 return;
  2715.                
  2716.             case "#listbotgroups":
  2717.                 if(%clientToServerAdminLevel >= 1)
  2718.                 {
  2719.                     messageClient(%TrueClientId, 'RPGchatCallback', $BotGroups);
  2720.                 }
  2721.                
  2722.                 return;
  2723.                
  2724.             case "#setupai":
  2725.                 if(%clientToServerAdminLevel >= 5)
  2726.                 {
  2727.                     for(%i = 0; (%id = GetWord($TownBotList, %i)) !$= ""; %i++) {
  2728.                         deleteObject(%id);
  2729.                     }
  2730.                    
  2731.                     InitTownBots();
  2732.                 }
  2733.                
  2734.                 return;
  2735.                
  2736.             case "#getadmin":
  2737.                 if(%clientToServerAdminLevel >= 1)
  2738.                 {
  2739.                     if(%cropped $= "") {
  2740.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  2741.                     }
  2742.                     else
  2743.                     {
  2744.                         %id = getClientByName(%cropped);
  2745.                        
  2746.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  2747.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  2748.                         }
  2749.                         else if(%id !$= -1)
  2750.                         {
  2751.                             %a = mfloor(%id.adminLevel);
  2752.                             messageClient(%TrueClientId, 'RPGchatCallback', %cropped @ "'s Admin Clearance Level: " @ %a);
  2753.                         }
  2754.                         else {
  2755.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  2756.                         }
  2757.                     }
  2758.                 }
  2759.                
  2760.                 return;
  2761.                
  2762.             case "#setadmin":
  2763.                 if(%clientToServerAdminLevel >= 1)
  2764.                 {
  2765.                     %c1 = GetWord(%cropped, 0);
  2766.                     %c2 = GetWord(%cropped, 1);
  2767.                    
  2768.                     if(%c1 !$= -1 && %c2 !$= -1)
  2769.                     {
  2770.                         %id = getClientByName(%c1);
  2771.                        
  2772.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  2773.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  2774.                         }
  2775.                         else if(%id !$= -1)
  2776.                         {
  2777.                             %a = mfloor(%c2);
  2778.                            
  2779.                             if(%a < 0) {
  2780.                                 %a = 0;
  2781.                             }
  2782.                            
  2783.                             if(%a > %clientToServerAdminLevel) {
  2784.                                 %a = %clientToServerAdminLevel;
  2785.                             }
  2786.                            
  2787.                             %id.adminLevel = %a;
  2788.                            
  2789.                             if(!%echoOff) {
  2790.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Changed " @ %c1 @ " (" @ %id @ ") Admin Clearance Level to " @ %id.adminLevel @ ".");
  2791.                             }
  2792.                         }
  2793.                         else {
  2794.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  2795.                         }
  2796.                     }
  2797.                     else {
  2798.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name & data.");
  2799.                     }
  2800.                 }
  2801.                
  2802.                 return;
  2803.                
  2804.             case "#eyes":
  2805.                 if(%cropped $= "") {
  2806.                     messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  2807.                 }
  2808.                 else
  2809.                 {
  2810.                     %id = getClientByName(%cropped);
  2811.                    
  2812.                     if(IsInCommaList(fetchData(%TrueClientId, "PersonalPetList"), %id) || %clientToServerAdminLevel >= 1)
  2813.                     {
  2814.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id !$= %TrueClientId && mfloor(%id.adminLevel) !$= 0) {
  2815.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  2816.                         }
  2817.                         else if(%id !$= -1)
  2818.                         {
  2819.                             if(!IsDead(%id))
  2820.                             {
  2821.                                 if(%clientToServerAdminLevel >= 1)
  2822.                                 {
  2823.                                     Revert(%TrueClientId);
  2824.                                    
  2825.                                     //eyes
  2826.                                     //note, AI's don't have a camera...
  2827.                                     if(isObject(%TrueClientId.camera))
  2828.                                     {
  2829.                                         %transform = %id.player.getTransform();
  2830.                                         %TrueClientId.camera.setTransform(%transform);
  2831.                                         %TrueClientId.camera.setOrbitMode(%id.player, %transform, 0.5, 4.5, 4.5);
  2832.                                         %TrueClientId.setControlObject(%TrueClientId.camera);
  2833.                                     }
  2834.                                 }
  2835.                             }
  2836.                             else {
  2837.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Target client is dead.");
  2838.                             }
  2839.                         }
  2840.                         else {
  2841.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  2842.                         }
  2843.                     }
  2844.                 }
  2845.                
  2846.                 return;
  2847.                
  2848.             case "#possess":
  2849.                 if(%cropped $= "") {
  2850.                     messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  2851.                 }
  2852.                 else
  2853.                 {
  2854.                     %id = getClientByName(%cropped);
  2855.                    
  2856.                     if(IsInCommaList(fetchData(%TrueClientId, "PersonalPetList"), %id) || %clientToServerAdminLevel >= 1)
  2857.                     {
  2858.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id !$= %TrueClientId && mfloor(%id.adminLevel) !$= 0) {
  2859.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  2860.                         }
  2861.                         else if(%id !$= -1)
  2862.                         {
  2863.                             if(!IsDead(%id))
  2864.                             {
  2865.                                 if(%clientToServerAdminLevel >= 4)
  2866.                                 {
  2867.                                     Revert(%TrueClientId);
  2868.                                    
  2869.                                     //possess
  2870.                                     %TrueClientId.possessId = %id;
  2871.                                     %id.possessedBy = %TrueClientId;
  2872.                                     %TrueClientId.setControlObject(%id.player);
  2873.                                 }
  2874.                             }
  2875.                             else {
  2876.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Target client is dead.");
  2877.                             }
  2878.                         }
  2879.                         else {
  2880.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  2881.                         }
  2882.                     }
  2883.                 }
  2884.                
  2885.                 return;
  2886.                
  2887.             case "#revert":
  2888.                 if(%TrueClientId.sleepMode $= "")
  2889.                 {
  2890.                     Revert(%TrueClientId);
  2891.                 }
  2892.                
  2893.                 return;
  2894.                
  2895.             case "#fixspellflag":
  2896.                 if(%clientToServerAdminLevel >= 4)
  2897.                 {
  2898.                     if(%cropped $= "") {
  2899.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  2900.                     }
  2901.                     else
  2902.                     {
  2903.                         %id = getClientByName(%cropped);
  2904.                        
  2905.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  2906.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  2907.                         }
  2908.                         else if(%id !$= -1)
  2909.                         {
  2910.                             storeData(%id, "SpellCastStep", "");
  2911.                            
  2912.                             if(!%echoOff) {
  2913.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Spell flag reset.");
  2914.                             }
  2915.                         }
  2916.                         else {
  2917.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  2918.                         }
  2919.                     }
  2920.                 }
  2921.                
  2922.                 return;
  2923.                
  2924.             case "#fixbashflag":
  2925.                 if(%clientToServerAdminLevel >= 4)
  2926.                 {
  2927.                     if(%cropped $= "") {
  2928.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  2929.                     }
  2930.                     else
  2931.                     {
  2932.                         %id = getClientByName(%cropped);
  2933.                        
  2934.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  2935.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  2936.                         }
  2937.                         else if(%id !$= -1)
  2938.                         {
  2939.                             storeData(%id, "blockBash", "");
  2940.                            
  2941.                             if(!%echoOff) {
  2942.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Bash flag reset.");
  2943.                             }
  2944.                         }
  2945.                         else {
  2946.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  2947.                         }
  2948.                     }
  2949.                 }
  2950.                
  2951.                 return;
  2952.                
  2953.             case "#kick":
  2954.                 if(%clientToServerAdminLevel >= 2)
  2955.                 {
  2956.                     %c1 = GetWord(%cropped, 0);
  2957.                     %c2 = GetWord(%cropped, 1);
  2958.                    
  2959.                     if(%c2 $= -1) {
  2960.                         %c2 = false;
  2961.                     }
  2962.                    
  2963.                     if(%c1 !$= -1)
  2964.                     {
  2965.                         %id = getClientByName(%c1);
  2966.                        
  2967.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  2968.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  2969.                         }
  2970.                         else if(%id !$= -1)
  2971.                         {
  2972.                             %id.setDisconnectReason("You have been kicked out of the game.");
  2973.                             savecharacter(%id);
  2974.                             %id.schedule(700, "delete");
  2975.                         }
  2976.                         else {
  2977.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  2978.                         }
  2979.                     }
  2980.                     else {
  2981.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name & data.");
  2982.                     }
  2983.                 }
  2984.                
  2985.                 return;
  2986.                
  2987.             case "#kickid":
  2988.                 if(%clientToServerAdminLevel >= 2)
  2989.                 {
  2990.                     %id = GetWord(%cropped, 0);
  2991.                     %c2 = GetWord(%cropped, 1);
  2992.                    
  2993.                     if(%c2 $= -1) {
  2994.                         %c2 = false;
  2995.                     }
  2996.                    
  2997.                     if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  2998.                         messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  2999.                     }
  3000.                     else if(%id !$= -1) {
  3001.                         Admin::Kick(%TrueClientId, %id, %c2);
  3002.                     }
  3003.                     else {
  3004.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify clientId & data.");
  3005.                     }
  3006.                 }
  3007.                
  3008.                 return;
  3009.                
  3010.             case "#ban":
  3011.                 if(%clienttoserverAdminLevel >= 3)
  3012.                 {
  3013.                     %absolute = false;
  3014.                     %c1 = GetWord(%cropped, 0);
  3015.                     %c2 = GetWord(%cropped, 1);
  3016.                    
  3017.                     if(%c2 $= "absolute" && %clientToServerAdminLevel >= 5) {
  3018.                         %absolute = true;
  3019.                     }
  3020.                    
  3021.                     if(%c2 <= 0) {
  3022.                         %c2 = $host::bantime;
  3023.                     }
  3024.                    
  3025.                     if(%c2 > $Host::MaxBanTime) {
  3026.                         %c2 = $Host::MaxBanTime;
  3027.                     }
  3028.                    
  3029.                     %bantime = %c2;
  3030.                     echo("absolute:" SPC %absolute);
  3031.                    
  3032.                     if(%c1 !$= -1)
  3033.                     {
  3034.                         %id = getClientByName(%c1);
  3035.                        
  3036.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  3037.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  3038.                         }
  3039.                         else if(%id !$= -1)
  3040.                         {
  3041.                             %id.setDisconnectReason("You have been banned.");
  3042.                             savecharacter(%id);
  3043.                             %id.schedule(700, "delete");
  3044.                            
  3045.                             if(%absolute)
  3046.                             {
  3047.                                 BanList::Addabsolute(%id.guid, %id.getAddress(), mpow(2,32)-1);
  3048.                                 BanList::Add(%id.guid, %id.getAddress(), 60*60*24*7);
  3049.                                 echo("ABSOLUTE BAN");
  3050.                             }
  3051.                             else {
  3052.                                 BanList::add(%id.guid, %id.getAddress(),%bantime);
  3053.                             }
  3054.                         }
  3055.                         else {
  3056.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  3057.                         }
  3058.                     }
  3059.                     else {
  3060.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name & data.");
  3061.                     }
  3062.                    
  3063.                 }
  3064.                
  3065.             case "#admin":
  3066.                 if($Host::UseSanctionedAdmin)
  3067.                 {
  3068.                     for(%ii = 0; (%cguid = GetWord($SanctionedAdminList,%ii)) !$= ""; %ii = %ii+2)
  3069.                     {
  3070.                         if(%cguid == %TrueClientId.guid)
  3071.                         {
  3072.                             %TrueClientId.adminLevel = GetWord($SanctionedAdminList,%ii+1);
  3073.                            
  3074.                             if(%TrueClientId.adminLevel >= 4) {
  3075.                                 ChangeRace(%TrueClientId, "DeathKnight");
  3076.                             }
  3077.                            
  3078.                             if(!%echoOff) {
  3079.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Admin Clearance Level " @ %TrueClientId.adminLevel @ " Granted.");
  3080.                             }
  3081.                            
  3082.                         }
  3083.                     }
  3084.                 }
  3085.                 else
  3086.                 {
  3087.                     for(%i = 1; %i <= 8; %i++)
  3088.                     {
  3089.                         if(%cropped $= $AdminPassword[%i] && $AdminPassword[%i] !$= "")
  3090.                         {
  3091.                             %TrueClientId.adminLevel = %i;
  3092.                            
  3093.                             if(%TrueClientId.adminLevel >= 4) {
  3094.                                 ChangeRace(%TrueClientId, "DeathKnight");
  3095.                             }
  3096.                            
  3097.                             if(!%echoOff) {
  3098.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Password accepted for Admin Clearance Level " @ %TrueClientId.adminLevel @ ".");
  3099.                             }
  3100.                            
  3101.                             break;
  3102.                         }
  3103.                     }
  3104.                 }
  3105.                
  3106.                 return;
  3107.                
  3108.             case "#human":
  3109.                 if(%clientToServerAdminLevel >= 4) {
  3110.                     ChangeRace(%TrueClientId, "Human");
  3111.                 }
  3112.                
  3113.                 return;
  3114.                
  3115.             case "#loadworld":
  3116.                 if(%clientToServerAdminLevel >= 5)
  3117.                 {
  3118.                     if(%cropped $= "") {
  3119.                         LoadWorld();
  3120.                     }
  3121.                     else {
  3122.                         messageClient(%TrueClientId, 'RPGchatCallback', "Do not use parameters for this function call.");
  3123.                     }
  3124.                 }
  3125.                
  3126.                 return;
  3127.                
  3128.             case "#saveworld":
  3129.                 if(%clientToServerAdminLevel >= 4)
  3130.                 {
  3131.                     if(%cropped $= "") {
  3132.                         SaveWorld();
  3133.                     }
  3134.                     else {
  3135.                         messageClient(%TrueClientId, 'RPGchatCallback', "Do not use parameters for this function call.");
  3136.                     }
  3137.                 }
  3138.                
  3139.                 return;
  3140.                
  3141.             case "#loadcharacter":
  3142.                 if(%clientToServerAdminLevel >= 4)
  3143.                 {
  3144.                     if(%cropped $= "") {
  3145.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify clientId.");
  3146.                     }
  3147.                     else {
  3148.                         LoadCharacter(%cropped);
  3149.                     }
  3150.                 }
  3151.                
  3152.                 return;
  3153.                
  3154.             case "#item":
  3155.                 return;
  3156.                
  3157.                 if(%clientToServerAdminLevel >= 2)
  3158.                 {
  3159.                     %name = GetWord(%cropped, 0);
  3160.                    
  3161.                     %id = getClientByName(%name);
  3162.                    
  3163.                     if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  3164.                         messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  3165.                     }
  3166.                     else if(%id !$= -1)
  3167.                     {
  3168.                         Player::setItemCount(%id, GetWord(%cropped, 1), GetWord(%cropped, 2));
  3169.                         RefreshAll(%id);
  3170.                        
  3171.                         if(!%echoOff) {
  3172.                             messageClient(%TrueClientId, 'RPGchatCallback', "Set " @ %name @ " (" @ %id @ ") " @ GetWord(%cropped, 1) @ " count to " @ GetWord(%cropped, 2));
  3173.                         }
  3174.                     }
  3175.                     else {
  3176.                         messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  3177.                     }
  3178.                 }
  3179.                
  3180.                 return;
  3181.                
  3182.             case "#getitemcount":
  3183.                 if(%clientToServerAdminLevel >= 1)
  3184.                 {
  3185.                     %id = getClientByName(GetWord(%cropped, 0));
  3186.                    
  3187.                     if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  3188.                         messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  3189.                     }
  3190.                     else if(%id !$= -1)
  3191.                     {
  3192.                         %c = Player::getItemCount(%id, GetWord(%cropped, 1));
  3193.                         messageClient(%TrueClientId, 'RPGchatCallback', "Item count for (" @ %id @ ") " @ GetWord(%cropped, 1) @ " is " @ %c);
  3194.                     }
  3195.                     else {
  3196.                         messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  3197.                     }
  3198.                 }
  3199.                
  3200.                 return;
  3201.                
  3202.             case "#myitem":
  3203.                 if(%clientToServerAdminLevel >= 2)
  3204.                 {
  3205.                     if(GetWord(%cropped, 0) !$= "")
  3206.                     {
  3207.                         %item = GetWord(%cropped, 0);
  3208.                         %amt = GetWord(%cropped, 1);
  3209.                         %prefix = GetWord(%cropped, 2);
  3210.                         %suffix = GetWord(%cropped, 3);
  3211.                        
  3212.                         if(%prefix == 0) {
  3213.                             %prefix = 3;
  3214.                         }
  3215.                        
  3216.                         if(%suffix == 0) {
  3217.                             %suffix = 1;
  3218.                         }
  3219.                        
  3220.                         if(%amt == 0) {
  3221.                             %amt = 1;
  3222.                         }
  3223.                        
  3224.                         //Player::setItemCount(%TrueClientId, GetWord(%cropped, 0), GetWord(%cropped, 1));
  3225.                         //AddToInventory(%TrueClientID, CreateItem( GetWord(%cropped, 0), (GetWord(%cropped, 1) $= "" ? 3 : GetWord(%cropped, 1) ), ( GetWord(%cropped, 2) $= "" ? 1 : GetWord(%cropped, 2) )));
  3226.                         Game.AddToInventory(%TrueClientID, %amt, %item, %prefix, %suffix);
  3227.                         RefreshAll(%TrueClientId);
  3228.                        
  3229.                         if(!%echoOff) {
  3230.                             messageClient(%TrueClientId, 'RPGchatCallback', "Gave " @ %TCsenderName @ " (" @ %TrueClientId @ ") " @ %amt SPC %item SPC "Prefix:" SPC %prefix SPC "Suffix:" SPC %suffix @ ".");
  3231.                         }
  3232.                     }
  3233.                     else {
  3234.                         messageClient(%TrueCientId, 'RPGchatCallback', "Useage: #myitem itemname [amt] [prefix] [suffix]. Prefix and suffix are a number 1-6. (3 is normal for prefix 1 is normal for suffix)");
  3235.                     }
  3236.                 }
  3237.                
  3238.                 return;
  3239.                
  3240.             case "#arenacutshort":
  3241.                 if(%clientToServerAdminLevel >= 1)
  3242.                 {
  3243.                     $IsABotMatch = true;
  3244.                     $ArenaBotMatchTicker = $ArenaBotMatchLengthInTicks;
  3245.                 }
  3246.                
  3247.                 return;
  3248.                
  3249.             case "#teleport":
  3250.                 if(%clientToServerAdminLevel >= 2)
  3251.                 {
  3252.                     if(%cropped $= "") {
  3253.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  3254.                     }
  3255.                     else
  3256.                     {
  3257.                         %id = getClientByName(%cropped);
  3258.                        
  3259.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  3260.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  3261.                         }
  3262.                         else if(%id !$= -1)
  3263.                         {
  3264.                             getLOSinfo(%TrueClientId, 50000);
  3265.                            
  3266.                             if(%id.player.ismounted())
  3267.                             {
  3268.                                 //unmount the player
  3269.                                 %id.player.getobjectMount().unmountobject(%id.player);
  3270.                                 %id.player.setcontrolobject(0);
  3271.                             }
  3272.                            
  3273.                             %id.player.setPosition($los::position);
  3274.                            
  3275.                             CheckAndBootFromArena(%id);
  3276.                            
  3277.                             if(!%echoOff) {
  3278.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Teleporting " @ %cropped @ " (" @ %id @ ") to " @ $los::position @ ".");
  3279.                             }
  3280.                         }
  3281.                         else {
  3282.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  3283.                         }
  3284.                     }
  3285.                 }
  3286.                
  3287.                 return;
  3288.                
  3289.             case "#teleport2":
  3290.                 if(%clientToServerAdminLevel >= 2)
  3291.                 {
  3292.                     %c1 = GetWord(%cropped, 0);
  3293.                     %c2 = GetWord(%cropped, 1);
  3294.                    
  3295.                     if(%c1 !$= -1 && %c2 !$= -1)
  3296.                     {
  3297.                         %id1 = getClientByName(%c1);
  3298.                         %id2 = getClientByName(%c2);
  3299.                        
  3300.                         if(mfloor(%id1.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id1 !$= %TrueClientId) {
  3301.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  3302.                         }
  3303.                         else if(%id1 !$= -1 && %id2 !$= -1)
  3304.                         {
  3305.                             if(!%echoOff) {
  3306.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Teleporting " @ %c1 @ " (" @ %id1 @ ") to " @ %c2 @ " (" @ %id2 @ ").");
  3307.                             }
  3308.                            
  3309.                             %id1.player.setPosition(%id2.player.getPosition());
  3310.                            
  3311.                             CheckAndBootFromArena(%id1);
  3312.                         }
  3313.                         else {
  3314.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name(s).");
  3315.                         }
  3316.                     }
  3317.                     else {
  3318.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name & data.");
  3319.                     }
  3320.                 }
  3321.                
  3322.                 return;
  3323.                
  3324.             case "#follow":
  3325.                 if(%clientToServerAdminLevel >= 1)
  3326.                 {
  3327.                     %c1 = GetWord(%cropped, 0);
  3328.                     %c2 = GetWord(%cropped, 1);
  3329.                    
  3330.                     if(%c1 !$= -1 && %c2 !$= -1)
  3331.                     {
  3332.                         %id1 = getClientByName(%c1);
  3333.                         %id2 = getClientByName(%c2);
  3334.                        
  3335.                         if(%id1 !$= -1 && %id2 !$= -1)
  3336.                         {
  3337.                             if(%id1.isAiControlled())
  3338.                             {
  3339.                                 if(!%echoOff) {
  3340.                                     messageClient(%TrueClientId, 'RPGchatCallback', "Making " @ %c1 @ " (" @ %id1 @ ") follow " @ %c2 @ " (" @ %id2 @ ").");
  3341.                                 }
  3342.                                
  3343.                                 %event = strstr(%cropped, ">");
  3344.                                
  3345.                                 if(%event !$= -1)
  3346.                                 {
  3347.                                     %cmd = getsubstr(%cropped, %event, 99999);
  3348.                                     AddEventCommand(%id1, %senderName, "onIdCloseEnough " @ %id2, %cmd);
  3349.                                 }
  3350.                                
  3351.                                 storeData(%id1, "tmpbotdata", %id2);
  3352.                                 storeData(%id1, "botAttackMode", 2);
  3353.                             }
  3354.                             else {
  3355.                                 messageClient(%TrueClientId, 'RPGchatCallback', "First name must be a bot.");
  3356.                             }
  3357.                         }
  3358.                         else {
  3359.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name(s).");
  3360.                         }
  3361.                     }
  3362.                     else {
  3363.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name & data.");
  3364.                     }
  3365.                 }
  3366.                
  3367.                 return;
  3368.                
  3369.             case "#cancelfollow":
  3370.                 if(%clientToServerAdminLevel >= 1)
  3371.                 {
  3372.                     if(%cropped !$= -1)
  3373.                     {
  3374.                         %id = getClientByName(%cropped);
  3375.                        
  3376.                         if(%id !$= -1)
  3377.                         {
  3378.                             if(%id.isAiControlled())
  3379.                             {
  3380.                                 AI::newDirectiveRemove(fetchData(%id, "BotInfoAiName"), 99);
  3381.                                
  3382.                                 if(!%echoOff) {
  3383.                                     messageClient(%TrueClientId, 'RPGchatCallback', %cropped @ " (" @ %id @ ") has stopped following its target.");
  3384.                                 }
  3385.                             }
  3386.                             else {
  3387.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Player must be a bot.");
  3388.                             }
  3389.                         }
  3390.                         else {
  3391.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  3392.                         }
  3393.                     }
  3394.                     else {
  3395.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  3396.                     }
  3397.                 }
  3398.                
  3399.                 return;
  3400.                
  3401.             case "#freeze":
  3402.                 if(%cropped !$= -1)
  3403.                 {
  3404.                     %id = getClientByName(%cropped);
  3405.                    
  3406.                     if(%id !$= -1)
  3407.                     {
  3408.                         if(IsInCommaList(fetchData(%TrueClientId, "PersonalPetList"), %id) || %clientToServerAdminLevel >= 1)
  3409.                         {
  3410.                             if(!%echoOff) {
  3411.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Freezing " @ %cropped @ " (" @ %id @ ").");
  3412.                             }
  3413.                            
  3414.                             %id.setControlObject(%id.camera);
  3415.                             storeData(%id, "frozen", true);
  3416.                            
  3417.                             if(%id.isAiControlled())
  3418.                             {
  3419.                                 //bot hack
  3420.                                 %tmp = %id.player;
  3421.                                 %client.setControlObject(%id.player);
  3422.                                 %client.setControlObject(%client.player);
  3423.                                 %id.player = %tmp;
  3424.                             }
  3425.                         }
  3426.                     }
  3427.                     else {
  3428.                         messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  3429.                     }
  3430.                 }
  3431.                 else {
  3432.                     messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  3433.                 }
  3434.                
  3435.                 return;
  3436.                
  3437.             case "#cancelfreeze":
  3438.                 if(%cropped !$= -1)
  3439.                 {
  3440.                     %id = getClientByName(%cropped);
  3441.                    
  3442.                     if(%id !$= -1)
  3443.                     {
  3444.                         if(IsInCommaList(fetchData(%TrueClientId, "PersonalPetList"), %id) || %clientToServerAdminLevel >= 1)
  3445.                         {
  3446.                             if(!%echoOff) {
  3447.                                 messageClient(%TrueClientId, 'RPGchatCallback', %cropped @ " (" @ %id @ ") is no longer frozen.");
  3448.                             }
  3449.                            
  3450.                             %id.setControlObject(%id.player);
  3451.                             storeData(%id, "frozen", "");
  3452.                         }
  3453.                     }
  3454.                     else {
  3455.                         messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  3456.                     }
  3457.                 }
  3458.                 else {
  3459.                     messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  3460.                 }
  3461.                
  3462.                 return;
  3463.                
  3464.             case "#kill":
  3465.                 if(%clientToServerAdminLevel >= 2)
  3466.                 {
  3467.                     if(%cropped !$= -1)
  3468.                     {
  3469.                         %id = getClientByName(%cropped);
  3470.                        
  3471.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  3472.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  3473.                         }
  3474.                         else if(%id !$= -1)
  3475.                         {
  3476.                             %id.player.scriptKill(0);
  3477.                            
  3478.                             if(!%echoOff) {
  3479.                                 messageClient(%TrueClientId, 'RPGchatCallback', %cropped @ " (" @ %id @ ") was executed.");
  3480.                             }
  3481.                         }
  3482.                         else if(!%echoOff) {
  3483.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  3484.                         }
  3485.                     }
  3486.                     else {
  3487.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  3488.                     }
  3489.                 }
  3490.                
  3491.                 return;
  3492.                
  3493.             case "#clearchar":
  3494.                 if(%clientToServerAdminLevel >= 5)
  3495.                 {
  3496.                     if(%cropped !$= -1)
  3497.                     {
  3498.                         %id = getClientByName(%cropped);
  3499.                        
  3500.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  3501.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  3502.                         }
  3503.                         else if(%id !$= -1)
  3504.                         {
  3505.                             %id.player.scriptKill(0);
  3506.                             ResetPlayer(%id);
  3507.                            
  3508.                             if(!%echoOff) {
  3509.                                 messageClient(%TrueClientId, 'RPGchatCallback', %cropped @ " (" @ %id @ ") profile was RESET.");
  3510.                             }
  3511.                         }
  3512.                         else {
  3513.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  3514.                         }
  3515.                     }
  3516.                     else {
  3517.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  3518.                     }
  3519.                 }
  3520.                
  3521.                 return;
  3522.         }
  3523.        
  3524.         //another break...
  3525.         switch$(%w1)
  3526.         {
  3527.             case "#spawn":
  3528.                 if(%clientToServerAdminLevel >= 3)
  3529.                 {
  3530.                     if(%cropped $= "") {
  3531.                         messageClient(%TrueClientId, 'RPGchatCallback', "syntax: #spawn botType displayName loadout [team] [x] [y] [z]");
  3532.                     }
  3533.                     else
  3534.                     {
  3535.                         %event = strstr(%cropped, ">");
  3536.                        
  3537.                         if(%event !$= -1)
  3538.                         {
  3539.                             %info = getsubstr(%cropped, 0, %event);
  3540.                             %cmd = getsubstr(%cropped, %event, 99999);
  3541.                         }
  3542.                         else {
  3543.                             %info = %cropped;
  3544.                         }
  3545.                        
  3546.                         %c1 = GetWord(%info, 0);
  3547.                         %c2 = GetWord(%info, 1);
  3548.                         %loadout = GetWord(%info, 2);
  3549.                         %team = GetWord(%info, 3);
  3550.                         %ox = GetWord(%info, 4);
  3551.                         %oy = GetWord(%info, 5);
  3552.                         %oz = GetWord(%info, 6);
  3553.                        
  3554.                         if(%c1 !$= -1 && %c2 !$= -1 && %loadout !$= -1)
  3555.                         {
  3556.                             if(getClientByName(%c2) $= -1)
  3557.                             {
  3558.                                 if(%ox $= -1 && %oy $= -1 && %oz $= -1)
  3559.                                 {
  3560.                                     %player = %TrueClientId.player;
  3561.                                     getLOSinfo(%TrueClientId, 50000);
  3562.                                     %lospos = $los::position;
  3563.                                 }
  3564.                                 else {
  3565.                                     %lospos = %ox @ " " @ %oy @ " " @ %oz;
  3566.                                 }
  3567.                                
  3568.                                 if(%team $= -1) {
  3569.                                     %team = 1;
  3570.                                 }
  3571.                                
  3572.                                 //%n = AI::helper(%c1, %c2, "TempSpawn " @ %lospos @ " " @ %team, %loadout);
  3573.                                 //%id = AI::getId(%n);
  3574.                                 %id = aiconnect(%c2, %team);
  3575.                                
  3576.                                 if(%event !$= -1) {
  3577.                                     AddEventCommand(%id, %senderName, "onkill", %cmd);
  3578.                                 }
  3579.                                
  3580.                                 if(!%echoOff) {
  3581.                                     messageClient(%TrueClientId, 'RPGchatCallback', "Spawned " @ %c2 @ " (" @ %id @ ") at " @ %id.player.getPosition() @ ".");
  3582.                                 }
  3583.                             }
  3584.                             else if(!%echoOff) {
  3585.                                 messageClient(%TrueClientId, 'RPGchatCallback', %c2 @ " already exists.");
  3586.                             }
  3587.                         }
  3588.                         else {
  3589.                             messageClient(%TrueClientId, 'RPGchatCallback', "syntax: #spawn botType displayName loadout [team] [x] [y] [z]");
  3590.                         }
  3591.                     }
  3592.                 }
  3593.                
  3594.                 return;
  3595.                
  3596.             case "#playanim":
  3597.                 if(%clientToServerAdminLevel >= 5)
  3598.                 {
  3599.                     if(%cropped $= "") {
  3600.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify animation.");
  3601.                     }
  3602.                     else
  3603.                     {
  3604.                         %anim = GetWord(%cropped, 0);
  3605.                         %sound = GetWord(%cropped, 1);
  3606.                        
  3607.                         if(%sound != -1 && %sound !$= "")
  3608.                         {
  3609.                        
  3610.                        
  3611.                         }
  3612.                        
  3613.                     }
  3614.                 }
  3615.                
  3616.                 return;
  3617.                
  3618.             case "#spawntestplayer":
  3619.                 if(%clientToServerAdminLevel >= 5)
  3620.                 {
  3621.                     if(%cropped $= "") {
  3622.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify animation.");
  3623.                     }
  3624.                     else
  3625.                     {
  3626.                         %tplayer = %cropped;
  3627.                        
  3628.                        
  3629.                     }
  3630.                 }
  3631.                
  3632.                 return;
  3633.                
  3634.             case "#gettransform":
  3635.                 if(%clienttoserverAdminLevel >=1)
  3636.                 {
  3637.                     if(%cropped $= "") {
  3638.                         messageClient(%TrueClientId, 'RPGchatCallback', "Transform" SPC %TrueClientID.player.getTransform());
  3639.                     }
  3640.                    
  3641.                 }
  3642.                
  3643.                 return;
  3644.                
  3645.         }
  3646.        
  3647.         //there appears to be a limit of ~74 cases per switch
  3648.         switch$(%w1)
  3649.         {
  3650.             case "#fell":
  3651.                 if(%clientToServerAdminLevel >= 2)
  3652.                 {
  3653.                     if(%cropped $= "") {
  3654.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  3655.                     }
  3656.                     else
  3657.                     {
  3658.                         %id = getClientByName(%cropped);
  3659.                        
  3660.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  3661.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  3662.                         }
  3663.                         else if(%id !$= -1)
  3664.                         {
  3665.                             if(!%echoOff) {
  3666.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Processing fell-off-map for " @ %cropped @ " (" @ %id @ ")");
  3667.                             }
  3668.                            
  3669.                             //Zone::handleTeleport(fetchdata(%id, "zone"), %id);
  3670.                             FellOffMap(%id);
  3671.                         }
  3672.                         else {
  3673.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  3674.                         }
  3675.                     }
  3676.                 }
  3677.                
  3678.                 return;
  3679.                
  3680.             case "#getstorage":
  3681.                 if(%clientToServerAdminLevel >= 1)
  3682.                 {
  3683.                     if(%cropped $= "") {
  3684.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  3685.                     }
  3686.                     else
  3687.                     {
  3688.                         %id = getClientByName(%cropped);
  3689.                        
  3690.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  3691.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  3692.                         }
  3693.                         else if(%id !$= -1)
  3694.                         {
  3695.                             messageClient(%TrueClientId, 'RPGchatCallback', %id @ ": " @ fetchData(%id, "BankStorage"));
  3696.                         }
  3697.                         else {
  3698.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  3699.                         }
  3700.                     }
  3701.                 }
  3702.                
  3703.                 return;
  3704.                
  3705.             case "#clearstorage":
  3706.                 if(%clientToServerAdminLevel >= 4)
  3707.                 {
  3708.                     if(%cropped $= "") {
  3709.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  3710.                     }
  3711.                     else
  3712.                     {
  3713.                         %id = getClientByName(%cropped);
  3714.                        
  3715.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  3716.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  3717.                         }
  3718.                         else if(%id !$= -1)
  3719.                         {
  3720.                             storeData(%id, "BankStorage", "");
  3721.                            
  3722.                             if(!%echoOff) {
  3723.                                 messageClient(%TrueClientId, 'RPGchatCallback', %id @ " bank storage cleared.");
  3724.                             }
  3725.                         }
  3726.                         else {
  3727.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  3728.                         }
  3729.                     }
  3730.                 }
  3731.                
  3732.                 return;
  3733.                
  3734.             case "#setstorage":
  3735.                 if(%clientToServerAdminLevel >= 4)
  3736.                 {
  3737.                     %name = GetWord(%cropped, 0);
  3738.                    
  3739.                     %id = getClientByName(%name);
  3740.                    
  3741.                     if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  3742.                         messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  3743.                     }
  3744.                     else if(%id !$= -1)
  3745.                     {
  3746.                         storeData(%id, "BankStorage", SetStuffString(fetchData(%id, "BankStorage"), GetWord(%cropped, 1), GetWord(%cropped, 2)));
  3747.                        
  3748.                         if(!%echoOff) {
  3749.                             messageClient(%TrueClientId, 'RPGchatCallback', %id @ " bank storage modified. Use #getstorage [name] to view.");
  3750.                         }
  3751.                     }
  3752.                     else {
  3753.                         messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  3754.                     }
  3755.                 }
  3756.                
  3757.                 return;
  3758.                
  3759.             case "#addsp":
  3760.                 if(%clientToServerAdminLevel >= 3)
  3761.                 {
  3762.                     %c1 = GetWord(%cropped, 0);
  3763.                     %c2 = GetWord(%cropped, 1);
  3764.                    
  3765.                     if(%c1 !$= -1 && %c2 !$= -1)
  3766.                     {
  3767.                         %id = getClientByName(%c1);
  3768.                        
  3769.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  3770.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  3771.                         }
  3772.                         else if(%id !$= -1)
  3773.                         {
  3774.                             storeData(%id, "SP", %c2, "inc");
  3775.                             RefreshAll(%id);
  3776.                            
  3777.                             if(!%echoOff) {
  3778.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Setting " @ %c1 @ " (" @ %id @ ") SP credits to " @ fetchData(%id, "SP") @ ".");
  3779.                             }
  3780.                         }
  3781.                         else {
  3782.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  3783.                         }
  3784.                     }
  3785.                     else {
  3786.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name & data.");
  3787.                     }
  3788.                 }
  3789.                
  3790.                 return;
  3791.                
  3792.             case "#setsp":
  3793.                 if(%clientToServerAdminLevel >= 3)
  3794.                 {
  3795.                     %c1 = GetWord(%cropped, 0);
  3796.                     %c2 = GetWord(%cropped, 1);
  3797.                    
  3798.                     if(%c1 !$= -1 && %c2 !$= -1)
  3799.                     {
  3800.                         %id = getClientByName(%c1);
  3801.                        
  3802.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  3803.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  3804.                         }
  3805.                         else if(%id !$= -1)
  3806.                         {
  3807.                             storeData(%id, "SP", %c2);
  3808.                             RefreshAll(%id);
  3809.                            
  3810.                             if(!%echoOff) {
  3811.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Setting " @ %c1 @ " (" @ %id @ ") SP credits to " @ fetchData(%id, "SP") @ ".");
  3812.                             }
  3813.                         }
  3814.                         else {
  3815.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  3816.                         }
  3817.                     }
  3818.                     else {
  3819.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name & data.");
  3820.                     }
  3821.                 }
  3822.                
  3823.                 return;
  3824.                
  3825.             case "#addlck":
  3826.                 if(%clientToServerAdminLevel >= 3)
  3827.                 {
  3828.                     %c1 = GetWord(%cropped, 0);
  3829.                     %c2 = GetWord(%cropped, 1);
  3830.                    
  3831.                     if(%c1 !$= "" && %c2 !$= "")
  3832.                     {
  3833.                         %id = getClientByName(%c1);
  3834.                        
  3835.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  3836.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  3837.                         }
  3838.                         else if(%id !$= -1)
  3839.                         {
  3840.                             storeData(%id, "LCK", %c2, "inc");
  3841.                             RefreshAll(%id);
  3842.                            
  3843.                             if(!%echoOff) {
  3844.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Setting " @ %c1 @ " (" @ %id @ ") base LCK to " @ fetchData(%id, "LCK") @ ".");
  3845.                             }
  3846.                         }
  3847.                         else {
  3848.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  3849.                         }
  3850.                     }
  3851.                     else {
  3852.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name & data.");
  3853.                     }
  3854.                 }
  3855.                
  3856.                 return;
  3857.                
  3858.             case "#sethp":
  3859.                 if(%clientToServerAdminLevel >= 2)
  3860.                 {
  3861.                     %c1 = GetWord(%cropped, 0);
  3862.                     %c2 = GetWord(%cropped, 1);
  3863.                    
  3864.                     if(%c1 !$= -1 && %c2 !$= -1)
  3865.                     {
  3866.                         %id = getClientByName(%c1);
  3867.                        
  3868.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  3869.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  3870.                         }
  3871.                         else if(%id !$= -1)
  3872.                         {
  3873.                             %max = fetchData(%id, "MaxHP");
  3874.                            
  3875.                             if(%c2 < 1) {
  3876.                                 %c2 = 1;
  3877.                             }
  3878.                             else if(%c2 > %max) {
  3879.                                 %c2 = %max;
  3880.                             }
  3881.                            
  3882.                             setHP(%id, %c2);
  3883.                            
  3884.                             if(!%echoOff) {
  3885.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Setting " @ %c1 @ " (" @ %id @ ") HP to " @ fetchData(%id, "HP") @ ".");
  3886.                             }
  3887.                         }
  3888.                         else {
  3889.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  3890.                         }
  3891.                     }
  3892.                     else {
  3893.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name & data.");
  3894.                     }
  3895.                 }
  3896.                
  3897.                 return;
  3898.                
  3899.             case "#setmana":
  3900.                 if(%clientToServerAdminLevel >= 2)
  3901.                 {
  3902.                     %c1 = GetWord(%cropped, 0);
  3903.                     %c2 = GetWord(%cropped, 1);
  3904.                    
  3905.                     if(%c1 !$= -1 && %c2 !$= -1)
  3906.                     {
  3907.                         %id = getClientByName(%c1);
  3908.                        
  3909.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  3910.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  3911.                         }
  3912.                         else if(%id !$= -1)
  3913.                         {
  3914.                             %max = fetchData(%id, "MaxMANA");
  3915.                            
  3916.                             if(%c2 < 0) {
  3917.                                 %c2 = 0;
  3918.                             }
  3919.                             else if(%c2 > %max) {
  3920.                                 %c2 = %max;
  3921.                             }
  3922.                            
  3923.                             setMANA(%id, %c2);
  3924.                            
  3925.                             if(!%echoOff) {
  3926.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Setting " @ %c1 @ " (" @ %id @ ") MANA to " @ fetchData(%id, "MANA") @ ".");
  3927.                             }
  3928.                         }
  3929.                         else {
  3930.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  3931.                         }
  3932.                     }
  3933.                     else {
  3934.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name & data.");
  3935.                     }
  3936.                 }
  3937.                
  3938.                 return;
  3939.                
  3940.             case "#addexp":
  3941.                 if(%clientToServerAdminLevel >= 3)
  3942.                 {
  3943.                     %c1 = GetWord(%cropped, 0);
  3944.                     %c2 = GetWord(%cropped, 1);
  3945.                    
  3946.                     if(%c1 !$= -1 && %c2 !$= -1)
  3947.                     {
  3948.                         %id = getClientByName(%c1);
  3949.                        
  3950.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  3951.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  3952.                         }
  3953.                         else if(%id !$= -1)
  3954.                         {
  3955.                             storeData(%id, "EXP", %c2, "inc");
  3956.                            
  3957.                             if(%id.isAiControlled()) {
  3958.                                 HardcodeAIskills(%id);
  3959.                             }
  3960.                            
  3961.                             RefreshExp(%id);
  3962.                            
  3963.                             if(!%echoOff) {
  3964.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Setting " @ %c1 @ " (" @ %id @ ") EXP to " @ fetchData(%id, "EXP") @ ".");
  3965.                             }
  3966.                         }
  3967.                         else {
  3968.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  3969.                         }
  3970.                     }
  3971.                     else {
  3972.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name & data.");
  3973.                     }
  3974.                 }
  3975.                
  3976.                 return;
  3977.                
  3978.             case "#setexp":
  3979.                 if(%clientToServerAdminLevel >= 3)
  3980.                 {
  3981.                     %c1 = GetWord(%cropped, 0);
  3982.                     %c2 = GetWord(%cropped, 1);
  3983.                    
  3984.                     if(%c1 !$= -1 && %c2 !$= -1)
  3985.                     {
  3986.                         %id = getClientByName(%c1);
  3987.                        
  3988.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  3989.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  3990.                         }
  3991.                         else if(%id !$= -1)
  3992.                         {
  3993.                             storeData(%id, "EXP", %c2);
  3994.                             RefreshExp(%id);
  3995.                            
  3996.                             if(!%echoOff) {
  3997.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Setting " @ %c1 @ " (" @ %id @ ") EXP to " @ fetchData(%id, "EXP") @ ".");
  3998.                             }
  3999.                         }
  4000.                         else {
  4001.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  4002.                         }
  4003.                     }
  4004.                     else {
  4005.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name & data.");
  4006.                     }
  4007.                 }
  4008.                
  4009.                 return;
  4010.                
  4011.             case "#addcoins":
  4012.                 if(%clientToServerAdminLevel >= 2)
  4013.                 {
  4014.                     %c1 = GetWord(%cropped, 0);
  4015.                     %c2 = GetWord(%cropped, 1);
  4016.                    
  4017.                     if(%c1 !$= -1 && %c2 !$= -1)
  4018.                     {
  4019.                         %id = getClientByName(%c1);
  4020.                        
  4021.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  4022.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  4023.                         }
  4024.                         else if(%id !$= -1)
  4025.                         {
  4026.                             storeData(%id, "COINS", %c2, "inc");
  4027.                             RefreshAll(%id);
  4028.                            
  4029.                             if(!%echoOff) {
  4030.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Setting " @ %c1 @ " (" @ %id @ ") COINS to " @ fetchData(%id, "COINS") @ ".");
  4031.                             }
  4032.                         }
  4033.                         else {
  4034.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  4035.                         }
  4036.                     }
  4037.                     else {
  4038.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name & data.");
  4039.                     }
  4040.                 }
  4041.                
  4042.                 return;
  4043.                
  4044.             case "#addbank":
  4045.                 if(%clientToServerAdminLevel >= 2)
  4046.                 {
  4047.                     %c1 = GetWord(%cropped, 0);
  4048.                     %c2 = GetWord(%cropped, 1);
  4049.                    
  4050.                     if(%c1 !$= -1 && %c2 !$= -1)
  4051.                     {
  4052.                         %id = getClientByName(%c1);
  4053.                        
  4054.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  4055.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  4056.                         }
  4057.                         else if(%id !$= -1)
  4058.                         {
  4059.                             storeData(%id, "BANK", %c2, "inc");
  4060.                             RefreshAll(%id);
  4061.                            
  4062.                             if(!%echoOff) {
  4063.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Setting " @ %c1 @ " (" @ %id @ ") BANK to " @ fetchData(%id, "BANK") @ ".");
  4064.                             }
  4065.                         }
  4066.                         else {
  4067.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  4068.                         }
  4069.                     }
  4070.                     else {
  4071.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name & data.");
  4072.                     }
  4073.                 }
  4074.                
  4075.                 return;
  4076.                
  4077.             case "#setteam":
  4078.                 if(%clientToServerAdminLevel >= 2)
  4079.                 {
  4080.                     %c1 = GetWord(%cropped, 0);
  4081.                     %c2 = GetWord(%cropped, 1);
  4082.                    
  4083.                     if(%c1 !$= -1 && %c2 !$= -1)
  4084.                     {
  4085.                         %id = getClientByName(%c1);
  4086.                        
  4087.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  4088.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  4089.                         }
  4090.                         else if(%id !$= -1)
  4091.                         {
  4092.                        
  4093.                             %id.team = %c2;
  4094.                            
  4095.                             //RefreshAll(%id);
  4096.                             if(!%echoOff) {
  4097.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Setting " @ %c1 @ " (" @ %id @ ") team to " @ %id.team @ ".");
  4098.                             }
  4099.                         }
  4100.                         else {
  4101.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  4102.                         }
  4103.                     }
  4104.                     else {
  4105.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name & data.");
  4106.                     }
  4107.                 }
  4108.                
  4109.                 return;
  4110.                
  4111.             case "#setrace":
  4112.                 if(%clientToServerAdminLevel >= 3)
  4113.                 {
  4114.                     %c1 = GetWord(%cropped, 0);
  4115.                     %c2 = GetWord(%cropped, 1);
  4116.                    
  4117.                     if(%c1 !$= -1 && %c2 !$= -1)
  4118.                     {
  4119.                         %id = getClientByName(%c1);
  4120.                        
  4121.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  4122.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  4123.                         }
  4124.                         else if(%id !$= -1)
  4125.                         {
  4126.                             if(%c2 $= "DeathKnight" && %clientToServerAdminLevel >= 4 || %c2 !$= "DeathKnight") {
  4127.                                 ChangeRace(%id, %c2, %clientToServerAdminLevel);
  4128.                             }
  4129.                            
  4130.                             if(!%echoOff) {
  4131.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Changed " @ %c1 @ " (" @ %id @ ") race to " @ fetchData(%id, "RACE") @ ".");
  4132.                             }
  4133.                         }
  4134.                         else {
  4135.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  4136.                         }
  4137.                     }
  4138.                     else {
  4139.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name & data.");
  4140.                     }
  4141.                 }
  4142.                
  4143.                 return;
  4144.                
  4145.             case "#setinvis":
  4146.                 if(%clientToServerAdminLevel >= 2)
  4147.                 {
  4148.                     %c1 = GetWord(%cropped, 0);
  4149.                     %c2 = GetWord(%cropped, 1);
  4150.                    
  4151.                     if(%c1 !$= -1 && %c2 !$= -1)
  4152.                     {
  4153.                         %id = getClientByName(%c1);
  4154.                        
  4155.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  4156.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  4157.                         }
  4158.                         else if(%id !$= -1)
  4159.                         {
  4160.                             if(%c2 $= 0)
  4161.                             {
  4162.                                 if(fetchData(%id, "invisible")) {
  4163.                                     UnHide(%id);
  4164.                                 }
  4165.                             }
  4166.                             else if(%c2 $= 1)
  4167.                             {
  4168.                                 if(!fetchData(%id, "invisible")) {
  4169.                                     GameBase::startFadeOut(%id);
  4170.                                 }
  4171.                                
  4172.                                 storeData(%id, "invisible", true);
  4173.                             }
  4174.                            
  4175.                             if(!%echoOff) {
  4176.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Changed " @ %c1 @ " (" @ %id @ ") invisible state to " @ %c2 @ ".");
  4177.                             }
  4178.                         }
  4179.                         else {
  4180.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  4181.                         }
  4182.                     }
  4183.                     else {
  4184.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name & data.");
  4185.                     }
  4186.                 }
  4187.                
  4188.                 return;
  4189.                
  4190.             case "#dumbai":
  4191.                 if(%clientToServerAdminLevel >= 2)
  4192.                 {
  4193.                     %c1 = GetWord(%cropped, 0);
  4194.                     %c2 = GetWord(%cropped, 1);
  4195.                    
  4196.                     if(%c1 !$= -1 && %c2 !$= -1)
  4197.                     {
  4198.                         %id = getClientByName(%c1);
  4199.                        
  4200.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  4201.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  4202.                         }
  4203.                         else if(%id !$= -1)
  4204.                         {
  4205.                             if(%c2 $= 0) {
  4206.                                 storeData(%id, "dumbAIflag", "");
  4207.                             }
  4208.                             else if(%c2 $= 1) {
  4209.                                 storeData(%id, "dumbAIflag", true);
  4210.                             }
  4211.                            
  4212.                             if(!%echoOff) {
  4213.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Changed " @ %c1 @ " (" @ %id @ ") dumb AI flag state to '" @ fetchData(%id, "dumbAIflag") @ "'.");
  4214.                             }
  4215.                         }
  4216.                         else {
  4217.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  4218.                         }
  4219.                     }
  4220.                     else {
  4221.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name & data.");
  4222.                     }
  4223.                 }
  4224.                
  4225.                 return;
  4226.                
  4227.             case "#getlck":
  4228.                 if(%clientToServerAdminLevel >= 1)
  4229.                 {
  4230.                     if(%cropped !$= -1)
  4231.                     {
  4232.                         %id = getClientByName(%cropped);
  4233.                        
  4234.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  4235.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  4236.                         }
  4237.                         else if(%id !$= -1) {
  4238.                             messageClient(%TrueClientId, 'RPGchatCallback', %cropped @ " (" @ %id @ ") base LCK is " @ fetchData(%id, "LCK") @ ".");
  4239.                         }
  4240.                         else {
  4241.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  4242.                         }
  4243.                     }
  4244.                     else {
  4245.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  4246.                     }
  4247.                 }
  4248.                
  4249.                 return;
  4250.                
  4251.             case "#gethp":
  4252.                 if(%clientToServerAdminLevel >= 1)
  4253.                 {
  4254.                     if(%cropped !$= "")
  4255.                     {
  4256.                         %id = getClientByName(%cropped);
  4257.                        
  4258.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  4259.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  4260.                         }
  4261.                         else if(%id !$= -1) {
  4262.                             messageClient(%TrueClientId, 'RPGchatCallback', %cropped @ " (" @ %id @ ") HP is " @ fetchData(%id, "HP") @ ".");
  4263.                         }
  4264.                         else {
  4265.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  4266.                         }
  4267.                     }
  4268.                     else {
  4269.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  4270.                     }
  4271.                 }
  4272.                
  4273.                 return;
  4274.                
  4275.             case "#getmana":
  4276.                 if(%clientToServerAdminLevel >= 1)
  4277.                 {
  4278.                     if(%cropped !$= "")
  4279.                     {
  4280.                         %id = getClientByName(%cropped);
  4281.                        
  4282.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  4283.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  4284.                         }
  4285.                         else if(%id !$= -1) {
  4286.                             messageClient(%TrueClientId, 'RPGchatCallback', %cropped @ " (" @ %id @ ") MANA is " @ fetchData(%id, "MANA") @ ".");
  4287.                         }
  4288.                         else {
  4289.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  4290.                         }
  4291.                     }
  4292.                     else {
  4293.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  4294.                     }
  4295.                 }
  4296.                
  4297.                 return;
  4298.                
  4299.             case "#getmaxhp":
  4300.                 if(%clientToServerAdminLevel >= 1)
  4301.                 {
  4302.                     if(%cropped !$= "")
  4303.                     {
  4304.                         %id = getClientByName(%cropped);
  4305.                        
  4306.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  4307.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  4308.                         }
  4309.                         else if(%id !$= -1) {
  4310.                             messageClient(%TrueClientId, 'RPGchatCallback', %cropped @ " (" @ %id @ ") max HP is " @ fetchData(%id, "MaxHP") @ ".");
  4311.                         }
  4312.                         else {
  4313.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  4314.                         }
  4315.                     }
  4316.                     else {
  4317.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  4318.                     }
  4319.                 }
  4320.                
  4321.                 return;
  4322.                
  4323.             case "#getmaxmana":
  4324.                 if(%clientToServerAdminLevel >= 1)
  4325.                 {
  4326.                     if(%cropped !$= "")
  4327.                     {
  4328.                         %id = getClientByName(%cropped);
  4329.                        
  4330.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  4331.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  4332.                         }
  4333.                         else if(%id !$= -1) {
  4334.                             messageClient(%TrueClientId, 'RPGchatCallback', %cropped @ " (" @ %id @ ") max MANA is " @ fetchData(%id, "MaxMANA") @ ".");
  4335.                         }
  4336.                         else {
  4337.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  4338.                         }
  4339.                     }
  4340.                     else {
  4341.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  4342.                     }
  4343.                 }
  4344.                
  4345.                 return;
  4346.                
  4347.             case "#getexp":
  4348.                 if(%clientToServerAdminLevel >= 1)
  4349.                 {
  4350.                     if(%cropped !$= -1)
  4351.                     {
  4352.                         %cl = getClientByName(%cropped);
  4353.                        
  4354.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  4355.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  4356.                         }
  4357.                         else if(%id !$= -1) {
  4358.                             messageClient(%TrueClientId, 'RPGchatCallback', %cropped @ " (" @ %cl @ ") EXP is " @ fetchData(%cl, "EXP") @ ".");
  4359.                         }
  4360.                         else {
  4361.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  4362.                         }
  4363.                     }
  4364.                     else {
  4365.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  4366.                     }
  4367.                 }
  4368.                
  4369.                 return;
  4370.                
  4371.             case "#getcoins":
  4372.                 if(%clientToServerAdminLevel >= 1)
  4373.                 {
  4374.                     if(%cropped !$= -1)
  4375.                     {
  4376.                         %id = getClientByName(%cropped);
  4377.                        
  4378.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  4379.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  4380.                         }
  4381.                         else if(%id !$= -1) {
  4382.                             messageClient(%TrueClientId, 'RPGchatCallback', %cropped @ " (" @ %id @ ") COINS is " @ fetchData(%id, "COINS") @ ".");
  4383.                         }
  4384.                         else {
  4385.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  4386.                         }
  4387.                     }
  4388.                     else {
  4389.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  4390.                     }
  4391.                 }
  4392.                
  4393.                 return;
  4394.                
  4395.             case "#getbank":
  4396.                 if(%clientToServerAdminLevel >= 1)
  4397.                 {
  4398.                     if(%cropped !$= -1)
  4399.                     {
  4400.                         %id = getClientByName(%cropped);
  4401.                        
  4402.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  4403.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  4404.                         }
  4405.                         else if(%id !$= -1) {
  4406.                             messageClient(%TrueClientId, 'RPGchatCallback', %cropped @ " (" @ %id @ ") BANK is " @ fetchData(%id, "BANK") @ ".");
  4407.                         }
  4408.                         else {
  4409.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  4410.                         }
  4411.                     }
  4412.                     else {
  4413.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  4414.                     }
  4415.                 }
  4416.                
  4417.                 return;
  4418.                
  4419.             case "#getteam":
  4420.                 if(%clientToServerAdminLevel >= 1)
  4421.                 {
  4422.                     if(%cropped !$= -1)
  4423.                     {
  4424.                         %id = getClientByName(%cropped);
  4425.                        
  4426.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  4427.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  4428.                         }
  4429.                         else if(%id !$= -1) {
  4430.                             messageClient(%TrueClientId, 'RPGchatCallback', %cropped @ " (" @ %id @ ") team is " @ %id.team @ ".");
  4431.                         }
  4432.                         else {
  4433.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  4434.                         }
  4435.                     }
  4436.                     else {
  4437.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  4438.                     }
  4439.                 }
  4440.                
  4441.                 return;
  4442.                
  4443.             case "#getclientid":
  4444.                 if(%clientToServerAdminLevel >= 1)
  4445.                 {
  4446.                     if(%cropped !$= -1)
  4447.                     {
  4448.                         %id = getClientByName(%cropped);
  4449.                        
  4450.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  4451.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  4452.                         }
  4453.                         else if(%id !$= -1) {
  4454.                             messageClient(%TrueClientId, 'RPGchatCallback', %cropped @ " clientId is " @ %id @ ".");
  4455.                         }
  4456.                         else {
  4457.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  4458.                         }
  4459.                     }
  4460.                     else {
  4461.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  4462.                     }
  4463.                 }
  4464.                
  4465.                 return;
  4466.                
  4467.             case "#getuniqueid":
  4468.                 if(%clientToServerAdminLevel >= 1)
  4469.                 {
  4470.                     if(%cropped !$= -1)
  4471.                     {
  4472.                         %id = getClientByName(%cropped);
  4473.                        
  4474.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  4475.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  4476.                         }
  4477.                         else if(%id !$= -1) {
  4478.                             messageClient(%TrueClientId, 'RPGchatCallback', %cropped @ " Global Unique ID is " @ %id.guid @ ".");
  4479.                         }
  4480.                         else {
  4481.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  4482.                         }
  4483.                     }
  4484.                     else {
  4485.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  4486.                     }
  4487.                 }
  4488.                
  4489.                 return;
  4490.                
  4491.             case "#getplayerid":
  4492.                 if(%clientToServerAdminLevel >= 1)
  4493.                 {
  4494.                     if(%cropped !$= -1)
  4495.                     {
  4496.                         %id = getClientByName(%cropped);
  4497.                        
  4498.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  4499.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  4500.                         }
  4501.                         else if(%id !$= -1) {
  4502.                             messageClient(%TrueClientId, 'RPGchatCallback', %cropped @ " playerId is " @ %id.player @ ".");
  4503.                         }
  4504.                         else {
  4505.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  4506.                         }
  4507.                     }
  4508.                     else {
  4509.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  4510.                     }
  4511.                 }
  4512.                
  4513.                 return;
  4514.                
  4515.             case "#getname":
  4516.                 if(%clientToServerAdminLevel >= 1)
  4517.                 {
  4518.                     if(%cropped !$= -1)
  4519.                     {
  4520.                         %n = %cropped.nameBase;
  4521.                        
  4522.                         if(%n !$= "") {
  4523.                             messageClient(%TrueClientId, 'RPGchatCallback', %cropped @ " name is " @ %n @ ".");
  4524.                         }
  4525.                         else {
  4526.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid clientId.");
  4527.                         }
  4528.                     }
  4529.                     else {
  4530.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify a clientId.");
  4531.                     }
  4532.                 }
  4533.                
  4534.                 return;
  4535.                
  4536.             case "#getpassword":
  4537.                 if(%clientToServerAdminLevel >= 5)
  4538.                 {
  4539.                     if(%cropped !$= -1)
  4540.                     {
  4541.                         %id = getClientByName(%cropped);
  4542.                        
  4543.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  4544.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  4545.                         }
  4546.                         else if(%id !$= -1) {
  4547.                             messageClient(%TrueClientId, 'RPGchatCallback', %cropped @ " password[" @ %id @ "] is " @ fetchData(%id, "password") @ ".");
  4548.                         }
  4549.                         else {
  4550.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  4551.                         }
  4552.                     }
  4553.                     else {
  4554.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  4555.                     }
  4556.                 }
  4557.                
  4558.                 return;
  4559.                
  4560.             case "#getotherinfo":
  4561.                 if(%clientToServerAdminLevel >= 5)
  4562.                 {
  4563.                     if(%cropped !$= -1)
  4564.                     {
  4565.                         %id = getClientByName(%cropped);
  4566.                        
  4567.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  4568.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  4569.                         }
  4570.                         else if(%id !$= -1) {
  4571.                             messageClient(%TrueClientId, 'RPGchatCallback', %cropped @ " $Client::info[" @ %id @ ", 5] is " @ $Client::info[%id, 5] @ ".");
  4572.                         }
  4573.                         else {
  4574.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  4575.                         }
  4576.                     }
  4577.                     else {
  4578.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  4579.                     }
  4580.                 }
  4581.                
  4582.                 return;
  4583.                
  4584.             case "#getlvl":
  4585.                 if(%clientToServerAdminLevel >= 1)
  4586.                 {
  4587.                     if(%cropped !$= -1)
  4588.                     {
  4589.                         %id = getClientByName(%cropped);
  4590.                        
  4591.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  4592.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  4593.                         }
  4594.                         else if(%id !$= -1) {
  4595.                             messageClient(%TrueClientId, 'RPGchatCallback', %cropped @ " (" @ %id @ ") LEVEL is " @ fetchData(%id, "LVL") @ ".");
  4596.                         }
  4597.                         else {
  4598.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  4599.                         }
  4600.                     }
  4601.                     else {
  4602.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  4603.                     }
  4604.                 }
  4605.                
  4606.                 return;
  4607.                
  4608.             case "#getfinallck":
  4609.                 if(%clientToServerAdminLevel >= 1)
  4610.                 {
  4611.                     if(%cropped !$= -1)
  4612.                     {
  4613.                         %id = getClientByName(%cropped);
  4614.                        
  4615.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  4616.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  4617.                         }
  4618.                         else if(%id !$= -1) {
  4619.                             messageClient(%TrueClientId, 'RPGchatCallback', %cropped @ " (" @ %id @ ") final LCK is " @ fetchData(%id, "LCK") @ ".");
  4620.                         }
  4621.                         else {
  4622.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  4623.                         }
  4624.                     }
  4625.                     else {
  4626.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  4627.                     }
  4628.                 }
  4629.                
  4630.                 return;
  4631.                
  4632.             case "#getfinaldef":
  4633.                 if(%clientToServerAdminLevel >= 1)
  4634.                 {
  4635.                     if(%cropped !$= -1)
  4636.                     {
  4637.                         %id = getClientByName(%cropped);
  4638.                        
  4639.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  4640.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  4641.                         }
  4642.                         else if(%id !$= -1) {
  4643.                             messageClient(%TrueClientId, 'RPGchatCallback', %cropped @ " (" @ %id @ ") max DEF roll is " @ fetchData(%id, "DEF") @ ".");
  4644.                         }
  4645.                         else {
  4646.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  4647.                         }
  4648.                     }
  4649.                     else {
  4650.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  4651.                     }
  4652.                 }
  4653.                
  4654.                 return;
  4655.                
  4656.             case "#getfinalatk":
  4657.                 if(%clientToServerAdminLevel >= 1)
  4658.                 {
  4659.                     if(%cropped !$= -1)
  4660.                     {
  4661.                         %id = getClientByName(%cropped);
  4662.                        
  4663.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  4664.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  4665.                         }
  4666.                         else if(%id !$= -1) {
  4667.                             messageClient(%TrueClientId, 'RPGchatCallback', %cropped @ " (" @ %id @ ") max ATK roll is " @ fetchData(%id, "ATK") @ ".");
  4668.                         }
  4669.                         else {
  4670.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  4671.                         }
  4672.                     }
  4673.                     else {
  4674.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  4675.                     }
  4676.                 }
  4677.                
  4678.                 return;
  4679.                
  4680.             case "#exportchat":
  4681.                 if(%clientToServerAdminLevel >= 5)
  4682.                 {
  4683.                     if(%cropped !$= "")
  4684.                     {
  4685.                         if(%cropped $= "0") {
  4686.                             $exportChat = false;
  4687.                         }
  4688.                         else if(%cropped $= "1") {
  4689.                             $exportChat = true;
  4690.                         }
  4691.                        
  4692.                         if(!%echoOff) {
  4693.                             messageClient(%TrueClientId, 'RPGchatCallback', "exportChat set to " @ $exportChat @ ".");
  4694.                         }
  4695.                     }
  4696.                     else {
  4697.                         messageClient(%TrueClientId, 'RPGchatCallback', "Specify 1 or 0 (1 = true, 0 = false).");
  4698.                     }
  4699.                 }
  4700.                
  4701.                 return;
  4702.                
  4703.             case "#doexport":
  4704.                 if(%clientToServerAdminLevel >= 2)
  4705.                 {
  4706.                     %c1 = GetWord(%cropped, 0);
  4707.                     %c2 = GetWord(%cropped, 1);
  4708.                    
  4709.                     if(%c1 !$= -1 && %c2 !$= -1)
  4710.                     {
  4711.                         %id = getClientByName(%c1);
  4712.                        
  4713.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  4714.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  4715.                         }
  4716.                         else if(%id !$= -1)
  4717.                         {
  4718.                             if(%c2 $= 0) {
  4719.                                 %id.doExport = false;
  4720.                             }
  4721.                             else if(%c2 $= 1) {
  4722.                                 %id.doExport = true;
  4723.                             }
  4724.                            
  4725.                             if(!%echoOff) {
  4726.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Changed " @ %c1 @ " (" @ %id @ ") doExport to " @ %id.doExport @ ".");
  4727.                             }
  4728.                         }
  4729.                         else {
  4730.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  4731.                         }
  4732.                     }
  4733.                     else {
  4734.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name & data.");
  4735.                     }
  4736.                 }
  4737.                
  4738.                 return;
  4739.                
  4740.             case "#getip":
  4741.                 if(%clientToServerAdminLevel >= 3)
  4742.                 {
  4743.                     if(%cropped !$= "")
  4744.                     {
  4745.                         %id = getClientByName(%cropped);
  4746.                        
  4747.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  4748.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  4749.                         }
  4750.                         else if(%id !$= -1) {
  4751.                             messageClient(%TrueClientId, 'RPGchatCallback', %cropped @ " (" @ %id @ ") IP is " @ %id.getAddress());
  4752.                         }
  4753.                         else {
  4754.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  4755.                         }
  4756.                     }
  4757.                     else {
  4758.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  4759.                     }
  4760.                 }
  4761.                
  4762.                 return;
  4763.                
  4764.             case "#spawnpack":
  4765.                 return;
  4766.                
  4767.                 if(%clientToServerAdminLevel >= 3)
  4768.                 {
  4769.                     if(%cropped !$= "")
  4770.                     {
  4771.                         %event = strstr(%cropped, ">");
  4772.                        
  4773.                         if(%event !$= -1)
  4774.                         {
  4775.                             %info = getsubstr(%cropped, 0, %event);
  4776.                             %cmd = getsubstr(%cropped, %event, 99999);
  4777.                         }
  4778.                         else {
  4779.                             %info = %cropped;
  4780.                         }
  4781.                        
  4782.                         %div = strstr(%info, "|");
  4783.                        
  4784.                         if(%div !$= -1)
  4785.                         {
  4786.                             %a = getsubstr(%info, 0, %div-1);
  4787.                             %tag = GetWord(%a, 0);
  4788.                             %ox = GetWord(%a, 1);
  4789.                             %oy = GetWord(%a, 2);
  4790.                             %oz = GetWord(%a, 3);
  4791.                            
  4792.                             if(%ox $= -1 && %oy $= -1 && %oz $= -1)
  4793.                             {
  4794.                                 //didn't enter coordinates.
  4795.                                 getLOSinfo(%TrueClientId, 50000);
  4796.                                 %pos = $los::position;
  4797.                             }
  4798.                             else {
  4799.                                 %pos = %ox @ " " @ %oy @ " " @ %oz;
  4800.                             }
  4801.                            
  4802.                             if(!IsInCommaList($SpawnPackList, %tag))
  4803.                             {
  4804.                                 %pack = getsubstr(%info, %div+1, 99999);
  4805.                                 %pid = DeployLootbag(%pos, "0 0 0", %pack);
  4806.                                 $SpawnPackList = AddToCommaList($SpawnPackList, %tag);
  4807.                                 $tagToObjectId[%tag] = %pid;
  4808.                                 %pid.tag = %tag;
  4809.                                
  4810.                                 if(%event !$= -1) {
  4811.                                     AddEventCommand(%pid, %senderName, "onpickup", %cmd);
  4812.                                 }
  4813.                                
  4814.                                 if(!%echoOff) {
  4815.                                     messageClient(%TrueClientId, 'RPGchatCallback', "Spawned pack (" @ %pid @ ") at position " @ %pos @ ".");
  4816.                                 }
  4817.                             }
  4818.                             else {
  4819.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Tagname " @ %tag @ " already exists.");
  4820.                             }
  4821.                         }
  4822.                         else {
  4823.                             messageClient(%TrueClientId, 'RPGchatCallback', "Divider not found. Type #spawnpack with no parameters to get a quick overview.");
  4824.                         }
  4825.                     }
  4826.                     else {
  4827.                         messageClient(%TrueClientId, 'RPGchatCallback', "#spawnpack tagname [x] [y] [z] | packstring. Use this command only if you know what you're doing.");
  4828.                     }
  4829.                 }
  4830.                
  4831.                 return;
  4832.                
  4833.             case "#delpack":
  4834.                 return;
  4835.                
  4836.                 if(%clientToServerAdminLevel >= 3)
  4837.                 {
  4838.                     %tag = GetWord(%cropped, 0);
  4839.                    
  4840.                     if(%cropped !$= -1)
  4841.                     {
  4842.                         if($tagToObjectId[%tag] !$= "")
  4843.                         {
  4844.                             %object = $tagToObjectId[%tag];
  4845.                             ClearEvents(%object);
  4846.                             deleteObject(%object);
  4847.                             $tagToObjectId[%tag] = "";
  4848.                             $SpawnPackList = RemoveFromCommaList($SpawnPackList, %tag);
  4849.                            
  4850.                             if(!%echoOff) {
  4851.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Deleted " @ %tag @ " (" @ %object @ ")");
  4852.                             }
  4853.                         }
  4854.                         else if(!%echoOff) {
  4855.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid tagname.");
  4856.                         }
  4857.                     }
  4858.                     else {
  4859.                         messageClient(%TrueClientId, 'RPGchatCallback', "#delpack tagname.");
  4860.                     }
  4861.                 }
  4862.                
  4863.                 return;
  4864.                
  4865.             case "#spawndis" or "#spawndif":
  4866.                 if(%clientToServerAdminLevel >= 3)
  4867.                 {
  4868.                     if(%cropped !$= "")
  4869.                     {
  4870.                         %f = GetWord(%cropped, 0);
  4871.                         %tag = GetWord(%cropped, 1);
  4872.                         %x = GetWord(%cropped, 2);
  4873.                         %y = GetWord(%cropped, 3);
  4874.                         %z = GetWord(%cropped, 4);
  4875.                         %r1 = GetWord(%cropped, 5);
  4876.                         %r2 = GetWord(%cropped, 6);
  4877.                         %r3 = GetWord(%cropped, 7);
  4878.                         %r4 = GetWord(%cropped, 8);
  4879.                         %s1 = GetWord(%cropped, 9);
  4880.                         %s2 = GetWord(%cropped, 10);
  4881.                         %s3 = GetWord(%cropped, 11);
  4882.                        
  4883.                        
  4884.                         if(getwords(%cropped, 2, 4) $= "")
  4885.                         {
  4886.                             //getLOSinfo(%client, %searchRange, %mask)
  4887.                            
  4888.                             %d = getLOSinfo(%TrueClientId, 50000);
  4889.                             %pos =getwords(%d, 1,3);
  4890.                            
  4891.                         }
  4892.                         else {
  4893.                             %pos = %x @ " " @ %y @ " " @ %z;
  4894.                         }
  4895.                        
  4896.                         if(getwords(%cropped, 5, 7) $= "") {
  4897.                             %rot = "0 0 0 1";
  4898.                         }
  4899.                         else {
  4900.                             %rot = %r1 @ " " @ %r2 @ " " @ %r3 SPC %r4;
  4901.                         }
  4902.                        
  4903.                         if(GetWords(%cropped, 8, 10) $= "")
  4904.                         {
  4905.                             %scale = "1 1 1";
  4906.                         }
  4907.                         else {
  4908.                             %scale = %s1 SPC %s2 SPC %s3;    //scale
  4909.                         }
  4910.                        
  4911.                         %fname = %f @ ".dif";
  4912.                        
  4913.                        
  4914.                         //%object = newObject(%tag, InteriorShape, %fname);
  4915.                         if(%tag !$= "" && isfile("interiors/" @ %fname))
  4916.                             %object = new InteriorInstance()
  4917.                         {
  4918.                             position = %pos;
  4919.                             rotation = %rot;
  4920.                             scale = %scale;
  4921.                             interiorFile = %fname;
  4922.                         };
  4923.                        
  4924.                         if(%object != 0 && %tag !$= "")
  4925.                         {
  4926.                             if($tagToObjectId[%tag] !$= "")
  4927.                             {
  4928.                                 %o = $tagToObjectId[%tag];
  4929.                                 //deleteobject(%o);
  4930.                                 %o.delete();
  4931.                                
  4932.                                 $tagToObjectId[%tag] = "";
  4933.                                 %w = "Replaced";
  4934.                             }
  4935.                             else
  4936.                             {
  4937.                                 $DISlist = AddToCommaList($DISlist, %tag);
  4938.                                 %w = "Spawned";
  4939.                             }
  4940.                            
  4941.                             MissionCleanup.add(%object);
  4942.                             $tagToObjectId[%tag] = %object;
  4943.                             %object.nametag = %tag;
  4944.                            
  4945.                             //%object.position = %pos;
  4946.                             //if(%rot !$= -1)
  4947.                             //  %object.rotation = %rot;
  4948.                            
  4949.                             if(!%echoOff) {
  4950.                                 messageClient(%TrueClientId, 'RPGchatCallback', %w @ " " @ %tag @ " (" @ %object @ ") at pos " @ %pos);
  4951.                             }
  4952.                         }
  4953.                         else {
  4954.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid DIF filename or tagname.");
  4955.                         }
  4956.                     }
  4957.                     else {
  4958.                         messageClient(%TrueClientId, 'RPGchatCallback', "#spawndis filename tagname [x] [y] [z] [r1] [r2] [r3] [r4] [s1] [s2] [s3]. Do not specify .dis, this will automatically be added.");
  4959.                     }
  4960.                 }
  4961.                
  4962.                 return;
  4963.                
  4964.             case "#deldis" or "#deldif":
  4965.                 if(%clientToServerAdminLevel >= 3)
  4966.                 {
  4967.                     %tag = GetWord(%cropped, 0);
  4968.                    
  4969.                     if(%cropped !$= -1)
  4970.                     {
  4971.                         if($tagToObjectId[%tag] !$= "")
  4972.                         {
  4973.                             %object = $tagToObjectId[%tag];
  4974.                             ClearEvents(%object);
  4975.                             %object.delete();
  4976.                             $tagToObjectId[%tag] = "";
  4977.                             $DISlist = RemoveFromCommaList($DISlist, %tag);
  4978.                            
  4979.                             if(!%echoOff) {
  4980.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Deleted " @ %tag @ " (" @ %object @ ")");
  4981.                             }
  4982.                         }
  4983.                         else if(!%echoOff) {
  4984.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid tagname.");
  4985.                         }
  4986.                     }
  4987.                     else {
  4988.                         messageClient(%TrueClientId, 'RPGchatCallback', "#deldis tagname.");
  4989.                     }
  4990.                 }
  4991.                
  4992.                 return;
  4993.                
  4994.             case "#listdis" or "#listdis":
  4995.                 if(%clientToServerAdminLevel >= 1)
  4996.                 {
  4997.                     messageClient(%TrueClientId, 'RPGchatCallback', $DISlist);
  4998.                 }
  4999.                
  5000.                 return;
  5001.                
  5002.             case "#listpacks":
  5003.                 return;//add later
  5004.                
  5005.                 if(%clientToServerAdminLevel >= 1)
  5006.                 {
  5007.                     messageClient(%TrueClientId, 'RPGchatCallback', $SpawnPackList);
  5008.                 }
  5009.                
  5010.                 return;
  5011.                
  5012.             case "#deleteobject":
  5013.                 if(%clientToServerAdminLevel >= 5)
  5014.                 {
  5015.                     %c1 = GetWord(%cropped, 0);
  5016.                    
  5017.                     if(%c1 !$= -1)
  5018.                     {
  5019.                         if(%c1.tag !$= "")
  5020.                         {
  5021.                             $tagToObjectId[%c1.tag] = "";
  5022.                            
  5023.                             if(IsInCommaList($DISlist, %c1.tag)) {
  5024.                                 $DISlist = RemoveFromCommaList($DISlist, %c1.tag);
  5025.                             }
  5026.                             else if(IsInCommaList($SpawnPackList, %c1.tag)) {
  5027.                                 $SpawnPackList = RemoveFromCommaList($SpawnPackList, %c1.tag);
  5028.                             }
  5029.                         }
  5030.                        
  5031.                         deleteObject(%c1);
  5032.                         ClearEvents(%c1);
  5033.                        
  5034.                         if(!%echoOff) {
  5035.                             messageClient(%TrueClientId, 'RPGchatCallback', "Attempted to deleteObject(" @ %c1 @ ")");
  5036.                         }
  5037.                     }
  5038.                     else {
  5039.                         messageClient(%TrueClientId, 'RPGchatCallback', "#deleteobject [objectId].  Be careful with this command.");
  5040.                     }
  5041.                 }
  5042.                
  5043.                 return;
  5044.                
  5045.             case "#getposition":
  5046.                 if(%clientToServerAdminLevel >= 1)
  5047.                 {
  5048.                     %player = %TrueClientId.player;
  5049.                     getLOSinfo(%TrueClientId, 50000);
  5050.                    
  5051.                     messageClient(%TrueClientId, 'RPGchatCallback', "Position at LOS is " @ $los::position);
  5052.                 }
  5053.                
  5054.                 return;
  5055.                
  5056.             case "#deathmsg":
  5057.                 if(%clientToServerAdminLevel >= 2)
  5058.                 {
  5059.                     %c1 = GetWord(%cropped, 0);
  5060.                     %msg = getsubstr(%cropped, (strlen(%c1)+1), 99999);
  5061.                    
  5062.                     if(%c1 !$= -1)
  5063.                     {
  5064.                         %id = getClientByName(%c1);
  5065.                        
  5066.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  5067.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  5068.                         }
  5069.                         else if(%id !$= -1)
  5070.                         {
  5071.                             storeData(%id, "deathmsg", %msg);
  5072.                            
  5073.                             if(!%echoOff) {
  5074.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Changed " @ %c1 @ " (" @ %id @ ") deathmsg to " @ fetchData(%id, "deathmsg"));
  5075.                             }
  5076.                         }
  5077.                         else if(!%echoOff) {
  5078.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  5079.                         }
  5080.                     }
  5081.                     else {
  5082.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name & data.");
  5083.                     }
  5084.                 }
  5085.                 else
  5086.                 {
  5087.                     storeData(%TrueClientId, "deathmsg", %cropped);
  5088.                     messageClient(%TrueClientId, 'RPGchatCallback', "Changed your death message to: " @ fetchData(%TrueClientId, "deathmsg"));
  5089.                 }
  5090.                
  5091.                 return;
  5092.                
  5093.             case "#block":
  5094.                 if(%clientToServerAdminLevel >= 3)
  5095.                 {
  5096.                     %bname = GetWord(%cropped, 0);
  5097.                    
  5098.                     if(%bname !$= -1)
  5099.                     {
  5100.                         //Always clear the blockdata
  5101.                         ClearBlockData(%senderName, %bname);
  5102.                        
  5103.                         if(!IsInCommaList($BlockList[%senderName], %bname)) {
  5104.                             $BlockList[%senderName] = AddToCommaList($BlockList[%senderName], %bname);
  5105.                         }
  5106.                        
  5107.                         storeData(%TrueClientId, "BlockInputFlag", %bname);
  5108.                         storeData(%TrueClientId, "tmpBlockCnt", "");
  5109.                        
  5110.                         ManageBlockOwnersList(%senderName);
  5111.                     }
  5112.                     else {
  5113.                         messageClient(%TrueClientId, 'RPGchatCallback', "Incorrect syntax for #block [blockname]");
  5114.                     }
  5115.                 }
  5116.                
  5117.                 return;
  5118.                
  5119.             case "#endblock":
  5120.                 if(%clientToServerAdminLevel >= 3)
  5121.                 {
  5122.                     if(fetchData(%TrueClientId, "BlockInputFlag") !$= "")
  5123.                     {
  5124.                         storeData(%TrueClientId, "BlockInputFlag", "");
  5125.                         storeData(%TrueClientId, "tmpBlockCnt", "");
  5126.                     }
  5127.                     else {
  5128.                         messageClient(%TrueClientId, 'RPGchatCallback', "No block to end!");
  5129.                     }
  5130.                 }
  5131.                
  5132.                 return;
  5133.                
  5134.             case "#delblock":
  5135.                 if(%clientToServerAdminLevel >= 3)
  5136.                 {
  5137.                     %bname = GetWord(%cropped, 0);
  5138.                    
  5139.                     if(%bname !$= -1)
  5140.                     {
  5141.                         if(IsInCommaList($BlockList[%senderName], %bname))
  5142.                         {
  5143.                             ClearBlockData(%senderName, %bname);
  5144.                             $BlockList[%senderName] = RemoveFromCommaList($BlockList[%senderName], %bname);
  5145.                            
  5146.                             ManageBlockOwnersList(%senderName);
  5147.                            
  5148.                             if(!%echoOff) {
  5149.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Block " @ %bname @ " deleted.");
  5150.                             }
  5151.                         }
  5152.                         else if(!%echoOff) {
  5153.                             messageClient(%TrueClientId, 'RPGchatCallback', "Block does not exist!");
  5154.                         }
  5155.                     }
  5156.                     else {
  5157.                         messageClient(%TrueClientId, 'RPGchatCallback', "Incorrect syntax for #delblock [blockname]");
  5158.                     }
  5159.                 }
  5160.                
  5161.                 return;
  5162.                
  5163.             case "#clearblocks":
  5164.                 if(%clientToServerAdminLevel >= 5)
  5165.                 {
  5166.                     %targetName = GetWord(%cropped, 0);
  5167.                     %id = getClientByName(%targetName);
  5168.                 }
  5169.                 else if(%clientToServerAdminLevel >= 3)
  5170.                 {
  5171.                     %targetName = %senderName;
  5172.                     %id = %TrueClientId;
  5173.                 }
  5174.                
  5175.                 if(%id !$= -1)
  5176.                 {
  5177.                     if($BlockList[%targetName] !$= "")
  5178.                     {
  5179.                         %list = $BlockList[%targetName];
  5180.                         $BlockList[%targetName] = "";
  5181.                        
  5182.                         for(%p = strstr(%list, ","); (%p = strstr(%list, ",")) !$= -1; %list = getsubstr(%list, %p+1, 99999))
  5183.                         {
  5184.                             %w = getsubstr(%list, 0, %p);
  5185.                             ClearBlockData(%targetName, %w);
  5186.                         }
  5187.                        
  5188.                         ManageBlockOwnersList(%targetName);
  5189.                        
  5190.                         if(!%echoOff) {
  5191.                             messageClient(%TrueClientId, 'RPGchatCallback', "Deleted ALL of " @ %targetName @ "'s blocks.");
  5192.                         }
  5193.                     }
  5194.                 }
  5195.                 else {
  5196.                     messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  5197.                 }
  5198.                
  5199.                 return;
  5200.                
  5201.             case "#clearallblocks":
  5202.                 if(%clientToServerAdminLevel >= 5)
  5203.                 {
  5204.                     %bname = GetWord(%cropped, 0);
  5205.                    
  5206.                     if(%bname $= "confirm")
  5207.                     {
  5208.                         %blist = $BlockOwnersList;
  5209.                        
  5210.                         for(%bp = strstr(%blist, ","); (%bp = strstr(%blist, ",")) !$= -1; %blist = getsubstr(%blist, %bp+1, 99999))
  5211.                         {
  5212.                             %name = getsubstr(%blist, 0, %bp);
  5213.                            
  5214.                             if($BlockList[%name] !$= "")
  5215.                             {
  5216.                                 %list = $BlockList[%name];
  5217.                                 $BlockList[%name] = "";
  5218.                                
  5219.                                 for(%p = strstr(%list, ","); (%p = strstr(%list, ",")) !$= -1; %list = getsubstr(%list, %p+1, 99999))
  5220.                                 {
  5221.                                     %w = getsubstr(%list, 0, %p);
  5222.                                     ClearBlockData(%name, %w);
  5223.                                 }
  5224.                             }
  5225.                            
  5226.                             ManageBlockOwnersList(%name);
  5227.                         }
  5228.                        
  5229.                         if(!%echoOff) {
  5230.                             messageClient(%TrueClientId, 'RPGchatCallback', "Deleted EVERYONE's blocks.");
  5231.                         }
  5232.                     }
  5233.                     else {
  5234.                         messageClient(%TrueClientId, 'RPGchatCallback', "Type #clearallblocks confirm to clear EVERYONE's blocks.");
  5235.                     }
  5236.                 }
  5237.                
  5238.                 return;
  5239.                
  5240.             case "#listblocks":
  5241.                 if(%clientToServerAdminLevel >= 5)
  5242.                 {
  5243.                     if(%cropped !$= "")
  5244.                     {
  5245.                         if(IsInCommaList($BlockOwnersList, %cropped)) {
  5246.                             messageClient(%TrueClientId, 'RPGchatCallback', %cropped @ "'s BlockList: " @ $BlockList[%cropped]);
  5247.                         }
  5248.                     }
  5249.                     else {
  5250.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  5251.                     }
  5252.                 }
  5253.                 else if(%clientToServerAdminLevel >= 3)
  5254.                 {
  5255.                     messageClient(%TrueClientId, 'RPGchatCallback', "Your BlockList: " @ $BlockList[%senderName]);
  5256.                 }
  5257.                
  5258.                 return;
  5259.                
  5260.             case "#echo":
  5261.                 if(stricmp(%cropped, "off") $= 0) {
  5262.                     %TrueClientId.echoOff = true;
  5263.                 }
  5264.                 else if(stricmp(%cropped, "on") $= 0) {
  5265.                     %TrueClientId.echoOff = "";
  5266.                 }
  5267.                 else {
  5268.                     messageClient(%TrueClientId, 'RPGchatCallback', %cropped);
  5269.                 }
  5270.                
  5271.                 return;
  5272.                
  5273.             case "#call":
  5274.                 if(%clientToServerAdminLevel >= 3)
  5275.                 {
  5276.                     %bname = GetWord(%cropped, 0);
  5277.                    
  5278.                     if(%bname !$= -1)
  5279.                     {
  5280.                         %list = getsubstr(%cropped, (strlen(%bname)+1), 99999);
  5281.                        
  5282.                         for(%p = strstr(%list, ","); (%p = strstr(%list, ",")) !$= -1; %list = getsubstr(%list, %p+1, 99999)) {
  5283.                             %a[%c++] = getsubstr(%list, 0, %p);
  5284.                         }
  5285.                        
  5286.                         if(%c <= 8)
  5287.                         {
  5288.                             if(IsInCommaList($BlockList[%senderName], %bname))
  5289.                             {
  5290.                                 %TrueClientId.echoOff = true;
  5291.                                
  5292.                                 for(%i = 1; (%bd = $BlockData[%senderName, %bname, %i]) !$= ""; %i++)
  5293.                                 {
  5294.                                     if(%a[1] !$= "") {
  5295.                                         %bd = nsprintf(%bd, %a[1], %a[2], %a[3], %a[4], %a[5], %a[6], %a[7], %a[8]);
  5296.                                     }
  5297.                                    
  5298.                                     RPGchat(%client, 0, %bd);   //, %senderName);
  5299.                                 }
  5300.                                
  5301.                                 %TrueClientId.echoOff = "";
  5302.                             }
  5303.                             else {
  5304.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Block does not exist!");
  5305.                             }
  5306.                         }
  5307.                         else {
  5308.                             messageClient(%TrueClientId, 'RPGchatCallback', "Too many parameters for #call (max of 8)");
  5309.                         }
  5310.                     }
  5311.                     else {
  5312.                         messageClient(%TrueClientId, 'RPGchatCallback', "Incorrect syntax for #call [blockname]");
  5313.                     }
  5314.                 }
  5315.                
  5316.                 return;
  5317.                
  5318.             case "#givethisstuff":
  5319.                 if(%clientToServerAdminLevel >= 2)
  5320.                 {
  5321.                     %c1 = GetWord(%cropped, 0);
  5322.                     %stuff = getsubstr(%cropped, (strlen(%c1)+1), 99999);
  5323.                    
  5324.                     if(%c1 !$= -1)
  5325.                     {
  5326.                         %id = getClientByName(%c1);
  5327.                        
  5328.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  5329.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  5330.                         }
  5331.                         else if(%id !$= -1)
  5332.                         {
  5333.                             GiveThisStuff(%id, %stuff, true);
  5334.                            
  5335.                             if(%id.isAiControlled()) {
  5336.                                 HardcodeAIskills(%id);
  5337.                             }
  5338.                            
  5339.                             if(!%echoOff) {
  5340.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Gave " @ %c1 @ " (" @ %id @ "): " @ %stuff);
  5341.                             }
  5342.                         }
  5343.                         else {
  5344.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  5345.                         }
  5346.                     }
  5347.                     else {
  5348.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name & data.");
  5349.                     }
  5350.                 }
  5351.                
  5352.                 return;
  5353.                
  5354.             case "#takethisstuff":
  5355.                 if(%clientToServerAdminLevel >= 2)
  5356.                 {
  5357.                     %c1 = GetWord(%cropped, 0);
  5358.                     %stuff = getsubstr(%cropped, (strlen(%c1)+1), 99999);
  5359.                    
  5360.                     if(%c1 !$= -1)
  5361.                     {
  5362.                         %id = getClientByName(%c1);
  5363.                        
  5364.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  5365.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  5366.                         }
  5367.                         else if(%id !$= -1)
  5368.                         {
  5369.                             if(HasThisStuff(%id, %stuff))
  5370.                             {
  5371.                                 TakeThisStuff(%id, %stuff);
  5372.                                
  5373.                                 if(%id.isAiControlled()) {
  5374.                                     HardcodeAIskills(%id);
  5375.                                 }
  5376.                                
  5377.                                 RefreshAll(%id);
  5378.                                
  5379.                                 if(!%echoOff) {
  5380.                                     messageClient(%TrueClientId, 'RPGchatCallback', "Took " @ %c1 @ " (" @ %id @ "): " @ %stuff);
  5381.                                 }
  5382.                             }
  5383.                             else if(!%echoOff) {
  5384.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Could not take stuff.");
  5385.                             }
  5386.                         }
  5387.                         else {
  5388.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  5389.                         }
  5390.                     }
  5391.                     else {
  5392.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name & data.");
  5393.                     }
  5394.                 }
  5395.                
  5396.                 return;
  5397.                
  5398.             case "#refreshbotskills":
  5399.                 if(%clientToServerAdminLevel >= 2)
  5400.                 {
  5401.                     if(%cropped $= "") {
  5402.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  5403.                     }
  5404.                     else
  5405.                     {
  5406.                         %id = getClientByName(%cropped);
  5407.                        
  5408.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  5409.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  5410.                         }
  5411.                         else if(%id !$= -1)
  5412.                         {
  5413.                             HardcodeAIskills(%id);
  5414.                            
  5415.                             if(!%echoOff) {
  5416.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Refreshed skills for " @ %cropped @ " (" @ %id @ ").");
  5417.                             }
  5418.                         }
  5419.                         else {
  5420.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  5421.                         }
  5422.                     }
  5423.                 }
  5424.                
  5425.                 return;
  5426.                
  5427.             case "#listblockowners":
  5428.                 if(%clientToServerAdminLevel >= 5)
  5429.                 {
  5430.                     messageClient(%TrueClientId, 'RPGchatCallback', $BlockOwnersList);
  5431.                 }
  5432.                
  5433.                 return;
  5434.                
  5435.             case "#nodroppack":
  5436.                 if(%clientToServerAdminLevel >= 2)
  5437.                 {
  5438.                     %c1 = GetWord(%cropped, 0);
  5439.                     %c2 = GetWord(%cropped, 1);
  5440.                    
  5441.                     if(%c1 !$= -1 && %c2 !$= -1)
  5442.                     {
  5443.                         %id = getClientByName(%c1);
  5444.                        
  5445.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  5446.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  5447.                         }
  5448.                         else if(%id !$= -1)
  5449.                         {
  5450.                             if(%c2 $= 0) {
  5451.                                 storeData(%id, "noDropLootbagFlag", "");
  5452.                             }
  5453.                             else if(%c2 $= 1) {
  5454.                                 storeData(%id, "noDropLootbagFlag", true);
  5455.                             }
  5456.                            
  5457.                             if(!%echoOff) {
  5458.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Changed " @ %c1 @ " (" @ %id @ ") noDropLootbagFlag to '" @ fetchData(%id, "noDropLootbagFlag") @ "'.");
  5459.                             }
  5460.                         }
  5461.                         else {
  5462.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  5463.                         }
  5464.                     }
  5465.                     else {
  5466.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name & data.");
  5467.                     }
  5468.                 }
  5469.                
  5470.                 return;
  5471.                
  5472.             case "#playsound":
  5473.                 if(%clientToServerAdminLevel >= 2)
  5474.                 {
  5475.                     %c1 = GetWord(%cropped, 0);
  5476.                     %pos = getsubstr(%cropped, (strlen(%c1)+1), 99999);
  5477.                    
  5478.                     if(%c1 !$= -1)
  5479.                     {
  5480.                         if(GetWord(%pos, 0) $= "")
  5481.                         {
  5482.                             if(getLOSinfo(%TrueClientId, 50000)) {
  5483.                                 %pos = $los::position;
  5484.                             }
  5485.                             else {
  5486.                                 %pos = %TrueClientId.player.getPosition();
  5487.                             }
  5488.                         }
  5489.                        
  5490.                         serverPlay3D(%c1, %pos);
  5491.                        
  5492.                         if(!%echoOff) {
  5493.                             messageClient(%TrueClientId, 'RPGchatCallback', "Playing sound " @ %c1 @ " at pos " @ %pos);
  5494.                         }
  5495.                     }
  5496.                     else {
  5497.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify nsound & position.");
  5498.                     }
  5499.                 }
  5500.                
  5501.                 return;
  5502.                
  5503.             case "#delbot":
  5504.                 if(%clientToServerAdminLevel >= 3)
  5505.                 {
  5506.                     if(%cropped !$= -1)
  5507.                     {
  5508.                         %id = getClientByName(%cropped);
  5509.                        
  5510.                         if(%id !$= -1)
  5511.                         {
  5512.                             if(%id.isAiControlled())
  5513.                             {
  5514.                                 storeData(%id, "noDropLootbagFlag", true);
  5515.                                 ClearEvents(%id);
  5516.                                 %id.player.scriptKill(0);
  5517.                                
  5518.                                 if(!%echoOff) {
  5519.                                     messageClient(%TrueClientId, 'RPGchatCallback', %cropped @ " (" @ %id @ ") was deleted.");
  5520.                                 }
  5521.                             }
  5522.                             else {
  5523.                                 messageClient(%TrueClientId, 'RPGchatCallback', "This command only works on bots.");
  5524.                             }
  5525.                         }
  5526.                         else if(!%echoOff) {
  5527.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  5528.                         }
  5529.                     }
  5530.                     else {
  5531.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  5532.                     }
  5533.                 }
  5534.                
  5535.                 return;
  5536.                
  5537.             case "#loadout":
  5538.                 if(%clientToServerAdminLevel >= 3)
  5539.                 {
  5540.                     %c1 = GetWord(%cropped, 0);
  5541.                     %stuff = getsubstr(%cropped, (strlen(%c1)+1), 99999);
  5542.                    
  5543.                     if(%c1 !$= -1)
  5544.                     {
  5545.                         if(!IsInCommaList($LoadOutList, %c1))
  5546.                         {
  5547.                             $LoadOutList = AddToCommaList($LoadOutList, %c1);
  5548.                             $LoadOut[%c1] = %stuff;
  5549.                            
  5550.                             if(!%echoOff) {
  5551.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Loadout " @ %c1 @ " defined.");
  5552.                             }
  5553.                         }
  5554.                         else if(!%echoOff) {
  5555.                             messageClient(%TrueClientId, 'RPGchatCallback', "Loadout tagname already exists.");
  5556.                         }
  5557.                     }
  5558.                     else {
  5559.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify tagname & data.");
  5560.                     }
  5561.                 }
  5562.                
  5563.                 return;
  5564.                
  5565.             case "#delloadout":
  5566.                 if(%clientToServerAdminLevel >= 3)
  5567.                 {
  5568.                     %c1 = GetWord(%cropped, 0);
  5569.                    
  5570.                     if(%c1 !$= -1)
  5571.                     {
  5572.                         if(IsInCommaList($LoadOutList, %c1))
  5573.                         {
  5574.                             $LoadOutList = RemoveFromCommaList($LoadOutList, %c1);
  5575.                             $LoadOut[%c1] = "";
  5576.                            
  5577.                             if(!%echoOff) {
  5578.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Loadout " @ %c1 @ " deleted.");
  5579.                             }
  5580.                         }
  5581.                         else if(!%echoOff) {
  5582.                             messageClient(%TrueClientId, 'RPGchatCallback', "Loadout tagname does not exist.");
  5583.                         }
  5584.                     }
  5585.                     else {
  5586.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify tagname.");
  5587.                     }
  5588.                 }
  5589.                
  5590.                 return;
  5591.                
  5592.             case "#clearloadouts":
  5593.                 if(%clientToServerAdminLevel >= 4)
  5594.                 {
  5595.                     %list = $LoadOutList;
  5596.                     $LoadOutList = "";
  5597.                    
  5598.                     for(%p = strstr(%list, ","); (%p = strstr(%list, ",")) !$= -1; %list = getsubstr(%list, %p+1, 99999))
  5599.                     {
  5600.                         %w = getsubstr(%list, 0, %p);
  5601.                         $LoadOut[%w] = "";
  5602.                     }
  5603.                    
  5604.                     if(!%echoOff) {
  5605.                         messageClient(%TrueClientId, 'RPGchatCallback', "Deleted ALL loadouts.");
  5606.                     }
  5607.                 }
  5608.                
  5609.                 return;
  5610.                
  5611.             case "#showloadout":
  5612.                 if(%clientToServerAdminLevel >= 3)
  5613.                 {
  5614.                     %c1 = GetWord(%cropped, 0);
  5615.                    
  5616.                     if(%c1 !$= -1)
  5617.                     {
  5618.                         if(IsInCommaList($LoadOutList, %c1)) {
  5619.                             messageClient(%TrueClientId, 'RPGchatCallback', %c1 @ ": " @ $LoadOut[%c1]);
  5620.                         }
  5621.                         else if(!%echoOff) {
  5622.                             messageClient(%TrueClientId, 'RPGchatCallback', "Loadout tagname does not exist.");
  5623.                         }
  5624.                     }
  5625.                     else {
  5626.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify tagname.");
  5627.                     }
  5628.                 }
  5629.                
  5630.                 return;
  5631.                
  5632.             case "#listloadouts":
  5633.                 if(%clientToServerAdminLevel >= 3)
  5634.                 {
  5635.                     %list = $LoadOutList;
  5636.                    
  5637.                     for(%p = strstr(%list, ","); (%p = strstr(%list, ",")) !$= -1; %list = getsubstr(%list, %p+1, 99999))
  5638.                     {
  5639.                         %w = getsubstr(%list, 0, %p);
  5640.                         messageClient(%TrueClientId, 'RPGchatCallback', %w @ ": " @ $LoadOut[%w]);
  5641.                     }
  5642.                 }
  5643.                
  5644.                 return;
  5645.                
  5646.             case "#nobotsniff":
  5647.                 if(%clientToServerAdminLevel >= 3)
  5648.                 {
  5649.                     %c1 = GetWord(%cropped, 0);
  5650.                     %c2 = GetWord(%cropped, 1);
  5651.                    
  5652.                     if(%c1 !$= -1 && %c2 !$= -1)
  5653.                     {
  5654.                         %id = getClientByName(%c1);
  5655.                        
  5656.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  5657.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  5658.                         }
  5659.                         else if(%id !$= -1)
  5660.                         {
  5661.                             if(%c2 $= 0) {
  5662.                                 storeData(%id, "noBotSniff", "");
  5663.                             }
  5664.                             else if(%c2 $= 1) {
  5665.                                 storeData(%id, "noBotSniff", true);
  5666.                             }
  5667.                            
  5668.                             if(!%echoOff) {
  5669.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Changed " @ %c1 @ " (" @ %id @ ") noBotSniff flag to " @ %c2 @ ".");
  5670.                             }
  5671.                         }
  5672.                         else {
  5673.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  5674.                         }
  5675.                     }
  5676.                     else {
  5677.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name & data.");
  5678.                     }
  5679.                 }
  5680.                
  5681.                 return;
  5682.                
  5683.             case "#addrankpoints":
  5684.                 if(%clientToServerAdminLevel >= 3)
  5685.                 {
  5686.                     %c1 = GetWord(%cropped, 0);
  5687.                     %c2 = GetWord(%cropped, 1);
  5688.                    
  5689.                     if(%c1 !$= -1 && %c2 !$= -1)
  5690.                     {
  5691.                         %id = getClientByName(%c1);
  5692.                        
  5693.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  5694.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  5695.                         }
  5696.                         else if(%id !$= -1)
  5697.                         {
  5698.                             storeData(%id, "RankPoints", %c2, "inc");
  5699.                            
  5700.                             if(!%echoOff) {
  5701.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Setting " @ %c1 @ " (" @ %id @ ") RankPoints to " @ fetchData(%id, "RankPoints") @ ".");
  5702.                             }
  5703.                         }
  5704.                         else {
  5705.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  5706.                         }
  5707.                     }
  5708.                     else {
  5709.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name & data.");
  5710.                     }
  5711.                 }
  5712.                
  5713.                 return;
  5714.         }
  5715.        
  5716.         //more breaks...this sucks
  5717.         switch$(%w1)
  5718.         {
  5719.        
  5720.             case "#delchar":
  5721.                 return;
  5722.                
  5723.                 if(%clientToServerAdminLevel >= 5)
  5724.                 {
  5725.                     %name = %cropped;
  5726.                     %dclient = getClientByName(%name);
  5727.                     //clear all skills.
  5728.                     //ok FIRST delete the character files.
  5729.                     %filename = "characters/" @ %dclient.realname @ "/" @ %dclient.namebase @ ".cs";
  5730.                     deletefile(%filename);
  5731.                     deletefile(%filename @ ".dso");
  5732.                    
  5733.                     %storage = FetchData(%dclient, "storage");
  5734.                    
  5735.                     for(%i = 0; (%in = Getword(%storage, %i)) != 0; %i++)
  5736.                     {
  5737.                         RemoveFromStorage(%dclient, %in);
  5738.                     }
  5739.                    
  5740.                     %inv = FetchData(%dclient, "inventory");
  5741.                    
  5742.                     for(%i = 0; (%in = Getword(%inv, %i)) != 0; %i++)
  5743.                     {
  5744.                         RemoveFromInventory(%dclient, %in);
  5745.                     }
  5746.                    
  5747.                     storedata(%dclient, "inventory", "");
  5748.                     storedata(%dclient, "storage", "");
  5749.                     storedata(%dclient, "bank", 0);
  5750.                     ClearVariables(%dclient);
  5751.                    
  5752.                     //put client in obs mode.
  5753.                     if(LoadCharacter(%dclient) != false)
  5754.                     {
  5755.                    
  5756.                         %dclient.choosingGroup = true;
  5757.                         %dclient.game = 'RPGgame';
  5758.                         %dclient.camera.getDataBlock().setMode(%client.camera, "observer");
  5759.                         %dclient.setControlObject(%dclient.camera);
  5760.                         %dclient.player.delete(); //bye bye player
  5761.                         commandToClient(%dclient, 'OpenISMenu');
  5762.                         commandToClient(%dclient, 'RPGplayMusic', "SoftTown");
  5763.                        
  5764.                     }
  5765.                     else
  5766.                     {
  5767.                         //problem, disconnect the client
  5768.                         %dclient.delete();
  5769.                     }
  5770.                 }
  5771.                
  5772.             case "#sethouse":
  5773.                 if(%clientToServerAdminLevel >= 3)
  5774.                 {
  5775.                     %c1 = GetWord(%cropped, 0);
  5776.                     %c2 = GetWord(%cropped, 1);
  5777.                    
  5778.                     if(%c1 !$= -1 && %c2 !$= -1)
  5779.                     {
  5780.                         %id = getClientByName(%c1);
  5781.                        
  5782.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  5783.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  5784.                         }
  5785.                         else if(%id !$= -1)
  5786.                         {
  5787.                             %hn = "";
  5788.                            
  5789.                             if(stricmp(%c2, "null") $= 0) {
  5790.                                 %hn = 0;
  5791.                             }
  5792.                             else
  5793.                             {
  5794.                                 for(%i = 1; $HouseName[%i] !$= ""; %i++)
  5795.                                 {
  5796.                                     if(strstr($HouseName[%i], %c2) !$= -1) {
  5797.                                         %hn = %i;
  5798.                                     }
  5799.                                 }
  5800.                             }
  5801.                            
  5802.                             if(%hn !$= "")
  5803.                             {
  5804.                                 %hname = $HouseName[%hn];
  5805.                                 storeData(%id, "MyHouse", %hname);
  5806.                                
  5807.                                 if(!%echoOff) {
  5808.                                     messageClient(%TrueClientId, 'RPGchatCallback', "Setting " @ %c1 @ " (" @ %id @ ") House to " @ fetchData(%id, "MyHouse") @ ".");
  5809.                                 }
  5810.                             }
  5811.                             else {
  5812.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Invalid House.");
  5813.                             }
  5814.                         }
  5815.                         else {
  5816.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  5817.                         }
  5818.                     }
  5819.                     else {
  5820.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name & house (to clear house, use: #sethouse name NULL).");
  5821.                     }
  5822.                 }
  5823.                
  5824.                 return;
  5825.                
  5826.             case "#setspawnmultiplier":
  5827.                 if(%clientToServerAdminLevel >= 5)
  5828.                 {
  5829.                     %c1 = GetWord(%cropped, 0);
  5830.                    
  5831.                     if(%c1 !$= -1)
  5832.                     {
  5833.                         $spawnMultiplier = Cap(%c1, 0, "inf");
  5834.                        
  5835.                         if(!%echoOff) {
  5836.                             messageClient(%TrueClientId, 'RPGchatCallback', "spawnMultiplier set to " @ $spawnMultiplier @ ".");
  5837.                         }
  5838.                     }
  5839.                     else {
  5840.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify a number (normal should be 1. 0 will cease spawning.)");
  5841.                     }
  5842.                 }
  5843.                
  5844.                 return;
  5845.                
  5846.             case "#jail":
  5847.                 if(%clientToServerAdminLevel >= 3)
  5848.                 {
  5849.                     %c1 = GetWord(%cropped, 0);
  5850.                     %c2 = GetWord(%cropped, 1);
  5851.                     %c3 = GetWord(%cropped, 2);
  5852.                    
  5853.                     if(%c1 !$= -1)
  5854.                     {
  5855.                         %id = getClientByName(%c1);
  5856.                        
  5857.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  5858.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  5859.                         }
  5860.                         else if(%id !$= -1)
  5861.                         {
  5862.                             %c1 = %id.nameBase;
  5863.                            
  5864.                             if(%c2 $= "") {
  5865.                                 %c2 = 300;
  5866.                             }
  5867.                            
  5868.                             if(%c3 $= "") {
  5869.                                 %c3 = Game.GetRandomJailNumber();
  5870.                             }
  5871.                            
  5872.                             %val = Game.ValidateJailNumber(%c3);
  5873.                            
  5874.                             if(%val)
  5875.                             {
  5876.                                 Game.Jail(%id, %c2 * 1000, %c3);
  5877.                                
  5878.                                 if(!%echoOff) {
  5879.                                     messageClient(%TrueClientId, 'RPGchatCallback', %c1 @ " has been jailed for " @ %c2 @ " seconds in Jail #" @ %c3 @ ".");
  5880.                                 }
  5881.                             }
  5882.                             else {
  5883.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Invalid jail number.");
  5884.                             }
  5885.                         }
  5886.                         else {
  5887.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  5888.                         }
  5889.                     }
  5890.                     else {
  5891.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name, time, and jail number.");
  5892.                     }
  5893.                 }
  5894.                
  5895.                 return;
  5896.                
  5897.             case "#beg":
  5898.                 if(%clientToServerAdminLevel >= 2)
  5899.                 {
  5900.                     %c1 = GetWord(%cropped, 0);
  5901.                     %c2 = GetWord(%cropped, 1);
  5902.                    
  5903.                     if(%c2 $= -1) {
  5904.                         %c2 = false;
  5905.                     }
  5906.                    
  5907.                     if(%c1 !$= -1)
  5908.                     {
  5909.                         %id = getClientByName(%c1);
  5910.                        
  5911.                         if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  5912.                             messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  5913.                         }
  5914.                         else if(%id !$= -1)
  5915.                         {
  5916.                             %ip = %id.getAddress();
  5917.                             BanList::add(%ip, 300);
  5918.                             Net::kick(%id, "Do not beg from an admin! The next time you might be banned, so quit your begging.");
  5919.                         }
  5920.                         else {
  5921.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  5922.                         }
  5923.                     }
  5924.                     else {
  5925.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name & data.");
  5926.                     }
  5927.                 }
  5928.                
  5929.                 return;
  5930.         }
  5931.        
  5932.         //another break due to the switch limitation
  5933.         switch$(%w1)
  5934.         {
  5935.             case "#onhear":
  5936.                 if(%clientToServerAdminLevel >= 3)
  5937.                 {
  5938.                     if(%cropped !$= "")
  5939.                     {
  5940.                         %event = strstr(%cropped, ">");
  5941.                        
  5942.                         if(%event !$= -1)
  5943.                         {
  5944.                             %info = getsubstr(%cropped, 0, %event);
  5945.                             %cmd = getsubstr(%cropped, %event, 99999);
  5946.                         }
  5947.                         else {
  5948.                             %info = %cropped;
  5949.                         }
  5950.                        
  5951.                         %var = GetWord(%info, 4);
  5952.                        
  5953.                         if(stricmp(%var, "var") $= 0) {
  5954.                             %var = "var";
  5955.                         }
  5956.                         else
  5957.                         {
  5958.                             %var = "";
  5959.                             %quote1 = strstr(%info, "\"");
  5960.                             %quote2 = String::ofindSubStr(%info, "\"", %quote1+1);
  5961.                         }
  5962.                        
  5963.                         if(%quote1 !$= -1 && %quote2 !$= -1 || %var !$= "")
  5964.                         {
  5965.                             %pname = GetWord(%info, 0);
  5966.                             %id = getClientByName(%pname);
  5967.                            
  5968.                             if(%id !$= -1)
  5969.                             {
  5970.                                 %pname = %id.nameBase;  //properly capitalize name
  5971.                                 %radius = GetWord(%info, 1);
  5972.                                 %keep = GetWord(%info, 2);
  5973.                                
  5974.                                 if(%keep $= "true" || %keep $= "false")
  5975.                                 {
  5976.                                     %targetname = GetWord(%info, 3);
  5977.                                     %tid = getClientByName(%targetname);
  5978.                                    
  5979.                                     if(stricmp(%targetname, "all") $= 0 || %tid !$= -1)
  5980.                                     {
  5981.                                         if(%var !$= "")
  5982.                                         {
  5983.                                             %vtxt = %var;
  5984.                                             %text = "var";
  5985.                                         }
  5986.                                         else
  5987.                                         {
  5988.                                             %text = getsubstr(%info, %quote1+1, %quote2);
  5989.                                             %vtxt = "|" @ %text @ "|";
  5990.                                         }
  5991.                                        
  5992.                                         if(%text !$= "")
  5993.                                         {
  5994.                                             if(%event !$= -1)
  5995.                                             {
  5996.                                                 AddEventCommand(%id, %senderName, "onHear " @ %pname @ " " @ %radius @ " " @ %keep @ " " @ %targetname @ " " @ %vtxt, %cmd);
  5997.                                                
  5998.                                                 if(!%echoOff) {
  5999.                                                     messageClient(%TrueClientId, 'RPGchatCallback', "onHear event set for " @ %pname @ "(" @ %id @ ") with text: \"" @ %text @ "\"");
  6000.                                                 }
  6001.                                             }
  6002.                                             else {
  6003.                                                 messageClient(%TrueClientId, 'RPGchatCallback', "onHear event definition failed.");
  6004.                                             }
  6005.                                         }
  6006.                                         else {
  6007.                                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid text.");
  6008.                                         }
  6009.                                     }
  6010.                                     else {
  6011.                                         messageClient(%TrueClientId, 'RPGchatCallback', "Invalid name. Please specify 'all' or target's name.");
  6012.                                     }
  6013.                                 }
  6014.                                 else {
  6015.                                     messageClient(%TrueClientId, 'RPGchatCallback', "Specify 'true' or 'false'. 'true' means that the onHear event won't be deleted after use. 'false' is recommended to keep things clean.");
  6016.                                 }
  6017.                             }
  6018.                             else {
  6019.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Invalid name.");
  6020.                             }
  6021.                         }
  6022.                         else {
  6023.                             messageClient(%TrueClientId, 'RPGchatCallback', "Quotes for text not found.");
  6024.                         }
  6025.                     }
  6026.                     else {
  6027.                         messageClient(%TrueClientId, 'RPGchatCallback', "#onhear name radius keep all/targetname \"text\"/var.");
  6028.                     }
  6029.                 }
  6030.                
  6031.                 return;
  6032.                
  6033.             case "#if":
  6034.                 if(%clientToServerAdminLevel >= 3)
  6035.                 {
  6036.                     if(%cropped !$= "")
  6037.                     {
  6038.                         %info = %cropped;
  6039.                        
  6040.                         %para1 = strstr(%info, "{");
  6041.                         %para2 = String::ofindSubStr(%info, "}", %para1+1);
  6042.                        
  6043.                         if(%para1 !$= -1 && %para2 !$= -1)
  6044.                         {
  6045.                             %expression = getsubstr(%info, %para1+1, %para2);
  6046.                            
  6047.                             if((%pw = CheckForProtectedWords(%expression)) $= "")
  6048.                             {
  6049.                                 %command = getsubstr(%info, %para1+%para2+3, 99999);
  6050.                                 %retval = eval("%x = (" @ %expression @ ");");
  6051.                                
  6052.                                 if(%retval $= 0) {
  6053.                                     %r = false;
  6054.                                 }
  6055.                                 else {
  6056.                                     %r = true;
  6057.                                 }
  6058.                                
  6059.                                 if(!%echoOff) {
  6060.                                     messageClient(%TrueClientId, 'RPGchatCallback', "(" @ %expression @ ") = " @ %r);
  6061.                                 }
  6062.                                
  6063.                                 if(%retval && %command !$= "") {
  6064.                                     RPGchat(%client, 0, %command);    //, %senderName);
  6065.                                 }
  6066.                             }
  6067.                             else {
  6068.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Protected word '" @ %pw @ "' can't be used in the #if statement.");
  6069.                             }
  6070.                         }
  6071.                         else {
  6072.                             messageClient(%TrueClientId, 'RPGchatCallback', "{ and } found.");
  6073.                         }
  6074.                     }
  6075.                     else {
  6076.                         messageClient(%TrueClientId, 'RPGchatCallback', "#if {expression} command");
  6077.                     }
  6078.                 }
  6079.                
  6080.                 return;
  6081.                
  6082.             case "#addskill":
  6083.                 if(%clientToServerAdminLevel >= 3)
  6084.                 {
  6085.                     %name = GetWord(%cropped, 0);
  6086.                    
  6087.                     %id = getClientByName(%name);
  6088.                    
  6089.                     if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  6090.                         messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  6091.                     }
  6092.                     else if(%id !$= -1)
  6093.                     {
  6094.                         %sid = GetWord(%cropped, 1);
  6095.                        
  6096.                         if($SkillDesc[%sid] !$= "")
  6097.                         {
  6098.                             %sn = mfloor(GetWord(%cropped, 2));
  6099.                            
  6100.                             if(%sn !$= 0)
  6101.                             {
  6102.                                 %id.PlayerSkill[%sid] += %sn;
  6103.                                 RefreshAll(%id);
  6104.                                
  6105.                                 if(!%echoOff) {
  6106.                                     messageClient(%TrueClientId, 'RPGchatCallback', "Set " @ %name @ " (" @ %id @ ") " @ $SkillDesc[%sid] @ " to " @ %id.PlayerSkill[%sid]);
  6107.                                 }
  6108.                             }
  6109.                         }
  6110.                     }
  6111.                     else {
  6112.                         messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  6113.                     }
  6114.                 }
  6115.                
  6116.                 return;
  6117.                
  6118.             case "#setvelocity":
  6119.                 if(%clientToServerAdminLevel >= 2)
  6120.                 {
  6121.                     %name = GetWord(%cropped, 0);
  6122.                    
  6123.                     %id = getClientByName(%name);
  6124.                    
  6125.                     if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  6126.                         messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  6127.                     }
  6128.                     else if(%id !$= -1)
  6129.                     {
  6130.                         %max = 5000;
  6131.                         %x = Cap(mfloor(GetWord(%cropped, 1)), -%max, %max);
  6132.                         %y = Cap(mfloor(GetWord(%cropped, 2)), -%max, %max);
  6133.                         %z = Cap(mfloor(GetWord(%cropped, 3)), -%max, %max);
  6134.                        
  6135.                         %vel = %x @ " " @ %y @ " " @ %z;
  6136.                         %id.player.setVelocity(%vel);
  6137.                        
  6138.                         if(!%echoOff) {
  6139.                             messageClient(%TrueClientId, 'RPGchatCallback', "Set " @ %name @ " (" @ %id @ ") velocity to " @ %vel);
  6140.                         }
  6141.                     }
  6142.                     else {
  6143.                         messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  6144.                     }
  6145.                 }
  6146.                
  6147.                 return;
  6148.                
  6149.             case "#getskill":
  6150.                 if(%clientToServerAdminLevel >= 2)
  6151.                 {
  6152.                     %name = GetWord(%cropped, 0);
  6153.                    
  6154.                     %id = getClientByName(%name);
  6155.                    
  6156.                     if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  6157.                         messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  6158.                     }
  6159.                     else if(%id !$= -1)
  6160.                     {
  6161.                         %sid = GetWord(%cropped, 1);
  6162.                        
  6163.                         if($SkillDesc[%sid] !$= "") {
  6164.                             messageClient(%TrueClientId, 'RPGchatCallback', %name @ " (" @ %id @ ") " @ $SkillDesc[%sid] @ " is " @ %id.PlayerSkill[%sid]);
  6165.                         }
  6166.                     }
  6167.                     else {
  6168.                         messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  6169.                     }
  6170.                 }
  6171.                
  6172.                 return;
  6173.                
  6174.             case "#scheduleblock":
  6175.                 if(%clientToServerAdminLevel >= 3)
  6176.                 {
  6177.                     %bname = GetWord(%cropped, 0);
  6178.                    
  6179.                     if(%bname !$= -1)
  6180.                     {
  6181.                         if(IsInCommaList($BlockList[%senderName], %bname))
  6182.                         {
  6183.                             %delay = GetWord(%cropped, 1);
  6184.                            
  6185.                             if(%delay >= 0.05)
  6186.                             {
  6187.                                 %repeat = mfloor(GetWord(%cropped, 2));
  6188.                                
  6189.                                 if(%repeat >= 0)
  6190.                                 {
  6191.                                     %rp = (%repeat+1);
  6192.                                    
  6193.                                     %arglist = getsubstr(%cropped, (strlen(%bname @ %delay @ %repeat @ "  ")+1), 99999);
  6194.                                    
  6195.                                     if(GetWord(%arglist, 0) !$= "") {
  6196.                                         %txt = "#call " @ %bname @ " " @ %arglist;
  6197.                                     }
  6198.                                     else {
  6199.                                         %txt = "#call " @ %bname;
  6200.                                     }
  6201.                                    
  6202.                                     for(%sbi = 1; %sbi <= %rp; %sbi++) {
  6203.                                         schedule(%delay * %sbi * 1000, "RPGchat(" @ %client @ ", 0, \"" @ %txt @ "\");");    //, \"" @ %senderName @ "\");");
  6204.                                     }
  6205.                                    
  6206.                                     if(!%echoOff) {
  6207.                                         messageClient(%TrueClientId, 'RPGchatCallback', "Block " @ %bname @ " scheduled for " @ %repeat @ " repeats at " @ %delay @ " second intervals.");
  6208.                                     }
  6209.                                 }
  6210.                                 else {
  6211.                                     messageClient(%TrueClientId, 'RPGchatCallback', "Schedule repeat too low, minimum is 0");
  6212.                                 }
  6213.                             }
  6214.                             else {
  6215.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Schedule delay too low, minimum is 0.05");
  6216.                             }
  6217.                         }
  6218.                         else if(!%echoOff) {
  6219.                             messageClient(%TrueClientId, 'RPGchatCallback', "Block does not exist!");
  6220.                         }
  6221.                     }
  6222.                     else {
  6223.                         messageClient(%TrueClientId, 'RPGchatCallback', "Incorrect syntax for #scheduleblock blockName delay numRepeat");
  6224.                     }
  6225.                 }
  6226.                
  6227.                 return;
  6228.                
  6229.             case "#listonhear":
  6230.                 if(%clientToServerAdminLevel >= 3)
  6231.                 {
  6232.                     if(%cropped !$= "")
  6233.                     {
  6234.                         %id = getClientByName(%cropped);
  6235.                        
  6236.                         if(%id !$= -1)
  6237.                         {
  6238.                             %index = GetEventCommandIndex(%id, "onHear");
  6239.                            
  6240.                             if(%index !$= -1)
  6241.                             {
  6242.                                 for(%i2 = 0; (%index2 = GetWord(%index, %i2)) !$= ""; %i2++) {
  6243.                                     messageClient(%TrueClientId, 'RPGchatCallback', %id.nameBase @ " onHear " @ %index2 @ ": " @ $EventCommand[%id, %index2]);
  6244.                                 }
  6245.                             }
  6246.                         }
  6247.                         else {
  6248.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  6249.                         }
  6250.                     }
  6251.                     else {
  6252.                         messageClient(%TrueClientId, 'RPGchatCallback', "Please specify player name.");
  6253.                     }
  6254.                 }
  6255.                
  6256.                 return;
  6257.                
  6258.             case "#clearonhear":
  6259.                 if(%clientToServerAdminLevel >= 3)
  6260.                 {
  6261.                     %name = GetWord(%cropped, 0);
  6262.                     %oindex = GetWord(%cropped, 1);
  6263.                    
  6264.                     if(%name !$= -1)
  6265.                     {
  6266.                         %id = getClientByName(%name);
  6267.                        
  6268.                         if(%id !$= -1)
  6269.                         {
  6270.                             %index = GetEventCommandIndex(%id, "onHear");
  6271.                            
  6272.                             if(%index !$= -1)
  6273.                             {
  6274.                                 for(%i2 = 0; (%index2 = GetWord(%index, %i2)) !$= ""; %i2++)
  6275.                                 {
  6276.                                     if(mfloor(%index2) $= mfloor(%oindex) || %oindex $= -1)
  6277.                                     {
  6278.                                         $EventCommand[%id, %index2] = "";
  6279.                                        
  6280.                                         if(!%echoOff) {
  6281.                                             messageClient(%TrueClientId, 'RPGchatCallback', %id.nameBase @ " onHear " @ %index2 @ " cleared.");
  6282.                                         }
  6283.                                     }
  6284.                                 }
  6285.                             }
  6286.                         }
  6287.                         else {
  6288.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  6289.                         }
  6290.                     }
  6291.                     else {
  6292.                         messageClient(%TrueClientId, 'RPGchatCallback', "Incorrect syntax for #clearonhear name [index]. If index is missing or -1, all onHears for name are cleared.");
  6293.                     }
  6294.                 }
  6295.                
  6296.                 return;
  6297.                
  6298.             case "#getvelocity":
  6299.                 if(%clientToServerAdminLevel >= 2)
  6300.                 {
  6301.                     %name = GetWord(%cropped, 0);
  6302.                    
  6303.                     %id = getClientByName(%name);
  6304.                    
  6305.                     if(mfloor(%id.adminLevel) >= mfloor(%clientToServerAdminLevel) && %id.nameBase !$= %senderName) {
  6306.                         messageClient(%TrueClientId, 'RPGchatCallback', "Could not process command: Target admin clearance level too high.");
  6307.                     }
  6308.                     else if(%id !$= -1)
  6309.                     {
  6310.                         %vel = %id.player.getVelocity();
  6311.                         messageClient(%TrueClientId, 'RPGchatCallback', %name @ " (" @ %id @ ") velocity: " @ %vel);
  6312.                     }
  6313.                     else {
  6314.                         messageClient(%TrueClientId, 'RPGchatCallback', "Invalid player name.");
  6315.                     }
  6316.                 }
  6317.                
  6318.                 return;
  6319.                
  6320.             case "#onconsider":
  6321.                 if(%clientToServerAdminLevel >= 3)
  6322.                 {
  6323.                     if(%cropped !$= "")
  6324.                     {
  6325.                         %event = strstr(%cropped, ">");
  6326.                        
  6327.                         if(%event !$= -1)
  6328.                         {
  6329.                             %info = getsubstr(%cropped, 0, %event);
  6330.                             %cmd = getsubstr(%cropped, %event, 99999);
  6331.                         }
  6332.                         else {
  6333.                             %info = %cropped;
  6334.                         }
  6335.                        
  6336.                         %tag = GetWord(%info, 0);
  6337.                         %object = $tagToObjectId[%tag];
  6338.                        
  6339.                         if(%object !$= "")
  6340.                         {
  6341.                             %radius = GetWord(%info, 1);
  6342.                             %keep = GetWord(%info, 2);
  6343.                            
  6344.                             if(%keep $= "true" || %keep $= "false")
  6345.                             {
  6346.                                 %targetname = GetWord(%info, 3);
  6347.                                 %tid = getClientByName(%targetname);
  6348.                                
  6349.                                 if(stricmp(%targetname, "all") $= 0 || %tid !$= -1)
  6350.                                 {
  6351.                                     if(%event !$= -1)
  6352.                                     {
  6353.                                         AddEventCommand(%object, %senderName, "onConsider " @ %radius @ " " @ %keep @ " " @ %targetname, %cmd);
  6354.                                        
  6355.                                         if(!%echoOff) {
  6356.                                             messageClient(%TrueClientId, 'RPGchatCallback', "onConsider event set for tagname " @ %tag @ "(" @ %object @ ") for radius " @ %radius);
  6357.                                         }
  6358.                                     }
  6359.                                     else {
  6360.                                         messageClient(%TrueClientId, 'RPGchatCallback', "onConsider event definition failed.");
  6361.                                     }
  6362.                                 }
  6363.                                 else {
  6364.                                     messageClient(%TrueClientId, 'RPGchatCallback', "Invalid name. Please specify 'all' or target's name.");
  6365.                                 }
  6366.                             }
  6367.                             else {
  6368.                                 messageClient(%TrueClientId, 'RPGchatCallback', "Specify 'true' or 'false'. 'true' means that the onConsider event won't be deleted after use.");
  6369.                             }
  6370.                         }
  6371.                         else {
  6372.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid tagname.");
  6373.                         }
  6374.                     }
  6375.                     else {
  6376.                         messageClient(%TrueClientId, 'RPGchatCallback', "#onconsider tagname radius keep all/targetname");
  6377.                     }
  6378.                 }
  6379.                
  6380.                 return;
  6381.                
  6382.             case "#listonconsider":
  6383.                 if(%clientToServerAdminLevel >= 3)
  6384.                 {
  6385.                     if(%cropped !$= "")
  6386.                     {
  6387.                         %tag = GetWord(%cropped, 0);
  6388.                         %object = $tagToObjectId[%tag];
  6389.                        
  6390.                         if(%object !$= "")
  6391.                         {
  6392.                             %index = GetEventCommandIndex(%object, "onConsider");
  6393.                            
  6394.                             if(%index !$= -1)
  6395.                             {
  6396.                                 for(%i2 = 0; (%index2 = GetWord(%index, %i2)) !$= ""; %i2++) {
  6397.                                     messageClient(%TrueClientId, 'RPGchatCallback', %tag @ " (" @ %object @ ") onConsider " @ %index2 @ ": " @ $EventCommand[%object, %index2]);
  6398.                                 }
  6399.                             }
  6400.                         }
  6401.                         else {
  6402.                             messageClient(%TrueClientId, 'RPGchatCallback', "Invalid tagname.");
  6403.                         }
  6404.                     }
  6405.                     else
  6406.                     {
  6407.                         %list = $DISlist;
  6408.                        
  6409.                         for(%p = strstr(%list, ","); (%p = strstr(%list, ",")) !$= -1; %list = getsubstr(%list, %p+1, 99999))
  6410.                         {
  6411.                             %w = getsubstr(%list, 0, %p);
  6412.                             %object = $tagToObjectId[%w];
  6413.                            
  6414.                             %index = GetEventCommandIndex(%object, "onConsider");
  6415.                            
  6416.                             if(%index !$= -1) {
  6417.                                 messageClient(%TrueClientId, 'RPGchatCallback', %w @ ": " @ %index);
  6418.                             }
  6419.                         }
  6420.                     }
  6421.                 }
  6422.                
  6423.                 return;
  6424.                
  6425.             case "#clearonconsider":
  6426.                 if(%clientToServerAdminLevel >= 3)
  6427.                 {
  6428.                     %tag = GetWord(%cropped, 0);
  6429.                     %object = $tagToObjectId[%tag];
  6430.                    
  6431.                     if(%object !$= "")
  6432.                     {
  6433.                         %oindex = GetWord(%cropped, 1);
  6434.                        
  6435.                         %index = GetEventCommandIndex(%object, "onConsider");
  6436.                        
  6437.                         if(%index !$= -1)
  6438.                         {
  6439.                             for(%i2 = 0; (%index2 = GetWord(%index, %i2)) !$= ""; %i2++)
  6440.                             {
  6441.                                 if(mfloor(%index2) $= mfloor(%oindex) || %oindex $= -1)
  6442.                                 {
  6443.                                     $EventCommand[%object, %index2] = "";
  6444.                                    
  6445.                                     if(!%echoOff) {
  6446.                                         messageClient(%TrueClientId, 'RPGchatCallback', %tag @ " (" @ %object @ ") onConsider " @ %index2 @ " cleared.");
  6447.                                     }
  6448.                                 }
  6449.                             }
  6450.                         }
  6451.                     }
  6452.                     else {
  6453.                         messageClient(%TrueClientId, 'RPGchatCallback', "Incorrect tagname for #clearonconsider tagname [index]. If index is missing or -1, all onConsiders for name are cleared.");
  6454.                     }
  6455.                 }
  6456.                
  6457.                 return;
  6458.         }
  6459.     }
  6460.    
  6461.     //========== BOT TALK ======================================================================================
  6462.    
  6463.     if(%botTalk)
  6464.     {
  6465.         //process TownBot talk
  6466.        
  6467.         %initTalk = "";
  6468.        
  6469.         for(%i = 0; (%w = GetWord("hail hello hi greetings yo hey sup salutations g'day howdy", %i)) !$= ""; %i++)
  6470.             if(stricmp(%cropped, %w) $= 0) {
  6471.                 %initTalk = true;
  6472.             }
  6473.            
  6474.         %clientPos = %TrueClientId.player.getTransform();
  6475.         %closest = 5000000;
  6476.        
  6477.         for(%i = 0; (%id = GetWord($TownBotList, %i)) !$= ""; %i++)
  6478.         {
  6479.        
  6480.             %botPos = %id.getTransform();
  6481.             %dist = VectorDist(%clientPos, %botPos);
  6482.            
  6483.             if(%dist < %closest)
  6484.             {
  6485.                 %closest = %dist;
  6486.                 %closestId = %id;
  6487.                 %closestPos = %botPos;
  6488.             }
  6489.         }
  6490.        
  6491.        
  6492.         %aiName = %closestId.name;//hrm
  6493.         %aiType = %closestID.mtype;
  6494.         %displayName = %aiName;
  6495.        
  6496.         if(%closest <= ($maxAIdistVec + (%TrueClientId.PlayerSkill[$SkillSpeech] / 50)) && %TrueClientId.team $= %closestId.team)
  6497.         {
  6498.        
  6499.             if(%aitype $= "merchant")
  6500.             {
  6501.                 //process merchant code
  6502.                 %trigger[2] = "buy";
  6503.                
  6504.                 if($state[%closestId, %TrueClientId] $= "")
  6505.                 {
  6506.                     if(%initTalk)
  6507.                     {
  6508.                         AI::sayLater(%TrueClientId, %closestId, "Did you come to see what items you can BUY?", true);
  6509.                         $state[%closestId, %TrueClientId] = 1;
  6510.                        
  6511.                     }
  6512.                 }
  6513.                 else if($state[%closestId, %TrueClientId] $= 1)
  6514.                 {
  6515.                     if(strstr(%message, %trigger[2]) !$= -1)
  6516.                     {
  6517.                         $state[%closestId, %TrueClientId] = "";
  6518.                         SetupShop(%TrueClientId, %closestId);
  6519.                        
  6520.                         AI::sayLater(%TrueClientId, %closestId, "Take a look at what I have.", true);
  6521.                        
  6522.                        
  6523.                     }
  6524.                 }
  6525.                
  6526.                 return;
  6527.             }
  6528.             else if(%aitype $= "bank")
  6529.             {
  6530.                 //process banker code
  6531.                 %trigger[2] = "yes";
  6532.                 %trigger[3] = "no";
  6533.                
  6534.                 if($state[%closestId, %TrueClientId] $= "")
  6535.                 {
  6536.                     if(%initTalk)
  6537.                     {
  6538.                         AI::sayLater(%TrueClientId, %closestId, "Would you like to access your bank account? (Yes or No)", true);
  6539.                         $state[%closestId, %TrueClientId] = 1;
  6540.                     }
  6541.                 }
  6542.                
  6543.                 if($state[%closestId, %TrueClientId] $= 1)
  6544.                 {
  6545.                     if(strstr(%message, %trigger[2]) !$= -1)
  6546.                     {
  6547.                         //deposit question
  6548.                         AI::sayLater(%TrueClientId, %closestId, "Ok, here is what you have stored here.", true);
  6549.                         setupbank(%TrueClientId, %closestId);
  6550.                         $state[%closestId, %TrueClientId] = "";
  6551.                     }
  6552.                    
  6553.                     if(strstr(%message, %trigger[3]) !$= -1)
  6554.                     {
  6555.                         //withdraw question
  6556.                         AI::sayLater(%TrueClientId, %closestId, "Good day, sir.", true);
  6557.                         $state[%closestId, %TrueClientId] = "";
  6558.                     }
  6559.                 }
  6560.             }
  6561.            
  6562.             if(%aitype $= "assassin")
  6563.             {
  6564.                 //process assassin code
  6565.                 %trigger[2] = "yes";
  6566.                 %trigger[3] = "no";
  6567.                 %trigger[4] = "buy";
  6568.                
  6569.                 if($state[%closestId, %TrueClientId] $= "")
  6570.                 {
  6571.                     if(%initTalk)
  6572.                     {
  6573.                         %highest = -1;
  6574.                         %list = GetPlayerIdList();
  6575.                        
  6576.                         for(%i = 0; (%id = GetWord(%list, %i)) !$= ""; %i++)
  6577.                         {
  6578.                             if(fetchData(%id, "bounty") $= "") {
  6579.                                 storeData(%id, "bounty", 0);
  6580.                             }
  6581.                            
  6582.                             if(fetchData(%id, "bounty") > %highest)
  6583.                             {
  6584.                                 %h = %id;
  6585.                                 %highest = fetchData(%id, "bounty");
  6586.                             }
  6587.                         }
  6588.                        
  6589.                         %n = %h.nameBase;
  6590.                         %c = fetchData(%h, "bounty");
  6591.                        
  6592.                         AI::sayLater(%TrueClientId, %closestId, "The highest bounty is currently on " @ %n @ " for $" @ %c @ ". Give me someone's name and I'll tell you their bounty, unless you want to BUY something." , true);
  6593.                        
  6594.                         $state[%closestId, %TrueClientId] = 1;
  6595.                     }
  6596.                 }
  6597.                 else if($state[%closestId, %TrueClientId] $= 1)
  6598.                 {
  6599.                     if(strstr(%message, %trigger[4]) !$= -1)
  6600.                     {
  6601.                         %cost = GetLCKcost(%TrueClientId);
  6602.                        
  6603.                         AI::sayLater(%TrueClientId, %closestId, "I will sell you one LCK point for $" @ %cost @ ". (YES/NO)", true);
  6604.                         $state[%closestId, %TrueClientId] = 2;
  6605.                     }
  6606.                     else
  6607.                     {
  6608.                         %lowest = 99999;
  6609.                         %h = "";
  6610.                         %list = GetPlayerIdList();
  6611.                        
  6612.                         for(%i = 0; (%id = GetWord(%list, %i)) !$= ""; %i++)
  6613.                         {
  6614.                             %comp = stricmp(%cropped, %id.nameBase);
  6615.                            
  6616.                             if(%comp < 0) {
  6617.                                 %comp = -%comp;
  6618.                             }
  6619.                            
  6620.                             if(%comp < %lowest)
  6621.                             {
  6622.                                 %h = %id;
  6623.                                 %lowest = %comp;
  6624.                             }
  6625.                         }
  6626.                        
  6627.                         if(%h !$= "")
  6628.                         {
  6629.                             %l = fetchData(%h, "LVL");
  6630.                             %c = getFinalCLASS(%h);
  6631.                             AI::sayLater(%TrueClientId, %closestId, "Are you talking about " @ %h.nameBase @ " the Level " @ %l @ " " @ %c @ "?", true);
  6632.                             storeData(%TrueClientId, "tmpdata", %h);
  6633.                             $state[%closestId, %TrueClientId] = 3;
  6634.                         }
  6635.                         else
  6636.                         {
  6637.                             AI::sayLater(%TrueClientId, %closestId, "I have no idea who you are talking about. Goodbye.", true);
  6638.                             $state[%closestId, %TrueClientId] = "";
  6639.                         }
  6640.                     }
  6641.                 }
  6642.                 else if($state[%closestId, %TrueClientId] $= 2)
  6643.                 {
  6644.                     if(strstr(%message, %trigger[2]) !$= -1)
  6645.                     {
  6646.                         %cost = GetLCKcost(%TrueClientId);
  6647.                        
  6648.                         if(fetchData(%TrueClientId, "COINS") >= %cost)
  6649.                         {
  6650.                             AI::sayLater(%TrueClientId, %closestId, "Here's your LCK point, thanks for your business.", true);
  6651.                             GiveThisStuff(%TrueClientId, "LCK 1", true);
  6652.                             storeData(%TrueClientId, "COINS", %cost, "dec");
  6653.                             RefreshAll(%TrueClientId);
  6654.                         }
  6655.                         else {
  6656.                             AI::sayLater(%TrueClientId, %closestId, "You can't afford this.", true);
  6657.                         }
  6658.                        
  6659.                         $state[%closestId, %TrueClientId] = "";
  6660.                     }
  6661.                     else if(strstr(%message, %trigger[3]) !$= -1)
  6662.                     {
  6663.                         AI::sayLater(%TrueClientId, %closestId, "See ya.", true);
  6664.                         $state[%closestId, %TrueClientId] = "";
  6665.                     }
  6666.                 }
  6667.                 else if($state[%closestId, %TrueClientId] $= 3)
  6668.                 {
  6669.                     if(strstr(%message, %trigger[2]) !$= -1)
  6670.                     {
  6671.                         %id = fetchData(%TrueClientId, "tmpdata");
  6672.                        
  6673.                         if(%id !$= %TrueClientId)
  6674.                         {
  6675.                             %n = %id.nameBase;
  6676.                            
  6677.                             if(IsInCommaList(fetchData(%TrueClientId, "TempKillList"), %n))
  6678.                             {
  6679.                                 storeData(%TrueClientId, "TempKillList", RemoveFromCommaList(fetchData(%TrueClientId, "TempKillList"), %n));
  6680.                                 AI::sayLater(%TrueClientId, %closestId, "I see you've killed " @ %n @ ". Here's your reward... " @ fetchData(%id, "bounty") @ " coins. Goodbye.", true);
  6681.                                 storeData(%TrueClientId, "COINS", fetchData(%id, "bounty"), "inc");
  6682.                                 storeData(%id, "bounty", 0);
  6683.                                
  6684.                                 %TrueClientId.player.playAudio(0, SoundMoney1);
  6685.                                 RefreshAll(%TrueClientId);
  6686.                             }
  6687.                             else {
  6688.                                 AI::sayLater(%TrueClientId, %closestId, %n @ "'s bounty is currently at " @ fetchData(%id, "bounty") @ " coins. Goodbye.", true);
  6689.                             }
  6690.                         }
  6691.                         else {
  6692.                             AI::sayLater(%TrueClientId, %closestId, "You can't get a reward for killing yourself... idiot.", true);
  6693.                         }
  6694.                        
  6695.                         $state[%closestId, %TrueClientId] = "";
  6696.                     }
  6697.                     else if(strstr(%message, %trigger[3]) !$= -1)
  6698.                     {
  6699.                         AI::sayLater(%TrueClientId, %closestId, "Well then, I have no idea who you are talking about. Goodbye.", true);
  6700.                         storeData(%TrueClientId, "tmpdata", "");
  6701.                         $state[%closestId, %TrueClientId] = "";
  6702.                     }
  6703.                 }
  6704.             }
  6705.             else if(%aitype $= "quest")
  6706.             {
  6707.                 Schedule(0, game, "QUEST" @ %closestid.cFunction, %closestid.qobj,  %closestid, %TrueClientId, %cropped);
  6708.             }
  6709.             else if(%aitype $= "Porter")
  6710.             {
  6711.                 //process manager code
  6712.                 %trigger[2] = "fight";
  6713.                 %trigger[3] = "refuse";
  6714.                
  6715.                 if($state[%closestId, %TrueClientId] $= "")
  6716.                 {
  6717.                     if(%initTalk)
  6718.                     {
  6719.                    
  6720.                         //AI::sayLater(%TrueClientId, %closestId, "Hail. Welcome to the arena, where the strongest warriors in the land compete for dominance! You may chose to FIGHT or you may REFUSE.", true);
  6721.                         AI::sayLater(%TrueClientId, %closestId, "Sorry, arena is currently closed. Come back later!", true);
  6722.                         $state[%closestId, %TrueClientId] = 0;
  6723.                     }
  6724.                 }
  6725.                 else if($state[%closestId, %TrueClientId] $= 1)
  6726.                 {
  6727.                     if(strstr(%message, %trigger[2]) !$= -1)
  6728.                     {
  6729.                         //FIGHT
  6730.                         %x = AddToRoster(%TrueClientId);
  6731.                        
  6732.                         if(%x !$= 0)
  6733.                         {
  6734.                             //TeleportToMarker(%TrueClientId, "TheArena/WaitingRoomMarkers", 0, 1);
  6735.                            
  6736.                             $state[%closestId, %TrueClientId] = "";
  6737.                             MessageClient(%TrueClientId, 'RPGchatcallback', "You have entered the waiting room. To leave the wait room type #leavearena");
  6738.                         }
  6739.                         else
  6740.                         {
  6741.                             //arena is full
  6742.                             AI::sayLater(%TrueClientId, %closestId, "Sorry, the arena roster is full right now.", true);
  6743.                             $state[%closestId, %TrueClientId] = "";
  6744.                         }
  6745.                     }
  6746.                     else if(strstr(%message, %trigger[3]) !$= -1)
  6747.                     {
  6748.                    
  6749.                    
  6750.                         AI::sayLater(%TrueClientId, %closestId, "That is too bad. However, we plan on some major improvements in the future, so I hope you choose to come fight later.", true);
  6751.                        
  6752.                     }
  6753.                 }
  6754.             }
  6755.             else if(%aitype $= "botmaker")
  6756.             {
  6757.                 //process botmaker code
  6758.                 %trigger[2] = "yes";
  6759.                 %trigger[3] = "no";
  6760.                
  6761.                 if($state[%closestId, %TrueClientId] $= "")
  6762.                 {
  6763.                     if(%initTalk)
  6764.                     {
  6765.                         if(CountObjInCommaList($PetList) >= $maxPets)
  6766.                         {
  6767.                             AI::sayLater(%TrueClientId, %closestId, "I'm sorry but all my helpers are already on duty.", true);
  6768.                             $state[%closestId, %TrueClientId] = "";
  6769.                         }
  6770.                         else if(CountObjInCommaList(fetchData(%TrueClientId, "PersonalPetList")) >= $maxPetsPerPlayer)
  6771.                         {
  6772.                             AI::sayLater(%TrueClientId, %closestId, "I'm sorry but you have too many helpers currently at your disposal.", true);
  6773.                             $state[%closestId, %TrueClientId] = "";
  6774.                         }
  6775.                         else
  6776.                         {
  6777.                             AI::sayLater(%TrueClientId, %closestId, "I have all sorts of helpers at my disposal. Tell me which class you are interested in.", true);
  6778.                             $state[%closestId, %TrueClientId] = 1;
  6779.                         }
  6780.                     }
  6781.                 }
  6782.                 else if($state[%closestId, %TrueClientId] $= 1)
  6783.                 {
  6784.                     %class = GetWord(%cropped, 0);
  6785.                     %gender = GetWord(%cropped, 1);
  6786.                     %defaults = $BotInfo[%aiName, DEFAULTS, %class];
  6787.                    
  6788.                     if(%gender $= -1) {
  6789.                         %gender = "Male";
  6790.                     }
  6791.                    
  6792.                     if(stricmp(%gender, "male") $= 0)
  6793.                     {
  6794.                         %gender = "Male";
  6795.                         %gflag = true;
  6796.                     }
  6797.                     else if(stricmp(%gender, "female") $= 0)
  6798.                     {
  6799.                         %gender = "Female";
  6800.                         %gflag = true;
  6801.                     }
  6802.                    
  6803.                     if(stricmp(%class, "mage") $= 0) {
  6804.                         %class = "Mage";
  6805.                     }
  6806.                     else if(stricmp(%class, "fighter") $= 0) {
  6807.                         %class = "Fighter";
  6808.                     }
  6809.                     else if(stricmp(%class, "paladin") $= 0) {
  6810.                         %class = "Paladin";
  6811.                     }
  6812.                     else if(stricmp(%class, "thief") $= 0) {
  6813.                         %class = "Thief";
  6814.                     }
  6815.                     else if(stricmp(%class, "bard") $= 0) {
  6816.                         %class = "Bard";
  6817.                     }
  6818.                     else if(stricmp(%class, "ranger") $= 0) {
  6819.                         %class = "Ranger";
  6820.                     }
  6821.                     else if(stricmp(%class, "cleric") $= 0) {
  6822.                         %class = "Cleric";
  6823.                     }
  6824.                     else if(stricmp(%class, "druid") $= 0) {
  6825.                         %class = "Druid";
  6826.                     }
  6827.                    
  6828.                     if(%defaults !$= "")
  6829.                     {
  6830.                         if(%gflag)
  6831.                         {
  6832.                             %lvl = GetStuffStringCount(%defaults, "LVL");
  6833.                             %nc = mpow(%lvl, 2) * 3;
  6834.                             $tmpdata[%TrueClientId, 1] = %class;
  6835.                             $tmpdata[%TrueClientId, 2] = %gender;
  6836.                             $tmpdata[%TrueClientId, 3] = %nc;   //just so the equation is only in one place.
  6837.                            
  6838.                             AI::sayLater(%TrueClientId, %closestId, "My " @ %class @ "s are Level " @ %lvl @ ", and will cost you " @ %nc @ " coins. [yes/no]", true);
  6839.                             $state[%closestId, %TrueClientId] = 2;
  6840.                         }
  6841.                         else
  6842.                         {
  6843.                             AI::sayLater(%TrueClientId, %closestId, "Invalid gender. Use 'male' or 'female'.", true);
  6844.                             $state[%closestId, %TrueClientId] = "";
  6845.                         }
  6846.                     }
  6847.                     else
  6848.                     {
  6849.                         AI::sayLater(%TrueClientId, %closestId, "Invalid class. Use any of the following: mage fighter paladin ranger thief bard cleric druid.", true);
  6850.                         $state[%closestId, %TrueClientId] = "";
  6851.                     }
  6852.                 }
  6853.                 else if($state[%closestId, %TrueClientId] $= 2)
  6854.                 {
  6855.                     if(strstr(%message, %trigger[2]) !$= -1)
  6856.                     {
  6857.                         %nc = $tmpdata[%TrueClientId, 3];
  6858.                        
  6859.                         if(%nc <= 0)
  6860.                         {
  6861.                             AI::sayLater(%TrueClientId, %closestId, "Invalid request.  Your transaction has been cancelled.~wError_Message.wav", true);
  6862.                             $state[%closestId, %TrueClientId] = "";
  6863.                         }
  6864.                         else if(%nc <= fetchData(%TrueClientId, "COINS"))
  6865.                         {
  6866.                             %class = $tmpdata[%TrueClientId, 1];
  6867.                             %gender = $tmpdata[%TrueClientId, 2];
  6868.                             %defaults = $BotInfo[%aiName, DEFAULTS, %class];
  6869.                             %lvl = GetStuffStringCount(%defaults, "LVL");
  6870.                            
  6871.                             storeData(%TrueClientId, "COINS", %nc, "dec");
  6872.                             %closestId.player.playAudio(0, SoundMoney1);
  6873.                             RefreshAll(%TrueClientId);
  6874.                            
  6875.                             %n = "";
  6876.                            
  6877.                             for(%i = 0; (%a = GetWord($BotInfo[%aiName, NAMES], %i)) !$= ""; %i++)
  6878.                             {
  6879.                                 if(getClientByName(%a) $= -1)
  6880.                                 {
  6881.                                     %n = %a;
  6882.                                     break;
  6883.                                 }
  6884.                             }
  6885.                            
  6886.                             if(%n $= "") {
  6887.                                 %n = "generic";
  6888.                             }
  6889.                            
  6890.                             $BotEquipment[generic] = "CLASS " @ %class @ " " @ %defaults;
  6891.                             %an = AI::helper("generic", %n, "TempSpawn " @ $BotInfo[%aiName, DESTSPAWN].player.getPosition() @ " " @ GameBase::getTeam(%TrueClientId));
  6892.                             %id = AI::getId(%an);
  6893.                             %id.sex = %gender;
  6894.                             ChangeRace(%id, "Human");
  6895.                             storeData(%id, "tmpbotdata", %TrueClientId);
  6896.                             storeData(%id, "botAttackMode", 2);
  6897.                            
  6898.                             schedule(55*60*1000, "Pet::BeforeTurnEvil(" @ %id @ ");");
  6899.                             schedule(60*60*1000, "Pet::TurnEvil(" @ %id @ ");");
  6900.                            
  6901.                             $PetList = AddToCommaList($PetList, %id);
  6902.                             storeData(%TrueClientId, "PersonalPetList", AddToCommaList(fetchData(%TrueClientId, "PersonalPetList"), %id));
  6903.                             storeData(%id, "petowner", %TrueClientId);
  6904.                            
  6905.                             AI::sayLater(%TrueClientId, %closestId, "This is " @ %n @ ", a Level " @ %lvl @ " " @ %class @ "! He is at your disposal. He will follow you around and fight for you for the next hour.", true);
  6906.                             $state[%closestId, %TrueClientId] = "";
  6907.                         }
  6908.                         else
  6909.                         {
  6910.                             AI::sayLater(%TrueClientId, %closestId, "You don't have enough coins. Goodbye.", true);
  6911.                             $state[%closestId, %TrueClientId] = "";
  6912.                         }
  6913.                        
  6914.                     }
  6915.                     else if(strstr(%message, %trigger[3]) !$= -1)
  6916.                     {
  6917.                         AI::sayLater(%TrueClientId, %closestId, "As you wish. Goodbye.", true);
  6918.                         $state[%closestId, %TrueClientId] = "";
  6919.                     }
  6920.                 }
  6921.             }
  6922.             else if(%aitype$= "Boat")
  6923.             {
  6924.                 if($state[%closestId, %TrueClientId] $= "")
  6925.                 {
  6926.                     if(%inittalk)
  6927.                     {
  6928.                         AI::sayLater(%TrueClientId, %closestId, "Hello traveller! Welcome to my boat shop, would you like to RENT a boat for 100 coins?");
  6929.                     }
  6930.                     else if(strstr(%message, "rent") !$= -1)
  6931.                     {
  6932.                         if(fetchdata(%TrueClientId, "COINS") >= 100)
  6933.                         {
  6934.                             %obj = Boat @ %closestid.shop;
  6935.                            
  6936.                             if(isobject(%obj))
  6937.                             {
  6938.                            
  6939.                                 %flag = false;
  6940.                                
  6941.                                 for(%i = 0; %i < %obj.getCount(); %i++)
  6942.                                 {
  6943.                                
  6944.                                     %zobj = %obj.getObject(%i);
  6945.                                     InitContainerRadiusSearch(VectorAdd(%zobj.getWorldBoxCenter(), "-2 -2 -2"), "4 4 4", $TypeMasks::VehicleObjectType);
  6946.                                     %ret = containerSearchNext();
  6947.                                    
  6948.                                     if(%ret == 0)
  6949.                                     {
  6950.                                         %flag = true;
  6951.                                         break;
  6952.                                     }
  6953.                                 }
  6954.                                
  6955.                                 if(%flag)
  6956.                                 {
  6957.                                     if(%TrueClientId.boat)
  6958.                                     {
  6959.                                         %TrueClientId.Boat.delete();
  6960.                                     }
  6961.                                    
  6962.                                     AI::sayLater(%TrueClientId, %closestId, "Ok here you go!");
  6963.                                     %spawnpos = %zobj.getWorldBoxCenter();
  6964.                                    
  6965.                                     %boat = new HoverVehicle()
  6966.                                     {
  6967.                                         dataBlock  = RPGBoat;
  6968.                                        
  6969.                                     };
  6970.                                     %waterheight = getword(VectorAdd(GlobalWater.position, GlobalWater.scale) , 2);
  6971.                                     %spawnpos = GetWord(%spawnpos, 0) SPC Getword(%spawnpos, 1) SPC %waterheight+3;
  6972.                                     %ztran = %zobj.getTransform();
  6973.                                     //%zrot = getword(%ztran, 3) SPC getword(%ztran, 4) SPC getword(%ztran, 5) SPC getword(%ztran, 6);
  6974.                                    
  6975.                                     %zrot = getWords(%ztran, 3, 5);
  6976.                                     %angle =  1;
  6977.                                    
  6978.                                     %boat.setTransform(%spawnpos SPC %zrot SPC %angle);
  6979.                                     MissionCleanup.add(%boat);
  6980.                                    
  6981.                                     %boat.owner = %trueclientid;
  6982.                                    
  6983.                                     %zobj.full = true;
  6984.                                     %trueclientid.boat = %boat;
  6985.                                     StoreData(%TrueClientId, "COINS", 100, "dec");
  6986.                                 }
  6987.                                 else {
  6988.                                     AI::sayLater(%TrueClientId, %closestId, "Sorry I do not have any spots availible, come back later.");
  6989.                                 }
  6990.                             }
  6991.                             else {
  6992.                                 AI::sayLater(%TrueClientId, %closestId, "Sorry I do not have any spots availible, come back later. [ERROR]");
  6993.                             }
  6994.                         }
  6995.                         else {
  6996.                             AI::sayLater(%TrueClientId, %closestId, "Come back when you have enough money!");
  6997.                         }
  6998.                     }
  6999.                    
  7000.                 }
  7001.             }
  7002.             else if(%aiType $= "Guild")
  7003.             {
  7004.            
  7005.                 //process guildmaster code
  7006.                 if($state[%closestId, %TrueClientId] $= "")
  7007.                 {
  7008.                     if(%initTalk)
  7009.                     {
  7010.                         if(fetchData(%TrueClientId, "LVL") >= 25)
  7011.                         {
  7012.                             AI::sayLater(%TrueClientId, %closestId, "Hello adventurer. Here is a list of the guilds currently registered in this land.", true);
  7013.                             $state[%closestId, %TrueClientId] = "";
  7014.                             CommandToClient(%TrueClientId, 'OpenGuildGUI');
  7015.                         }
  7016.                         else
  7017.                         {
  7018.                             AI::sayLater(%TrueClientId, %closestId, "Come back when you are at least level 25. Goodbye.", true);
  7019.                             $state[%closestId, %TrueClientId] = "";
  7020.                         }
  7021.                     }
  7022.                 }
  7023.                
  7024.             }
  7025.         }
  7026.         else
  7027.         {
  7028.             //This condition occurs when you are talking from too far of any TownBot.  All states are cleared here.
  7029.             //This means that potentially, you could initiate a conversation with the banker, travel for an hour
  7030.             //WITHOUT saying a word, come back and continue the conversation.  As soon as you speak in a way that
  7031.             //townbots hear you (#say, #shout, #tell) and are too far from them, all conversations are reset.
  7032.            
  7033.             for(%i = 0; (%id = GetWord($TownBotList, %i)) !$= ""; %i++) {
  7034.                 $state[%id, %TrueClientId] = "";
  7035.             }
  7036.         }
  7037.     }
  7038. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement