Exemplo n.º 1
0
        public Hero(GameClient client, Universe universe, Toon toon)
        {
            this.InGameClient = client;
            this.Universe = universe;
            this.Properties = toon;
            this.CurrentWorldSNO = 0x115EE;

            // actor values
            this.Id = 0x789E00E2;
            this.SnoId = this.ClassSNO;
            this.WorldId = 0x772E0000;
            this.Field2 = 0x00000009;
            this.Field3 = 0x00000000;
            this.Scale = ModelScale;
            this.RotationAmount = 0.05940768f;
            this.RotationAxis = new Vector3D(0f, 0f, 0.9982339f);
            this.Position.X = 3143.75f;
            this.Position.Y = 2828.75f;
            this.Position.Z = 59.075588f;

            this.GBHandle = new GBHandle()
            {
                Field0 = 0x00000007,
                Field1 = this.Properties.ClassID,
            };

            this.Field7 = -1;
            this.Field8 = -1;
            this.Field9 = 0x00000000;
            this.Field10 = 0x0;
        }
Exemplo n.º 2
0
        public static void DeleteToon(Toon toon)
        {
            if (!Toons.ContainsKey(toon.PersistentID))
            {
                Logger.Error("Attempting to delete toon that does not exist: {0}", toon.PersistentID);
                return;
            }

            if (toon.DeleteFromDB()) Toons.Remove(toon.PersistentID);
        }
Exemplo n.º 3
0
        public override void CreateToon(Google.ProtocolBuffers.IRpcController controller, CreateToonRequest request, Action<CreateToonResponse> done)
        {
            Logger.Trace("CreateToon()");
            var heroCreateParams = D3.OnlineService.HeroCreateParams.ParseFrom(request.AttributeList[0].Value.MessageValue);
            var builder = CreateToonResponse.CreateBuilder();

            var toon = new Toon(request.Name, heroCreateParams.GbidClass, heroCreateParams.IsFemale ? ToonFlags.Female : ToonFlags.Male, 1, Client.Account);
            if (ToonManager.SaveToon(toon)) builder.SetToon(toon.BnetEntityID);
            done(builder.Build());
        }
Exemplo n.º 4
0
        public static bool SaveToon(Toon toon)
        {
            if(Toons.ContainsKey(toon.PersistentID))
            {
                Logger.Error("Duplicate persistent toon id: {0}", toon.PersistentID);
                return false;
            }

            Toons.Add(toon.PersistentID, toon);
            toon.SaveToDB();
            return true;
        }
Exemplo n.º 5
0
        public static bool SaveToon(Toon toon)
        {
            if (Toons.ContainsKey(toon.PersistentID))
            {
                Logger.Error("Duplicate persistent toon id: {0}", toon.PersistentID);
                return(false);
            }

            Toons.Add(toon.PersistentID, toon);
            toon.SaveToDB();
            return(true);
        }
Exemplo n.º 6
0
        public static void DeleteToon(Toon toon)
        {
            if (!Toons.ContainsKey(toon.PersistentID))
            {
                Logger.Error("Attempting to delete toon that does not exist: {0}", toon.PersistentID);
                return;
            }

            if (toon.DeleteFromDB())
            {
                Toons.Remove(toon.PersistentID);
            }
        }
Exemplo n.º 7
0
        private static void LoadToons()
        {
            var query  = "SELECT * from toons";
            var cmd    = new SQLiteCommand(query, DBManager.Connection);
            var reader = cmd.ExecuteReader();

            if (!reader.HasRows)
            {
                return;
            }

            while (reader.Read())
            {
                var databaseId = (ulong)reader.GetInt64(0);
                var toon       = new Toon(databaseId, reader.GetString(1), reader.GetByte(2), reader.GetByte(3), reader.GetByte(4), reader.GetInt64(5));
                Toons.Add(databaseId, toon);
            }
        }
Exemplo n.º 8
0
 public Player(GameClient client, Universe universe, Toon bnetToon)
 {
     this.Client = client;
     this.Universe = universe;
     this.Hero = new Hero(client, universe, bnetToon);
 }
Exemplo n.º 9
0
        public Hero(GameClient client, Universe universe, Toon toon)
        {
            RevealedWorlds = new List<World>();
            RevealedScenes = new List<Scene>();
            RevealedActors = new List<Actor>();

            this.InGameClient = client;
            this.Universe = universe;
            this.Properties = toon;
            this.CurrentWorldSNO = 0x115EE;

            // actor values
            this.Id = 0x789E00E2;
            this.SnoId = this.ClassSNO;
            this.Field2 = 0x00000009;
            this.Field3 = 0x00000000;
            this.Scale = ModelScale;
            this.RotationAmount = 0.05940768f;
            this.RotationAxis = new Vector3D(0f, 0f, 0.9982339f);
            
            //initial world and position
            this.WorldId = 0x772E0000;
            //new char starter pos:
            this.Position.X = 3143.75f;
            this.Position.Y = 2828.75f;
            this.Position.Z = 59.075588f;

            //den of evil:
            //this.Position.X = 2526.250000f;
            //this.Position.Y = 2098.750000f;
            //this.Position.Z = -5.381495f;

            //inn:
            //this.Position.X = 2996.250000f;
            //this.Position.Y = 2793.750000f;
            //this.Position.Z = 24.045330f;

            // adrias hut
            //this.Position.X = 1768.750000f;
            //this.Position.Y = 2921.250000f;
            //this.Position.Z = 20.333143f;        

            // cemetry of forsaken
            //this.Position.X = 2041.250000f;
            //this.Position.Y = 1778.750000f;
            //this.Position.Z = 0.426203f;

            //defiled crypt level 2
            //this.WorldId = 2000289804;
            //this.Position.X = 158.750000f;
            //this.Position.Y = 76.250000f;
            //this.Position.Z = 0.100000f;

            this.GBHandle = new GBHandle()
            {
                Field0 = 0x00000007,
                Field1 = this.Properties.ClassID,
            };

            this.Field7 = -1;
            this.Field8 = -1;
            this.Field9 = 0x00000000;
            this.Field10 = 0x0;
        }
Exemplo n.º 10
0
        private static void LoadToons()
        {
            var query = "SELECT * from toons";
            var cmd = new SQLiteCommand(query, DBManager.Connection);
            var reader = cmd.ExecuteReader();

            if (!reader.HasRows) return;

            while(reader.Read())
            {
                var databaseId = (ulong) reader.GetInt64(0);
                var toon = new Toon(databaseId, reader.GetString(1), reader.GetByte(2), reader.GetByte(3), reader.GetByte(4), reader.GetInt64(5));
                Toons.Add(databaseId, toon);
            }
        }