Fester Pot wrote...
Doing so requires to add a count to the variable for each rat that is killed.
void main()
{
int nNth = GetLocalInt(GetModule(), "ratkills");
nNth++;
SetLocalInt(GetModule(), "ratkills", nNth);
}
This would be placed on the rat's OnDeath script, so for each rat killed, the variable grows by +1.
Then you need to check the conversation of your NPC for the variable number. In this case, it's 10.
This would be placed on the TEXT APPEARS TAB of the conversation.
int StartingConditional()
{
// Inspect local variables
if(!(GetLocalInt(GetModule(), "ratkills") == 10))
return FALSE;
return TRUE;
}
FP!
Try this for the ondeath
void main()
{
int nNth = GetLocalInt(GetModule(), "ratkills");
if(!(GetLocalInt(GetModule(), "ratkills") <= 9))
{
nNth++;SetLocalInt(GetModule(), "ratkills", nNth);
}
}
Doing it this way will only allow it to get to 10 kills. If a player more than 10 rats, it will still fire Fester's conditional script.
Or you could change fester's conditional to this:
int StartingConditional(){
// Inspect local variables
if(!(GetLocalInt(GetModule(), "ratkills") >= 10))
return FALSE;
return TRUE;
Either way will work. of course this is persuming you have more than 10 rats in your sewer. If only 10 rats in your sewer do it how fester wrote it.
Modifié par Pattycake1, 20 octobre 2012 - 07:07 .