Without Further ado, I present: Relentless
NWScript:
void main()
{
int nUser = GetUserDefinedEventNumber();
object oPC =GetLastHostileActor();
string sTorchTag = "NW_IT_TORCH001";
location lSource = GetLocation(OBJECT_SELF);
object ome=OBJECT_SELF;
int knee;
int iKnockdown = 25;
int iLightMe = 2;
if(nUser == 1001)
{
}
else if(nUser == 1002)
{
}
else if(nUser == 1003)
{
}
else if(nUser == 1004)
{
}
else if(nUser == 1005)
{
if ((GetLocalInt(OBJECT_SELF,"knee")==1) && (GetDistanceToObject(oPC)<7.0) &&
(GetTag(GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oPC)) == sTorchTag ||
GetTag(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oPC)) == sTorchTag ))
{
AssignCommand(oPC,ClearAllActions());
AssignCommand(oPC,ActionMoveToLocation(lSource,TRUE));
AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW,0.5,2.0));
AssignCommand(oPC,ActionDoCommand(AssignCommand(CreateObject(OBJECT_TYPE_PLACEABLE,"flamelarge001", lSource), PlaySound("al_cv_firebowl1"))));
AssignCommand(oPC,ActionDoCommand(DelayCommand(1.0,ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_IMP_FLAME_M),lSource,5.0))));
AssignCommand(oPC,ActionDoCommand(DelayCommand(2.0,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDeath(TRUE),ome))));
}
}
else if(nUser == 1006)
{
if ((GetCurrentHitPoints()<=iKnockdown) && (GetLocalInt(OBJECT_SELF,"knee")==0))
{
ClearAllActions();
SetLocalInt(OBJECT_SELF,"knee",1);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectDamageResistance(DAMAGE_TYPE_BLUDGEONING,10),OBJECT_SELF,30.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectDamageResistance(DAMAGE_TYPE_COLD,10),OBJECT_SELF,30.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectDamageResistance(DAMAGE_TYPE_ELECTRICAL,10),OBJECT_SELF,30.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectDamageResistance(DAMAGE_TYPE_MAGICAL,10),OBJECT_SELF,30.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectDamageResistance(DAMAGE_TYPE_PIERCING, 10),OBJECT_SELF,30.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectDamageResistance(DAMAGE_TYPE_SLASHING, 10),OBJECT_SELF,30.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectDamageResistance(DAMAGE_TYPE_SONIC, 10),OBJECT_SELF,30.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectKnockdown(),OBJECT_SELF,30.0);
DelayCommand(30.0,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints()-GetCurrentHitPoints()),OBJECT_SELF,30.0));
DelayCommand(28.0,SetLocalInt(OBJECT_SELF,"knee",0));
}
if ((GetLocalInt(OBJECT_SELF,"knee")==1) && (GetDamageDealtByType(DAMAGE_TYPE_FIRE)>=iLightMe))
{
DelayCommand(0.5,AssignCommand(CreateObject(OBJECT_TYPE_PLACEABLE,"flamelarge001", lSource, TRUE), ApplyEffectToObject(DURATION_TYPE_INSTANT,
EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD), OBJECT_SELF)));
AssignCommand(oPC,ClearAllActions());
AssignCommand(oPC,ActionDoCommand(DelayCommand(1.5,ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_IMP_FLAME_M),lSource,5.0))));
AssignCommand(oPC,DelayCommand(2.5,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDeath(TRUE),ome)));
}
}
else if(nUser == 1007)
{
}
else if(nUser == 1008)
{
}
}
Easily modifiable to turn any creature into an almost unstoppable foe. After
the creature takes so much damage it falls down. There it waits and if it is
not finished off within the alloted time, it will rise again to continue the
attack. The only sure way to silence the monster is to burn it. Put it to
the torch or do enough fire damage so it catches fire. Modify the the
resistances and you can have a water elemental that can dispatched only by
freezing it with Cold, or a vampire that must be Staked through the heart.
Let me know if you use it or if you find any modifications that help the
code. This is my first published code, and it was a great learning
experience, have fun!
--Alt
|