public uoobject Finditem(int Type) { uoobject myobj = new uoobject(); foreach (DictionaryEntry Item in uonet.GameObjects) { uoobject mytemp = (uoobject)Item.Value; if (mytemp.type == Type) { myobj = mytemp; break; } } return myobj; }
public void main() { Active = false; //uoobject tempob = (uoobject)uonet.GameObjects[3]; //Events.Cast(Spell.Agility); uonet.displaywipe(); uonet.display("Script Started!"); Event Events = new Event(uonet); int cnt = 0; while (cnt < 10) { Events.UseObject(1076771726); while (uonet.UOClient.TargCurs == 0) { Thread.Sleep(10); } Events.TargetGround(2563, 489, 0, 0); for (int x = 0; x < 40; x++) { Thread.Sleep(100); String temp = (String)uonet.Journal[0]; if (temp.Contains("loosen")) { uonet.display("FoundLoosen"); break; } } //Thread.Sleep(3000); } uonet.display(Events.IntToEUO(uonet.player.CharID)); uoobject myobj = new uoobject(); foreach (DictionaryEntry Item in uonet.GameObjects) { uoobject mytemp = (uoobject)Item.Value; uonet.display("ID: " + mytemp.serial); } uonet.display("Script Ended!"); //Events.Move(3503, 2580, 0, 5); // uonet.Send(Packets.Send.Packets.MoveRequestPacket(Direction.West,0,0)); // Events.UseSkill(Skill.AnimalLore); //Thread.Sleep(500); //Events.UseSkill(Skill.Tracking); }
private void handleDrawObject(byte[] incMobile) { // Draw object really means draw mobile // May want to move mobiles to their own list? rather than item list uoobject myobject = new uoobject(); myobject.serial = ((incMobile[3] <<24) | (incMobile[4] <<16) | (incMobile[5] <<8) | (incMobile[6])); myobject.type = ((incMobile[7] <<8) | (incMobile[8] & 0xFF)); myobject.x = ((incMobile[9] <<8) | (incMobile[10] & 0xFF)); myobject.y = ((incMobile[11] <<8) | (incMobile[12] & 0xFF)); myobject.z = incMobile[13]; myobject.color = ((incMobile[14] <<8) | (incMobile[15])); // store the id in a 2nd array, if the id is found we update the data, if not we replace if(GameObjects.ContainsKey(myobject.serial)) { GameObjects.Remove(myobject.serial); GameObjects.Add(myobject.serial,myobject); } else { GameObjects.Add(myobject.serial,myobject); } display("Drawn Object ID: " + myobject.serial + " type: " + myobject.type + "X: " + myobject.x + "Y: " + myobject.y); }
private void handleObjectInfo(byte[] incMobile) { // This should be all correct // need to remove 8000000 from ID uoobject tmpob = new uoobject(); int offset = 0; int direction = 0; tmpob.serial = ((incMobile[3] <<24) | (incMobile[4] <<16) | (incMobile[5] <<8) | (incMobile[6] & 0xFF)); tmpob.type = (incMobile[7] << 8) | (incMobile[8] & 0xFF); if ((tmpob.serial & 0x80000000) == 0x80000000) { tmpob.stack = ((incMobile[9] <<8) | (incMobile[10] & 0xFF)); //int temp2 = (incMobile[4] & 0x7F); tmpob.serial = (tmpob.serial & 0x7FFFFF); // Removes the 8000000 if its found offset = offset + 2; } if ((tmpob.type & 0x8000) == 0x8000) { offset = offset + 1; } tmpob.x = ((incMobile[9 + offset] <<8) | (incMobile[10 + offset] & 0xFF)); tmpob.x = (tmpob.x & 0x7FFF); int temp = (incMobile[11 + offset] & 0xF); tmpob.y = ((temp << 8) | (incMobile[12 + offset] & 0xFF)); if ((tmpob.x & 0x8000) == 0x8000) { direction = incMobile[13 + offset]; offset = offset + 1; } tmpob.z = incMobile[13 + offset]; if ((tmpob.y & 0x8000) == 0x8000) { tmpob.color = ((incMobile[14 + offset] <<8) | (incMobile[15 + offset] & 0xFF)); offset = offset + 2; } if ((tmpob.y & 0x4000) == 0x4000) { tmpob.flags = incMobile[14 + offset]; } if (GameObjects.ContainsKey(tmpob.serial)) { GameObjects.Remove(tmpob.serial); GameObjects.Add(tmpob.serial, tmpob); } else { GameObjects.Add(tmpob.serial, tmpob); } display("Object Info ID: " + tmpob.serial + " Type: " + tmpob.type + "X: " + tmpob.x + "Y: " + tmpob.y); }
private void handleUpdatePlayer(byte[] buffer) { uoobject tmpob = new uoobject(); tmpob.serial = (buffer[4] & 0xFF) | ((buffer[3] & 0xFF) << 8) | ((buffer[2] & 0xFF) << 16) | ((buffer[1] & 0xFF) << 24); tmpob.type = (buffer[6] & 0xFF) | ((buffer[5] & 0xFF) << 8); tmpob.x = (buffer[8] & 0xFF) | ((buffer[7] & 0xFF) << 8); tmpob.y = (buffer[10] & 0xFF) | ((buffer[9] & 0xFF) << 8); tmpob.z = (buffer[11] & 0xFF); int direction = (buffer[12] & 0xFF); tmpob.color = (buffer[14] & 0xFF) | ((buffer[13] & 0xFF) << 8); int flag = (buffer[15] & 0xFF); int highlightColor = (buffer[16] & 0xFF); if (GameObjects.ContainsKey(tmpob.serial)) { GameObjects.Remove(tmpob.serial); GameObjects.Add(tmpob.serial, tmpob); } else { GameObjects.Add(tmpob.serial, tmpob); } if (tmpob.serial == player.CharID) { player.CharPosX = tmpob.x; player.CharPosY = tmpob.y; player.CharPosZ = tmpob.z; } display("Update Player ID: " + tmpob.serial + " type: " + tmpob.type + "X: " + tmpob.x + "Y: " + tmpob.y); }