Files
HeroesStone_PRC8/_module/nss/playharp.nss
Jaysyn904 1eefc84201 Initial Commit
Initial Commit.
2025-09-14 15:40:46 -04:00

139 lines
3.8 KiB
Plaintext

//::///////////////////////////////////////////////
//:: ZEP_ONOFF.nss
//:: Copyright (c) 2001 Bioware Corp.
//:: Modified by Dan Heidel 1/14/04 for CEP
//:://////////////////////////////////////////////
/*
Turns the placeable object's animation on/off
Since the activation state for a placeable cannot
be querried, this state must be stored in the
local int CEP_L_AMION. If the placeable is
activated by default, CEP_L_AMION must be 1. If the
placeable is deactivated by default, CEP_L_AMION must
be set to 0 or else incorrect behavior will result.
All CEP placeables have local variables set properly.
Also, for musical instruments, etc, sounds will be
played if specified.
CEP_L_SOUND1 is the name of the WAV file to play
when the placeable is activated.
CEP_L_SOUND2 is the name of the WAV file to play
when the placeable is deactivated.
If either of these is not defined, no sound will
be played for that anim.
By default, all CEP placeables that have sounds
attached to them already have local variables
defined for them.
*/
//:://////////////////////////////////////////////
//:: Created By: Brent
//:: Created On: January 2002
//:://////////////////////////////////////////////
#include "prc_class_const"
#include "nw_i0_2q4luskan"
void main()
{
object oPC = GetLastUsedBy();
if (!GetIsPC(oPC)) return;
AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_TALK_PLEADING, 1.0f, 3.0f));
string sSound1 = GetLocalString(OBJECT_SELF, "CEP_L_SOUND1");
string sSound2 = GetLocalString(OBJECT_SELF, "CEP_L_SOUND2");
if (GetLocalInt(OBJECT_SELF,"CEP_L_AMION") == 0)
{
object oSelf = OBJECT_SELF;
PlaySound(sSound1);
DelayCommand(0.1, PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE));
SetLocalInt(OBJECT_SELF,"CEP_L_AMION",1);
}
else
{
object oSelf = OBJECT_SELF;
PlaySound(sSound2);
DelayCommand(0.1, PlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
SetLocalInt(OBJECT_SELF,"CEP_L_AMION",0);
string sDeny; }
string sDeny;
/* Script generated by
Lilac Soul's NWN Script Generator, v. 1.6
For download info, please visit:
http://www.lilacsoul.revility.com */
//Put this OnUsed
{
object oPC = GetLastUsedBy();
if (!GetIsPC(oPC)) return;
int iBardic = GetLevelByClass(CLASS_TYPE_BARD, oPC)
+ GetLevelByClass(CLASS_TYPE_HARPER, oPC)
+ GetLevelByClass(CLASS_TYPE_DIRGESINGER, oPC)
+ GetLevelByClass(CLASS_TYPE_DRAGONSONG_LYRIST, oPC)
+ GetLevelByClass(CLASS_TYPE_FOCHLUCAN_LYRIST, oPC)
+ GetLevelByClass(CLASS_TYPE_SUBLIME_CHORD, oPC)
+ GetLevelByClass(CLASS_TYPE_VIRTUOSO, oPC);
if (iBardic==0)
{
sDeny="Not quite. Perhaps someone with actual talent could do better...";
SendMessageToPC(oPC, sDeny);
return;
}
if (!GetIsSkillSuccessful(oPC, SKILL_PERFORM, 15))
{
sDeny="Not bad, but a bit out of tune...";
SendMessageToPC(oPC, sDeny);
return;
}
AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_TALK_PLEADING, 1.0f, 3.0f));
object oTarget;
oTarget = OBJECT_SELF;
//Visual effects can't be applied to waypoints, so if it is a WP
//apply to the WP's location instead
int nInt;
nInt = GetObjectType(oTarget);
effect eEffect;
eEffect = EffectVisualEffect(VFX_FNF_DISPEL_GREATER);
if (nInt != OBJECT_TYPE_WAYPOINT)
DelayCommand(3.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oTarget));
else
DelayCommand(3.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eEffect, GetLocation(oTarget)));
location lTarget;
oTarget = GetWaypointByTag("hiddenroom");
lTarget = GetLocation(oTarget);
DelayCommand(3.0, CreateObjectVoid(OBJECT_TYPE_ITEM, "AletterfromVanthar", lTarget));
eEffect = EffectVisualEffect(VFX_FNF_STRIKE_HOLY);
DelayCommand(3.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eEffect, lTarget));
} }