Beispiel #1
0
        private static void HandleAddTab(GameSession session)
        {
            if (!session.Player.Account.RemoveMerets(990))
            {
                return;
            }

            session.Send(SkillBookTreePacket.AddTab(session.Player));
        }
Beispiel #2
0
        private static void HandleRename(GameSession session, PacketReader packet)
        {
            long   id      = packet.ReadLong();
            string newName = packet.ReadUnicodeString();

            SkillTab skillTab = session.Player.SkillTabs.FirstOrDefault(x => x.TabId == id);

            skillTab.Name = newName;
            session.Send(SkillBookTreePacket.Rename(id, newName));
        }
Beispiel #3
0
    private static void HandleSave(GameSession session, PacketReader packet)
    {
        Player player = session.Player;

        long activeTabId = packet.ReadLong();
        long selectedTab = packet.ReadLong(); // if 0 player used activate tab
        int  unknown     = packet.ReadInt();
        int  tabCount    = packet.ReadInt();

        for (int i = 0; i < tabCount; i++)
        {
            long   tabId   = packet.ReadLong();
            string tabName = packet.ReadUnicodeString();

            SkillTab skillTab = player.SkillTabs.FirstOrDefault(x => x.TabId == tabId);
            if (skillTab is null)
            {
                skillTab = new(player.CharacterId, player.Job, player.JobCode, tabId, tabName);
                player.SkillTabs.Add(skillTab);
            }
            else
            {
                skillTab       = player.SkillTabs[i];
                skillTab.TabId = tabId;
                skillTab.Name  = tabName;
            }

            // Count of skills that were added to the tab, doesn't show skills that were removed
            int skillCount = packet.ReadInt();
            for (int j = 0; j < skillCount; j++)
            {
                int skillId    = packet.ReadInt();
                int skillLevel = packet.ReadInt();

                // not sure what to do with this
            }
        }

        session.Player.ActiveSkillTabId = activeTabId;
        session.Send(SkillBookTreePacket.Save(session.Player, selectedTab));
        foreach (SkillTab skillTab in session.Player.SkillTabs)
        {
            DatabaseManager.SkillTabs.Update(skillTab);
        }

        if (selectedTab == 0)
        {
            session.Player.UpdatePassiveSkills();
        }
    }
Beispiel #4
0
        private static void HandleSave(GameSession session, PacketReader packet)
        {
            long activeTabId = packet.ReadLong();
            long selectedTab = packet.ReadLong(); // if 0 player used activate tab
            int  unknown     = packet.ReadInt();
            int  tabCount    = packet.ReadInt();

            for (int i = 0; i < tabCount; i++)
            {
                long   tabId   = packet.ReadLong();
                string tabName = packet.ReadUnicodeString();

                SkillTab skillTab = session.Player.SkillTabs.FirstOrDefault(x => x.TabId == tabId);
                if (skillTab == default)
                {
                    skillTab = new SkillTab(session.Player.CharacterId, session.Player.Job, tabId, tabName);
                    session.Player.SkillTabs.Add(skillTab);
                }
                else
                {
                    skillTab       = session.Player.SkillTabs[i];
                    skillTab.TabId = tabId;
                    skillTab.Name  = tabName;
                }

                skillTab.ResetSkillTree(session.Player.Job);
                int skillCount = packet.ReadInt();
                for (int j = 0; j < skillCount; j++)
                {
                    int skillId    = packet.ReadInt();
                    int skillLevel = packet.ReadInt();
                    skillTab.AddOrUpdate(skillId, (short)skillLevel, skillLevel > 0);
                }
            }

            session.Player.ActiveSkillTabId = activeTabId;
            session.Send(SkillBookTreePacket.Save(session.Player, selectedTab));
            foreach (SkillTab skillTab in session.Player.SkillTabs)
            {
                DatabaseManager.SkillTabs.Update(skillTab);
            }
        }
Beispiel #5
0
 private static void HandleSave(GameSession session)
 {
     session.Send(SkillBookTreePacket.Save(session.Player));
 }
 private void HandleSave(GameSession session, PacketReader packet)
 {
     session.Send(SkillBookTreePacket.Save(session.Player));
 }
 private void HandleOpen(GameSession session)
 {
     session.Send(SkillBookTreePacket.Open(session.Player));
 }
 private static void HandleAddTab(GameSession session)
 {
     session.Send(SkillBookTreePacket.AddTab(session.Player));
 }