2025/08/22 Update
Reverted to 4.56 to track down a bug that started in 4.57. Bugfixed back to 4.61. It's amazing the damage that one skipped case statement can do.
This commit is contained in:
37
nwn/nwnprc/trunk/scripts/prc_imp_grab.nss
Normal file
37
nwn/nwnprc/trunk/scripts/prc_imp_grab.nss
Normal file
@@ -0,0 +1,37 @@
|
||||
// PnP Improved Grab Attack - Item Unique OnHit Script
|
||||
//
|
||||
|
||||
#include "prc_inc_combmove"
|
||||
#include "prc_misc_const"
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
object oPC = OBJECT_SELF;
|
||||
object oItem = PRCGetSpellCastItem();
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
|
||||
string sGrapplerName = GetName(oPC);
|
||||
|
||||
int GrappleBonus = GetLocalInt(oPC, "GRAPPLE_BONUS");
|
||||
int PCSize = PRCGetSizeModifier(oPC);
|
||||
int TargetSize = PRCGetSizeModifier(oTarget);
|
||||
int GrappleChance = d100();
|
||||
|
||||
|
||||
// You automatically lose an attempt to hold if the target is two or more size categories larger than you are.
|
||||
if (TargetSize - 2 >= PCSize)
|
||||
{
|
||||
FloatingTextStringOnCreature("This creature is too large to grapple.", oPC);
|
||||
return;
|
||||
}
|
||||
|
||||
// Don't try to grapple on every attack.
|
||||
if (GrappleChance >= 66)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
FloatingTextStringOnCreature("The "+sGrapplerName+" is trying to grab you!", oTarget);
|
||||
DoGrapple(oPC, oTarget, GrappleBonus, FALSE, TRUE);
|
||||
}
|
Reference in New Issue
Block a user