예제 #1
0
 internal Pet(uint PetId, uint OwnerId, uint RoomId, string Name, uint Type, string Race, string Color, int experience, int Energy, int Nutrition, int Respect, double CreationStamp, int X, int Y, double Z, bool havesaddle, int Anyonecanride, int Dye, int PetHer, int Rarity, DateTime LastHealth, DateTime UntilGrown, MoplaBreed MoplaBreed)
 {
     this.PetId         = PetId;
     this.OwnerId       = OwnerId;
     this.RoomId        = RoomId;
     this.Name          = Name;
     this.Type          = Type;
     this.Race          = Race;
     this.Color         = Color;
     this.Experience    = experience;
     this.Energy        = Energy;
     this.Nutrition     = Nutrition;
     this.Respect       = Respect;
     this.CreationStamp = CreationStamp;
     this.X             = X;
     this.Y             = Y;
     this.Z             = Z;
     this.PlacedInRoom  = false;
     this.DBState       = DatabaseUpdateState.Updated;
     this.HaveSaddle    = havesaddle;
     this.AnyoneCanRide = Anyonecanride;
     this.PetHair       = PetHer;
     this.HairDye       = Dye;
     this.Rarity        = Rarity;
     this.LastHealth    = LastHealth;
     this.UntilGrown    = UntilGrown;
     this.MoplaBreed    = MoplaBreed;
     this.PetCommands   = PetCommandHandler.GetPetCommands(this);
 }
예제 #2
0
 internal static MoplaBreed CreateMonsterplantBreed(Pet Pet)
 {
     MoplaBreed breed = null;
     if (Pet.Type == 16)
     {
         Tuple<string, string> tuple = GeneratePlantData(Pet.Rarity);
         breed = new MoplaBreed(Pet, Pet.PetId, Pet.Rarity, tuple.Item1, tuple.Item2, 0, 1);
         using (IQueryAdapter adapter = CyberEnvironment.GetDatabaseManager().getQueryReactor())
         {
             adapter.setQuery("INSERT INTO bots_monsterplants (pet_id, rarity, plant_name, plant_data) VALUES (@petid , @rarity , @plantname , @plantdata)");
             adapter.addParameter("petid", Pet.PetId);
             adapter.addParameter("rarity", Pet.Rarity);
             adapter.addParameter("plantname", tuple.Item1);
             adapter.addParameter("plantdata", tuple.Item2);
             adapter.runQuery();
         }
     }
     return breed;
 }
예제 #3
0
        internal static MoplaBreed CreateMonsterplantBreed(Pet Pet)
        {
            MoplaBreed breed = null;

            if (Pet.Type == 16)
            {
                Tuple <string, string> tuple = GeneratePlantData(Pet.Rarity);
                breed = new MoplaBreed(Pet, Pet.PetId, Pet.Rarity, tuple.Item1, tuple.Item2, 0, 1);
                using (IQueryAdapter adapter = CyberEnvironment.GetDatabaseManager().getQueryReactor())
                {
                    adapter.setQuery("INSERT INTO bots_monsterplants (pet_id, rarity, plant_name, plant_data) VALUES (@petid , @rarity , @plantname , @plantdata)");
                    adapter.addParameter("petid", Pet.PetId);
                    adapter.addParameter("rarity", Pet.Rarity);
                    adapter.addParameter("plantname", tuple.Item1);
                    adapter.addParameter("plantdata", tuple.Item2);
                    adapter.runQuery();
                }
            }
            return(breed);
        }
예제 #4
0
 internal static Pet GeneratePetFromRow(DataRow Row, DataRow mRow)
 {
     if (Row == null)
     {
         return null;
     }
     MoplaBreed moplaBreed = null;
     if (Convert.ToUInt32(mRow["type"]) == 16u)
     {
         using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor())
         {
             queryreactor.setQuery("SELECT * FROM bots_monsterplants WHERE pet_id = " + Convert.ToUInt32(Row["id"]));
             DataRow row = queryreactor.getRow();
             moplaBreed = new MoplaBreed(row);
         }
     }
     return new Pet(Convert.ToUInt32(Row["id"]), Convert.ToUInt32(Row["user_id"]), Convert.ToUInt32(Row["room_id"]), (string)Row["name"], Convert.ToUInt32(mRow["type"]), (string)mRow["race"], (string)mRow["color"], (int)mRow["experience"], (int)mRow["energy"], (int)mRow["nutrition"], (int)mRow["respect"], Convert.ToDouble(mRow["createstamp"]), (int)Row["x"], (int)Row["y"], Convert.ToDouble(Row["z"]), (int)mRow["have_saddle"] == 1, (int)mRow["anyone_ride"], (int)mRow["hairdye"], (int)mRow["pethair"], (int)mRow["rarity"], CyberEnvironment.UnixToDateTime((double)((int)mRow["lasthealth_stamp"])), CyberEnvironment.UnixToDateTime((double)((int)mRow["untilgrown_stamp"])), moplaBreed);
 }
예제 #5
0
파일: Pet.cs 프로젝트: kessiler/habboServer
		internal Pet(uint PetId, uint OwnerId, uint RoomId, string Name, uint Type, string Race, string Color, int experience, int Energy, int Nutrition, int Respect, double CreationStamp, int X, int Y, double Z, bool havesaddle, int Anyonecanride, int Dye, int PetHer, int Rarity, DateTime LastHealth, DateTime UntilGrown, MoplaBreed MoplaBreed)
		{
			this.PetId = PetId;
			this.OwnerId = OwnerId;
			this.RoomId = RoomId;
			this.Name = Name;
			this.Type = Type;
			this.Race = Race;
			this.Color = Color;
			this.Experience = experience;
			this.Energy = Energy;
			this.Nutrition = Nutrition;
			this.Respect = Respect;
			this.CreationStamp = CreationStamp;
			this.X = X;
			this.Y = Y;
			this.Z = Z;
			this.PlacedInRoom = false;
			this.DBState = DatabaseUpdateState.Updated;
			this.HaveSaddle = havesaddle;
			this.AnyoneCanRide = Anyonecanride;
			this.PetHair = PetHer;
			this.HairDye = Dye;
			this.Rarity = Rarity;
			this.LastHealth = LastHealth;
			this.UntilGrown = UntilGrown;
			this.MoplaBreed = MoplaBreed;
            this.PetCommands = PetCommandHandler.GetPetCommands(this);
		}