Jump to content

Home

Script question


Salk

Recommended Posts

Hello!

 

I would like to create a conditional script to check if the krayt dragon pearl (tat18_dragonprl) is either in the inventory or assembled into a lightsaber.

 

I got the first part working with this:

 

int StartingConditional() {

return GetIsObjectValid(GetItemPossessedBy(GetFirstPC(), "tat18_dragonprl"));

}

 

but how do I fix the second half of my problem? The INVENTORY_SLOT does not seem to be of any help because it's not that the pearl is considered an equipped item.

 

Perhaps doing what I want is not possible at all?

Link to comment
Share on other sites

This is an indirect way of doing it but if I remember correctly you can only get the Dragon Pearl once you have completed the quest for it. I forget the name of the quest but you can look it up in the .jrl file and decipher which one you need. This script checks to see if a particular Journal entry is active.

 

int StartingConditional() {

return (GetJournalEntry("name of journal entry reference") == 1);

}

 

The 1 is which entry you are checking for.

Link to comment
Share on other sites

Thank you for your help, harIII but that solution won't work.

 

You see, I want to set a dialogue condition to make sure that the pearl has not been sold so just checking for the journal entry won't suffice.

 

Thanks anyway for the suggestion though!

Link to comment
Share on other sites

It should still return as true if the pearl is in your lightsaber. I'd probably check for it being owned by the player with GetItemPossessor, rather than GetItemPossessedBy, like this:

 

int StartingConditional()
{

  object oPC = GetFirstPC();
  object oPearl = GetObjectByTag("tat18_dragonprl");

     if( (GetItemPossessor(oPearl)) == (oPC) )
     {

        return TRUE;

     }


     else return FALSE; 


}

Link to comment
Share on other sites

  • 2 weeks later...

Archived

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

×
×
  • Create New...