Author Topic: Globalized "SetDisarmable" flag OnSpawn  (Read 342 times)

Legacy_SKIPPNUTTZ

  • Full Member
  • ***
  • Posts: 148
  • Karma: +0/-0
Globalized "SetDisarmable" flag OnSpawn
« on: May 10, 2012, 09:40:42 pm »


               Possible?

Basically I need a method to set the disarmable flag to true on every monster in the module. Default AI will automatically equip most effective weapon iirc.

-----

Also looking for a way to send PC weapons to inventory ondisarm. Possible?

server: nwnx2 / Windows
               
               

               


                     Modifié par SKIPPNUTTZ, 10 mai 2012 - 08:42 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Globalized "SetDisarmable" flag OnSpawn
« Reply #1 on: May 12, 2012, 05:12:25 am »


               

SKIPPNUTTZ wrote...

Possible?

Basically I need a method to set the disarmable flag to true on every monster in the module. Default AI will automatically equip most effective weapon iirc.


I do not think you can set the disarmable flag via NWN script.  I also do not see why you would want to.   Setting the creature non disarmable in the toolset should be reserved to things that simply do not use normal weapons.  You would not want to be able to disarm birds beak or a dragons claw after all.    

So assuming that you have not set creatures as disarmable in the tool set that use normal weapons, The standard way to make the weapon non disarmable in the toolset wouldbe to set the droppable flag on the item. Ingame the droppable flag on the item translates to the cursed flag.   So you could simply set the cursed flag to FALSE in the module's OnAquire script.  

   

Also looking for a way to send PC weapons to inventory ondisarm. Possible?

Ghost answered that in the thread.
Reply 1: Disarm weapon script? 
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Globalized "SetDisarmable" flag OnSpawn
« Reply #2 on: May 12, 2012, 10:11:13 am »


               

SKIPPNUTTZ wrote...

Possible?

Basically I need a method to set the disarmable flag to true on every monster in the module. Default AI will automatically equip most effective weapon iirc.

-----

Also looking for a way to send PC weapons to inventory ondisarm. Possible?

server: nwnx2 / Windows

this can be done via moneo/letoscript, see the sticky thread how to datamine your module
               
               

               
            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0
Globalized "SetDisarmable" flag OnSpawn
« Reply #3 on: May 14, 2012, 01:59:23 pm »


               

Also looking for a way to send PC weapons to inventory ondisarm. Possible?

server: nwnx2 / Windows


In the Module Event (OnUnacquire Item) you would basically check to see if the item was a weapon (ranged or melee) that was Unacquired & if it was a PC that dropped it, also check to see if the PC is in combat, and if so, return it to the owner by copying the object onto the PC and destroying the original dropped (be sure to copy variables over)...

I use this to prevent duping as well, by destroying all objects dropped if it's not a weapon and for weapons, if in combat, if the PC drops it, the original is destroyed and the copy is put in the player's inventory.  Of course I give the PC gold for lost items, sometimes they do it by accident, so the lost is at least somewhat returned to them..

However, many PCs may complain, so you could simply just copy what is dropped & put it back into the PC's inventory (Destroying the original), and then, if the copy is dropped, you could warn the PC that their inventory is full...  You will need to set a variable on the copy & ensure that when it's dropped you check that variable, and set the script to tell the PC that their inventory is full. (Obviously you will need to remove the variable after a short delay to ensure the message doesn't fire off falsely later when the PC drops it say (2 minutes later))  When you check the variable on the copy, you wouldn't want to destroy it or copy it back into the PC's inventory, or you would enter this infinite loop, probably locking down the server / game / module..

I noticed quite a few servers have some wild infinite loops running around, they don't realize it because the DMs or Server Admins are never on.. '<img'>
               
               

               


                     Modifié par _Guile, 15 mai 2012 - 05:26 .