Ejemplo n.º 1
0
        public static string BreedViewerSwf(HorseInstance horse, string terrainTileType)
        {
            double hands = CalculateHands(horse.AdvancedStats.Height, true);

            string swf = "breedviewer.swf?terrain=" + terrainTileType + "&breed=" + horse.Breed.Swf + "&color=" + horse.Color + "&hands=" + hands.ToString(CultureInfo.InvariantCulture);

            if (horse.Equipment.Saddle != null)
            {
                swf += "&saddle=" + horse.Equipment.Saddle.EmbedSwf;
            }
            if (horse.Equipment.SaddlePad != null)
            {
                swf += "&saddlepad=" + horse.Equipment.SaddlePad.EmbedSwf;
            }
            if (horse.Equipment.Bridle != null)
            {
                swf += "&bridle=" + horse.Equipment.Bridle.EmbedSwf;
            }
            if (horse.Equipment.Companion != null)
            {
                swf += "&companion=" + horse.Equipment.Companion.EmbedSwf;
            }
            swf += "&junk=";

            return(swf);
        }
Ejemplo n.º 2
0
        public void AddEntry(User user, Horse.HorseInstance horse)
        {
            ArenaEntry arenaEntry = new ArenaEntry();

            arenaEntry.EnteredUser  = user;
            arenaEntry.EnteredHorse = horse;
            Entries.Add(arenaEntry);
        }
Ejemplo n.º 3
0
        public WildHorse(HorseInstance horse, int MapX = -1, int MapY = -1, int despawnTimeout = 1440, bool addToDatabase = true)
        {
            Instance = horse;
            timeout  = despawnTimeout;
            if (MapX == -1 && MapY == -1)
            {
                while (true)
                {
                    if (horse.Breed.SpawnInArea == null)
                    {
                        // Pick x/y
                        int tryX = GameServer.RandomNumberGenerator.Next(0, Map.Width);
                        int tryY = GameServer.RandomNumberGenerator.Next(0, Map.Height);

                        if (CanHorseBeHere(tryX, tryY))
                        {
                            x = tryX;
                            y = tryY;
                            break;
                        }
                        else
                        {
                            continue;
                        }
                    }
                    else
                    {
                        World.Zone zone = World.GetZoneByName(horse.Breed.SpawnInArea);
                        // Pick x/y in zone.
                        int tryX = GameServer.RandomNumberGenerator.Next(zone.StartX, zone.EndX);
                        int tryY = GameServer.RandomNumberGenerator.Next(zone.StartY, zone.EndY);

                        if (CanHorseBeHere(tryX, tryY))
                        {
                            x = tryX;
                            y = tryY;
                            break;
                        }
                        else
                        {
                            continue;
                        }
                    }
                }
            }
            else
            {
                x = MapX;
                y = MapY;
            }
            wildHorses.Add(this);
            if (addToDatabase)
            {
                Database.AddWildHorse(this);
            }
        }
Ejemplo n.º 4
0
 public BasicStats(HorseInstance horse, int newHealth, int newShoes, int newHunger, int newThirst, int newMood, int newGroom, int newTiredness, int newExperience)
 {
     baseHorse  = horse;
     health     = newHealth;
     shoes      = newShoes;
     hunger     = newHunger;
     thirst     = newThirst;
     mood       = newMood;
     groom      = newGroom;
     tiredness  = newTiredness;
     experience = newExperience;
 }
Ejemplo n.º 5
0
 public AdvancedStats(HorseInstance horse, int newSpeed, int newStrength, int newConformation, int newAgility, int newInteligence, int newEndurance, int newPersonality, int newHeight)
 {
     if (horse != null)
     {
         baseHorse = horse;
     }
     speed        = newSpeed;
     strength     = newStrength;
     conformation = newConformation;
     agility      = newAgility;
     endurance    = newEndurance;
     inteligence  = newInteligence;
     personality  = newPersonality;
     Height       = newHeight;
 }
Ejemplo n.º 6
0
        public HorseInstance GenerateLeaseHorse()
        {
            HorseInstance instance = new HorseInstance(this.Breed, loadColor: this.Color, loadCategory: "LEASED", leaseTimer: this.Minutes);

            instance.Name   = this.HorseName;
            instance.Gender = this.Gender;
            instance.Leaser = this.LeaseId;

            instance.BasicStats    = new HorseInfo.BasicStats(instance, Health, Shoes, Hunger, Thirst, Mood, Groom, Tiredness, Experience);
            instance.AdvancedStats = new HorseInfo.AdvancedStats(instance, Speed, Strength, Conformation, Agility, Inteligence, Endurance, Personality, Height);

            instance.Equipment.Saddle    = this.Saddle;
            instance.Equipment.SaddlePad = this.SaddlePad;
            instance.Equipment.Bridle    = this.Bridle;

            return(instance);
        }
Ejemplo n.º 7
0
        public static void GenerateHorses()
        {
            Logger.InfoPrint("Generating horses.");
            while (wildHorses.Count < 40)
            {
                HorseInfo.Breed horseBreed = HorseInfo.Breeds[GameServer.RandomNumberGenerator.Next(0, HorseInfo.Breeds.Length)];
                if (horseBreed.Swf == "")
                {
                    continue;
                }
                if (horseBreed.SpawnInArea == "none") // no unipegs >_>
                {
                    continue;
                }

                HorseInstance horseInst = new HorseInstance(horseBreed);
                WildHorse     wildHorse = new WildHorse(horseInst);

                Logger.DebugPrint("Created " + horseBreed.Name + " at X:" + wildHorse.X + ", Y:" + wildHorse.Y);
            }
        }
Ejemplo n.º 8
0
 public StatCalculator(HorseInstance horse, StatType type, User user = null)
 {
     baseHorse = horse;
     horseStat = type;
     baseUser  = user;
 }