Updated AMS marker feats. Removed arcane & divine marker feats. Updated Dread Necromancer for epic progression. Updated weapon baseitem models. Updated new weapons for crafting & npc equip. Updated prefix. Updated release archive.
195 lines
8.3 KiB
Plaintext
195 lines
8.3 KiB
Plaintext
//::///////////////////////////////////////////////
|
||
//:: Name fiendkll maintain script
|
||
//:: FileName wol_m_fiendkll
|
||
//:://////////////////////////////////////////////
|
||
/*
|
||
LEGACY ITEM PENALTIES (These do not stack. Highest takes precedence).
|
||
Attack Penalty: -1 at 6th, -2 at 12th
|
||
Reflex Save Penalty: -1 at 7th, -2 at 9th, -3 at 15th
|
||
Hit Point Penalty: -2 at 7th, -4 at 8th, -6 at 10th, -8 at 14th, -10 at 16th
|
||
|
||
LEGACY ITEM BONUSES
|
||
8th - +1 Outsider Bane Heavy Flail
|
||
11th - +2 Outsider Bane Heavy Flail
|
||
16th - +2 Holy Outsider Bane Heavy Flail
|
||
|
||
LEGACY ITEM ABILITIES
|
||
Darkvision (Sp): Beginning at 6th level, once per day on command, you can use darkvision as the spell. Caster level 5th.
|
||
Sense Fiends (Su): At 6th level and higher, you can detect evil. Caster level 5th.
|
||
Devil Chills (Su): At 12th level and higher, Fiendkiller’s Flail infects any creature damaged by it with devil chills.
|
||
Devil’s Fang (Su): Beginning at 13th level, the spiked ball secretes deathblade poison.
|
||
*/
|
||
|
||
#include "prc_inc_template"
|
||
|
||
void main()
|
||
{
|
||
int nEvent = GetRunningEvent();
|
||
if(DEBUG) DoDebug("wol_m_fiendkll running, event: " + IntToString(nEvent));
|
||
|
||
// Get the PC. This is event-dependent
|
||
object oPC, oItem;
|
||
switch(nEvent)
|
||
{
|
||
case EVENT_ITEM_ONHIT: oPC = OBJECT_SELF; break;
|
||
case EVENT_ONPLAYEREQUIPITEM: oPC = GetItemLastEquippedBy(); break;
|
||
case EVENT_ONPLAYERUNEQUIPITEM: oPC = GetItemLastUnequippedBy(); break;
|
||
case EVENT_ONHEARTBEAT: oPC = OBJECT_SELF; break;
|
||
|
||
default:
|
||
oPC = OBJECT_SELF;
|
||
}
|
||
object oSkin = GetPCSkin(oPC);
|
||
int nHD = GetHitDice(oPC);
|
||
int nHPPen = 0;
|
||
object oWOL = GetItemPossessedBy(oPC, "WOL_FiendkillersFlail");
|
||
|
||
// You get nothing if you aren't wielding the weapon
|
||
if(oWOL != GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC))
|
||
{
|
||
SetCompositeAttackBonus(oPC, "fiendkll_Atk", 0, ATTACK_BONUS_MISC);
|
||
SetCompositeBonus(oSkin, "fiendkll_SavesR", 0, ITEM_PROPERTY_DECREASED_SAVING_THROWS, IP_CONST_SAVEBASETYPE_REFLEX);
|
||
return;
|
||
}
|
||
|
||
// We aren't being called from any event, instead from EvalPRCFeats
|
||
if(nEvent == FALSE)
|
||
{
|
||
// 5th to 10th level abilities
|
||
if (GetHasFeat(FEAT_LEAST_LEGACY, oPC))
|
||
{
|
||
if(nHD >= 5)
|
||
{
|
||
|
||
}
|
||
if(nHD >= 6)
|
||
{
|
||
nHPPen += 2;
|
||
SetCompositeAttackBonus(oPC, "fiendkll_Atk", -1, ATTACK_BONUS_MISC);
|
||
IPSafeAddItemProperty(oSkin, PRCItemPropertyBonusFeat(IP_CONST_FEAT_FIEND_DARKVIS), 0.0, X2_IP_ADDPROP_POLICY_KEEP_EXISTING, FALSE, FALSE);
|
||
IPSafeAddItemProperty(oSkin, PRCItemPropertyBonusFeat(IP_CONST_FEAT_FIEND_DETECT), 0.0, X2_IP_ADDPROP_POLICY_KEEP_EXISTING, FALSE, FALSE);
|
||
}
|
||
if(nHD >= 7)
|
||
{
|
||
nHPPen += 2;
|
||
SetCompositeBonus(oSkin, "fiendkll_SavesR", 1, ITEM_PROPERTY_DECREASED_SAVING_THROWS, IP_CONST_SAVEBASETYPE_REFLEX);
|
||
}
|
||
if(nHD >= 8)
|
||
{
|
||
nHPPen += 2;
|
||
IPSafeAddItemProperty(oWOL, ItemPropertyAttackBonusVsRace(IP_CONST_RACIALTYPE_OUTSIDER, 3));
|
||
IPSafeAddItemProperty(oWOL, ItemPropertyDamageBonusVsRace(IP_CONST_RACIALTYPE_OUTSIDER, IP_CONST_DAMAGETYPE_BLUDGEONING, IP_CONST_DAMAGEBONUS_2d6));
|
||
}
|
||
if(nHD >= 9)
|
||
{
|
||
SetCompositeBonus(oSkin, "fiendkll_SavesR", 2, ITEM_PROPERTY_DECREASED_SAVING_THROWS, IP_CONST_SAVEBASETYPE_REFLEX);
|
||
}
|
||
if(nHD >= 10)
|
||
{
|
||
nHPPen += 2;
|
||
}
|
||
}
|
||
// 11th to 16th level abilities
|
||
if (GetHasFeat(FEAT_LESSER_LEGACY, oPC))
|
||
{
|
||
if(nHD >= 11)
|
||
{
|
||
IPSafeAddItemProperty(oWOL, ItemPropertyEnhancementBonus(2));
|
||
IPSafeAddItemProperty(oWOL, ItemPropertyAttackBonusVsRace(IP_CONST_RACIALTYPE_OUTSIDER, 4));
|
||
}
|
||
if(nHD >= 12)
|
||
{
|
||
SetCompositeAttackBonus(oPC, "fiendkll_Atk", -2, ATTACK_BONUS_MISC);
|
||
if(DEBUG) DoDebug("wol_m_fiendkll: Adding eventhooks");
|
||
AddEventScript(oPC, EVENT_ONPLAYEREQUIPITEM, "wol_m_fiendkll", TRUE, FALSE);
|
||
AddEventScript(oPC, EVENT_ONPLAYERUNEQUIPITEM, "wol_m_fiendkll", TRUE, FALSE);
|
||
AddEventScript(oWOL, EVENT_ITEM_ONHIT, "wol_m_fiendkll", TRUE, FALSE);
|
||
|
||
// Add the OnHitCastSpell: Unique needed to trigger the event
|
||
IPSafeAddItemProperty(oWOL, ItemPropertyOnHitCastSpell(IP_CONST_ONHIT_CASTSPELL_ONHIT_UNIQUEPOWER, 1), 99999.0, X2_IP_ADDPROP_POLICY_KEEP_EXISTING, FALSE, FALSE);
|
||
}
|
||
if(nHD >= 13)
|
||
{
|
||
}
|
||
if(nHD >= 14)
|
||
{
|
||
nHPPen += 2;
|
||
}
|
||
if(nHD >= 15)
|
||
{
|
||
SetCompositeBonus(oSkin, "fiendkll_SavesR", 3, ITEM_PROPERTY_DECREASED_SAVING_THROWS, IP_CONST_SAVEBASETYPE_REFLEX);
|
||
}
|
||
if(nHD >= 16)
|
||
{
|
||
nHPPen += 2;
|
||
IPSafeAddItemProperty(oWOL, ItemPropertyDamageBonusVsAlign(IP_CONST_ALIGNMENTGROUP_EVIL, IP_CONST_DAMAGETYPE_BLUDGEONING, IP_CONST_DAMAGEBONUS_2d6));
|
||
}
|
||
}
|
||
|
||
SetLocalInt(oPC, "WoLHealthPenalty", nHPPen);
|
||
if (!GetLocalInt(oPC, "WoLHealthPenaltyHB") && nHPPen > 0)
|
||
{
|
||
WoLHealthPenaltyHB(oPC);
|
||
SetLocalInt(oPC, "WoLHealthPenaltyHB", TRUE);
|
||
}
|
||
}
|
||
// We are called from the OnPlayerEquipItem eventhook. Add OnHitCast: Unique Power to oPC's weapon
|
||
else if(nEvent == EVENT_ONPLAYEREQUIPITEM)
|
||
{
|
||
oPC = GetItemLastEquippedBy();
|
||
oItem = GetItemLastEquipped();
|
||
if(DEBUG) DoDebug("wol_m_fiendkll - OnEquip\n"
|
||
+ "oPC = " + DebugObject2Str(oPC) + "\n"
|
||
+ "oItem = " + DebugObject2Str(oItem) + "\n"
|
||
);
|
||
|
||
if(oItem == oWOL)
|
||
{
|
||
// Add eventhook to the item
|
||
AddEventScript(oItem, EVENT_ITEM_ONHIT, "wol_m_fiendkll", TRUE, FALSE);
|
||
|
||
// Add the OnHitCastSpell: Unique needed to trigger the event
|
||
IPSafeAddItemProperty(oItem, ItemPropertyOnHitCastSpell(IP_CONST_ONHIT_CASTSPELL_ONHIT_UNIQUEPOWER, 1), 99999.0, X2_IP_ADDPROP_POLICY_KEEP_EXISTING, FALSE, FALSE);
|
||
}
|
||
}
|
||
// We are called from the OnPlayerUnEquipItem eventhook. Remove OnHitCast: Unique Power from oPC's weapon
|
||
else if(nEvent == EVENT_ONPLAYERUNEQUIPITEM)
|
||
{
|
||
oPC = GetItemLastUnequippedBy();
|
||
oItem = GetItemLastUnequipped();
|
||
if(DEBUG) DoDebug("wol_m_fiendkll - OnUnEquip\n"
|
||
+ "oPC = " + DebugObject2Str(oPC) + "\n"
|
||
+ "oItem = " + DebugObject2Str(oItem) + "\n"
|
||
);
|
||
|
||
// Only applies to the WoL
|
||
if(GetBaseItemType(oItem) == BASE_ITEM_HEAVYFLAIL)
|
||
{
|
||
// Add eventhook to the item
|
||
RemoveEventScript(oItem, EVENT_ITEM_ONHIT, "wol_m_fiendkll", TRUE, FALSE);
|
||
|
||
// Remove the temporary OnHitCastSpell: Unique
|
||
// Makes sure to get ammo if its a ranged weapon
|
||
RemoveSpecificProperty(oItem, ITEM_PROPERTY_ONHITCASTSPELL, IP_CONST_ONHIT_CASTSPELL_ONHIT_UNIQUEPOWER, 0, 1, "", -1, DURATION_TYPE_TEMPORARY);
|
||
}
|
||
}
|
||
else if(nEvent == EVENT_ITEM_ONHIT)
|
||
{
|
||
oItem = GetSpellCastItem();
|
||
object oTarget = PRCGetSpellTargetObject();
|
||
if(DEBUG) DoDebug("wol_m_fiendkll: OnHit:\n"
|
||
+ "oPC = " + DebugObject2Str(oPC) + "\n"
|
||
+ "oItem = " + DebugObject2Str(oItem) + "\n"
|
||
+ "oTarget = " + DebugObject2Str(oTarget) + "\n"
|
||
);
|
||
|
||
// Was it Caput Mortuum
|
||
if(oItem == oWOL)
|
||
{
|
||
if (nHD >= 12)
|
||
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectDisease(DISEASE_DEVIL_CHILLS), oTarget);
|
||
if (nHD >= 13)
|
||
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectPoison(POISON_DEATHBLADE), oTarget);
|
||
}// end if - Item is a melee weapon
|
||
}// end if - Running OnHit event
|
||
} |