Exemple #1
0
 public ValueChange(Character Character, byte index, uint value)
     : base(0x48, 7)
 {
     writer.Write(Character.WorldId);
     writer.Write(index);
     writer.Write(value);
 }
Exemple #2
0
 public void ExecuteQuest(Character Character)
 {
     foreach (Case ccase in Cases)
     {
         ExecuteCase(ccase, Character);
     }
 }
Exemple #3
0
 public SetCamera(Character Character, ushort mapId)
     : base(0x1b, 10)
 {
     writer.Write(mapId);
     writer.Write(Character.Position.X);
     writer.Write(Character.Position.Y);
 }
Exemple #4
0
 public override bool Check(Character Character)
 {
     if (Character.Player.Level >= MinLevel)
     {
         return true;
     }
     return false;
 }
Exemple #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);
            }
        }
Exemple #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);
 }
Exemple #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);
            }
        }
Exemple #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);
 }
Exemple #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);
 }
Exemple #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);
            }
        }
Exemple #11
0
 public void Execute(Character Character, string Message)
 {
     Character.Chat(Message);
 }
Exemple #12
0
 public ParalysisResistance(Character Character)
     : base(0x16, 2)
 {
     writer.Write(Character.Stats.ParalysisResistance);
 }
 public CharacterBaseStats(Character Character)
 {
     this.Character = Character;
 }
Exemple #14
0
 public PUPoint(Character Character)
     : base(0x17, 2)
 {
     writer.Write((ushort)Character.Player.StatPoints);
 }
Exemple #15
0
 public abstract bool Check(Character Character);
Exemple #16
0
 public OTP(Character Character)
     : base(0x09, 2)
 {
     writer.Write(Character.Stats.OTP);
 }
Exemple #17
0
 public Contribution(Character Character)
     : base(0x1e, 2)
 {
     writer.Write((ushort)Character.Player.Contribute);
 }
Exemple #18
0
 /// <summary>
 /// Unspawn a player
 /// </summary>
 public void UnspawnPlayer()
 {
     Database.Update(Database.KalDB, Character.Player);
     ServerWorld.RemoveEntity(Character);
     Character = null;
 }
Exemple #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);
 }
Exemple #20
0
 public Magic(Character Character)
     : base(0x1c, 4)
 {
     writer.Write(Character.Stats.MinMagicalDamage);
     writer.Write(Character.Stats.MaxMagicalDamage);
 }
Exemple #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());
            }
        }
Exemple #22
0
 public Attack(Character Character)
     : base(0x1b, 4)
 {
     writer.Write(Character.Stats.MinDamage);
     writer.Write(Character.Stats.MaxDamage);
 }
Exemple #23
0
 public override void Execute(Character Character)
 {
     Character.ShowHtml(HtmlID);
 }
Exemple #24
0
 public CurseResistance(Character Character)
     : base(0x15, 2)
 {
     writer.Write(Character.Stats.CurseResistance);
 }
Exemple #25
0
 public override void Execute(Character Character)
 {
     // Character.ShowHtml(GuideID);
 }
Exemple #26
0
 public SUPoint(Character Character)
     : base(0x18, 2)
 {
     writer.Write((ushort)Character.Player.SkillPoints);
 }
 public CharacterPosition(Character Character)
     : base()
 {
     this.Character = Character;
 }
Exemple #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);
 }
Exemple #29
0
 public LightningResistance(Character Character)
     : base(0x14, 2)
 {
     writer.Write(Character.Stats.LightningResistance);
 }
Exemple #30
0
 public AttackSpeed(Character Character)
     : base(0x11, 2)
 {
     writer.Write(Character.Stats.AttackSpeed);
 }