I have a few tweaks to do yet ... but my biggest ... head scratcher is ..
The effects, the sound and visual fire when the potion is drank, but does not fire when it wears off.
I have the spawning in of the sound object because I am assuming that the player will move after drinking the potion.
Once I get this finalized I intend on making an Enlarge potion as well.
Thanks in advance for the help script ninja's of ALFA.
/* Script generated by
Lilac Soul's NWN Script Generator, v. 2.3
For download info, please visit:
http://nwvault.ign.com/View.php?view=Ot ... 683&id=625 */
#include "nw_i0_2q4luskan"
void main()
{
object oPC;
object oTarget;
object oSpawn;
location lTarget;
oPC = GetItemActivator();
oTarget = oPC;
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "magicteleportino", lTarget);
//Visual effects can't be applied to waypoints, so if it is a WP
//the VFX will be applied to the WP's location instead
int nInt;
nInt = GetObjectType(oTarget);
if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_TORNADO), oTarget);
else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_TORNADO), GetLocation(oTarget));
oTarget = GetObjectByTag("MagicTeleportInOut");
SoundObjectSetPosition(oTarget, GetPosition(oPC));
SoundObjectPlay(oTarget);
SoundObjectSetVolume(oTarget, 25);
oTarget = oPC;
int iRace = GetRacialType(oPC);
if(iRace == RACIAL_TYPE_DWARF) SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_GNOME);
if(iRace == RACIAL_TYPE_ELF) SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_HALFLING);
if(iRace == RACIAL_TYPE_GNOME) SetCreatureAppearanceType(oPC, 1255);
if(iRace == RACIAL_TYPE_HALFELF) SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_GNOME);
if(iRace == RACIAL_TYPE_HALFLING) SetCreatureAppearanceType(oPC, 1255);
if(iRace == RACIAL_TYPE_HALFORC) SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_DWARF);
if(iRace == RACIAL_TYPE_HUMAN) SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_GNOME);
SetLocalString(oPC, "shrunk", "1");
AssignCommand(oPC, ActionSpeakString("*shrinks*"));
oTarget = GetObjectByTag("MagicTeleportInOut");
SoundObjectStop(oTarget);
DelayCommand(1.0, DestroyObject(oTarget, 0.0));
oTarget = oPC;
effect eEffect;
eEffect = EffectDazed();
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oTarget, 8.0f);
eEffect = EffectAbilityDecrease(ABILITY_STRENGTH, 2);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oTarget, 20.0f);
eEffect = EffectACIncrease(1);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oTarget, 23.0f);
lTarget = GetLocation(oTarget);
DelayCommand(23.0, CreateObjectVoid(OBJECT_TYPE_PLACEABLE, "magicteleportino", lTarget));
//Visual effects can't be applied to waypoints, so if it is a WP
//the VFX will be applied to the WP's location instead
nInt = GetObjectType(oTarget);
if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_TORNADO), oTarget);
else DelayCommand(24.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_TORNADO), GetLocation(oTarget)));
oTarget = GetObjectByTag("MagicTeleportInOut");
DelayCommand(24.0,SoundObjectSetPosition(oTarget, GetPosition(oPC)));
DelayCommand(24.0, SoundObjectPlay(oTarget));
SoundObjectSetVolume(oTarget, 25);
oTarget = oPC;
DelayCommand(24.0, SetLocalString(oPC, "shrunk", "0"));
if(iRace == RACIAL_TYPE_DWARF) DelayCommand(24.0, SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_DWARF));
if(iRace == RACIAL_TYPE_ELF) DelayCommand(24.0, SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_ELF));
if(iRace == RACIAL_TYPE_GNOME) DelayCommand(24.0, SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_GNOME));
if(iRace == RACIAL_TYPE_HALFELF) DelayCommand(24.0, SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_HALF_ELF));
if(iRace == RACIAL_TYPE_HALFLING) DelayCommand(24.0, SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_HALFLING));
if(iRace == RACIAL_TYPE_HALFORC) DelayCommand(24.0, SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_HALF_ORC));
if(iRace == RACIAL_TYPE_HUMAN) DelayCommand(24.0, SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_HUMAN));
DelayCommand(24.0, AssignCommand(oPC, ActionSpeakString("*returns to normal size*")));
oTarget = GetObjectByTag("MagicPortalInOut");
DelayCommand(24.0, SoundObjectStop(oTarget));
oTarget = GetObjectByTag("MagicTeleportInOut");
DelayCommand(25.0, DestroyObject(oTarget, 0.0));
oTarget = oPC;
eEffect = EffectDazed();
DelayCommand(24.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oTarget, 10.0f));
}
NWN1 script help
- Nalo Jade
- Githyanki
- Posts: 1407
- Joined: Thu Dec 23, 2004 1:27 pm
- Location: Paso Robles, CA (-8 GMT)
- Contact:
NWN1 script help
"The reasonable man adapts to fit the world. The unreasonable man adapts the world to suit him. Therefore all progress is achieved by the unreasonable." - unknown
removed self from forums, contact via E-mail. Adios.
removed self from forums, contact via E-mail. Adios.
nInt = GetObjectType(oTarget);
if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_TORNADO), oTarget);
else DelayCommand(24.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_TORNADO), GetLocation(oTarget)));
oTarget is oPC; hence, nInt will never be OBJECT_TyPE_WAYPOINT and VFX_IMP_TORNADO is fired immediately, instead of after 24 seconds.
if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_TORNADO), oTarget);
else DelayCommand(24.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_TORNADO), GetLocation(oTarget)));
oTarget is oPC; hence, nInt will never be OBJECT_TyPE_WAYPOINT and VFX_IMP_TORNADO is fired immediately, instead of after 24 seconds.
- Nalo Jade
- Githyanki
- Posts: 1407
- Joined: Thu Dec 23, 2004 1:27 pm
- Location: Paso Robles, CA (-8 GMT)
- Contact:
So I need to delay spawn a waypoint at the PC's location to get it to fire again?
Whats the "cleanest" way to get it to fire when I want?
I don't speak script ninja ... Me and Lilac, and ScarFaces Appearance reverter are friends ... but not like sleep over buddies.
Whats the "cleanest" way to get it to fire when I want?
I don't speak script ninja ... Me and Lilac, and ScarFaces Appearance reverter are friends ... but not like sleep over buddies.
"The reasonable man adapts to fit the world. The unreasonable man adapts the world to suit him. Therefore all progress is achieved by the unreasonable." - unknown
removed self from forums, contact via E-mail. Adios.
removed self from forums, contact via E-mail. Adios.
Replace those lines with
Code: Select all
DelayCommand(24.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_TORNADO), GetLocation(oTarget)));
- Nalo Jade
- Githyanki
- Posts: 1407
- Joined: Thu Dec 23, 2004 1:27 pm
- Location: Paso Robles, CA (-8 GMT)
- Contact:
Thanks Zelk ... I will test it ... in a week. I gotta get ready to go.
There will be a brief intermission of peace on the forums ... but I shall return
There will be a brief intermission of peace on the forums ... but I shall return

"The reasonable man adapts to fit the world. The unreasonable man adapts the world to suit him. Therefore all progress is achieved by the unreasonable." - unknown
removed self from forums, contact via E-mail. Adios.
removed self from forums, contact via E-mail. Adios.
- Nalo Jade
- Githyanki
- Posts: 1407
- Joined: Thu Dec 23, 2004 1:27 pm
- Location: Paso Robles, CA (-8 GMT)
- Contact:
Thank you Creslyn for walking me through this on IRC ...
this is what I have now ...
/* Script generated by
Lilac Soul's NWN Script Generator, v. 2.3
For download info, please visit:
http://nwvault.ign.com/View.php?view=Ot ... 683&id=625 */
#include "nw_i0_2q4luskan"
void main()
{
object oPC;
object oTarget;
object oSpawn;
location lTarget;
oPC = GetItemActivator();
oTarget = oPC;
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "magicteleportino", lTarget);
//Visual effects can't be applied to waypoints, so if it is a WP
//the VFX will be applied to the WP's location instead
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_TORNADO), GetLocation(oTarget));
oTarget = GetObjectByTag("MagicTeleportInOut");
SoundObjectSetPosition(oTarget, GetPosition(oPC));
SoundObjectPlay(oTarget);
SoundObjectSetVolume(oTarget, 25);
oTarget = oPC;
int iRace = GetRacialType(oPC);
if(iRace == RACIAL_TYPE_DWARF) SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_GNOME);
if(iRace == RACIAL_TYPE_ELF) SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_HALFLING);
if(iRace == RACIAL_TYPE_GNOME) SetCreatureAppearanceType(oPC, 1255);
if(iRace == RACIAL_TYPE_HALFELF) SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_GNOME);
if(iRace == RACIAL_TYPE_HALFLING) SetCreatureAppearanceType(oPC, 1255);
if(iRace == RACIAL_TYPE_HALFORC) SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_DWARF);
if(iRace == RACIAL_TYPE_HUMAN) SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_GNOME);
SetLocalString(oPC, "shrunk", "1");
AssignCommand(oPC, ActionSpeakString("*shrinks*"));
oTarget = GetObjectByTag("MagicTeleportInOut");
SoundObjectStop(oTarget);
DelayCommand(1.0, DestroyObject(oTarget, 0.0));
oTarget = oPC;
effect eEffect;
eEffect = EffectDazed();
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oTarget, 8.0f);
eEffect = EffectAbilityDecrease(ABILITY_STRENGTH, 2);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oTarget, 20.0f);
eEffect = EffectACIncrease(1);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oTarget, 23.0f);
lTarget = GetLocation(oTarget);
DelayCommand(23.0, CreateObjectVoid(OBJECT_TYPE_PLACEABLE, "magicteleportino", lTarget));
//Visual effects can't be applied to waypoints, so if it is a WP
//the VFX will be applied to the WP's location instead
DelayCommand(24.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_TORNADO), GetLocation(oTarget)));
DelayCommand(24.0,SoundObjectSetPosition(oTarget, GetPosition(oPC)));
DelayCommand(24.0, SoundObjectPlay(oTarget));
SoundObjectSetVolume(oTarget, 25);
oTarget = oPC;
DelayCommand(24.0, SetLocalString(oPC, "shrunk", "0"));
if(iRace == RACIAL_TYPE_DWARF) DelayCommand(24.0, SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_DWARF));
if(iRace == RACIAL_TYPE_ELF) DelayCommand(24.0, SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_ELF));
if(iRace == RACIAL_TYPE_GNOME) DelayCommand(24.0, SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_GNOME));
if(iRace == RACIAL_TYPE_HALFELF) DelayCommand(24.0, SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_HALF_ELF));
if(iRace == RACIAL_TYPE_HALFLING) DelayCommand(24.0, SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_HALFLING));
if(iRace == RACIAL_TYPE_HALFORC) DelayCommand(24.0, SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_HALF_ORC));
if(iRace == RACIAL_TYPE_HUMAN) DelayCommand(24.0, SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_HUMAN));
DelayCommand(24.0, AssignCommand(oPC, ActionSpeakString("*returns to normal size*")));
oTarget = GetObjectByTag("MagicPortalInOut");
DelayCommand(24.0, SoundObjectStop(oTarget));
oTarget = GetObjectByTag("MagicTeleportInOut");
DelayCommand(25.0, DestroyObject(oTarget, 0.0));
oTarget = oPC;
eEffect = EffectDazed();
DelayCommand(24.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oTarget, 10.0f));
}
this is what I have now ...
/* Script generated by
Lilac Soul's NWN Script Generator, v. 2.3
For download info, please visit:
http://nwvault.ign.com/View.php?view=Ot ... 683&id=625 */
#include "nw_i0_2q4luskan"
void main()
{
object oPC;
object oTarget;
object oSpawn;
location lTarget;
oPC = GetItemActivator();
oTarget = oPC;
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "magicteleportino", lTarget);
//Visual effects can't be applied to waypoints, so if it is a WP
//the VFX will be applied to the WP's location instead
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_TORNADO), GetLocation(oTarget));
oTarget = GetObjectByTag("MagicTeleportInOut");
SoundObjectSetPosition(oTarget, GetPosition(oPC));
SoundObjectPlay(oTarget);
SoundObjectSetVolume(oTarget, 25);
oTarget = oPC;
int iRace = GetRacialType(oPC);
if(iRace == RACIAL_TYPE_DWARF) SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_GNOME);
if(iRace == RACIAL_TYPE_ELF) SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_HALFLING);
if(iRace == RACIAL_TYPE_GNOME) SetCreatureAppearanceType(oPC, 1255);
if(iRace == RACIAL_TYPE_HALFELF) SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_GNOME);
if(iRace == RACIAL_TYPE_HALFLING) SetCreatureAppearanceType(oPC, 1255);
if(iRace == RACIAL_TYPE_HALFORC) SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_DWARF);
if(iRace == RACIAL_TYPE_HUMAN) SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_GNOME);
SetLocalString(oPC, "shrunk", "1");
AssignCommand(oPC, ActionSpeakString("*shrinks*"));
oTarget = GetObjectByTag("MagicTeleportInOut");
SoundObjectStop(oTarget);
DelayCommand(1.0, DestroyObject(oTarget, 0.0));
oTarget = oPC;
effect eEffect;
eEffect = EffectDazed();
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oTarget, 8.0f);
eEffect = EffectAbilityDecrease(ABILITY_STRENGTH, 2);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oTarget, 20.0f);
eEffect = EffectACIncrease(1);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oTarget, 23.0f);
lTarget = GetLocation(oTarget);
DelayCommand(23.0, CreateObjectVoid(OBJECT_TYPE_PLACEABLE, "magicteleportino", lTarget));
//Visual effects can't be applied to waypoints, so if it is a WP
//the VFX will be applied to the WP's location instead
DelayCommand(24.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_TORNADO), GetLocation(oTarget)));
DelayCommand(24.0,SoundObjectSetPosition(oTarget, GetPosition(oPC)));
DelayCommand(24.0, SoundObjectPlay(oTarget));
SoundObjectSetVolume(oTarget, 25);
oTarget = oPC;
DelayCommand(24.0, SetLocalString(oPC, "shrunk", "0"));
if(iRace == RACIAL_TYPE_DWARF) DelayCommand(24.0, SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_DWARF));
if(iRace == RACIAL_TYPE_ELF) DelayCommand(24.0, SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_ELF));
if(iRace == RACIAL_TYPE_GNOME) DelayCommand(24.0, SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_GNOME));
if(iRace == RACIAL_TYPE_HALFELF) DelayCommand(24.0, SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_HALF_ELF));
if(iRace == RACIAL_TYPE_HALFLING) DelayCommand(24.0, SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_HALFLING));
if(iRace == RACIAL_TYPE_HALFORC) DelayCommand(24.0, SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_HALF_ORC));
if(iRace == RACIAL_TYPE_HUMAN) DelayCommand(24.0, SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_HUMAN));
DelayCommand(24.0, AssignCommand(oPC, ActionSpeakString("*returns to normal size*")));
oTarget = GetObjectByTag("MagicPortalInOut");
DelayCommand(24.0, SoundObjectStop(oTarget));
oTarget = GetObjectByTag("MagicTeleportInOut");
DelayCommand(25.0, DestroyObject(oTarget, 0.0));
oTarget = oPC;
eEffect = EffectDazed();
DelayCommand(24.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oTarget, 10.0f));
}
"The reasonable man adapts to fit the world. The unreasonable man adapts the world to suit him. Therefore all progress is achieved by the unreasonable." - unknown
removed self from forums, contact via E-mail. Adios.
removed self from forums, contact via E-mail. Adios.
Right, with that problem with the sound object selection (between first and second) simplest way to handle it is probably to just write up what you need as a function and run it twice (delayed second time) in the main script. Here's one that should work, but as I don't have nwn1 installed and nwn2 editor changed some functions, be a good idea to have zelk or someone go over it for compatibility issues.
Code: Select all
/*
1. apply vfx at target location
2. play sound at target location
3. change appearance type
4. apply ac boost, str decrease, daze
5. speakstring
6. set variable
*/
void ShrinkingPotion(object oTarget);
void ShrinkingPotion(object oTarget)
{
location lTarget = GetLocation(oTarget);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_TORNADO), lTarget);
object oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "magicteleportino", lTarget);
SoundObjectSetPosition(oSpawn, GetPosition(oTarget));
SoundObjectPlay(oSpawn);
SoundObjectSetVolume(oSpawn, 25);
DelayCommand(1.0, DestroyObject(oSpawn));
int iRace = GetRacialType(oTarget);
int nState = GetLocalInt(oTarget, "shrunk");
effect eDaze = EffectDazed();
if(nState != TRUE)
{
SetLocalInt(oTarget, "shrunk", TRUE);
AssignCommand(oTarget, ActionSpeakString("*shrinks*"));
if(iRace == RACIAL_TYPE_DWARF) SetCreatureAppearanceType(oTarget, APPEARANCE_TYPE_GNOME);
if(iRace == RACIAL_TYPE_ELF) SetCreatureAppearanceType(oTarget, APPEARANCE_TYPE_HALFLING);
if(iRace == RACIAL_TYPE_GNOME) SetCreatureAppearanceType(oTarget, 1255);
if(iRace == RACIAL_TYPE_HALFELF) SetCreatureAppearanceType(oTarget, APPEARANCE_TYPE_GNOME);
if(iRace == RACIAL_TYPE_HALFLING) SetCreatureAppearanceType(oTarget, 1255);
if(iRace == RACIAL_TYPE_HALFORC) SetCreatureAppearanceType(oTarget, APPEARANCE_TYPE_DWARF);
if(iRace == RACIAL_TYPE_HUMAN) SetCreatureAppearanceType(oTarget, APPEARANCE_TYPE_GNOME);
effect eAC = EffectACIncrease(1);
effect eStr = EffectAbilityDecrease(ABILITY_STRENGTH, 2);
effect eLink = EffectLinkEffects(eAC, eStr);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, 24.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDaze, oTarget, 8.0);
}
else
{
SetLocalInt(oTarget, "shrunk", FALSE);
AssignCommand(oTarget, ActionSpeakString("*returns to normal size*"));
if(iRace == RACIAL_TYPE_DWARF) SetCreatureAppearanceType(oTarget, APPEARANCE_TYPE_DWARF);
if(iRace == RACIAL_TYPE_ELF) SetCreatureAppearanceType(oTarget, APPEARANCE_TYPE_ELF);
if(iRace == RACIAL_TYPE_GNOME) SetCreatureAppearanceType(oTarget, APPEARANCE_TYPE_GNOME);
if(iRace == RACIAL_TYPE_HALFELF) SetCreatureAppearanceType(oTarget, APPEARANCE_TYPE_HALF_ELF);
if(iRace == RACIAL_TYPE_HALFLING) SetCreatureAppearanceType(oTarget, APPEARANCE_TYPE_HALFLING);
if(iRace == RACIAL_TYPE_HALFORC) SetCreatureAppearanceType(oTarget, APPEARANCE_TYPE_HALF_ORC);
if(iRace == RACIAL_TYPE_HUMAN) SetCreatureAppearanceType(oTarget, APPEARANCE_TYPE_HUMAN);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDaze, oTarget, 10.0);
}
}
void main()
{
object oPC = GetItemActivator();
ShrinkingPotion(oPC);
DelayCommand(24.0, ShrinkingPotion(oPC));
}
- Nalo Jade
- Githyanki
- Posts: 1407
- Joined: Thu Dec 23, 2004 1:27 pm
- Location: Paso Robles, CA (-8 GMT)
- Contact:
So the script for a potion made by a 3rd level caster is ....Reduce Person
Transmutation
Level: Sor/Wiz 1 Components: V, S, M Casting Time: 1 round Range: Close (25 ft. + 5 ft./2 levels) Target: One humanoid creature Duration: 1 min./level (D) Saving Throw: Fortitude negates Spell Resistance: Yes
This spell causes instant diminution of a humanoid creature, halving its height, length, and width and dividing its weight by 8. This decrease changes the creature’s size category to the next smaller one. The target gains a +2 size bonus to Dexterity, a –2 size penalty to Strength (to a minimum of 1), and a +1 bonus on attack rolls and AC due to its reduced size.
A Small humanoid creature whose size decreases to Tiny has a space of 2-1/2 feet and a natural reach of 0 feet (meaning that it must enter an opponent’s square to attack). A Large humanoid creature whose size decreases to Medium has a space of 5 feet and a natural reach of 5 feet. This spell doesn’t change the target’s speed.
All equipment worn or carried by a creature is similarly reduced by the spell.
Melee and projectile weapons deal less damage. Other magical properties are not affected by this spell. Any reduced item that leaves the reduced creature’s possession (including a projectile or thrown weapon) instantly returns to its normal size. This means that thrown weapons deal their normal damage (projectiles deal damage based on the size of the weapon that fired them).
Multiple magical effects that reduce size do not stack.
Reduce person counters and dispels enlarge person.
Reduce person can be made permanent with a permanency spell.
Material Component: A pinch of powdered iron.
Code: Select all
/* Script generated by
Lilac Soul's NWN Script Generator, v. 2.3
For download info, please visit:
http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */
#include "nw_i0_2q4luskan"
/*
1. apply vfx at target location
2. play sound at target location
3. change appearance type
4. apply ac boost, str decrease, daze
5. speakstring
6. set variable
*/
////Special thanks to Creslyn for fixing it up!/////
////Appearance type 1255 is for Brownie appearance////
///Encumberance may be an issue! PnP rules dictate that the equipment shrinks///
///along with the target thus reducing its weight relative to the new size &///
///Strength ... I was unwilling to look into solving this and as a compromise ///
///did not reduce the damage of weapons for being smaller...feel free to edit///
/// to suit your needs, but make sure Creslyn gets credit...///
void ShrinkingPotion(object oTarget);
void ShrinkingPotion(object oTarget)
{
location lTarget = GetLocation(oTarget);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_TORNADO), lTarget);
object oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "magicteleportino", lTarget);
SoundObjectSetPosition(oSpawn, GetPosition(oTarget));
SoundObjectPlay(oSpawn);
SoundObjectSetVolume(oSpawn, 25);
DelayCommand(1.0, DestroyObject(oSpawn));
int iRace = GetRacialType(oTarget);
int nState = GetLocalInt(oTarget, "shrunk");
effect eDaze = EffectDazed();
if(nState != TRUE)
{
SetLocalInt(oTarget, "shrunk", TRUE);
AssignCommand(oTarget, ActionSpeakString("*shrinks*"));
if(iRace == RACIAL_TYPE_DWARF) SetCreatureAppearanceType(oTarget, APPEARANCE_TYPE_GNOME);
if(iRace == RACIAL_TYPE_ELF) SetCreatureAppearanceType(oTarget, APPEARANCE_TYPE_HALFLING);
if(iRace == RACIAL_TYPE_GNOME) SetCreatureAppearanceType(oTarget, 1255);
if(iRace == RACIAL_TYPE_HALFELF) SetCreatureAppearanceType(oTarget, APPEARANCE_TYPE_GNOME);
if(iRace == RACIAL_TYPE_HALFLING) SetCreatureAppearanceType(oTarget, 1255);
if(iRace == RACIAL_TYPE_HALFORC) SetCreatureAppearanceType(oTarget, APPEARANCE_TYPE_DWARF);
if(iRace == RACIAL_TYPE_HUMAN) SetCreatureAppearanceType(oTarget, APPEARANCE_TYPE_GNOME);
effect eAC = EffectACIncrease(1);
effect eStr = EffectAbilityDecrease(ABILITY_STRENGTH, 2);
effect eDex = EffectAbilityIncrease(ABILITY_DEXTERITY, 2);
effect eLink = EffectLinkEffects(eAC, eStr, eDex);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, 240.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDaze, oTarget, 8.0);
}
else
{
SetLocalInt(oTarget, "shrunk", FALSE);
AssignCommand(oTarget, ActionSpeakString("*returns to normal size*"));
if(iRace == RACIAL_TYPE_DWARF) SetCreatureAppearanceType(oTarget, APPEARANCE_TYPE_DWARF);
if(iRace == RACIAL_TYPE_ELF) SetCreatureAppearanceType(oTarget, APPEARANCE_TYPE_ELF);
if(iRace == RACIAL_TYPE_GNOME) SetCreatureAppearanceType(oTarget, APPEARANCE_TYPE_GNOME);
if(iRace == RACIAL_TYPE_HALFELF) SetCreatureAppearanceType(oTarget, APPEARANCE_TYPE_HALF_ELF);
if(iRace == RACIAL_TYPE_HALFLING) SetCreatureAppearanceType(oTarget, APPEARANCE_TYPE_HALFLING);
if(iRace == RACIAL_TYPE_HALFORC) SetCreatureAppearanceType(oTarget, APPEARANCE_TYPE_HALF_ORC);
if(iRace == RACIAL_TYPE_HUMAN) SetCreatureAppearanceType(oTarget, APPEARANCE_TYPE_HUMAN);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDaze, oTarget, 10.0);
}
}
void main()
{
object oPC = GetItemActivator();
ShrinkingPotion(oPC);
DelayCommand(240.0, ShrinkingPotion(oPC));
}
"The reasonable man adapts to fit the world. The unreasonable man adapts the world to suit him. Therefore all progress is achieved by the unreasonable." - unknown
removed self from forums, contact via E-mail. Adios.
removed self from forums, contact via E-mail. Adios.