public override void ExecuteCommand(Client client, Identity target, string[] args) { int itemid = Int32.Parse(args[1]); AONanos it = NanoHandler.GetNano(itemid); if (it == null) { client.SendChatText("No Nano with id " + itemid + " found."); return; } client.SendChatText("Nano Debug Info for Nano " + itemid); client.SendChatText("Attack values:"); foreach (AOItemAttribute at in it.Attack) { client.SendChatText("Type: " + at.Stat + " Value: " + at.Value); } client.SendChatText("Defense values:"); foreach (AOItemAttribute at in it.Defend) { client.SendChatText("Type: " + at.Stat + " Value: " + at.Value); } client.SendChatText("Item Attributes:"); foreach (AOItemAttribute at in it.Stats) { client.SendChatText("Type: " + at.Stat + " Value: " + at.Value); } client.SendChatText("Events/Functions:"); foreach (AOEvents ev in it.Events) { client.SendChatText("Eventtype: " + ev.EventType); foreach (AOFunctions fu in ev.Functions) { client.SendChatText(" Functionnumber: " + fu.FunctionType); foreach (object arg in fu.Arguments.Values) { client.SendChatText(" Argument: " + arg); } foreach (AORequirements aor in fu.Requirements) { client.SendChatText( " Reqs: " + aor.Statnumber + " " + aor.Operator + " " + aor.Value + " " + aor.ChildOperator); } } } }
/// <summary> /// Read nanos from database /// TODO: catch exceptions /// </summary> public void readNanosfromSQL() { lock (ActiveNanos) { SqlWrapper ms = new SqlWrapper(); { AONanos m_an; DataTable dt = ms.ReadDT("SELECT * FROM " + getSQLTablefromDynelType() + "activenanos WHERE ID=" + ID.ToString()); if (dt.Rows.Count > 0) { foreach (DataRow row in dt.Rows) { m_an = new AONanos(); m_an.ID = (Int32)row["nanoID"]; m_an.NanoStrain = (Int32)row["strain"]; ActiveNanos.Add(m_an); } } } } }
/// <summary> /// The parse nano. /// </summary> /// <param name="rectype"> /// The rectype. /// </param> /// <param name="recnum"> /// The recnum. /// </param> /// <param name="data"> /// The data. /// </param> /// <param name="sqlFile"> /// The sql file. /// </param> /// <returns> /// The <see cref="AONanos"/>. /// </returns> public AONanos ParseNano(int rectype, int recnum, byte[] data, string sqlFile) { this.br = new BufferedReader(rectype, recnum, data); AONanos aon = new AONanos(); aon.ID = recnum; Console.Write("\rNano 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.NCUCost = attrval; AOItemAttribute aoia = new AOItemAttribute(); aoia.Stat = attrkey; aoia.Value = attrval; aon.Stats.Add(aoia); } else { AOItemAttribute aoia = new AOItemAttribute(); aoia.Stat = attrkey; aoia.Value = attrval; aon.Stats.Add(aoia); } 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); }