Rolo Kipp wrote...
<getting...>
For the math portion, my thought is to compare DC against base skill. Subtract skill from DC, if >0 the XP = difference squared.
At the low end, this means no XP for a trap/lock that you can pick in your sleep.
At the high end, this makes the skill rewarding for challenging targets in similar manner to the scaled XP fighters get with variable opponents.
<...tricky>
I do similar to what Rolo suggests, though its based on your overall levels vs the DC of the lock or trap and there's a minimum reward of 2xp ... even for the ones you can "do in your sleep".
XP for Locks:
void RewardPartyXP(int XP, object oTarget,int bAllParty=TRUE)
{
if (bAllParty == TRUE)
{
object oPartyMember = GetFirstFactionMember(oTarget, TRUE);
while (GetIsObjectValid(oPartyMember) == TRUE)
{
if( GetArea( oPartyMember) == GetArea( oTarget)) GiveXPToCreature( oPartyMember, XP);
oPartyMember = GetNextFactionMember(oTarget, TRUE);
}
}
else
{
GiveXPToCreature(oTarget, XP);
}
}
object oPC=GetLastUnlocked();
int iXPaward = 0;
int iXPawarddc = 0;
void main()
{if(GetLocalInt(OBJECT_SELF,"unlock") == 1)
{return;}
iXPawarddc = (GetLockUnlockDC(OBJECT_SELF));
iXPaward = (iXPawarddc -((GetHitDice(oPC)+5)));
SetLocalInt(OBJECT_SELF,"unlock",1);
SendMessageToPC( (oPC ),"Unlocked");
if (iXPaward >= 2)
RewardPartyXP(iXPaward, oPC, TRUE);
else
RewardPartyXP(2, oPC, TRUE);
DelayCommand(600.0, SetLocalInt(OBJECT_SELF,"unlock",0));
}
XP for Traps:
void RewardPartyXP(int XP, object oTarget,int bAllParty=TRUE)
{
if (bAllParty == TRUE)
{
object oPartyMember = GetFirstFactionMember(oTarget, TRUE);
while (GetIsObjectValid(oPartyMember) == TRUE)
{
if( GetArea( oPartyMember) == GetArea( oTarget)) GiveXPToCreature( oPartyMember, XP);
oPartyMember = GetNextFactionMember(oTarget, TRUE);
}
}
else
{
GiveXPToCreature(oTarget, XP);
}
}
object oPC=GetLastDisarmed();
int iXPaward = 0;
int iXPawarddc = 0;
void main()
{if(GetLocalInt(OBJECT_SELF,"disarm") == 1)
{return;}
iXPawarddc = (GetTrapDisarmDC(OBJECT_SELF));
iXPaward = (iXPawarddc -((GetHitDice(oPC)+5)));
SetLocalInt(OBJECT_SELF,"disarm",1);
SendMessageToPC( (oPC ),"Trap disarmed");
if (iXPaward >= 2)
RewardPartyXP(iXPaward, oPC, TRUE);
else
RewardPartyXP(2, oPC, TRUE);
DelayCommand(600.0, SetLocalInt(OBJECT_SELF,"disarm",0));
}
Both versions use a delayed command to allow a second, third, etc... attempt. This I think works better as if limited to once per PC, PCs can still relock or even retrap things and let others in their Party double dip.
Modifié par kalbaern, 13 juin 2013 - 04:33 .