Amon_PRC8/_module/nss/di_ropeclimb.nss

49 lines
2.2 KiB
Plaintext
Raw Permalink Normal View History

2025-04-03 19:00:46 -04:00
void main()
{
// ______________________________________________________________
// Do a Rope climbing check.
// We're doing this with a strength plus a concentrate. (You've got to pay attention
// when climbing a rope).
// Number of skill ranks in concentrate / 2 is added to the check. A -1 penalty for
// every 25 lbs of gear carried.
// NOTE: The right most character of the tag of the rope climbed should
// should be a number from 1-9. This is the number of D8 * 5 points of dmg taken
// on a fall. (Essentially how high the rope is.)
// this is harsh fall dmg, but this is intended for very higy lvl characters
// NOTE: The name of the rope should be the tag of the object transported
// to when the rope is successfully climbed.
// At this time the fall location is hardcoded on line 37.
// ______________________________________________________________
object oPC = GetLastUsedBy();
int iHeight = StringToInt(GetStringRight(GetTag(OBJECT_SELF), 1));
int falldmg = d8(iHeight * 5);
int iDIFFICULTY = 18;
int iRopeClimbCheck = GetAbilityModifier(ABILITY_STRENGTH, oPC) +
GetSkillRank(SKILL_CONCENTRATION, oPC) / 2 -
(GetWeight(oPC) / 250) + // -1 for each 25 lbs carried
d20();
if(iRopeClimbCheck < iDIFFICULTY)
{
if(GetTag(GetArea(oPC)) == "di_cliffs1")
{
SendMessageToPC(oPC, "You have fallen from the rope!");
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectKnockdown(), oPC, 3.0f);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDamage(falldmg), oPC);
}
else // If teleport is necessary dmg will be applied in the on enter event
{
SetLocalString(oPC, "di_fallstring", "You have fallen from the rope!");
SetLocalInt(oPC, "di_falldmg", falldmg);
object oTarget = GetObjectByTag("ihavefallen");// eventually this needs softcoded
AssignCommand(oPC, JumpToObject(oTarget));
}
}
else
{
object oTarget = GetObjectByTag(GetName(OBJECT_SELF));
AssignCommand(oPC, JumpToObject(oTarget));
}
}