-- Version 1.1 ELEMENT_NONE = -1 ELEMENT_EARTH = 0 ELEMENT_WATER = 1 ELEMENT_FIRE = 2 ELEMENT_WIND = 3 ELEMENT_LIGHT = 4 ELEMENT_DARK = 5 CPetEgg = class( function (self, _inventoryItem) self.Item = _inventoryItem; self.Address = _inventoryItem.Address; self.Id = 0 self.Name = "" self.PetId = 0 self.PetName = "" self.Element = -1 self.Level = 0 self.Aptitude = 0 if self.Address then self:update() end end ) function CPetEgg:update() self.Id = memoryReadInt(getProc(), self.Address) self.Name = GetIdName(self.Id) self.PetId = memoryReadInt(getProc(), self.Address + 0x24) self.PetName = GetIdName(self.PetId) self.Element = memoryReadByte(getProc(), self.Address + 0x2D) self.Level = memoryReadByte(getProc(), self.Address + 0x2E) self.Aptitude = memoryReadByte(getProc(), self.Address + 0x30) end -- _eggSlot is the slot you wish to extract the egg to -- _item is the inventory item that is the pet egg you wish to extract (I haven't gotten to the point yet where I can easily find items that are eggs and that are the level I want etc) function CPetEgg:extract(_eggSlot) if (self == nil) then printf("No egg item was specified. Cannot Extract the egg.\n"); return; end; if (_eggSlot == nil) then printf("You must specify an egg slot into which to extract the new egg.\n"); return; end; local inUse = RoMScript("HasPetItem("..tostring(_eggSlot)..")"); if (inUse) then printf("The pet slot is already in use\n"); return; end; self.Item:use(); --printf("Perform Extraction to ".._eggSlot.."\n"); RoMScript("SetPetItem("..tostring(_eggSlot)..")"); yrest(500); return CEggPet(_eggSlot); end; -- _reagent is the index of the pet you want to merge into this egg. function CEggPet:merge(_reagent) if (_reagent.EggSlot == self.EggSlot) then printf("Cannot merge an egg pet with itself!\n"); end; local max, count = RoMScript("GetPetMixDayMergeCount("..tostring(self.EggSlot)..")"); --printf(tostring(count).."/"..tostring(max).." merges\n"); if (count >= max) then printf("Maximum number of merges has been reached\n"); return; end; --printf("Perform merge!! /run PET_MIX_SELECT_ID1="..tostring(self.EggSlot).."; PET_MIX_SELECT_ID2="..tostring(_reagent.EggSlot).."; SetPetMix(PET_MIX_SELECT_ID1, PET_MIX_SELECT_ID2, 0)\n"); RoMScript("/run PET_MIX_SELECT_ID1="..tostring(self.EggSlot).."; PET_MIX_SELECT_ID2="..tostring(_reagent.EggSlot).."; SetPetMix(PET_MIX_SELECT_ID1, PET_MIX_SELECT_ID2, 0)"); yrest(500); self:update(); end