Beispiel #1
0
 public static Corpse Create(Player player)
 {
     var corpse = new Corpse {
         Owner = player,
         OwnerGuid = player.Guid,
         //PartyGuid = ,
         Facing = player.Facing,
         PosX = player.PosX,
         PosY = player.PosY,
         PosZ = player.PosZ,
         DisplayId = player.DisplayId,
         //Bytes1_0 = , // classe?
         Race = player.Race,
         Gender = player.Gender,
         Skin = player.Skin,
         Face = player.Face,
         HairStyle = player.HairStyle,
         HairColor = player.HairColor,
         FacialHair = player.FacialHair,
         GuildId = player.GuildMember.With(x=>x.Guild.Id),
         //Flags = CorpseFlags.Bones,
         DynamicFlags = CorpseDynamicFlags.None,
     };
     return corpse;
 }
Beispiel #2
0
 public Skill(Player player, [NotNull] SkillCap cap)
 {
     if (cap == null)
         throw new ArgumentNullException("cap");
     this.player = player;
     this.cap = cap;
 }
Beispiel #3
0
 public void Ctor()
 {
     var player = new Player();
     IInventory inventory = CreateInventory(player, 100);
     Assert.Equal(player, inventory.Container.Owner);
     Assert.Equal(100u, inventory.Slots);
 }
Beispiel #4
0
        public void Login(Player player)
        {
            if(null == player) {
                SendCharacterLoginFiled();
                return;
            }

            Player = player;
            Player.Session = this;

            ObjectManager.Add(player);

            Creature creature = Creature.Create(IoC.Resolve<ICreatureTemplateRepository>().FindById(647));
            creature.PosX = player.PosX;
            creature.PosY = player.PosY;
            creature.PosZ = player.PosZ;
            creature.Health = 100;
            creature.MaxHealth = 100;
            creature.NpcFlags = NpcFlags.Gossip | NpcFlags.QuestGiver | NpcFlags.Banker;
            ObjectManager.Add(creature);

            SendLoginVerifyWorld();
            SendAccountDataTimes(0xEA);
            SendLoginSetTimeSpeed();
            SendSetProficiency(2, -1);
            SendSetProficiency(4, -1);
            SendSetProficiency(6, -1);
            SendInitialSpells();

            updateManager = new UpdateManager(this);
            updateManager.Start();

            SendTimeSyncReq();
        }
Beispiel #5
0
 public Skill CreateSkill(Player player)
 {
     return new Skill(player, GetCap())
                {
                    Id = (ushort) Id,
                    Value = MinValue(),
                };
 }
Beispiel #6
0
 public GuildMember([NotNull] Player player, [NotNull] Guild guild)
 {
     if (player == null)
         throw new ArgumentNullException("player");
     if (guild == null)
         throw new ArgumentNullException("guild");
     this.player = player;
     this.guild = guild;
 }
Beispiel #7
0
 public bool Use(Player user)
 {
     user.PosX = gameObject.PosX;
     user.PosY = gameObject.PosY;
     user.PosZ = gameObject.PosZ;
     user.Facing = gameObject.Facing;
     user.HeartBeat();
     user.StandState = StandStates.SittingChairLow + Hight;
     return true;
 }
Beispiel #8
0
        public void OwnerIsPlayerOnSetItemIntoItemContainer()
        {
            var player = new Player();

            Container container = CreateContainer(10);
            player.Inventory[0] = container;
            Item item = CreateItem();
            container.Inventory[0] = item;

            Assert.Equal(2, player.Inventory.Count());
            Assert.Equal(player, container.Contained);
            Assert.Equal(player, container.Owner);
            Assert.Equal(container, item.Contained);
            Assert.Equal(player, item.Owner);
        }
Beispiel #9
0
 public void Dispatch(ISession session, IPacket packet)
 {
     Account account = session.Account;
     BinaryReader r = packet.CreateReader();
     var player = new Player {
         Name = r.ReadCString(),
         Race = (Races)r.ReadByte(),
         Classe = (Classes)r.ReadByte(),
         Gender = (GenderType)r.ReadByte(),
         Skin = r.ReadByte(),
         Face = r.ReadByte(),
         HairStyle = r.ReadByte(),
         HairColor = r.ReadByte(),
         FacialHair = r.ReadByte(),
     };
     new FakeCharacterCreateHandler(player).Init();
     account.AddPlayer(player);
     //Repository.Account.Save(account);
     //Repository.Account.SubmitChanges();
     session.SendCharCreate();
 }
Beispiel #10
0
 private static IPacket GetNameQueryResponcePkt(Player player)
 {
     IPacket result = WorldPacketFactory.Create(WMSG.SMSG_NAME_QUERY_RESPONSE);
     BinaryWriter writer = result.CreateWriter();
     writer.WritePackGuid(player.Guid);
     writer.Write((byte)0); // this is a type, ranging from 0-3
     writer.WriteCString(player.Name);
     writer.WriteCString("");
     writer.Write((byte)player.Race);
     writer.Write((byte)player.Gender);
     writer.Write((byte)player.Classe);
     writer.Write(true);
     writer.WriteCString(player.Name);
     writer.WriteCString(player.Name);
     writer.WriteCString(player.Name);
     writer.WriteCString(player.Name);
     return result;
 }
Beispiel #11
0
 public BankInventory(Player player)
     : base(player.Inventory, 39, 28)
 {
     _player = player;
 }
Beispiel #12
0
 public override bool IsSeenBy(Player unit)
 {
     if(Ghost && !unit.Ghost) {
         return false; //non ghost cant see ghost
     }
     return base.IsSeenBy(unit);
 }
Beispiel #13
0
 public void SendNameQueryResponce(Player player)
 {
     Send(GetNameQueryResponcePkt(player));
 }
Beispiel #14
0
 public BankBagsInventory(Player player)
     : base(player.Inventory, 67, 0)
 {
     _player = player;
 }
Beispiel #15
0
 public BackPackInventory(Player player)
     : base(player.Inventory, 23, 16)
 {
 }
Beispiel #16
0
 public static IEnumerable<Positioned> GetSeenObjectsNear(Player me)
 {
     return allObjects.Values.Where(o => o.IsSeenBy(me));
 }
Beispiel #17
0
 public void BeginTrade(Player other)
 {
     if(other == null) {
         throw new TradeException(TradeStatus.PlayerNotFound);
     }
 }
Beispiel #18
0
        public bool Use(Player user)
        {
            gameObject.Flags = 0;

            return true;
        }
Beispiel #19
0
 public void LogOut()
 {
     ObjectManager.Remove(Player);
     updateManager.Stop();
     Player.Session = null;
     Player = null;
 }
Beispiel #20
0
 public void RemovePlayer(Player player)
 {
     players.Remove(player);
 }
 public FakeCharacterCreateHandler(Player player)
 {
     this.player = player;
 }
Beispiel #22
0
 public override ushort ValueFor(Player player)
 {
     return (ushort) (player.Level*5);
 }
Beispiel #23
0
 public override ushort ValueFor(Player player)
 {
     return value;
 }
Beispiel #24
0
 public abstract ushort ValueFor(Player player);
Beispiel #25
0
 public KeyRingInventory(Player player)
     : base(player.Inventory, 91, 0)
 {
     _player = player;
 }
Beispiel #26
0
 public TradeContext(Player player)
 {
     Contractor = player;
 }
Beispiel #27
0
 public void AddPlayer(Player player)
 {
     players.Add(player);
 }
Beispiel #28
0
 protected abstract IInventory GetInventoryDst(Player player);
Beispiel #29
0
 protected override IInventory GetInventoryDst(Player player)
 {
     return player.Bank;
 }
Beispiel #30
0
 public bool Use(Player user)
 {
     return true;
 }