Beispiel #1
0
 public override void ExecuteCommand(Client client, Identity target, string[] args)
 {
     client.SendChatText("Looking up for statel in playfield " + client.Character.PlayField.ToString());
     Statels.Statel o = null;
     foreach (Statels.Statel s in Statels.Statelppf[client.Character.PlayField])
     {
         if (o == null)
         {
             o = s;
         }
         else
         {
             if (AOCoord.Distance2D(client.Character.Coordinates, s.Coordinates)
                 < AOCoord.Distance2D(client.Character.Coordinates, o.Coordinates))
             {
                 o = s;
             }
         }
     }
     if (o == null)
     {
         client.SendChatText("No statel on this playfield... Very odd, where exactly are you???");
         return;
     }
     client.SendChatText(o.Type + ":" + o.Instance);
     foreach (Statels.StatelEvent se in o.Events)
     {
         client.SendChatText(
             "Event: " + se.EventNumber.ToString() + " # of Functions: " + se.Functions.Count.ToString());
         foreach (Statels.Statel_Function sf in se.Functions)
         {
             string Fargs = "";
             foreach (string arg in sf.Arguments)
             {
                 if (Fargs.Length > 0)
                 {
                     Fargs = Fargs + ", ";
                 }
                 Fargs = Fargs + arg;
             }
             client.SendChatText(
                 "    Fn: " + sf.FunctionNumber.ToString() + ", # of Args: " + sf.Arguments.Count.ToString());
             client.SendChatText("    Args: " + Fargs);
             foreach (Statels.Statel_Function_Requirement sfr in sf.Requirements)
             {
                 string req;
                 req = "Attr: " + sfr.AttributeNumber.ToString() + " Value: " + sfr.AttributeValue.ToString()
                       + " Target: " + sfr.Target.ToString() + " Op: " + sfr.Operator.ToString();
                 client.SendChatText("    Req: " + req);
             }
         }
     }
 }
Beispiel #2
0
 public static Doors DoorinRange(int playfield, AOCoord coord, float range)
 {
     foreach (Doors door in Program.zoneServer.Doors)
     {
         int pf = door.ID & 0xffff;
         if (pf != playfield)
         {
             continue;
         }
         if ((coord.Distance2D(door.Coordinates) < range) &&
             (Math.Abs(coord.coordinate.y - door.Coordinates.y) < 3))
         {
             return(door);
         }
     }
     return(null);
 }
Beispiel #3
0
 public bool onTargetinVicinity(Client cli)
 {
     foreach (StatelEvent e in this.Events)
     {
         if (e.EventNumber != Constants.EventtypeOnTargetInVicinity)
         {
             continue;
         }
         if ((AOCoord.Distance2D(cli.Character.Coordinates, this.Coordinates) < 1.2f) &&
             (Math.Abs(cli.Character.Coordinates.y - this.Coordinates.y) < 5))
         {
             foreach (Statel_Function f in e.Functions)
             {
                 f.Execute(cli, this, e.EventNumber);
             }
             return(true);
         }
     }
     return(false);
 }