Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v1.16 #122

Merged
merged 22 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
5d2bb55
add Ranni's Tower Fix to seamless header
Umgak Aug 25, 2024
e0e4594
fix model masks
Umgak Aug 25, 2024
ab42597
commit the correct version of the fix script please
Umgak Aug 25, 2024
810f4d3
destroy the timer if the script is deactivated early
Umgak Aug 25, 2024
6c9f396
TGA read/write extensions for C strings and singular bits
Dasaav-dsv Aug 25, 2024
1b9eff6
Update ThingName to support writes (and never return nil)
Dasaav-dsv Aug 25, 2024
b6bff3e
Fix inconsistent case
Dasaav-dsv Aug 25, 2024
4ca0582
Pad shorter writes with spaces to preserve null terminated buffer siz…
Dasaav-dsv Aug 25, 2024
c2b72a3
Small fix to getInvData, change "Print player inventory items" to "Pr…
inuNorii Aug 25, 2024
66a5b36
Merge pull request #117 from Umgak/dev
inuNorii Aug 25, 2024
658a8e4
Merge pull request #118 from Dasaav-dsv/dev
inuNorii Aug 25, 2024
fa5e96c
Merge branch 'dev' of https://github.com/The-Grand-Archives/Elden-Rin…
inuNorii Aug 25, 2024
6ccdebc
Fixed issues in getItemIdx, getItemByIdx, RemoveItem, equipItem
inuNorii Sep 2, 2024
82719c8
Update app ver in readme
inuNorii Sep 2, 2024
b904b7c
Increase TABLE_VERSION
inuNorii Sep 2, 2024
79d2399
Update changelog
inuNorii Sep 2, 2024
a345a53
Change position of "Sword of Night" in ItemDropdownDLC and WEAPON_ID …
inuNorii Sep 10, 2024
b3bc9c7
Ranni's Tower Fix fix
inuNorii Sep 11, 2024
7d1b712
Add 268435455 to GOODS_ID dropdown for EquipItemData->Pouch
inuNorii Sep 11, 2024
ac5b71c
Ranni's Tower Fix actually added to Seamless Co-op header
inuNorii Sep 11, 2024
7fab247
Change game version to v1.14.0 and table version to v1.16.0
inuNorii Sep 11, 2024
6da484b
Add version to changelog
inuNorii Sep 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions BUILD_ENV
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
TABLE_VERSION=1.15.0
GAME_VERSION=1.13.0
TABLE_VERSION=1.16.0
GAME_VERSION=1.14.0
MIN_CE_VERSION=7.4
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
# Changelog
## [Unreleased]

## [v1.16.0] - 2024-09-11
### Added
- by [Umgak](https://github.com/Umgak):
- Ranni's Tower Fix script for Seamless Co-op
- by [Dasaav](https://github.com/Dasaav-dsv/):
- TGA read/write extensions for C strings and singular bits
### Changed
- "Print player inventory items" has been renamed to "Print items" and now prints the currently selected type of inventory
- by [Dasaav](https://github.com/Dasaav-dsv/):
- ThingName to support writes (and never return nil)
- Change position of "Sword of Night" in ItemDropdownDLC and WEAPON_ID dropdowns
- Supported version to v1.14.0
### Removed
- "Print storage chest items
### Fixed
- getItemIdx, getItemByIdx, RemoveItem when no inventory specified
- equipItem when missing the "empty slot" weapons and protectors
- by [Umgak](https://github.com/Umgak):
- Model Masks offset in Last Protector Highlighted

## [v1.15.0] - 2024-08-10
### Added
- Support for "key items" in EquipInventoryData header and RemoveItem, getItemIdx, getItemByIdx, isInventoryFull functions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@
<id id="100601"/>
<id id="100602"/>
<id id="100603"/>
<id id="100604"/>
</x-ce2fs-child-order>
</CheatEntry>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
{$lua}
if syntaxcheck then return end
[ENABLE]
local invChoice = readByte(EquipInventoryDataIdx + 4)
local inv = getInvData(invChoice)
local keyOffset = inv[2] * 0x10

local GameDataMan = readPointer("GameDataMan")
local PlayerGameData = readPointer(GameDataMan + 0x8)
local EquipInventoryData = readPointer(PlayerGameData + 0x5D0)
local EquipInventoryData = readPointer(PlayerGameData + inv[1])

local inventoryList = readPointer(EquipInventoryData + 0x10 + keyOffset)
local inventoryNum = readInteger(EquipInventoryData + 0x18 + keyOffset)

local inventoryList = readPointer(EquipInventoryData + 0x10)
local inventoryNum = readInteger(EquipInventoryData + 0x18)
local invName = {
[0] = "Player Inventory"
[1] = "Storage Chest"
[2] = "Key Items (Player Inventory)"
[3] = "Key Items (Storage Chest)"
}

print("---- Player Inventory ----")
print("---- "..invName[invChoice].." ----")
local itemCount = 0
for i=0,2688 do
for i=0,inv[3] do
local item = getAddress(inventoryList + i * 0x18)
local GaItemHandle = readInteger(item)
local itemId = readInteger(item + 4)
Expand All @@ -32,4 +43,3 @@ end
disableMemrec(memrec)

[DISABLE]

Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
<id id="108249"/>
<id id="108253"/>
<id id="108255"/>
<id id="108256"/>
</x-ce2fs-child-order>
</CheatEntry>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function getInvData(value)
[2] = { 0x5D0, 1, 384}, -- key items on player
[3] = { 0x8D0, 1, 128} -- key items in chest
}
if value ~= nil and value >= 0 and value <= 4 then
if value ~= nil and value >= 0 and value < 4 then
return inv[value]
else
return false
Expand All @@ -24,7 +24,7 @@ function getItemIdx(inputId, inv)
local GameDataMan = readPointer("GameDataMan")
local PlayerGameData = readPointer(GameDataMan + 0x8)

local inv = getInvData(inv)
local inv = getInvData(inv or 0)
local invOffset = inv[1]
local keyOffset = inv[2] * 0x10

Expand Down Expand Up @@ -53,7 +53,7 @@ function getItemByIdx(idx, inv)
local GameDataMan = readPointer("GameDataMan")
local PlayerGameData = readPointer(GameDataMan + 0x8)

local inv = getInvData(inv)
local inv = getInvData(inv or 0)
local invOffset = inv[1]
local keyOffset = inv[2] * 0x10

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,59 @@
{$lua}
if syntaxcheck then return end
[ENABLE]
ThingName = {}

function ThingName:new(pName, length, fallback)
local o = {}
setmetatable(o, self)
self.__index = self
local str = fallback and tostring(fallback) or "?ThingName?"
self.fallback = str
if pName ~= nil then
local read = readString(pName, length, true)
if read ~= nil then
str = read
self.ptr = pName
end
end
self.length = str:len()
return o
end

function ThingName:len()
return self.length
end

function ThingName:default()
return self.fallback
end

function ThingName:read()
if self:len() <= 0 then
return ""
end
return self.ptr and tga.readWCStr(self.ptr, self.length) or self:default()
end

ThingName.__tostring = ThingName.read

function ThingName:write(name)
name = name and tostring(name)
if name == nil then return end
local len = self.length - string.len(name)
if len > 0 then
-- pad with spaces (or we lose null terminated length information)
name = table.concat{name, string.rep(" ", len)}
end
-- already does boundary checking
tga.writeWCStr(self.ptr, name, self.length)
end

-- minimal buffer size in bytes to store the name or its default
function ThingName:buf()
return (math.max(self.length, self.fallback:len()) + 1) * 2
end

local function findByFmgIndex(fmgIndex, id)
if fmgIndex < 0 or fmgIndex >= 512 or id < 0 then
return nil
Expand Down Expand Up @@ -59,48 +112,45 @@ local function findInFmgs(fmgIndexTable, id)
return nil
end

local function getThingName(fmgIndices, id, length, default)
if type(id) ~= "number" then return default end
local function getThingName(fmgIndices, id, length, fallback)
local pName = findInFmgs(fmgIndices, id)
if pName ~= nil then
return readString(pName, length, true)
end
return default
return ThingName:new(pName, length, fallback)
end

function getGoodsName(goodsId)
return getThingName({111, 10, 319, 419}, goodsId, 128, "?GoodsName?")
return getThingName({111, 10, 319, 419}, goodsId, 256, "?GoodsName?")
end

function getWeaponName(weaponId)
return getThingName({115, 11, 310, 410}, weaponId, 128, "?WeaponName?")
return getThingName({115, 11, 310, 410}, weaponId, 256, "?WeaponName?")
end

function getProtectorName(protectorId)
return getThingName({117, 12, 313, 413}, protectorId, 128, "?ProtectorName?")
return getThingName({117, 12, 313, 413}, protectorId, 256, "?ProtectorName?")
end

function getAccessoryName(accessoryId)
return getThingName({113, 13, 316, 416}, accessoryId, 128, "?AccessoryName?")
return getThingName({113, 13, 316, 416}, accessoryId, 256, "?AccessoryName?")
end

function getMagicName(magicId)
return getThingName({118, 14, 325, 425}, magicId, 128, "?MagicName?")
return getThingName({118, 14, 325, 425}, magicId, 256, "?MagicName?")
end

function getArtsName(artsId)
return getThingName({42, 331, 431}, artsId, 128, "?ArtsName?")
return getThingName({42, 331, 431}, artsId, 256, "?ArtsName?")
end

function getNpcName(npcId)
return getThingName({119, 18, 328, 428}, npcId, 128, "?NpcName?")
return getThingName({119, 18, 328, 428}, npcId, 256, "?NpcName?")
end

function getPlaceName(placeId)
return getThingName({120, 19, 329, 429}, placeId, 128, "?PlaceName?")
return getThingName({120, 19, 329, 429}, placeId, 256, "?PlaceName?")
end

[DISABLE]
ThingName = nil
getGoodsName = nil
getWeaponName = nil
getProtectorName = nil
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<CheatEntry>
<ID>108255</ID>
<Description>"GetThingName_Code"</Description>
<Description>"GetThingName_code"</Description>
<VariableType>Auto Assembler Script</VariableType>
</CheatEntry>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ local func_addr = AOBScanModuleUnique(process,"?? 83 ec ?? 8b f2 ?? 8b e9 ?? 85
function RemoveItem(idx, inv)
local GameDataMan = readPointer("GameDataMan")
local PlayerGameData = readPointer(GameDataMan + 8)
inv = getInvData(inv)
inv = getInvData(inv or 0)
local EquipInventoryData = readPointer(PlayerGameData + inv[1])
local tailDataIdx = readInteger(EquipInventoryData + 0x1C + inv[2] * 0x10)
return executeCodeEx(0, 100, func_addr, EquipInventoryData, idx + tailDataIdx, 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ function equipItem(slot, invIdx)
return false
end

local function getItemIfMissing(id)
local idx = getItemIdx(id)
if not idx then
ItemGive(id)
return getItemIdx(id)
end
return idx
end

local GameDataMan = readPointer("GameDataMan")
local PlayerGameData = readPointer(GameDataMan + 0x8)
local EquipGameData = PlayerGameData + 0x2B0
Expand All @@ -40,31 +49,20 @@ function equipItem(slot, invIdx)
local protector_type = 0x10000000
if slot <= 5 then
item = 110000
invIdx = getItemIdx(item)
elseif slot == 12 then
item = 10000 + protector_type
invIdx = getItemIdx(item)
elseif slot == 13 then
item = 10100 + protector_type
invIdx = getItemIdx(item)
elseif slot == 14 then
item = 10200 + protector_type
invIdx = getItemIdx(item)
elseif slot == 15 then
item = 10300 + protector_type
invIdx = getItemIdx(item)

else
invIdx = 0xFFFFFFFF
tailDataIdx = 0
end

if not invIdx then
local e = "Item not found"
print(e)
error(e, 2)
end

if invIdx ~= 0xFFFFFFFF then invIdx = getItemIfMissing(item) end
if not invIdx then throwError("Item not found") end
writeInteger(equipItem_data + 0x10, item)
end

Expand All @@ -79,4 +77,4 @@ end
deAlloc(equipItem_data)
equipItem_data = nil
equipItem = nil
unequipItem = nil
unequipItem = nil
Loading