Closed AmProsius closed 3 years ago
A few words about the fix. It will prevent NPCs from equipping a weapon when they already have one of the type equipped. That means in particular:
In short: An NPC willl auto-equip a ranged and a melee weapon if available - but only the first time.
So, you could argue the fix only works to a certain extend. In most cases, the first sold ranged weapon will be "lost" for most traders.
I had an idea to improve this slightly.
Trading with mages (e.g. Xardas or Cronos) will always result in them equipping weapons, because they typically do not wear any to begin with. As soon as the player sells them a weapon (of any type) they will have it equipped when the player returns to them even with this fix. There is the option of disabling that for NPCs that exclusively use magic to fight:
changed to
func void G1CP_059_NpcEquipBestWeapons_Hook() {
G1CP_ReportFuncToSpy();
// Define possibly missing symbols locally
const int ITEM_KAT_NF = 2;
const int ITEM_KAT_FF = 4;
const int FAI_HUMAN_MAGE = -2;
if (FAI_HUMAN_MAGE == -2) {
FAI_HUMAN_MAGE = G1CP_GetIntVar("FAI_HUMAN_MAGE", 0, -1);
};
var C_Npc npc; npc = _^(ESI);
if (!Npc_HasEquippedMeleeWeapon(npc))
&& (!Npc_HasReadiedMeleeWeapon(npc))
&& (npc.fight_tactic != FAI_HUMAN_MAGE) {
G1CP_NpcEquipBestWeaponByType(npc, ITEM_KAT_NF);
};
if (!Npc_HasEquippedRangedWeapon(npc))
&& (!Npc_HasReadiedRangedWeapon(npc))
&& (npc.fight_tactic != FAI_HUMAN_MAGE) {
G1CP_NpcEquipBestWeaponByType(npc, ITEM_KAT_FF);
};
};
This should work great in the main game. In mods, however, it could cause issues. If a mod, for example, adds wands or staffs for mages but does not equip them (only adds them to the inventory), they would not show up in the game. Given that those NPCs would only fight with magic anyway it might only cause cosmetic issues - given that the fight AI was not adjusted such the mage-fighters switch to melee in close combat for example.
We could discuss this. In my opinion it would be nice not seeing Xardas with weird orc weapons on his back.
If we choose to do so, that might be something for v1.1.0 or even a hotfix for v1.0.0 should we have to create one anyway.
Trading with mages (e.g. Xardas or Cronos) will always result in them equipping weapons, because they typically do not wear any to begin with. As soon as the player sells them a weapon (of any type) they will have it equipped when the player returns to them even with this fix. There is the option of disabling that for NPCs that exclusively use magic to fight[.]
I like this idea, but I'd like to treat it as a separate fix, so mods would be able to disable the mage fight (if they introduce staffs) without disabling the vendor fix.
I'd like to treat it as a separate fix, so mods would be able to disable the mage fight (if they introduce staffs) without disabling the vendor fix.
I think that should be possible. Of course, the separate fix will only take effect if this fix here (#59) is applied, too.
Hello, everyone!
I am sorry for spamming a closed report, I wasn't sure if I should ask here or open a new report.
I noticed that NPC "Scorpio" is equipping some of his merchandise. In Chapter 4 he has the Heavy Crossbow and Guards' Sword equipped. In Chapter 5 he equips the Vengeful Steel.
Is the fix supposed to take effect on him as well?
Scorpio in Chapter 4.
Scorpio in Chapter 5.
Regards, Quintus24
@Quintus24 Thanks for the report. Judging from the script this should not happen. I will try to reproduce this.
In the meantime some notes:
fix status 59
. Nevertheless, we will check on our side if we can reproduce the error.
Hi @szapp,
I checked a few more merchants and noticed that only Sharky seems to have equipped a crossbow, which I sold him. However, he never had a ranged weapon equipped in the first place, additionally, he equipped it when I was not around him.
Best Regards, Quintus24
When the player sells a weapon to a vendor that's stronger than their current one, the vendor will equip the new weapon. That prevents the player from buying that weapon back.