Initial commit
Initial commit.
This commit is contained in:
31
_module/nss/ucd_xpawardtraps.nss
Normal file
31
_module/nss/ucd_xpawardtraps.nss
Normal file
@@ -0,0 +1,31 @@
|
||||
// Declares Variables
|
||||
object oPC=GetLastDisarmed();
|
||||
int iXPaward = 0;
|
||||
int iXPawarddc = 0;
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
iXPawarddc = (GetTrapDisarmDC(OBJECT_SELF) *3);
|
||||
// Multiplies the Trap Disarm DC by 8
|
||||
|
||||
iXPaward = (iXPawarddc -((GetHitDice(oPC)-1)*3));
|
||||
// Subtracts 8 for every level -1 of the pc from the XP award (this way 1st level Pcs get full xp).
|
||||
|
||||
SendMessageToPC( (oPC ),"Trap disarmed");
|
||||
// Sends a message to the PC letting them Know that the trap was disarmed.
|
||||
|
||||
if (iXPaward >= 1)
|
||||
// checks to make sure that the xp award is at least 1.
|
||||
|
||||
GiveXPToCreature(oPC, iXPaward);
|
||||
// If the XP reward is at least 1 then give the PC a reward.
|
||||
|
||||
else
|
||||
// If the XP award is less then 1.
|
||||
|
||||
|
||||
GiveXPToCreature(oPC, 1);
|
||||
// give 1 xp.
|
||||
|
||||
}
|
Reference in New Issue
Block a user