forked from Jaysyn/PRC8
2025/11/27 Update
Werewolf merges monk gloves if equipped. Added more switches to the Switch conversation. Increased summoned Huge Beholder eye ray uses to 99.
This commit is contained in:
@@ -1612,31 +1612,140 @@ int IPGetDamageBonusConstantFromNumber(int nNumber)
|
||||
// oOld - Item equipped before polymorphing (source for item props)
|
||||
// oNew - Item equipped after polymorphing (target for item props)
|
||||
// bWeapon - Must be set TRUE when oOld is a weapon.
|
||||
// ----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
void IPWildShapeCopyItemProperties(object oOld, object oNew, int bWeapon = FALSE)
|
||||
{
|
||||
if (GetIsObjectValid(oOld) && GetIsObjectValid(oNew))
|
||||
{
|
||||
itemproperty ip = GetFirstItemProperty(oOld);
|
||||
while (GetIsItemPropertyValid(ip))
|
||||
{
|
||||
if (bWeapon)
|
||||
{
|
||||
if (GetWeaponRanged(oOld) == GetWeaponRanged(oNew) )
|
||||
{
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,ip,oNew);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,ip,oNew);
|
||||
}
|
||||
ip = GetNextItemProperty(oOld);
|
||||
// Invalid source/target
|
||||
if (!GetIsObjectValid(oOld) || !GetIsObjectValid(oNew))
|
||||
return;
|
||||
|
||||
// Determine possessor
|
||||
object oPC = GetItemPossessor(oOld);
|
||||
if (!GetIsObjectValid(oPC))
|
||||
oPC = GetItemPossessor(oNew);
|
||||
|
||||
}
|
||||
}
|
||||
if (!GetIsObjectValid(oPC))
|
||||
{
|
||||
if (DEBUG) DoDebug("IPWS: Unable to determine item possessor");
|
||||
return;
|
||||
}
|
||||
|
||||
// Determine glove state once
|
||||
int bMonkGloves = GetLocalInt(oPC, "WEARING_MONK_GLOVES");
|
||||
|
||||
// Weapon ranged mismatch = do nothing (intent is no partial copy)
|
||||
if (bWeapon && GetWeaponRanged(oOld) != GetWeaponRanged(oNew))
|
||||
{
|
||||
if (DEBUG) DoDebug("IPWS: Weapon ranged mismatch <20> skipping all IP copy");
|
||||
return;
|
||||
}
|
||||
|
||||
// Begin property copy
|
||||
itemproperty ip = GetFirstItemProperty(oOld);
|
||||
while (GetIsItemPropertyValid(ip))
|
||||
{
|
||||
int nType = GetItemPropertyType(ip);
|
||||
|
||||
// If copying from gloves and monk gloves are active
|
||||
if (bMonkGloves
|
||||
&& (nType == ITEM_PROPERTY_DAMAGE_BONUS
|
||||
|| nType == ITEM_PROPERTY_DAMAGE_BONUS_VS_RACIAL_GROUP
|
||||
|| nType == ITEM_PROPERTY_DAMAGE_BONUS_VS_ALIGNMENT_GROUP))
|
||||
{
|
||||
// Always apply glove damage IPs
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ip, oNew);
|
||||
ip = GetNextItemProperty(oOld);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Normal weapon pass
|
||||
if (bWeapon)
|
||||
{
|
||||
// If monk gloves active ? skip ALL weapon damage IPs
|
||||
if (bMonkGloves
|
||||
&& (nType == ITEM_PROPERTY_DAMAGE_BONUS
|
||||
|| nType == ITEM_PROPERTY_DAMAGE_BONUS_VS_RACIAL_GROUP
|
||||
|| nType == ITEM_PROPERTY_DAMAGE_BONUS_VS_ALIGNMENT_GROUP))
|
||||
{
|
||||
ip = GetNextItemProperty(oOld);
|
||||
continue;
|
||||
}
|
||||
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ip, oNew);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ip, oNew);
|
||||
}
|
||||
|
||||
ip = GetNextItemProperty(oOld);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* // ----------------------------------------------------------------------------
|
||||
// GZ, Sept. 30 2003
|
||||
// Special Version of Copy Item Properties for use with greater wild shape
|
||||
// oOld - Item equipped before polymorphing (source for item props)
|
||||
// oNew - Item equipped after polymorphing (target for item props)
|
||||
// bWeapon - Must be set TRUE when oOld is a weapon.
|
||||
// ----------------------------------------------------------------------------
|
||||
void IPWildShapeCopyItemProperties(object oOld, object oNew, int bWeapon = FALSE)
|
||||
{
|
||||
if (!GetIsObjectValid(oOld) || !GetIsObjectValid(oNew))
|
||||
return;
|
||||
|
||||
object oPC = GetItemPossessor(oOld);
|
||||
if (!GetIsObjectValid(oPC))
|
||||
{
|
||||
oPC = GetItemPossessor(oNew);
|
||||
}
|
||||
if (!GetIsObjectValid(oPC))
|
||||
{
|
||||
if (DEBUG) DoDebug("IPWS: Unable to determine item possessor");
|
||||
return;
|
||||
}
|
||||
|
||||
int bMonkGloves = GetLocalInt(oPC, "WEARING_MONK_GLOVES");
|
||||
|
||||
itemproperty ip = GetFirstItemProperty(oOld);
|
||||
while (GetIsItemPropertyValid(ip))
|
||||
{
|
||||
if (bWeapon)
|
||||
{
|
||||
// Gloves override weapon damage <20> skip weapon damage properties
|
||||
if (bMonkGloves)
|
||||
{
|
||||
int nType = GetItemPropertyType(ip);
|
||||
|
||||
// skip damage props
|
||||
if (nType == ITEM_PROPERTY_DAMAGE_BONUS
|
||||
|| nType == ITEM_PROPERTY_DAMAGE_BONUS_VS_RACIAL_GROUP
|
||||
|| nType == ITEM_PROPERTY_DAMAGE_BONUS_VS_ALIGNMENT_GROUP)
|
||||
{
|
||||
if (DEBUG) DoDebug("IPWS: SKIPPED weapon damage IP");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (DEBUG) DoDebug("IPWS: Applied non-damage weapon IP");
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ip, oNew);
|
||||
}
|
||||
|
||||
}
|
||||
else if (GetWeaponRanged(oOld) == GetWeaponRanged(oNew) )
|
||||
{
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,ip,oNew);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,ip,oNew);
|
||||
}
|
||||
|
||||
ip = GetNextItemProperty(oOld);
|
||||
}
|
||||
} */
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Returns the current enhancement bonus of a weapon (+1 to +20), 0 if there is
|
||||
// no enhancement bonus. You can test for a specific type of enhancement bonus
|
||||
@@ -2018,4 +2127,6 @@ int IPOnHitSaveDC(int nSaveDC)
|
||||
if (nSaveDC > 26) nIPBonus = IP_CONST_ONHIT_SAVEDC_26;
|
||||
|
||||
return nIPBonus;
|
||||
} */
|
||||
} */
|
||||
|
||||
//:: void main(){}
|
||||
Reference in New Issue
Block a user