Пример #1
0
        public void LevelUp()
        {
            int maxhealth = this.MaxHealth;
            int maxpower  = this.MaxPower;

            this.Level++;
            StatManager.CalculateNextLevelExp(this);
            this.Exp = 0;
            StatManager.CalculateNewStats(this);
            this.Health = this.MaxHealth;
            this.Power  = this.MaxPower;
            UpdateData();
            Save();

            ServerPacket pkg = new ServerPacket(SMSG.LEVELUP_INFO);

            pkg.Write((uint)this.Level);
            pkg.Write((uint)(this.MaxHealth - maxhealth));
            pkg.Write((uint)(this.MaxPower - maxpower));
            pkg.Write((uint)0);
            pkg.Write((uint)0);
            pkg.Write((uint)0);

            pkg.Write((uint)0);
            pkg.Write((uint)0);
            pkg.Write((uint)0);
            pkg.Write((uint)0);
            pkg.Write((uint)0);
            pkg.Write((uint)0);

            pkg.Finish();
            pkg.AddDestination(this.CharacterID);
            WorldServer.Send(pkg);
        }
Пример #2
0
        //		[UpdateValueAttribute(PLAYERFIELDS.SKILL_INFO, ArraySize=384)]
        //		protected uint [] m_skill_info;

        public PlayerObject(DBCharacter c) : base()
        {
            m_character                     = c;
            m_character.Health              = c.Health;
            m_character.MaxHealth           = c.MaxHealth;
            m_character.Power               = c.Power;
            m_character.MaxPower            = c.MaxPower;
            m_character.Strength            = c.Strength;
            m_character.BaseStrength        = c.BaseStrength;
            m_character.Stamina             = c.Stamina;
            m_character.BaseStamina         = c.BaseStamina;
            m_character.Agility             = c.Agility;
            m_character.BaseAgility         = c.BaseAgility;
            m_character.Intellect           = c.Intellect;
            m_character.BaseIntellect       = c.BaseIntellect;
            m_character.Spirit              = c.Spirit;
            m_character.BaseSpirit          = c.BaseSpirit;
            m_character.AttackPower         = c.AttackPower;
            m_character.AttackPowerModifier = c.AttackPowerModifier;
            m_character.GuildID             = c.GuildID;
            m_character.GuildRank           = c.GuildRank;
            m_character.GuildTimeStamp      = WorldClock.GetTimeStamp();


            m_scale           = c.Scale;
            m_displayID       = c.DisplayID;
            m_nativedisplayID = c.DisplayID;
            m_playerFlags     = 0;
            m_accessLevel     = ACCESSLEVEL.NORMAL;
            m_baseattacktime  = 2000;
            //			m_skill_info = new uint[384];
            //			m_skill_info[0] = 133;	//Just for a test, Mage spell fireball
            Inventory = new PlayerInventory(this);
            if (c.Items != null)
            {
                foreach (DBItem item in c.Items)
                {
                    Inventory.CreateItem(item);
                }
            }
            StatManager.CalculateNextLevelExp(this);
            StatManager.CalculateNewStats(this);

            ObjectManager.AddWorldObject(this);
            EventManager.AddEvent(new AggrMonsterEvent(this));
            EventManager.AddEvent(new RoamingEvent(this));
        }