Author Topic: Immunity to disarm?  (Read 432 times)

Legacy_Buddywarrior

  • Hero Member
  • *****
  • Posts: 512
  • Karma: +0/-0
Immunity to disarm?
« on: May 26, 2013, 03:49:29 am »


               We're using Scarface's Socketed System and we're wondering if it's possible to create an immunity to disarm gem. Maybe one of you know a function I can use, or an elligant way to pull this off?
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Immunity to disarm?
« Reply #1 on: May 26, 2013, 10:08:47 pm »


               I haven't tested this, but the cursed flag should prevent disarm.  Just set the cursed flag on the item when equipped and unset it when unequipped.
               
               

               
            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0
Immunity to disarm?
« Reply #2 on: May 27, 2013, 03:31:27 am »


               WhiZard, are we talking 100% immune to disarm or it just makes you unequip it?
               
               

               
            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
Immunity to disarm?
« Reply #3 on: May 27, 2013, 05:25:45 pm »


               He is saying onequip set it as cursed so that it can't be unequipped, normally.  Howsoever, by removing the cursed flag on unequip, would that not be tantamount to allowing the weapon to be disarmed? In essence since disarming the weapon would cause unequip to fire, or would it not?
Another question that arises is that does unequip actually fire when you have a cursed item equipped and you try to un-equip it?  Because isn't that what cursed does: prevent you from un-equipping.  If this were the actual case removing the cursed status on unequip would be irrelevant.
You could do it through a conversation though that would be tedious.  An  interesting sideline would be to have a cursed sword that could still be unequipped by specific class, or stat, or other condition using the conversation element.
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Immunity to disarm?
« Reply #4 on: May 27, 2013, 05:34:47 pm »


               

ffbj wrote...

He is saying onequip set it as cursed so that it can't be unequipped, normally.  Howsoever, by removing the cursed flag on unequip, would that not be tantamount to allowing the weapon to be disarmed? In essence since disarming the weapon would cause unequip to fire, or would it not?
Another question that arises is that does unequip actually fire when you have a cursed item equipped and you try to un-equip it?  Because isn't that what cursed does: prevent you from un-equipping.  If this were the actual case removing the cursed status on unequip would be irrelevant.
You could do it through a conversation though that would be tedious.  An  interesting sideline would be to have a cursed sword that could still be unequipped by specific class, or stat, or other condition using the conversation element.


The item will not unequip on a disarm when the cursed flag is set.  Removing the flag is done so you can sell it or drop it.  But every time you equip it, the flag is set so that it will not unequip or drop when a disarm is attempted (the feedback for this is a "failed" disarm attempt).

The cursed flag does not prevent normal unequipping.  It prevents any loss from an inventory even if you are transfering from one inventory to another.  So when the player unequps the item, he is free to drop and sell it, but when he equips it, it cannot be sold, dropped, disarmed, etc.
               
               

               
            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0
Immunity to disarm?
« Reply #5 on: May 28, 2013, 12:39:45 am »


               you could use nwnx_cool and just Supress the feat use...
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Immunity to disarm?
« Reply #6 on: May 28, 2013, 07:36:33 pm »


               He is looking at a means of "socketing" a disarm immune property on an item, typically this applies to weapons.  A global disabling of the feat does not seem to be what the OP has in mind.  The equip and unequip player events are already there, so I don't see how the plugin would be more efficient through rescripting the feat usage.
               
               

               
            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
Immunity to disarm?
« Reply #7 on: May 29, 2013, 10:36:48 pm »


               So the cursed flag means a weapon can't be disarmed?  This seems more like a benefit than a curse.
Additionally if all you have to do is unequip a cursed item and then sell it, it seems sort of pointless.  I never really looked at cursed items and how they work.
               
               

               
            

Legacy_ShadowM

  • Hero Member
  • *****
  • Posts: 1373
  • Karma: +0/-0
Immunity to disarm?
« Reply #8 on: May 29, 2013, 11:08:56 pm »


               You getting cursed items and cursed flag mixed up. In NWN the cursed flag block transfer to other inventories and out of inventories and cannot be sold I think also. WhiZard is using that to block the disarming with a script. There are other scripting systems that check for the cursed flag(I use a variable) and block it from being unequipped until removed curse spells or other means are casted/met to remove the curse (this is more PNP). In WhiZard version he removing the cursed flag on unequipped because he just using for blocking disarm (great simple solution too WhiZard, thanks for posting it). Which could be scripted in multiple ways like additional property(like No Disarming) that check on equip to add cursed flag and un equip removed the cursed property.
               
               

               
            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0
Immunity to disarm?
« Reply #9 on: May 30, 2013, 03:29:14 pm »


               

WhiZard wrote...

He is looking at a means of "socketing" a disarm immune property on an item, typically this applies to weapons.  A global disabling of the feat does not seem to be what the OP has in mind.  The equip and unequip player events are already there, so I don't see how the plugin would be more efficient through rescripting the feat usage.


Basically you would code a feat use check in nwnx_cool, for disarm, when a monster disarms, check for a local integer on the PC (for optimization apply it when the PC uses the socket), then when the monster uses the feat, it will be supressed, because the PC is immune to disarm...

However, making the item read "Immunity To Disarm", now that would be another subject entirely different...

It's far easier to set an integer on the PC and just use the gem on the PC instead of "an item", to give the PC immunity to disarm...   I'd just send them a message, "You are now permanently immune to disarm", but that's the way I roll things...  (I'm shying away from item properties and moving towards permanent abilities/special abilities/powers on PCs, that way the PC cannot transfer the item.)

To me it kind of takes away module re-play value when you can xfer all of your gear to a new toon...
               
               

               


                     Modifié par _Guile, 30 mai 2013 - 02:31 .
                     
                  


            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Immunity to disarm?
« Reply #10 on: May 30, 2013, 03:49:59 pm »


               

_Guile wrote...
However, making the item read "Immunity To Disarm", now that would be another subject entirely different...


But that is exactly what the OP requested.  It is far more efficient to make use of the already hard-coded check for the curse flag (which causes the return of "failed")  than to rescript the disarm usage, as I had said before.  I understand that you prefer innate immunties for players, but what the OP asked for isn't that hard to accomodate.

ShadowM is right on with describing what I suggested.  Add a property on the item, an addition to the item description, or a variable (if you have fixed the dye and craft weapon copying scripts so they will copy variables) and set the curse flag if the weapon is already equipped.  Then for the equip and unequip events script the adding and removing of the curse flag if the disarm-immune indicator is detected, and the majority of the script overhead is on events that take place outside of combat.
               
               

               


                     Modifié par WhiZard, 30 mai 2013 - 02:53 .
                     
                  


            

Legacy_Buddywarrior

  • Hero Member
  • *****
  • Posts: 512
  • Karma: +0/-0
Immunity to disarm?
« Reply #11 on: May 30, 2013, 05:49:07 pm »


               Thanks for the discussion guys. I used the curse flag as WhiZard suggested and it looks like it should be working fine. I don't have a description on the weapon itself, but other than that all looks to be working just fine.

As far as 'role play', the idea of using a weapon chain, tie or arm replacement (ala the bad guy from Bruce Lee's Enter the Dragon. It sounded like a reasonable request, so I'm obliging.

Thanks again!
               
               

               
            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0
Immunity to disarm?
« Reply #12 on: May 30, 2013, 10:00:04 pm »


               

Buddywarrior wrote...

Thanks for the discussion guys. I used the curse flag as WhiZard suggested and it looks like it should be working fine. I don't have a description on the weapon itself, but other than that all looks to be working just fine.

As far as 'role play', the idea of using a weapon chain, tie or arm replacement (ala the bad guy from Bruce Lee's Enter the Dragon. It sounded like a reasonable request, so I'm obliging. 

Thanks again!


Cool...

I'd highly suggest you check out nwnx_cool , it's definitely worth your time mate, the customization that is possible with that nwnx2 plugin is really powerful!  (as in your ability to modify a lot of the core game "events" / feats / skills)
               
               

               


                     Modifié par _Guile, 04 juin 2013 - 06:21 .
                     
                  


            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
Immunity to disarm?
« Reply #13 on: June 05, 2013, 05:59:07 pm »


               Thanks for that clarification ShadowM, an interesting discussion.  I would tend to think it would be preferable to have the individual weapon immune to disarm, which has some basis in fantasy literature, that is, the property is intrinsic to that particular weapon only.  Of course if you wanted to make the PC entirely immune to disarm you could do as Guile suggests, though, as pointed out that was not the op asked for. So cursed flag != cursed item necessarily.
I think my confuson resulted from thinking in terms of curses being bad but in this case the cursed flag acutually results in a benefit.  Snared by tautology.
               
               

               


                     Modifié par ffbj, 05 juin 2013 - 05:02 .
                     
                  


            

Legacy_Buddywarrior

  • Hero Member
  • *****
  • Posts: 512
  • Karma: +0/-0
Immunity to disarm?
« Reply #14 on: June 05, 2013, 10:26:32 pm »


               ashamed to say that I've never tried nwnx.