public NanoFormula ParseNano(int recnum, byte[] data, string sqlFile)
{
this.br = new BufferedReader((int)Extractor.RecordType.Nano, recnum, data);
NanoFormula aon = new NanoFormula();
aon.ID = recnum;
this.br.Skip(16);
int numberOfAttributes = this.br.Read3F1() - 1;
int counter = 0;
while (true)
{
if (counter > numberOfAttributes)
{
break;
}
int attrkey = this.br.ReadInt32();
int attrval = this.br.ReadInt32();
if (attrkey == 54)
{
aon.Stats.Add(attrkey, attrval);
}
else
{
aon.Stats.Add(attrkey, attrval);
}
counter++;
}
this.br.Skip(8);
short nameLength = this.br.ReadInt16();
short descriptionLength = this.br.ReadInt16();
if (nameLength > 0)
{
this.br.ReadString(nameLength);
}
if (descriptionLength > 0)
{
this.br.ReadString(descriptionLength); // Read and discard Description
}
bool flag4 = true;
checked
{
while (this.br.Ptr < this.br.Buffer.Length - 8 && flag4)
{
switch (this.br.ReadInt32())
{
case 2:
this.ParseFunctionSet(aon.Events);
break;
case 3:
case 5:
case 7:
case 8:
case 9:
case 10:
case 11:
case 12:
case 13:
case 15:
case 16:
case 17:
case 18:
case 19:
case 21:
goto IL_4BF;
case 4:
this.ParseAtkDefSet(aon.Attack, aon.Defend);
break;
case 6:
{
this.br.Skip(4);
int count = this.br.Read3F1() * 8;
this.br.Skip(count);
break;
}
case 14:
this.ParseAnimSoundSet(1, null);
break;
case 20:
this.ParseAnimSoundSet(2, null);
break;
case 22:
this.ParseActionSet(aon.Actions);
break;
case 23:
this.ParseShopHash(aon.Events);
break;
default:
goto IL_4BF;
}
continue;
IL_4BF:
flag4 = false;
}
}
return aon;
}