Skip to content

Replacing an inventory item via dialog

GreenerGreener Member Posts: 430
I've run into a problem, currently an NPC has a sword that is restricted to them, upon their death I'd like anyone to be able to use the item

Thus I was attempting to create an exact copy without the restrict item (319) effect

I'm trying to implement it via dialog (seen below) with the TakePartyItem("OAGinawa") DestroyItem("OAGinawa") GiveItemCreate("OAKatana",OAGinaw,1,0,0) but it doesn't seem to work, can anyone offer a fix?

IF ~~ THEN
BEGIN Enemy
SAY ~A foolish choice, you will most certainly pay with your life……KIE!~
IF ~~ THEN DO ~Enemy() TakePartyItem("OAGinawa") DestroyItem("OAGinawa") GiveItemCreate("OAKatana",OAGinaw,1,0,0)~
EXIT
END

Comments

  • ErgErg Member Posts: 1,756
    Assuming that OAGinaw is the Death Variable of the NPC that has to receive the new item, try adding quotes, i.e.

    GiveItemCreate("OAKatana","OAGinaw",1,0,0)
  • GreenerGreener Member Posts: 430
    @Erg Thank you, that sort of worked

    It creates said item, but places it in the creatures inventory, is there a way to equip the newly created item?

    I tried:

    IF ~~ THEN DO ~Enemy() TakePartyItem("OAGinawa") DestroyItem("OAGinawa") GiveItemCreate("OAKatana","OAGinaw",1,0,0, IDENTIFIED, WEAPON1, EQUIP)~

    but the yields the following error

    [action list near line 39, column 145 of Ginawa/Dialogue/OAGinawJ.d] PARSE WARNING at line 39 column 1-128
    Near Text: )
    Too many arguments to [GiveItemCreate]. Recovering.
  • GreenerGreener Member Posts: 430
    I see to have found a work around...

    I've made the original item with the restrict item (319) code and made is undroppable

    Now this creates the new version of the sword without the restrict item effect (319)
    IF ~~ THEN DO ~GiveItemCreate("OAKatana","OAGinaw",1,0,0,)

    And upon killing the NPC the created item is what is dropped
Sign In or Register to comment.