diff --git a/TemplePlus/condition.cpp b/TemplePlus/condition.cpp index 92579c3b8..a6de25fe3 100644 --- a/TemplePlus/condition.cpp +++ b/TemplePlus/condition.cpp @@ -210,6 +210,7 @@ class ItemCallbacks static int __cdecl WeaponViciousBlowback(DispatcherCallbackArgs args); // TODO (need to replace the damage calculation function to do this right...) static int __cdecl WeaponWounding(DispatcherCallbackArgs args); static int __cdecl WeaponThundering(DispatcherCallbackArgs args); + static int __cdecl ArmorShadowSilentMovesSkillBonus(DispatcherCallbackArgs args); static int __cdecl WeaponDamageBonus(DispatcherCallbackArgs args); @@ -500,6 +501,9 @@ class ConditionFunctionReplacement : public TempleFix { // Fixes Weapon Damage Bonus for ammo items replaceFunction(0x100FFE90, itemCallbacks.WeaponDamageBonus); + // Allow silent moves and shadow armor to have multipe levels + replaceFunction(0x10102370, itemCallbacks.ArmorShadowSilentMovesSkillBonus); + // Cast Defensively Aoo Trigger Query, SpellInterrupted Query replaceFunction(0x100F8BE0, genericCallbacks.CastDefensivelyAooTrigger); replaceFunction(0x100F8CC0, genericCallbacks.CastDefensivelySpellInterrupted); @@ -5384,7 +5388,7 @@ int __cdecl ItemCallbacks::MaxDexBonus(objHndl armor) auto parent = inventory.GetParent(armor); if (parent) { auto obj = objSystem->GetObject(parent); - if ((obj != nullptr) && (obj->GetInt32(obj_f_type) == obj_t_pc)) { + if ((obj != nullptr) && (obj->IsPC() || obj->IsNPC())) { auto adjustment = d20Sys.D20QueryPython(parent, "Max Dex Bonus Adjustment", armor); res += adjustment; } @@ -5403,7 +5407,7 @@ int __cdecl ItemCallbacks::ArmorCheckPenalty(objHndl armor) auto parent = inventory.GetParent(armor); if (parent) { auto obj = objSystem->GetObject(parent); - if ((obj != nullptr) && (obj->GetInt32(obj_f_type) == obj_t_pc)) { + if ((obj != nullptr) && (obj->IsPC() || obj->IsNPC())) { auto adjustment = d20Sys.D20QueryPython(parent, "Armor Check Penalty Adjustment", armor); res += adjustment; //The adjustment is a positive value, the penalty is a negative value res = std::min(res, 0); @@ -5566,6 +5570,26 @@ int ItemCallbacks::WeaponWounding(DispatcherCallbackArgs args){ } +int __cdecl ItemCallbacks::ArmorShadowSilentMovesSkillBonus(DispatcherCallbackArgs args) +{ + GET_DISPIO(dispIoTypeObjBonus, DispIoObjBonus); + + auto inventoryIdx = args.GetCondArg(2); + auto value = args.GetCondArg(0); //Now supporting multiple values for improved and greater + value = std::max(value, 5); //In case this is an old cond which would possible have a 0 value instead of 5 + + auto item = inventory.GetItemAtInvIdx(args.objHndCaller, inventoryIdx); + + const char* desc = nullptr; + if (item != objHndl::null) { + desc = description.getDisplayName(item); + } + + dispIo->bonOut->AddBonusWithDesc(value, 34, 112, desc); + + return 0; +} + int ItemCallbacks::WeaponThundering(DispatcherCallbackArgs args){ GET_DISPIO(dispIOTypeDamage, DispIoDamage); diff --git a/tpdata/co8infra.dat b/tpdata/co8infra.dat index 75811b3d5..f4fed52f8 100644 Binary files a/tpdata/co8infra.dat and b/tpdata/co8infra.dat differ diff --git a/tpdata/kotbfixes.dat b/tpdata/kotbfixes.dat index ada0e183c..4a2f010d2 100644 Binary files a/tpdata/kotbfixes.dat and b/tpdata/kotbfixes.dat differ diff --git a/tpdata/tpgamefiles.dat b/tpdata/tpgamefiles.dat index 2abb569c2..4c9f83dac 100644 Binary files a/tpdata/tpgamefiles.dat and b/tpdata/tpgamefiles.dat differ diff --git a/tpdata/tpmes/item_creation.mes b/tpdata/tpmes/item_creation.mes index e5e70a49e..d87876f16 100644 --- a/tpdata/tpmes/item_creation.mes +++ b/tpdata/tpmes/item_creation.mes @@ -109,6 +109,11 @@ {1242}{Blurring} {1243}{Displacement} {1244}{Mobility} +{1245}{Commander} +{1246}{Shadow, Imp} +{1247}{Shadow, Gtr} +{1248}{Silent Moves, Imp} +{1249}{Silent Moves, Gtr} // shield bonuses {1400}{+1} diff --git a/tpdata/tprules/craft_maa_specs.tab b/tpdata/tprules/craft_maa_specs.tab index 5df206507..93745bfae 100644 --- a/tpdata/tprules/craft_maa_specs.tab +++ b/tpdata/tprules/craft_maa_specs.tab @@ -41,8 +41,8 @@ 205 Armor Light Fortification IESF_ARMOR 1 0 C3 206 Armor Glamered IESF_ARMOR 1 0 C3 207 Armor Slick IESF_ARMOR 1 0 C3 -208 Armor Shadow IESF_ARMOR 1 0 C3 -209 Armor Silent Moves IESF_ENABLED IESF_ARMOR 1 0 C3 +208 Armor Shadow IESF_ENABLED IESF_ARMOR IESF_INCREMENTAL 0 5 C5 'invisibility' 3750 +209 Armor Silent Moves IESF_ENABLED IESF_ARMOR IESF_INCREMENTAL 0 5 C5 'silence' 3750 210 Armor Spell Resistance IESF_ENABLED IESF_ARMOR IESF_INCREMENTAL 2 13 C15 'spell resistance' 211 Armor Spell Resistance IESF_ENABLED IESF_ARMOR IESF_INCREMENTAL 3 15 C15 'spell resistance' 210 212 Armor Spell Resistance IESF_ENABLED IESF_ARMOR IESF_INCREMENTAL 4 17 C15 'spell resistance' 211 @@ -78,6 +78,11 @@ 242 Armor Blurring IESF_ARMOR IESF_NONCORE 1 0 C5 'blur' 243 Armor Displacement IESF_ARMOR IESF_NONCORE 1 0 C5 'displacement' 244 Armor Mobility IESF_ENABLED IESF_ARMOR IESF_NONCORE IESF_LIGHT_ONLY 1 0 C5 'cats grace' +245 Armor Commander IESF_ARMOR IESF_NONCORE 0 0 C5 'eagles splendor' 2000 +246 Armor Shadow IESF_ENABLED IESF_ARMOR IESF_INCREMENTAL 0 10 C10 'invisibility' 208 15000 +247 Armor Shadow IESF_ENABLED IESF_ARMOR IESF_INCREMENTAL 0 15 C15 'invisibility' 246 33750 +248 Armor Silent Moves IESF_ENABLED IESF_ARMOR IESF_INCREMENTAL 0 10 C10 'silence' 209 15000 +249 Armor Silent Moves IESF_ENABLED IESF_ARMOR IESF_INCREMENTAL 0 15 C15 'silence' 248 33750 400 Shield Enhancement Bonus IESF_ENABLED IESF_SHIELD IESF_PLUS_BONUS 1 1 C3 401 Shield Enhancement Bonus IESF_ENABLED IESF_SHIELD IESF_PLUS_BONUS 1 2 C6 400 402 Shield Enhancement Bonus IESF_ENABLED IESF_SHIELD IESF_PLUS_BONUS 1 3 C9 401