34 lines
1.3 KiB
Plaintext
34 lines
1.3 KiB
Plaintext
void main()
|
|
{
|
|
object oTarget =GetLocalObject(OBJECT_SELF,"T1_TARGET_OBJECT");
|
|
if (oTarget != OBJECT_INVALID)
|
|
{
|
|
FloatingTextStringOnCreature(GetName(GetPCSpeaker()) + " tries to climb the rope ..." , GetPCSpeaker());
|
|
int iMod;
|
|
object oArmor = GetItemInSlot (INVENTORY_SLOT_CHEST);
|
|
if (oArmor !=OBJECT_INVALID)
|
|
if (GetItemACValue(oArmor)>3)
|
|
iMod = GetItemACValue(oArmor) - 3;
|
|
else
|
|
iMod = -4;
|
|
ActionWait(2.0f);
|
|
if (GetAbilityModifier(ABILITY_DEXTERITY,GetPCSpeaker())+d20()-iMod >= GetWillSavingThrow(OBJECT_SELF))
|
|
{
|
|
|
|
FloatingTextStringOnCreature(GetName(GetPCSpeaker()) + " ... and makes it!" , GetPCSpeaker());
|
|
ActionWait(0.5f);
|
|
AssignCommand(GetPCSpeaker(), JumpToObject(oTarget));
|
|
}
|
|
else
|
|
{
|
|
int iDmgMod = FloatToInt(GetDistanceToObject(oTarget));
|
|
effect eKnock = EffectKnockdown();
|
|
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eKnock,GetPCSpeaker(),3.0f);
|
|
effect eDmg = EffectDamage(d6(iDmgMod),DAMAGE_TYPE_BLUDGEONING);
|
|
FloatingTextStringOnCreature(GetName(GetPCSpeaker()) + " ... and fails!"+IntToString(iDmgMod) , GetPCSpeaker());
|
|
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eDmg,GetPCSpeaker(),3.0f);
|
|
}
|
|
|
|
}
|
|
}
|