Skip to content

I would like someone to make me a script for a conversation

It's for a quest. I want the script to take ALL of the particular items and pay the PC for each one. The item is VENOM_SAMPLE_001. The amount of gold for each item is 75gp. The quest is available all the time once you accept it.

I tried Lilac Soul's Script Generator - I got the script to take ALL of the items but they only made a payment of 75gp for one of the items. Here is what I have:

//Put this on action taken in the conversation editor
#include "nw_i0_tool"
void main()
{

object oPC = GetPCSpeaker();

object oItem;
oItem = GetFirstItemInInventory(oPC);

while (GetIsObjectValid(oItem))
{
if (GetTag(oItem)=="VENOM_SAMPLE_001") DestroyObject(oItem);

oItem = GetNextItemInInventory(oPC);
}

RewardPartyGP(75, oPC, TRUE);

}

Comments

  • DazDaz Member Posts: 125
    This should work:
    //Put this on action taken in the conversation editor
    #include "nw_i0_tool"
    void main()
    {
        object oPC = GetPCSpeaker();
    
        object oItem = GetFirstItemInInventory(oPC);
    
        while (GetIsObjectValid(oItem))
        {
            if (GetTag(oItem) == "VENOM_SAMPLE_001")
            {
                DestroyObject(oItem);
    
                RewardPartyGP(75, oPC, TRUE);
            }
            oItem = GetNextItemInInventory(oPC);
        }
    }
    

    You had "RewardPartyGP(75, oPC, TRUE);" outside of the loop, so it only rewarded the 75gp once it was done destroying all the items
  • Ugly_DuckUgly_Duck Member Posts: 182
    That worked Great! Thanks for the help!
Sign In or Register to comment.