EN4_PRC8/_module/nss/qst_random.nss

26 lines
493 B
Plaintext
Raw Permalink Normal View History

#include "utl_i_sqluuid"
void main()
{
int iRandom;
int iMax;
int iLastQuest;
iMax = 13;
iRandom = Random(iMax)+1;
iLastQuest = GetLocalInt(GetPCSpeaker(),"LastQuest");
if (iRandom == iLastQuest)
{
iRandom++;
if (iRandom > iMax)
iRandom = 1;
}
//Lvl 40 characters should get the main questline until finished.
if (SQLocalsUUID_GetInt(GetPCSpeaker(),"OverallQuest") < 4 && GetHitDice(GetPCSpeaker()) > 39)
iRandom =11;
SetLocalInt(OBJECT_SELF,"RandomStep",iRandom);
}