//:://///////////////////////////////////////////// //:: Acid Weapon //:: Copyright (c) 2015 Rose Corp. //::////////////////////////////////////////////// // Gives a melee weapon 2d8 acid damage. //::////////////////////////////////////////////// //:: Created By: Rose //:: Created On: Dec. 6, 2015 //::////////////////////////////////////////////// #include "nw_i0_spells" //#include "x2_i0_spells" #include "prc_inc_spells" #include "x2_inc_switches" #include "prc_x2_itemprop" // *** Tarashon adding visual *** // void AddFlamingEffectToWeapon( object oTarget, float fDuration, int nCasterLvl) { IPSafeAddItemProperty(oTarget, ItemPropertyVisualEffect(ITEM_VISUAL_ACID), fDuration,X2_IP_ADDPROP_POLICY_REPLACE_EXISTING,FALSE,TRUE); } // *** Tarashon done with visual *** // void main() // { // if( GetUserDefinedItemEventNumber() == X2_ITEM_EVENT_ACTIVATE ) { object oPC = GetItemActivator(); if (GetLevelByClass(CLASS_TYPE_ASSASSIN, oPC) < 1) { SendMessageToPC(OBJECT_SELF, "You must have at least 1 level of assassin to use this item!"); return; } //Declare major variables effect eVis = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE); effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); int nMetaMagic = PRCGetMetaMagicFeat(); int nCasterLvl = GetLevelByClass(CLASS_TYPE_ASSASSIN, oPC); int nDuration = 2 * nCasterLvl; //Limit nCasterLvl to 20. if(nCasterLvl > 20) { nCasterLvl = 20; } if (nMetaMagic == METAMAGIC_EXTEND) { nDuration = nDuration * 2; //Duration is +100% } object oTarget = GetItemActivatedTarget(); if(GetIsObjectValid(oTarget) && GetObjectType(oTarget) == OBJECT_TYPE_CREATURE) { // Alter the right hand weapon equipped by the creature. object oWeapon1 = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oTarget); if(GetIsObjectValid(oWeapon1)) { // If the PC has a melee weapon equipped. if ( IPGetIsMeleeWeapon(oWeapon1)) { if (nDuration>0) { // haaaack: store caster level on item for the on hit spell to work properly ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, GetItemPossessor(oWeapon1)); ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, GetItemPossessor(oWeapon1), 1440.0); // ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, GetItemPossessor(oWeapon1), TurnsToSeconds(nDuration)); IPSafeAddItemProperty(oWeapon1, ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_ACID, IP_CONST_DAMAGEBONUS_2d8), 1440.0); } } else { FloatingTextStrRefOnCreature(83615, OBJECT_SELF); } } // Alter the left hand weapon equipped by the creature. object oWeapon2 = GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oTarget); if(GetIsObjectValid(oWeapon2)) { // If the PC has a melee weapon equipped. if ( IPGetIsMeleeWeapon(oWeapon2)) { if (nDuration>0) { // haaaack: store caster level on item for the on hit spell to work properly ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, GetItemPossessor(oWeapon2)); ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, GetItemPossessor(oWeapon2), 1440.0); // ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, GetItemPossessor(oWeapon2), TurnsToSeconds(nDuration)); IPSafeAddItemProperty(oWeapon2, ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_ACID, IP_CONST_DAMAGEBONUS_2d8), 1440.0); } } else { FloatingTextStrRefOnCreature(83615, OBJECT_SELF); } } // Alter the right claw equipped by the creature. object oWeapon3 = GetItemInSlot(INVENTORY_SLOT_CWEAPON_R, oTarget); if(GetIsObjectValid(oWeapon3)) { if (nDuration>0) { // haaaack: store caster level on item for the on hit spell to work properly ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, GetItemPossessor(oWeapon3)); ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, GetItemPossessor(oWeapon3), 1440.0); // ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, GetItemPossessor(oWeapon3), TurnsToSeconds(nDuration)); IPSafeAddItemProperty(oWeapon3, ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_ACID, IP_CONST_DAMAGEBONUS_2d8), 1440.0); } } // Alter the left claw equipped by the creature. object oWeapon4 = GetItemInSlot(INVENTORY_SLOT_CWEAPON_L, oTarget); if(GetIsObjectValid(oWeapon4)) { if (nDuration>0) { // haaaack: store caster level on item for the on hit spell to work properly ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, GetItemPossessor(oWeapon4)); ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, GetItemPossessor(oWeapon4), 1440.0); // ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, GetItemPossessor(oWeapon4), TurnsToSeconds(nDuration)); IPSafeAddItemProperty(oWeapon4, ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_ACID, IP_CONST_DAMAGEBONUS_2d8), 1440.0); } } // Alter the bite equipped by the creature. object oWeapon5 = GetItemInSlot(INVENTORY_SLOT_CWEAPON_B, oTarget); if(GetIsObjectValid(oWeapon5)) { if (nDuration>0) { // haaaack: store caster level on item for the on hit spell to work properly ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, GetItemPossessor(oWeapon5)); ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, GetItemPossessor(oWeapon5), 1440.0); // ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, GetItemPossessor(oWeapon5), TurnsToSeconds(nDuration)); IPSafeAddItemProperty(oWeapon5, ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_ACID, IP_CONST_DAMAGEBONUS_2d8), 1440.0); } } } else { SendMessageToPC(oPC, "You must target a creature!"); return; } } // }