PDA

View Full Version : K1 Napalm Grenade Script!


e-varmint
07-17-2007, 04:59 PM
Here is a script that changes Thermal Detonators into Napalm Grenades (and some force power scripts I added added as edits). I created it by modifying the k_sup_grenade script that comes with the game. It has a 12' radius, and causes indescriminate damage, so don't stand too close to your target!!! Take Heed: The enemy's Thermal Detonators will also do this, and you can easily wipe out your own party by using one of these in an enclosed space!!!

The easiest way to use it:
Compile the script (call it nukem, for this example),
Put it in the Override directory
Find line 89 (ITEM_ABILITY_GRENADE_THERMAL_DETONATOR) in spells.2DA. Change the entry in the impactscript column to nukem, save the change, put spells.2da in Override if it is not already there.

Thermal Detonators are now MUCH MORE FUN!!!. When you get bored with it, just change Line 89 back to k_sup_grenade.

The hard way: Make your own custom grenade that uses this script. I'm not competent to describe that process.


#include "k_inc_debug"
#include "k_inc_force"

//Get the DC for the grenade based on the targets feats.
int GR_GetGrenadeDC(object oTarget);

void main()
{
int nSpell = GetSpellId();
int nDamage;
int nDC;
int nDCCheck;
object oTarget;
int nVFX;
int nFeat = GetHasFeat(FEAT_WEAPON_SPECIALIZATION_GRENADE);
int nUnc1 = GetHasFeat(FEAT_UNCANNY_DODGE_1);
int nUnc2 = GetHasFeat(FEAT_UNCANNY_DODGE_2);

if(nFeat == TRUE)
{
nFeat = 6;
}
///Thermal Detonator
{
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(1044),GetSpellTargetLocation()) ;
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(3007),GetSpellTargetLocation()) ;

nVFX = 3005;
nDamage = 90 + nFeat;
nDC = 15;
effect ePush = EffectForcePushTargeted(GetSpellTargetLocation());
effect eFlame = EffectVisualEffect(VFX_IMP_FLAME);

oTarget = GetFirstObjectInShape(SHAPE_SPHERE, 12.0, GetSpellTargetLocation());
while(GetIsObjectValid(oTarget))
{
ApplyEffectToObject(DURATION_TYPE_INSTANT, ePush, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(nDamage, DAMAGE_TYPE_BLASTER), oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eFlame, oTarget);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectStunned(), oTarget, 20.0f);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectAttackDecrease(3), oTarget, 8.0f);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectForceResistanceDecrease(5), oTarget, 20.0f);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(4003), oTarget);

oTarget = GetNextObjectInShape(SHAPE_SPHERE, 12.0, GetSpellTargetLocation());
}
}

ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(nVFX),GetSpellTargetLocation()) ;
}

//Get the DC for the grenade based on the targets feats.
int GR_GetGrenadeDC(object oTarget)
{
int nUnc1 = GetHasFeat(FEAT_UNCANNY_DODGE_1, oTarget);
int nUnc2 = GetHasFeat(FEAT_UNCANNY_DODGE_2, oTarget);
int nDC = 0;
if(nUnc1 == TRUE)
{
nDC += 2;
if(nUnc2 == TRUE)
{
nDC += 2;
}
}
return nDC;
}

tk102
07-17-2007, 05:05 PM
Hi,

I'm moving this to Holowan Laboratories since this is more instruction on how to make a napalm grenade mod rather than the mod itself.

e-varmint
07-17-2007, 05:14 PM
Hi,

I'm moving this to Holowan Laboratories since this is more instruction on how to make a napalm grenade mod rather than the mod itself.

Thanks!!! And thanks for showing me the CODE function.

This probably belongs here also:

From another thread:

Force Burn is a custom power that I put together. It projects flame and lightning, knocks the target down, sets it on fire, and stuns it for 20 seconds. Here is the script:

#include "k_inc_force"
void main()
{
SWFP_DAMAGE_TYPE = DAMAGE_TYPE_FIRE;

object oCaster = OBJECT_SELF;
object oTarget = GetSpellTargetObject();

SWFP_DAMAGE = 30;

effect eBeam = EffectBeam(2053, oCaster, BODY_NODE_HAND_LEFT);
effect eBeam1 = EffectBeam(2066, OBJECT_SELF, BODY_NODE_HAND_LEFT);
effect eVFX = EffectVisualEffect(3013);

effect eDamage = EffectDamage(SWFP_DAMAGE, SWFP_DAMAGE_TYPE);
effect ePush = EffectForcePushTargeted(GetSpellTargetLocation());
effect eFlame = EffectVisualEffect(VFX_IMP_FLAME);


ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(3007),GetSpellTargetLocation()) ;
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, ePush, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eFlame, oTarget);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectStunned(), oTarget, 20.0f);


ApplyEffectToObject(1, eBeam, oTarget, 1.5f);
ApplyEffectToObject(1, eBeam1, oTarget, 1.5f);

ApplyEffectToObject(1, eVFX, oTarget, 1.5f);

}

Edit: While I'm at it, I might as well add this force power script. It damages the target, then spawns vandar at the target location. You can replace "n_yoda" with the creature of your choice, which you have designated as "Friendly 1" in the creature's .utc file.


#include "k_inc_force"
void main()
{

SWFP_DAMAGE_TYPE = DAMAGE_TYPE_FIRE;

object oCaster = OBJECT_SELF;
object oTarget = GetSpellTargetObject();

SWFP_DAMAGE = 30;

effect eVFX = EffectVisualEffect(3013);

effect eDamage = EffectDamage(SWFP_DAMAGE, SWFP_DAMAGE_TYPE);


ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(3005),GetSpellTargetLocation()) ;
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectAttackDecrease(3), oTarget, 20.0f);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectForceResistanceDecrease(5), oTarget, 20.0f);
CreateObject( OBJECT_TYPE_CREATURE,
"n_yoda", GetLocation(GetSpellTargetObject()));


ApplyEffectToObject(1, eVFX, oTarget, 1.5f);

DelayCommand(60.0, ExecuteScript("Zappit1", OBJECT_SELF));


}


Zappit1 makes vandar dissappear. The previous script delays this action for 60 seconds.


void main()
{

DestroyObject( GetObjectByTag("n_yoda"));

}


To spawn multiple objects of the same type, you will need to create separate .utc files for each one for the DestroyObject to work correctly:


#include "k_inc_force"
void main()
{

SWFP_DAMAGE_TYPE = DAMAGE_TYPE_FIRE;

object oCaster = OBJECT_SELF;
object oTarget = GetSpellTargetObject();

SWFP_DAMAGE = 30;

effect eVFX = EffectVisualEffect(3013);

effect eDamage = EffectDamage(SWFP_DAMAGE, SWFP_DAMAGE_TYPE);


ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(3005),GetSpellTargetLocation()) ;
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectAttackDecrease(3), oTarget, 20.0f);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectForceResistanceDecrease(5), oTarget, 20.0f);
CreateObject( OBJECT_TYPE_CREATURE,
"n_RGHOUL39", GetLocation(GetSpellTargetObject()));
CreateObject( OBJECT_TYPE_CREATURE,
"n_RGHOUL40", GetLocation(GetSpellTargetObject()));
CreateObject( OBJECT_TYPE_CREATURE,
"n_RGHOUL41", GetLocation(GetSpellTargetObject()));


ApplyEffectToObject(1, eVFX, oTarget, 1.5f);

DelayCommand(60.0, ExecuteScript("Zappit2", OBJECT_SELF));


}


Zappit2:

void main()
{

DestroyObject( GetObjectByTag("n_RGHOUL39"));
DestroyObject( GetObjectByTag("n_RGHOUL40"));
DestroyObject( GetObjectByTag("n_RGHOUL41"));

}

I like making all the rakghouls "insane". It adds a certain risk/reward to the spell, since they are likely to come after you instead of your target. I would also advise making this a long-range spell when you do your spells.2da editing.

If you want a real laugh, make a script that will spawn about 7 insane gizkas (make them Level 20) and a couple of Vandars with a "very fast" movement rate. Disable the execution of the zappit script.