generated from Jaysyn/ModuleTemplate
Initial Commit
Initial Commit.
This commit is contained in:
97
_module/nss/rogue_inc.nss
Normal file
97
_module/nss/rogue_inc.nss
Normal file
@@ -0,0 +1,97 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Rogue Equipment
|
||||
//:: ROGUE_INC.nss
|
||||
//:://////////////////////////////////////////////
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: 69_Jeremy_69
|
||||
//:: Created On: April 25, 2003
|
||||
//:://////////////////////////////////////////////
|
||||
#include "prc_class_const"
|
||||
|
||||
// Must use ExecuteScript to call, as items use TouchAttacks which
|
||||
// are called and are not actions, there for cannot be
|
||||
// assigned.
|
||||
void StrangleHold(object oRogue, object oVictim);
|
||||
/*
|
||||
The caller makes a attack role. If successfull
|
||||
choking starts, Target may make escape attempt with a
|
||||
reflex save. If the Target fails fails to break free
|
||||
they are rendered unconscious for 1d3 rounds.
|
||||
*/
|
||||
|
||||
void main()
|
||||
{
|
||||
object oTarget = GetLocalObject(OBJECT_SELF,"ROGUE_ITEM");
|
||||
|
||||
switch(GetLocalInt(OBJECT_SELF,"ROGUE_ITEM"))
|
||||
{
|
||||
case 1:
|
||||
StrangleHold(OBJECT_SELF,oTarget);
|
||||
break;
|
||||
}
|
||||
DeleteLocalInt(OBJECT_SELF,"ROGUE_ITEM");
|
||||
DeleteLocalObject(OBJECT_SELF,"ROGUE_ITEM");
|
||||
}
|
||||
|
||||
void StrangleHold(object oRogue, object oVictim)
|
||||
{
|
||||
// PC Messages
|
||||
string VICTIM = "You passed out from a strangle hold.";
|
||||
string ERROR1 = "Invalid Target.";
|
||||
string ERROR2 = "You are to far away.";
|
||||
string MISS = "You missed.";
|
||||
|
||||
// Make sure we have a creature
|
||||
if(GetObjectType(oVictim) != OBJECT_TYPE_CREATURE)
|
||||
{
|
||||
FloatingTextStringOnCreature(ERROR1, oRogue, FALSE);
|
||||
return;
|
||||
}
|
||||
// Make sure they are close enough to use the garrote
|
||||
if(GetDistanceBetween(oRogue, oVictim)>2.0f)
|
||||
{
|
||||
FloatingTextStringOnCreature(ERROR2, oRogue, FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
effect eHit = EffectStunned();
|
||||
eHit = EffectLinkEffects(eHit, EffectKnockdown());
|
||||
float fDuration = RoundsToSeconds(d6());
|
||||
// Give hidden creatures +4 bonus
|
||||
int nHide = 0;
|
||||
if (!GetObjectSeen(oRogue, oVictim)) nHide = 4;
|
||||
|
||||
int iRogue = GetLevelByClass(CLASS_TYPE_ROGUE, oRogue)
|
||||
+ GetLevelByClass(CLASS_TYPE_SCOUT, oRogue)
|
||||
+ GetLevelByClass(CLASS_TYPE_BEGUILER, oRogue)
|
||||
+ GetLevelByClass(CLASS_TYPE_NINJA, oRogue)
|
||||
+ GetLevelByClass(CLASS_TYPE_FACTOTUM, oRogue)
|
||||
+ GetLevelByClass(CLASS_TYPE_ASSASSIN, oRogue)
|
||||
+ GetLevelByClass(CLASS_TYPE_ARCTRICK, oRogue)
|
||||
+ GetLevelByClass(CLASS_TYPE_HANDOTWM, oRogue)
|
||||
+ GetLevelByClass(CLASS_TYPE_NIGHTSHADE, oRogue)
|
||||
+ GetLevelByClass(CLASS_TYPE_NINJA_SPY, oRogue)
|
||||
+ GetLevelByClass(CLASS_TYPE_SHADOWLORD, oRogue)
|
||||
+ GetLevelByClass(CLASS_TYPE_SHADOW_SUN_NINJA, oRogue)
|
||||
+ GetLevelByClass(CLASS_TYPE_SHADOW_THIEF_AMN, oRogue)
|
||||
+ GetLevelByClass(CLASS_TYPE_UNSEEN_SEER, oRogue)
|
||||
+ GetLevelByClass(CLASS_TYPE_PSYCHIC_ROGUE, oRogue);
|
||||
|
||||
int nDC = iRogue + GetAbilityModifier(ABILITY_STRENGTH, oRogue) + nHide + 10;
|
||||
/*
|
||||
//:: DC Example
|
||||
//:: Merry, Classes: Rogue(5) Fighter(1), Strength 9(-1),Hidden
|
||||
//:: 5 + (-1) + 2 + 10 = 14 DC
|
||||
//:: Gaarsh, Classes: Rogue(3), Strength 16(+2), NOT Hidden
|
||||
//:: 3 + (+2) + 0 + 10 = 15 DC
|
||||
*/
|
||||
|
||||
// Rogue attempts grab
|
||||
if(!ReflexSave(oVictim, nDC) && TouchAttackMelee(oVictim))
|
||||
{
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eHit, oVictim, fDuration);
|
||||
FloatingTextStringOnCreature(VICTIM, oVictim, FALSE);
|
||||
}else{
|
||||
FloatingTextStringOnCreature(MISS, oRogue, FALSE);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user