[Edit: thats what I get for being long winded... Kato beat me to it]
The function you need is
CreateItemOnObjectYou should check out the lexicon for other functions as well:
http://palmergames.c...xicon_1_69.html
That function will go in a script you create which is executed by the "Yes" conversation option. And it will go in the "Main" of that script.
Since you also want a chance of this object showing up there are a number of ways to do this. The most straight forward is to wrap an if statement around the CreateItemOnObject function
Example (pseudo code)
void main()
{
object oPC = GetPCSpeaker();
if(d2() ==1)
{
string sItemResref = "enter_the_item_resref_here";
CreateItemOnObject(sItemResref, oPC);
}
else
{
// PC does not get any item
// perhaps a good place to provide a failure message as follows
FloatingTextStringOnCreature(GetName(oPC)+" finds nothing on the "+GetName(OBJECT_SELF)+".", oPC);
}
}
Modifié par henesua, 08 septembre 2012 - 01:56 .