Esempio n. 1
0
 /// <summary>
 /// Constructor for Guards, assumes unfriendly and tells people to move along
 /// </summary>
 /// <param name="name">Guards name</param>
 /// <param name="gender">Guards gender</param>
 /// <param name="race">Guards race</param>
 public Guard(string name, Genders gender, Races race)
     : base(name, gender, race)
 {
     AppearsFriendly = false;
     InitialGreeting = "You should not be here!";
     _inventory = new List<Item>();
 }
Esempio n. 2
0
 /// <summary>
 /// Overloaded constructor, creates player based on inputs
 /// </summary>
 /// <param name="name">Player's name</param>
 /// <param name="description">Player's description</param>
 /// <param name="gender">Player's gender</param>
 /// <param name="race">Player's race</param>
 public Player(string name, string description, Genders gender, Races race)
     : base(name, description, gender, race)
 {
     _inventory = new List<Item>();
     _inventorySize = 12;
     _currentRoomNumber = 0;
 }
Esempio n. 3
0
        //private IList<Trait> _traits;
        //public IList<Trait> Traits { get { return _traits; } }     // return an unmodifialbe list - ArrayList.ReadOnly?

        /// <summary>
        /// Initializes a new instance of the <see cref="Race"/> class for testing.
        /// </summary>
        /// <param name="raceType">Type of the race.</param>
        public Race(Races raceType) {
            RaceType = raceType;
            LeaderName = raceType.GetName() + " Leader";
            Description = new StringBuilder(raceType.GetDescription());
            Color = RandomExtended<GameColor>.Choice(Enums<GameColor>.GetValues()
                .Except(default(GameColor), GameColor.Black, GameColor.Clear).ToArray());
        }
Esempio n. 4
0
 /// <summary>
 /// Overloaded Constructor, allows customization of the Character
 /// </summary>
 /// <param name="name">Character's Name</param>
 /// <param name="description">Character's Description</param>
 /// <param name="gender">Character's Gender</param>
 /// <param name="race">Character's Race</param>
 public Character(string name, string description, Genders gender, Races race)
 {
     _name = name;
     _description = description;
     _gender = gender;
     _race = race;
 }
Esempio n. 5
0
 /// <summary>
 /// Constructor for Staff, assumes friendly and tells people their name
 /// </summary>
 /// <param name="name">Staffs name</param>
 /// <param name="gender">Staff gender</param>
 /// <param name="race">Staffs race</param>
 public Staff(string name, Genders gender, Races race)
     : base(name, gender, race)
 {
     AppearsFriendly = true;
     InitialGreeting = string.Format("Why hello there, my name is {0}", this.Name);
     _inventory = new List<Item>();
 }
Esempio n. 6
0
 /// <summary>
 /// Default constructor, creates Mr. Smith.
 /// </summary>
 public Character()
 {
     _name = "Mr. Smith";
     _description = "He wears a suit, carries a briefcase, and talks kinda funny.";
     _gender = Genders.MALE;
     _race = Races.HUMAN;
 }
Esempio n. 7
0
 /// <summary>
 /// Default person constructor
 /// </summary>
 public Person()
 {
     _name = "Mr. Smith";
     _gender = Genders.Male;
     _race = Races.Human;
     _currentRoom = new int[2];
     _isAlive = true;
 }
Esempio n. 8
0
 /// <summary>
 /// Overloaded person constructor
 /// </summary>
 /// <param name="name"></param>
 /// <param name="gender"></param>
 /// <param name="race"></param>
 public Person(string name,Genders gender, Races race)
 {
     _name = name;
     _gender = gender;
     _race = race;
     _currentRoom = new int[2];
     _isAlive = true;
 }
Esempio n. 9
0
 public Actor(String name, Races race, Genders gender)
 {
     stats = new StatsDatum();
     equipment = new Equipment();
     skills = new List<Skill>();
     statusEffects = new List<StatusEffect>();
     this.name = name;
     this.race = race;
     this.gender = gender;
 }
Esempio n. 10
0
        public static string GetRandomName(Races sRaces)
        {
            string s = "";

            if (sRaces == Races.Human) {
                s = string.Format("{0}{1}{2}", HumanNameRot1[rnd.Next(0, HumanNameRot1.Length)],
                                  HumanNameIn[rnd.Next(0, HumanNameIn.Length)],
                                  HumanNameRot2[rnd.Next(0, HumanNameRot2.Length)]);
            }

            return s;
        }
Esempio n. 11
0
 public Player(string name, Races race, PlayerClasses playerClass,
     int strength, int dexterity, int constitution, int intelligence, int wisdom, int charisma)
 {
     Name = name;
     Race = race;
     PlayerClass = playerClass;
     Strength = strength;
     Dexterity = dexterity;
     Constitution = constitution;
     Intelligence = intelligence;
     Wisdom = wisdom;
     Charisma = charisma;
 }
Esempio n. 12
0
        public StatusInfoPacket(PacketReader reader)
            : base(0x11, "StatusInfo")
        {
            Serial = reader.ReadInt32();
            PlayerName = reader.ReadString(30);
            CurrentHealth = reader.ReadInt16();
            MaxHealth = reader.ReadInt16();
            NameChangeFlag = reader.ReadByte() != 0x00; // 0x1 = allowed, 0 = not allowed
            StatusTypeFlag = reader.ReadByte();
            if (StatusTypeFlag > 0)
            {
                Sex = (Genders)reader.ReadByte(); // 0=male, 1=female
                Strength = reader.ReadInt16();
                Dexterity = reader.ReadInt16();
                Intelligence = reader.ReadInt16();
                CurrentStamina = reader.ReadInt16();
                MaxStamina = reader.ReadInt16();
                CurrentMana = reader.ReadInt16();
                MaxMana = reader.ReadInt16();
                GoldInInventory = reader.ReadInt32();
                ArmorRating = reader.ReadInt16();
                Weight = reader.ReadInt16();

                if (StatusTypeFlag >= 5)
                {
                    MaxWeight = reader.ReadInt16();
                    Race = (Races)reader.ReadByte();
                }

                if (StatusTypeFlag >= 3)
                {
                    StatCap = reader.ReadInt16();
                    Followers = reader.ReadByte();
                    MaxFollowers = reader.ReadByte();
                }

                if (StatusTypeFlag >= 4)
                {
                    ResistFire = reader.ReadInt16();
                    ResistCold = reader.ReadInt16();
                    ResistPoison = reader.ReadInt16();
                    ResistEnergy = reader.ReadInt16();
                    Luck = reader.ReadInt16();
                    DmgMin = reader.ReadInt16();
                    DmgMax = reader.ReadInt16();
                    TithingPoints = reader.ReadInt16();
                }
            }
        }
Esempio n. 13
0
    /// <summary>
    /// Gets all the buildings of a certain race
    /// </summary>
    /// <param name="position"></param>
    /// <param name="radius"></param>
    /// <param name="race"></param>
    /// <returns></returns>
    public static List<IBuilding> getBuildingsOfRaceNearPosition(Vector3 position, float radius, Races race)
    {
        GameObject[] foundGameObjects = getObjectsNearPosition(position, radius);
        List<IBuilding> buldingsOfRace = new List<IBuilding>();

        for (int i = 0; i < foundGameObjects.Length; i++)
        {
            GameObject obj = foundGameObjects[i];
            IBuilding objBuilding = obj.GetComponent<IBuilding>();
            if (objBuilding != null && objBuilding.healthPercentage > 0f && objBuilding.getRace() == race)
            {
                buldingsOfRace.Add(objBuilding);
            }
        }
        return buldingsOfRace;
    }
Esempio n. 14
0
    /// <summary>
    /// Gets all the units of a certain race
    /// </summary>
    /// <param name="position"></param>
    /// <param name="radius"></param>
    /// <param name="race"></param>
    /// <returns></returns>
    public static List<Unit> getUnitsOfRaceNearPosition(Vector3 position, float radius, Races race)
    {
        GameObject[] foundGameObjects = getObjectsNearPosition(position, radius);
        List<Unit> unitsOfRace = new List<Unit>();

        for (int i = 0; i < foundGameObjects.Length; i++)
        {
            GameObject obj = foundGameObjects[i];
            Unit objUnit = obj.GetComponent<Unit>();
            if (objUnit != null && objUnit.status != EntityStatus.DEAD && objUnit.race == race)
            {
                unitsOfRace.Add(objUnit);
            }
        }
        return unitsOfRace;
    }
Esempio n. 15
0
        public MobileStatusCompactPacket(PacketReader reader)
            : base(0x11, "StatusInfo")
        {
            m_serial = reader.ReadInt32();
            m_playerName = reader.ReadString(30);
            m_currentHealth = reader.ReadInt16();
            m_maxHealth = reader.ReadInt16();
            m_nameChangeFlag = reader.ReadByte(); // 0x1 = allowed, 0 = not allowed
            m_statusTypeFlag = reader.ReadByte();
            sex = (Genders)reader.ReadByte(); // 0=male, 1=female
            m_strength = reader.ReadInt16();
            m_dexterity = reader.ReadInt16();
            m_intelligence = reader.ReadInt16();
            m_currentStamina = reader.ReadInt16();
            m_maxStamina = reader.ReadInt16();
            m_currentMana = reader.ReadInt16();
            m_maxMana = reader.ReadInt16();
            m_goldInInventory = reader.ReadInt32();
            m_armorRating = reader.ReadInt16();
            m_weight = reader.ReadInt16();

            if (m_statusTypeFlag >= 5)
            {
                m_maxWeight = reader.ReadInt16();
                m_race = (Races)reader.ReadByte();
            }

            if (m_statusTypeFlag >= 3)
            {
                m_statCap = reader.ReadInt16();
                m_followers = reader.ReadByte();
                m_maxFollowers = reader.ReadByte();
            }

            if (m_statusTypeFlag >= 4)
            {
                m_resistFire = reader.ReadInt16();
                m_resistCold = reader.ReadInt16();
                m_resistPoison = reader.ReadInt16();
                m_resistEnergy = reader.ReadInt16();
                m_luck = reader.ReadInt16();
                m_dmgMin = reader.ReadInt16();
                m_dmgMax = reader.ReadInt16();
                m_tithingPoints = reader.ReadInt16();
            }
        }
 protected override void RecordPopupListState(string popupListName, string selectionName) {
     base.RecordPopupListState(popupListName, selectionName);
     UniverseSize universeSize;
     if (Enums<UniverseSize>.TryParse(selectionName, true, out universeSize)) {
         //D.Log("UniverseSize recorded as {0}.".Inject(selectionName));
         _universeSize = universeSize;
     }
     Races playerRace;
     if (Enums<Races>.TryParse(selectionName, true, out playerRace)) {
         //D.Log("Player recorded as {0}.".Inject(selectionName));
         _playerRace = playerRace;
     }
     GameColor playerColor;
     if (Enums<GameColor>.TryParse(selectionName, true, out playerColor)) {
         _playerColor = playerColor;
     }
 }
Esempio n. 17
0
    //List<Race> races;
    void Awake()
    {
        // Singleton
        if (instance) {
            Destroy (this.gameObject);
            return;
        }
        instance = this;

        /*races = new List<Race>();

        races.Add(new Race("Human","Common inhabitant of the plains"));

        races.Add(new Race("Beast","Fearsome creature of the wild"));

        races.Add(new Race("Undead","The walking dead"));
        */
    }
        public CreateCharacterPacket(string name, Genders sex, Races race,
            byte str, byte dex, byte intel, byte skill1, byte skill1Value,
            byte skill2, byte skill2Value, byte skill3, byte skill3Value, short skinColor,
            short hairStyle, short hairColor, short facialHairStyle, short facialHairColor,
            short locationIndex, short slotNumber, int clientIp, short shirtColor, short pantsColor)
            : base(0x00, "Create Character", 104)
        {
            str = (byte)MathHelper.Clamp(str, 10, 60);
            dex = (byte)MathHelper.Clamp(dex, 10, 60);
            intel = (byte)MathHelper.Clamp(intel, 10, 60);

            if (str + dex + intel != 80)
                throw new Exception("Unable to create character with a combined stat total not equal to 80.");

            Stream.Write(0xedededed);
            Stream.Write(0xffffffff);
            Stream.Write((byte)0);
            Stream.WriteAsciiFixed(name, 30);
            Stream.WriteAsciiFixed("", 30);
            Stream.Write((byte)((int)sex + (int)race));
            Stream.Write((byte)str);
            Stream.Write((byte)dex);
            Stream.Write((byte)intel);

            Stream.Write((byte)skill1);
            Stream.Write((byte)skill1Value);
            Stream.Write((byte)skill2);
            Stream.Write((byte)skill2Value);
            Stream.Write((byte)skill3);
            Stream.Write((byte)skill3Value);

            Stream.Write((short)skinColor);
            Stream.Write((short)hairStyle);
            Stream.Write((short)hairColor);
            Stream.Write((short)facialHairStyle);
            Stream.Write((short)facialHairColor);
            Stream.Write((short)locationIndex);
            Stream.Write((short)slotNumber);
            Stream.Write((short)0);

            Stream.Write(clientIp);
            Stream.Write((short)shirtColor);
            Stream.Write((short)pantsColor);
        }
    protected void btnUserInfoSubmit_OnClick(object sender, EventArgs e)
    {
        try
        {
            var name = txtName.Text.Split(' ');
            var lastname = name[0];
            var firstname = name[1];
            var birthDay = Convert.ToDateTime(txtDateOfBirth.Text);
            var sex = new Sex(ddlSex.SelectedValue, ddlSex.SelectedItem.Text);
            var phoneNumber = txtPhoneNumber.Text;
            var job = new JobIndustries(ddlJob.SelectedValue,ddlJob.SelectedItem.Text);
            var province = new Province(ddlProvine.SelectedValue,ddlProvine.SelectedItem.Text);
            var district = new District(ddlDistrict.SelectedValue,ddlDistrict.SelectedItem.Text, province);
            var address = new Address(province, district);
            var race = new Races(ddRaces.SelectedValue, ddRaces.SelectedItem.Text);
            var maximOfLife = txtMaxim.Text;
            var photoPath = "";
            if (this.fuResume.HasFile)
            {
                string imgThumb = "E:\\DOCUMENTS\\School\\ASP.NETWorkSpaces\\WebFindingJobsMVCmodel\\Images\\" + this.fuResume.FileName;
                this.fuResume.SaveAs(imgThumb);
                photoPath = "/Images/" + this.fuResume.FileName;
            }
            User1 = (User)Session["User"];
            var returnValue = User1.SetFullInfo(firstname, lastname, birthDay, sex, phoneNumber, job, address, race, maximOfLife,photoPath);
            SetExistInfo();

            if (returnValue)
            {
                Session["User"] = User1;
                SetExistInfo();
                JavaScriptAleart("Thực hiện thành công");
            }
            else
            {
                JavaScriptAleart("Chỉnh sửa không thành công. Vui lòng load lại trang và thử lại");
            }
        }
        catch (Exception exception)
        {
            Response.Write(exception.ToString());
            JavaScriptAleart("Chỉnh sửa không thành công. Vui lòng load lại trang và thử lại");
        }
    }
        void RestoreOldClassSpecials(SaveTree saveTree, Races classicTransformedRace)
        {
            try
            {
                // Get old class record
                SaveTreeBaseRecord oldClassRecord = saveTree.FindRecord(RecordTypes.OldClass);
                if (oldClassRecord == null)
                {
                    return;
                }

                // Read old class data
                System.IO.MemoryStream stream = new System.IO.MemoryStream(oldClassRecord.RecordData);
                System.IO.BinaryReader reader = new System.IO.BinaryReader(stream);
                ClassFile classFile           = new ClassFile();
                classFile.Load(reader);
                reader.Close();

                // Restore any specials set by transformed race
                if (classicTransformedRace == Races.Vampire)
                {
                    // Restore pre-vampire specials
                    characterDocument.career.DamageFromSunlight   = classFile.Career.DamageFromSunlight;
                    characterDocument.career.DamageFromHolyPlaces = classFile.Career.DamageFromHolyPlaces;
                    characterDocument.career.Paralysis            = classFile.Career.Paralysis;
                    characterDocument.career.Disease = classFile.Career.Disease;
                }
                else if (classicTransformedRace == Races.Werewolf)
                {
                    // TODO: Restore pre-werewolf specials
                }
                else if (classicTransformedRace == Races.Wereboar)
                {
                    // TODO: Restore pre-wereboar specials
                }
            }
            catch (Exception ex)
            {
                Debug.LogErrorFormat("Could not restore old class specials for vamp/were import. Error: '{0}'", ex.Message);
            }
        }
Esempio n. 21
0
    //Function called externally from MainMenu scene to check if a race is unlocked
    public bool IsRaceUnlocked(Races raceToCheck_)
    {
        switch (raceToCheck_)
        {
        case Races.Human:
            return(true);    //Humans are the default

        case Races.Dwarf:
            return(this.dwarf);

        case Races.Elf:
            return(this.elf);

        case Races.HalfMan:
            return(this.halfman);

        case Races.Orc:
            return(this.orc);

        case Races.GillFolk:
            return(this.gillfolk);

        case Races.ScaleSkin:
            return(this.scaleskin);

        case Races.Amazon:
            return(this.amazon);

        case Races.Minotaur:
            return(this.minotaur);

        case Races.Elemental:
            return(this.elemental);

        case Races.Dragon:
            return(this.dragon);
        }

        //If somehow we reach this point, we're returning false by default just in case
        return(false);
    }
Esempio n. 22
0
            // Oaths are declared by NPC race according to the race index used in FACTION.TXT.
            // Unfortunately, classic never uses this faction race ID but, instead, uses the
            // hardcoded index race of each region, which is not the same. In classic, this
            // results in all NPCs from High Rock saying Nord oaths, while all NPCs in Hammerfell
            // will say Khajiit oaths.
            // Instead, DFU uses the faction race ID to return the correct oath.
            // For the list of oaths, see https://www.imperial-library.info/content/daggerfall-oaths-and-expletives
            public override string Oath()
            {
                // Get the questor race to find the correct oath
                Races race = Races.None;

                Symbol[] questors = parent.GetQuestors();
                if (questors.Length > 0)
                {
                    race = parent.GetPerson(questors[0]).Race;
                }

                // Fallback to race of current region
                if (race == Races.None)
                {
                    race = GameManager.Instance.PlayerGPS.GetRaceOfCurrentRegion();
                }

                int oathId = (int)RaceTemplate.GetFactionRaceFromRace(race);

                return(DaggerfallUnity.Instance.TextProvider.GetRandomText(201 + oathId));
            }
Esempio n. 23
0
    // info methods
    private Color getRaceColor(Races r)
    {
        Color c;

        switch (r)
        {
        case Races.ELVES:
            c = Color.green;
            break;

        case Races.MEN:
            c = Color.red;
            break;

        default:
            c = Color.white;
            break;
        }

        return(c);
    }
Esempio n. 24
0
        public RaceInfo GetRaceInfo(int raceId)
        {
            using (var contex = new RaceContext()) {
                Races race         = contex.Races.Find(raceId);
                var   CarsInDaRace = (from a in contex.CarInRaces
                                      where a.Races == race
                                      select a).ToList();
                var Cars = (from a in contex.CarInRaces
                            where a.Races == race
                            select a.Cars).ToList();

                var list = new List <CarInfo>();

                foreach (var carInRace in CarsInDaRace)
                {
                    var CarInfo = new CarInfo()
                    {
                        CarId                = carInRace.Cars.Id,
                        CarName              = carInRace.Cars.Name,
                        DriverName           = carInRace.Cars.DriverName,
                        BestLapInTicks       = carInRace.BestLap,
                        EndPosition          = carInRace.EndPosition,
                        StartPosition        = carInRace.StartPosition,
                        TotalRaceTimeInTicks = carInRace.TotalRaceTime
                    };
                    list.Add(CarInfo);
                }

                var Tracks = (from a in contex.Races
                              where a.Id == raceId
                              select a.Tracks).ToList();

                return(new RaceInfo {
                    RaceId = race.Id, ActualEnd = race.ActualEndTime,
                    ActualStart = race.ActualStartTime, Cars = list, NumberOfLaps = race.NumberOfLaps,
                    PlannedEnd = race.PlannedEndTime, PlannedStart = race.PlannedStartTime,
                    TrackId = race.Tracks.Id, TrackName = race.Tracks.Name
                });
            }
        }
Esempio n. 25
0
        public Player(string label, int[] attributes, int level, Races charRace, Classes charClass, Feats[] charFeats, Armors[] charArmors,
                      Weapons[] charWeapons, Spells[] charSpells, AlignmentAxiom alignAxiom, AlignmentMoral alignMoral)
        {
            Label = label;

            STR = attributes[0];
            DEX = attributes[1];
            CON = attributes[2];
            INT = attributes[3];
            WIS = attributes[4];
            CHA = attributes[5];

            Level       = level;
            CharRace    = charRace;
            CharClass   = charClass;
            AlignAxiom  = alignAxiom;
            AlignMoral  = alignMoral;
            CharFeats   = charFeats;
            CharArmors  = charArmors;
            CharWeapons = charWeapons;
            CharSpells  = charSpells;
        }
Esempio n. 26
0
        /// <summary>
        /// sets person race and display race
        /// </summary>
        /// <param name="race">race to be set</param>
        void SetRace(Races race)
        {
            // set race
            this.race = race;

            // set display race
            switch (race)
            {
            case Races.Redguard:
                this.displayRace = DisplayRaces.Redguard;
                break;

            case Races.Nord:
                this.displayRace = DisplayRaces.Nord;
                break;

            case Races.Breton:
            default:
                this.displayRace = DisplayRaces.Breton;
                break;
            }
        }
        /// <summary>
        /// Setup this person based on race and gender.
        /// </summary>
        public void SetPerson(Races race, Genders gender, int personVariant)
        {
            // Must specify a race
            if (race == Races.None)
            {
                return;
            }

            // Get texture range for this race and gender
            int[] textures = null;
            switch (race)
            {
            case Races.Redguard:
                textures = (gender == Genders.Male) ? maleRedguardTextures : femaleRedguardTextures;
                break;

            case Races.Nord:
                textures = (gender == Genders.Male) ? maleNordTextures : femaleNordTextures;
                break;

            case Races.Breton:
            default:
                textures = (gender == Genders.Male) ? maleBretonTextures : femaleBretonTextures;
                break;
            }

            // Setup person rendering
            CacheRecordSizesAndFrames(textures[personVariant]);
            AssignMeshAndMaterial(textures[personVariant]);

            // Setup animation state
            moveAnims        = GetStateAnims(AnimStates.Move);
            idleAnims        = GetStateAnims(AnimStates.Idle);
            stateAnims       = moveAnims;
            animSpeed        = stateAnims[0].FramePerSecond;
            currentAnimState = AnimStates.Move;
            lastOrientation  = -1;
            UpdateOrientation();
        }
Esempio n. 28
0
        private void RemoveLimit(Player player, string[] args)
        {
            if (!player.HasPermission("RaceSystem.Modify"))
            {
                player.SendError(GetMessage("NoPermission", player)); return;
            }

            if (args.Length < 1)
            {
                player.SendError(GetMessage("InvalidArgs", player)); return;
            }

            var race = Races.FirstOrDefault(r => string.Equals(r.Name, args.JoinToString(" "), StringComparison.CurrentCultureIgnoreCase));

            if (race == null)
            {
                player.SendError(GetMessage("RaceNonExisting", player)); return;
            }

            race.RemoveLimit();
            player.SendMessage(GetMessage("LimitRemoved", player), race);
        }
Esempio n. 29
0
 /// <summary>
 /// randomize NPC with current race - set current race before calling this function with property Race.
 /// </summary>
 /// <param name="race">Entity race of NPC in current location.</param>
 public void RandomiseNPC(Races race)
 {
     // Randomly set guards
     if (Random.Range(0, 32) == 0)
     {
         gender = Genders.Male;
         personOutfitVariant = 0;
         IsGuard             = true;
     }
     else
     {
         // Randomize gender
         gender = (Random.Range(0, 2) == 1) ? Genders.Female : Genders.Male;
         // Set outfit variant for npc
         personOutfitVariant = Random.Range(0, numPersonOutfitVariants);
         IsGuard             = false;
     }
     // Set race (set current race before calling this function with property Race)
     SetRace(race);
     // Set remaining fields and update billboards
     SetPerson();
 }
Esempio n. 30
0
        private void RemovePermission(Player player, string[] args)
        {
            if (!player.HasPermission("RaceSystem.Modify"))
            {
                player.SendError(GetMessage("NoPermission", player)); return;
            }

            if (args.Length < 2)
            {
                player.SendError(GetMessage("InvalidArgs", player)); return;
            }

            var race = Races.FirstOrDefault(r => string.Equals(r.Name, args[0], StringComparison.CurrentCultureIgnoreCase));

            if (race == null)
            {
                player.SendError(GetMessage("RaceNonExisting", player)); return;
            }

            var permissions = args.Skip(1);

            race.RemovePermission(permissions);

            foreach (var pl in Server.ClientPlayers)
            {
                CheckPlayerExcists(pl);
                if (!Data[pl.Id].HasRace(race) || HasPermission(pl, race.Permissions))
                {
                    continue;
                }
                Data[pl.Id].Reset();
                CheckPlayerExcists(pl);
            }

            player.SendMessage(GetMessage("PermissionRemoved", player), race, string.Join(", ", permissions.ToArray()));

            SaveRaceData();
        }
Esempio n. 31
0
 /*
  * Author: Dr Nexus
  * Modified by: Kroy
  *
  * Choose the race and set race specific attributes, for character c.
  *
  * Parameter c Character to set.
  * Parameter race of the character.
  * Return create basic stats.
  */
 public bool OnCharacterChooseRace(Character c, Races race)
 {
     //Skill lang = null;
     if (race == Races.Dwarf)
     {
         Dwarf.Start(c);
     }
     else if (race == Races.Gnome)
     {
         Gnome.Start(c);
     }
     else if (race == Races.Human)
     {
         Human.Start(c);
     }
     else if (race == Races.NightElf)
     {
         NightElf.Start(c);
     }
     else if (race == Races.Orc)
     {
         Orc.Start(c);
     }
     else if (race == Races.Tauren)
     {
         Tauren.Start(c);
     }
     else if (race == Races.Troll)
     {
         Troll.Start(c);
     }
     else if (race == Races.Undead)
     {
         Undead.Start(c);
     }
     ChooseClass(c);          // Coose class after race.
     return(true);            // execute the caller code
 }
Esempio n. 32
0
        void AssignRace()
        {
            // Use faction race only for individuals
            if (isIndividualNPC)
            {
                FactionFile.FactionRaces factionRace = (FactionFile.FactionRaces)factionData.race;
                if (factionRace != FactionFile.FactionRaces.None)
                {
                    switch (factionRace)
                    {
                    case FactionFile.FactionRaces.Redguard:
                        race = Races.Redguard;
                        return;

                    case FactionFile.FactionRaces.Nord:
                        race = Races.Nord;
                        return;

                    case FactionFile.FactionRaces.DarkElf:
                        race = Races.DarkElf;
                        return;

                    case FactionFile.FactionRaces.WoodElf:
                        race = Races.WoodElf;
                        return;

                    case FactionFile.FactionRaces.Breton:
                    default:
                        race = Races.Breton;
                        return;
                    }
                }
            }

            // Otherwise use race of current region
            race     = GameManager.Instance.PlayerGPS.GetRaceOfCurrentRegion();
            nameBank = GameManager.Instance.PlayerGPS.GetNameBankOfCurrentRegion();
        }
        public ActionResult Edit(RacesModel race)
        {
            if ((UserHelper.GetUserRole(User.Identity.Name) != "admin") && (UserHelper.GetUserRole(User.Identity.Name) != "worker") &&
                (UserHelper.GetUserRole(User.Identity.Name) != "manager"))
            {
                return(RedirectToAction("Index", "Home"));
            }


            if (ModelState.IsValid)
            {
                pszczupakEntities ent = new pszczupakEntities();
                Races             r   = ent.Races.Where(x => x.id == race.id).FirstOrDefault();
                r = ConverterHelper.RacesSameValuesWithoutID(r, race);
                ent.Entry(ent.Races.Where(x => x.id == r.id).First()).CurrentValues.SetValues(r);
                ent.SaveChanges();
                return(RedirectToAction("Index"));
            }
            else
            {
                return(View(race));
            }
        }
Esempio n. 34
0
        public static string FromRace(Races r)
        {
            switch (r)
            {
            case Races.Human: return("Human");

            case Races.Dwarf: return("Dwarf");

            case Races.NightElf: return("NightElf");

            case Races.Gnome: return("Gnome");

            case Races.Orc: return("Orc");

            case Races.Undead: return("Undead");

            case Races.Tauren: return("Tauren");

            case Races.Troll: return("Troll");

            default: throw new Exception("Race not found");
            }
        }
Esempio n. 35
0
        public static int BaseSpiByRace(Races r)
        {
            switch (r)
            {
            case Races.Human: return(21);

            case Races.Dwarf: return(19);

            case Races.NightElf: return(20);

            case Races.Gnome: return(20);

            case Races.Orc: return(23);

            case Races.Undead: return(25);

            case Races.Tauren: return(22);

            case Races.Troll: return(21);

            default: return(0);
            }
        }
Esempio n. 36
0
        public static int BaseIntByRace(Races r)
        {
            switch (r)
            {
            case Races.Human: return(20);

            case Races.Dwarf: return(19);

            case Races.NightElf: return(20);

            case Races.Gnome: return(24);

            case Races.Orc: return(17);

            case Races.Undead: return(18);

            case Races.Tauren: return(15);

            case Races.Troll: return(16);

            default: return(0);
            }
        }
Esempio n. 37
0
    /*public void Activate()
     * {
     *  SelectionList.LoadEntries(PlayerManager.GetSavedGames());
     * }*/

    private void StartNewGame(string name, Races race, EmpireController.govType gov)//Attempt to start a new game
    {
        //string newLevel = SelectionList.GetCurrentEntry();

        /*if (newLevel != "")
         * {
         *  ResourceManager.LevelName = newLevel;
         *  if (Application.loadedLevelName != "BlankMap1") Application.LoadLevel("BlankMap1");
         *  else if (Application.loadedLevelName != "BlankMap2") Application.LoadLevel("BlankMap2");
         *  //makes sure that the loaded level runs at normal speed
         *  Time.timeScale = 1.0f;
         * }*/
        playerInstance.GetComponent <EmpireController>().name       = "Player";
        playerInstance.GetComponent <EmpireController>().EmpireName = name;
        playerInstance.GetComponent <EmpireController>().Race       = race;
        playerInstance.GetComponent <EmpireController>().Gov        = gov;


        DontDestroyOnLoad(playerInstance);//prevent this player object from disappearing when scene changes
        SceneManager.LoadScene("SolarSystemTest");

        //playerInstance.
    }
Esempio n. 38
0
 public static RaceTemplate GetRaceTemplate(Races race)
 {
     switch (race)
     {
         default:
         case Races.Breton:
             return new Breton();
         case Races.Redguard:
             return new Redguard();
         case Races.Nord:
             return new Nord();
         case Races.DarkElf:
             return new DarkElf();
         case Races.HighElf:
             return new HighElf();
         case Races.WoodElf:
             return new WoodElf();
         case Races.Khajiit:
             return new Khajiit();
         case Races.Argonian:
             return new Argonian();
     }
 }
Esempio n. 39
0
        public CubesAssets(Player a_player, ViewClasses.GameAssets a_assets, Map a_map, PathFinder a_pathfinder)
        {
            m_ownerID = a_player.m_playerID;
            m_race    = a_player.m_race;

            m_cube = new Cube(m_ownerID, a_assets.c_cube, 10, 10, Vector3.Zero, 10, a_player.AddUnderAttackPosition);

            m_cube.m_moveBehavior   = MovementFactory.m_standardMovement;
            m_cube.m_attackBehavior = new StandardAttack(m_cube, 1, 1, 3);

            m_cube.m_buildBehavior = BuildFactory.CreateNewVisibleBuild(a_player, m_cube, 1, a_map, a_pathfinder);

            m_barbarian = new Barbarian(m_ownerID, a_assets.c_barbarian, 30, 30, Vector3.Zero, 10, a_player.AddUnderAttackPosition);

            m_barbarian.m_moveBehavior   = MovementFactory.m_standardMovement;
            m_barbarian.m_attackBehavior = AttackFactory.CreateNewStandardAttack(m_barbarian, 1, 5, 3);

            m_extractor = new Extractor(m_ownerID, a_assets.c_extractor, 500, 500, Vector3.Zero, a_player.AddUnderAttackPosition);

            m_igloo = new CubeIgloo(m_ownerID, a_assets.c_igloo, 100, 100, Vector3.Zero, a_player.AddUnderAttackPosition);

            m_barrack = new Barrack(m_ownerID, a_assets.c_barrack, 200, 200, Vector3.Zero, a_player.AddUnderAttackPosition);
        }
        public void editCondition(Condition condition)
        {
            m_condition             = condition;
            guiTypeCbo.SelectedItem = m_condition.getConditionType();
            switch (m_condition.getConditionType())
            {
            case CommonTools.ConditionType.Overall_Level:
            case CommonTools.ConditionType.Combat_Level:
            case CommonTools.ConditionType.Explore_Level:
            case CommonTools.ConditionType.Trade_Level:
            case CommonTools.ConditionType.Hull_Level:
                guiAmountTxt.Text = m_condition.getValue();
                break;

            case CommonTools.ConditionType.Faction_Required:
                guiCodeTxt.Text   = m_condition.getValue();
                guiAmountTxt.Text = m_condition.getFlag();
                m_codeSearch.setDataType(DataConfiguration.DataType.faction);
                break;

            case CommonTools.ConditionType.Item_Required:
                guiCodeTxt.Text   = m_condition.getValue();
                guiAmountTxt.Text = m_condition.getFlag();
                m_codeSearch.setDataType(DataConfiguration.DataType.item);
                break;

            case CommonTools.ConditionType.Profession:
                Professions profession = (Professions)Int32.Parse(m_condition.getValue());
                guiValueCbo.SelectedItem = profession;
                break;

            case CommonTools.ConditionType.Race:
                Races race = (Races)Int32.Parse(m_condition.getValue());
                guiValueCbo.SelectedItem = race;
                break;
            }
        }
Esempio n. 41
0
        public Ship(BinaryReader r)
        {
            // data

            Id          = r.ReadInt32();
            LockID      = r.ReadInt32();
            OwnerID     = r.ReadInt32();
            IsInAuction = r.ReadByte();
            Race        = (Races)r.ReadInt32();
            ClassType   = (ClassTypes)r.ReadInt32();
            BPV         = r.ReadInt32();
            EPV         = r.ReadInt32();

            Utils.ReadString(r, out ShipClassName);
            Utils.ReadString(r, out Name);

            TurnCreated = r.ReadInt32();

            Damage   = new ShipDamage(r);
            Stores   = new ShipStores(r);
            Officers = new ShipOfficers(r);

            Flags = r.ReadInt32();

            // helpers

            int c = r.ReadInt32();

            if (c == 0)
            {
                ShipCache = null;
            }
            else
            {
                ShipCache = r.ReadBytes(c);
            }
        }
Esempio n. 42
0
        public static float GetAvgSize(Races race)
        {
            switch (race)
            {
            case Races.Humanoid: return(Humanoid);

            case Races.Human: return(Human);

            case Races.Elf: return(Elf);

            case Races.Orc: return(Orc);

            case Races.Troll: return(Troll);

            case Races.Dwarf: return(Dward);

            case Races.Halfling: return(Halfling);

            case Races.Fairy: return(Fairy);

            case Races.Incubus: return(Incubus);

            case Races.Succubus: return(Succubus);

            case Races.Equine: return(Equine);

            case Races.Dragon: return(Dragon);

            case Races.DragonKin: return(DragonKin);

            case Races.Amazon: return(Amazon);

            default:
                return(160f);
            }
        }
Esempio n. 43
0
 public Character(string name, Races race, Genders gender, int age, double maxHealth, int experience = 0)
 {
     if (String.IsNullOrEmpty(name) || name.Contains('\0'))
     {
         throw new Exception(rm.GetString("InvalidName"));
     }
     if (age < 0)
     {
         throw new Exception(rm.GetString("InvalidAge"));
     }
     if (maxHealth <= 0)
     {
         throw new Exception(rm.GetString("InvalidHealth"));
     }
     Inventory     = new Inventory();
     Id            = ++NextId;
     Name          = name;
     Race          = race;
     Gender        = gender;
     Age           = age;
     MaxHealth     = maxHealth;
     CurrentHealth = MaxHealth;
     Experience    = experience;
 }
Esempio n. 44
0
 // determine whether or not this ship should fight an alien ship
 public bool shouldIFightAlien(EnemyShip otherShip)
 {
     //if (otherShip.race >= 0 && otherShip.race < Races.size()) {
     if (this.angerAtRace.Length == Races.size())
     {
         float chance = this.GetSpecies().getAggro() + Random.Range(0, 4) + this.angerAtRace[otherShip.race];
         if (otherShip.race == this.race)
         {
             chance *= 0.5f;                              // if target is same race, reduce chance of fighting
         }
         if (chance >= 10)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     else
     {
         return(false);
     }
 }
Esempio n. 45
0
        private void AddRace(Player player, string[] args)
        {
            if (!player.HasPermission("RaceSystem.Modify"))
            {
                player.SendError(GetMessage("NoPermission", player)); return;
            }

            if (args.Length != 1)
            {
                player.SendError(GetMessage("InvalidArgs", player)); return;
            }

            var name = args[0];

            if (Races.FirstOrDefault(r => string.Equals(r.Name, name, StringComparison.CurrentCultureIgnoreCase)) != null)
            {
                player.SendError(GetMessage("RaceExists", player)); return;
            }

            Races.Add(new Race(name, "9f0000"));
            player.SendMessage(GetMessage("RaceAdded", player), name);

            SaveRaceData();
        }
Esempio n. 46
0
        private void ChangeColor(Player player, string[] args)
        {
            if (!player.HasPermission("RaceSystem.Modify"))
            {
                player.SendError(GetMessage("NoPermission", player)); return;
            }

            if (args.Length != 2)
            {
                player.SendError(GetMessage("InvalidArgs", player)); return;
            }

            var race = Races.FirstOrDefault(r => string.Equals(r.Name, args[0], StringComparison.CurrentCultureIgnoreCase));

            if (race == null)
            {
                player.SendError(GetMessage("RaceNonExisting", player)); return;
            }
            var color = args[1];

            if (!IsHex(color.ToCharArray()))
            {
                player.SendError(GetMessage("InvalidColor", player)); return;
            }

            race.ChangeColor(color);
            player.SendMessage(GetMessage("ColorChanged", player), race, color);

            foreach (var pl in Server.ClientPlayers)
            {
                CheckPlayerExcists(pl);
                Data[pl.Id].UpdateChatFormat(pl);
            }

            SaveRaceData();
        }
Esempio n. 47
0
        static BodyMorphology GetBodyMorphology(Races race)
        {
            switch (race)
            {
            case Races.Argonian:
                return(BodyMorphology.Argonian);

            case Races.DarkElf:
            case Races.HighElf:
            case Races.WoodElf:
                return(BodyMorphology.Elf);

            case Races.Breton:
            case Races.Nord:
            case Races.Redguard:
                return(BodyMorphology.Human);

            case Races.Khajiit:
                return(BodyMorphology.Khajiit);

            default:
                throw new Exception("GetBodyMorphology() encountered unsupported race value.");
            }
        }
Esempio n. 48
0
    // METHOD TO SPAWN A NEW SHIP AT A LOCATION
    GameObject createShip(int race, int shipType, float x, float z, float fuel = 10000f, float hp = 100)
    {
        GameObject shipSpawn;
        Species    shipRace = Races.get(race);
        //float size = ((float)shipRace.getSize() + 1) / 5; // ship size between .2 and 2.2
        float size = ((float)shipRace.getSize() + shipRace.getIntellect() + 1) / 8; // ship size between .1 and 2.1 using intelligence and size

        switch (shipType)
        {
        case 2:
            // create the ship game object
            shipSpawn = (GameObject)Instantiate(ship2, new Vector3(x, 0, z), Quaternion.identity);
            shipSpawn.transform.localScale = new Vector3(size * 3f, size * 1f, size * 3f);     // set ship to size of race
            break;

        case 1:
            // create the ship game object
            shipSpawn = (GameObject)Instantiate(ship1, new Vector3(x, 0, z), Quaternion.identity);
            shipSpawn.transform.localScale = new Vector3(size * 2f, size * 2f, size * 2f);     // set ship to size of race
            break;

        case 0:
        default:
            // create the ship game object
            shipSpawn = (GameObject)Instantiate(ship0, new Vector3(x, 0, z), Quaternion.identity);
            shipSpawn.transform.localScale = new Vector3(size, size, size * 2);     // set ship to size of race
            break;
        }
        shipSpawn.GetComponent <EnemyShip>().race = race;
        //shipSpawn.GetComponent<EnemyShip>().speed = 2 * (shipRace.getIntellect() + 1); // set speed according to intelligence
        shipSpawn.GetComponent <EnemyShip>().speed         = 10 + (shipRace.getIntellect() / 2);
        shipSpawn.GetComponent <Renderer>().material.color = shipRace.getColor(); // set ship to color of race
        shipSpawn.GetComponent <EnemyShip>().fuel          = fuel;
        shipSpawn.GetComponent <EnemyShip>().hp            = hp;
        return(shipSpawn);
    }
Esempio n. 49
0
        static void Main(string[] args)
        {
            // classes
            var classOptions = Classes.ClassOptions();
            var firstClass   = classOptions.First();
            var myClass      = Classes.GetClass(firstClass);
            // races
            var raceOptions = Races.RaceOptions();
            var firstRace   = raceOptions.First();
            var myRace      = Races.GetRace(firstRace);
            // monsters
            var monsterOptions = Monsters.MonsterOptions();
            var types          = Monsters.Types;
            var sizes          = Monsters.Sizes;
            var search         = new Monsters.Search(size: sizes[0]);
            var result         = Monsters.MonsterOptions(search);

            search = new Monsters.Search(type: types[0]);
            result = Monsters.MonsterOptions(search);
            search = new Monsters.Search(type: types[5], size: sizes[2]);
            result = Monsters.MonsterOptions(search);
            // spells
            var search2 = new Spells.Search(level: 0);

            result  = Spells.SpellOptions(search2);
            search2 = new Spells.Search(level: 1);
            result  = Spells.SpellOptions(search2);
            search2 = new Spells.Search(level: 2);
            result  = Spells.SpellOptions(search2);
            search2 = new Spells.Search(level: 1, school: "Necromancy");
            result  = Spells.SpellOptions(search2);
            search2 = new Spells.Search(level: 0, @class: "Druid");
            result  = Spells.SpellOptions(search2);
            search2 = new Spells.Search(level: 3, @class: "Wizard", school: "Evocation");
            result  = Spells.SpellOptions(search2);
        }
Esempio n. 50
0
        protected async override void ViewIsAppearing(object sender, EventArgs e)
        {
            base.ViewIsAppearing(sender, e);

            _userDialogs.ShowLoading("Retrieving All Races");
            var user = await _userManager.GetUser();

            if (_userManager.IsAnonymous(user))
            {
                Races.Clear();
            }
            else if (Races.Count == 0)
            {
                var races = await _dataService.GetRaces(user);

                var orderedRaces = races.OrderBy(x => x.RaceDate);
                foreach (var race in orderedRaces)
                {
                    Races.Add(race);
                }
            }
            SelectedRace = null;
            _userDialogs.HideLoading();
        }
Esempio n. 51
0
 /// <summary>
 /// Sets the race based on the string value entered.
 /// </summary>
 /// <param name="r">Name of the character race</param>
 public void setRace(string r)
 {
     pRace = r.ParseEnum<Races>();
 }
Esempio n. 52
0
        public StatusInfoPacket(PacketReader reader)
            : base(0x11, "StatusInfo")
        {
            Serial = reader.ReadInt32();
            PlayerName = reader.ReadString(30);
            CurrentHealth = reader.ReadInt16();
            MaxHealth = reader.ReadInt16();
            NameChangeFlag = reader.ReadByte() != 0x00; // 0x1 = allowed, 0 = not allowed
            StatusTypeFlag = reader.ReadByte();
            if (StatusTypeFlag > 0)
            {
                Sex = (Genders)reader.ReadByte(); // 0=male, 1=female
                Strength = reader.ReadInt16();
                Dexterity = reader.ReadInt16();
                Intelligence = reader.ReadInt16();
                CurrentStamina = reader.ReadInt16();
                MaxStamina = reader.ReadInt16();
                CurrentMana = reader.ReadInt16();
                MaxMana = reader.ReadInt16();
                GoldInInventory = reader.ReadInt32();
                ArmorRating = reader.ReadInt16();
                Weight = reader.ReadInt16();

                if (StatusTypeFlag >= 5)
                {
                    MaxWeight = reader.ReadInt16();
                    Race = (Races)reader.ReadByte();
                }

                if (StatusTypeFlag >= 3)
                {
                    StatCap = reader.ReadInt16();
                    Followers = reader.ReadByte();
                    MaxFollowers = reader.ReadByte();
                }

                if (StatusTypeFlag >= 4)
                {
                    ResistFire = reader.ReadInt16();
                    ResistCold = reader.ReadInt16();
                    ResistPoison = reader.ReadInt16();
                    ResistEnergy = reader.ReadInt16();
                    Luck = reader.ReadInt16();
                    DmgMin = reader.ReadInt16();
                    DmgMax = reader.ReadInt16();
                    TithingPoints = reader.ReadInt32();
                }

                if(StatusTypeFlag >= 6)
                {
                    //TODO
                    reader.ReadInt16();//wordHit Chance Increase(KR attribute)
                    reader.ReadInt16();//wordSwing Speed Increase(KR attribute)
                    reader.ReadInt16();//wordDamage Chance Increase(KR attribute)
                    reader.ReadInt16();//wordLower Reagent Cost(KR attribute)
                    reader.ReadInt16();//wordHit Points Regeneration(KR attribute)
                    reader.ReadInt16();//wordStamina Regeneration (KR attribute)
                    reader.ReadInt16();//wordMana Regeneration (KR attribute)
                    reader.ReadInt16();//wordReflect Physical Damage(KR attribute)
                    reader.ReadInt16();//wordEnhance Potions (KR attribute)
                    reader.ReadInt16();//wordDefense Chance Increase(KR attribute)
                    reader.ReadInt16();//wordSpell Damage Increase(KR attribute)
                    reader.ReadInt16();//wordFaster Cast Recovery(KR attribute)
                    reader.ReadInt16();//wordFaster Casting (KR attribute)
                    reader.ReadInt16();//wordLower Mana Cost(KR attribute)
                    reader.ReadInt16();//wordStrength Increase (KR attribute)
                    reader.ReadInt16();//wordDexterity Increase (KR attribute)
                    reader.ReadInt16();//wordIntelligence Increase (KR attribute)
                    reader.ReadInt16();//wordHit Points Increase(KR attribute)
                    reader.ReadInt16();//wordStamina Increase (KR attribute)
                    reader.ReadInt16();//wordMana Increase (KR attribute)
                    reader.ReadInt16();//wordMaximum Hit Points Increase (KR attribute)
                    reader.ReadInt16();//wordMaximum Stamina Increase(KR attribute)
                    reader.ReadInt16();//wordMaximum Mana Increase(KR attribute)
                }
            }
        }
Esempio n. 53
0
		public Character( Account acc, byte []data ): this( -8897.50f, -173.480f, 81.5775f, 0f )
		{			
			account = acc;
			Name = "";
			int part = 0;
			for(int t = 6;t < data.Length;t++ )			
			{
				byte b = data[ t ];
				if ( part == 0 )
				{
					if ( b == 0 )
					{
						part++;					
					}
					else
						if ( b != 0 && part == 0 )
						Name += (char)b;
				}
				else
					if ( part == 1 )
				{
					race = (Races)b;
					part++;
				}
				else
					if ( part == 2 )
				{							
					switch( b )
					{
						case (int)Classes.Warrior:
							if ( !World.WarriorClassAvailable )
							{
								this.Send( OpCodes.SMSG_CHAR_CREATE, new byte[]{ 0, 0, 0, 0, 0x31 } );
								Name = null;
								return;
							}
							Classe = Classes.Warrior;
							manaType = 1;
							AllSkills.Add( new DaggerSkill( 1, 300 ) );
							AllSkills.Add( new AxeSkill( 1, 300 ) );
							AllSkills.Add( new SwordSkill( 1, 300 ) );
							AllSkills.Add( new MacesSkill( 1, 300 ) );
							AllSkills.Add( new ShieldSkill( 1, 1 ) );
							AllSkills.Add( new ClothSkill( 1, 1 ) );
							AllSkills.Add( new LeatherSkill( 1, 1 ) );
							AllSkills.Add( new MailSkill( 1, 1 ) );
							
							if ( Race == Races.Orc || Race == Races.Dwarf )
								AllSkills.Add( new TwoHandedAxeSkill( 1, 300 ) );
							else
							if ( Race == Races.Tauren )
								AllSkills.Add( new TwoHandedMaceSkill( 1, 300 ) );
							else								
								AllSkills.Add( new TwoHandedSwordSkill( 1, 300 ) );
							AllSkills.Add( new Arms( 1, 1 ) );
							AllSkills.Add( new Protection( 1, 1 ) );
							Mana = BaseMana = 100;							
							break;
						case (int)Classes.Paladin:
							if ( !World.PaladinClassAvailable )
							{
								this.Send( OpCodes.SMSG_CHAR_CREATE, new byte[]{ 0, 0, 0, 0, 0x31 } );
								Name = null;
								return;
							}
							Classe = Classes.Paladin;
							manaType = 0;
							AllSkills.Add( new TwoHandedMaceSkill( 1, 300 ) );
							AllSkills.Add( new MacesSkill( 1, 300 ) );
							AllSkills.Add( new ClothSkill( 1, 1 ) );
							AllSkills.Add( new ShieldSkill( 1, 1 ) );
							AllSkills.Add( new LeatherSkill( 1, 1 ) );
							AllSkills.Add( new MailSkill( 1, 1 ) );
							break;
						case (int)Classes.Rogue:
							if ( !World.RogueClassAvailable )
							{
								this.Send( OpCodes.SMSG_CHAR_CREATE, new byte[]{ 0, 0, 0, 0, 0x31 } );
								Name = null;
								return;
							}
							Classe = Classes.Rogue;
							manaType = 3;
							AllSkills.Add( new ThrowsSkill( 1, 300 ) );
							AllSkills.Add( new DaggerSkill( 1, 300 ) );
							AllSkills.Add( new ThrowsSkill( 1, 300 ) );
							AllSkills.Add( new ClothSkill( 1, 1 ) );
							AllSkills.Add( new LeatherSkill( 1, 1 ) );
							AllSkills.Add( new Assassination( 1, 1 ) );
							AllSkills.Add( new Subtlety( 1, 1 ) );
							AllSkills.Add( new Combat( 1, 1 ) );
							Mana = BaseMana = 100;
							break;
						case (int)Classes.Hunter:
							if ( !World.HunterClassAvailable )
							{
								this.Send( OpCodes.SMSG_CHAR_CREATE, new byte[]{ 0, 0, 0, 0, 0x31 } );
								Name = null;
								return;
							}
							Classe = Classes.Hunter;
							manaType = 0;
							AllSkills.Add( new AxeSkill( 1, 300 ) );
							AllSkills.Add( new BowsSkill( 1, 300 ) );
							AllSkills.Add( new DaggerSkill( 1, 300 ) );
							AllSkills.Add( new LeatherSkill( 1, 1 ) );
							AllSkills.Add( new ClothSkill( 1, 1 ) );
							AllSkills.Add( new GunSkill( 1, 300 ) );
							break;
						case (int)Classes.Warlock:
							if ( !World.WarlockClassAvailable )
							{
								this.Send( OpCodes.SMSG_CHAR_CREATE, new byte[]{ 0, 0, 0, 0, 0x31 } );
								Name = null;
								return;
							}
							Classe = Classes.Warlock;
							manaType = 0;
							AllSkills.Add( new WandsSkill( 1, 300 ) );
							AllSkills.Add( new DaggerSkill( 1, 300 ) );
							AllSkills.Add( new Destruction( 1, 300 ) );
							AllSkills.Add( new Demonology( 1, 300 ) );
							AllSkills.Add( new Affliction( 1, 300 ) );
							AllSkills.Add( new ClothSkill( 1, 1 ) );
							Mana = BaseMana = 100;
							break;
						case (int)Classes.Mage:
							if ( !World.MageClassAvailable )
							{
								this.Send( OpCodes.SMSG_CHAR_CREATE, new byte[]{ 0, 0, 0, 0, 0x31 } );
								Name = null;
								return;
							}
							Classe = Classes.Mage;
							manaType = 0;
							AllSkills.Add( new WandsSkill( 1, 300 ) );
							//AllSkills.Add( new DaggerSkill( 1, 300 ) );
							AllSkills.Add( new StavesSkill( 1, 300 ) );
							AllSkills.Add( new ClothSkill( 1, 300 ) );

							AllSkills.Add( new ArcaneSkill( 1, 300 ) );
							AllSkills.Add( new FireSkill( 1, 300 ) );
							AllSkills.Add( new FrostSkill( 1, 300 ) );

							Mana = BaseMana = 100;
							break;
						case (int)Classes.Shaman:
							if ( !World.ShamanClassAvailable )
							{
								this.Send( OpCodes.SMSG_CHAR_CREATE, new byte[]{ 0, 0, 0, 0, 0x31 } );
								Name = null;
								return;
							}
							Classe = Classes.Shaman;
							manaType = 0;
							AllSkills.Add( new StavesSkill( 1, 300 ) );
							AllSkills.Add( new MacesSkill( 1, 300 ) );
							AllSkills.Add( new ClothSkill( 1, 1 ) );
							AllSkills.Add( new LeatherSkill( 1, 1 ) );
							break;
						case (int)Classes.Priest:
							if ( !World.PriestClassAvailable )
							{
								this.Send( OpCodes.SMSG_CHAR_CREATE, new byte[]{ 0, 0, 0, 0, 0x31 } );
								Name = null;
								return;
							}
							Classe = Classes.Priest;
							manaType = 0;
							AllSkills.Add( new WandsSkill( 1, 300 ) );
							AllSkills.Add( new MacesSkill( 1, 300 ) );
							AllSkills.Add( new ClothSkill( 1, 1 ) );
							break;
						case (int)Classes.Druid:
							if ( !World.DruidClassAvailable )
							{
								this.Send( OpCodes.SMSG_CHAR_CREATE, new byte[]{ 0, 0, 0, 0, 0x31 } );
								Name = null;
								return;
							}
							Classe = Classes.Druid;
							manaType = 0;
							AllSkills.Add( new StavesSkill( 1, 300 ) );
							AllSkills.Add( new LeatherSkill( 1, 1 ) );
							AllSkills.Add( new ClothSkill( 1, 1 ) );
							break;
						default:
							manaType = 0;
							break;
					}
					part++;
				}
				else
					if ( part == 3 )
				{
					gender = b;
					part++;
				}
				else
					if ( part == 4 )
				{
					skin = b;
					part++;
				}
				else
					if ( part == 5 )
				{
					face = b;
					part++;
				}
				else
					if ( part == 6 )
				{
					hairStyle = b;
					part++;
				}
				else
					if ( part == 7 )
				{
					hairColour = b;
					part++;
				}
				else
					if ( part == 8 )
				{
					facialHair = b;
					part++;
					break;
				}
			}


			foreach( Account acco in World.allAccounts )
				foreach( Character ch in acco.characteres )
					if ( ch.Name.ToLower() == Name.ToLower() )
					{
						byte []pack = new byte[]{  0x00, 0x03, 0x3a, 0x00, 0x39 };
						Send( pack );
						Name = null;
						return;
					}

			MapId = 0;
			ZoneId = 9;

			HitPoints = 50;
			BaseHitPoints = 50;
			Rage = BaseRage = 350;
			Level = 1;

			//	Skill lang = null;

			/*TrainAbility( 6247 );//	Open
			TrainAbility( 6249 );//	Open
			TrainAbility( 6461 );//	Open*/
			TrainAbility( 6477 );//	Open
			TrainAbility( 6478 );//	Open
			TrainAbility( 7266 );//	Open
			//TrainAbility( 11437 );//	Open

			switch( Race)
			{
				case Races.Human:
					Faction = Factions.Player_Human;
					break;
				case Races.Dwarf:
					Faction = Factions.Player_Dwarf;
					break;
				case Races.NightElf:
					Faction = Factions.Player_Elf;
					break;
				case Races.Gnome:
					Faction = Factions.Player_Gnome;
					break;
				case Races.Orc:
					Faction = Factions.Player_Orc;
					break;
				case Races.Undead:
					Faction = Factions.Player_Undead;
					break;
				case Races.Tauren:
					Faction = Factions.Player_Tauren;
					break;
				case Races.Troll:
					Faction = Factions.Player_Troll;
					break;
			}
			foreach( Factions f in World.FriendRaces[ Race ] as ArrayList )
				reputationAdjustments[ (int)World.FactionAssociated[ f ] ] = 0;

			onCharacterChooseRace( this, race );
			Copper = 100;
			AllSkills.Add( new UnarmedSkill( 1, 300 ) );
			AllSkills.Add( new DefenseSkill( 1, 300 ) );

			OnCreateCharacter();
			byte []ok = new byte[]{  0x00, 0x03, 0x3a, 0x00, 0x2d };
			Send( ok );
		}
Esempio n. 54
0
		public override void Deserialize( GenericReader gr )
		{
			base.Deserialize( gr );
			int version = gr.ReadInt();
			if ( version > 6 )
			{
				int nreput = gr.ReadInt();
				for(int t = 0;t < nreput;t++ )
				{
					int krep = gr.ReadInt();
					int vrep = gr.ReadInt();
					reputationAdjustments[ krep ] = vrep;
				}
			}
			if ( version > 5 )
			{
				int nact = gr.ReadInt();
				for(int t = 0;t < nact;t++ )
					actionBar.Add( new Action( gr ) );
			}
			if ( version > 4 )
			{
				int nf = gr.ReadInt();
				for(int t = 0;t < nf;t++ )
				{
					UInt64 gu = (UInt64)gr.ReadInt64();
					friends.Add( gu );
					string user = gr.ReadString();
					friends.Add( user );
				}
			}
			if ( version > 2 )
			{
				BindingPointX = gr.ReadFloat();
				BindingPointY = gr.ReadFloat();
				BindingPointZ = gr.ReadFloat();
				BindingPointMapId = (UInt16)gr.ReadInt();
			}
			if ( version > 1 )
			{
				bool pa = gr.ReadBool();
				if ( pa )
				{
					petActions = new int[ 11 ];
					for(int t = 0;t < 11;t++ )
						petActions[ t ] = gr.ReadInt();
				}
			}
			int sum = gr.ReadInt();
			if ( sum != 0 )
			{
				UInt64 g = gr.ReadInt64();
				if ( version > 7 )
				{
					int sid = gr.ReadInt();
					Summon = new BaseCreature( gr );
					Summon.Id = sid;
				}
			//	Summon = (Mobile)MobileList.TempSummon[ g ];
				Summon.SummonedBy = this;					
				( Summon as BaseCreature ).AIEngine = new SummonedAI( this, Summon as BaseCreature );
			}
			sum = gr.ReadInt();
			if ( sum != 0 )
			{
				Charm = (Mobile)MobileList.TempSummon[ gr.ReadInt64() ];
				Charm.CharmedBy = this;
				( Charm as BaseCreature ).AIEngine = new SummonedAI( this, Charm as BaseCreature );
			}
			CorpseLocationX = gr.ReadFloat();
			CorpseLocationY = gr.ReadFloat();
			CorpseLocationZ = gr.ReadFloat();
			if ( version > 3 )
				CorpseMapId = (ushort)gr.ReadShort();
			corpsGuid = gr.ReadInt64();
			zones = new uint[ 32 ];
			for(int t = 0;t < 32;t++ )
				zones[ t ] = (uint)gr.ReadInt();
			int exi = gr.ReadInt();
			if ( exi == 1 )
			{
				mark = new Position( gr.ReadFloat(), gr.ReadFloat(), gr.ReadFloat(), gr.ReadInt() );
			}
			ammoType = gr.ReadInt();
			race = (Races)gr.ReadByte();
			if ( version == 0 )
				Classe = (Classes)gr.ReadByte();
			gender = gr.ReadByte();
			skin = gr.ReadByte();
			face = gr.ReadByte();
			hairStyle = gr.ReadByte();
			hairColour = gr.ReadByte();
			facialHair = gr.ReadByte();

			copper = (uint)gr.ReadInt();
			int nactq = 20;
			for(int t = 0;t < nactq;t++ )
			{
				int vv = gr.ReadInt();
				if ( vv == 1 )
				{
					ActiveQuest aq = new ActiveQuest( gr );
					if ( aq.Id > 0 )
						AddQuest( aq );
				}
			}

			int nq = gr.ReadInt();
			for(int t = 0;t < nq;t++ )
			{
				int id = gr.ReadInt();
				questsDone[ id ] = true;
			}
			for(int g = 0;g < 8;g++ )
			{
				int field = gr.ReadInt();
				TaxiField[ g ] = (uint)field;
			}
		//	RunSpeed = 11f;
			
		}
Esempio n. 55
0
        public static string GetRandomSecondName(Races sRaces)
        {
            string s = "";

            if (sRaces == Races.Human) {
                s += string.Format(" {0}", HumanSecondnames[rnd.Next(0, HumanSecondnames.Length)]);
            }

            return s;
        }
Esempio n. 56
0
 public void SetPlayerRace(Races race)
 {
     playerRace = race;
     switch (playerRace)
     {
         case Races.ELVES:
             pauseMenuPrefab = "PauseMenu-Elf";
             break;
         case Races.MEN:
             pauseMenuPrefab = "PauseMenu-Human";
             break;
     }
 }
Esempio n. 57
0
		public void CopyAllParameters(Character from) 
		{ 
			//Skills 
			AllSkills.Clear(); 
			IDictionaryEnumerator enumerator = from.AllSkills.GetEnumerator(); 
			while (enumerator.MoveNext()) 
			{ 
				AllSkills.Add( (ushort)enumerator.Key, (Skill)enumerator.Value);             
			} 
			//Abilities 
			KnownAbilities.Clear(); 
			enumerator = from.KnownAbilities.GetEnumerator(); 
			while (enumerator.MoveNext()) 
			{ 
				KnownAbilities.Add( enumerator.Key, enumerator.Value);             
			} 
			//Items 
			
			for(int i=0; i<from.Items.Length; i++) 
			{ 
				if (from.Items[i] != null) 
				{ 
					ConstructorInfo info = HelperTools.Utility.FindConstructor( from.Items[i].GetType().Name); 
					Item newitem = (Item)info.Invoke(null); 
					Items[i] = newitem; 
				}    
				else
					Items[ i ] = null;
			} 
			//Mobile fields       
			Classe = from.Classe; 
			ManaType = from.ManaType; 
			BaseHitPoints = from.BaseHitPoints; 
			HitPoints = from.HitPoints;
			Mana = from.Mana;
			BaseMana = from.BaseMana;          
			BaseAgility = from.BaseAgility; 
			BaseEnergy = from.BaseEnergy; 
			BaseFocus = from.BaseFocus; 
			BaseIq = from.BaseIq; 
			BaseRage = from.BaseRage; 
			BaseSpirit = from.BaseSpirit; 
			BaseStamina = from.BaseStamina; 
			BaseStr = from.BaseStr; 
			Exp = from.Exp; 
			Faction = from.Faction; 
			Level = from.Level; 
			Model = from.Model;          
			Orientation = from.Orientation; 
			RunSpeed = from.RunSpeed; 
			WalkSpeed = from.WalkSpeed; 
			Speed = from.Speed; 

			//Local fields 
			gender = (byte)from.Gender; 
			skin = (byte)from.Skin; 
			face = (byte)from.Face; 
			hairStyle = (byte)from.HairStyle; 
			hairColour = (byte)from.HairColour; 
			race = from.Race; 
			facialHair = (byte)from.FacialHair;                      
		} 
Esempio n. 58
0
 /// <summary>
 /// Overloaded Guard Constructor
 /// </summary>
 /// <param name="name">Guard's Name</param>
 /// <param name="description">Guard's Description</param>
 /// <param name="gender">Guard's Gender</param>
 /// <param name="race">Guard's Race</param>
 public Guard(string name, string description, Genders gender, Races race)
     : base(name, description, gender, race)
 {
     _currentRoomNumber = 0;
     _greeting = "Move along!";
 }
Esempio n. 59
0
 void Start()
 {
     m_race = GetComponent<Races> ();
 }
Esempio n. 60
0
 string getRace(Races r)
 {
     return r.GetDescription();
 }