Exemple #1
0
        /// <summary>
        /// Lineteleport
        /// </summary>
        /// <param name="Self"></param>
        /// <param name="Caller"></param>
        /// <param name="Target"></param>
        /// <param name="Arguments">UInt32 (LineType?), UInt32 (Combo of Line# and Playfield), Int32 (Playfield to teleport to)</param>
        /// <returns></returns>
        public bool FunctionExecute(Dynel Self, Dynel Caller, object Target, object[] Arguments)
        {
            uint arg2;
            int  to_pf;

            Console.WriteLine(Target.GetType().ToString());
            if (Target is Statels.Statel)
            {
                arg2  = UInt32.Parse((string)Arguments[1]); // Linesegment and playfield (lower word)
                arg2  = arg2 >> 16;
                to_pf = Int32.Parse((string)Arguments[2]);
            }
            else
            {
                arg2  = (UInt32)Arguments[1];
                to_pf = (Int32)Arguments[2];
            }
            CoordHeading a = this.FindEntry(to_pf, (Int32)arg2);

            if (a.Coordinates.x != -1)
            {
                ((Character)Self).Client.Teleport(a.Coordinates, a.Heading, to_pf);
                return(true);
            }
            return(false);
        }
        public bool FunctionExecute(Dynel self, Dynel caller, object target, object[] arguments)
        {
            Client cli = ((Character)self).Client;
            Quaternion q = new Quaternion(0, 1, 0, 0);
            AOCoord a = new AOCoord();
            Int32 pf;
            if (target is Statels.Statel)
            {
                a.x = Int32.Parse((string)arguments[0]);
                a.y = Int32.Parse((string)arguments[1]);
                a.z = Int32.Parse((string)arguments[2]);
                pf = Int32.Parse((string)arguments[3]);
            }
            else
            {
                a.x = (Int32)arguments[0];
                a.y = (Int32)arguments[1];
                a.z = (Int32)arguments[2];
                pf = (Int32)arguments[3];
            }

            // Same playfield teleport sometimes has 0 for pf argument
            if (pf == 0)
            {
                pf = cli.Character.PlayField;
            }

            cli.Teleport(a, q, pf);
            return true;
        }
Exemple #3
0
        public bool FunctionExecute(Dynel Self, Dynel Caller, object Target, object[] Arguments)
        {
            string text = (string)Arguments[0];

            SystemText.Send(((Character)Self).Client, text, 0);
            return(true);
        }
Exemple #4
0
        /// <summary>
        /// Experimental - Check who is in the given radius
        /// </summary>
        /// <param name="client">Character or NPC to start from</param>
        /// <param name="radius">RAdius</param>
        /// <returns></returns>
        public static List <Dynel> GetClientsInRadius(Dynel client, float radius)
        {
            // we're added ourselves, because we're included in the list too.
            List <Dynel> clientList = new List <Dynel> {
                client
            };

            // searching client as first one!

            foreach (Client client1 in Program.zoneServer.Clients)
            {
                if (client1.Character.PlayField != client.PlayField)
                {
                    continue;
                }
                if (client1.Character.Id == client.Id)
                {
                    continue;
                }
                if (client1.Character.Coordinates.Distance2D(client.Coordinates) >= radius)
                {
                    continue;
                }
                clientList.Add(client1.Character);
            }
            return(clientList);
        }
 public bool FunctionExecute(Dynel self, Dynel caller, object target, object[] arguments)
 {
     int actionnumber = (Int32)arguments[0];
     NonPlayerCharacterClass knubotTarget = (NonPlayerCharacterClass)self;
     knubotTarget.KnuBot.Action((Int32)arguments[0]);
     return true;
 }
 public bool FunctionExecute(Dynel Self, Dynel Caller, object Target, object[] Arguments)
 {
     Character ch = (Character)Self;
     Dictionary<int, uint> statstoupdate = new Dictionary<int, uint>();
     foreach (ClassStat cs in ch.Stats.All)
     {
         if (cs.Changed)
         {
             if (cs.SendBaseValue)
             {
                 statstoupdate.Add(cs.StatNumber, cs.StatBaseValue);
             }
             else
             {
                 statstoupdate.Add(cs.StatNumber, (uint)cs.Value);
             }
             cs.Changed = false;
         }
     }
     if (ch.Client == null)
     {
         Stat.SendBulk(ch, statstoupdate);
     }
     else
     {
         Stat.SendBulk(ch.Client, statstoupdate);
     }
     return true;
 }
Exemple #7
0
        public bool FunctionExecute(Dynel self, Dynel caller, object target, object[] arguments)
        {
            Client     cli = ((Character)self).Client;
            Quaternion q   = new Quaternion(0, 1, 0, 0);
            AOCoord    a   = new AOCoord();
            Int32      pf;

            if (target is Statels.Statel)
            {
                a.x = Int32.Parse((string)arguments[0]);
                a.y = Int32.Parse((string)arguments[1]);
                a.z = Int32.Parse((string)arguments[2]);
                pf  = Int32.Parse((string)arguments[3]);
            }
            else
            {
                a.x = (Int32)arguments[0];
                a.y = (Int32)arguments[1];
                a.z = (Int32)arguments[2];
                pf  = (Int32)arguments[3];
            }

            // Same playfield teleport sometimes has 0 for pf argument
            if (pf == 0)
            {
                pf = cli.Character.PlayField;
            }

            cli.Teleport(a, q, pf);
            return(true);
        }
Exemple #8
0
        public static void DespawnPacket(int targetId)
        {
            PacketWriter packetWriter = new PacketWriter();

            packetWriter.PushByte(0xDF);
            packetWriter.PushByte(0xDF);
            packetWriter.PushShort(10);
            packetWriter.PushShort(1);
            packetWriter.PushShort(0x1d);
            packetWriter.PushInt(3086);
            packetWriter.PushInt(0);
            packetWriter.PushInt(0x36510078);
            packetWriter.PushIdentity(50000, targetId);
            packetWriter.PushByte(1);
            byte[] packet = packetWriter.Finish();

            Dynel dyn = FindDynel.FindDynelById(50000, targetId);

            if (dyn != null)
            {
                NonPlayerCharacterClass npc = dyn as NonPlayerCharacterClass;
                if (npc != null)
                {
                    npc.RemoveFromCache();
                }
                Announce.PlayfieldOthers(dyn.PlayField, packet);
            }
        }
 public bool FunctionExecute(Dynel Self, Dynel Caller, object Target, object[] Arguments)
 {
     Character ch = (Character)Self;
     ch.Stats.SetPercentageModifier(
         (Int32)Arguments[0], ch.Stats.GetPercentageModifier((Int32)Arguments[0]) + (Int32)Arguments[1]);
     return true;
 }
Exemple #10
0
        public bool FunctionExecute(Dynel Self, Dynel Caller, object Target, object[] Arguments)
        {
            Character ch = (Character)Self;
            Dictionary <int, uint> statstoupdate = new Dictionary <int, uint>();

            foreach (ClassStat cs in ch.Stats.All)
            {
                if (cs.Changed)
                {
                    if (cs.SendBaseValue)
                    {
                        statstoupdate.Add(cs.StatNumber, cs.StatBaseValue);
                    }
                    else
                    {
                        statstoupdate.Add(cs.StatNumber, (uint)cs.Value);
                    }
                    cs.Changed = false;
                }
            }
            if (ch.Client == null)
            {
                Stat.SendBulk(ch, statstoupdate);
            }
            else
            {
                Stat.SendBulk(ch.Client, statstoupdate);
            }
            return(true);
        }
Exemple #11
0
        public bool FunctionExecute(Dynel self, Dynel caller, object target, object[] arguments)
        {
            int actionnumber = (Int32)arguments[0];
            NonPlayerCharacterClass knubotTarget = (NonPlayerCharacterClass)self;

            knubotTarget.KnuBot.Action((Int32)arguments[0]);
            return(true);
        }
Exemple #12
0
        public bool FunctionExecute(Dynel Self, Dynel Caller, object Target, object[] Arguments)
        {
            Character ch = (Character)Self;

            ch.Stats.SetPercentageModifier(
                (Int32)Arguments[0], ch.Stats.GetPercentageModifier((Int32)Arguments[0]) + (Int32)Arguments[1]);
            return(true);
        }
Exemple #13
0
        private void DynelSpawned(object s, Dynel dynel)
        {
            if (dynel.Identity.Type == IdentityType.SimpleChar)
            {
                SimpleChar c = dynel.Cast <SimpleChar>();

                Chat.WriteLine($"SimpleChar Spawned(TestPlugin): {c.Identity} -- {c.Name} -- {c.Position} -- {c.Health} -- IsInPlay: {c.IsInPlay}");
            }
        }
Exemple #14
0
        /// <summary>
        /// </summary>
        /// <param name="dynel">
        /// </param>
        /// <param name="stat">
        /// </param>
        /// <param name="value">
        /// </param>
        /// <param name="announce">
        /// </param>
        public static void Send(Dynel dynel, int stat, int value, bool announce)
        {
            ICharacter character = dynel as ICharacter;

            if (character != null)
            {
                Send(character, stat, value, announce);
            }
        }
Exemple #15
0
        public bool FunctionExecute(Dynel Self, Dynel Caller, object Target, object[] Arguments)
        {
            Identity pfinstance = new Identity();
            Identity id2        = new Identity();
            Identity id3        = new Identity();
            Client   cli        = ((Character)Self).Client;

            if (Target is Statels.Statel)
            {
                pfinstance.Type     = Int32.Parse((string)Arguments[0]);
                pfinstance.Instance = Int32.Parse((string)Arguments[1]);
                id2.Type            = Int32.Parse((string)Arguments[2]);
                id2.Instance        = Int32.Parse((string)Arguments[3]);
                id3.Type            = Int32.Parse((string)Arguments[4]);
                id3.Instance        = Int32.Parse((string)Arguments[5]);
            }
            else
            {
                // Shouldnt happen ever, as far as i know only Statels do ProxyTeleports (perhaps GM's can too tho)
                pfinstance.Type     = (Int32)Arguments[0];
                pfinstance.Instance = (Int32)Arguments[1];
                id2.Type            = (Int32)Arguments[2];
                id2.Instance        = (Int32)Arguments[3];
                id3.Type            = (Int32)Arguments[4];
                id3.Instance        = (Int32)Arguments[5];
            }
            SqlWrapper ms = new SqlWrapper();
            DataTable  dt = ms.ReadDatatable("SELECT * from proxydestinations WHERE playfield=" + pfinstance.Instance);

            if (dt.Rows.Count == 0)
            {
#if DEBUG
                cli.SendChatText("No Destination found for playfield " + pfinstance.Instance);
                foreach (string arg in Arguments)
                {
                    cli.SendChatText("Argument: " + arg);
                }
#endif
            }
            else
            {
                AOCoord a = new AOCoord();
                a.x = (Single)dt.Rows[0][1];
                a.y = (Single)dt.Rows[0][2];
                a.z = (Single)dt.Rows[0][3];
                Quaternion q = new Quaternion(0, 0, 0, 0);
                q.x = (Single)dt.Rows[0][4];
                q.y = (Single)dt.Rows[0][5];
                q.z = (Single)dt.Rows[0][6];
                q.w = (Single)dt.Rows[0][7];
                int instance = (Int32)((Statels.Statel)Target).Instance;
                // TODO: 1=GS need to change that later to a crowdbalancing system
                cli.TeleportProxy(a, q, pfinstance.Instance, pfinstance, 1, instance, id2, id3);
            }
            return(true);
        }
Exemple #16
0
        public override void ExecuteCommand(Client client, Identity target, string[] args)
        {
            Dynel _target = FindDynel.FindDynelById(target.Type, target.Instance);

            if (_target == null)
            {
                this.CommandHelp(client);
                return;
            }

            if ((_target is Character) && (!(_target is NonPlayerCharacterClass)))
            {
                this.CommandHelp(client);
                return;
            }

            Vector3 v3 = new Vector3(0, 0, 0);

            switch (args[1].ToLower())
            {
            case "north":
            case "n":
                v3.z = 1;
                break;

            case "west":
            case "w":
                v3.x = 1;
                break;

            case "south":
            case "s":
                v3.z = -1;
                break;

            case "east":
            case "e":
                v3.x = -1;
                break;

            case "me":
                Vector3 tempchar   = new Vector3(client.Character.Coordinates.x, 0, client.Character.Coordinates.z);
                Vector3 temptarget = new Vector3(_target.Coordinates.x, 0, _target.Coordinates.z);
                v3   = temptarget - tempchar;
                v3.z = -v3.z;
                break;

            default:
                this.CommandHelp(client);
                return;
            }
            v3.y = 0.0000000;
            _target.RawHeading = _target.RawHeading.GenerateRotationFromDirectionVector(v3.Normalize());
            client.Teleport(client.Character.RawCoord, client.Character.RawHeading, client.Character.PlayField);
        }
Exemple #17
0
        public bool FunctionExecute(Dynel Self, Dynel Caller, object Target, object[] Arguments)
        {
            Character ch = (Character)Self;

            ch.Stats.SetModifier((Int32)Arguments[0], ch.Stats.GetModifier((Int32)Arguments[0]) + (Int32)Arguments[1]);
            ch.Stats.GetStatbyNumber((Int32)Arguments[0]).CalcTrickle();
            ch.Stats.GetStatbyNumber((Int32)Arguments[0]).Changed = false;
            // Dont send to client, client will do calculation too
            // Packets.Stat.Send(ch.client, (Int32)Arguments[0], ch.Stats.GetStatbyNumber((Int32)Arguments[0]).Value, ch.Stats.GetStatbyNumber((Int32)Arguments[0]).AnnounceToPlayfield);
            return(true);
        }
Exemple #18
0
 public override bool Execute(Dynel self, Dynel caller, object target, object[] arguments)
 {
     lock (self)
     {
         lock (caller)
         {
             lock (target)
             {
                 return(this.FunctionExecute(self, caller, target, arguments));
             }
         }
     }
 }
 public override bool Execute(Dynel self, Dynel caller, object target, object[] arguments)
 {
     lock (self)
     {
         lock (caller)
         {
             lock (target)
             {
                 return this.FunctionExecute(self, caller, target, arguments);
             }
         }
     }
 }
Exemple #20
0
        public bool FunctionExecute(Dynel Self, Dynel Caller, object Target, object[] Arguments)
        {
            int Statnumber;
            int minhit;
            int maxhit;

            if (Target is Statels.Statel)
            {
                Statnumber = Int32.Parse((string)Arguments[0]);
                minhit     = Int32.Parse((string)Arguments[1]);
                maxhit     = Int32.Parse((string)Arguments[2]);
                if (minhit > maxhit)
                {
                    minhit = maxhit;
                    maxhit = Int32.Parse((string)Arguments[1]);
                }
            }
            else
            {
                Statnumber = (int)Arguments[0];
                minhit     = (int)Arguments[1];
                maxhit     = (int)Arguments[2];
                if (minhit > maxhit)
                {
                    minhit = maxhit;
                    maxhit = (int)Arguments[1];
                }
            }
            Random    rnd    = new Random();
            int       random = rnd.Next(minhit, maxhit);
            Character ch     = (Character)Self;

            // Increase only to maximum value. if max value is lower then actual value, half of the random will be subtracted
            if (Statnumber == 27)
            {
                random = Math.Min(random, ch.Stats.Life.Value - ch.Stats.Health.Value);
            }
            if (Statnumber == 132)
            {
                random = Math.Min(random, ch.Stats.MaxNanoEnergy.Value - ch.Stats.NanoEnergyPool.Value);
            }
            if (random < 0)
            {
                random /= 2;
            }

            ((Character)Self).Stats.SetStatValueByName(
                Statnumber, (uint)(((Character)Self).Stats.StatValueByName(Statnumber) + random));
            return(true);
        }
Exemple #21
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="packet"></param>
        /// <param name="client"></param>
        public static void Read(byte[] packet, Client client, Dynel dynel)
        {
            PacketWriter packetWriter = new PacketWriter();
            PacketReader packetReader = new PacketReader(packet);

            Header   header   = packetReader.PopHeader();
            byte     unknown1 = packetReader.PopByte();
            byte     unknown2 = packetReader.PopByte();
            Identity tofollow = packetReader.PopIdentity();
            int      unknown3 = packetReader.PopInt();
            int      unknown4 = packetReader.PopInt();
            int      unknown5 = packetReader.PopInt();
            int      unknown6 = packetReader.PopInt();
            byte     unknown7 = packetReader.PopByte();

            packetReader.Finish();

            /* start of packet */
            packetWriter.PushByte(0xDF);
            packetWriter.PushByte(0xDF);
            /* packet type */
            packetWriter.PushShort(10);
            /* unknown */
            packetWriter.PushShort(1);
            /* packet length (writer takes care of this) */
            packetWriter.PushShort(0);
            /* server ID */
            packetWriter.PushInt(3086);
            // Announcer takes care of ID's
            packetWriter.PushInt(0);
            /* packet ID */
            packetWriter.PushInt(0x260f3671);
            /* affected dynel identity */
            packetWriter.PushIdentity(50000, client.Character.Id);
            /* ? */
            packetWriter.PushByte(0);
            /* movement type */
            packetWriter.PushByte(unknown2);
            // Target's Identity
            packetWriter.PushIdentity(tofollow);
            packetWriter.PushInt(unknown3);
            packetWriter.PushInt(unknown4);
            packetWriter.PushInt(unknown5);
            packetWriter.PushInt(unknown6);
            packetWriter.PushByte(0);
            packetWriter.PushByte(0);

            byte[] reply = packetWriter.Finish();
            Announce.Playfield(client.Character.PlayField, reply);
        }
Exemple #22
0
        public override void ExecuteCommand(Client client, Identity target, string[] args)
        {
            int   id = int.Parse(args[1]);
            Dynel d  = FindDynel.FindDynelById(50000, id);

            if (d == null)
            {
                client.SendChatText("Couldn't find Dynel " + id);
            }
            else
            {
                client.Teleport(d.Coordinates, d.Heading, d.PlayField);
            }
        }
Exemple #23
0
        public void OnStateEnter()
        {
            Chat.WriteLine("StartMissionState::OnStateEnter");

            Dynel questStarter = DynelManager.Characters.FirstOrDefault(x => x.Name == QuestStarterName && !x.IsPet);

            if (questStarter == null)
            {
                //Should we just reform and try again or try to solve this situation?
                Chat.WriteLine("Unable to locate quest starter.");
                return;
            }

            NpcDialog.Open(questStarter);
        }
 public ItemContainer(int _type, uint _instance, Dynel _parent)
 {
     Type = _type;
     Instance = _instance;
     LoadFromSQL(_parent.getSQLTablefromDynelType() + "inventory");
     switch (_type)
     {
         // only Characters and NonPC's for now
         case 50000:
             NumberOfSlots = 30;
             break;
         default:
             throw new NotImplementedException("Can't create untyped container");
     }
     Items = new Object[NumberOfSlots];
 }
Exemple #25
0
        public ItemContainer(int _type, uint _instance, Dynel _parent)
        {
            Type     = _type;
            Instance = _instance;
            LoadFromSQL(_parent.getSQLTablefromDynelType() + "inventory");
            switch (_type)
            {
            // only Characters and NonPC's for now
            case 50000:
                NumberOfSlots = 30;
                break;

            default:
                throw new NotImplementedException("Can't create untyped container");
            }
            Items = new Object[NumberOfSlots];
        }
        public void OnStateEnter()
        {
            Chat.WriteLine("GrabMissionState::OnStateEnter");

            //Ignore pets because I already know you people are going to try that.
            //There should be a NPC template associated with this mob that we can use to accurately identify it but i will wait until there's a need.
            Dynel questGiver = DynelManager.Characters.FirstOrDefault(x => x.Name == Constants.QuestGiverName && !x.IsPet);

            if (questGiver == null)
            {
                //Goto MoveToQuestGiver State?
                Chat.WriteLine("Unable to locate quest giver.");
                return;
            }

            NpcDialog.Open(questGiver);
        }
Exemple #27
0
        public bool FunctionExecute(Dynel Self, Dynel Caller, object Target, object[] Arguments)
        {
            Character ch = (Character)Self;

            if (Arguments.Length == 2)
            {
                ch.Stats.ShoulderMeshLeft.StatModifier =
                    (Int32)((Int32)Arguments[1] - ch.Stats.ShoulderMeshLeft.StatBaseValue);
                ch.Stats.ShoulderMeshRight.StatModifier =
                    (Int32)((Int32)Arguments[1] - ch.Stats.ShoulderMeshRight.StatBaseValue);
                ch.MeshLayer.AddMesh(3, (Int32)Arguments[1], (Int32)Arguments[0], 4);
                ch.MeshLayer.AddMesh(4, (Int32)Arguments[1], (Int32)Arguments[0], 4);
            }
            else
            {
                Int32 placement = (Int32)Arguments[Arguments.Length - 1];
                if ((placement == 52) || (placement == 54)) // Social pads
                {
                    if (placement == 52)
                    {
                        ch.SocialMeshLayer.AddMesh(3, (Int32)Arguments[1], (Int32)Arguments[0], 4);
                    }
                    else
                    {
                        ch.SocialMeshLayer.AddMesh(4, (Int32)Arguments[1], (Int32)Arguments[0], 4);
                    }
                }
                else
                {
                    if (placement == 20)
                    {
                        ch.Stats.ShoulderMeshRight.StatModifier =
                            (Int32)((Int32)Arguments[1] - ch.Stats.ShoulderMeshRight.StatBaseValue);
                        ch.MeshLayer.AddMesh(3, (Int32)Arguments[1], (Int32)Arguments[0], 4);
                    }
                    else
                    {
                        ch.Stats.ShoulderMeshLeft.StatModifier =
                            (Int32)((Int32)Arguments[1] - ch.Stats.ShoulderMeshLeft.StatBaseValue);
                        ch.MeshLayer.AddMesh(4, (Int32)Arguments[1], (Int32)Arguments[0], 4);
                    }
                }
            }
            return(true);
        }
 public bool FunctionExecute(Dynel Self, Dynel Caller, object Target, object[] Arguments)
 {
     if ((Target is Character) || (Target is NonPlayerCharacterClass))
     {
         Character t = (Character)Target;
         bool found = false;
         Int32 placement;
         if (Arguments.Length == 2)
         {
             placement = 0;
         }
         else
         {
             placement = (Int32)Arguments[Arguments.Length - 1];
         }
         if (placement >= 49)
         {
             if (t.SocialTab.ContainsKey((Int32)Arguments[1]))
             {
                 t.SocialTab[(Int32)Arguments[1]] = (Int32)Arguments[0];
             }
             else
             {
                 t.SocialTab.Add((Int32)Arguments[1], (Int32)Arguments[0]);
             }
         }
         else
         {
             foreach (AOTextures aot in t.Textures)
             {
                 if (aot.place == (Int32)Arguments[1])
                 {
                     found = true;
                     aot.Texture = (Int32)Arguments[0];
                 }
             }
             if (!found)
             {
                 t.Textures.Add(new AOTextures((Int32)Arguments[1], (Int32)Arguments[0]));
             }
         }
     }
     return true;
 }
Exemple #29
0
 public bool FunctionExecute(Dynel Self, Dynel Caller, object Target, object[] Arguments)
 {
     if ((Target is Character) || (Target is NonPlayerCharacterClass))
     {
         Character t     = (Character)Target;
         bool      found = false;
         Int32     placement;
         if (Arguments.Length == 2)
         {
             placement = 0;
         }
         else
         {
             placement = (Int32)Arguments[Arguments.Length - 1];
         }
         if (placement >= 49)
         {
             if (t.SocialTab.ContainsKey((Int32)Arguments[1]))
             {
                 t.SocialTab[(Int32)Arguments[1]] = (Int32)Arguments[0];
             }
             else
             {
                 t.SocialTab.Add((Int32)Arguments[1], (Int32)Arguments[0]);
             }
         }
         else
         {
             foreach (AOTextures aot in t.Textures)
             {
                 if (aot.place == (Int32)Arguments[1])
                 {
                     found       = true;
                     aot.Texture = (Int32)Arguments[0];
                 }
             }
             if (!found)
             {
                 t.Textures.Add(new AOTextures((Int32)Arguments[1], (Int32)Arguments[0]));
             }
         }
     }
     return(true);
 }
Exemple #30
0
        private void OnDynelSpawned(object s, Dynel dynel)
        {
            if (_phase != ReformPhase.AwaitingTeammembers)
            {
                return;
            }

            if (!_teamCache.Contains(dynel.Identity))
            {
                return;
            }

            SimpleChar oldTeammate = dynel.Cast <SimpleChar>();

            if (!oldTeammate.IsInPlay)
            {
                return;
            }

            InvitePlayer(oldTeammate.Identity);
        }
        public static void Send(Client client, Dynel dynel1, Dynel dynel2)
        {
            PacketWriter packetWriter = new PacketWriter();
            packetWriter.PushByte(0xdf);
            packetWriter.PushByte(0xdf);
            packetWriter.PushShort(0xa);
            packetWriter.PushShort(1);
            packetWriter.PushShort(0);
            packetWriter.PushInt(3086);
            packetWriter.PushInt(client.Character.Id);
            packetWriter.PushInt(0x36284f6e);
            packetWriter.PushIdentity(dynel1.Type, dynel1.Id);
            packetWriter.PushByte(0);
            packetWriter.PushInt(1); // Knubot sends 2 here
            packetWriter.PushByte(0); // and 2 here too
            packetWriter.PushIdentity(dynel2.Type, dynel2.Id); // knubot 0
            packetWriter.PushIdentity(0xc767, 0x39da2458); // temp bag ID?? Knubot 0, needs more testing....

            byte[] packet = packetWriter.Finish();
            client.SendCompressed(packet);
        }
 public bool FunctionExecute(Dynel Self, Dynel Caller, object Target, object[] Arguments)
 {
     if (Arguments.Length == 2)
     {
         ((Character)Self).Stats.BackMesh.Set((Int32)Arguments[0]);
         ((Character)Self).MeshLayer.AddMesh(5, (Int32)Arguments[1], (Int32)Arguments[0], 0);
     }
     else
     {
         int placement = (Int32)Arguments[Arguments.Length - 1];
         if (placement == 51)
         {
             ((Character)Self).SocialMeshLayer.AddMesh(5, (Int32)Arguments[1], (Int32)Arguments[0], 0);
         }
         else
         {
             ((Character)Self).Stats.BackMesh.Set((Int32)Arguments[0]);
             ((Character)Self).MeshLayer.AddMesh(5, (Int32)Arguments[1], (Int32)Arguments[0], 0);
         }
     }
     return true;
 }
Exemple #33
0
 public bool FunctionExecute(Dynel Self, Dynel Caller, object Target, object[] Arguments)
 {
     if (Arguments.Length == 2)
     {
         ((Character)Self).Stats.BackMesh.Set((Int32)Arguments[0]);
         ((Character)Self).MeshLayer.AddMesh(5, (Int32)Arguments[1], (Int32)Arguments[0], 0);
     }
     else
     {
         int placement = (Int32)Arguments[Arguments.Length - 1];
         if (placement == 51)
         {
             ((Character)Self).SocialMeshLayer.AddMesh(5, (Int32)Arguments[1], (Int32)Arguments[0], 0);
         }
         else
         {
             ((Character)Self).Stats.BackMesh.Set((Int32)Arguments[0]);
             ((Character)Self).MeshLayer.AddMesh(5, (Int32)Arguments[1], (Int32)Arguments[0], 0);
         }
     }
     return(true);
 }
Exemple #34
0
        public static void Send(Client client, Dynel dynel1, Dynel dynel2)
        {
            PacketWriter packetWriter = new PacketWriter();

            packetWriter.PushByte(0xdf);
            packetWriter.PushByte(0xdf);
            packetWriter.PushShort(0xa);
            packetWriter.PushShort(1);
            packetWriter.PushShort(0);
            packetWriter.PushInt(3086);
            packetWriter.PushInt(client.Character.Id);
            packetWriter.PushInt(0x36284f6e);
            packetWriter.PushIdentity(dynel1.Type, dynel1.Id);
            packetWriter.PushByte(0);
            packetWriter.PushInt(1);                           // Knubot sends 2 here
            packetWriter.PushByte(0);                          // and 2 here too
            packetWriter.PushIdentity(dynel2.Type, dynel2.Id); // knubot 0
            packetWriter.PushIdentity(0xc767, 0x39da2458);     // temp bag ID?? Knubot 0, needs more testing....

            byte[] packet = packetWriter.Finish();
            client.SendCompressed(packet);
        }
Exemple #35
0
        public bool FunctionExecute(Dynel Self, Dynel Caller, object Target, object[] Arguments)
        {
            Client   cli        = ((Character)Self).Client;
            Identity pfinstance = new Identity();
            Identity R          = new Identity();
            Identity dest       = new Identity();
            int      gs         = 1;
            int      sg         = 0;

            if (Target is Statels.Statel)
            {
                pfinstance.Type     = Int32.Parse((string)Arguments[0]);
                pfinstance.Instance = Int32.Parse((string)Arguments[1]);
                R.Type        = Int32.Parse((string)Arguments[2]);
                R.Instance    = Int32.Parse((string)Arguments[3]);
                dest.Type     = Int32.Parse((string)Arguments[4]);
                dest.Instance = Int32.Parse((string)Arguments[5]);
            }
            else
            {
                pfinstance.Type     = (Int32)Arguments[0];
                pfinstance.Instance = (Int32)Arguments[1];
                R.Type        = (Int32)Arguments[2];
                R.Instance    = (Int32)Arguments[3];
                dest.Type     = (Int32)Arguments[4];
                dest.Instance = (Int32)Arguments[5];
            }

            int          to_pf = (Int32)((UInt32)(dest.Instance & 0xffff));
            int          arg2  = (Int32)((UInt32)(dest.Instance >> 16));
            CoordHeading a     = this.FindEntry(to_pf, arg2);

            if (a.Coordinates.x != -1)
            {
                cli.TeleportProxy(a.Coordinates, a.Heading, to_pf, pfinstance, gs, sg, R, dest);
                return(true);
            }
            return(false);
        }
        public bool FunctionExecute(Dynel Self, Dynel Caller, object Target, object[] Arguments)
        {
            Client cli = ((Character)Self).Client;
            Identity pfinstance = new Identity();
            Identity R = new Identity();
            Identity dest = new Identity();
            int gs = 1;
            int sg = 0;
            if (Target is Statels.Statel)
            {
                pfinstance.Type = Int32.Parse((string)Arguments[0]);
                pfinstance.Instance = Int32.Parse((string)Arguments[1]);
                R.Type = Int32.Parse((string)Arguments[2]);
                R.Instance = Int32.Parse((string)Arguments[3]);
                dest.Type = Int32.Parse((string)Arguments[4]);
                dest.Instance = Int32.Parse((string)Arguments[5]);
            }
            else
            {
                pfinstance.Type = (Int32)Arguments[0];
                pfinstance.Instance = (Int32)Arguments[1];
                R.Type = (Int32)Arguments[2];
                R.Instance = (Int32)Arguments[3];
                dest.Type = (Int32)Arguments[4];
                dest.Instance = (Int32)Arguments[5];
            }

            int to_pf = (Int32)((UInt32)(dest.Instance & 0xffff));
            int arg2 = (Int32)((UInt32)(dest.Instance >> 16));
            CoordHeading a = this.FindEntry(to_pf, arg2);

            if (a.Coordinates.x != -1)
            {
                cli.TeleportProxy(a.Coordinates, a.Heading, to_pf, pfinstance, gs, sg, R, dest);
                return true;
            }
            return false;
        }
Exemple #37
0
        /// <summary>
        /// </summary>
        /// <param name="dynel">
        /// </param>
        /// <returns>
        /// </returns>
        public static uint CalculateNanoPoints(Dynel dynel)
        {
            int[,] tableProfNanoPoints =
            {
                { 4, 4,  4, 4, 5, 4, 4, 4, 4,  4,  4,  4, 4, 4 },
                { 4, 4,  5, 4, 5, 5, 5, 5, 4,  5,  5,  5, 4, 4 },
                { 4, 4,  6, 4, 6, 5, 5, 5, 4,  6,  6,  6, 4, 4 },
                { 4, 4,  7, 4, 6, 6, 5, 5, 4,  7,  7,  7, 4, 4 },

                // TitleLevel 4
                { 4, 4,  8, 4, 7, 6, 6, 6, 4,  8,  8,  8, 4, 4 }, // TitleLevel 5
                { 4, 4,  9, 4, 7, 7, 7, 7, 4, 10, 10, 10, 4, 4 }, // TitleLevel 6
                { 5, 5, 10, 5, 8, 8, 7, 7, 5, 10, 10, 10, 4, 4 }, // TitleLevel 7
                // TitleLevel 3
                // TitleLevel 2
                // TitleLevel 1
                // Sol|MA|ENG|FIX|AGE|ADV|TRA|CRA|ENF|DOC| NT| MP|KEP|SHA  // geprüfte Prof & TL = Soldier, Martial Artist, Engineer, Fixer
            };

            // Sol|Opi|Nan|Tro
            int[] breedBaseNanoPoints          = { 10, 10, 15, 8 };
            int[] breedMultiplicatorNanoPoints = { 3, 3, 4, 2 };
            int[] breedModificatorNanoPoints   = { 0, -1, 1, -2 };

            uint breed      = dynel.Stats["Breed"].BaseValue;
            uint profession = dynel.Stats["Profession"].BaseValue;
            uint titleLevel = dynel.Stats["TitleLevel"].BaseValue;
            uint level      = dynel.Stats["Level"].BaseValue;

            // BreedBaseNP+(Level*(TableProfNP+BreedModiNP))+(NanoEnergyPool*BreedMultiNP))
            return
                ((uint)
                 (breedBaseNanoPoints[breed - 1]
                  + (dynel.Stats["Level"].Value
                     * (tableProfNanoPoints[titleLevel - 1, profession - 1] + breedModificatorNanoPoints[breed - 1]))
                  + (dynel.Stats["NanoEnergyPool"].Value * breedMultiplicatorNanoPoints[breed - 1])));
        }
Exemple #38
0
        /// <summary>
        /// </summary>
        /// <param name="dynel">
        /// </param>
        /// <returns>
        /// </returns>
        public static uint CalculateHitPoints(Dynel dynel)
        {
            int[,] tableProfessionHitPoints =
            {
                {  6,  6, 6,  6,  6,  6, 6, 6,  7, 6, 6, 6,  6,  6 },
                {  7,  7, 6,  7,  7,  7, 6, 7,  8, 6, 6, 6,  7,  7 },
                {  8,  7, 6,  7,  7,  8, 7, 7,  9, 6, 6, 6,  8,  8 },
                {  9,  8, 6,  8,  8,  8, 7, 7, 10, 6, 6, 6,  9,  9 },

                // TitleLevel 4
                { 10,  9, 6,  9,  8,  9, 8, 8, 11, 6, 6, 6, 10,  9 }, // TitleLevel 5
                { 11, 12, 6, 10,  9,  9, 9, 9, 12, 6, 6, 6, 11, 10 }, // TitleLevel 6
                { 12, 13, 7, 11, 10, 10, 9, 9, 13, 6, 6, 6, 11, 10 }, // TitleLevel 7
                // TitleLevel 3
                // TitleLevel 2
                // TitleLevel 1
                // Sol| MA|ENG|FIX|AGE|ADV|TRA|CRA|ENF|DOC| NT| MP| KEP|SHA   // geprüfte Prof & TL = Soldier, Martial Artist, Engineer, Fixer
            };

            // Sol|Opi|Nan|Tro
            int[] breedBaseHitPoints          = { 10, 15, 10, 25 };
            int[] breedMultiplicatorHitPoints = { 3, 3, 2, 4 };
            int[] breedModificatorHitPoints   = { 0, -1, -1, 0 };

            uint breed      = dynel.Stats["Breed"].BaseValue;
            uint profession = dynel.Stats["Profession"].BaseValue;
            uint titlelevel = dynel.Stats["TitleLevel"].BaseValue;
            uint level      = dynel.Stats["Level"].BaseValue;

            // BreedBaseHP+(Level*(TableProfHP+BreedModiHP))+(BodyDevelopment*BreedMultiHP))
            return
                ((uint)
                 (breedBaseHitPoints[breed - 1]
                  + (dynel.Stats["Level"].Value
                     * (tableProfessionHitPoints[titlelevel - 1, profession - 1] + breedModificatorHitPoints[breed - 1]))
                  + (dynel.Stats["BodyDevelopment"].Value * breedMultiplicatorHitPoints[breed - 1])));
        }
 /// <summary>
 /// Lineteleport
 /// </summary>
 /// <param name="Self"></param>
 /// <param name="Caller"></param>
 /// <param name="Target"></param>
 /// <param name="Arguments">UInt32 (LineType?), UInt32 (Combo of Line# and Playfield), Int32 (Playfield to teleport to)</param>
 /// <returns></returns>
 public bool FunctionExecute(Dynel Self, Dynel Caller, object Target, object[] Arguments)
 {
     uint arg2;
     int to_pf;
     Console.WriteLine(Target.GetType().ToString());
     if (Target is Statels.Statel)
     {
         arg2 = UInt32.Parse((string)Arguments[1]); // Linesegment and playfield (lower word)
         arg2 = arg2 >> 16;
         to_pf = Int32.Parse((string)Arguments[2]);
     }
     else
     {
         arg2 = (UInt32)Arguments[1];
         to_pf = (Int32)Arguments[2];
     }
     CoordHeading a = this.FindEntry(to_pf, (Int32)arg2);
     if (a.Coordinates.x != -1)
     {
         ((Character)Self).Client.Teleport(a.Coordinates, a.Heading, to_pf);
         return true;
     }
     return false;
 }
Exemple #40
0
 public bool FunctionExecute(Dynel Self, Dynel Caller, object Target, object[] Arguments)
 {
     if (Arguments.Length == 2)
     {
         ((Character)Self).Stats.HeadMesh.StatModifier =
             (Int32)((Int32)Arguments[1] - ((Character)Self).Stats.HeadMesh.StatBaseValue);
         ((Character)Self).MeshLayer.AddMesh(0, (Int32)Arguments[1], (Int32)Arguments[0], 4);
     }
     else
     {
         Int32 placement = (Int32)Arguments[Arguments.Length - 1];
         if (placement >= 49) // Social page
         {
             ((Character)Self).SocialMeshLayer.AddMesh(0, (Int32)Arguments[1], (Int32)Arguments[0], 4);
         }
         else
         {
             ((Character)Self).Stats.HeadMesh.StatModifier =
                 (Int32)((Int32)Arguments[1] - ((Character)Self).Stats.HeadMesh.StatBaseValue);
             ((Character)Self).MeshLayer.AddMesh(0, (Int32)Arguments[1], (Int32)Arguments[0], 4);
         }
     }
     return(true);
 }
 public static void Read(byte[] packet, Client client, Dynel dyn)
 {
     SqlWrapper ms = new SqlWrapper();
     PacketWriter _writer = new PacketWriter();
     PacketReader _reader = new PacketReader(packet);
 }
 public bool FunctionExecute(Dynel Self, Dynel Caller, object Target, object[] Arguments)
 {
     string text = (string)Arguments[0];
     SystemText.Send(((Character)Self).Client, text, 0);
     return true;
 }
 public bool FunctionExecute(Dynel Self, Dynel Caller, object Target, object[] Arguments)
 {
     ((Character)Self).Stats.HairMesh.Set((int)Arguments[0]);
     ((Character)Self).MeshLayer.AddMesh(0, (int)Arguments[1], (int)Arguments[0], 0);
     return false;
 }
        /// <summary>
        /// The read.
        /// </summary>
        /// <param name="packet">
        /// The packet.
        /// </param>
        /// <param name="client">
        /// The client.
        /// </param>
        /// <param name="dynel">
        /// The dynel.
        /// </param>
        public static void Read(byte[] packet, Client client, Dynel dynel)
        {
            sender = client;
            PacketReader packetReader = new PacketReader(packet);
            packetReader.PopHeader();
            packetReader.PopByte();
            temp1 = packetReader.PopInt();
            count = packetReader.PopInt(); // Count of commands sent
            action = packetReader.PopInt();
            temp4 = packetReader.PopInt();
            user = packetReader.PopIdentity();
            target = packetReader.PopIdentity();
            packetReader.Finish();
            bool feedback = true;
            switch (action)
            {
                case 1:

                    // Get
                    break;
                case 2:

                    // Drop
                    break;
                case 3:

                    // Use
                    OnUse();
                    AOCoord newcoord = client.Character.Coordinates;
                    feedback = false;

                    if (Statels.StatelppfonUse.ContainsKey(client.Character.PlayField))
                    {
                        foreach (Statels.Statel s in Statels.StatelppfonUse[client.Character.PlayField])
                        {
                            if (s.onUse(client, target))
                            {
                                return;
                            }
                        }
                    }

                    bool teleport = false;
                    int playfield = 152;
                    switch (target.Instance)
                    {
                            // Need to add feedback to the character 
                            // Are the Newer Grid points in this list???
                            // No newer Grid points in list, will be replaced by a check against a list of statels read from rdb anyway
                            // - Algorithman
                        case -1073605919: // Teleport Tower(noobisland)(right)
                            if (client.Character.Stats.Side.Value != 2)
                            {
                                client.SendChatText("You need to be omni to use this teleporter!");
                                teleport = false;
                            }
                            else
                            {
                                newcoord.x = 202;
                                newcoord.z = 878;
                                newcoord.y = 16;
                                playfield = 687;
                            }

                            break;

                        case -1073736991: // Teleport Tower(noobisland)(left)
                            if (client.Character.Stats.Side.Value != 1)
                            {
                                client.SendChatText("You need to be clan to use this teleporter!");
                                teleport = false;
                            }
                            else
                            {
                                newcoord.x = 390;
                                newcoord.z = 340;
                                newcoord.y = 0;
                                playfield = 545;
                            }

                            break;

                        case -1073671455: // Teleport Tower(noobisland)(middle)
                            if (client.Character.Stats.Side.Value != 0)
                            {
                                client.SendChatText("You need to be neutral to use this teleporter!");
                                teleport = false;
                            }
                            else
                            {
                                newcoord.x = 685;
                                newcoord.z = 480;
                                newcoord.y = 73;
                                playfield = 800;
                            }

                            break;

                        case -1073741189: // 2ho -> Stret west
                            if (client.Character.Stats.Cash.Value < 50)
                            {
                                // check if you got enough credits to use the ferry
                                client.SendChatText("You need atleast 50 credits to board this ferry!");
                                teleport = false;
                            }
                            else
                            {
                                client.Character.Stats.Cash.Set(client.Character.Stats.Cash.Value - 50);
                                newcoord.x = 1143;
                                newcoord.z = 541;
                                newcoord.y = 8;
                                playfield = 790;
                            }

                            break;

                        case -1073478890: // Stret West -> 2ho
                            if (client.Character.Stats.Cash.Value < 50)
                            {
                                // check if you got enough credits to use the ferry
                                client.SendChatText("You need atleast 50 credits to board this ferry!");
                                teleport = false;
                            }
                            else
                            {
                                client.Character.Stats.Cash.Set(client.Character.Stats.Cash.Value - 50);
                                newcoord.x = 760;
                                newcoord.z = 1982;
                                newcoord.y = 7;
                                playfield = 635;
                            }

                            break;

                        case -1073216841: // Harry's -> Plesant Meadows
                            if (client.Character.Stats.Cash.Value < 50)
                            {
                                // check if you got enough credits to use the ferry
                                client.SendChatText("You need atleast 50 credits to board this ferry!");
                                teleport = false;
                            }
                            else
                            {
                                client.Character.Stats.Cash.Set(client.Character.Stats.Cash.Value - 50);
                                newcoord.x = 370;
                                newcoord.z = 1564;
                                newcoord.y = 7;
                                playfield = 630;
                            }

                            break;

                        case -1073216906: // Plesant Meadows -> Harry's
                            if (client.Character.Stats.Cash.Value < 50)
                            {
                                // check if you got enough credits to use the ferry
                                client.SendChatText("You need atleast 50 credits to board this ferry!");
                                teleport = false;
                            }
                            else
                            {
                                client.Character.Stats.Cash.Set(client.Character.Stats.Cash.Value - 50);
                                newcoord.x = 3196;
                                newcoord.z = 3172;
                                newcoord.y = 7;
                                playfield = 695;
                            }

                            break;

                        case -1073282442: // Pleasant Meadows -> Omni-Tek outpost in Lush Fields
                            if (client.Character.Stats.Cash.Value < 50)
                            {
                                // check if you got enough credits to use the ferry
                                client.SendChatText("You need atleast 50 credits to board this ferry!");
                                teleport = false;
                            }
                            else
                            {
                                client.Character.Stats.Cash.Set(client.Character.Stats.Cash.Value - 50);
                                newcoord.x = 3389;
                                newcoord.z = 800;
                                newcoord.y = 8;
                                playfield = 695;
                            }

                            break;

                        case -1073413449: // Omni-Tek outpost in Lush Fields -> Pleasant Meadows
                            if (client.Character.Stats.Cash.Value < 50)
                            {
                                // check if you got enough credits to use the ferry
                                client.SendChatText("You need atleast 50 credits to board this ferry!");
                                teleport = false;
                            }
                            else
                            {
                                client.Character.Stats.Cash.Set(client.Character.Stats.Cash.Value - 50);
                                newcoord.x = 370;
                                newcoord.z = 1562;
                                newcoord.y = 7;
                                playfield = 630;
                            }

                            break;

                        case -1073347913: // Harry's trading outpost -> Omni-1 Trade (free)
                            newcoord.x = 3569;
                            newcoord.z = 912;
                            newcoord.y = 9;
                            playfield = 695;
                            break;

                        case -1073282377: // Omni-1 Trade -> Harry's trading outpost (free)
                            newcoord.x = 3290;
                            newcoord.z = 2922;
                            newcoord.y = 7;
                            playfield = 695;
                            break;

                        default:
                            feedback = true;
                            teleport = false;
                            break;
                    }

                    if (teleport)
                    {
                        client.Teleport(newcoord, client.Character.Heading, playfield);
                    }

                    // Use item in inventory
                    if (target.Type == 104)
                    {
                        InventoryEntries ie = client.Character.GetInventoryAt(target.Instance);
                        AOItem mi = ItemHandler.GetItemTemplate(ie.Item.LowID);

                        // TODO mi.applyon(client.Character, ItemHandler.eventtype_onuse, true, false, ie.Placement);
                        TemplateAction.Send(client.Character, ie);
                        if (mi.isConsumable())
                        {
                            ie.Item.MultipleCount--;
                            if (ie.Item.MultipleCount <= 0)
                            {
                                client.Character.Inventory.Remove(ie);
                                DeleteItem.Send(client.Character, ie.Container, ie.Placement);

                                // Packets.Stat.Set(client, 0, client.Character.Stats.GetStat(0),false);
                            }
                        }

                        foreach (AOEvents aoe in mi.Events)
                        {
                            if (aoe.EventType == Constants.EventtypeOnUse)
                            {
                                sender.Character.ExecuteEvent(
                                    sender.Character, sender.Character, aoe, true, false, 0, CheckReqs.doCheckReqs);
                                SkillUpdate.SendStat(client, 0x209, client.Character.Stats.SocialStatus.Value, false);

                                // Social Status
                                return;
                            }
                        }

                        int le = packet[7] + packet[6] * 256;
                        byte[] reply = new byte[le];
                        Array.Copy(packet, reply, le);
                        reply[0] = 0xdf;
                        reply[1] = 0xdf;
                        reply[8] = 0x00;
                        reply[9] = 0x00;
                        reply[10] = 0x0C;
                        reply[11] = 0x0E;
                        reply[12] = (byte)(client.Character.Id >> 24);
                        reply[13] = (byte)(client.Character.Id >> 16);
                        reply[14] = (byte)(client.Character.Id >> 8);
                        reply[15] = (byte)client.Character.Id;
                        reply[0x1c] = 0;
                        reply[32] = 1;
                        reply[36] = 3;

                        PacketWriter pw = new PacketWriter();
                        pw.PushBytes(reply);
                        byte[] rep = pw.Finish();
                        client.SendCompressed(rep);
                        SkillUpdate.SendStat(client, 0x209, client.Character.Stats.SocialStatus.Value, false);

                        // Social Status
                        return;
                    }
                    else if (target.Type == 51035)
                    {
                        // Shops
                        VendingMachine vm = VendorHandler.GetVendorById(target.Instance);
                        ShopInventory.Send(client, vm);
                        Trade.Send(client, client.Character, vm);
                        Trade.Send(client, vm, client.Character);
                        Trade.Send(client, vm, client.Character);
                        int le = packet[7] + packet[6] * 256;
                        byte[] reply = new byte[le];
                        Array.Copy(packet, reply, le);
                        reply[0] = 0xdf;
                        reply[1] = 0xdf;
                        reply[8] = 0x00;
                        reply[9] = 0x00;
                        reply[10] = 0x0C;
                        reply[11] = 0x0E;
                        reply[12] = (byte)(client.Character.Id >> 24);
                        reply[13] = (byte)(client.Character.Id >> 16);
                        reply[14] = (byte)(client.Character.Id >> 8);
                        reply[15] = (byte)client.Character.Id;
                        reply[0x1c] = 0;
                        reply[0x20] = 1;

                        client.Character.LastTrade = target;

                        PacketWriter pw = new PacketWriter();
                        pw.PushBytes(reply);
                        byte[] rep = pw.Finish();
                        client.SendCompressed(rep);
                    }
                    else if (target.Type == 51050)
                    {
                        // Open corpse
                    }

                    break;
                case 4:

                    // Repair
                    break;
                case 5:

                    // UseItemOnItem
#if DEBUG
                    Console.WriteLine("Use Item on Item not defined yet");
                    Console.WriteLine("Packet data:");
                    string line = string.Empty;
                    int count2 = 0;
                    foreach (byte packbyte in packet)
                    {
                        if ((count2 % 16) == 0)
                        {
                            Console.WriteLine(line);
                            line = string.Empty;
                        }

                        line = line + packbyte.ToString("X2") + " ";
                        count2++;
                    }

                    if (line != string.Empty)
                    {
                        Console.WriteLine();
                    }

                    Console.WriteLine(line);

#endif
                    break;
                default:
                    break;
            }

            if (feedback)
            {
#if DEBUG
                string Feedback1 = string.Format("T1 {0}, Count {1}, Action {2}, T4 {3}", temp1, count, action, temp4);
                string Feedback2 = string.Format(
                    "User {0}:{1}, Target {2}:{3} ({4}:{5})", 
                    user.Type, 
                    user.Instance, 
                    target.Type, 
                    (uint)target.Instance, 
                    target.Type.ToString("X4"), 
                    ((uint)target.Instance).ToString("X8"));
                Statels.Statel b = null;
                if (Statels.Statelppf.ContainsKey(client.Character.PlayField))
                {
                    foreach (Statels.Statel z in Statels.Statelppf[client.Character.PlayField])
                    {
                        if ((z.Type == target.Type) && ((Int32)z.Instance == target.Instance))
                        {
                            b = z;
                            break;
                        }
                    }
                }

                if (b != null)
                {
                    foreach (Statels.StatelEvent e in b.Events)
                    {
                        Console.WriteLine("DebugOutput: \r\n" + e);
                    }

                    Console.WriteLine(b.Coordinates.ToString());
                }
                else
                {
                    Console.WriteLine(
                        "No Statel defined in database for #" + target.Type + ":" + (UInt32)target.Instance + " ("
                        + target.Type.ToString("X4") + ":" + target.Instance.ToString("X8") + ")");
                }

                client.SendChatText(Feedback1);
                client.SendChatText(Feedback2);
#endif
            }
        }
        /// <summary>
        /// Experimental - Check who is in the given radius
        /// </summary>
        /// <param name="client">Character or NPC to start from</param>
        /// <param name="radius">RAdius</param>
        /// <returns></returns>
        public static List<Dynel> GetClientsInRadius(Dynel client, float radius)
        {
            // we're added ourselves, because we're included in the list too.
            List<Dynel> clientList = new List<Dynel> { client };

            // searching client as first one!

            foreach (Client client1 in Program.zoneServer.Clients)
            {
                if (client1.Character.PlayField != client.PlayField)
                {
                    continue;
                }
                if (client1.Character.Id == client.Id)
                {
                    continue;
                }
                if (client1.Character.Coordinates.Distance2D(client.Coordinates) >= radius)
                {
                    continue;
                }
                clientList.Add(client1.Character);
            }
            return clientList;
        }
Exemple #46
0
        /// <summary>
        /// Character_Stats
        /// Class for character's stats
        /// </summary>
        /// <param name="parent">
        /// Stat's owner (Character or derived class)
        /// </param>
        public DynelStats(Dynel parent)
        {
            this.all.Add(this.flags);
            this.all.Add(this.life);
            this.all.Add(this.volumeMass);
            this.all.Add(this.attackSpeed);
            this.all.Add(this.breed);
            this.all.Add(this.clan);
            this.all.Add(this.team);
            this.all.Add(this.state);
            this.all.Add(this.timeExist);
            this.all.Add(this.mapFlags);
            this.all.Add(this.professionLevel);
            this.all.Add(this.previousHealth);
            this.all.Add(this.mesh);
            this.all.Add(this.anim);
            this.all.Add(this.name);
            this.all.Add(this.info);
            this.all.Add(this.strength);
            this.all.Add(this.agility);
            this.all.Add(this.stamina);
            this.all.Add(this.intelligence);
            this.all.Add(this.sense);
            this.all.Add(this.psychic);
            this.all.Add(this.ams);
            this.all.Add(this.staticInstance);
            this.all.Add(this.maxMass);
            this.all.Add(this.staticType);
            this.all.Add(this.energy);
            this.all.Add(this.health);
            this.all.Add(this.height);
            this.all.Add(this.dms);
            this.all.Add(this.can);
            this.all.Add(this.face);
            this.all.Add(this.hairMesh);
            this.all.Add(this.side);
            this.all.Add(this.deadTimer);
            this.all.Add(this.accessCount);
            this.all.Add(this.attackCount);
            this.all.Add(this.titleLevel);
            this.all.Add(this.backMesh);
            this.all.Add(this.alienXP);
            this.all.Add(this.fabricType);
            this.all.Add(this.catMesh);
            this.all.Add(this.parentType);
            this.all.Add(this.parentInstance);
            this.all.Add(this.beltSlots);
            this.all.Add(this.bandolierSlots);
            this.all.Add(this.fatness);
            this.all.Add(this.clanLevel);
            this.all.Add(this.insuranceTime);
            this.all.Add(this.inventoryTimeout);
            this.all.Add(this.aggDef);
            this.all.Add(this.xp);
            this.all.Add(this.ip);
            this.all.Add(this.level);
            this.all.Add(this.inventoryId);
            this.all.Add(this.timeSinceCreation);
            this.all.Add(this.lastXP);
            this.all.Add(this.age);
            this.all.Add(this.sex);
            this.all.Add(this.profession);
            this.all.Add(this.cash);
            this.all.Add(this.alignment);
            this.all.Add(this.attitude);
            this.all.Add(this.headMesh);
            this.all.Add(this.missionBits5);
            this.all.Add(this.missionBits6);
            this.all.Add(this.missionBits7);
            this.all.Add(this.veteranPoints);
            this.all.Add(this.monthsPaid);
            this.all.Add(this.speedPenalty);
            this.all.Add(this.totalMass);
            this.all.Add(this.itemType);
            this.all.Add(this.repairDifficulty);
            this.all.Add(this.price);
            this.all.Add(this.metaType);
            this.all.Add(this.itemClass);
            this.all.Add(this.repairSkill);
            this.all.Add(this.currentMass);
            this.all.Add(this.icon);
            this.all.Add(this.primaryItemType);
            this.all.Add(this.primaryItemInstance);
            this.all.Add(this.secondaryItemType);
            this.all.Add(this.secondaryItemInstance);
            this.all.Add(this.userType);
            this.all.Add(this.userInstance);
            this.all.Add(this.areaType);
            this.all.Add(this.areaInstance);
            this.all.Add(this.defaultPos);
            this.all.Add(this.race);
            this.all.Add(this.projectileAC);
            this.all.Add(this.meleeAC);
            this.all.Add(this.energyAC);
            this.all.Add(this.chemicalAC);
            this.all.Add(this.radiationAC);
            this.all.Add(this.coldAC);
            this.all.Add(this.poisonAC);
            this.all.Add(this.fireAC);
            this.all.Add(this.stateAction);
            this.all.Add(this.itemAnim);
            this.all.Add(this.martialArts);
            this.all.Add(this.meleeMultiple);
            this.all.Add(this.onehBluntWeapons);
            this.all.Add(this.onehEdgedWeapon);
            this.all.Add(this.meleeEnergyWeapon);
            this.all.Add(this.twohEdgedWeapons);
            this.all.Add(this.piercing);
            this.all.Add(this.twohBluntWeapons);
            this.all.Add(this.throwingKnife);
            this.all.Add(this.grenade);
            this.all.Add(this.thrownGrapplingWeapons);
            this.all.Add(this.bow);
            this.all.Add(this.pistol);
            this.all.Add(this.rifle);
            this.all.Add(this.subMachineGun);
            this.all.Add(this.shotgun);
            this.all.Add(this.assaultRifle);
            this.all.Add(this.driveWater);
            this.all.Add(this.closeCombatInitiative);
            this.all.Add(this.distanceWeaponInitiative);
            this.all.Add(this.physicalProwessInitiative);
            this.all.Add(this.bowSpecialAttack);
            this.all.Add(this.senseImprovement);
            this.all.Add(this.firstAid);
            this.all.Add(this.treatment);
            this.all.Add(this.mechanicalEngineering);
            this.all.Add(this.electricalEngineering);
            this.all.Add(this.materialMetamorphose);
            this.all.Add(this.biologicalMetamorphose);
            this.all.Add(this.psychologicalModification);
            this.all.Add(this.materialCreation);
            this.all.Add(this.materialLocation);
            this.all.Add(this.nanoEnergyPool);
            this.all.Add(this.lrEnergyWeapon);
            this.all.Add(this.lrMultipleWeapon);
            this.all.Add(this.disarmTrap);
            this.all.Add(this.perception);
            this.all.Add(this.adventuring);
            this.all.Add(this.swim);
            this.all.Add(this.driveAir);
            this.all.Add(this.mapNavigation);
            this.all.Add(this.tutoring);
            this.all.Add(this.brawl);
            this.all.Add(this.riposte);
            this.all.Add(this.dimach);
            this.all.Add(this.parry);
            this.all.Add(this.sneakAttack);
            this.all.Add(this.fastAttack);
            this.all.Add(this.burst);
            this.all.Add(this.nanoProwessInitiative);
            this.all.Add(this.flingShot);
            this.all.Add(this.aimedShot);
            this.all.Add(this.bodyDevelopment);
            this.all.Add(this.duck);
            this.all.Add(this.dodge);
            this.all.Add(this.evade);
            this.all.Add(this.runSpeed);
            this.all.Add(this.fieldQuantumPhysics);
            this.all.Add(this.weaponSmithing);
            this.all.Add(this.pharmaceuticals);
            this.all.Add(this.nanoProgramming);
            this.all.Add(this.computerLiteracy);
            this.all.Add(this.psychology);
            this.all.Add(this.chemistry);
            this.all.Add(this.concealment);
            this.all.Add(this.breakingEntry);
            this.all.Add(this.driveGround);
            this.all.Add(this.fullAuto);
            this.all.Add(this.nanoAC);
            this.all.Add(this.alienLevel);
            this.all.Add(this.healthChangeBest);
            this.all.Add(this.healthChangeWorst);
            this.all.Add(this.healthChange);
            this.all.Add(this.currentMovementMode);
            this.all.Add(this.prevMovementMode);
            this.all.Add(this.autoLockTimeDefault);
            this.all.Add(this.autoUnlockTimeDefault);
            this.all.Add(this.moreFlags);
            this.all.Add(this.alienNextXP);
            this.all.Add(this.npcFlags);
            this.all.Add(this.currentNCU);
            this.all.Add(this.maxNCU);
            this.all.Add(this.specialization);
            this.all.Add(this.effectIcon);
            this.all.Add(this.buildingType);
            this.all.Add(this.buildingInstance);
            this.all.Add(this.cardOwnerType);
            this.all.Add(this.cardOwnerInstance);
            this.all.Add(this.buildingComplexInst);
            this.all.Add(this.exitInstance);
            this.all.Add(this.nextDoorInBuilding);
            this.all.Add(this.lastConcretePlayfieldInstance);
            this.all.Add(this.extenalPlayfieldInstance);
            this.all.Add(this.extenalDoorInstance);
            this.all.Add(this.inPlay);
            this.all.Add(this.accessKey);
            this.all.Add(this.petMaster);
            this.all.Add(this.orientationMode);
            this.all.Add(this.sessionTime);
            this.all.Add(this.rp);
            this.all.Add(this.conformity);
            this.all.Add(this.aggressiveness);
            this.all.Add(this.stability);
            this.all.Add(this.extroverty);
            this.all.Add(this.breedHostility);
            this.all.Add(this.reflectProjectileAC);
            this.all.Add(this.reflectMeleeAC);
            this.all.Add(this.reflectEnergyAC);
            this.all.Add(this.reflectChemicalAC);
            this.all.Add(this.rechargeDelay);
            this.all.Add(this.equipDelay);
            this.all.Add(this.maxEnergy);
            this.all.Add(this.teamSide);
            this.all.Add(this.currentNano);
            this.all.Add(this.gmLevel);
            this.all.Add(this.reflectRadiationAC);
            this.all.Add(this.reflectColdAC);
            this.all.Add(this.reflectNanoAC);
            this.all.Add(this.reflectFireAC);
            this.all.Add(this.currBodyLocation);
            this.all.Add(this.maxNanoEnergy);
            this.all.Add(this.accumulatedDamage);
            this.all.Add(this.canChangeClothes);
            this.all.Add(this.features);
            this.all.Add(this.reflectPoisonAC);
            this.all.Add(this.shieldProjectileAC);
            this.all.Add(this.shieldMeleeAC);
            this.all.Add(this.shieldEnergyAC);
            this.all.Add(this.shieldChemicalAC);
            this.all.Add(this.shieldRadiationAC);
            this.all.Add(this.shieldColdAC);
            this.all.Add(this.shieldNanoAC);
            this.all.Add(this.shieldFireAC);
            this.all.Add(this.shieldPoisonAC);
            this.all.Add(this.berserkMode);
            this.all.Add(this.insurancePercentage);
            this.all.Add(this.changeSideCount);
            this.all.Add(this.absorbProjectileAC);
            this.all.Add(this.absorbMeleeAC);
            this.all.Add(this.absorbEnergyAC);
            this.all.Add(this.absorbChemicalAC);
            this.all.Add(this.absorbRadiationAC);
            this.all.Add(this.absorbColdAC);
            this.all.Add(this.absorbFireAC);
            this.all.Add(this.absorbPoisonAC);
            this.all.Add(this.absorbNanoAC);
            this.all.Add(this.temporarySkillReduction);
            this.all.Add(this.birthDate);
            this.all.Add(this.lastSaved);
            this.all.Add(this.soundVolume);
            this.all.Add(this.petCounter);
            this.all.Add(this.metersWalked);
            this.all.Add(this.questLevelsSolved);
            this.all.Add(this.monsterLevelsKilled);
            this.all.Add(this.pvPLevelsKilled);
            this.all.Add(this.missionBits1);
            this.all.Add(this.missionBits2);
            this.all.Add(this.accessGrant);
            this.all.Add(this.doorFlags);
            this.all.Add(this.clanHierarchy);
            this.all.Add(this.questStat);
            this.all.Add(this.clientActivated);
            this.all.Add(this.personalResearchLevel);
            this.all.Add(this.globalResearchLevel);
            this.all.Add(this.personalResearchGoal);
            this.all.Add(this.globalResearchGoal);
            this.all.Add(this.turnSpeed);
            this.all.Add(this.liquidType);
            this.all.Add(this.gatherSound);
            this.all.Add(this.castSound);
            this.all.Add(this.travelSound);
            this.all.Add(this.hitSound);
            this.all.Add(this.secondaryItemTemplate);
            this.all.Add(this.equippedWeapons);
            this.all.Add(this.xpKillRange);
            this.all.Add(this.amsModifier);
            this.all.Add(this.dmsModifier);
            this.all.Add(this.projectileDamageModifier);
            this.all.Add(this.meleeDamageModifier);
            this.all.Add(this.energyDamageModifier);
            this.all.Add(this.chemicalDamageModifier);
            this.all.Add(this.radiationDamageModifier);
            this.all.Add(this.itemHateValue);
            this.all.Add(this.damageBonus);
            this.all.Add(this.maxDamage);
            this.all.Add(this.minDamage);
            this.all.Add(this.attackRange);
            this.all.Add(this.hateValueModifyer);
            this.all.Add(this.trapDifficulty);
            this.all.Add(this.statOne);
            this.all.Add(this.numAttackEffects);
            this.all.Add(this.defaultAttackType);
            this.all.Add(this.itemSkill);
            this.all.Add(this.itemDelay);
            this.all.Add(this.itemOpposedSkill);
            this.all.Add(this.itemSIS);
            this.all.Add(this.interactionRadius);
            this.all.Add(this.placement);
            this.all.Add(this.lockDifficulty);
            this.all.Add(this.members);
            this.all.Add(this.minMembers);
            this.all.Add(this.clanPrice);
            this.all.Add(this.missionBits3);
            this.all.Add(this.clanType);
            this.all.Add(this.clanInstance);
            this.all.Add(this.voteCount);
            this.all.Add(this.memberType);
            this.all.Add(this.memberInstance);
            this.all.Add(this.globalClanType);
            this.all.Add(this.globalClanInstance);
            this.all.Add(this.coldDamageModifier);
            this.all.Add(this.clanUpkeepInterval);
            this.all.Add(this.timeSinceUpkeep);
            this.all.Add(this.clanFinalized);
            this.all.Add(this.nanoDamageModifier);
            this.all.Add(this.fireDamageModifier);
            this.all.Add(this.poisonDamageModifier);
            this.all.Add(this.npCostModifier);
            this.all.Add(this.xpModifier);
            this.all.Add(this.breedLimit);
            this.all.Add(this.genderLimit);
            this.all.Add(this.levelLimit);
            this.all.Add(this.playerKilling);
            this.all.Add(this.teamAllowed);
            this.all.Add(this.weaponDisallowedType);
            this.all.Add(this.weaponDisallowedInstance);
            this.all.Add(this.taboo);
            this.all.Add(this.compulsion);
            this.all.Add(this.skillDisabled);
            this.all.Add(this.clanItemType);
            this.all.Add(this.clanItemInstance);
            this.all.Add(this.debuffFormula);
            this.all.Add(this.pvpRating);
            this.all.Add(this.savedXP);
            this.all.Add(this.doorBlockTime);
            this.all.Add(this.overrideTexture);
            this.all.Add(this.overrideMaterial);
            this.all.Add(this.deathReason);
            this.all.Add(this.damageOverrideType);
            this.all.Add(this.brainType);
            this.all.Add(this.xpBonus);
            this.all.Add(this.healInterval);
            this.all.Add(this.healDelta);
            this.all.Add(this.monsterTexture);
            this.all.Add(this.hasAlwaysLootable);
            this.all.Add(this.tradeLimit);
            this.all.Add(this.faceTexture);
            this.all.Add(this.specialCondition);
            this.all.Add(this.autoAttackFlags);
            this.all.Add(this.nextXP);
            this.all.Add(this.teleportPauseMilliSeconds);
            this.all.Add(this.sisCap);
            this.all.Add(this.animSet);
            this.all.Add(this.attackType);
            this.all.Add(this.nanoFocusLevel);
            this.all.Add(this.npcHash);
            this.all.Add(this.collisionRadius);
            this.all.Add(this.outerRadius);
            this.all.Add(this.monsterData);
            this.all.Add(this.monsterScale);
            this.all.Add(this.hitEffectType);
            this.all.Add(this.resurrectDest);
            this.all.Add(this.nanoInterval);
            this.all.Add(this.nanoDelta);
            this.all.Add(this.reclaimItem);
            this.all.Add(this.gatherEffectType);
            this.all.Add(this.visualBreed);
            this.all.Add(this.visualProfession);
            this.all.Add(this.visualSex);
            this.all.Add(this.ritualTargetInst);
            this.all.Add(this.skillTimeOnSelectedTarget);
            this.all.Add(this.lastSaveXP);
            this.all.Add(this.extendedTime);
            this.all.Add(this.burstRecharge);
            this.all.Add(this.fullAutoRecharge);
            this.all.Add(this.gatherAbstractAnim);
            this.all.Add(this.castTargetAbstractAnim);
            this.all.Add(this.castSelfAbstractAnim);
            this.all.Add(this.criticalIncrease);
            this.all.Add(this.rangeIncreaserWeapon);
            this.all.Add(this.rangeIncreaserNF);
            this.all.Add(this.skillLockModifier);
            this.all.Add(this.interruptModifier);
            this.all.Add(this.acgEntranceStyles);
            this.all.Add(this.chanceOfBreakOnSpellAttack);
            this.all.Add(this.chanceOfBreakOnDebuff);
            this.all.Add(this.dieAnim);
            this.all.Add(this.towerType);
            this.all.Add(this.expansion);
            this.all.Add(this.lowresMesh);
            this.all.Add(this.criticalDecrease);
            this.all.Add(this.oldTimeExist);
            this.all.Add(this.resistModifier);
            this.all.Add(this.chestFlags);
            this.all.Add(this.primaryTemplateId);
            this.all.Add(this.numberOfItems);
            this.all.Add(this.selectedTargetType);
            this.all.Add(this.corpseHash);
            this.all.Add(this.ammoName);
            this.all.Add(this.rotation);
            this.all.Add(this.catAnim);
            this.all.Add(this.catAnimFlags);
            this.all.Add(this.displayCATAnim);
            this.all.Add(this.displayCATMesh);
            this.all.Add(this.school);
            this.all.Add(this.nanoSpeed);
            this.all.Add(this.nanoPoints);
            this.all.Add(this.trainSkill);
            this.all.Add(this.trainSkillCost);
            this.all.Add(this.isFightingMe);
            this.all.Add(this.nextFormula);
            this.all.Add(this.multipleCount);
            this.all.Add(this.effectType);
            this.all.Add(this.impactEffectType);
            this.all.Add(this.corpseType);
            this.all.Add(this.corpseInstance);
            this.all.Add(this.corpseAnimKey);
            this.all.Add(this.unarmedTemplateInstance);
            this.all.Add(this.tracerEffectType);
            this.all.Add(this.ammoType);
            this.all.Add(this.charRadius);
            this.all.Add(this.chanceOfUse);
            this.all.Add(this.currentState);
            this.all.Add(this.armourType);
            this.all.Add(this.restModifier);
            this.all.Add(this.buyModifier);
            this.all.Add(this.sellModifier);
            this.all.Add(this.castEffectType);
            this.all.Add(this.npcBrainState);
            this.all.Add(this.waitState);
            this.all.Add(this.selectedTarget);
            this.all.Add(this.missionBits4);
            this.all.Add(this.ownerInstance);
            this.all.Add(this.charState);
            this.all.Add(this.readOnly);
            this.all.Add(this.damageType);
            this.all.Add(this.collideCheckInterval);
            this.all.Add(this.playfieldType);
            this.all.Add(this.npcCommand);
            this.all.Add(this.initiativeType);
            this.all.Add(this.charTmp1);
            this.all.Add(this.charTmp2);
            this.all.Add(this.charTmp3);
            this.all.Add(this.charTmp4);
            this.all.Add(this.npcCommandArg);
            this.all.Add(this.nameTemplate);
            this.all.Add(this.desiredTargetDistance);
            this.all.Add(this.vicinityRange);
            this.all.Add(this.npcIsSurrendering);
            this.all.Add(this.stateMachine);
            this.all.Add(this.npcSurrenderInstance);
            this.all.Add(this.npcHasPatrolList);
            this.all.Add(this.npcVicinityChars);
            this.all.Add(this.proximityRangeOutdoors);
            this.all.Add(this.npcFamily);
            this.all.Add(this.commandRange);
            this.all.Add(this.npcHatelistSize);
            this.all.Add(this.npcNumPets);
            this.all.Add(this.odMinSizeAdd);
            this.all.Add(this.effectRed);
            this.all.Add(this.effectGreen);
            this.all.Add(this.effectBlue);
            this.all.Add(this.odMaxSizeAdd);
            this.all.Add(this.durationModifier);
            this.all.Add(this.npcCryForHelpRange);
            this.all.Add(this.losHeight);
            this.all.Add(this.petReq1);
            this.all.Add(this.petReq2);
            this.all.Add(this.petReq3);
            this.all.Add(this.mapOptions);
            this.all.Add(this.mapAreaPart1);
            this.all.Add(this.mapAreaPart2);
            this.all.Add(this.fixtureFlags);
            this.all.Add(this.fallDamage);
            this.all.Add(this.reflectReturnedProjectileAC);
            this.all.Add(this.reflectReturnedMeleeAC);
            this.all.Add(this.reflectReturnedEnergyAC);
            this.all.Add(this.reflectReturnedChemicalAC);
            this.all.Add(this.reflectReturnedRadiationAC);
            this.all.Add(this.reflectReturnedColdAC);
            this.all.Add(this.reflectReturnedNanoAC);
            this.all.Add(this.reflectReturnedFireAC);
            this.all.Add(this.reflectReturnedPoisonAC);
            this.all.Add(this.proximityRangeIndoors);
            this.all.Add(this.petReqVal1);
            this.all.Add(this.petReqVal2);
            this.all.Add(this.petReqVal3);
            this.all.Add(this.targetFacing);
            this.all.Add(this.backstab);
            this.all.Add(this.originatorType);
            this.all.Add(this.questInstance);
            this.all.Add(this.questIndex1);
            this.all.Add(this.questIndex2);
            this.all.Add(this.questIndex3);
            this.all.Add(this.questIndex4);
            this.all.Add(this.questIndex5);
            this.all.Add(this.qtDungeonInstance);
            this.all.Add(this.qtNumMonsters);
            this.all.Add(this.qtKilledMonsters);
            this.all.Add(this.animPos);
            this.all.Add(this.animPlay);
            this.all.Add(this.animSpeed);
            this.all.Add(this.qtKillNumMonsterId1);
            this.all.Add(this.qtKillNumMonsterCount1);
            this.all.Add(this.qtKillNumMonsterId2);
            this.all.Add(this.qtKillNumMonsterCount2);
            this.all.Add(this.qtKillNumMonsterID3);
            this.all.Add(this.qtKillNumMonsterCount3);
            this.all.Add(this.questIndex0);
            this.all.Add(this.questTimeout);
            this.all.Add(this.towerNpcHash);
            this.all.Add(this.petType);
            this.all.Add(this.onTowerCreation);
            this.all.Add(this.ownedTowers);
            this.all.Add(this.towerInstance);
            this.all.Add(this.attackShield);
            this.all.Add(this.specialAttackShield);
            this.all.Add(this.npcVicinityPlayers);
            this.all.Add(this.npcUseFightModeRegenRate);
            this.all.Add(this.rnd);
            this.all.Add(this.socialStatus);
            this.all.Add(this.lastRnd);
            this.all.Add(this.itemDelayCap);
            this.all.Add(this.rechargeDelayCap);
            this.all.Add(this.percentRemainingHealth);
            this.all.Add(this.percentRemainingNano);
            this.all.Add(this.targetDistance);
            this.all.Add(this.teamCloseness);
            this.all.Add(this.numberOnHateList);
            this.all.Add(this.conditionState);
            this.all.Add(this.expansionPlayfield);
            this.all.Add(this.shadowBreed);
            this.all.Add(this.npcFovStatus);
            this.all.Add(this.dudChance);
            this.all.Add(this.healMultiplier);
            this.all.Add(this.nanoDamageMultiplier);
            this.all.Add(this.nanoVulnerability);
            this.all.Add(this.amsCap);
            this.all.Add(this.procInitiative1);
            this.all.Add(this.procInitiative2);
            this.all.Add(this.procInitiative3);
            this.all.Add(this.procInitiative4);
            this.all.Add(this.factionModifier);
            this.all.Add(this.missionBits8);
            this.all.Add(this.missionBits9);
            this.all.Add(this.stackingLine2);
            this.all.Add(this.stackingLine3);
            this.all.Add(this.stackingLine4);
            this.all.Add(this.stackingLine5);
            this.all.Add(this.stackingLine6);
            this.all.Add(this.stackingOrder);
            this.all.Add(this.procNano1);
            this.all.Add(this.procNano2);
            this.all.Add(this.procNano3);
            this.all.Add(this.procNano4);
            this.all.Add(this.procChance1);
            this.all.Add(this.procChance2);
            this.all.Add(this.procChance3);
            this.all.Add(this.procChance4);
            this.all.Add(this.otArmedForces);
            this.all.Add(this.clanSentinels);
            this.all.Add(this.otMed);
            this.all.Add(this.clanGaia);
            this.all.Add(this.otTrans);
            this.all.Add(this.clanVanguards);
            this.all.Add(this.gos);
            this.all.Add(this.otFollowers);
            this.all.Add(this.otOperator);
            this.all.Add(this.otUnredeemed);
            this.all.Add(this.clanDevoted);
            this.all.Add(this.clanConserver);
            this.all.Add(this.clanRedeemed);
            this.all.Add(this.sk);
            this.all.Add(this.lastSK);
            this.all.Add(this.nextSK);
            this.all.Add(this.playerOptions);
            this.all.Add(this.lastPerkResetTime);
            this.all.Add(this.currentTime);
            this.all.Add(this.shadowBreedTemplate);
            this.all.Add(this.npcVicinityFamily);
            this.all.Add(this.npcScriptAmsScale);
            this.all.Add(this.apartmentsAllowed);
            this.all.Add(this.apartmentsOwned);
            this.all.Add(this.apartmentAccessCard);
            this.all.Add(this.mapAreaPart3);
            this.all.Add(this.mapAreaPart4);
            this.all.Add(this.numberOfTeamMembers);
            this.all.Add(this.actionCategory);
            this.all.Add(this.currentPlayfield);
            this.all.Add(this.districtNano);
            this.all.Add(this.districtNanoInterval);
            this.all.Add(this.unsavedXP);
            this.all.Add(this.regainXPPercentage);
            this.all.Add(this.tempSaveTeamId);
            this.all.Add(this.tempSavePlayfield);
            this.all.Add(this.tempSaveX);
            this.all.Add(this.tempSaveY);
            this.all.Add(this.extendedFlags);
            this.all.Add(this.shopPrice);
            this.all.Add(this.newbieHP);
            this.all.Add(this.hpLevelUp);
            this.all.Add(this.hpPerSkill);
            this.all.Add(this.newbieNP);
            this.all.Add(this.npLevelUp);
            this.all.Add(this.npPerSkill);
            this.all.Add(this.maxShopItems);
            this.all.Add(this.playerId);
            this.all.Add(this.shopRent);
            this.all.Add(this.synergyHash);
            this.all.Add(this.shopFlags);
            this.all.Add(this.shopLastUsed);
            this.all.Add(this.shopType);
            this.all.Add(this.lockDownTime);
            this.all.Add(this.leaderLockDownTime);
            this.all.Add(this.invadersKilled);
            this.all.Add(this.killedByInvaders);
            this.all.Add(this.missionBits10);
            this.all.Add(this.missionBits11);
            this.all.Add(this.missionBits12);
            this.all.Add(this.houseTemplate);
            this.all.Add(this.percentFireDamage);
            this.all.Add(this.percentColdDamage);
            this.all.Add(this.percentMeleeDamage);
            this.all.Add(this.percentProjectileDamage);
            this.all.Add(this.percentPoisonDamage);
            this.all.Add(this.percentRadiationDamage);
            this.all.Add(this.percentEnergyDamage);
            this.all.Add(this.percentChemicalDamage);
            this.all.Add(this.totalDamage);
            this.all.Add(this.trackProjectileDamage);
            this.all.Add(this.trackMeleeDamage);
            this.all.Add(this.trackEnergyDamage);
            this.all.Add(this.trackChemicalDamage);
            this.all.Add(this.trackRadiationDamage);
            this.all.Add(this.trackColdDamage);
            this.all.Add(this.trackPoisonDamage);
            this.all.Add(this.trackFireDamage);
            this.all.Add(this.npcSpellArg1);
            this.all.Add(this.npcSpellRet1);
            this.all.Add(this.cityInstance);
            this.all.Add(this.distanceToSpawnpoint);
            this.all.Add(this.cityTerminalRechargePercent);
            this.all.Add(this.unreadMailCount);
            this.all.Add(this.lastMailCheckTime);
            this.all.Add(this.advantageHash1);
            this.all.Add(this.advantageHash2);
            this.all.Add(this.advantageHash3);
            this.all.Add(this.advantageHash4);
            this.all.Add(this.advantageHash5);
            this.all.Add(this.shopIndex);
            this.all.Add(this.shopId);
            this.all.Add(this.isVehicle);
            this.all.Add(this.damageToNano);
            this.all.Add(this.accountFlags);
            this.all.Add(this.damageToNanoMultiplier);
            this.all.Add(this.mechData);
            this.all.Add(this.vehicleAC);
            this.all.Add(this.vehicleDamage);
            this.all.Add(this.vehicleHealth);
            this.all.Add(this.vehicleSpeed);
            this.all.Add(this.battlestationSide);
            this.all.Add(this.victoryPoints);
            this.all.Add(this.battlestationRep);
            this.all.Add(this.petState);
            this.all.Add(this.paidPoints);
            this.all.Add(this.visualFlags);
            this.all.Add(this.pvpDuelKills);
            this.all.Add(this.pvpDuelDeaths);
            this.all.Add(this.pvpProfessionDuelKills);
            this.all.Add(this.pvpProfessionDuelDeaths);
            this.all.Add(this.pvpRankedSoloKills);
            this.all.Add(this.pvpRankedSoloDeaths);
            this.all.Add(this.pvpRankedTeamKills);
            this.all.Add(this.pvpRankedTeamDeaths);
            this.all.Add(this.pvpSoloScore);
            this.all.Add(this.pvpTeamScore);
            this.all.Add(this.pvpDuelScore);
            this.all.Add(this.acgItemSeed);
            this.all.Add(this.acgItemLevel);
            this.all.Add(this.acgItemTemplateId);
            this.all.Add(this.acgItemTemplateId2);
            this.all.Add(this.acgItemCategoryId);
            this.all.Add(this.hasKnuBotData);
            this.all.Add(this.questBoothDifficulty);
            this.all.Add(this.questAsMinimumRange);
            this.all.Add(this.questAsMaximumRange);
            this.all.Add(this.visualLodLevel);
            this.all.Add(this.targetDistanceChange);
            this.all.Add(this.tideRequiredDynelId);
            this.all.Add(this.streamCheckMagic);
            this.all.Add(this.objectType);
            this.all.Add(this.instance);
            this.all.Add(this.weaponsStyle);
            this.all.Add(this.shoulderMeshRight);
            this.all.Add(this.shoulderMeshLeft);
            this.all.Add(this.weaponMeshRight);
            this.all.Add(this.weaponMeshLeft);
            this.all.Add(this.overrideTextureAttractor);
            this.all.Add(this.overrideTextureBack);
            this.all.Add(this.overrideTextureHead);
            this.all.Add(this.overrideTextureShoulderpadLeft);
            this.all.Add(this.overrideTextureShoulderpadRight);
            this.all.Add(this.overrideTextureWeaponLeft);
            this.all.Add(this.overrideTextureWeaponRight);

            // add Tricklers, try not to do circulars!!
            this.SetAbilityTricklers();
            this.bodyDevelopment.Affects.Add(this.life.StatId);
            this.nanoEnergyPool.Affects.Add(this.maxNanoEnergy.StatId);
            this.level.Affects.Add(this.life.StatId);
            this.level.Affects.Add(this.maxNanoEnergy.StatId);
            this.level.Affects.Add(this.titleLevel.StatId);
            this.level.Affects.Add(this.nextSK.StatId);
            this.level.Affects.Add(this.nextXP.StatId);
            this.alienLevel.Affects.Add(this.alienNextXP.StatId);
            this.xp.Affects.Add(this.level.StatId);
            this.sk.Affects.Add(this.level.StatId);
            this.alienXP.Affects.Add(this.alienLevel.StatId);
            this.profession.Affects.Add(this.health.StatId);
            this.profession.Affects.Add(this.maxNanoEnergy.StatId);
            this.profession.Affects.Add(this.ip.StatId);
            this.stamina.Affects.Add(this.healDelta.StatId);
            this.psychic.Affects.Add(this.nanoDelta.StatId);
            this.stamina.Affects.Add(this.healInterval.StatId);
            this.psychic.Affects.Add(this.nanoInterval.StatId);
            this.level.Affects.Add(this.ip.StatId);

            foreach (DynelStat c in this.all)
            {
                c.SetParent(parent);
            }

            if (!(parent is NonPlayerCharacter))
            {
                /*
                Flags.RaiseBeforeStatChangedEvent += Send;
                Life.RaiseBeforeStatChangedEvent += Send;
                VolumeMass.RaiseBeforeStatChangedEvent += Send;
                AttackSpeed.RaiseBeforeStatChangedEvent += Send;
                Breed.RaiseBeforeStatChangedEvent += Send;
                Clan.RaiseBeforeStatChangedEvent += Send;
                Team.RaiseBeforeStatChangedEvent += Send;
                State.RaiseBeforeStatChangedEvent += Send;
                TimeExist.RaiseBeforeStatChangedEvent += Send;
                MapFlags.RaiseBeforeStatChangedEvent += Send;
                ProfessionLevel.RaiseBeforeStatChangedEvent += Send;
                PreviousHealth.RaiseBeforeStatChangedEvent += Send;
                Mesh.RaiseBeforeStatChangedEvent += Send;
                Anim.RaiseBeforeStatChangedEvent += Send;
                Name.RaiseBeforeStatChangedEvent += Send;
                Info.RaiseBeforeStatChangedEvent += Send;
                Strength.RaiseBeforeStatChangedEvent += Send;
                Agility.RaiseBeforeStatChangedEvent += Send;
                Stamina.RaiseBeforeStatChangedEvent += Send;
                Intelligence.RaiseBeforeStatChangedEvent += Send;
                Sense.RaiseBeforeStatChangedEvent += Send;
                Psychic.RaiseBeforeStatChangedEvent += Send;
                AMS.RaiseBeforeStatChangedEvent += Send;
                StaticInstance.RaiseBeforeStatChangedEvent += Send;
                MaxMass.RaiseBeforeStatChangedEvent += Send;
                StaticType.RaiseBeforeStatChangedEvent += Send;
                Energy.RaiseBeforeStatChangedEvent += Send;
                Health.RaiseBeforeStatChangedEvent += Send;
                Height.RaiseBeforeStatChangedEvent += Send;
                DMS.RaiseBeforeStatChangedEvent += Send;
                Can.RaiseBeforeStatChangedEvent += Send;
                Face.RaiseBeforeStatChangedEvent += Send;
                HairMesh.RaiseBeforeStatChangedEvent += Send;
                Side.RaiseBeforeStatChangedEvent += Send;
                DeadTimer.RaiseBeforeStatChangedEvent += Send;
                AccessCount.RaiseBeforeStatChangedEvent += Send;
                AttackCount.RaiseBeforeStatChangedEvent += Send;
                TitleLevel.RaiseBeforeStatChangedEvent += Send;
                BackMesh.RaiseBeforeStatChangedEvent += Send;
                AlienXP.RaiseBeforeStatChangedEvent += Send;
                FabricType.RaiseBeforeStatChangedEvent += Send;
                CATMesh.RaiseBeforeStatChangedEvent += Send;
                ParentType.RaiseBeforeStatChangedEvent += Send;
                ParentInstance.RaiseBeforeStatChangedEvent += Send;
                BeltSlots.RaiseBeforeStatChangedEvent += Send;
                BandolierSlots.RaiseBeforeStatChangedEvent += Send;
                Fatness.RaiseBeforeStatChangedEvent += Send;
                ClanLevel.RaiseBeforeStatChangedEvent += Send;
                InsuranceTime.RaiseBeforeStatChangedEvent += Send;
                InventoryTimeout.RaiseBeforeStatChangedEvent += Send;
                AggDef.RaiseBeforeStatChangedEvent += Send;
                XP.RaiseBeforeStatChangedEvent += Send;
                IP.RaiseBeforeStatChangedEvent += Send;
                Level.RaiseBeforeStatChangedEvent += Send;
                InventoryId.RaiseBeforeStatChangedEvent += Send;
                TimeSinceCreation.RaiseBeforeStatChangedEvent += Send;
                LastXP.RaiseBeforeStatChangedEvent += Send;
                Age.RaiseBeforeStatChangedEvent += Send;
                Sex.RaiseBeforeStatChangedEvent += Send;
                Profession.RaiseBeforeStatChangedEvent += Send;
                Cash.RaiseBeforeStatChangedEvent += Send;
                Alignment.RaiseBeforeStatChangedEvent += Send;
                Attitude.RaiseBeforeStatChangedEvent += Send;
                HeadMesh.RaiseBeforeStatChangedEvent += Send;
                MissionBits5.RaiseBeforeStatChangedEvent += Send;
                MissionBits6.RaiseBeforeStatChangedEvent += Send;
                MissionBits7.RaiseBeforeStatChangedEvent += Send;
                VeteranPoints.RaiseBeforeStatChangedEvent += Send;
                MonthsPaid.RaiseBeforeStatChangedEvent += Send;
                SpeedPenalty.RaiseBeforeStatChangedEvent += Send;
                TotalMass.RaiseBeforeStatChangedEvent += Send;
                ItemType.RaiseBeforeStatChangedEvent += Send;
                RepairDifficulty.RaiseBeforeStatChangedEvent += Send;
                Price.RaiseBeforeStatChangedEvent += Send;
                MetaType.RaiseBeforeStatChangedEvent += Send;
                ItemClass.RaiseBeforeStatChangedEvent += Send;
                RepairSkill.RaiseBeforeStatChangedEvent += Send;
                CurrentMass.RaiseBeforeStatChangedEvent += Send;
                Icon.RaiseBeforeStatChangedEvent += Send;
                PrimaryItemType.RaiseBeforeStatChangedEvent += Send;
                PrimaryItemInstance.RaiseBeforeStatChangedEvent += Send;
                SecondaryItemType.RaiseBeforeStatChangedEvent += Send;
                SecondaryItemInstance.RaiseBeforeStatChangedEvent += Send;
                UserType.RaiseBeforeStatChangedEvent += Send;
                UserInstance.RaiseBeforeStatChangedEvent += Send;
                AreaType.RaiseBeforeStatChangedEvent += Send;
                AreaInstance.RaiseBeforeStatChangedEvent += Send;
                DefaultPos.RaiseBeforeStatChangedEvent += Send;
                Race.RaiseBeforeStatChangedEvent += Send;
                ProjectileAC.RaiseBeforeStatChangedEvent += Send;
                MeleeAC.RaiseBeforeStatChangedEvent += Send;
                EnergyAC.RaiseBeforeStatChangedEvent += Send;
                ChemicalAC.RaiseBeforeStatChangedEvent += Send;
                RadiationAC.RaiseBeforeStatChangedEvent += Send;
                ColdAC.RaiseBeforeStatChangedEvent += Send;
                PoisonAC.RaiseBeforeStatChangedEvent += Send;
                FireAC.RaiseBeforeStatChangedEvent += Send;
                StateAction.RaiseBeforeStatChangedEvent += Send;
                ItemAnim.RaiseBeforeStatChangedEvent += Send;
                MartialArts.RaiseBeforeStatChangedEvent += Send;
                MeleeMultiple.RaiseBeforeStatChangedEvent += Send;
                OnehBluntWeapons.RaiseBeforeStatChangedEvent += Send;
                OnehEdgedWeapon.RaiseBeforeStatChangedEvent += Send;
                MeleeEnergyWeapon.RaiseBeforeStatChangedEvent += Send;
                TwohEdgedWeapons.RaiseBeforeStatChangedEvent += Send;
                Piercing.RaiseBeforeStatChangedEvent += Send;
                TwohBluntWeapons.RaiseBeforeStatChangedEvent += Send;
                ThrowingKnife.RaiseBeforeStatChangedEvent += Send;
                Grenade.RaiseBeforeStatChangedEvent += Send;
                ThrownGrapplingWeapons.RaiseBeforeStatChangedEvent += Send;
                Bow.RaiseBeforeStatChangedEvent += Send;
                Pistol.RaiseBeforeStatChangedEvent += Send;
                Rifle.RaiseBeforeStatChangedEvent += Send;
                SubMachineGun.RaiseBeforeStatChangedEvent += Send;
                Shotgun.RaiseBeforeStatChangedEvent += Send;
                AssaultRifle.RaiseBeforeStatChangedEvent += Send;
                DriveWater.RaiseBeforeStatChangedEvent += Send;
                CloseCombatInitiative.RaiseBeforeStatChangedEvent += Send;
                DistanceWeaponInitiative.RaiseBeforeStatChangedEvent += Send;
                PhysicalProwessInitiative.RaiseBeforeStatChangedEvent += Send;
                BowSpecialAttack.RaiseBeforeStatChangedEvent += Send;
                SenseImprovement.RaiseBeforeStatChangedEvent += Send;
                FirstAid.RaiseBeforeStatChangedEvent += Send;
                Treatment.RaiseBeforeStatChangedEvent += Send;
                MechanicalEngineering.RaiseBeforeStatChangedEvent += Send;
                ElectricalEngineering.RaiseBeforeStatChangedEvent += Send;
                MaterialMetamorphose.RaiseBeforeStatChangedEvent += Send;
                BiologicalMetamorphose.RaiseBeforeStatChangedEvent += Send;
                PsychologicalModification.RaiseBeforeStatChangedEvent += Send;
                MaterialCreation.RaiseBeforeStatChangedEvent += Send;
                MaterialLocation.RaiseBeforeStatChangedEvent += Send;
                NanoEnergyPool.RaiseBeforeStatChangedEvent += Send;
                LR_EnergyWeapon.RaiseBeforeStatChangedEvent += Send;
                LR_MultipleWeapon.RaiseBeforeStatChangedEvent += Send;
                DisarmTrap.RaiseBeforeStatChangedEvent += Send;
                Perception.RaiseBeforeStatChangedEvent += Send;
                Adventuring.RaiseBeforeStatChangedEvent += Send;
                Swim.RaiseBeforeStatChangedEvent += Send;
                DriveAir.RaiseBeforeStatChangedEvent += Send;
                MapNavigation.RaiseBeforeStatChangedEvent += Send;
                Tutoring.RaiseBeforeStatChangedEvent += Send;
                Brawl.RaiseBeforeStatChangedEvent += Send;
                Riposte.RaiseBeforeStatChangedEvent += Send;
                Dimach.RaiseBeforeStatChangedEvent += Send;
                Parry.RaiseBeforeStatChangedEvent += Send;
                SneakAttack.RaiseBeforeStatChangedEvent += Send;
                FastAttack.RaiseBeforeStatChangedEvent += Send;
                Burst.RaiseBeforeStatChangedEvent += Send;
                NanoProwessInitiative.RaiseBeforeStatChangedEvent += Send;
                FlingShot.RaiseBeforeStatChangedEvent += Send;
                AimedShot.RaiseBeforeStatChangedEvent += Send;
                BodyDevelopment.RaiseBeforeStatChangedEvent += Send;
                Duck.RaiseBeforeStatChangedEvent += Send;
                Dodge.RaiseBeforeStatChangedEvent += Send;
                Evade.RaiseBeforeStatChangedEvent += Send;
                RunSpeed.RaiseBeforeStatChangedEvent += Send;
                FieldQuantumPhysics.RaiseBeforeStatChangedEvent += Send;
                WeaponSmithing.RaiseBeforeStatChangedEvent += Send;
                Pharmaceuticals.RaiseBeforeStatChangedEvent += Send;
                NanoProgramming.RaiseBeforeStatChangedEvent += Send;
                ComputerLiteracy.RaiseBeforeStatChangedEvent += Send;
                Psychology.RaiseBeforeStatChangedEvent += Send;
                Chemistry.RaiseBeforeStatChangedEvent += Send;
                Concealment.RaiseBeforeStatChangedEvent += Send;
                BreakingEntry.RaiseBeforeStatChangedEvent += Send;
                DriveGround.RaiseBeforeStatChangedEvent += Send;
                FullAuto.RaiseBeforeStatChangedEvent += Send;
                NanoAC.RaiseBeforeStatChangedEvent += Send;
                AlienLevel.RaiseBeforeStatChangedEvent += Send;
                HealthChangeBest.RaiseBeforeStatChangedEvent += Send;
                HealthChangeWorst.RaiseBeforeStatChangedEvent += Send;
                HealthChange.RaiseBeforeStatChangedEvent += Send;
                CurrentMovementMode.RaiseBeforeStatChangedEvent += Send;
                PrevMovementMode.RaiseBeforeStatChangedEvent += Send;
                AutoLockTimeDefault.RaiseBeforeStatChangedEvent += Send;
                AutoUnlockTimeDefault.RaiseBeforeStatChangedEvent += Send;
                MoreFlags.RaiseBeforeStatChangedEvent += Send;
                AlienNextXP.RaiseBeforeStatChangedEvent += Send;
                NPCFlags.RaiseBeforeStatChangedEvent += Send;
                CurrentNCU.RaiseBeforeStatChangedEvent += Send;
                MaxNCU.RaiseBeforeStatChangedEvent += Send;
                Specialization.RaiseBeforeStatChangedEvent += Send;
                EffectIcon.RaiseBeforeStatChangedEvent += Send;
                BuildingType.RaiseBeforeStatChangedEvent += Send;
                BuildingInstance.RaiseBeforeStatChangedEvent += Send;
                CardOwnerType.RaiseBeforeStatChangedEvent += Send;
                CardOwnerInstance.RaiseBeforeStatChangedEvent += Send;
                BuildingComplexInst.RaiseBeforeStatChangedEvent += Send;
                ExitInstance.RaiseBeforeStatChangedEvent += Send;
                NextDoorInBuilding.RaiseBeforeStatChangedEvent += Send;
                LastConcretePlayfieldInstance.RaiseBeforeStatChangedEvent += Send;
                ExtenalPlayfieldInstance.RaiseBeforeStatChangedEvent += Send;
                ExtenalDoorInstance.RaiseBeforeStatChangedEvent += Send;
                InPlay.RaiseBeforeStatChangedEvent += Send;
                AccessKey.RaiseBeforeStatChangedEvent += Send;
                PetMaster.RaiseBeforeStatChangedEvent += Send;
                OrientationMode.RaiseBeforeStatChangedEvent += Send;
                SessionTime.RaiseBeforeStatChangedEvent += Send;
                RP.RaiseBeforeStatChangedEvent += Send;
                Conformity.RaiseBeforeStatChangedEvent += Send;
                Aggressiveness.RaiseBeforeStatChangedEvent += Send;
                Stability.RaiseBeforeStatChangedEvent += Send;
                Extroverty.RaiseBeforeStatChangedEvent += Send;
                BreedHostility.RaiseBeforeStatChangedEvent += Send;
                ReflectProjectileAC.RaiseBeforeStatChangedEvent += Send;
                ReflectMeleeAC.RaiseBeforeStatChangedEvent += Send;
                ReflectEnergyAC.RaiseBeforeStatChangedEvent += Send;
                ReflectChemicalAC.RaiseBeforeStatChangedEvent += Send;
                RechargeDelay.RaiseBeforeStatChangedEvent += Send;
                EquipDelay.RaiseBeforeStatChangedEvent += Send;
                MaxEnergy.RaiseBeforeStatChangedEvent += Send;
                TeamSide.RaiseBeforeStatChangedEvent += Send;
                CurrentNano.RaiseBeforeStatChangedEvent += Send;
                GmLevel.RaiseBeforeStatChangedEvent += Send;
                ReflectRadiationAC.RaiseBeforeStatChangedEvent += Send;
                ReflectColdAC.RaiseBeforeStatChangedEvent += Send;
                ReflectNanoAC.RaiseBeforeStatChangedEvent += Send;
                ReflectFireAC.RaiseBeforeStatChangedEvent += Send;
                CurrBodyLocation.RaiseBeforeStatChangedEvent += Send;
                MaxNanoEnergy.RaiseBeforeStatChangedEvent += Send;
                AccumulatedDamage.RaiseBeforeStatChangedEvent += Send;
                CanChangeClothes.RaiseBeforeStatChangedEvent += Send;
                Features.RaiseBeforeStatChangedEvent += Send;
                ReflectPoisonAC.RaiseBeforeStatChangedEvent += Send;
                ShieldProjectileAC.RaiseBeforeStatChangedEvent += Send;
                ShieldMeleeAC.RaiseBeforeStatChangedEvent += Send;
                ShieldEnergyAC.RaiseBeforeStatChangedEvent += Send;
                ShieldChemicalAC.RaiseBeforeStatChangedEvent += Send;
                ShieldRadiationAC.RaiseBeforeStatChangedEvent += Send;
                ShieldColdAC.RaiseBeforeStatChangedEvent += Send;
                ShieldNanoAC.RaiseBeforeStatChangedEvent += Send;
                ShieldFireAC.RaiseBeforeStatChangedEvent += Send;
                ShieldPoisonAC.RaiseBeforeStatChangedEvent += Send;
                BerserkMode.RaiseBeforeStatChangedEvent += Send;
                InsurancePercentage.RaiseBeforeStatChangedEvent += Send;
                ChangeSideCount.RaiseBeforeStatChangedEvent += Send;
                AbsorbProjectileAC.RaiseBeforeStatChangedEvent += Send;
                AbsorbMeleeAC.RaiseBeforeStatChangedEvent += Send;
                AbsorbEnergyAC.RaiseBeforeStatChangedEvent += Send;
                AbsorbChemicalAC.RaiseBeforeStatChangedEvent += Send;
                AbsorbRadiationAC.RaiseBeforeStatChangedEvent += Send;
                AbsorbColdAC.RaiseBeforeStatChangedEvent += Send;
                AbsorbFireAC.RaiseBeforeStatChangedEvent += Send;
                AbsorbPoisonAC.RaiseBeforeStatChangedEvent += Send;
                AbsorbNanoAC.RaiseBeforeStatChangedEvent += Send;
                TemporarySkillReduction.RaiseBeforeStatChangedEvent += Send;
                BirthDate.RaiseBeforeStatChangedEvent += Send;
                LastSaved.RaiseBeforeStatChangedEvent += Send;
                SoundVolume.RaiseBeforeStatChangedEvent += Send;
                PetCounter.RaiseBeforeStatChangedEvent += Send;
                MeetersWalked.RaiseBeforeStatChangedEvent += Send;
                QuestLevelsSolved.RaiseBeforeStatChangedEvent += Send;
                MonsterLevelsKilled.RaiseBeforeStatChangedEvent += Send;
                PvPLevelsKilled.RaiseBeforeStatChangedEvent += Send;
                MissionBits1.RaiseBeforeStatChangedEvent += Send;
                MissionBits2.RaiseBeforeStatChangedEvent += Send;
                AccessGrant.RaiseBeforeStatChangedEvent += Send;
                DoorFlags.RaiseBeforeStatChangedEvent += Send;
                ClanHierarchy.RaiseBeforeStatChangedEvent += Send;
                QuestStat.RaiseBeforeStatChangedEvent += Send;
                ClientActivated.RaiseBeforeStatChangedEvent += Send;
                PersonalResearchLevel.RaiseBeforeStatChangedEvent += Send;
                GlobalResearchLevel.RaiseBeforeStatChangedEvent += Send;
                PersonalResearchGoal.RaiseBeforeStatChangedEvent += Send;
                GlobalResearchGoal.RaiseBeforeStatChangedEvent += Send;
                TurnSpeed.RaiseBeforeStatChangedEvent += Send;
                LiquidType.RaiseBeforeStatChangedEvent += Send;
                GatherSound.RaiseBeforeStatChangedEvent += Send;
                CastSound.RaiseBeforeStatChangedEvent += Send;
                TravelSound.RaiseBeforeStatChangedEvent += Send;
                HitSound.RaiseBeforeStatChangedEvent += Send;
                SecondaryItemTemplate.RaiseBeforeStatChangedEvent += Send;
                EquippedWeapons.RaiseBeforeStatChangedEvent += Send;
                XPKillRange.RaiseBeforeStatChangedEvent += Send;
                AMSModifier.RaiseBeforeStatChangedEvent += Send;
                DMSModifier.RaiseBeforeStatChangedEvent += Send;
                ProjectileDamageModifier.RaiseBeforeStatChangedEvent += Send;
                MeleeDamageModifier.RaiseBeforeStatChangedEvent += Send;
                EnergyDamageModifier.RaiseBeforeStatChangedEvent += Send;
                ChemicalDamageModifier.RaiseBeforeStatChangedEvent += Send;
                RadiationDamageModifier.RaiseBeforeStatChangedEvent += Send;
                ItemHateValue.RaiseBeforeStatChangedEvent += Send;
                DamageBonus.RaiseBeforeStatChangedEvent += Send;
                MaxDamage.RaiseBeforeStatChangedEvent += Send;
                MinDamage.RaiseBeforeStatChangedEvent += Send;
                AttackRange.RaiseBeforeStatChangedEvent += Send;
                HateValueModifyer.RaiseBeforeStatChangedEvent += Send;
                TrapDifficulty.RaiseBeforeStatChangedEvent += Send;
                StatOne.RaiseBeforeStatChangedEvent += Send;
                NumAttackEffects.RaiseBeforeStatChangedEvent += Send;
                DefaultAttackType.RaiseBeforeStatChangedEvent += Send;
                ItemSkill.RaiseBeforeStatChangedEvent += Send;
                ItemDelay.RaiseBeforeStatChangedEvent += Send;
                ItemOpposedSkill.RaiseBeforeStatChangedEvent += Send;
                ItemSIS.RaiseBeforeStatChangedEvent += Send;
                InteractionRadius.RaiseBeforeStatChangedEvent += Send;
                Placement.RaiseBeforeStatChangedEvent += Send;
                LockDifficulty.RaiseBeforeStatChangedEvent += Send;
                Members.RaiseBeforeStatChangedEvent += Send;
                MinMembers.RaiseBeforeStatChangedEvent += Send;
                ClanPrice.RaiseBeforeStatChangedEvent += Send;
                MissionBits3.RaiseBeforeStatChangedEvent += Send;
                ClanType.RaiseBeforeStatChangedEvent += Send;
                ClanInstance.RaiseBeforeStatChangedEvent += Send;
                VoteCount.RaiseBeforeStatChangedEvent += Send;
                MemberType.RaiseBeforeStatChangedEvent += Send;
                MemberInstance.RaiseBeforeStatChangedEvent += Send;
                GlobalClanType.RaiseBeforeStatChangedEvent += Send;
                GlobalClanInstance.RaiseBeforeStatChangedEvent += Send;
                ColdDamageModifier.RaiseBeforeStatChangedEvent += Send;
                ClanUpkeepInterval.RaiseBeforeStatChangedEvent += Send;
                TimeSinceUpkeep.RaiseBeforeStatChangedEvent += Send;
                ClanFinalized.RaiseBeforeStatChangedEvent += Send;
                NanoDamageModifier.RaiseBeforeStatChangedEvent += Send;
                FireDamageModifier.RaiseBeforeStatChangedEvent += Send;
                PoisonDamageModifier.RaiseBeforeStatChangedEvent += Send;
                NPCostModifier.RaiseBeforeStatChangedEvent += Send;
                XPModifier.RaiseBeforeStatChangedEvent += Send;
                BreedLimit.RaiseBeforeStatChangedEvent += Send;
                GenderLimit.RaiseBeforeStatChangedEvent += Send;
                LevelLimit.RaiseBeforeStatChangedEvent += Send;
                PlayerKilling.RaiseBeforeStatChangedEvent += Send;
                TeamAllowed.RaiseBeforeStatChangedEvent += Send;
                WeaponDisallowedType.RaiseBeforeStatChangedEvent += Send;
                WeaponDisallowedInstance.RaiseBeforeStatChangedEvent += Send;
                Taboo.RaiseBeforeStatChangedEvent += Send;
                Compulsion.RaiseBeforeStatChangedEvent += Send;
                SkillDisabled.RaiseBeforeStatChangedEvent += Send;
                ClanItemType.RaiseBeforeStatChangedEvent += Send;
                ClanItemInstance.RaiseBeforeStatChangedEvent += Send;
                DebuffFormula.RaiseBeforeStatChangedEvent += Send;
                PvP_Rating.RaiseBeforeStatChangedEvent += Send;
                SavedXP.RaiseBeforeStatChangedEvent += Send;
                DoorBlockTime.RaiseBeforeStatChangedEvent += Send;
                OverrideTexture.RaiseBeforeStatChangedEvent += Send;
                OverrideMaterial.RaiseBeforeStatChangedEvent += Send;
                DeathReason.RaiseBeforeStatChangedEvent += Send;
                DamageOverrideType.RaiseBeforeStatChangedEvent += Send;
                BrainType.RaiseBeforeStatChangedEvent += Send;
                XPBonus.RaiseBeforeStatChangedEvent += Send;
                HealInterval.RaiseBeforeStatChangedEvent += Send;
                HealDelta.RaiseBeforeStatChangedEvent += Send;
                MonsterTexture.RaiseBeforeStatChangedEvent += Send;
                HasAlwaysLootable.RaiseBeforeStatChangedEvent += Send;
                TradeLimit.RaiseBeforeStatChangedEvent += Send;
                FaceTexture.RaiseBeforeStatChangedEvent += Send;
                SpecialCondition.RaiseBeforeStatChangedEvent += Send;
                AutoAttackFlags.RaiseBeforeStatChangedEvent += Send;
                NextXP.RaiseBeforeStatChangedEvent += Send;
                TeleportPauseMilliSeconds.RaiseBeforeStatChangedEvent += Send;
                SISCap.RaiseBeforeStatChangedEvent += Send;
                AnimSet.RaiseBeforeStatChangedEvent += Send;
                AttackType.RaiseBeforeStatChangedEvent += Send;
                NanoFocusLevel.RaiseBeforeStatChangedEvent += Send;
                NPCHash.RaiseBeforeStatChangedEvent += Send;
                CollisionRadius.RaiseBeforeStatChangedEvent += Send;
                OuterRadius.RaiseBeforeStatChangedEvent += Send;
                MonsterData.RaiseBeforeStatChangedEvent += Send;
                MonsterScale.RaiseBeforeStatChangedEvent += Send;
                HitEffectType.RaiseBeforeStatChangedEvent += Send;
                ResurrectDest.RaiseBeforeStatChangedEvent += Send;
                NanoInterval.RaiseBeforeStatChangedEvent += Send;
                NanoDelta.RaiseBeforeStatChangedEvent += Send;
                ReclaimItem.RaiseBeforeStatChangedEvent += Send;
                GatherEffectType.RaiseBeforeStatChangedEvent += Send;
                VisualBreed.RaiseBeforeStatChangedEvent += Send;
                VisualProfession.RaiseBeforeStatChangedEvent += Send;
                VisualSex.RaiseBeforeStatChangedEvent += Send;
                RitualTargetInst.RaiseBeforeStatChangedEvent += Send;
                SkillTimeOnSelectedTarget.RaiseBeforeStatChangedEvent += Send;
                LastSaveXP.RaiseBeforeStatChangedEvent += Send;
                ExtendedTime.RaiseBeforeStatChangedEvent += Send;
                BurstRecharge.RaiseBeforeStatChangedEvent += Send;
                FullAutoRecharge.RaiseBeforeStatChangedEvent += Send;
                GatherAbstractAnim.RaiseBeforeStatChangedEvent += Send;
                CastTargetAbstractAnim.RaiseBeforeStatChangedEvent += Send;
                CastSelfAbstractAnim.RaiseBeforeStatChangedEvent += Send;
                CriticalIncrease.RaiseBeforeStatChangedEvent += Send;
                RangeIncreaserWeapon.RaiseBeforeStatChangedEvent += Send;
                RangeIncreaserNF.RaiseBeforeStatChangedEvent += Send;
                SkillLockModifier.RaiseBeforeStatChangedEvent += Send;
                InterruptModifier.RaiseBeforeStatChangedEvent += Send;
                ACGEntranceStyles.RaiseBeforeStatChangedEvent += Send;
                ChanceOfBreakOnSpellAttack.RaiseBeforeStatChangedEvent += Send;
                ChanceOfBreakOnDebuff.RaiseBeforeStatChangedEvent += Send;
                DieAnim.RaiseBeforeStatChangedEvent += Send;
                TowerType.RaiseBeforeStatChangedEvent += Send;
                Expansion.RaiseBeforeStatChangedEvent += Send;
                LowresMesh.RaiseBeforeStatChangedEvent += Send;
                CriticalDecrease.RaiseBeforeStatChangedEvent += Send;
                OldTimeExist.RaiseBeforeStatChangedEvent += Send;
                ResistModifier.RaiseBeforeStatChangedEvent += Send;
                ChestFlags.RaiseBeforeStatChangedEvent += Send;
                PrimaryTemplateID.RaiseBeforeStatChangedEvent += Send;
                NumberOfItems.RaiseBeforeStatChangedEvent += Send;
                SelectedTargetType.RaiseBeforeStatChangedEvent += Send;
                Corpse_Hash.RaiseBeforeStatChangedEvent += Send;
                AmmoName.RaiseBeforeStatChangedEvent += Send;
                Rotation.RaiseBeforeStatChangedEvent += Send;
                CATAnim.RaiseBeforeStatChangedEvent += Send;
                CATAnimFlags.RaiseBeforeStatChangedEvent += Send;
                DisplayCATAnim.RaiseBeforeStatChangedEvent += Send;
                DisplayCATMesh.RaiseBeforeStatChangedEvent += Send;
                School.RaiseBeforeStatChangedEvent += Send;
                NanoSpeed.RaiseBeforeStatChangedEvent += Send;
                NanoPoints.RaiseBeforeStatChangedEvent += Send;
                TrainSkill.RaiseBeforeStatChangedEvent += Send;
                TrainSkillCost.RaiseBeforeStatChangedEvent += Send;
                IsFightingMe.RaiseBeforeStatChangedEvent += Send;
                NextFormula.RaiseBeforeStatChangedEvent += Send;
                MultipleCount.RaiseBeforeStatChangedEvent += Send;
                EffectType.RaiseBeforeStatChangedEvent += Send;
                ImpactEffectType.RaiseBeforeStatChangedEvent += Send;
                CorpseType.RaiseBeforeStatChangedEvent += Send;
                CorpseInstance.RaiseBeforeStatChangedEvent += Send;
                CorpseAnimKey.RaiseBeforeStatChangedEvent += Send;
                UnarmedTemplateInstance.RaiseBeforeStatChangedEvent += Send;
                TracerEffectType.RaiseBeforeStatChangedEvent += Send;
                AmmoType.RaiseBeforeStatChangedEvent += Send;
                CharRadius.RaiseBeforeStatChangedEvent += Send;
                ChanceOfUse.RaiseBeforeStatChangedEvent += Send;
                CurrentState.RaiseBeforeStatChangedEvent += Send;
                ArmourType.RaiseBeforeStatChangedEvent += Send;
                RestModifier.RaiseBeforeStatChangedEvent += Send;
                BuyModifier.RaiseBeforeStatChangedEvent += Send;
                SellModifier.RaiseBeforeStatChangedEvent += Send;
                CastEffectType.RaiseBeforeStatChangedEvent += Send;
                NPCBrainState.RaiseBeforeStatChangedEvent += Send;
                WaitState.RaiseBeforeStatChangedEvent += Send;
                SelectedTarget.RaiseBeforeStatChangedEvent += Send;
                MissionBits4.RaiseBeforeStatChangedEvent += Send;
                OwnerInstance.RaiseBeforeStatChangedEvent += Send;
                CharState.RaiseBeforeStatChangedEvent += Send;
                ReadOnly.RaiseBeforeStatChangedEvent += Send;
                DamageType.RaiseBeforeStatChangedEvent += Send;
                CollideCheckInterval.RaiseBeforeStatChangedEvent += Send;
                PlayfieldType.RaiseBeforeStatChangedEvent += Send;
                NPCCommand.RaiseBeforeStatChangedEvent += Send;
                InitiativeType.RaiseBeforeStatChangedEvent += Send;
                CharTmp1.RaiseBeforeStatChangedEvent += Send;
                CharTmp2.RaiseBeforeStatChangedEvent += Send;
                CharTmp3.RaiseBeforeStatChangedEvent += Send;
                CharTmp4.RaiseBeforeStatChangedEvent += Send;
                NPCCommandArg.RaiseBeforeStatChangedEvent += Send;
                NameTemplate.RaiseBeforeStatChangedEvent += Send;
                DesiredTargetDistance.RaiseBeforeStatChangedEvent += Send;
                VicinityRange.RaiseBeforeStatChangedEvent += Send;
                NPCIsSurrendering.RaiseBeforeStatChangedEvent += Send;
                StateMachine.RaiseBeforeStatChangedEvent += Send;
                NPCSurrenderInstance.RaiseBeforeStatChangedEvent += Send;
                NPCHasPatrolList.RaiseBeforeStatChangedEvent += Send;
                NPCVicinityChars.RaiseBeforeStatChangedEvent += Send;
                ProximityRangeOutdoors.RaiseBeforeStatChangedEvent += Send;
                NPCFamily.RaiseBeforeStatChangedEvent += Send;
                CommandRange.RaiseBeforeStatChangedEvent += Send;
                NPCHatelistSize.RaiseBeforeStatChangedEvent += Send;
                NPCNumPets.RaiseBeforeStatChangedEvent += Send;
                ODMinSizeAdd.RaiseBeforeStatChangedEvent += Send;
                EffectRed.RaiseBeforeStatChangedEvent += Send;
                EffectGreen.RaiseBeforeStatChangedEvent += Send;
                EffectBlue.RaiseBeforeStatChangedEvent += Send;
                ODMaxSizeAdd.RaiseBeforeStatChangedEvent += Send;
                DurationModifier.RaiseBeforeStatChangedEvent += Send;
                NPCCryForHelpRange.RaiseBeforeStatChangedEvent += Send;
                LOSHeight.RaiseBeforeStatChangedEvent += Send;
                PetReq1.RaiseBeforeStatChangedEvent += Send;
                PetReq2.RaiseBeforeStatChangedEvent += Send;
                PetReq3.RaiseBeforeStatChangedEvent += Send;
                MapOptions.RaiseBeforeStatChangedEvent += Send;
                MapAreaPart1.RaiseBeforeStatChangedEvent += Send;
                MapAreaPart2.RaiseBeforeStatChangedEvent += Send;
                FixtureFlags.RaiseBeforeStatChangedEvent += Send;
                FallDamage.RaiseBeforeStatChangedEvent += Send;
                ReflectReturnedProjectileAC.RaiseBeforeStatChangedEvent += Send;
                ReflectReturnedMeleeAC.RaiseBeforeStatChangedEvent += Send;
                ReflectReturnedEnergyAC.RaiseBeforeStatChangedEvent += Send;
                ReflectReturnedChemicalAC.RaiseBeforeStatChangedEvent += Send;
                ReflectReturnedRadiationAC.RaiseBeforeStatChangedEvent += Send;
                ReflectReturnedColdAC.RaiseBeforeStatChangedEvent += Send;
                ReflectReturnedNanoAC.RaiseBeforeStatChangedEvent += Send;
                ReflectReturnedFireAC.RaiseBeforeStatChangedEvent += Send;
                ReflectReturnedPoisonAC.RaiseBeforeStatChangedEvent += Send;
                ProximityRangeIndoors.RaiseBeforeStatChangedEvent += Send;
                PetReqVal1.RaiseBeforeStatChangedEvent += Send;
                PetReqVal2.RaiseBeforeStatChangedEvent += Send;
                PetReqVal3.RaiseBeforeStatChangedEvent += Send;
                TargetFacing.RaiseBeforeStatChangedEvent += Send;
                Backstab.RaiseBeforeStatChangedEvent += Send;
                OriginatorType.RaiseBeforeStatChangedEvent += Send;
                QuestInstance.RaiseBeforeStatChangedEvent += Send;
                QuestIndex1.RaiseBeforeStatChangedEvent += Send;
                QuestIndex2.RaiseBeforeStatChangedEvent += Send;
                QuestIndex3.RaiseBeforeStatChangedEvent += Send;
                QuestIndex4.RaiseBeforeStatChangedEvent += Send;
                QuestIndex5.RaiseBeforeStatChangedEvent += Send;
                QTDungeonInstance.RaiseBeforeStatChangedEvent += Send;
                QTNumMonsters.RaiseBeforeStatChangedEvent += Send;
                QTKilledMonsters.RaiseBeforeStatChangedEvent += Send;
                AnimPos.RaiseBeforeStatChangedEvent += Send;
                AnimPlay.RaiseBeforeStatChangedEvent += Send;
                AnimSpeed.RaiseBeforeStatChangedEvent += Send;
                QTKillNumMonsterID1.RaiseBeforeStatChangedEvent += Send;
                QTKillNumMonsterCount1.RaiseBeforeStatChangedEvent += Send;
                QTKillNumMonsterID2.RaiseBeforeStatChangedEvent += Send;
                QTKillNumMonsterCount2.RaiseBeforeStatChangedEvent += Send;
                QTKillNumMonsterID3.RaiseBeforeStatChangedEvent += Send;
                QTKillNumMonsterCount3.RaiseBeforeStatChangedEvent += Send;
                QuestIndex0.RaiseBeforeStatChangedEvent += Send;
                QuestTimeout.RaiseBeforeStatChangedEvent += Send;
                Tower_NPCHash.RaiseBeforeStatChangedEvent += Send;
                PetType.RaiseBeforeStatChangedEvent += Send;
                OnTowerCreation.RaiseBeforeStatChangedEvent += Send;
                OwnedTowers.RaiseBeforeStatChangedEvent += Send;
                TowerInstance.RaiseBeforeStatChangedEvent += Send;
                AttackShield.RaiseBeforeStatChangedEvent += Send;
                SpecialAttackShield.RaiseBeforeStatChangedEvent += Send;
                NPCVicinityPlayers.RaiseBeforeStatChangedEvent += Send;
                NPCUseFightModeRegenRate.RaiseBeforeStatChangedEvent += Send;
                Rnd.RaiseBeforeStatChangedEvent += Send;
                SocialStatus.RaiseBeforeStatChangedEvent += Send;
                LastRnd.RaiseBeforeStatChangedEvent += Send;
                ItemDelayCap.RaiseBeforeStatChangedEvent += Send;
                RechargeDelayCap.RaiseBeforeStatChangedEvent += Send;
                PercentRemainingHealth.RaiseBeforeStatChangedEvent += Send;
                PercentRemainingNano.RaiseBeforeStatChangedEvent += Send;
                TargetDistance.RaiseBeforeStatChangedEvent += Send;
                TeamCloseness.RaiseBeforeStatChangedEvent += Send;
                NumberOnHateList.RaiseBeforeStatChangedEvent += Send;
                ConditionState.RaiseBeforeStatChangedEvent += Send;
                ExpansionPlayfield.RaiseBeforeStatChangedEvent += Send;
                ShadowBreed.RaiseBeforeStatChangedEvent += Send;
                NPCFovStatus.RaiseBeforeStatChangedEvent += Send;
                DudChance.RaiseBeforeStatChangedEvent += Send;
                HealMultiplier.RaiseBeforeStatChangedEvent += Send;
                NanoDamageMultiplier.RaiseBeforeStatChangedEvent += Send;
                NanoVulnerability.RaiseBeforeStatChangedEvent += Send;
                AmsCap.RaiseBeforeStatChangedEvent += Send;
                ProcInitiative1.RaiseBeforeStatChangedEvent += Send;
                ProcInitiative2.RaiseBeforeStatChangedEvent += Send;
                ProcInitiative3.RaiseBeforeStatChangedEvent += Send;
                ProcInitiative4.RaiseBeforeStatChangedEvent += Send;
                FactionModifier.RaiseBeforeStatChangedEvent += Send;
                MissionBits8.RaiseBeforeStatChangedEvent += Send;
                MissionBits9.RaiseBeforeStatChangedEvent += Send;
                StackingLine2.RaiseBeforeStatChangedEvent += Send;
                StackingLine3.RaiseBeforeStatChangedEvent += Send;
                StackingLine4.RaiseBeforeStatChangedEvent += Send;
                StackingLine5.RaiseBeforeStatChangedEvent += Send;
                StackingLine6.RaiseBeforeStatChangedEvent += Send;
                StackingOrder.RaiseBeforeStatChangedEvent += Send;
                ProcNano1.RaiseBeforeStatChangedEvent += Send;
                ProcNano2.RaiseBeforeStatChangedEvent += Send;
                ProcNano3.RaiseBeforeStatChangedEvent += Send;
                ProcNano4.RaiseBeforeStatChangedEvent += Send;
                ProcChance1.RaiseBeforeStatChangedEvent += Send;
                ProcChance2.RaiseBeforeStatChangedEvent += Send;
                ProcChance3.RaiseBeforeStatChangedEvent += Send;
                ProcChance4.RaiseBeforeStatChangedEvent += Send;
                OTArmedForces.RaiseBeforeStatChangedEvent += Send;
                ClanSentinels.RaiseBeforeStatChangedEvent += Send;
                OTMed.RaiseBeforeStatChangedEvent += Send;
                ClanGaia.RaiseBeforeStatChangedEvent += Send;
                OTTrans.RaiseBeforeStatChangedEvent += Send;
                ClanVanguards.RaiseBeforeStatChangedEvent += Send;
                GOS.RaiseBeforeStatChangedEvent += Send;
                OTFollowers.RaiseBeforeStatChangedEvent += Send;
                OTOperator.RaiseBeforeStatChangedEvent += Send;
                OTUnredeemed.RaiseBeforeStatChangedEvent += Send;
                ClanDevoted.RaiseBeforeStatChangedEvent += Send;
                ClanConserver.RaiseBeforeStatChangedEvent += Send;
                ClanRedeemed.RaiseBeforeStatChangedEvent += Send;
                SK.RaiseBeforeStatChangedEvent += Send;
                LastSK.RaiseBeforeStatChangedEvent += Send;
                NextSK.RaiseBeforeStatChangedEvent += Send;
                PlayerOptions.RaiseBeforeStatChangedEvent += Send;
                LastPerkResetTime.RaiseBeforeStatChangedEvent += Send;
                CurrentTime.RaiseBeforeStatChangedEvent += Send;
                ShadowBreedTemplate.RaiseBeforeStatChangedEvent += Send;
                NPCVicinityFamily.RaiseBeforeStatChangedEvent += Send;
                NPCScriptAMSScale.RaiseBeforeStatChangedEvent += Send;
                ApartmentsAllowed.RaiseBeforeStatChangedEvent += Send;
                ApartmentsOwned.RaiseBeforeStatChangedEvent += Send;
                ApartmentAccessCard.RaiseBeforeStatChangedEvent += Send;
                MapAreaPart3.RaiseBeforeStatChangedEvent += Send;
                MapAreaPart4.RaiseBeforeStatChangedEvent += Send;
                NumberOfTeamMembers.RaiseBeforeStatChangedEvent += Send;
                ActionCategory.RaiseBeforeStatChangedEvent += Send;
                CurrentPlayfield.RaiseBeforeStatChangedEvent += Send;
                DistrictNano.RaiseBeforeStatChangedEvent += Send;
                DistrictNanoInterval.RaiseBeforeStatChangedEvent += Send;
                UnsavedXP.RaiseBeforeStatChangedEvent += Send;
                RegainXPPercentage.RaiseBeforeStatChangedEvent += Send;
                TempSaveTeamID.RaiseBeforeStatChangedEvent += Send;
                TempSavePlayfield.RaiseBeforeStatChangedEvent += Send;
                TempSaveX.RaiseBeforeStatChangedEvent += Send;
                TempSaveY.RaiseBeforeStatChangedEvent += Send;
                ExtendedFlags.RaiseBeforeStatChangedEvent += Send;
                ShopPrice.RaiseBeforeStatChangedEvent += Send;
                NewbieHP.RaiseBeforeStatChangedEvent += Send;
                HPLevelUp.RaiseBeforeStatChangedEvent += Send;
                HPPerSkill.RaiseBeforeStatChangedEvent += Send;
                NewbieNP.RaiseBeforeStatChangedEvent += Send;
                NPLevelUp.RaiseBeforeStatChangedEvent += Send;
                NPPerSkill.RaiseBeforeStatChangedEvent += Send;
                MaxShopItems.RaiseBeforeStatChangedEvent += Send;
                PlayerID.RaiseBeforeStatChangedEvent += Send;
                ShopRent.RaiseBeforeStatChangedEvent += Send;
                SynergyHash.RaiseBeforeStatChangedEvent += Send;
                ShopFlags.RaiseBeforeStatChangedEvent += Send;
                ShopLastUsed.RaiseBeforeStatChangedEvent += Send;
                ShopType.RaiseBeforeStatChangedEvent += Send;
                LockDownTime.RaiseBeforeStatChangedEvent += Send;
                LeaderLockDownTime.RaiseBeforeStatChangedEvent += Send;
                InvadersKilled.RaiseBeforeStatChangedEvent += Send;
                KilledByInvaders.RaiseBeforeStatChangedEvent += Send;
                MissionBits10.RaiseBeforeStatChangedEvent += Send;
                MissionBits11.RaiseBeforeStatChangedEvent += Send;
                MissionBits12.RaiseBeforeStatChangedEvent += Send;
                HouseTemplate.RaiseBeforeStatChangedEvent += Send;
                PercentFireDamage.RaiseBeforeStatChangedEvent += Send;
                PercentColdDamage.RaiseBeforeStatChangedEvent += Send;
                PercentMeleeDamage.RaiseBeforeStatChangedEvent += Send;
                PercentProjectileDamage.RaiseBeforeStatChangedEvent += Send;
                PercentPoisonDamage.RaiseBeforeStatChangedEvent += Send;
                PercentRadiationDamage.RaiseBeforeStatChangedEvent += Send;
                PercentEnergyDamage.RaiseBeforeStatChangedEvent += Send;
                PercentChemicalDamage.RaiseBeforeStatChangedEvent += Send;
                TotalDamage.RaiseBeforeStatChangedEvent += Send;
                TrackProjectileDamage.RaiseBeforeStatChangedEvent += Send;
                TrackMeleeDamage.RaiseBeforeStatChangedEvent += Send;
                TrackEnergyDamage.RaiseBeforeStatChangedEvent += Send;
                TrackChemicalDamage.RaiseBeforeStatChangedEvent += Send;
                TrackRadiationDamage.RaiseBeforeStatChangedEvent += Send;
                TrackColdDamage.RaiseBeforeStatChangedEvent += Send;
                TrackPoisonDamage.RaiseBeforeStatChangedEvent += Send;
                TrackFireDamage.RaiseBeforeStatChangedEvent += Send;
                NPCSpellArg1.RaiseBeforeStatChangedEvent += Send;
                NPCSpellRet1.RaiseBeforeStatChangedEvent += Send;
                CityInstance.RaiseBeforeStatChangedEvent += Send;
                DistanceToSpawnpoint.RaiseBeforeStatChangedEvent += Send;
                CityTerminalRechargePercent.RaiseBeforeStatChangedEvent += Send;
                UnreadMailCount.RaiseBeforeStatChangedEvent += Send;
                LastMailCheckTime.RaiseBeforeStatChangedEvent += Send;
                AdvantageHash1.RaiseBeforeStatChangedEvent += Send;
                AdvantageHash2.RaiseBeforeStatChangedEvent += Send;
                AdvantageHash3.RaiseBeforeStatChangedEvent += Send;
                AdvantageHash4.RaiseBeforeStatChangedEvent += Send;
                AdvantageHash5.RaiseBeforeStatChangedEvent += Send;
                ShopIndex.RaiseBeforeStatChangedEvent += Send;
                ShopID.RaiseBeforeStatChangedEvent += Send;
                IsVehicle.RaiseBeforeStatChangedEvent += Send;
                DamageToNano.RaiseBeforeStatChangedEvent += Send;
                AccountFlags.RaiseBeforeStatChangedEvent += Send;
                DamageToNanoMultiplier.RaiseBeforeStatChangedEvent += Send;
                MechData.RaiseBeforeStatChangedEvent += Send;
                VehicleAC.RaiseBeforeStatChangedEvent += Send;
                VehicleDamage.RaiseBeforeStatChangedEvent += Send;
                VehicleHealth.RaiseBeforeStatChangedEvent += Send;
                VehicleSpeed.RaiseBeforeStatChangedEvent += Send;
                BattlestationSide.RaiseBeforeStatChangedEvent += Send;
                VP.RaiseBeforeStatChangedEvent += Send;
                BattlestationRep.RaiseBeforeStatChangedEvent += Send;
                PetState.RaiseBeforeStatChangedEvent += Send;
                PaidPoints.RaiseBeforeStatChangedEvent += Send;
                VisualFlags.RaiseBeforeStatChangedEvent += Send;
                PVPDuelKills.RaiseBeforeStatChangedEvent += Send;
                PVPDuelDeaths.RaiseBeforeStatChangedEvent += Send;
                PVPProfessionDuelKills.RaiseBeforeStatChangedEvent += Send;
                PVPProfessionDuelDeaths.RaiseBeforeStatChangedEvent += Send;
                PVPRankedSoloKills.RaiseBeforeStatChangedEvent += Send;
                PVPRankedSoloDeaths.RaiseBeforeStatChangedEvent += Send;
                PVPRankedTeamKills.RaiseBeforeStatChangedEvent += Send;
                PVPRankedTeamDeaths.RaiseBeforeStatChangedEvent += Send;
                PVPSoloScore.RaiseBeforeStatChangedEvent += Send;
                PVPTeamScore.RaiseBeforeStatChangedEvent += Send;
                PVPDuelScore.RaiseBeforeStatChangedEvent += Send;
                ACGItemSeed.RaiseBeforeStatChangedEvent += Send;
                ACGItemLevel.RaiseBeforeStatChangedEvent += Send;
                ACGItemTemplateID.RaiseBeforeStatChangedEvent += Send;
                ACGItemTemplateID2.RaiseBeforeStatChangedEvent += Send;
                ACGItemCategoryID.RaiseBeforeStatChangedEvent += Send;
                HasKnuBotData.RaiseBeforeStatChangedEvent += Send;
                QuestBoothDifficulty.RaiseBeforeStatChangedEvent += Send;
                QuestASMinimumRange.RaiseBeforeStatChangedEvent += Send;
                QuestASMaximumRange.RaiseBeforeStatChangedEvent += Send;
                VisualLODLevel.RaiseBeforeStatChangedEvent += Send;
                TargetDistanceChange.RaiseBeforeStatChangedEvent += Send;
                TideRequiredDynelID.RaiseBeforeStatChangedEvent += Send;
                StreamCheckMagic.RaiseBeforeStatChangedEvent += Send;
                Type.RaiseBeforeStatChangedEvent += Send;
                Instance.RaiseBeforeStatChangedEvent += Send;
                ShoulderMeshRight.RaiseBeforeStatChangedEvent += Send;
                ShoulderMeshLeft.RaiseBeforeStatChangedEvent += Send;
                WeaponMeshRight.RaiseBeforeStatChangedEvent += Send;
                WeaponMeshLeft.RaiseBeforeStatChangedEvent += Send;
                */
            }

            this.expansion.DoNotDontWriteToSql = true;
            this.accountFlags.DoNotDontWriteToSql = true;
            this.playerId.DoNotDontWriteToSql = true;
            this.professionLevel.DoNotDontWriteToSql = true;
            this.objectType.DoNotDontWriteToSql = true;
            this.instance.DoNotDontWriteToSql = true;
            this.gmLevel.DoNotDontWriteToSql = true;
        }
 public void SetParent(Dynel parent)
 {
     this.parent = parent;
 }
 /// <summary>
 /// Calls a function by its number
 /// </summary>
 /// <param name="functionNumber">
 /// The number of the function
 /// </param>
 /// <param name="self">
 /// The self.
 /// </param>
 /// <param name="caller">
 /// The caller.
 /// </param>
 /// <param name="target">
 /// The target.
 /// </param>
 /// <param name="arguments">
 /// The arguments.
 /// </param>
 /// <returns>
 /// </returns>
 public bool CallFunction(int functionNumber, Dynel self, Dynel caller, object target, object[] arguments)
 {
     FunctionPrototype func = this.GetFunctionByNumber(functionNumber);
     return func.Execute(self, caller, target, arguments);
 }
 public bool FunctionExecute(Dynel Self, Dynel Caller, object Target, object[] Arguments)
 {
     return false;
 }
 /// <summary>
 /// Locks function targets and executes the function
 /// </summary>
 /// <param name="self">Dynel (Character or NPC)</param>
 /// <param name="caller">Caller of the function</param>
 /// <param name="target">Target of the Function (Dynel or Statel)</param>
 /// <param name="arguments">Function Arguments</param>
 /// <returns></returns>
 public abstract bool Execute(Dynel self, Dynel caller, Object target, object[] arguments);
Exemple #51
0
 public bool FunctionExecute(Dynel Self, Dynel Caller, object Target, object[] Arguments)
 {
     return(false);
 }
        public static void Read(byte[] packet, Client client, Dynel dynel)
        {
            PacketReader reader = new PacketReader(packet);
            PacketWriter packetWriter = new PacketWriter();
            Header header = reader.PopHeader();
            reader.PopByte();
            reader.PopInt(); // unknown
            byte action = reader.PopByte(); // unknown
            Identity ident = reader.PopIdentity();
            int container = reader.PopInt();
            int place = reader.PopInt();

            Character character = (Character)FindDynel.FindDynelById(ident.Type, ident.Instance);
            Character chaffected =
                (Character)FindDynel.FindDynelById(header.AffectedId.Type, header.AffectedId.Instance);

            // If target is a NPC, call its Action 0
            if ((character is NonPlayerCharacterClass) && (action == 0))
            {
                if (((NonPlayerCharacterClass)character).KnuBot != null)
                {
                    character.KnuBotTarget = character;
                    ((NonPlayerCharacterClass)character).KnuBot.TalkingTo = chaffected;
                    ((NonPlayerCharacterClass)character).KnuBot.Action(0);
                }
                return;
            }

            int cashDeduct = 0;
            int inventoryCounter;
            InventoryEntries inventoryEntry;

            switch (action)
            {
                case 1: // end trade
                    inventoryCounter = client.Character.Inventory.Count - 1;
                    while (inventoryCounter >= 0)
                    {
                        inventoryEntry = client.Character.Inventory[inventoryCounter];
                        AOItem aoItem;
                        if (inventoryEntry.Container == -1)
                        {
                            int nextFree = client.Character.GetNextFreeInventory(104);
                            aoItem = ItemHandler.GetItemTemplate(inventoryEntry.Item.LowID);
                            int price = aoItem.getItemAttribute(74);
                            int mult = aoItem.getItemAttribute(212); // original multiplecount
                            if (mult == 0)
                            {
                                mult = 1;
                                inventoryEntry.Item.MultipleCount = 1;
                            }
                            // Deduct Cash (ie.item.multiplecount) div mult * price
                            cashDeduct +=
                                Convert.ToInt32(
                                    mult * price
                                    *
                                    (100
                                     - Math.Floor(Math.Min(1500, client.Character.Stats.ComputerLiteracy.Value) / 40.0))
                                    / 2500);
                            // Add the Shop modificator and exchange the CompLit for skill form vendortemplate table
                            inventoryEntry.Placement = nextFree;
                            inventoryEntry.Container = 104;
                            if (!aoItem.isStackable())
                            {
                                int multiplicator = inventoryEntry.Item.MultipleCount;
                                inventoryEntry.Item.MultipleCount = 0;
                                while (multiplicator > 0)
                                {
                                    AddTemplate.Send(client, inventoryEntry);
                                    multiplicator--;
                                }
                            }
                            else
                            {
                                AddTemplate.Send(client, inventoryEntry);
                            }
                        }
                        if (inventoryEntry.Container == -2)
                        {
                            aoItem = ItemHandler.interpolate(
                                inventoryEntry.Item.LowID, inventoryEntry.Item.HighID, inventoryEntry.Item.Quality);
                            double multipleCount = aoItem.getItemAttribute(212); // original multiplecount
                            int price = aoItem.getItemAttribute(74);
                            if (multipleCount == 0.0)
                            {
                                multipleCount = 1.0;
                            }
                            else
                            {
                                multipleCount = inventoryEntry.Item.MultipleCount / multipleCount;
                            }
                            cashDeduct -=
                                Convert.ToInt32(
                                    multipleCount * price
                                    *
                                    (100
                                     + Math.Floor(Math.Min(1500, client.Character.Stats.ComputerLiteracy.Value) / 40.0))
                                    / 2500);
                            // Add the Shop modificator and exchange the CompLit for skill form vendortemplate table
                            client.Character.Inventory.Remove(inventoryEntry);
                        }
                        inventoryCounter--;
                    }

                    client.Character.Stats.Cash.Set((uint)(client.Character.Stats.Cash.Value - cashDeduct));
                    //                    Packets.Stat.Set(client, 61, client.Character.Stats.Cash.StatValue - cashdeduct, false);
                    byte[] reply0 = new byte[32];
                    Array.Copy(packet, reply0, 32);

                    // pushing in server ID
                    reply0[8] = 0;
                    reply0[9] = 0;
                    reply0[10] = 12;
                    reply0[11] = 14;

                    // pushing in Client ID
                    reply0[12] = (byte)(client.Character.Id >> 24);
                    reply0[13] = (byte)(client.Character.Id >> 16);
                    reply0[14] = (byte)(client.Character.Id >> 8);
                    reply0[15] = (byte)(client.Character.Id);

                    packetWriter.PushBytes(reply0);
                    packetWriter.PushByte(1);
                    packetWriter.PushByte(4);
                    packetWriter.PushIdentity(client.Character.LastTrade);
                    packetWriter.PushIdentity(client.Character.LastTrade);
                    client.Character.LastTrade = new Identity { Instance = 0, Type = 0 };

                    byte[] reply2 = packetWriter.Finish();
                    client.SendCompressed(reply2);
                    break;
                case 2:
                    // Decline trade
                    inventoryCounter = client.Character.Inventory.Count - 1;
                    while (inventoryCounter >= 0)
                    {
                        inventoryEntry = client.Character.Inventory[inventoryCounter];
                        if (inventoryEntry.Container == -1)
                        {
                            client.Character.Inventory.Remove(inventoryEntry);
                        }
                        else
                        {
                            if (inventoryEntry.Container == -2)
                            {
                                inventoryEntry.Placement = client.Character.GetNextFreeInventory(104);
                                inventoryEntry.Container = 104;
                            }
                        }
                        inventoryCounter--;
                    }

                    byte[] replyCopy = new byte[50];
                    Array.Copy(packet, replyCopy, 50);

                    // pushing in server ID
                    replyCopy[8] = 0;
                    replyCopy[9] = 0;
                    replyCopy[10] = 12;
                    replyCopy[11] = 14;

                    // pushing in Client ID
                    replyCopy[12] = (byte)(client.Character.Id >> 24);
                    replyCopy[13] = (byte)(client.Character.Id >> 16);
                    replyCopy[14] = (byte)(client.Character.Id >> 8);
                    replyCopy[15] = (byte)(client.Character.Id);

                    packetWriter.PushBytes(replyCopy);
                    byte[] rep1 = packetWriter.Finish();

                    client.SendCompressed(rep1);
                    break;
                case 3:
                    break;
                case 4:
                    break;
                case 5: // add item to trade window
                case 6: // remove item from trade window
                    byte[] reply = new byte[50];
                    Array.Copy(packet, reply, 50);
                    if (character.Inventory.Count == 0)
                    {
                        ((VendingMachine)character).LoadTemplate(((VendingMachine)character).TemplateId);
                    }

                    // pushing in server ID
                    reply[8] = 0;
                    reply[9] = 0;
                    reply[10] = 12;
                    reply[11] = 14;

                    // pushing in Client ID
                    reply[12] = (byte)(client.Character.Id >> 24);
                    reply[13] = (byte)(client.Character.Id >> 16);
                    reply[14] = (byte)(client.Character.Id >> 8);
                    reply[15] = (byte)(client.Character.Id);

                    //PacketWriter pw = new PacketWriter();
                    packetWriter.PushBytes(reply);
                    byte[] replyRemoveItemFromTradeWindow = packetWriter.Finish();
                    client.SendCompressed(replyRemoveItemFromTradeWindow);

                    if (client.Character == character)
                    {
                        if (action == 5)
                        {
                            inventoryEntry = character.GetInventoryAt(place);
                            inventoryEntry.Placement = character.GetNextFreeInventory(-2);
                            inventoryEntry.Container = -2;
                        }
                        if (action == 6)
                        {
                            inventoryEntry = character.GetInventoryAt(place, -2);
                            inventoryEntry.Placement = character.GetNextFreeInventory(104);
                            inventoryEntry.Container = 104;
                        }
                    }
                    else
                    {
                        InventoryEntries inew = new InventoryEntries
                            { Container = -1, Placement = character.GetNextFreeInventory(-1) };
                        int oldPlacement = ((packet[46] >> 24) + (packet[47] >> 16) + (packet[48] >> 8) + packet[49]);
                        InventoryEntries totrade = character.GetInventoryAt(oldPlacement);
                        inew.Item.LowID = totrade.Item.LowID;
                        inew.Item.HighID = totrade.Item.HighID;
                        inew.Item.MultipleCount = totrade.Item.MultipleCount;
                        if (action == 6) // Remove item from trade window
                        {
                            inew.Item.MultipleCount = -inew.Item.MultipleCount;
                        }
                        inew.Item.Quality = totrade.Item.Quality;
                        chaffected.InventoryReplaceAdd(inew);
                    }
                    break;
            }
        }