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

109 lines
3.5 KiB
Plaintext

// Thief-boost item
// Purpose of script - to boost thieves damage and attack temporarily
// -Seeker-, 30 / 6 2005 for Alangara
// -Seeker-, 6 / 3 2010 for Alangara - added to hit bonus
#include "prc_class_const"
void main()
{
object oPC = GetItemActivator();
float duration = HoursToSeconds(24); // Alter duration here
int iRogue = GetLevelByClass(CLASS_TYPE_ROGUE, oPC)
+ GetLevelByClass(CLASS_TYPE_SCOUT, oPC)
+ GetLevelByClass(CLASS_TYPE_BEGUILER, oPC)
+ GetLevelByClass(CLASS_TYPE_NINJA, oPC)
+ GetLevelByClass(CLASS_TYPE_FACTOTUM, oPC)
+ GetLevelByClass(CLASS_TYPE_PSYCHIC_ROGUE, oPC);
int iRoguePrC = GetLevelByClass(CLASS_TYPE_ARCTRICK, oPC)
+ GetLevelByClass(CLASS_TYPE_ASSASSIN, oPC)
+ GetLevelByClass(CLASS_TYPE_BFZ, oPC)
+ GetLevelByClass(CLASS_TYPE_GHOST_FACED_KILLER, oPC)
+ GetLevelByClass(CLASS_TYPE_HANDOTWM, oPC)
+ GetLevelByClass(CLASS_TYPE_HARPER, oPC)
+ GetLevelByClass(CLASS_TYPE_NIGHTSHADE, oPC)
+ GetLevelByClass(CLASS_TYPE_NINJA_SPY, oPC)
+ GetLevelByClass(CLASS_TYPE_SHADOWDANCER, oPC)
+ GetLevelByClass(CLASS_TYPE_SHADOWLORD, oPC)
+ GetLevelByClass(CLASS_TYPE_SHADOW_SUN_NINJA, oPC)
+ GetLevelByClass(CLASS_TYPE_SHADOW_THIEF_AMN, oPC)
+ GetLevelByClass(CLASS_TYPE_SLAYER_OF_DOMIEL, oPC)
+ GetLevelByClass(CLASS_TYPE_UNSEEN_SEER, oPC);
if ( oPC != OBJECT_INVALID && GetIsPC( oPC ) )
{
// Check for rogue status
int rogue;
if ( iRogue > 0 )
{
// Get total of levels
rogue = iRogue;
rogue += iRoguePrC;
int dmgBoost = 0;
int attackBonus = 0;
if ( rogue < 41 )
{
dmgBoost = DAMAGE_BONUS_20;
attackBonus = 20;
}
if ( rogue < 31 )
{
dmgBoost = DAMAGE_BONUS_15;
attackBonus = 15;
}
if ( rogue < 21 )
{
dmgBoost = DAMAGE_BONUS_10;
attackBonus = 10;
}
if ( rogue < 11 )
{
dmgBoost = DAMAGE_BONUS_5;
attackBonus = 5;
}
// Create effects
effect eDmgBoost = EffectDamageIncrease( dmgBoost, DAMAGE_TYPE_MAGICAL );
effect eAttackIncrease = EffectAttackIncrease (attackBonus);
// Den version nedenunder goer at vaaben bonusser ikke taeller med.
// men har fusket selv som du kan se ovenfor og det virker.....
// hilsen tarashon, hehe
// effect eAttackIncrease = EffectAttackIncrease ( attackBonus, ATTACK_BONUS_ONHAND );
// Prohibit stacking
effect eLoop=GetFirstEffect(oPC);
while (GetIsEffectValid(eLoop))
{
if (GetEffectType(eLoop)==EFFECT_TYPE_DAMAGE_INCREASE && GetEffectDurationType( eLoop ) == DURATION_TYPE_TEMPORARY)
{
RemoveEffect(oPC, eLoop);
}
else if (GetEffectType(eLoop)== EFFECT_TYPE_ATTACK_INCREASE && GetEffectDurationType( eLoop ) == DURATION_TYPE_TEMPORARY)
{
RemoveEffect(oPC, eLoop);
}
eLoop=GetNextEffect(oPC);
}
// Apply effect to player
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDmgBoost, oPC, duration );
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eAttackIncrease, oPC, duration );
}
else
{
// Can only be used by a rogue
FloatingTextStringOnCreature( "This item can only be used by a rogue", oPC, FALSE );
}
}
else
{
// Do nothing
}
}