Jump to content

Setting #charges


Demivrgvs

Recommended Posts

I've changed some in game items from X charges to once a day...problem is that when i find the item it has X charges even if it correctly recharge one charge after resting. And if i add a new ability with charges when the item is found the new ability has no charges before resting. What have i to do to set the #charges so that they're diplayed correctly before resting? :)

Link to comment

Is it possible to make something like this...

 

COPY_EXISTING ~ribald.sto~ ~override/ribald.sto~

ADD_STORE_ITEM ~myitem~ #20 #0 #0 #1 #5

 

...but referring to items that may lay in containers? What i need is something like:

 

COPY ~Item_rev\itm\AMUL15.ITM~ ~override\AMUL15.ITM~ #20 #0 #0

 

Just to edit the #charges the item will have when you find it.

Link to comment

There isn't a top level WeiDU command for this. Something like the following:

 

COPY_EXISTING ~AREANAME.are~ ~override~ // pick the correct area :)
 PATCH_IF (SOURCE_SIZE > 0x11b) THEN BEGIN
READ_LONG  0x78 "io" // offset to list of items
FOR (READ_SHORT 0x76 "ic"; "ic" > 0x00; "ic" -= 0x01) BEGIN
  READ_ASCII ("io" + ("ic" * 0x14) - 0x14) ~in~ // item name
  PATCH_IF (~%in%~ STRING_EQUAL_CASE ~NAMEOFTHEITEMTOMODIFY~) THEN BEGIN
	WRITE_SHORT ("io" + ("ic" * 0x14) - 0x0a) 0x00 // charges first header
	WRITE_SHORT ("io" + ("ic" * 0x14) - 0x08) 0x00 // charges second header
	WRITE_SHORT ("io" + ("ic" * 0x14) - 0x06) 0x00 // charges third header
	SET "ic" = 0x00
  END
END
 END
BUT_ONLY

 

where you pick the area name, the item to modify, and some non-zero number of charges :)

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...