Esempio n. 1
0
        public void SendRenownAbility(CharacterInfoRenown ren, byte trained)
        {
            PacketOut Out = new PacketOut((byte)Opcodes.F_CAREER_PACKAGE_INFO, 64);

            Out.WriteByte(ren.Tree);
            Out.WriteByte(1);
            Out.WriteByte(0);
            Out.WriteByte(ren.Position);
            Out.Fill(0, 2);
            Out.WriteByte(1);
            Out.WriteByte(0);
            Out.WriteByte(trained);                               // skill trained
            Out.WriteByte(2);
            Out.Fill(0, 14);
            Out.WriteByte(ren.Renown_Costs);    // renown costs
            Out.WriteByte(1);
            Out.WriteByte(0);
            Out.WriteByte(0);
            Out.WriteUInt16(ren.SpellId);    // ability id
            if (ren.Unk.Length > 0)
            {
                Out.WriteHexStringBytes(ren.Unk.Replace(" ", ""));
            }

            else
            {
                Out.WriteByte(3);
                Out.Fill(0, 3);
                Out.WriteUInt16(0x0204);            //???
            }
            Out.WritePascalString("");              // name
            if (ren.Slotreq == 0)
            {
                Out.Fill(0, 5);
            }
            else   // requirement
            {
                Out.WriteByte(1);
                Out.WriteByte(0);
                Out.WriteByte(ren.Slotreq);
                Out.Fill(0, 5);
            }
            _player.SendPacket(Out);
        }
Esempio n. 2
0
        public void LoadSkills()
        {
            if (_player._Value.RenownSkills?.Length > 0)
            {
                string command = "";
                byte   stat    = 0;
                int    value   = 0;

                string[] temp = _player._Value.RenownSkills.Split(';');
                foreach (string str in temp)
                {
                    if (str.Length > 0)
                    {
                        int tree = int.Parse(str.Split(':')[0]);
                        int pos  = int.Parse(str.Split(':')[1]);

                        CharacterInfoRenown ren = CharMgr.RenownAbilityInfo[(byte)(tree + 9)][pos];

                        _trained[tree][pos] = ren.SpellId;
                        PointsSpent        += ren.Renown_Costs;

                        if (ren.Slotreq == 0 || !ren.Passive)
                        {
                            if (value != 0 || (!string.IsNullOrEmpty(command) && !ren.Passive))
                            {
                                ExecuteCommand(command, stat, value);

                                _savedCommandInfo.Add(new Tuple <string, byte, int>(command, stat, value));
                            }

                            command = ren.CommandName;
                            stat    = ren.Stat;
                            value   = ren.Value;
                        }

                        else
                        {
                            value += ren.Value;
                        }

                        if (ren.Passive)
                        {
                            _passiveIds.Add(ren.SpellId);
                        }
                        else
                        {
                            _activeIds.Add(ren.SpellId);
                        }
                    }
                }

                if (command != null)
                {
                    ExecuteCommand(command, stat, value);

                    _savedCommandInfo.Add(new Tuple <string, byte, int>(command, stat, value));
                }

                if (PointsSpent > GetMaxPoints() || PointsSpent > 80)
                {
                    _player.SendClientMessage("Your renown point spend exceeds the number of points available to you. Your renown specialization has been reset.", ChatLogFilters.CHATLOGFILTERS_CSR_TELL_RECEIVE);
                    Respec();
                }

                else
                {
                    _player.StsInterface.ApplyStats();
                    _player.StsInterface.SendRenownStats();
                }
            }
        }