Exemplo n.º 1
0
        internal Cavebot(Objects.Client c)
        {
            this.Client = c;
            InitializeComponent();
            this.Icon = Properties.Resources.icon;
            this.timerStatusWatcher.Start();

            // set default UI values
            comboboxWaypointsOffset.SelectedIndex = 0;
            comboboxWaypointsType.SelectedIndex = 0;
            comboboxTargetingFightMode.SelectedIndex = 0;
            comboboxTargetingMinCount.SelectedIndex = 0;
            comboboxTargetingSpellRune.SelectedIndex = 0;
            comboboxTargetingStance.SelectedIndex = 0;
            comboboxLootingDestination.SelectedIndex = 1;

            // set default settings
            checkboxSettingsDebugMode.Checked = true;
            checkboxSettingsCanUseMagicRope.Checked = true;
            checkboxSettingsEatFood.Checked = true;
            checkboxSettingsStickToCreature.Checked = true;
            checkboxSettingsStopAttackingWhenOutOfRange.Checked = true;
            checkboxSettingsUseAlternateNodeFinder.Checked = true;

            // set up events
            this.Client.Modules.Cavebot.WaypointAdded += new Modules.Cavebot.WaypointHandler(Cavebot_WaypointAdded);
            this.Client.Modules.Cavebot.WaypointInserted += new Modules.Cavebot.WaypointInsertedHandler(Cavebot_WaypointInserted);
            this.Client.Modules.Cavebot.WaypointRemoved += new Modules.Cavebot.WaypointHandler(Cavebot_WaypointRemoved);
            this.Client.Modules.Cavebot.TargetAdded += new Modules.Cavebot.TargetHandler(Cavebot_TargetAdded);
            this.Client.Modules.Cavebot.TargetRemoved += new Modules.Cavebot.TargetHandler(Cavebot_TargetRemoved);
            this.Client.Modules.Cavebot.LootAdded += new Modules.Cavebot.LootHandler(Cavebot_LootAdded);
            this.Client.Modules.Cavebot.LootRemoved += new Modules.Cavebot.LootHandler(Cavebot_LootRemoved);
            this.Client.Modules.Cavebot.StatusChanged += new Modules.Cavebot.StatusChangedHandler(Cavebot_StatusChanged);
        }
Exemplo n.º 2
0
 public MapGrid(int x, int y, bool walkable, Objects.Location location)
 {
     _x = x;
     _y = y;
     _walkable = walkable;
     _location = location;
 }
Exemplo n.º 3
0
        void element_BeforeRendering(object sender, Objects.RenderEventArgs e)
        {
            vec3 currentVector = this.camera.Position - this.camera.Target;
            vec3 defaultVector = ScientificCamera.defaultPosition - ScientificCamera.defaultTarget;
            currentVector.Normalize();
            defaultVector.Normalize();

            float cosAngle = currentVector.ScalarProduct(defaultVector);// / 1.0f;
            float angle = (float)Math.Acos(cosAngle);
            //vec3 axis = currentVector.VectorProduct(defaultVector);
            vec3 axis = defaultVector.VectorProduct(currentVector);
            //mat4 translate = glm.translate(mat4.identity(), new vec3(0.2f, 0.2f, 0.2f));
            mat4 modelMatrix = glm.rotate(angle, axis);

            //mat4 modelMatrix = mat4.identity();
            mat4 viewMatrix = this.camera.GetViewMat4();
            mat4 projectionMatrix = this.camera.GetProjectionMat4();

            ShaderProgram shaderProgram = element.shaderProgram;
            shaderProgram.Bind();

            shaderProgram.SetUniformMatrix4(PyramidElement.strprojectionMatrix, projectionMatrix.to_array());
            shaderProgram.SetUniformMatrix4(PyramidElement.strviewMatrix, viewMatrix.to_array());
            shaderProgram.SetUniformMatrix4(PyramidElement.strmodelMatrix, modelMatrix.to_array());
        }
Exemplo n.º 4
0
		public override void Update(Objects.View3D view)
		{
			base.Update(view);

			SlimDX.Direct3D11.DeviceContext context = GameEnvironment.Device.ImmediateContext; 

			//DataStream stream = Instances.Map(MapMode.WriteDiscard, SlimDX.Direct3D11.MapFlags.None);

			DataBox box = context.MapSubresource(Instances, MapMode.WriteDiscard, MapFlags.None);
			DataStream stream = box.Data; 

			Random rand = new Random();

			float Dist = 300f;
			float HalfDist = Dist * 0.5f;

			for (int i = 0; i < MaxCount; i++)
			{
				stream.Write(new StarInstanceVertex()
				{
					Color = new Vector4((float)rand.NextDouble(), (float)rand.NextDouble(), (float)rand.NextDouble(), (float)rand.NextDouble()),
					Position = new Vector3((float)(rand.NextDouble() * Dist) - HalfDist,
											(float)(rand.NextDouble() * Dist) - HalfDist,
											(float)(rand.NextDouble() * Dist) - HalfDist)
				});

			}

			this.InstanceCount = MaxCount; 

			//Instances.Unmap(); 
			context.UnmapSubresource(Instances, 0); 
		}
Exemplo n.º 5
0
        internal static void CastAoe(string parSpellName, Objects.Location parSpellPos)
        {
            lock (Inject.inject_Lock)
            {
                DoString("CastSpellByName('" + parSpellName + "')");

                uint posStruc = BmWrapper.memory.AllocateMemory(12);

                if (posStruc != 0)
                {
                    bool b1 = BmWrapper.memory.WriteFloat(posStruc, parSpellPos.x);
                    bool b2 = BmWrapper.memory.WriteFloat(posStruc + 4, parSpellPos.y);
                    bool b3 = BmWrapper.memory.WriteFloat(posStruc + 8, parSpellPos.z);

                    if (b1 && b2 && b3)
                    {

                        // Write the asm stuff for Lua_DoString
                        String[] asm = new String[]
                        {
                            "mov eax, 0x40",
                            "mov [0xCECAC0], eax",

                            "mov eax, [" + Inject.PlayerPtr + "]",
                            "mov ecx, " + (uint)posStruc,
                            "call " + (uint)0x6E60F0,
                            "retn",
                        };
                        Inject.InjectAndExecute(asm, true);
                    }
                    BmWrapper.memory.FreeMemory(posStruc);
                }
            }
        }
Exemplo n.º 6
0
		public static void Get(Objects.User user, Action<Objects.User> callback)
		{
			var parameters = new Dictionary<string, string>();
			if(user.Name != null && user.Name != string.Empty)
			{
				parameters.Add ("username", user.Name.ToLower());
			}
			else if (user.ID != 0)
			{
				parameters.Add ("user_id", user.ID.ToString());
			}

			Core.Request.Get(Constants.API_USERS_FETCH, parameters, (Core.Response response) => {
				if(response.success)
				{
					user.BulkUpdate(response.json["users"][0].AsObject);
				}
				else
				{
					user = null;
				}

				if (callback != null)
				{
					callback(user);
				}
			}, false);
		}
Exemplo n.º 7
0
        public TurnPacket(Objects.Client c, Constants.Direction direction)
            : base(c)
        {
            Direction = direction;

            switch (direction)
            {
                case Tibia.Constants.Direction.Down:
                    Type = OutgoingPacketType.TurnDown;
                    break;
                case Tibia.Constants.Direction.Up:
                    Type = OutgoingPacketType.TurnUp;
                    break;
                case Tibia.Constants.Direction.Right:
                    Type = OutgoingPacketType.TurnRight;
                    break;
                case Tibia.Constants.Direction.Left:
                    Type = OutgoingPacketType.TurnLeft;
                    break;
                default:
                    throw new ArgumentOutOfRangeException(
                        "direction",
                        "Valid directions for turning are Up, Right, Down, and Left.");
            }

            Destination = PacketDestination.Server;
        }
Exemplo n.º 8
0
 public NetworkMessage(Objects.Client client, int size)
 {
     bufferSize = size;
     buffer = new byte[bufferSize];
     Client = client;
     position = GetPacketHeaderSize() + 2;
 }
Exemplo n.º 9
0
 public mainProcess(Objects.UserObject cUser,ref  List<Objects.MsgObject> list)
 {
     currentUser = cUser;
     mainProcess._globalMsgList = list;
     string userName = currentUser.FirstName + " " + currentUser.LastName;
     chatRobot = new msgCenter.Operators.ChatRobotOperator(userName);
 }
Exemplo n.º 10
0
        void legacyUIRect_BeforeRendering(object sender, Objects.RenderEventArgs e)
        {
            LegacySimpleUIRect element = sender as LegacySimpleUIRect;

            IUILayoutArgs args = element.GetArgs();

            GL.MatrixMode(GL.GL_PROJECTION);
            GL.PushMatrix();
            GL.LoadIdentity();
            GL.Ortho((float)args.left, (float)args.right, (float)args.bottom, (float)args.top, element.Param.zNear, element.Param.zFar);
            //GL.Ortho(args.left / 2, args.right / 2, args.bottom / 2, args.top / 2, element.Param.zNear, element.Param.zFar);

            IViewCamera camera = e.Camera;

            if (camera == null)
            {
                GL.gluLookAt(0, 0, 1, 0, 0, 0, 0, 1, 0);
                //throw new Exception("Camera not set!");
            }
            else
            {
                vec3 position = camera.Position - camera.Target;
                position.Normalize();
                GL.gluLookAt(position.x, position.y, position.z,
                    0, 0, 0,
                    camera.UpVector.x, camera.UpVector.y, camera.UpVector.z);
            }

            GL.MatrixMode(GL.GL_MODELVIEW);
            GL.PushMatrix();
            GL.Scale(args.UIWidth / 2, args.UIHeight / 2, args.UIWidth);

        }
Exemplo n.º 11
0
 public static bool Send(Objects.Client client, PipeConstantType constantType, uint value)
 {
     SetConstantPacket p = new SetConstantPacket(client);
     p.ConstantType = constantType;
     p.Value = value;
     return p.Send();
 }
Exemplo n.º 12
0
        static void Main(string[] args)
        {
            //Console
            int speed = 100;
            int playFieldWidth = 15;
            Console.BufferHeight = Console.WindowHeight = 30;
            Console.BufferWidth = Console.WindowWidth = 35;

            Objects userDwarf = new Objects();
            userDwarf.x = 2;
            userDwarf.y = Console.WindowHeight - 1;
            userDwarf.c = '@';
            userDwarf.color = ConsoleColor.White;

            List<Objects> objectss = new List<Objects>();
            Random randomGenerator = new Random();

            while (true)
            {
                if (speed >= 400)
                {
                    speed = 400;
                }
                Objects newEnemy = new Objects();
                newEnemy.color = ConsoleColor.Green;
                newEnemy.x = randomGenerator.Next(0, playFieldWidth); // 0-5
                newEnemy.y = 0; // poqvqva se nai-otgore
                newEnemy.c = '#';
                // newCar.c = randomGenerator.Next(randomKoli4ki[0],randomKoli4ki[duljina]);
                objectss.Add(newEnemy);
            }
        }
Exemplo n.º 13
0
        public static void tryCaptureTower(Objects.playerObject player)
        {
            List<Grid.GridObjectInterface> list = GameController.Grid.checkNeighbouringBlocks(player);

            foreach (Grid.GridObjectInterface item in list)
            {
                if (item is Objects.Turret && (item.Position - player.Position).Length() <= MAX_CAPTURE_DISTANCE)
                {
                    Objects.Turret turret = ((Objects.Turret)item);
                    if (turret.Team.Equals(Objects.Team.neutral))
                    {
                        turret.changeTeam(player.Team);
                        GameController.AIController.registerTurretOnTeam(turret, player.Team);
                        if (player.Team == Objects.Team.Red)
                        {
                            Controller.GameController.Team1Gold.Add(TradingInformation.creditsForCapturingTower.ToString());
                            Controller.GameController.team1.teamCredits += TradingInformation.creditsForCapturingTower;
                        }
                        else
                        {
                            Controller.GameController.Team2Gold.Add(TradingInformation.creditsForCapturingTower.ToString());
                            Controller.GameController.team2.teamCredits += TradingInformation.creditsForCapturingTower;
                        }
                        break;
                    }
                }
            }
        }
Exemplo n.º 14
0
 /// <summary>
 /// Constructor for an item in the player's inventory.
 /// </summary>
 /// <param name="item"></param>
 public ItemLocation(Objects.Item item)
 {
     this.WorldLocation = item.ToLocation();
     this.ItemID = item.ID;
     this.ItemCount = item.Count;
     this.StackIndex = item.Slot;
 }
Exemplo n.º 15
0
 public NetworkMessage(Objects.Client client, byte[] data, int length)
 {
     buffer = new byte[bufferSize];
     Client = client;
     Array.Copy(data, buffer, length);
     this.length = length;
     position = 0;
 }
Exemplo n.º 16
0
        public static bool Send(Objects.Client client, EventType eventType)
        {
            EventTriggerPacket p = new EventTriggerPacket(client);

            p.eventType = eventType;

            return p.Send();
        }
		void Mapper( Objects.ClassWithProperties instance )
		{
			var mapped = instance.MapInto<ClassWithProperties>();
			Assert.Equal( instance.PropertyOne, mapped.PropertyOne );
			Assert.Equal( instance.PropertyTwo, mapped.PropertyTwo );
			Assert.Equal( instance.PropertyThree, mapped.PropertyThree );
			Assert.Equal( instance.PropertyFour, mapped.PropertyFour );
		}
Exemplo n.º 18
0
 public void Feed(Objects.Data data)
 {
     // thread safe
     mutex.WaitOne();
     foreach (SubscriptionRegistration registration in registrations.Values)
         registration.Notify(data);
     mutex.ReleaseMutex();
 }
Exemplo n.º 19
0
 public Projectile(Game game, Objects.Enemy target, int level)
     : base(game)
 {
     m_ModelName = "Projectiles/Sphere";
     Scale = 0.05f;
     m_Target = target;
     m_Level = level;
 }
Exemplo n.º 20
0
 public static Image GetSpriteImage(Objects.Client client, int spriteId)
 {
     return GetSpriteImage(
         Path.Combine(
             Path.GetDirectoryName(client.Process.MainModule.FileName),
             "Pokemon.spr"),
         spriteId);
 }
Exemplo n.º 21
0
 public NetworkMessage(Objects.Client client, byte[] data)
 {
     buffer = new byte[bufferSize];
     Client = client;
     Array.Copy(data, buffer, data.Length);
     length = data.Length;
     position = 0;
 }
Exemplo n.º 22
0
 public static bool SessionCheck(Objects.Gebruiker g)
 {
     if (!SQLInjectionCheck(g.GebruikersNaam) || !SQLInjectionCheck(g.WachtWoord) || g.GebruikersNaam == "" || g.WachtWoord == "" || g.GebruikersNaam.Length < 8 || g.WachtWoord.Length < 8)
     {
         return false;
     }
     return true;
 }
Exemplo n.º 23
0
        void element_AfterRendering(object sender, Objects.RenderEventArgs e)
        {
            GL.MatrixMode(GL.GL_MODELVIEW);
            GL.PopMatrix();

            GL.MatrixMode(GL.GL_PROJECTION);
            GL.PopMatrix();
        }
Exemplo n.º 24
0
 /// <summary>
 /// Constructor for a tile.
 /// </summary>
 /// <param name="address">This tile's memory address.</param>
 /// <param name="tileNumber">This tile's index number.</param>
 /// <param name="objects">A list of tile objects.</param>
 /// <param name="location">This tile's world location.</param>
 public Tile(Objects.Client client, int address, int tileNumber, IEnumerable<TileObject> objects, Objects.Location location)
 {
     this.Client = client;
     this.Address = address;
     this.TileNumber = tileNumber;
     this.Objects = objects.ToList();
     this.WorldLocation = location;
 }
Exemplo n.º 25
0
 public void AnnounceTierTypeUpgrade(Objects.Avatar avatar, int nextTier, int cost)
 {
     foreach (var ep in server.EPToPlayer.Keys)
     {
         var p = server.EPToPlayer[ep];
         if (p.Team.Id == avatar.Team)
             server.NetworkOut.AnnounceTierTypeUpgrade(ep, nextTier != -1 ? "Tier " + nextTier : "", cost);
     }
 }
Exemplo n.º 26
0
 public void AnnounceTierTypeChoice(Objects.Avatar avatar)
 {
     foreach (var ep in server.EPToPlayer.Keys)
     {
         var p = server.EPToPlayer[ep];
         if (p.Team.Id == avatar.Team)
             server.NetworkOut.AnnounceTierTypeChoice(p.Endpoint);
     }
 }
Exemplo n.º 27
0
 public MapViewer(Objects.Client c)
 {
     this.Client = c;
     string dir = c.TibiaProcess.MainModule.FileName;
     this.TibiaDirectory = dir.Substring(0, dir.LastIndexOf("\\") + 1);
     this.TibiaDirectory += this.TibiaDirectory.EndsWith("\\") ? string.Empty : "\\";
     this.CacheDirectory = "mapfiledata";
     this.Location = (this.Client.Player.Connected ? this.Client.Player.Location : new Objects.Location());
 }
Exemplo n.º 28
0
		static void ShowNotification(Objects.Trophy trophy)
		{
			if (trophy.Unlocked)
			{
				GameJolt.UI.Manager.Instance.QueueNotification(
					string.Format("Unlocked <b>#{0}</b>", trophy.Title),
					trophy.Image);
			}
		}
Exemplo n.º 29
0
 public void Notify(Objects.Data data)
 {
     if (data == null)
         throw new ArgumentNullException();
     if (subscription.Status != SubscriptionStatus.Running)
         return;
     if (data.Device == subscription.Device && (data.Service & subscription.Service) > 0)
         session.ClientEventEnqueue(new ClientEvent { Guid = subscription.Guid, Data = data, Type = ClientEventType.SubscriptionNotification, Timestamp = DateTime.Now });
 }
Exemplo n.º 30
0
 public MergedChunk(Objects.Client client, Objects.Location worldLocation, Node[,] nodes)
 {
     this.Client = client;
     this.WorldLocation = worldLocation;
     this.MiniMapLocation = new Location(this.WorldLocation.X / this.Client.Addresses.MiniMap.WorldLocationMultiplier,
         this.WorldLocation.Y / this.Client.Addresses.MiniMap.WorldLocationMultiplier, this.WorldLocation.Z);
     this.Nodes = nodes;
     this.Type = ChunkTypes.Merged;
 }