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

151 lines
4.9 KiB
Plaintext

// *** Special damage resistance potions depending on class for Alangara, by Tarashon ***
#include "x2_inc_spellhook"
#include "prc_class_const"
void main()
{
object oPC;
if ((GetObjectType(GetItemActivatedTarget())!=OBJECT_TYPE_CREATURE)
){
SendMessageToPC(GetItemActivator(), "Improper use of item!");
return;}
oPC = GetItemActivator();
object oTarget;
oTarget = oPC;
int iTier1 = GetLevelByClass(CLASS_TYPE_DRAGONDISCIPLE, oPC)
+ GetLevelByClass(CLASS_TYPE_SHADOWDANCER, oPC)
+ GetLevelByClass(CLASS_TYPE_HARPER, oPC)
+ GetLevelByClass(CLASS_TYPE_ASSASSIN, oPC)
+ GetLevelByClass(CLASS_TYPE_ARCANE_ARCHER, oPC)
+ GetLevelByClass(CLASS_TYPE_ROGUE, oPC)
+ GetLevelByClass(CLASS_TYPE_RANGER, oPC)
+ GetLevelByClass(CLASS_TYPE_MONK, oPC);
int iTier2 = GetLevelByClass(CLASS_TYPE_FIGHTER, oPC)
+ GetLevelByClass(CLASS_TYPE_CW_SAMURAI, oPC)
+ GetLevelByClass(CLASS_TYPE_KNIGHT, oPC)
+ GetLevelByClass(CLASS_TYPE_MARSHAL, oPC)
+ GetLevelByClass(CLASS_TYPE_SAMURAI, oPC)
+ GetLevelByClass(CLASS_TYPE_SOULKNIFE, oPC)
+ GetLevelByClass(CLASS_TYPE_SOULBORN, oPC)
+ GetLevelByClass(CLASS_TYPE_SCOUT, oPC)
+ GetLevelByClass(CLASS_TYPE_INCARNATE, oPC)
+ GetLevelByClass(CLASS_TYPE_HEXBLADE, oPC)
+ GetLevelByClass(CLASS_TYPE_DUSKBLADE, oPC)
+ GetLevelByClass(CLASS_TYPE_PSYWAR, oPC)
+ GetLevelByClass(CLASS_TYPE_SWASHBUCKLER, oPC)
+ GetLevelByClass(CLASS_TYPE_WARBLADE, oPC)
+ GetLevelByClass(CLASS_TYPE_PALADIN, oPC)
+ GetLevelByClass(CLASS_TYPE_CRUSADER, oPC)
+ GetLevelByClass(CLASS_TYPE_SWORDSAGE, oPC)
+ GetLevelByClass(CLASS_TYPE_BLACKGUARD, oPC)
+ GetLevelByClass(CLASS_TYPE_BATTLERAGER, oPC)
+ GetLevelByClass(CLASS_TYPE_BATTLESMITH, oPC)
+ GetLevelByClass(CLASS_TYPE_COC, oPC)
+ GetLevelByClass(CLASS_TYPE_DISPATER, oPC)
+ GetLevelByClass(CLASS_TYPE_DIVINECHAMPION, oPC)
+ GetLevelByClass(CLASS_TYPE_DUELIST, oPC)
+ GetLevelByClass(CLASS_TYPE_DWARVENDEFENDER, oPC)
+ GetLevelByClass(CLASS_TYPE_ETERNAL_BLADE, oPC)
+ GetLevelByClass(CLASS_TYPE_FOE_HUNTER, oPC)
+ GetLevelByClass(CLASS_TYPE_GHOST_FACED_KILLER, oPC)
+ GetLevelByClass(CLASS_TYPE_HALFLING_WARSLINGER, oPC)
+ GetLevelByClass(CLASS_TYPE_HEXTOR, oPC)
+ GetLevelByClass(CLASS_TYPE_IAIJUTSU_MASTER, oPC)
+ GetLevelByClass(CLASS_TYPE_INCARNUM_BLADE, oPC)
+ GetLevelByClass(CLASS_TYPE_JUDICATOR, oPC)
+ GetLevelByClass(CLASS_TYPE_LASHER, oPC)
+ GetLevelByClass(CLASS_TYPE_LEGENDARY_DREADNOUGHT, oPC)
+ GetLevelByClass(CLASS_TYPE_MASTER_OF_NINE, oPC)
+ GetLevelByClass(CLASS_TYPE_ORC_WARLORD, oPC)
+ GetLevelByClass(CLASS_TYPE_PURPLE_DRAGON_KNIGHT, oPC)
+ GetLevelByClass(CLASS_TYPE_PYROKINETICIST, oPC)
+ GetLevelByClass(CLASS_TYPE_RAVAGER, oPC)
+ GetLevelByClass(CLASS_TYPE_REAPING_MAULER, oPC)
+ GetLevelByClass(CLASS_TYPE_SANCTIFIED_MIND, oPC)
+ GetLevelByClass(CLASS_TYPE_SERENE_GUARDIAN, oPC)
+ GetLevelByClass(CLASS_TYPE_SHINING_BLADE, oPC)
+ GetLevelByClass(CLASS_TYPE_SHOU, oPC)
+ GetLevelByClass(CLASS_TYPE_SPINEMELD_WARRIOR, oPC)
+ GetLevelByClass(CLASS_TYPE_TEMPEST, oPC)
+ GetLevelByClass(CLASS_TYPE_THAYAN_KNIGHT, oPC)
+ GetLevelByClass(CLASS_TYPE_WARCHIEF, oPC)
+ GetLevelByClass(CLASS_TYPE_WARFORGED_JUGGERNAUT, oPC)
+ GetLevelByClass(CLASS_TYPE_WARMIND, oPC)
+ GetLevelByClass(CLASS_TYPE_WEAPON_MASTER, oPC)
+ GetLevelByClass(CLASS_TYPE_PALADIN, oPC)
+ GetLevelByClass(CLASS_TYPE_WEREWOLF, oPC);
int nAmount = 15;
int nDuration = 30;
if ((GetLevelByClass(CLASS_TYPE_BARBARIAN, oPC) > 0))
{
nAmount = 35;
}
else if (iTier2 > 0)
{
nAmount = 30;
}
else if (iTier1 > 0)
{
nAmount = 25;
}
else
{
nAmount = 15;
}
effect eEffect1;
effect eEffect2;
effect eEffect3;
eEffect1 = EffectDamageResistance(DAMAGE_TYPE_BLUDGEONING, nAmount);
eEffect2 = EffectDamageResistance(DAMAGE_TYPE_PIERCING, nAmount);
eEffect3 = EffectDamageResistance(DAMAGE_TYPE_SLASHING, nAmount);
effect eDur = EffectVisualEffect(VFX_DUR_AURA_GREEN);
effect eLink = EffectLinkEffects(eEffect1, eDur);
eLink = EffectLinkEffects(eEffect2, eLink);
eLink = EffectLinkEffects(eEffect3, eLink);
if ( GetItemPossessedBy(oTarget, "potioncrystal7") != OBJECT_INVALID )
{
nDuration = nDuration +10;
}
// *** Fokus Token in action *** //
if (GetItemPossessedBy(oPC, "potioncrystal6")!= OBJECT_INVALID)
{
if (d100()<=25)
{
CreateItemOnObject("damageresist", oPC);
FloatingTextStringOnCreature("The Focus Stone emits a brief radiance as it restores your potion", oPC);
}
}
// *** End of focus Token *** //
float fTime = RoundsToSeconds(nDuration);
//After effects are removed we apply the immunity to mind spells to the target
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fTime);
}