Ejemplo n.º 1
0
        public static Container CreateCorpse(Creature template, Position newPosition)
        {
            ushort                wcidCorpse = 21;
            WeenieHeaderFlag      weenie     = WeenieHeaderFlag.ItemsCapacity | WeenieHeaderFlag.ContainersCapacity | WeenieHeaderFlag.Usable | WeenieHeaderFlag.UseRadius | WeenieHeaderFlag.Burden;
            ObjectDescriptionFlag objDesc    = ObjectDescriptionFlag.Openable | ObjectDescriptionFlag.Stuck | ObjectDescriptionFlag.Attackable | ObjectDescriptionFlag.Corpse; // = bitfield 8213
            string                name       = $"Corpse of {template.Name}";
            Container             wo         = new Container(template.AceCorpse, GuidManager.NewItemGuid(), name, wcidCorpse, objDesc, weenie, newPosition);

            // TODO: Find the correct motionstate to create a corpse with. For now only the dead motionstate works
            // wo.CurrentMotionState = new GeneralMotion(MotionStance.Standing);
            wo.CurrentMotionState = new UniversalMotion(MotionStance.Standing, new MotionItem(MotionCommand.Dead));
            wo.SoundTableId       = 536871106;                                                                                                                                                                                                                                // SoundTableId in DB - constant value according to pcap
            wo.PhysicsTableId     = 872415342;                                                                                                                                                                                                                                // phstableid in DB - constant value according to pcap

            wo.PhysicsDescriptionFlag = PhysicsDescriptionFlag.CSetup | PhysicsDescriptionFlag.MTable | PhysicsDescriptionFlag.ObjScale | PhysicsDescriptionFlag.STable | PhysicsDescriptionFlag.PeTable | PhysicsDescriptionFlag.Position | PhysicsDescriptionFlag.Movement; // 104579 - according to pcap
            wo.PhysicsState           = PhysicsState.Ethereal | PhysicsState.IgnoreCollision | PhysicsState.Gravity;                                                                                                                                                          // 1044 - according to pcap

            uint tmpIcon = 100667504;

            wo.IconId = tmpIcon;

            wo.ItemCapacity      = 120;                 // constant value according to pcap
            wo.ContainerCapacity = 10;                  // constant value according to pcap
            wo.Usable            = Usable.ViewedRemote; // constant value according to pcap
            wo.UseRadius         = 2.0f;                // constant value according to pcap
            wo.Burden            = 6000;                // Testdata, has to be set as the sum of the spawned items in the corpse

            // Calculation of the TTL: 5 real time minutes * player level with a minimum of 1 hour, so we set the minimum here
            wo.DespawnTime = 360 + WorldManager.PortalYearTicks;

            return(wo);
        }
Ejemplo n.º 2
0
 public Container(AceObject aceObject, ObjectGuid guid, string name, ushort weenieClassId, ObjectDescriptionFlag descriptionFlag, WeenieHeaderFlag weenieFlag, Position position)
     : this(aceObject)
 {
     Name             = name;
     DescriptionFlags = descriptionFlag;
     WeenieFlags      = weenieFlag;
     Location         = position;
     WeenieClassId    = weenieClassId;
 }
Ejemplo n.º 3
0
 public Container(ItemType type, ObjectGuid guid, string name, ushort weenieClassId, ObjectDescriptionFlag descriptionFlag, WeenieHeaderFlag weenieFlag, Position position)
     : base(guid)
 {
     Name             = name;
     DescriptionFlags = descriptionFlag;
     WeenieFlags      = weenieFlag;
     Location         = position;
     WeenieClassId    = weenieClassId;
 }
Ejemplo n.º 4
0
        public static WorldObject CreateTrainingWand(Player player)
        {
            const WeenieHeaderFlag weenie =
                WeenieHeaderFlag.Usable | WeenieHeaderFlag.HookItemTypes | WeenieHeaderFlag.Value |
                WeenieHeaderFlag.TargetType | WeenieHeaderFlag.Container | WeenieHeaderFlag.Wielder |
                WeenieHeaderFlag.Burden;

            const ushort WandTraining = 12748;

            var wo = new UsableObject(ObjectType.Caster,
                                      new ObjectGuid(CommonObjectFactory.DynamicObjectId, GuidType.None), "Training Wand", WandTraining,
                                      ObjectDescriptionFlag.Inscribable, weenie, null);

            // Todo: Swap this out and read from Weenie database

            wo.Icon                = 0x2A3C;
            wo.GameData.Value      = 25;
            wo.GameData.Burden     = 50;
            wo.GameData.TargetType = 16;
            wo.GameData.Type       = 0x31CC; // TODO: Magic number need to research

            wo.GameData.Usable = Usable.UsableNo;

            wo.PhysicsData.PhysicsDescriptionFlag = PhysicsDescriptionFlag.Stable | PhysicsDescriptionFlag.Petable
                                                    | PhysicsDescriptionFlag.CSetup |
                                                    PhysicsDescriptionFlag.AnimationFrame;

            wo.PhysicsData.AnimationFrame = 0x00000065;

            wo.PhysicsData.EquipperPhysicsDescriptionFlag = EquipMask.Wand;
            wo.PhysicsData.Stable  = 0x20000014;
            wo.PhysicsData.Petable = 0x3400002B;
            wo.PhysicsData.CSetup  = 0x2000ED7;

            wo.ModelData.AddTexture(0, 0xC3, 0xC4);
            wo.ModelData.AddModel(0, 0x2D7C);
            wo.PhysicsData.PhysicsState = PhysicsState.Gravity | PhysicsState.IgnoreCollision | PhysicsState.Ethereal;

            return(wo);
        }
Ejemplo n.º 5
0
        public SpellLikeEffect(ItemType type,
                               ObjectGuid guid,
                               string name,
                               ushort weenieClassId,
                               ObjectDescriptionFlag descriptionFlag,
                               WeenieHeaderFlag weenieFlag,
                               Position position,
                               Spell spellId,
                               uint modelId,
                               uint soundTableId,
                               uint physicsTableId) : base(guid)
        {
            Name             = name;
            DescriptionFlags = descriptionFlag;
            WeenieFlags      = weenieFlag;
            Location         = position;
            WeenieClassId    = weenieClassId;

            Spell          = spellId;
            SetupTableId   = modelId;
            SoundTableId   = soundTableId;
            PhysicsTableId = physicsTableId;
        }
Ejemplo n.º 6
0
        public SpellLikeEffect(ObjectType type,
                               ObjectGuid guid,
                               string name,
                               ushort weenieClassId,
                               ObjectDescriptionFlag descriptionFlag,
                               WeenieHeaderFlag weenieFlag,
                               Position position,
                               Spell spellId,
                               uint modelId,
                               uint soundTableId,
                               uint physicsTableId) : base(type, guid)
        {
            this.Name             = name;
            this.DescriptionFlags = descriptionFlag;
            this.WeenieFlags      = weenieFlag;
            this.Location         = position;
            this.WeenieClassid    = weenieClassId;

            this.GameData.Spell      = spellId;
            this.PhysicsData.CSetup  = modelId;
            this.PhysicsData.Stable  = soundTableId;
            this.PhysicsData.Petable = physicsTableId;
        }
Ejemplo n.º 7
0
 public DebugObject(ObjectType type, ObjectGuid guid, string name, ushort weenieClassId, ObjectDescriptionFlag descriptionFlag, WeenieHeaderFlag weenieFlag, Position position)
     : base(type, guid, name, weenieClassId, descriptionFlag, weenieFlag, position)
 {
 }
Ejemplo n.º 8
0
        public static void HandleDebugEchoFlags(Session session, params string[] parameters)
        {
            try
            {
                if (parameters?.Length == 2)
                {
                    var debugOutput = "";
                    switch (parameters[0].ToLower())
                    {
                    case "descriptionflags":
                        ObjectDescriptionFlag objectDescFlag = new ObjectDescriptionFlag();
                        objectDescFlag = (ObjectDescriptionFlag)Convert.ToUInt32(parameters[1]);

                        debugOutput = $"{objectDescFlag.GetType().Name} = {objectDescFlag.ToString()}" + " (" + (uint)objectDescFlag + ")";
                        break;

                    case "weenieflags":
                        WeenieHeaderFlag weenieHdr = new WeenieHeaderFlag();
                        weenieHdr = (WeenieHeaderFlag)Convert.ToUInt32(parameters[1]);

                        debugOutput = $"{weenieHdr.GetType().Name} = {weenieHdr.ToString()}" + " (" + (uint)weenieHdr + ")";
                        break;

                    case "weenieflags2":
                        WeenieHeaderFlag2 weenieHdr2 = new WeenieHeaderFlag2();
                        weenieHdr2 = (WeenieHeaderFlag2)Convert.ToUInt32(parameters[1]);

                        debugOutput = $"{weenieHdr2.GetType().Name} = {weenieHdr2.ToString()}" + " (" + (uint)weenieHdr2 + ")";
                        break;

                    case "positionflag":
                        UpdatePositionFlag posFlag = new UpdatePositionFlag();
                        posFlag = (UpdatePositionFlag)Convert.ToUInt32(parameters[1]);

                        debugOutput = $"{posFlag.GetType().Name} = {posFlag.ToString()}" + " (" + (uint)posFlag + ")";
                        break;

                    case "type":
                        ItemType objectType = new ItemType();
                        objectType = (ItemType)Convert.ToUInt32(parameters[1]);

                        debugOutput = $"{objectType.GetType().Name} = {objectType.ToString()}" + " (" + (uint)objectType + ")";
                        break;

                    case "containertype":
                        ContainerType contType = new ContainerType();
                        contType = (ContainerType)Convert.ToUInt32(parameters[1]);

                        debugOutput = $"{contType.GetType().Name} = {contType.ToString()}" + " (" + (uint)contType + ")";
                        break;

                    case "usable":
                        Usable usableType = new Usable();
                        usableType = (Usable)Convert.ToInt64(parameters[1]);

                        debugOutput = $"{usableType.GetType().Name} = {usableType.ToString()}" + " (" + (Int64)usableType + ")";
                        break;

                    case "radarbehavior":
                        RadarBehavior radarBeh = new RadarBehavior();
                        radarBeh = (RadarBehavior)Convert.ToUInt32(parameters[1]);

                        debugOutput = $"{radarBeh.GetType().Name} = {radarBeh.ToString()}" + " (" + (uint)radarBeh + ")";
                        break;

                    case "physicsdescriptionflags":
                        PhysicsDescriptionFlag physicsDescFlag = new PhysicsDescriptionFlag();
                        physicsDescFlag = (PhysicsDescriptionFlag)Convert.ToUInt32(parameters[1]);

                        debugOutput = $"{physicsDescFlag.GetType().Name} = {physicsDescFlag.ToString()}" + " (" + (uint)physicsDescFlag + ")";
                        break;

                    case "physicsstate":
                        PhysicsState physState = new PhysicsState();
                        physState = (PhysicsState)Convert.ToUInt32(parameters[1]);

                        debugOutput = $"{physState.GetType().Name} = {physState.ToString()}" + " (" + (uint)physState + ")";
                        break;

                    case "validlocations":
                        EquipMask locFlags = new EquipMask();
                        locFlags = (EquipMask)Convert.ToUInt32(parameters[1]);

                        debugOutput = $"{locFlags.GetType().Name} = {locFlags.ToString()}" + " (" + (uint)locFlags + ")";
                        break;

                    case "currentwieldedlocation":
                        EquipMask locFlags2 = new EquipMask();
                        locFlags2 = (EquipMask)Convert.ToUInt32(parameters[1]);

                        debugOutput = $"{locFlags2.GetType().Name} = {locFlags2.ToString()}" + " (" + (uint)locFlags2 + ")";
                        break;

                    case "priority":
                        CoverageMask covMask = new CoverageMask();
                        covMask = (CoverageMask)Convert.ToUInt32(parameters[1]);

                        debugOutput = $"{covMask.GetType().Name} = {covMask.ToString()}" + " (" + (uint)covMask + ")";
                        break;

                    case "radarcolor":
                        RadarColor radarBlipColor = new RadarColor();
                        radarBlipColor = (RadarColor)Convert.ToUInt32(parameters[1]);

                        debugOutput = $"{radarBlipColor.GetType().Name} = {radarBlipColor.ToString()}" + " (" + (uint)radarBlipColor + ")";
                        break;

                    default:
                        debugOutput = "No valid type to test";
                        break;
                    }

                    if (session == null)
                    {
                        Console.WriteLine(debugOutput.Replace(", ", " | "));
                    }
                    else
                    {
                        session.Network.EnqueueSend(new GameMessageSystemChat(debugOutput, ChatMessageType.System));
                    }
                }
            }
            catch (Exception)
            {
                string debugOutput = "Exception Error, check input and try again";
                if (session == null)
                {
                    Console.WriteLine(debugOutput.Replace(", ", " | "));
                }
                else
                {
                    session.Network.EnqueueSend(new GameMessageSystemChat(debugOutput, ChatMessageType.System));
                }
            }
        }
Ejemplo n.º 9
0
 public CollidableObject(ObjectType type, ObjectGuid guid, string name, ushort weenieClassId, ObjectDescriptionFlag descriptionFlag, WeenieHeaderFlag weenieFlag, Position position)
     : base(type, guid)
 {
     this.Name             = name;
     this.DescriptionFlags = descriptionFlag;
     this.WeenieFlags      = weenieFlag;
     this.Location         = position;
     this.WeenieClassid    = weenieClassId;
 }
Ejemplo n.º 10
0
 public ImmutableWorldObject(ObjectType type, ObjectGuid guid, string name, ObjectDescriptionFlag descriptionFlag, WeenieHeaderFlag weenieFlag, Position position) : base(type, guid)
 {
     this.Name             = name;
     this.DescriptionFlags = descriptionFlag;
     this.WeenieFlags      = weenieFlag;
     this.Position         = position;
 }
Ejemplo n.º 11
0
 public Creature(ObjectType type, ObjectGuid guid, string name, ushort weenieClassId, ObjectDescriptionFlag descriptionFlag, WeenieHeaderFlag weenieFlag, Position position)
     : base(type, guid, name, weenieClassId, descriptionFlag, weenieFlag, position)
 {
     this.movementStateMachine.Initialize(MovementRules.GetRules(), MovementRules.GetInitState());
 }