PDA

View Full Version : NPCs added to CT have attack weapons set to unidentified



alloowishus
January 8th, 2025, 14:55
Having attacks set to identified causes problems, I am trying to find out how to make sure they are all set to identified when added to the CT. There is a function in the manager_combat2.lua in my ruleset called "onNPCPostAdd"

-- Setup Attacks
for _, nodeWeapon in pairs(DB.getChildren(tCustom.nodeCT, "weapons")) do
if DB.getValue(nodeWeapon, "name", "") == "" and DB.getValue(nodeWeapon, "type", "") == "" then
nodeWeapon.delete();
else
ItemManager2.UpdateToCoreRPG(nodeWeapon);
DB.setValue(nodeWeapon, "open", "windowreference", "item", "");
DB.setValue(nodeWeapon, "locked", "number", 0);
end
end

Any ideas on how I would set the weapons to "identified" and make sure that the DB.xml is populated with the information as if I clicked on "identified" icon? Thanks. 63166

Moon Wizard
January 8th, 2025, 23:55
Why not just fix the code in the attacks that has problems with the identification state?

"isidentified" is the name of the field that controls the identification state. You can force by using DB.setValue(node, "isidentified", "number", 1).

Regards,
JPG