The Black Wyrm Lair Forums
The Black Wyrm's Lair Terms of Use Help Search Members Calendar

Welcome Guest ( Log In | Register )

> Remove all equipment on death
aigleborgne
post Jul 11 2006, 05:39 PM
Post #1



Group Icon

Mod Developer
Posts: 210
Joined: 3-December 05




Hello smile.gif

I want to remove all equipment from my creature when it dies.
There are 2 solutions:
- Set all items to undropable
- Use a script

The last one doesn't work :

IF
Die()
THEN
RESPONSE #100
DestroyAllEquipment()
ReallyForceSpellDead(Myself,RED_HOLY_MIGHT)
END

Any idea?
Go to the top of the page
 
Quote Post
 
Start new topic
Replies
CamDawg
post Jul 12 2006, 11:27 AM
Post #2





Forum Member
Posts: 59
Joined: 22-July 04




The creature will drop all of its equipment on death, so the script won't fire until after it's already dropped everything. Undroppable flags are pretty easy; below are examples to flag a single item or all items on a creature.

CODE
// for a specific item, replace itemname with resref
COPY_EXISTING foo.cre~ ~override~
 READ_LONG  0x2bc "itm_off" ELSE 0
 READ_LONG  0x2c0 "itm_num" ELSE 0
 FOR (index = 0; index < item_num; index = index + 1) BEGIN
   READ_ASCII ("%itm_off%" + (0x14 * "%index%")) "item"
   PATCH_IF ("%item%" STRING_COMPARE_CASE "itemname" = 0) BEGIN
     READ_BYTE   ("%itm_off%" + 0x10 + (0x14 * "%index%")) "flags"
     WRITE_BYTE  ("%itm_off%" + 0x10 + (0x14 * "%index%")) ("%flags%" BOR   0b00001000) // adds undroppable flag
   END
 END
 BUT_ONLY_IF_IT_CHANGES

// for all items
COPY_EXISTING foo.cre~ ~override~
 READ_LONG  0x2bc "itm_off" ELSE 0
 READ_LONG  0x2c0 "itm_num" ELSE 0
 FOR (index = 0; index < item_num; index = index + 1) BEGIN
   READ_BYTE   ("%itm_off%" + 0x10 + (0x14 * "%index%")) "flags"
   WRITE_BYTE  ("%itm_off%" + 0x10 + (0x14 * "%index%")) ("%flags%" BOR   0b00001000) // adds undroppable flag
 END
 BUT_ONLY_IF_IT_CHANGES


This post has been edited by CamDawg: Jul 12 2006, 11:28 AM


--------------------
The Gibberlings Three - Home of IE Mods

The BG2 Fixpack - All the fixes of Baldurdash, plus a few hundred more. Now available, with more fixes being added in every release.
Go to the top of the page
 
Quote Post

Posts in this topic


Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:



- Lo-Fi Version Time is now: 13th May 2026 - 03:11 AM