@@ -148,6 +148,12 @@ function Town:createMemoryRecord()
148148 landTaxRateRecord.Type = vtByte
149149 landTaxRateRecord.appendToEntry(record)
150150
151+ local townFlagsRecord = addressList.createMemoryRecord()
152+ townFlagsRecord.Address = self.Address + 0x2c8;
153+ townFlagsRecord.Description = "Town Flags"
154+ townFlagsRecord.ShowAsHex = true
155+ townFlagsRecord.appendToEntry(record)
156+
151157 local headTaxRateRecord = addressList.createMemoryRecord()
152158 headTaxRateRecord.Address = self.Address + 0x6f8;
153159 headTaxRateRecord.Description = "Head Tax Rate"
@@ -224,6 +230,34 @@ function Town:createMemoryRecord()
224230 satisfactionBeggarRecord.ShowAsSigned = true
225231 satisfactionBeggarRecord.appendToEntry(record)
226232
233+ local satisfactionRichRecord = addressList.createMemoryRecord()
234+ satisfactionRichRecord.Address = self.Address + 0x0308;
235+ satisfactionRichRecord.Description = "Current Unscaled Satisfaction (Rich)"
236+ satisfactionRichRecord.Type = vtWord
237+ satisfactionRichRecord.ShowAsSigned = true
238+ satisfactionRichRecord.appendToEntry(record)
239+
240+ local satisfactionWealthyRecord = addressList.createMemoryRecord()
241+ satisfactionWealthyRecord.Address = self.Address + 0x30a;
242+ satisfactionWealthyRecord.Description = "Current Unscaled Satisfaction (Wealthy)"
243+ satisfactionWealthyRecord.Type = vtWord
244+ satisfactionWealthyRecord.ShowAsSigned = true
245+ satisfactionWealthyRecord.appendToEntry(record)
246+
247+ local satisfactionPoorRecord = addressList.createMemoryRecord()
248+ satisfactionPoorRecord.Address = self.Address + 0x30c;
249+ satisfactionPoorRecord.Description = "Current Unscaled Satisfaction (Poor)"
250+ satisfactionPoorRecord.Type = vtWord
251+ satisfactionPoorRecord.ShowAsSigned = true
252+ satisfactionPoorRecord.appendToEntry(record)
253+
254+ local satisfactionBeggarRecord = addressList.createMemoryRecord()
255+ satisfactionBeggarRecord.Address = self.Address + 0x30e;
256+ satisfactionBeggarRecord.Description = "Current Unscaled Satisfaction (Beggar)"
257+ satisfactionBeggarRecord.Type = vtWord
258+ satisfactionBeggarRecord.ShowAsSigned = true
259+ satisfactionBeggarRecord.appendToEntry(record)
260+
227261 local wellsRecord = addressList.createMemoryRecord()
228262 wellsRecord.Address = self.Address + 0x789;
229263 wellsRecord.Description = "Wells"
@@ -272,6 +306,29 @@ function Town:createMemoryRecord()
272306 field_776_class31s_len_record.Type = vtWord
273307 field_776_class31s_len_record.appendToEntry(record)
274308
309+ local freezingDaysRecord = addressList.createMemoryRecord()
310+ freezingDaysRecord.Description = "Freezing Counter"
311+ freezingDaysRecord.Address = self.Address + 0x9b8;
312+ freezingDaysRecord.appendToEntry(record)
313+
314+ local freezingDaysRecord = addressList.createMemoryRecord()
315+ freezingDaysRecord.Description = "Freezing Days"
316+ freezingDaysRecord.Address = self.Address + 0x9bd;
317+ freezingDaysRecord.appendToEntry(record)
318+
319+ local freezing9C0Record = addressList.createMemoryRecord()
320+ freezing9C0Record.Description = "Freezing 9C0"
321+ freezing9C0Record.Address = self.Address + 0x9c0;
322+ freezing9C0Record.appendToEntry(record)
323+
324+ local freezing9C4Record = addressList.createMemoryRecord()
325+ freezing9C4Record.Description = "Freezing 9C4"
326+ freezing9C4Record.Address = self.Address + 0x9c4;
327+ freezing9C4Record.ShowAsHex = true
328+ freezing9C4Record.appendToEntry(record)
329+
330+ Shipyard:create(self.Address + 0x810):createMemoryRecord(record)
331+
275332 record.Collapsed = true
276333end
277334
@@ -315,6 +372,13 @@ function Town:createWaresRecords(parentRecord)
315372 waresRecord.IsGroupHeader = true
316373 waresRecord.Options = "moManualExpandCollapse"
317374 waresRecord.Description = "Wares"
375+
376+ local notEnoughWaresRecord = addressList.createMemoryRecord()
377+ notEnoughWaresRecord.Address = self.Address + 0x00
378+ notEnoughWaresRecord.Description = "Not enough wares flag"
379+ notEnoughWaresRecord.Type = vtWord
380+ notEnoughWaresRecord.appendToEntry(waresRecord)
381+
318382 for i=0,23 do
319383 local wareRecord = addressList.createMemoryRecord()
320384 wareRecord.Address = self.Address + 0x04 + (i*4)
@@ -458,12 +522,24 @@ function Merchant:createMemoryRecord()
458522 self:createRankRecords(record)
459523 self:createOfficeRecords(record)
460524
525+ local field8Record = addressList.createMemoryRecord()
526+ field8Record.Address = self.Address + 0x08;
527+ field8Record.Description = "field8"
528+ field8Record.Type = vtWord
529+ field8Record.appendToEntry(record)
530+
461531 local hometownIndexRecord = addressList.createMemoryRecord()
462532 hometownIndexRecord.Address = self.Address + 0x19;
463533 hometownIndexRecord.Description = "Hometown Index"
464534 hometownIndexRecord.Type = vtByte
465535 hometownIndexRecord.appendToEntry(record)
466536
537+ local sailorReputationRecord = addressList.createMemoryRecord()
538+ sailorReputationRecord.Address = self.Address + 0x1f;
539+ sailorReputationRecord.Description = "Sailor Reputation"
540+ sailorReputationRecord.Type = vtByte
541+ sailorReputationRecord.appendToEntry(record)
542+
467543 local nameRecord = addressList.createMemoryRecord()
468544 nameRecord.Address = string.format("+%X", readInteger(self.Address + 0xe8))
469545 nameRecord.Description = "Name"
@@ -536,11 +612,15 @@ function Merchant:createReputationRecords(parentRecord)
536612 local reputationRecord = addressList.createMemoryRecord()
537613 reputationRecord.IsGroupHeader = true
538614 reputationRecord.Options = "moManualExpandCollapse"
539- reputationRecord.Address = self.Address + 0x2fc + (i*4)
540- reputationRecord.Type = vtSingle
541615 reputationRecord.Description = townNames[getTownId(i)]
542616 reputationRecord.appendToEntry(reputationRecords)
543617
618+ local currentReputationRecord = addressList.createMemoryRecord()
619+ currentReputationRecord.Address = self.Address + 0x2fc + (i*4)
620+ currentReputationRecord.Type = vtSingle
621+ currentReputationRecord.Description = "Reputation"
622+ currentReputationRecord.appendToEntry(reputationRecord)
623+
544624 local buildingReputationRecord = addressList.createMemoryRecord()
545625 buildingReputationRecord.Address = self.Address + 0x11c + (i*3*4)
546626 buildingReputationRecord.Type = vtSingle
@@ -565,7 +645,6 @@ function Merchant:createReputationRecords(parentRecord)
565645 sailorReputationRecord.Description = "Sailors"
566646 sailorReputationRecord.appendToEntry(reputationRecord)
567647
568-
569648 reputationRecord.Collapsed = true
570649 end
571650 reputationRecords.Collapsed = true
@@ -603,6 +682,56 @@ function Merchant:createOfficeRecords(parentRecord)
603682 officeRecords.appendToEntry(parentRecord)
604683end
605684
685+
686+ Shipyard = {}
687+ Shipyard.__index = Shipyard
688+
689+ function Shipyard:create(address)
690+ local obj = {}
691+ setmetatable(obj, Shipyard)
692+ obj.Address = address
693+ return obj
694+ end
695+
696+ function Shipyard:createMemoryRecord(parentRecord)
697+ local record = addressList.createMemoryRecord()
698+ record.IsGroupHeader = true
699+ record.Options = "moManualExpandCollapse"
700+ record.Description = "Shipyard"
701+
702+ local xpRecord = addressList.createMemoryRecord()
703+ xpRecord.Address = self.Address + 0x00
704+ xpRecord.Description = "XP"
705+ xpRecord.appendToEntry(record)
706+
707+ local pendingXpRecord = addressList.createMemoryRecord()
708+ pendingXpRecord.Address = self.Address + 0x04
709+ pendingXpRecord.Description = "Pending XP"
710+ pendingXpRecord.appendToEntry(record)
711+
712+ local utilizationMarkupRecord = addressList.createMemoryRecord()
713+ utilizationMarkupRecord.Address = self.Address + 0x08
714+ utilizationMarkupRecord.Description = "Utilization Markup"
715+ utilizationMarkupRecord.Type = vtSingle
716+ utilizationMarkupRecord.appendToEntry(record)
717+
718+ local buildingShipIndexRecord = addressList.createMemoryRecord()
719+ buildingShipIndexRecord.Address = self.Address + 0x0c
720+ buildingShipIndexRecord.Description = "Building Ship Index"
721+ buildingShipIndexRecord.Type = vtWord
722+ buildingShipIndexRecord.appendToEntry(record)
723+
724+ local repairingShipIndexRecord = addressList.createMemoryRecord()
725+ repairingShipIndexRecord.Address = self.Address + 0x0e
726+ repairingShipIndexRecord.Description = "Reparing Ship Index"
727+ repairingShipIndexRecord.Type = vtWord
728+ repairingShipIndexRecord.appendToEntry(record)
729+
730+ record.Collapsed = true
731+ record.appendToEntry(parentRecord)
732+ end
733+
734+
606735Office = {}
607736Office.__index = Office
608737
@@ -628,6 +757,20 @@ function Office:createMemoryRecord(parentRecord)
628757 record.Options = "moManualExpandCollapse"
629758 record.Description = townNames[getTownId(self:getTownIndex())]
630759
760+ local waresRecord = addressList.createMemoryRecord()
761+ waresRecord.IsGroupHeader = true
762+ waresRecord.Options = "moManualExpandCollapse"
763+ waresRecord.Description = "Wares"
764+ for i=0,23 do
765+ local wareAvgPriceRecord = addressList.createMemoryRecord()
766+ wareAvgPriceRecord.Address = self.Address + 0x3b8 + 0x04 * i;
767+ wareAvgPriceRecord.Description = wareNames[i].." (Avg Price)"
768+ wareAvgPriceRecord.Type = vtSingle
769+ wareAvgPriceRecord.appendToEntry(waresRecord)
770+ end
771+ waresRecord.Collapsed = true
772+ waresRecord.appendToEntry(record)
773+
631774 local _2e4RichRecord = addressList.createMemoryRecord()
632775 _2e4RichRecord.Address = self.Address + 0x2e4 + 0x00;
633776 _2e4RichRecord.Description = "Rent Rich"
@@ -777,7 +920,144 @@ function Class5:createMemoryRecord(parentRecord)
777920 class5Record.appendToEntry(parentRecord)
778921end
779922
923+ LocalMapShip = {}
924+ LocalMapShip.__index = LocalMapShip
925+
926+ function LocalMapShip:create(address, index)
927+ local obj = {}
928+ setmetatable(obj, LocalMapShip)
929+ obj.Address = address
930+ obj.Index = index
931+ return obj
932+ end
933+
934+ function LocalMapShip:createMemoryRecord(parentRecord)
935+ local localMapShipRecord = addressList.createMemoryRecord()
936+ localMapShipRecord.IsGroupHeader = true
937+ localMapShipRecord.Options = "moManualExpandCollapse"
938+ localMapShipRecord.Description = "Local Map Ship "..self.Index
939+
940+ local shipXRecord = addressList.createMemoryRecord()
941+ shipXRecord.Address = self.Address + 0x08
942+ shipXRecord.Description = "X"
943+ shipXRecord.ShowAsHex = true
944+ shipXRecord.appendToEntry(localMapShipRecord)
945+
946+ local shipYRecord = addressList.createMemoryRecord()
947+ shipYRecord.Address = self.Address + 0x0c
948+ shipYRecord.Description = "Y"
949+ shipYRecord.ShowAsHex = true
950+ shipYRecord.appendToEntry(localMapShipRecord)
951+
952+ local shipDirectionRecord = addressList.createMemoryRecord()
953+ shipDirectionRecord.Address = self.Address + 0x11
954+ shipDirectionRecord.Description = "Ship Direction"
955+ shipDirectionRecord.ShowAsHex = true
956+ shipDirectionRecord.Type = vtByte
957+ shipDirectionRecord.appendToEntry(localMapShipRecord)
958+
959+
960+ local shipIndex = readInteger(self.Address + 0x04)
961+ local t = Ship:create(readInteger(shipsAddress + 0x04) + 0x180 * shipIndex, shipIndex)
962+ t:createMemoryRecord(localMapShipRecord)
963+
964+ localMapShipRecord.appendToEntry(parentRecord)
965+ end
966+
967+ Ship = {}
968+ Ship.__index = Ship
969+
970+ function Ship:create(address, index)
971+ local obj = {}
972+ setmetatable(obj, Ship)
973+ obj.Address = address
974+ obj.Index = index
975+ return obj
976+ end
977+
978+ function Ship:createMemoryRecord(parentRecord)
979+ local shipRecord = addressList.createMemoryRecord()
980+ shipRecord.IsGroupHeader = true
981+ shipRecord.Options = "moManualExpandCollapse"
982+ shipRecord.Description = "Ship "..self.Index
983+
984+ local maxHealthRecord = addressList.createMemoryRecord()
985+ maxHealthRecord.Address = self.Address + 0x14
986+ maxHealthRecord.Description = "Max Health"
987+ maxHealthRecord.appendToEntry(shipRecord)
988+
989+ local currentHealthRecord = addressList.createMemoryRecord()
990+ currentHealthRecord.Address = self.Address + 0x18
991+ currentHealthRecord.Description = "Current Health"
992+ currentHealthRecord.appendToEntry(shipRecord)
993+
994+ local sailorsRecord = addressList.createMemoryRecord()
995+ sailorsRecord.Address = self.Address + 0x40
996+ sailorsRecord.Description = "Sailors"
997+ sailorsRecord.Type = vtWord
998+ sailorsRecord.appendToEntry(shipRecord)
999+
1000+ local nameRecord = addressList.createMemoryRecord()
1001+ nameRecord.Address = self.Address + 0x0160
1002+ nameRecord.Description = "Name"
1003+ nameRecord.Type = vtString
1004+ nameRecord.String.Size = 10
1005+ nameRecord.appendToEntry(shipRecord)
1006+
1007+ local weaponsRecord = addressList.createMemoryRecord()
1008+ weaponsRecord.IsGroupHeader = true
1009+ weaponsRecord.Options = "moManualExpandCollapse"
1010+ weaponsRecord.Description = "Weapons"
1011+ for i=0,23 do
1012+ local weaponRecord = addressList.createMemoryRecord()
1013+ weaponRecord.Address = self.Address + 0x013c + i
1014+ weaponRecord.Description = "Slot "..i
1015+ weaponRecord.Type = vtByte
1016+ weaponRecord.ShowAsHex = true
1017+ weaponRecord.appendToEntry(weaponsRecord)
1018+ end
1019+ weaponsRecord.appendToEntry(shipRecord)
1020+ weaponsRecord.Collapsed = true
1021+
1022+ shipRecord.appendToEntry(parentRecord)
1023+ end
1024+
1025+ SeaBattle = {}
1026+ SeaBattle.__index = SeaBattle
1027+
1028+ function SeaBattle:create(address, index)
1029+ local obj = {}
1030+ setmetatable(obj, SeaBattle)
1031+ obj.Address = address
1032+ obj.Index = index
1033+ return obj
1034+ end
1035+
1036+ function SeaBattle:createMemoryRecord(parentRecord)
1037+ local seaBattleRecord = addressList.createMemoryRecord()
1038+ seaBattleRecord.IsGroupHeader = true
1039+ seaBattleRecord.Options = "moManualExpandCollapse"
1040+ seaBattleRecord.Description = "Sea Battle "..self.Index
1041+
1042+ local windDirectionRecord = addressList.createMemoryRecord()
1043+ windDirectionRecord.Address = self.Address + 0x670
1044+ windDirectionRecord.Description = "Wind Direction"
1045+ windDirectionRecord.ShowAsHex = true
1046+ windDirectionRecord.Type = vtByte
1047+ windDirectionRecord.appendToEntry(seaBattleRecord)
1048+
1049+ local localMapShipsCount = readSmallInteger(self.Address + 0x14)
1050+ for i=0,localMapShipsCount-1 do
1051+ local t = LocalMapShip:create(readInteger(readInteger(self.Address + 0x04) + 4 * i), i)
1052+ t:createMemoryRecord(seaBattleRecord)
1053+ end
1054+
1055+ seaBattleRecord.appendToEntry(parentRecord)
1056+ end
1057+
7801058gameWorldAddress = 0x006DE4A0
1059+ class11Address = 0x006E55D0
1060+ shipsAddress = 0x006DD7A0
7811061addressList = getAddressList()
7821062
7831063
@@ -889,5 +1169,18 @@ c5:createMemoryRecord(gameLoopRecord)
8891169
8901170gameLoopRecord.Collapsed = true
8911171
1172+
1173+ -- Sea Battles
1174+ local seaBattlesRecord = addressList.createMemoryRecord()
1175+ seaBattlesRecord.Description = "Sea Battles"
1176+ seaBattlesRecord.IsGroupHeader = true
1177+ seaBattlesRecord.Options = "moManualExpandCollapse"
1178+ local battlesAllocated = readByte(class11Address + 0x404)
1179+ local battlesAddress = readInteger(class11Address)
1180+ for i=0,battlesAllocated-1 do
1181+ local t = SeaBattle:create(battlesAddress + i*0x2f24, i)
1182+ t:createMemoryRecord(seaBattlesRecord)
1183+ end
1184+
8921185</LuaScript >
8931186</CheatTable >
0 commit comments