Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Dark Dreams of Furiae - a new module for NWN:EE! Buy now
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

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: 67
    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

    Sherincall
  • Ugly_DuckUgly_Duck Member Posts: 95
    That worked Great! Thanks for the help!

Sign In or Register to comment.