Alangara_PRC8/_module/nss/thunderstone.nss
Jaysyn904 86feb9ca6f Initial commit
Initial commit.
2024-06-05 21:21:06 -04:00

72 lines
1.5 KiB
Plaintext

// *** Thunderstrike ability grainting to worn melee weapon, by Tarashon ***
#include "prc_x2_itemprop"
void main()
{
object oPC;
oPC = GetItemActivator();
object oItem;
oItem = GetItemPossessedBy(oPC, "thunderstone");
if (GetIsObjectValid(oItem))
DestroyObject(oItem);
object oTarget;
oTarget = GetItemActivator();
//Visual effects can't be applied to waypoints, so if it is a WP
//the VFX will be applied to the WP's location instead
int nInt;
nInt = GetObjectType(oTarget);
if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_ELECTRIC_EXPLOSION), oTarget);
else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_ELECTRIC_EXPLOSION), GetLocation(oTarget));
oTarget = oPC;
oItem = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oTarget);
itemproperty ipAdd;
ipAdd = ItemPropertyLimitUseByClass(IP_CONST_CLASS_PALADIN);
IPSafeAddItemProperty(oItem, ipAdd);
// ***
ipAdd = ItemPropertyLimitUseByClass(IP_CONST_CLASS_FIGHTER);
IPSafeAddItemProperty(oItem, ipAdd);
// ***
ipAdd = ItemPropertyLimitUseByClass(IP_CONST_CLASS_BARBARIAN);
IPSafeAddItemProperty(oItem, ipAdd);
// ***
ipAdd = ItemPropertyLimitUseByClass(IP_CONST_CLASS_ROGUE);
IPSafeAddItemProperty(oItem, ipAdd);
// ***
ipAdd = ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_ELECTRICAL, IP_CONST_DAMAGEBONUS_2d10);
IPSafeAddItemProperty(oItem, ipAdd);
// ***
SetPlotFlag(oItem, TRUE);
ipAdd = ItemPropertyVampiricRegeneration(2);
IPSafeAddItemProperty(oItem, ipAdd);
}