mw bonus appears to not apply
-
Area name:
Issue Location:
Quest Name:
Store Name:
NPC Name:
NPC Location:
Server Version:
Screen Shot:
Time: https://www.timeanddate.com/Issue Description:
when i cast mw on my gloves there is a temp bonus to the item and it is reflected in the character sheet.
however when looking at the combat log the bonus is not applied.
-
Here's the code. Someone help me find why it doesnt work as intended.
void AddEnhancementEffectToWeapon(object oMyWeapon, float fDuration) { IPSafeAddItemProperty(oMyWeapon, ItemPropertyEnhancementBonus(1), fDuration, X2_IP_ADDPROP_POLICY_KEEP_EXISTING, TRUE, TRUE); return; } void main() { /* Spellcast Hook Code Added 2003-07-07 by Georg Zoeller If you want to make changes to all spells, check x2_inc_spellhook.nss to find out more */ if (!X2PreSpellCastCode()) { // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell return; } // End of Spell Cast Hook //Declare major variables effect eVis = EffectVisualEffect(VFX_IMP_SUPER_HEROISM); effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE); int nDuration = GetAdjustedCasterLevel(OBJECT_SELF); int nMetaMagic = GetMetaMagicFeat(); object oTarget = GetSpellTargetObject(); object oMyWeapon; switch (GetObjectType(oTarget)) { case OBJECT_TYPE_ITEM: oMyWeapon = oTarget; break; case OBJECT_TYPE_CREATURE: oMyWeapon = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oTarget); if (!GetIsObjectValid(oMyWeapon)) { oMyWeapon = GetItemInSlot(INVENTORY_SLOT_ARMS, oTarget); } break; default: SendMessageToPC(OBJECT_SELF, "You must cast this spell at a creature or an item." ); return; break; } if (nMetaMagic == METAMAGIC_EXTEND) { nDuration = nDuration * 2; //Duration is +100% } if(GetIsObjectValid(oMyWeapon) ) { SignalEvent(GetItemPossessor(oMyWeapon), EventSpellCastAt(OBJECT_SELF, GetSpellId(), FALSE)); if (nDuration > 0) { ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, GetItemPossessor(oMyWeapon)); ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, GetItemPossessor(oMyWeapon), HoursToSeconds(nDuration)); AddEnhancementEffectToWeapon(oMyWeapon, HoursToSeconds(nDuration)); } return; } else { FloatingTextStrRefOnCreature(83615, OBJECT_SELF); return; } }
-
Tested in game.
Looks to be working just fine
-
@zool the issue was that i has in this example +11 ab before the mw was cast so the only benefit was that it was enchantment to pass dr and the +1 dam, rather than giving the +1 ab as well
-
@cadiz Sure, but I just tested it, and that character had +10 AB, before the spell was cast, and +11 afterwards, with +1 damage and DR piercing.
They had +1 enchancement, as it says, and it all worked fine.
So, at the least, I can't reproduce this bug. At most, it doesn't exist.
-