Try this:
effect eEffect;
int nInt;
location lTarget;
object oSpawn;
object oTarget;
/* Script generated by
Lilac Soul's NWN Script Generator, v. 2.3
For download info, please visit:
http://nwvault.ign.c...=4683&id=625テつ テつ テつ */
//Put this script OnEnter
void main()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
//Make sure it only fires at night
if (!GetIsNight())
return;
if (GetLocalInt(oPC,"ResetC")==1) { return;} // checks to see if player has triggered w/30 seconds
SetLocalInt(oPC,"ResetC",1); //Sets up the check
DelayCommand(30.0,SetLocalInt(oPC,"ResetC",0)); //Undoes the checking integer in 30 seconds
//First skill attempt to reveal the hole. This one using search
if (GetIsSkillSuccessful(oPC, SKILL_SEARCH, 18)) //set required roll skill + d20
{
oTarget = GetWaypointByTag("WP_HoleCementaryHalbrook");
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "holecementhalbro", lTarget);
oTarget = oSpawn;
nInt = GetObjectType(oTarget);
if (nInt != OBJECT_TYPE_WAYPOINT) DelayCommand(0.5,
ApplyEffectToObject(DURATION_TYPE_INSTANT,
EffectVisualEffect(VFX_IMP_DUST_EXPLOSION), oTarget));
else
DelayCommand(0.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT,
EffectVisualEffect(VFX_IMP_DUST_EXPLOSION), GetLocation(oTarget)));
DelayCommand(1.0, SendMessageToPC(oPC, "You found what appears to be a freshly dug hole leading down into a cave"));
oTarget = GetObjectByTag("tr_HoleCementaryHalbrook");
nInt = GetObjectType(oTarget);
eEffect = EffectVisualEffect(VFX_IMP_DUST_EXPLOSION);
if (nInt != OBJECT_TYPE_WAYPOINT)
DelayCommand(20.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oTarget));
else
DelayCommand(20.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eEffect, GetLocation(oTarget)));
DelayCommand(20.0, DestroyObject(oTarget, 3.0));
}
//Second skill attempte to reveal the hole. This one using spot
else if (GetIsSkillSuccessful(oPC, SKILL_SPOT, 18)) //set required roll skill + d20
{
oTarget = GetWaypointByTag("WP_HoleCementaryHalbrook");
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "holecementhalbro", lTarget);
oTarget = oSpawn;
nInt = GetObjectType(oTarget);
if (nInt != OBJECT_TYPE_WAYPOINT) DelayCommand(0.5,
ApplyEffectToObject(DURATION_TYPE_INSTANT,
EffectVisualEffect(VFX_IMP_DUST_EXPLOSION), oTarget));
else
DelayCommand(0.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT,
EffectVisualEffect(VFX_IMP_DUST_EXPLOSION), GetLocation(oTarget)));
DelayCommand(1.0, SendMessageToPC(oPC, "You found what appears to be a freshly dug hole leading down into a cave"));
oTarget = GetObjectByTag("tr_HoleCementaryHalbrook");
nInt = GetObjectType(oTarget);
eEffect = EffectVisualEffect(VFX_IMP_DUST_EXPLOSION);
if (nInt != OBJECT_TYPE_WAYPOINT)
DelayCommand(30.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oTarget));
else
DelayCommand(30.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eEffect, GetLocation(oTarget)));
DelayCommand(30.0, DestroyObject(oTarget, 3.0));
}
//If PC fails both skillrolls, he gets a message
else
{
SendMessageToPC(oPC, "You sense something is amiss here, but you are not quite able to spot what it is");
}
}
Modifiテδゥ par Redunct, 25 septembre 2010 - 10:16 .