PoA_PRC8/_module/nss/imp_grab.nss
Jaysyn904 bfbbd2f1ac Major update
Added several new undead models & facelifted overrides for other models.  Added dozens of new undead creatures from Libris Mortis & the monster manuals.  Added CODI Core AI.  Added NESS spawner system.  Added randomized respawning trap system.  Added undead feeding system.  Greatly revamped Catacombs & Halls of the Dead.  Updated nimtools.  Full compile.  Updated release archive.
2024-04-07 01:06:57 -04:00

37 lines
995 B
Plaintext

// 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 grappling you!", oTarget);
DoGrapple(oPC, oTarget, GrappleBonus, FALSE, TRUE);
}