public static ServerMessage Compose(Pet Pet)
 {
     ServerMessage Message = new ServerMessage(OpcodesOut.INVENTORY_PET_ADDED);
     Message.AppendUInt32(Pet.Id);
     Message.AppendStringWithBreak(Pet.Name);
     Message.AppendInt32(Pet.Type);
     Message.AppendInt32(Pet.Race);
     Message.AppendStringWithBreak(Pet.ColorCode);
     return Message;
 }
Esempio n. 2
0
 public void Add(Pet Pet)
 {
     lock (mInner)
     {
         if (!mInner.ContainsKey(Pet.Id))
         {
             mInner.Add(Pet.Id, Pet);
         }
     }
 }
Esempio n. 3
0
 public static ServerMessage Compose(uint DisplayId, Pet Pet)
 {
     ServerMessage Message = new ServerMessage(OpcodesOut.ROOM_PET_UPDATE);
     Message.AppendInt32(9);
     Message.AppendUInt32(DisplayId);
     Message.AppendUInt32(DisplayId);
     Message.AppendStringWithBreak(Pet.Name);
     Message.AppendInt32(Pet.Type);
     Message.AppendInt32(Pet.Race);
     Message.AppendStringWithBreak(Pet.ColorCode);
     return Message;
 }
Esempio n. 4
0
        public static Bot CreateNewInstance(Bot Definition, uint RoomId, Vector3 Position, Pet PetData = null)
        {
            uint ResultId = 0;

            lock (mSyncRoot)
            {
                ResultId = mBotInstanceIdGenerator++;
            }

            Bot BotInstance = new Bot(ResultId, Definition.Id, Definition.BehaviorType, Definition.Name, Definition.Look,
                Definition.Motto, RoomId, Position, Definition.ServePosition, Definition.PredefinedPositions.ToList(),
                Definition.WalkMode, Definition.Kickable, Definition.Rotation, Definition.Responses, Definition.Effect,
                Definition.ResponseDistance, Definition.Health, Definition.CurrentPos, PetData);

            lock (mSyncRoot)
            {
                mBotInstances.Add(ResultId, BotInstance);
            }

            return BotInstance;
        }
Esempio n. 5
0
 public static ServerMessage Compose(uint DisplayId, Pet Pet)
 {
     ServerMessage Message = new ServerMessage(OpcodesOut.ROOM_PET_INFO);
     Message.AppendUInt32(DisplayId);
     Message.AppendStringWithBreak(Pet.Name);
     Message.AppendInt32(Pet.Level); // Cur lvl
     Message.AppendInt32(Pet.TotalLevels); // Tar(MAX) lvl
     Message.AppendInt32(Pet.Experience); // Cur Exp??
     Message.AppendInt32(Pet.ExperienceTarget); // Tar Exp??
     Message.AppendInt32(Pet.Energy); // Cur Energy??
     Message.AppendInt32(Pet.EnergyLimit); // Tar Energy??
     Message.AppendInt32(Pet.Happiness); // Nutrition
     Message.AppendInt32(Pet.HappinessLimit); // Max nutrition
     Message.AppendInt32(Pet.Type); // Look (type)??
     Message.AppendInt32(Pet.Race); // Breed??
     Message.AppendStringWithBreak(Pet.ColorCode); // Color
     Message.AppendInt32(Pet.Score); // Respect?
     Message.AppendUInt32(Pet.OwnerId);
     Message.AppendInt32(Pet.AgeDays);
     Message.AppendStringWithBreak(Pet.OwnerName);
     return Message;
 }
Esempio n. 6
0
        public Bot(uint Id, uint DefId, string BehaviorType, string Name, string Look, string Motto, uint RoomId, Vector3 Position,
            Vector2 ServePosition, List<Vector2> DefinedPositions, BotWalkMode WalkMode, bool Kickable, int Rotation,
            List<BotResponse> Responses, int Effect, int ResponseDistance, int Health, string PositionNow, Pet PetData = null)
        {
            mId = Id;
            mDefinitionId = DefId;
            mBehaviorType = BehaviorType;
            mName = Name;
            mLook = Look;
            mMotto = Motto;
            mRoomId = RoomId;
            mInitialPosition = Position;
            mPositionNow = PositionNow;
            mServePosition = ServePosition;
            mDefinedPositions = DefinedPositions;
            mWalkMode = WalkMode;
            mKickable = Kickable;
            mRotation = Rotation;
            mEffect = Effect;
            mResponses = Responses;
            mResponseDistance = ResponseDistance;
            mPetData = PetData;
            mHealth = Health;

            switch (mBehaviorType.ToLower())
            {
                case "pet":

                    mBrain = new PetBot();
                    break;

                default:

                    mBrain = new GenericBot();
                    break;
            }
        }
Esempio n. 7
0
        public static void MarkWriteback(Pet Pet)
        {
            lock (mWritebackPets)
            {
                if (mWritebackPets.Contains(Pet))
                {
                    return;
                }

                mWritebackPets.Add(Pet);
            }
        }