40 lines
1.2 KiB
Plaintext
40 lines
1.2 KiB
Plaintext
#include "rtg_i0_generic"
|
|
|
|
int StartingConditional()
|
|
{
|
|
object oPC = GetPCSpeaker();
|
|
object oItem = GetFirstItemInInventory(oPC);
|
|
string sAssignedBy = GetLocalString(oPC, "RTG_AssignedByTag");
|
|
|
|
|
|
if(sAssignedBy != "" && sAssignedBy == GetTag(OBJECT_SELF) && GetIsObjectValid(oItem) && GetLocalInt(oPC, "RTG_TaskType") == RTG_TASK_TYPE_HARVEST)
|
|
{
|
|
int nCount = GetLocalInt(oPC, "RTG_ItemNum");
|
|
while(GetIsObjectValid(oItem) && nCount != 0)
|
|
{
|
|
if(GetTag(oItem) == GetLocalString(oPC, "RTG_ItemTag"))
|
|
{
|
|
nCount --;
|
|
DestroyObject(oItem);
|
|
}
|
|
oItem = GetNextItemInInventory(oPC);
|
|
}
|
|
SetLocalInt(oPC, "RTG_ItemNum", nCount);
|
|
|
|
if(nCount == 0)
|
|
{
|
|
SetLocalInt(oPC, "RTG_TaskActive", FALSE);
|
|
return FALSE;
|
|
}
|
|
else if(GetIsObjectValid(GetItemPossessedBy(oPC, GetLocalString(oPC, "RTG_ItemTag"))))
|
|
{
|
|
struct RTG_TaskReplyPhraseData newTaskReplyPhrase = RTG_ReplyTask(oPC);
|
|
PlaySound("gui_journaladd");
|
|
SetCustomToken(3372, newTaskReplyPhrase.sText);
|
|
|
|
return TRUE;
|
|
}
|
|
}
|
|
return FALSE;
|
|
}
|