Пример #1
0
        /// <summary>
        /// Handler for NPC_ACCEPT packet, when character levels up from exp earned when killing an NPC
        /// </summary>
        /// <param name="pkt"></param>
        public static void NPCAccept(Packet pkt)
        {
            NPCSpec(pkt);             //same handler for the first part of the packet

            byte  level    = World.Instance.MainPlayer.ActiveCharacter.RenderData.level = pkt.GetChar();
            short statpts  = pkt.GetShort();
            short skillpts = pkt.GetShort();
            short maxHP    = pkt.GetShort();
            short maxTP    = pkt.GetShort();
            short maxSP    = pkt.GetShort();

            World.Instance.MainPlayer.ActiveCharacter.Emote(EndlessClient.Emote.LevelUp);
            World.Instance.ActiveCharacterRenderer.PlayerEmote();

            //local reference for readability
            CharStatData stats = World.Instance.MainPlayer.ActiveCharacter.Stats;

            stats.level       = level;
            stats.statpoints  = statpts;
            stats.skillpoints = skillpts;
            stats.SetMaxHP(maxHP);
            stats.SetMaxTP(maxTP);
            stats.SetMaxSP(maxSP);
            EOGame.Instance.Hud.RefreshStats();
        }
Пример #2
0
		protected BaseStatusBar()
		{
			m_stats = World.Instance.MainPlayer.ActiveCharacter.Stats;
			
			m_textSheet = ((EOGame)Game).GFXManager.TextureFromResource(GFXTypes.PostLoginUI, 58, true);
			m_elemSourceRect = new Rectangle(0, 0, 110, 14);

			if(!Game.Components.Contains(this))
				Game.Components.Add(this);
		
			m_label = new XNALabel(drawArea.WithPosition(new Vector2(2, 14)), Constants.FontSize08)
			{
				AutoSize = false,
				BackColor = Color.Transparent,
				ForeColor = Constants.LightGrayText,
				Visible = false
			};
			m_label.SetParent(this);
		}