Beispiel #1
0
        public Player(bool fullSim = false)
        {
            FullSim = fullSim;

            WorldObject      = new ACE.Server.WorldObjects.Player();
            WorldObject.Name = "Player";
            //worldObj.RunSkill = runSkill;
            //worldObj.IsCreature = true;

            WorldObject.Strength.StartingValue     = 400;
            WorldObject.Endurance.StartingValue    = 400;
            WorldObject.Coordination.StartingValue = 400;
            WorldObject.Quickness.StartingValue    = 400;
            WorldObject.Focus.StartingValue        = 400;
            WorldObject.Self.StartingValue         = 400;

            var run = WorldObject.GetCreatureSkill(Skill.Run);

            run.InitLevel = 100;

            var jump = WorldObject.GetCreatureSkill(Skill.Jump);

            jump.InitLevel = 450;

            WorldObject.PhysicsObj = new PhysicsObj();
            PhysicsObj.set_object_guid(new ACE.Entity.ObjectGuid(NextPlayerGuid++));

            // player
            uint modelID  = 0x02000001;
            uint mTableID = 0x09000001;
            //uint runSkill = 300;
            float scale = 1.0f;

            PhysicsObj.makeAnimObject(modelID, true);

            var weenie = new WeenieObject(WorldObject);

            PhysicsObj.set_weenie_obj(weenie);

            PhysicsObj.SetMotionTableID(mTableID);
            PhysicsObj.SetScaleStatic(scale);

            if (!fullSim)
            {
                PhysicsObj.ParticleManager = new ParticleManager();
            }

            RawMotionState = new RawMotionState();
            RawMotionState.CurrentHoldKey = HoldKey.Run;
        }
Beispiel #2
0
        public ViewObject(uint setupID)
        {
            PhysicsObj = new PhysicsObj();

            var guid = new ACE.Entity.ObjectGuid(NextGuid++);

            PhysicsObj.set_object_guid(guid);

            uint modelID = setupID;

            //uint runSkill = 300;
            float scale = 1.0f;

            if (modelID >> 24 == 0x1)
            {
                PhysicsObj = PhysicsObj.makeObject(modelID, guid.Full, false);
            }
            else
            {
                PhysicsObj.makeAnimObject(modelID, true);
            }

            // fake contact / on ground
            PhysicsObj.TransientState |= TransientStateFlags.Contact | TransientStateFlags.OnWalkable;

            // fake cell
            PhysicsObj.CurCell = new ObjCell();

            var worldObj = new WorldObject();
            //worldObj.Name = $"Obj {setupID:X8}";
            //worldObj.RunSkill = runSkill;
            //worldObj.IsCreature = true;

            var weenie = new WeenieObject(worldObj);

            PhysicsObj.set_weenie_obj(weenie);

            var didTable = DIDTables.Get(setupID);

            if (didTable != null)
            {
                var mTableID = didTable.MotionTableID;
                PhysicsObj.SetMotionTableID(mTableID);
            }

            PhysicsObj.SetScaleStatic(scale);

            PhysicsObj.set_initial_frame(new AFrame());
        }