test in code block
edit: it double spaced my code.
edit 2: now it's single spaced again, lol
int bhCheck(object oNPC, int nOption);
#include "pqj_inc"
#include "nw_i0_plot"
void main()
{
object oPC = GetPCSpeaker();
SetLocalInt(oPC, "CheckResult", bhCheck(OBJECT_SELF, GetLocalInt(oPC, "DialogOption")));
}
int bhCheck(object oNPC, int nOption)
{
object oPC = GetPCSpeaker();
string sNPC = GetTag(oNPC);
string sArea = GetTag(GetArea(oNPC));
int nGold = GetGold(oPC);
object oMod = GetModule();
// Surface NPCs
// Juno
if (sNPC == "StanFetter")
{
if (nOption == 1)return TRUE;
}
if (sNPC == "HighPriestBannen")
{
if (nOption == 2)return TRUE;
}
if (sNPC == "PathelaJard")
{
if (nOption == 3)return TRUE;
}
if (sNPC == "JunoGaurd1")
{
if (nOption == 4)return TRUE;
}
if (sNPC == "JunoGaurd2")
{
if (nOption == 4)return TRUE;
}
if (sNPC == "JunoGaurd3")
{
if (nOption == 4)return TRUE;
}
if (sNPC == "JunoGaurd4")
{
if (nOption == 4)return TRUE;
}
if (sNPC == "JunoGaurd5")
{
if (nOption == 4)return TRUE;
}
if (sNPC == "JunoGaurd6")
{
if (nOption == 4)return TRUE;
}
if (sNPC == "JunoGaurd7")
{
if (nOption == 4)return TRUE;
}
if (sNPC == "JunoGaurd8")
{
if (nOption == 4)return TRUE;
}
if (sNPC == "MerlinWebster")
{
if (nOption == 5)return TRUE;
}
if (sNPC == "KingGoodman")
{
if (nOption == 6)if(RetrieveQuestState("TheLichQueen", GetPCSpeaker()) != 3)return TRUE;
if (nOption == 7)if(RetrieveQuestState("TheLichQueen", GetPCSpeaker()) == 2)return TRUE;
if (nOption == 8)if(RetrieveQuestState("TheLichQueen", GetPCSpeaker()) == 3)return TRUE;
if (nOption == 10)return TRUE;
}
if (sNPC == "CaptainNorris")
{
if (nOption == 9)return TRUE;
}
if (sNPC == "CaptainBlake")
{
if (nOption == 11)return TRUE;
}
if (sNPC == "CeldorTheShopkeep")
{
if (nOption == 12)return TRUE;
}
if (sNPC == "BigDaveTheBarkeep")
{
if (nOption == 13)return TRUE;
}
if (sNPC == "Ashane")
{
if (nOption == 14)return TRUE;
if (nOption == 15)if(RetrieveQuestState("HuntingForHides", GetPCSpeaker()) == 0)return TRUE;
if (nOption == 16)
{
string sItemNeeded = "CougarPelt";
int nNumberNeeded = 10;
int nHowManyDoesPCHave = GetNumItems(oPC,sItemNeeded);
if(RetrieveQuestState("HuntingForHides", oPC) == 1 && nHowManyDoesPCHave >= nNumberNeeded)
return TRUE;
}
if (nOption == 17)
{
string sItemNeeded = "CragCatPelt";
int nNumberNeeded = 15;
int nHowManyDoesPCHave = GetNumItems(oPC,sItemNeeded);
if(RetrieveQuestState("HuntingForHides", oPC) == 2 && nHowManyDoesPCHave >= nNumberNeeded)
return TRUE;
}
if (nOption == 18)
{
string sItemNeeded = "BearPelt";
int nNumberNeeded = 20;
int nHowManyDoesPCHave = GetNumItems(oPC,sItemNeeded);
if(RetrieveQuestState("HuntingForHides", oPC) == 3 && nHowManyDoesPCHave >= nNumberNeeded)
return TRUE;
}
if (nOption == 19)
{
string sItemNeeded = "NW_IT_MSMLMISC10";
int nNumberNeeded = 25;
int nHowManyDoesPCHave = GetNumItems(oPC,sItemNeeded);
if(RetrieveQuestState("HuntingForHides", oPC) == 4 && nHowManyDoesPCHave >= nNumberNeeded)
return TRUE;
}
}
if (sNPC == "PerodoSveffinkdser")
{
if (nOption == 20)return TRUE;
if (nOption == 21)if(GetItemPossessedBy(oPC, "NW_IT_MSMLMISC13")!= OBJECT_INVALID)return TRUE;
if (nOption == 22)
{
string sItemNeeded = "NW_IT_MSMLMISC13";
int nNumberNeeded = 2;
int nHowManyDoesPCHave = GetNumItems(oPC,sItemNeeded);
if(nHowManyDoesPCHave >= nNumberNeeded)
return TRUE;
}
if (nOption == 23)
{
string sItemNeeded = "NW_IT_MSMLMISC13";
int nNumberNeeded = 3;
int nHowManyDoesPCHave = GetNumItems(oPC,sItemNeeded);
if(nHowManyDoesPCHave >= nNumberNeeded)
return TRUE;
}
if (nOption == 24)
{
string sItemNeeded = "NW_IT_MSMLMISC13";
int nNumberNeeded = 4;
int nHowManyDoesPCHave = GetNumItems(oPC,sItemNeeded);
if(nHowManyDoesPCHave >= nNumberNeeded)
return TRUE;
}
if (nOption == 25)
{
string sItemNeeded = "NW_IT_MSMLMISC13";
int nNumberNeeded = 5;
int nHowManyDoesPCHave = GetNumItems(oPC,sItemNeeded);
if(nHowManyDoesPCHave >= nNumberNeeded)
return TRUE;
}
}
return FALSE;
}
Modifié par Chris Lefforge, 15 juillet 2010 - 12:03 .