예제 #1
0
 public override void Init(StoC_0x83_QuestUpdate pak)
 {
     index = pak.ReadByte();
     if (index == 0)
     {
         lenName = pak.ReadShortLowEndian();
         lenDesc = pak.ReadByte();
         unk1    = pak.ReadByte();
     }
     else
     {
         lenName = pak.ReadByte();
         lenDesc = pak.ReadShortLowEndian();
         unk1    = pak.ReadByte();
     }
     if (lenName == 0 && lenDesc == 0)
     {
         name = "";
         desc = "";
     }
     else
     {
         name = pak.ReadString(lenName);
         desc = pak.ReadString(lenDesc);
     }
 }
 public override void Init(StoC_0x83_QuestUpdate pak)
 {
     index = pak.ReadByte();
     if (index == 0)
     {
         lenName = pak.ReadShortLowEndian();
         lenDesc = pak.ReadByte();
         unk1 = pak.ReadByte();
     }
     else
     {
         lenName = pak.ReadByte();
         lenDesc = pak.ReadShortLowEndian();
         unk1 = pak.ReadByte();
     }
     if (lenName == 0 && lenDesc == 0)
     {
         name = "";
         desc = "";
     }
     else
     {
         name = pak.ReadString(lenName);
         desc = pak.ReadString(lenDesc);
     }
 }
            public override void Init(StoC_0x83_QuestUpdate pak)
            {
                index      = pak.ReadByte();                     // 0x00
                lenName    = pak.ReadByte();                     // 0x01
                unk2       = pak.ReadShortLowEndian();           // 0x02
                goalsCount = pak.ReadByte();                     // 0x04
                level      = pak.ReadByte();                     // 0x05
                name       = pak.ReadString(lenName);            // 0x06
                lenDesc    = pak.ReadByte();
                desc       = pak.ReadString(lenDesc);
                goals      = new string[goalsCount];
                goalInfo   = new QuestGoalInfo[goalsCount];
                goalItems  = new StoC_0x02_InventoryUpdate.Item[goalsCount];
                for (int i = 0; i < goalsCount; i++)
                {
                    ushort goalDescLen = pak.ReadShortLowEndian();
#if SKIP_CR_IN_DESCRIPTION
                    goals[i] = pak.ReadString(goalDescLen - 1); // 0x0A on end string
                    pak.Skip(1);                                // skip 0x0A on end string
#else
                    goals[i] = pak.ReadString(goalDescLen);
#endif
                    QuestGoalInfo questGoalInfo = new QuestGoalInfo();
                    questGoalInfo.zoneId2          = pak.ReadShortLowEndian();
                    questGoalInfo.XOff2            = pak.ReadShortLowEndian();
                    questGoalInfo.YOff2            = pak.ReadShortLowEndian();
                    questGoalInfo.unk2             = pak.ReadShortLowEndian();
                    questGoalInfo.type             = pak.ReadShortLowEndian();
                    questGoalInfo.unk1             = pak.ReadShortLowEndian();
                    questGoalInfo.zoneId           = pak.ReadShortLowEndian();
                    questGoalInfo.XOff             = pak.ReadShortLowEndian();
                    questGoalInfo.YOff             = pak.ReadShortLowEndian();
                    goalInfo[i]                    = questGoalInfo;
                    questGoalInfo.flagGoalFinished = pak.ReadByte();

                    StoC_0x02_InventoryUpdate.Item item = new StoC_0x02_InventoryUpdate.Item();

                    item.slot = pak.ReadByte();
                    if (item.slot > 0)
                    {
                        item.unk1_1115 = pak.ReadShort();
                        item.level     = pak.ReadByte();

                        item.value1 = pak.ReadByte();
                        item.value2 = pak.ReadByte();

                        item.hand = pak.ReadByte();
                        byte temp = pak.ReadByte();                         //WriteByte((byte) ((item.Type_Damage*64) + item.Object_Type));
                        item.damageType = (byte)(temp >> 6);
                        item.objectType = (byte)(temp & 0x3F);
                        item.unk1_1112  = pak.ReadByte();
                        item.weight     = pak.ReadShort();
                        item.condition  = pak.ReadByte();
                        item.durability = pak.ReadByte();
                        item.quality    = pak.ReadByte();
                        item.bonus      = pak.ReadByte();
                        item.unk2_1112  = pak.ReadByte();
                        item.model      = pak.ReadShort();
                        item.extension  = pak.ReadByte();
                        item.color      = pak.ReadShort();
                        item.flag       = pak.ReadByte();
                        if ((item.flag & 0x08) == 0x08)
                        {
                            item.effectIcon = pak.ReadShort();
                            item.effectName = pak.ReadPascalString();
                        }
                        if ((item.flag & 0x10) == 0x10)
                        {
                            item.effectIcon2 = pak.ReadShort();
                            item.effectName2 = pak.ReadPascalString();
                        }
                        item.effect = pak.ReadByte();
                        item.name   = pak.ReadPascalString();
                    }
                    goalItems[i] = item;
                }
            }
			public override void Init(StoC_0x83_QuestUpdate pak)
			{
				index = pak.ReadByte();          // 0x00
				lenName = pak.ReadByte();        // 0x01
				unk2 = pak.ReadShortLowEndian(); // 0x02
				goalsCount = pak.ReadByte();     // 0x04
				level = pak.ReadByte();          // 0x05
				name = pak.ReadString(lenName);  // 0x06
				lenDesc = pak.ReadByte();
				desc = pak.ReadString(lenDesc);
				goals = new string[goalsCount];
				goalInfo = new QuestGoalInfo[goalsCount];
				goalItems = new StoC_0x02_InventoryUpdate.Item[goalsCount];
				for (int i = 0; i < goalsCount; i++)
				{
					ushort goalDescLen = pak.ReadShortLowEndian();
#if SKIP_CR_IN_DESCRIPTION
					goals[i] = pak.ReadString(goalDescLen - 1); // 0x0A on end string
					pak.Skip(1);// skip 0x0A on end string
#else
					goals[i] = pak.ReadString(goalDescLen);
#endif
					QuestGoalInfo questGoalInfo = new QuestGoalInfo();
					questGoalInfo.zoneId2 = pak.ReadShortLowEndian();
					questGoalInfo.XOff2 = pak.ReadShortLowEndian();
					questGoalInfo.YOff2 = pak.ReadShortLowEndian();
					questGoalInfo.unk2 = pak.ReadShortLowEndian();
					questGoalInfo.type = pak.ReadShortLowEndian();
					questGoalInfo.unk1 = pak.ReadShortLowEndian();
					questGoalInfo.zoneId = pak.ReadShortLowEndian();
					questGoalInfo.XOff = pak.ReadShortLowEndian();
					questGoalInfo.YOff = pak.ReadShortLowEndian();
					goalInfo[i] = questGoalInfo;
					questGoalInfo.flagGoalFinished = pak.ReadByte();

					StoC_0x02_InventoryUpdate.Item item = new StoC_0x02_InventoryUpdate.Item();

					item.slot = pak.ReadByte();
					if (item.slot > 0)
					{
						item.level = pak.ReadByte();

						item.value1 = pak.ReadByte();
						item.value2 = pak.ReadByte();

						item.hand = pak.ReadByte();
						byte temp = pak.ReadByte(); //WriteByte((byte) ((item.Type_Damage*64) + item.Object_Type));
						item.damageType = (byte)(temp >> 6);
						item.objectType = (byte)(temp & 0x3F);
						item.weight = pak.ReadShort();
						item.condition = pak.ReadByte();
						item.durability = pak.ReadByte();
						item.quality = pak.ReadByte();
						item.bonus = pak.ReadByte();
						item.model = pak.ReadShort();
						item.extension = pak.ReadByte();
						item.color = pak.ReadShort();
						item.flag = pak.ReadByte();
						if ((item.flag & 0x08) == 0x08)
						{
							item.effectIcon = pak.ReadShort();
							item.effectName = pak.ReadPascalString();
						}
						if ((item.flag & 0x10) == 0x10)
						{
							item.effectIcon2 = pak.ReadShort();
							item.effectName2 = pak.ReadPascalString();
						}
						item.effect = pak.ReadByte();
						item.name = pak.ReadPascalString();
					}
					goalItems[i] = item;
				}
			}