Post by Stingray888 on Aug 9, 2013 23:42:45 GMT
New on/off placeable/audio script (generic) placed on 'on heartbeat': onoff_objsound
void main ()
{
string sTag=GetTag(OBJECT_SELF);
object oNearestObject=GetNearestObjectByTag(sTag);
if (GetLocalInt(OBJECT_SELF,"NW_L_AMION") == 0)
{
SoundObjectSetVolume(oNearestObject, 0);
}
else
{
SoundObjectSetVolume(oNearestObject, 127);
}
}
If GetArea(OBJECT_SELF) ==
{
ExecuteScript( "mine_bad", OBJECT_SELF);
}
//Make oDrunk face oTarget and act like a drunkard.
AssignCommand(oDrunk, PlayConversationAnimation(nAnimation, oTarget));
On Spawn:
coward_ai = SetCombatCondition(X0_COMBAT_FLAG_COWARDLY); and walkwaypoints() and SetListeningPatterns();
coward_ai_main = ExecuteScript("coward_ai", OBJECT_SELF); and ActionRandomWalk();
On Heartbeat:
zeptorch_spawn
Variables:
CEP_L_AMION int 1 = Light source is initially activated
(This is a localint that holds the present on-off state of the placeable. If the placeable is to be switched on or off, please use the zep_torch or zep_torchupdate functions. DO NOT CHANGE THIS VARIABLE MANUALLY. Doing so will cause the light-emitting placeable to stop functioning properly if done improperly)
CEP_L_LIGHTCONST string GREY_10 = Light type and intensity
(This localstring holds the name of the lighting constant used to put a colored light on a lit light-emitting placeable. For example, if a torch is supposed to emit a 20 foot diameter yellow light, CEP_L_LIGHTCONST should contain "YELLOW_20". The function ColorInit in the zep_inc_main library converts this string into a number which can be used by the game engine. The following colors and light radii are available: White, Yellow, Orange, Red, Green, Blue and Purple (note that Green actually calls a GREY lighting effect which is green for some inscrutable reason) 5, 10, 15, 20 are the available radii. Note that some light colors are brighter than others)
CEP_L_LIGHTCYCLE int 1 = Light source turns off when daytime
(This is a localint that determines whether the light-emitting placeable will automatically switch itself on and off to match the day/night cycle. If it is set to 1, the placeable will shut off during the day. If set to 0, the placeable does not change state unless zep_torch or zep_torchupdate are used to change it. Also note that cycling placeables update on every heartbeat. This means that if a cycling light-emitter is turned off at night, it will switch back on on the next heartbeat)
CEP_L_LIGHTSWAP string zep_oolantern005 = Non-lit swap-in placeable resref
(This localstring holds the resref of its counterpart light-emitter. For example, a lit wooden lantern's CEP_L_LIGHTSWAP contains "owoodlantern001" and an unlit wood lantern's CEP_L_LIGHTSWAP contains "woodlantern001". This variable provides a handle so that the lit/unlit light-emitter placeable can be swapped for its counterpart when the placeable "switches" on or off. NEVER CHANGE THIS VARIABLE)
For placeable objects that are a source of illumination (such as the lamp post), it is not enough to just use its ANIMATION_PLACEABLE_DEACTIVATE or ANIMATION_PLACEABLE_ACTIVATE. That just affects the glowing part of the animation, itself. You must also use the SetPlaceableIllumination() command set to TRUE and tell the area it's in to RecomputeStaticLighting().
Must have this nw_d2_gen_check in the 'on perception' of the npc in order to trigger a special greeting.
//::///////////////////////////////////////////////
//:: Generic Conversation Check
//:: NW_D2_gen_check
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Check to see whether the NPC has an initialized
NPC is using SetSpecialConversationStart
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Nov 7, 2001
//:://////////////////////////////////////////////
#include "NW_I0_GENERIC"
int StartingConditional()
{
if(GetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION))
{
if(!GetIsObjectValid(GetPCSpeaker()))
{
return TRUE;
}
}
return FALSE;
}
void main ()
{
string sTag=GetTag(OBJECT_SELF);
object oNearestObject=GetNearestObjectByTag(sTag);
if (GetLocalInt(OBJECT_SELF,"NW_L_AMION") == 0)
{
SoundObjectSetVolume(oNearestObject, 0);
}
else
{
SoundObjectSetVolume(oNearestObject, 127);
}
}
If GetArea(OBJECT_SELF) ==
{
ExecuteScript( "mine_bad", OBJECT_SELF);
}
//Make oDrunk face oTarget and act like a drunkard.
AssignCommand(oDrunk, PlayConversationAnimation(nAnimation, oTarget));
On Spawn:
coward_ai = SetCombatCondition(X0_COMBAT_FLAG_COWARDLY); and walkwaypoints() and SetListeningPatterns();
coward_ai_main = ExecuteScript("coward_ai", OBJECT_SELF); and ActionRandomWalk();
On Heartbeat:
zeptorch_spawn
Variables:
CEP_L_AMION int 1 = Light source is initially activated
(This is a localint that holds the present on-off state of the placeable. If the placeable is to be switched on or off, please use the zep_torch or zep_torchupdate functions. DO NOT CHANGE THIS VARIABLE MANUALLY. Doing so will cause the light-emitting placeable to stop functioning properly if done improperly)
CEP_L_LIGHTCONST string GREY_10 = Light type and intensity
(This localstring holds the name of the lighting constant used to put a colored light on a lit light-emitting placeable. For example, if a torch is supposed to emit a 20 foot diameter yellow light, CEP_L_LIGHTCONST should contain "YELLOW_20". The function ColorInit in the zep_inc_main library converts this string into a number which can be used by the game engine. The following colors and light radii are available: White, Yellow, Orange, Red, Green, Blue and Purple (note that Green actually calls a GREY lighting effect which is green for some inscrutable reason) 5, 10, 15, 20 are the available radii. Note that some light colors are brighter than others)
CEP_L_LIGHTCYCLE int 1 = Light source turns off when daytime
(This is a localint that determines whether the light-emitting placeable will automatically switch itself on and off to match the day/night cycle. If it is set to 1, the placeable will shut off during the day. If set to 0, the placeable does not change state unless zep_torch or zep_torchupdate are used to change it. Also note that cycling placeables update on every heartbeat. This means that if a cycling light-emitter is turned off at night, it will switch back on on the next heartbeat)
CEP_L_LIGHTSWAP string zep_oolantern005 = Non-lit swap-in placeable resref
(This localstring holds the resref of its counterpart light-emitter. For example, a lit wooden lantern's CEP_L_LIGHTSWAP contains "owoodlantern001" and an unlit wood lantern's CEP_L_LIGHTSWAP contains "woodlantern001". This variable provides a handle so that the lit/unlit light-emitter placeable can be swapped for its counterpart when the placeable "switches" on or off. NEVER CHANGE THIS VARIABLE)
For placeable objects that are a source of illumination (such as the lamp post), it is not enough to just use its ANIMATION_PLACEABLE_DEACTIVATE or ANIMATION_PLACEABLE_ACTIVATE. That just affects the glowing part of the animation, itself. You must also use the SetPlaceableIllumination() command set to TRUE and tell the area it's in to RecomputeStaticLighting().
Must have this nw_d2_gen_check in the 'on perception' of the npc in order to trigger a special greeting.
//::///////////////////////////////////////////////
//:: Generic Conversation Check
//:: NW_D2_gen_check
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Check to see whether the NPC has an initialized
NPC is using SetSpecialConversationStart
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Nov 7, 2001
//:://////////////////////////////////////////////
#include "NW_I0_GENERIC"
int StartingConditional()
{
if(GetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION))
{
if(!GetIsObjectValid(GetPCSpeaker()))
{
return TRUE;
}
}
return FALSE;
}