Jaysyn904 22947ad4b6 Initial Upload
Initial Upload
2023-08-08 16:22:17 -04:00

56 lines
1.4 KiB
Plaintext

/*------
New Name: ema_xp_4_trap_disarm
Date: 19-OCT-2003
Re-creator: Drakkenkin
Notes:
This Script was made from the scripts Telzar08Trap_XP_award and Velar03trap_disarm_xp.
The Scripts were made by Telzar and Velar respectively.
I re-worked this script because I like most of one of the script but I like the detection if
the PC is in or out of combat of the other script. So I combined the two.
----*/
// Declares Variables
object oPC=GetLastUnlocked();
int iXPaward = 0;
int iXPawarddc = 0;
void main()
{
if (GetIsInCombat(oPC))
{
iXPawarddc = (GetLockUnlockDC(OBJECT_SELF) *10);
// Multiplies the doorlock DC by 10
iXPaward = (iXPawarddc -((GetHitDice(oPC)-1)*10));
// Subtracts 10 for every level -1 of the pc from the XP award
//(this way 1st level Pcs get full xp).
}
else
{
iXPawarddc = (GetLockUnlockDC(OBJECT_SELF) *5);
// Multiplies the Trap Disarm DC by 5
iXPaward = (iXPawarddc -((GetHitDice(oPC)-1)*5));
// Subtracts 5 for every level -1 of the pc from the XP award
}
SendMessageToPC( (oPC ),"Door Unlocked");
// 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.
}
}