62 lines
1.8 KiB
Plaintext
62 lines
1.8 KiB
Plaintext
//:://////////////////////////////////////////////
|
|
//:: Created By: Eddie V. Pacheco
|
|
//:: Created On: July 31 2003
|
|
//:: Assisted and thanks to: YellowLab
|
|
//:: Edited my McDaggart: Jan 04
|
|
//:://////////////////////////////////////////////
|
|
void PlaceBedroll(object oPC)
|
|
{
|
|
location lLoc = GetLocation(oPC);
|
|
CreateObject(OBJECT_TYPE_PLACEABLE,"bedrolls001",lLoc,FALSE);
|
|
DestroyObject(GetItemPossessedBy(oPC,"bedroll"));
|
|
object oMyRoll = GetNearestObjectByTag("MyBedRoll",oPC);
|
|
|
|
location lRoll = GetLocation(oMyRoll);
|
|
AssignCommand(oPC,ActionMoveToLocation(lRoll,FALSE));
|
|
AssignCommand(oPC,ActionDoCommand(SetFacing(GetFacing(oMyRoll))));
|
|
}
|
|
|
|
void PickupBedroll(object oPC)
|
|
{
|
|
AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW,1.0,2.0f));
|
|
CreateItemOnObject("bedroll",oPC);
|
|
DestroyObject(GetNearestObjectByTag("MyBedRoll",oPC),1.0f);
|
|
}
|
|
|
|
#include "nw_i0_plot"
|
|
void main()
|
|
{
|
|
object oPC = GetLastPCRested();
|
|
ExportSingleCharacter(oPC);
|
|
SetLocalInt(oPC, "PCDead", 0);
|
|
string sRealApp = "realApp";
|
|
int nRealMe = GetLocalInt(oPC, sRealApp);
|
|
|
|
if (!GetIsPC(oPC)) return;
|
|
|
|
if(nRealMe>0)
|
|
{
|
|
SetCreatureAppearanceType(oPC, nRealMe - 1);
|
|
}
|
|
|
|
if (GetLastRestEventType()== REST_EVENTTYPE_REST_STARTED && HasItem(oPC,"bedroll"))
|
|
{
|
|
SetLocalInt(oPC, "bedroll", 1);
|
|
PlaceBedroll(oPC);
|
|
DelayCommand(2.5, ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_IMP_SLEEP), oPC));
|
|
}
|
|
|
|
if (GetLastRestEventType()== REST_EVENTTYPE_REST_CANCELLED && GetLocalInt(oPC,"bedroll")==1)
|
|
{
|
|
PickupBedroll(oPC);
|
|
SetLocalInt(oPC, "bedroll", 0);
|
|
}
|
|
|
|
if (GetLastRestEventType()== REST_EVENTTYPE_REST_FINISHED && GetLocalInt(oPC,"bedroll")==1)
|
|
{
|
|
PickupBedroll(oPC);
|
|
SetLocalInt(oPC, "bedroll", 0);
|
|
}
|
|
|
|
}
|