generated from Jaysyn/ModuleTemplate
48 lines
1.4 KiB
Plaintext
48 lines
1.4 KiB
Plaintext
//::///////////////////////////////////////////////
|
|
//:: Destroy Vampire with Stake
|
|
//:: pl_stake_act
|
|
//:: Copyright (c) 2003 Joseph L. Berkley, Jr.
|
|
//:://////////////////////////////////////////////
|
|
/*
|
|
|
|
*/
|
|
//:://////////////////////////////////////////////
|
|
//:: Created By: Joseph L. Berkley, Jr.
|
|
//:: Created On: 6 March 2003
|
|
//:://////////////////////////////////////////////
|
|
#include "00_debug"
|
|
|
|
object FindStake( object oPC );
|
|
|
|
void main()
|
|
{
|
|
object oPC = GetPCSpeaker();
|
|
object oItem = FindStake( GetPCSpeaker() );
|
|
if( !GetIsObjectValid( oItem ) ) return;
|
|
|
|
ActionPlayAnimation( ANIMATION_PLACEABLE_OPEN );
|
|
DestroyObject( oItem );
|
|
AssignCommand( oPC, ActionPlayAnimation( ANIMATION_FIREFORGET_STEAL ) );
|
|
ApplyEffectToObject( DURATION_TYPE_INSTANT,
|
|
EffectVisualEffect( VFX_FNF_STRIKE_HOLY ),
|
|
OBJECT_SELF );
|
|
GiveXPToCreature( oPC, 1000 );
|
|
SetLocalInt( OBJECT_SELF, "VAMPIRE_INSIDE", FALSE );
|
|
Debug( "Closing");
|
|
DelayCommand( 2.5, ActionPlayAnimation( ANIMATION_PLACEABLE_CLOSE ) );
|
|
}
|
|
|
|
object FindStake( object oPC )
|
|
{
|
|
object oResult = OBJECT_INVALID;
|
|
object oItem = GetFirstItemInInventory( oPC );
|
|
while( GetIsObjectValid( oItem ) && !GetIsObjectValid( oResult ) )
|
|
{
|
|
if( GetTag( oItem ) == "WOODEN_STAKE" )
|
|
oResult = oItem;
|
|
oItem = GetNextItemInInventory( oPC );
|
|
} // while valid item
|
|
|
|
return oResult;
|
|
}
|