PRC8/trunk/scripts/prc_ad_dexatk.nss
Jaysyn904 1662218bb4 Initial upload.
Adding base PRC 4.19a files to repository.
2022-10-07 13:51:24 -04:00

27 lines
893 B
Plaintext

#include "prc_inc_clsfunc"
void main()
{
object oPC = OBJECT_SELF;
object oWeapon = GetLocalObject(oPC, "CHOSEN_WEAPON");
int iType = GetBaseItemType(oWeapon);
if (GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC) != oWeapon)
{
FloatingTextStringOnCreature("You must have your chosen weapon equipped in your main hand.", oPC, FALSE);
return;
}
int iWeaponType = GetBaseItemType(oWeapon);
int iNumDice = StringToInt(Get2DACache("baseitems","NumDice",iWeaponType));
int iDieToRoll = StringToInt(Get2DACache("baseitems","DieToRoll",iWeaponType));
int iAttack = iNumDice * iDieToRoll - 1;
effect eAttackIncrease = EffectAttackIncrease(iAttack,ATTACK_BONUS_MISC);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eAttackIncrease, oPC);
FloatingTextStringOnCreature("Dexterous Attack Mode Activated", oPC, FALSE);
DelayCommand(6.0, CheckCombatDexAttack(oPC));
}