Salk

[KotOR] Store buying prices

Recommended Posts

Well, using further hacking (in a very similar manner), I managed to have Fazza only buy from the player wraid plates and dragon pearls (those are the two items he is interested in considering the dialogue options). In the process I also corrected a bug inside four scripts not correctly counting the stack of wraid plates and dragon pearls in possession of the player.

One thing I also discovered is that the ChangeItemCost() function will modify the value of every item that belongs to a certain class (but I need to investigate further).

Both the dragon pearl and the wraid plate are Plot_Useable_Items and so, for instance, this:

   if ((GetTag(oInvItem) == "tat18_dragonprl")) {
      ChangeItemCost(GetTag(oInvItem), 3.0);
    } 

will also increase the value of the wraid plate (and apparently every item in the same category) as well.

  • Like 1

Share this post


Link to post
Share on other sites
19 hours ago, Salk said:

Well, using further hacking (in a very similar manner), I managed to have Fazza only buy from the player wraid plates and dragon pearls (those are the two items he is interested in considering the dialogue options).

How did you manage that? UTM files have an option to only buy or only sell (and I don't even know if those work) but I don't see any way to restrict the buying to specific items. I suppose it would be possible if you temporarily removed all other items from the player's inventory, but I don't know how well that would work in practice.

 

19 hours ago, Salk said:

One thing I also discovered is that the ChangeItemCost() function will modify the value of every item that belongs to a certain class

Interesting. The function may be limited to affecting base item types rather than specific items. Most quest items are plot usable items, but you also can't sell a lot of them, so it might not be a problem. And of course affecting every crystal was the intent before anyway.

  • Like 1

Share this post


Link to post
Share on other sites

Hello, JC!

42 minutes ago, JCarter426 said:

How did you manage that? UTM files have an option to only buy or only sell (and I don't even know if those work) but I don't see any way to restrict the buying to specific items. I suppose it would be possible if you temporarily removed all other items from the player's inventory, but I don't know how well that would work in practice.

I managed with this which has been included in k_ptat_fazzastor.ncs, which triggers when the Player chooses the dialogue option(s) about selling dragon pearl(s):

        if (((!GetPlotFlag(oInvItem)) && (GetTag(oInvItem) != "tat18_dragonprl"))) {
            SetPlotFlag(oInvItem, 1);
            DelayCommand(1.0, SetPlotFlag(oInvItem, 0));
        }

and this one is for the dialogue option(s) about selling wraid plates and have been included in a duplicate script k_ptat_fazzasto2.ncs:

        if (((!GetPlotFlag(oInvItem)) && (GetTag(oInvItem) != "tat17_wraidplate"))) {
            SetPlotFlag(oInvItem, 1);
            DelayCommand(1.0, SetPlotFlag(oInvItem, 0));
        }

The first one will only show the dragon pearl(s) and the second only the wraid plate(s).

The Plot Flag is removed from the affected inventory items upon leaving the store, just the same way the original value for the items whose price we wanted to raise. It's hackwork but that's all I could think of.

Cheers!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.