• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
City of Arabel
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

mw bonus appears to not apply

Scheduled Pinned Locked Moved Closed Bugs
5 Posts 3 Posters 205 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C
    Cadiz
    last edited by 23 Sept 2021, 17:03

    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.

    Zool's rule - don't be a dick.

    E 1 Reply Last reply 10 Oct 2021, 18:54 Reply Quote
    • E
      Echo @Cadiz
      last edited by 10 Oct 2021, 18:54

      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;
          }
      }
      

      "You can complain if you weren't asked; you can't complain if you were asked but didn't contribute." ~ Professor.

      1 Reply Last reply Reply Quote
      • Z
        Zool
        last edited by Zool 23 Jan 2022, 20:12

        Tested in game.

        70d552fd-a953-4908-9760-39048c8ba260-image.png

        Looks to be working just fine

        > !!!MOLES for the MOLE GOD!!!

        C 1 Reply Last reply 23 Jan 2022, 21:53 Reply Quote
        • C
          Cadiz @Zool
          last edited by 23 Jan 2022, 21:53

          @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

          Zool's rule - don't be a dick.

          Z 1 Reply Last reply 23 Jan 2022, 22:43 Reply Quote
          • Z
            Zool @Cadiz
            last edited by 23 Jan 2022, 22:43

            @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.

            > !!!MOLES for the MOLE GOD!!!

            1 Reply Last reply Reply Quote
            • Z Zool moved this topic from Bug Reports on 24 Jan 2022, 22:30
            • 1 / 1
            1 / 1
            • First post
              4/5
              Last post