示例#1
0
 public ValueChange(Character Character, byte index, uint value)
     : base(0x48, 7)
 {
     writer.Write(Character.WorldId);
     writer.Write(index);
     writer.Write(value);
 }
示例#2
0
 public void ExecuteQuest(Character Character)
 {
     foreach (Case ccase in Cases)
     {
         ExecuteCase(ccase, Character);
     }
 }
示例#3
0
 public SetCamera(Character Character, ushort mapId)
     : base(0x1b, 10)
 {
     writer.Write(mapId);
     writer.Write(Character.Position.X);
     writer.Write(Character.Position.Y);
 }
示例#4
0
 public override bool Check(Character Character)
 {
     if (Character.Player.Level >= MinLevel)
     {
         return true;
     }
     return false;
 }
示例#5
0
        public SpawnPlayer(Character Character, bool isPlayerPlayer)
            : base(0x32)
        {
            SetCapacity((ushort)(59 + Character.Player.Name.Length));

            writer.Write(Character.WorldId);
            writer.Write(Character.Player.Name.ToCharArray());
            writer.Write((byte)0);

            if(isPlayerPlayer)
            {
                writer.Write((byte)((byte)0x80 | (byte)Character.Player.Class));
            }
            else
            {
                writer.Write((byte)Character.Player.Class);
            }

            //Coordinates
            writer.Write(Character.Position.X);
            writer.Write(Character.Position.Y);
            writer.Write(Character.Position.Z);

            writer.Write((short)1);

            if (Character.IsAlive)
            {
                writer.Write((byte)0); // Alive
            } else {
                writer.Write((byte)2); // Dead
            }

            writer.Write((short)0);
            writer.Write((byte)0);

            ///
            /// Gear
            ///
            PlayerGear gear = Character.Gear as PlayerGear;

            writer.Write(gear.Slots[1]);
            writer.Write(gear.Slots[2]);
            writer.Write(gear.Slots[3]);
            writer.Write(gear.Slots[4]);
            writer.Write(gear.Slots[5]);
            writer.Write(gear.Slots[6]);
            writer.Write(gear.Slots[7]);

            ///
            /// Look
            ///
            writer.Write((byte)Character.Player.Face);
            writer.Write((byte)Character.Player.Hair);

            for(int i=0;i<19;i++) {
                writer.Write((byte)0);
            }
        }
示例#6
0
 public Agility(Character Character)
     : base(0x04, 9)
 {
     writer.Write(Character.Stats.Dexterity);
     writer.Write(Character.Stats.OTP);
     writer.Write(Character.Stats.Evasion);
     writer.Write(Character.Stats.MinDamage);
     writer.Write(Character.Stats.MaxDamage);
 }
示例#7
0
        private void ExecuteCase(Case Case, Character Character)
        {
            //check each condition
            foreach (Condition condition in Case.Conditions)
            {
                if (!condition.Check(Character))
                {
                    return;
                }
            }

            //execute each action
            foreach (Quests.Action action in Case.Actions)
            {
                action.Execute(Character);
            }
        }
示例#8
0
 public static void Chat(Character Character, string Message)
 {
     foreach (string Key in ChatCommands.Keys)
     {
         if (Message.StartsWith(Key))
         {
             try
             {
                 ChatCommands[Key].Execute(Character, Message);
             }
             catch (Exception ex)
             {
                 ServerConsole.WriteLine("Chat command error: {0}", MessageLevel.Error, ex);
             }
         }
     }
     Character.Chat(Message);
 }
示例#9
0
 public PlayerInfo(Character Character)
     : base(0x42, 59)
 {
     writer.Write((byte)Character.Player.Specialty);
     writer.Write((ushort)0);
     // Contribution
     writer.Write((ushort)Character.Player.Contribute);
     // Stats
     writer.Write(Character.Stats.Strength);
     writer.Write(Character.Stats.Health);
     writer.Write(Character.Stats.Intelligence);
     writer.Write(Character.Stats.Wisdom);
     writer.Write(Character.Stats.Dexterity);
     // Health
     writer.Write((ushort)Character.CurrentHP);
     writer.Write(Character.Stats.MaximumHP);
     // Mana
     writer.Write((ushort)Character.CurrentMP);
     writer.Write(Character.Stats.MaximumMP);
     // Special stats
     writer.Write(Character.Stats.OTP);
     writer.Write(Character.Stats.Evasion);
     writer.Write(Character.Stats.Defense);
     writer.Write(Character.Stats.Absorb);
     // Other
     writer.Write(Character.Player.Experience);
     // Damage
     writer.Write(Character.Stats.MinDamage);
     writer.Write(Character.Stats.MaxDamage);
     writer.Write(Character.Stats.MinMagicalDamage);
     writer.Write(Character.Stats.MaxMagicalDamage);
     // Points
     writer.Write((short)Character.Player.StatPoints);
     writer.Write((short)Character.Player.SkillPoints);
     // Resistance
     writer.Write(Character.Stats.FireResistance);
     writer.Write(Character.Stats.IceResistance);
     writer.Write(Character.Stats.LightningResistance);
     writer.Write(Character.Stats.CurseResistance);
     writer.Write(Character.Stats.ParalysisResistance);
     // Rage
     writer.Write((int)Character.Player.Rage);
 }
示例#10
0
        public void Execute(Character Character, string Message)
        {
            string[] args = Message.Split(' ');
            int index = Convert.ToInt32(args[1]);

            //check if the item exists
            if (Item.FindByIndex(index) != null)
            {
                PlayerItem pItem = new PlayerItem();
                pItem.Index = index;
                pItem.MaxEnd = (byte)pItem.Item.Endurance;
                pItem.CurEnd = pItem.MaxEnd;
                pItem.Num = 1;
                Character.Inventory.AddItem(pItem);
            }
            else
            {
                ServerConsole.WriteLine("Index {0} does not exist", MessageLevel.Error, index);
            }
        }
示例#11
0
 public void Execute(Character Character, string Message)
 {
     Character.Chat(Message);
 }
示例#12
0
 public ParalysisResistance(Character Character)
     : base(0x16, 2)
 {
     writer.Write(Character.Stats.ParalysisResistance);
 }
示例#13
0
 public CharacterBaseStats(Character Character)
 {
     this.Character = Character;
 }
示例#14
0
 public PUPoint(Character Character)
     : base(0x17, 2)
 {
     writer.Write((ushort)Character.Player.StatPoints);
 }
示例#15
0
 public abstract bool Check(Character Character);
示例#16
0
 public OTP(Character Character)
     : base(0x09, 2)
 {
     writer.Write(Character.Stats.OTP);
 }
示例#17
0
 public Contribution(Character Character)
     : base(0x1e, 2)
 {
     writer.Write((ushort)Character.Player.Contribute);
 }
示例#18
0
 /// <summary>
 /// Unspawn a player
 /// </summary>
 public void UnspawnPlayer()
 {
     Database.Update(Database.KalDB, Character.Player);
     ServerWorld.RemoveEntity(Character);
     Character = null;
 }
示例#19
0
 public Wisdom(Character Character)
     : base(0x03, 7)
 {
     writer.Write(Character.Stats.Wisdom);
     writer.Write(Character.CurrentMP);
     writer.Write(Character.Stats.MaximumMP);
     writer.Write(Character.Stats.CurseResistance);
 }
示例#20
0
 public Magic(Character Character)
     : base(0x1c, 4)
 {
     writer.Write(Character.Stats.MinMagicalDamage);
     writer.Write(Character.Stats.MaxMagicalDamage);
 }
示例#21
0
        /// <summary>
        /// Selects a Player
        /// </summary>
        /// <param name="playerId"></param>
        public void PlayerSelect(int PID)
        {
            if (Authenticated)
            {
                Player player = Player.GetPlayer(PID);
                Character = new Character(player, this);

                Send(new Packets.LoginAccepted());
                Send(new Packets.PlayerInfo(Character));
                Send(new Packets.SetCamera(Character, 0));
                Send(new Packets.CameraUpdate());
            }
        }
示例#22
0
 public Attack(Character Character)
     : base(0x1b, 4)
 {
     writer.Write(Character.Stats.MinDamage);
     writer.Write(Character.Stats.MaxDamage);
 }
示例#23
0
文件: Html.cs 项目: BeshoyFD/kalsharp
 public override void Execute(Character Character)
 {
     Character.ShowHtml(HtmlID);
 }
示例#24
0
 public CurseResistance(Character Character)
     : base(0x15, 2)
 {
     writer.Write(Character.Stats.CurseResistance);
 }
示例#25
0
 public override void Execute(Character Character)
 {
     // Character.ShowHtml(GuideID);
 }
示例#26
0
 public SUPoint(Character Character)
     : base(0x18, 2)
 {
     writer.Write((ushort)Character.Player.SkillPoints);
 }
示例#27
0
 public CharacterPosition(Character Character)
     : base()
 {
     this.Character = Character;
 }
示例#28
0
 public Strength(Character Character)
     : base(0x00, 7)
 {
     writer.Write(Character.Stats.Strength);
     writer.Write(Character.Stats.OTP);
     writer.Write(Character.Stats.MinDamage);
     writer.Write(Character.Stats.MaxDamage);
 }
示例#29
0
 public LightningResistance(Character Character)
     : base(0x14, 2)
 {
     writer.Write(Character.Stats.LightningResistance);
 }
示例#30
0
 public AttackSpeed(Character Character)
     : base(0x11, 2)
 {
     writer.Write(Character.Stats.AttackSpeed);
 }