Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using Stump.DofusProtocol.Types;
- using Stump.Core.IO;
- namespace Stump.DofusProtocol.Messages
- {
- public class SpellUpgradeRequestMessage : NetworkMessage
- {
- public const uint Id = 5608;
- public override uint MessageId
- {
- get { return Id; }
- }
- public ushort spellId;
- public sbyte spellLevel;
- public SpellUpgradeRequestMessage()
- {
- }
- public SpellUpgradeRequestMessage(ushort spellId, sbyte spellLevel)
- {
- this.spellId = spellId;
- this.spellLevel = spellLevel;
- }
- public override void Serialize(ICustomDataWriter writer)
- {
- writer.WriteVaruhshort(spellId);
- writer.WriteSByte(spellLevel);
- }
- public override void Deserialize(ICustomDataReader reader)
- {
- spellId = reader.ReadVaruhshort();
- if (spellId < 0)
- throw new Exception("Forbidden value on spellId = " + spellId + ", it doesn't respect the following condition : spellId < 0");
- spellLevel = reader.ReadSByte();
- if (spellLevel < 1 || spellLevel > 6)
- throw new Exception("Forbidden value on spellLevel = " + spellLevel + ", it doesn't respect the following condition : spellLevel < 1 || spellLevel > 6");
- }
- public override void Serialize(BigEndianWriter writer)
- {
- throw new NotImplementedException();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement