28 lines
984 B
Plaintext
28 lines
984 B
Plaintext
|
//Disarm Trap XP award for Thieves
|
||
|
//Operates on this math: (TrapDC * XPMultiplier) - (ThiefLevel x Skill) = XP Award
|
||
|
// Created by Todmaerin 6/22/02
|
||
|
// Modified 6/30/02
|
||
|
|
||
|
object oThief = GetLastDisarmed();
|
||
|
void main()
|
||
|
{
|
||
|
string sThiefLevel;
|
||
|
int nPosition;
|
||
|
int nRogueTrue;
|
||
|
for (nPosition= 1; nPosition <= 3; nPosition ++)
|
||
|
{
|
||
|
nRogueTrue = GetLocalInt(oThief, IntToString(GetClassByPosition (nPosition, oThief) ));
|
||
|
};
|
||
|
if (nRogueTrue = CLASS_TYPE_ROGUE)
|
||
|
{
|
||
|
sThiefLevel = IntToString(GetLevelByClass (CLASS_TYPE_ROGUE, oThief));
|
||
|
int nDisarmSkill = GetSkillRank(SKILL_DISABLE_TRAP, oThief);
|
||
|
int nTrapDC = GetTrapDisarmDC(OBJECT_SELF);
|
||
|
float fXPMod = 1.2;
|
||
|
//the math
|
||
|
int nXPAward = FloatToInt((nTrapDC * fXPMod) - (StringToInt(sThiefLevel) * nDisarmSkill));
|
||
|
GiveXPToCreature (oThief, nXPAward);
|
||
|
}
|
||
|
|
||
|
}
|