PoA_PRC8/_module/nss/godlipot.nss
Jaysyn904 7dd83ad168 Spell & Ability Upgrade
Reorganized hak files & removed duplicates.  Added @rafhot's PRC spell & ability level scaling expansion.  Further script integration.  Full compile.
2023-08-19 21:08:35 -04:00

326 lines
14 KiB
Plaintext

//Script Name: godlipot
//////////////////////////////////////////
// Created By: Genisys (Guile)
// Created On: 8/13/08
//
// (TABASED ITEM SCRIPT TEMPLATE)
/////////////////////////////////////////
/*
This potion temporarially bestows the
PC or DM with God Like Powers, they are
invincible and can kill any creature
rather quickly!
*/
////////////////////////////////////////
#include "x2_inc_switches"
#include "prc_inc_spells"
//Main Script
void main()
{
//All Major Variables Declared (Commonly used variables as well)
int nEvent = GetUserDefinedItemEventNumber(); //Which event triggered this
object oPC; //The player character using the item
object oItem; //The item being used
object oSpellOrigin; //The origin of the spell
object oSpellTarget; //The target of the spell
int iSpell; //The Spell ID number
object oTarget; //Define oTarget below
object oObject; //Define oObject below
int nInt; //A commonly used intergal (Must be defined)
int nLvl; //Commonly used intergal for levels (ie. GetHitDice(oTarget); etc.)
string sTag; //Used to define a tagname of something
string sResref; //Used to define a resref name of something
string sMsg; //Used to define a message
effect eEffect; //Used to define an effect to be applied to an object or location
effect eVis; //Used to define a visual effect to be applied to an object or location
location lTarget; //The Target Location of the PC ONLY! (USE - Getlocation(oPC);)
location lway; //The Target location for the Activated Item's Target only! (See below)
effect eGod;
effect eVis2;
int nDmg;
////////////////////////////////////////////////////////////////////////////////////////////////
//Set the return value for the item event script
// * X2_EXECUTE_SCRIPT_CONTINUE - continue calling script after executed script is done
// * X2_EXECUTE_SCRIPT_END - end calling script after executed script is done
int nResult = X2_EXECUTE_SCRIPT_END;
///////////////////////////////////////////////////////////////////////////////////////////////
//Deterimine which event has fired for the item...
switch (nEvent)
{
////////////////////////////////////////////////////////////////////////////
///////The Item has the property: On-Hit Cast Spell: Unique Power/////////
case X2_ITEM_EVENT_ONHITCAST:
// * This code runs when the item has the 'OnHitCastSpell: Unique power' property
// * and it hits a target(if it is a weapon) or is being hit (if it is a piece of armor)
// * Note that this event fires for non PC creatures as well.
oItem = PRCGetSpellCastItem(); // The item triggering this spellscript
oPC = OBJECT_SELF; // The player triggering it
oSpellOrigin = OBJECT_SELF ; // Where the spell came from
oSpellTarget = PRCGetSpellTargetObject(); // What the spell is aimed at
//Your code goes here
break;
///////////////////////////////////////////////////////////////////////////
/////////////Cast Spell: Unique Power /or/ Activate Item//////////////////
//I seperated this cause it's more commonly used..
case X2_ITEM_EVENT_ACTIVATE:
{
// * This code runs when the Unique Power property of the item is used
// * or the item is activated. Note that this event fires for PCs only.
oPC = GetItemActivator(); // The player who activated the item
oItem = GetItemActivated(); // The item that was activated
oTarget = GetItemActivatedTarget(); //The target of the item's power
lway = GetItemActivatedTargetLocation(); //To get the location of the target!
nLvl = GetHitDice(oPC);
//Determine how many bonus attacks / round they get..
if(nLvl<=10)
{
nInt = 4;
}
else if(nLvl>=11 && nLvl <=20)
{
nInt = 3;
}
else
{
nInt = 2;
}
//If it's a monk adjust the attacks down by 1..
if(GetLevelByClass(CLASS_TYPE_MONK,oPC)>=10)
{ nInt -=1; }
//Make it show that they are under the effects of godliness..
eVis = EffectVisualEffect(VFX_DUR_GHOSTLY_PULSE, FALSE);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oPC, 300.0f);
eVis = EffectVisualEffect(VFX_DUR_IOUNSTONE_YELLOW, FALSE);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oPC, 300.0f);
eVis = EffectVisualEffect(VFX_DUR_MAGIC_RESISTANCE, FALSE);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oPC, 300.0f);
//AB Bonus
eGod = EffectAttackIncrease(10, ATTACK_BONUS_MISC);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
//Make them invisible (They cannot be seen or dispelled!)
eGod = EffectInvisibility(INVISIBILITY_TYPE_IMPROVED);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
//Bonus Attacks (Based Upon Level)
eGod = EffectModifyAttacks(nInt);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
//AC Bonus
eGod = EffectACIncrease(20, AC_DODGE_BONUS, AC_VS_DAMAGE_TYPE_ALL);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
eGod = EffectACIncrease(20, AC_NATURAL_BONUS, AC_VS_DAMAGE_TYPE_ALL);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
eGod = EffectACIncrease(20, AC_DEFLECTION_BONUS, AC_VS_DAMAGE_TYPE_ALL);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
//Damage Increase
eGod = EffectDamageIncrease(DAMAGE_BONUS_2d12, DAMAGE_TYPE_MAGICAL);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
eGod = EffectDamageIncrease(DAMAGE_BONUS_2d12, DAMAGE_TYPE_DIVINE);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
eGod = EffectDamageIncrease(DAMAGE_BONUS_2d12, DAMAGE_TYPE_POSITIVE);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
eGod = EffectDamageIncrease(DAMAGE_BONUS_2d12, DAMAGE_TYPE_SONIC);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
//Resistance
eGod = EffectDamageResistance(DAMAGE_TYPE_ACID, 50, 0); //No Limit!
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
eGod = EffectDamageResistance(DAMAGE_TYPE_BLUDGEONING, 50, 0); //No Limit!
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
eGod = EffectDamageResistance(DAMAGE_TYPE_COLD, 50, 0); //No Limit!
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
eGod = EffectDamageResistance(DAMAGE_TYPE_DIVINE, 50, 0); //No Limit!
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
eGod = EffectDamageResistance(DAMAGE_TYPE_ELECTRICAL, 50, 0); //No Limit!
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
eGod = EffectDamageResistance(DAMAGE_TYPE_FIRE, 50, 0); //No Limit!
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
eGod = EffectDamageResistance(DAMAGE_TYPE_MAGICAL, 50, 0); //No Limit!
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
eGod = EffectDamageResistance(DAMAGE_TYPE_NEGATIVE, 50, 0); //No Limit!
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
eGod = EffectDamageResistance(DAMAGE_TYPE_PIERCING, 50, 0); //No Limit!
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
eGod = EffectDamageResistance(DAMAGE_TYPE_POSITIVE, 50, 0); //No Limit!
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
eGod = EffectDamageResistance(DAMAGE_TYPE_SLASHING, 50, 0); //No Limit!
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
eGod = EffectDamageResistance(DAMAGE_TYPE_SONIC, 50, 0); //No Limit!
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
//Damage Reduction
eGod = EffectDamageReduction(50, DAMAGE_POWER_PLUS_TWENTY, 0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
//Massive Regeneration!
eGod = EffectRegenerate(80, 3.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
//Massive Concealment
eGod = EffectConcealment(80, MISS_CHANCE_TYPE_NORMAL);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
//Pretty much immune to magic!
eGod = EffectSpellResistanceIncrease(77);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
//Give them a lot of hit points (temp)
eGod = EffectTemporaryHitpoints(888);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
//Haste
eGod = EffectHaste();
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
//True Seeing..
eGod = EffectTrueSeeing();
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
//Immunity to Misc.
eGod = EffectImmunity(IMMUNITY_TYPE_CRITICAL_HIT);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
eGod = EffectImmunity(IMMUNITY_TYPE_DEATH);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
eGod = EffectImmunity(IMMUNITY_TYPE_KNOCKDOWN);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
eGod = EffectImmunity(IMMUNITY_TYPE_MIND_SPELLS);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
eGod = EffectImmunity(IMMUNITY_TYPE_MOVEMENT_SPEED_DECREASE);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
eGod = EffectImmunity(IMMUNITY_TYPE_NEGATIVE_LEVEL);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
eGod = EffectImmunity(IMMUNITY_TYPE_PARALYSIS);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
eGod = EffectImmunity(IMMUNITY_TYPE_DISEASE);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
eGod = EffectImmunity(IMMUNITY_TYPE_FEAR);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
eGod = EffectImmunity(IMMUNITY_TYPE_POISON);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
eGod = EffectImmunity(IMMUNITY_TYPE_SLOW);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
eGod = EffectImmunity(IMMUNITY_TYPE_SAVING_THROW_DECREASE);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
eGod = EffectImmunity(IMMUNITY_TYPE_ATTACK_DECREASE);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
eGod = EffectImmunity(IMMUNITY_TYPE_AC_DECREASE);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
eGod = EffectImmunity(IMMUNITY_TYPE_ABILITY_DECREASE);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
eGod = EffectImmunity(IMMUNITY_TYPE_BLINDNESS);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
eGod = EffectImmunity(IMMUNITY_TYPE_DEAFNESS);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
//+10 to all saves..
eGod = EffectSavingThrowIncrease(SAVING_THROW_ALL, 10, SAVING_THROW_TYPE_ALL);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
//Powerful Damage Shield! 82 - 92 dmg per hit!
eGod = EffectDamageShield(80, DAMAGE_BONUS_2d12,DAMAGE_TYPE_DIVINE);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGod, oPC, 300.0f);
} break;
///////////////////////////////////////////////////////////////////////////
///////////When the User Equips this item////////////////////////////////
case X2_ITEM_EVENT_EQUIP:
// * This code runs when the item is equipped
// * Note that this event fires for PCs only
oPC = GetPCItemLastEquippedBy(); // The player who equipped the item
oItem = GetPCItemLastEquipped(); // The item that was equipped
//Your code goes here
break;
////////////////////////////////////////////////////////////////////////////
/////////////When the User Unequips this item//////////////////////////////
case X2_ITEM_EVENT_UNEQUIP:
// * This code runs when the item is unequipped
// * Note that this event fires for PCs only
oPC = GetPCItemLastUnequippedBy();// The player who unequipped the item
oItem = GetPCItemLastUnequipped(); // The item that was unequipped
//Your code goes here
break;
////////////////////////////////////////////////////////////////////////////
////////////Everytime ANYONE Acquires this item////////////////////////////
case X2_ITEM_EVENT_ACQUIRE:
// * This code runs when the item is acquired
// * Note that this event fires for PCs only
oPC = GetModuleItemAcquiredBy(); // The player who acquired the item
oItem = GetModuleItemAcquired(); // The item that was acquired
//Your code goes here
break;
////////////////////////////////////////////////////////////////////////////
//////////Everytime ANYONE Loses this item/////////////////////////////////
case X2_ITEM_EVENT_UNACQUIRE:
// * This code runs when the item is unacquired
// * Note that this event fires for PCs only
oPC = GetModuleItemLostBy(); // The player who dropped the item
oItem = GetModuleItemLost(); // The item that was dropped
//Your code goes here
break;
////////////////////////////////////////////////////////////////////////////
/////Everytime ANYONE Cast a spell at this item////////////////////////////
case X2_ITEM_EVENT_SPELLCAST_AT:
//* This code runs when a PC or DM casts a spell from one of the
//* standard spellbooks on the item
oPC = OBJECT_SELF; // The player who cast the spell
oItem = PRCGetSpellTargetObject();// The item targeted by the spell
iSpell = GetSpellId(); // The id of the spell that was cast
// See the list of SPELL_* constants
//Your code goes here
//Change the following line from X2_EXECUTE_SCRIPT_CONTINUE to
//X2_EXECUTE_SCRIPT_END if you want to prevent the spell that was
//cast on the item from taking effect
nResult = X2_EXECUTE_SCRIPT_CONTINUE;
break;
}
//Pass the return value back to the calling script
SetExecutedScriptReturnValue(nResult);
}