Im trying to write the code so it dosent matter which order i give the 2 items however i want it so if i give item 1 first it says i still need item 2 and if i give item 2 first then say it still needs item 1 and if i given both items then disappear this is what i done so far but i cant get it working right so any help please.
func ActionObject_2(idx)
{
if (ObjGet(ObjFind(2),O_STATUS) == 0)
{
Message1(5,4,"Hey i need 2 items");
MessagePop();
Message2(5,4,"ok i'll get them for you.");
MessagePop();
Message1(5,4,"thanks.");
MessagePop();
ObjSet(ObjFind(2),O_STATUS,1);
}
else
{
idx = OpenDialogInventory();
if(idx!=-1) UseObject(idx);
}
}
func UseObject_2(idx)
{
itemid=ObjGet(idx,O_ID);
if (ObjGet(ObjFind(2),O_STATUS) == 1)
{
if(itemid==26 && ObjGet(ObjFind(28),O_DISABLE) != 1)
{
Message0(5,4,"Thanks i still need item 2.");
MessagePop();
InventorySub(idx);
ObjSet(ObjFind(26),O_DISABLE,1);
//ObjSet(ObjFind(2),O_STATUS,2);
}
else
{
Message0(5,4,"Thanks.");
MessagePop();
ObjSet(ObjFind(26),O_DISABLE,1);
ObjSet(ObjFind(2),O_DISABLE,1);
ObjSet(ObjFind(2),O_DRAW,0);
GameCommand(CMD_REFRESH);
}
if(itemid==28 && ObjGet(ObjFind(26),O_DISABLE) != 1)
{
Message0(5,4,"Thanks i still need item 1.");
MessagePop();
InventorySub(idx);
ObjSet(ObjFind(28),O_DISABLE,1);
// ObjSet(ObjFind(2),O_STATUS,2);
}
else
{
Message0(5,4,"Thanks.");
MessagePop();
ObjSet(ObjFind(28),O_DISABLE,1);
ObjSet(ObjFind(2),O_DISABLE,1);
ObjSet(ObjFind(2),O_DRAW,0);
GameCommand(CMD_REFRESH);
}
}
else if(itemid !=26 || itemid !=28)
{
Message1(5,4,"That's not the items.");
MessagePop();
DropObject(idx);
}
}