25 lines
670 B
Plaintext
25 lines
670 B
Plaintext
// dr_ul_random - reward for unlocking random door
|
|
|
|
void main()
|
|
{
|
|
object oPC=GetLastUnlocked();
|
|
object oMod=GetModule();
|
|
float fXP=GetLocalFloat(oMod,"fXPMultiplier");
|
|
object oMe=OBJECT_SELF;
|
|
int nXP=4;
|
|
int nMult=FloatToInt(fXP);
|
|
if (!GetLocalInt(oMe,"bUnlocked"))
|
|
{ // set to unlocked
|
|
if (nMult==0) nMult=6;
|
|
nXP=nXP*nMult;
|
|
AdjustAlignment(oPC,ALIGNMENT_CHAOTIC,1,FALSE);
|
|
GiveXPToCreature(oPC,nXP);
|
|
SetLocalInt(oMe,"bUnlocked",TRUE);
|
|
} // set to unlocked
|
|
else
|
|
{ // already unlocked before
|
|
SendMessageToPC(oPC,"No XP awarded. Door has been unlocked before.");
|
|
} // already unlocked before
|
|
|
|
}
|