39 lines
767 B
Plaintext
39 lines
767 B
Plaintext
void RemoveXPFromParty(int nXP, object oPC, int bAllParty=TRUE)
|
|
{
|
|
|
|
if (!bAllParty)
|
|
{
|
|
nXP=(GetXP(oPC)-nXP)>=0 ? GetXP(oPC)-nXP : 0;
|
|
SetXP(oPC, nXP);
|
|
}
|
|
else
|
|
{
|
|
object oMember=GetFirstFactionMember(oPC, TRUE);
|
|
while (GetIsObjectValid(oMember))
|
|
{
|
|
nXP=(GetXP(oMember)-nXP)>=0 ? GetXP(oMember)-nXP : 0;
|
|
SetXP(oMember, nXP);
|
|
oMember=GetNextFactionMember(oPC, TRUE);
|
|
}
|
|
}
|
|
}
|
|
|
|
void Repeat(object oPC)
|
|
{
|
|
int nInt = GetCampaignInt("deathquest","exp_loss",oPC);
|
|
if(nInt==1)
|
|
{
|
|
RemoveXPFromParty(10, oPC, FALSE);
|
|
DelayCommand(30.0, Repeat(oPC));
|
|
}
|
|
}
|
|
|
|
void main()
|
|
{
|
|
object oPC = GetPCSpeaker();
|
|
SetLocalInt(OBJECT_SELF,"drow_priest_talk",1);
|
|
SetCampaignInt("deathquest","exp_loss",1,oPC);
|
|
Repeat(oPC);
|
|
}
|
|
|