/// <summary> /// /// </summary> /// <param name="script"></param> public ConsumeItemToken(Script script) : base(script) { Type = script.ReadByte(); if (Type != 0xff) Target = Location.FromScript(script); }
/// <summary> /// /// </summary> /// <param name="script"></param> public ChangeWallToken(Script script) : base(script) { Type = script.ReadByte(); switch (Type) { // All sides case 0xf7: { Target = Location.FromScript(script); // script.ReadPosition(); To = script.ReadByte(); From = script.ReadByte(); } break; // One side case 0xe9: { Target = Location.FromScript(script); // script.ReadPosition(); Side = script.ReadByte(); To = script.ReadByte(); From = script.ReadByte(); } break; // Open door case 0xea: { Target = Location.FromScript(script); // script.ReadPosition(); } break; } }
/// <summary> /// /// </summary> /// <param name="script"></param> public SetWallToken(Script script) : base(script) { Type = script.ReadByte(); switch (Type) { // All sides case 0xf7: { Target = Location.FromScript(script); To = script.ReadByte(); } break; // One side case 0xe9: { Target = Location.FromScript(script); Side = script.ReadByte(); To = script.ReadByte(); } break; // Change party direction case 0xed: { direction = script.ReadByte(); } break; default: { } break; } }
/// <summary> /// /// </summary> /// <param name="script"></param> public NewItemToken(Script script) : base(script) { ItemID = script.ReadAddr(); Type = script.ReadAddr(); switch (Type) { case 0xffff: { Unknown0 = script.ReadByte(); Unknown1 = script.ReadByte(); } break; case 0xfffe: { Unknown0 = script.ReadByte(); Unknown1 = script.ReadByte(); Unknown2 = script.ReadByte(); } break; default: { Target = Location.FromValue(Type); SubPos = script.ReadByte(); Unknown0 = script.ReadByte(); } break; } Item item = Assets.Items[ItemID]; if (item != null) ItemName = item.UnidentifiedName; }
/// <summary> /// /// </summary> /// <param name="script"></param> public SoundToken(Script script) : base(script) { Id = script.ReadByte(); byte b = script.ReadByte(); if (b != 0x00) Target = Location.FromValue(b); Flag = script.ReadByte(); }
/// <summary> /// /// </summary> /// <param name="script"></param> public TeleportToken(Script script) : base(script) { Type = script.ReadByte(); switch (Type) { // Party case 0xe8: { Unknown0 = script.ReadShort(); Destination = Location.FromScript(script); } break; // case 0xe1: { Destination = Location.FromScript(script); } break; // Monster case 0xf3: { script.ReadByte(); script.ReadByte(); script.ReadByte(); script.ReadByte(); //Source = Location.FromScript(script); //Destination = Location.FromScript(script); } break; // Item case 0xf5: { Source = Location.FromScript(script); Destination = Location.FromScript(script); script.ReadShort(); } break; default: { Source = Location.FromScript(script); Destination = Location.FromScript(script); } break; } }
/// <summary> /// /// </summary> /// <param name="reader"></param> public Item(ushort index, BinaryReader reader) { byte b; UnidentifiedNameId = reader.ReadByte(); IdentifiedNameId = reader.ReadByte(); b = reader.ReadByte(); Flags = (ItemFlag)(b & 0xE0); Charges = (byte)(b & 0x1F); Picture = reader.ReadByte(); ItemTypeID = reader.ReadByte(); SubPosition = reader.ReadByte(); Location = Location.FromValue(reader.ReadUInt16()); Unk0 = reader.ReadUInt16(); Unk1 = reader.ReadUInt16(); Level = reader.ReadByte(); Value = reader.ReadSByte(); Index = index; }
/// <summary> /// /// </summary> /// <param name="script"></param> public OpenDoorToken(Script script) : base(script) { Target = Location.FromScript(script); }
/// <summary> /// /// </summary> /// <param name="script"></param> public ConditionalGetWallSide(Script script) : base(script) { Side = script.ReadByte(); target = Location.FromScript(script); }
/// <summary> /// /// </summary> /// <param name="script"></param> public ConditionalGetWallNumber(Script script) : base(script) { Target = Location.FromScript(script); }