Question: I been looking for this

Okay here am I again with another question! So sorry!

This is a question for multiple things though!

1- I am looking for a resting system that is easy to implement and does the following:

  • Rests allowed only after X time has passed.
  • Can rest ONLY if player is in posession of a bedroll (or other item) or has entered a resting zone

2- I remember years back there was a RP point rewarder, I just cannot find it anywhere in the vault anymore. It would show how many RP points the player had gathered with that character…if anyone has a link to it please could I have it? <3

I found what I think you are looking for here: http://www.dmh-online.net/nwn/scripts/

I copied the script here (this is apparently to be placed at onResting event in the Module properties):

    //::///////////////////////////////////////////////
    //:: Resting Script
    //:: boz_o0_resting
    //:: Copyright (c) 2002 Brotherhood of Zock
    //:://////////////////////////////////////////////
    /*
       This script allows the players to rest after a specified amount of hours
       has passed and only if they are in possession of a "Bedroll" or use a local
       "placeable" item that allows them to rest (and sets the LocalInt "iRestAllowed" to 1).
    */
    //:://////////////////////////////////////////////
    //:: Created By: Kihon
    //:: Created On: July 8, 2002
    //:://////////////////////////////////////////////
    // Counting the actual date from Year0 Month0 Day0 Hour0 in hours
    int GetHourTimeZero()
    {
       int iHourTimeZero;
       iHourTimeZero = (GetCalendarYear()-1)*12*28*24 + (GetCalendarMonth()-1)*28*24 + (GetCalendarDay()-1)*24 + GetTimeHour();
       return iHourTimeZero;
    }

    // The main function placed in the onRest event
    void main()
    {
      object oPlayer = GetLastPCRested();
      object oBedroll;
      int iRestPossible;
      int iRestDelay = 8; //The ammount of hours a player must wait between Rests
      // Allow Resting if the player carries a "Bedroll"
      if (GetIsObjectValid(oBedroll=GetItemPossessedBy(oPlayer,"Bedroll")))
      {
        SetLocalInt (oPlayer, "iRestAllowed", 1);
      }
      // Prevent the player from resting before the RestDelay is over
      if (GetHourTimeZero() < GetLocalInt (oPlayer, "iNextRestHourTimeZero"))
      {
        SetLocalInt (oPlayer, "iRestAllowed", 0);
        SendMessageToPC (oPlayer, "You must wait " + IntToString (GetLocalInt (oPlayer, "iNextRestHourTimeZero")-GetHourTimeZero()) + " hours before resting again.");
      }
      if (GetLastRestEventType() == REST_EVENTTYPE_REST_STARTED)
        {
          // Check if Player is allowed to Rest (Bedroll used or in Inventory)
          if (GetLocalInt (oPlayer, "iRestAllowed") != 1)
            {
              AssignCommand (oPlayer, ClearAllActions()); //Prevent Resting
              SendMessageToPC (oPlayer, "You may not rest now.");
            }
          else
            {
              SetLocalInt (oPlayer, "iRestAllowed", 0);
              SetLocalInt (oPlayer, "iNextRestHourTimeZero", GetHourTimeZero()+iRestDelay);
            }
        }
    }

The script placed in the onUsed event of the “Rest-allowing-placable”:

//Function placed on the onUsed Event of a placeable item that allows resting (a bed, or a bedroll...)
void main()
{
  object oLastUser = GetLastUsedBy();
  if (GetIsPC (oLastUser) && GetIsObjectValid (oLastUser))
  {
    SetLocalInt (oLastUser, "iRestAllowed", 1);
    AssignCommand (oLastUser, ActionRest());
  }
}

The Script Archive also had something of a reward roleplaying system. Here is that script:

//::///////////////////////////////////////////////
//:: Conversation Reward Functions
//:: aa_conv_rewards
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
    Assigns various rewards based on conversation
    responses.  Rewards may include 
    alignment shifts, XP, gold, items
*/
//:://////////////////////////////////////////////
//:: Created By: Keith Voss (fendis_khan)
//:: Created On: 2 Jul 2002
//:://////////////////////////////////////////////

//PRIVATE FUNCTION DECLARATIONS
// Assigns alignment shift and XP based on PC response
// - returns level of misalignment between alignment and response
// - returns negative value if Reward fails to be awarded
// nResponse: Alignment of response
// nAlignmentAxis: Alignment axis (ALIGNMENT_GOOD or ALIGNMENT_LAWFUL)
// nXPReward: XP reward for answering in character
// nAlignReward: Alignment shift toward that of response
int RewardRolePlay( object oPC, int nResponse, int nAlignmentAxis=ALIGNMENT_GOOD, int nXPReward=20, int nAlignReward=1 );
//::///////////////////////////////////////////////
//:: RewardRolePlay Functions
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
    Assigns alignment shift and XP based on PC
    response.  XP given for correct roleplay;
    alignment shift given to all
*/
//:://////////////////////////////////////////////
//:: Created By: Keith Voss (fendis_khan)
//:: Created On: 2 Jul 2002
//:://////////////////////////////////////////////
int RewardRolePlay( object oPC, int nResponse, int nAlignmentAxis=ALIGNMENT_GOOD, int nXPReward=20, int nAlignReward=1 )
{
    int nAlignmentValue;
    int nAlignment;
    int nAlignUp;
    int nAlignDown;
    int nMisAligned = -1; // 0 indicates match, 1 or 2 indicate difference in alignment, -1 invalid call
    if ( (!GetIsPC( oPC )) || (nXPReward < 0) || (nAlignReward < 0) )
    {
        return -1; // signal reward failure
    }
    if ( (nAlignmentAxis == ALIGNMENT_GOOD) || (nAlignmentAxis == ALIGNMENT_EVIL) )
    {
        nAlignmentValue = GetGoodEvilValue( oPC );
        nAlignment = GetAlignmentGoodEvil( oPC );
        nAlignUp = ALIGNMENT_GOOD;
        nAlignDown = ALIGNMENT_EVIL;
    }
    else if ( (nAlignmentAxis == ALIGNMENT_LAWFUL) || (nAlignmentAxis == ALIGNMENT_CHAOTIC) )
    {
        nAlignmentValue = GetLawChaosValue( oPC );
        nAlignment = GetAlignmentLawChaos( oPC );
        nAlignUp = ALIGNMENT_LAWFUL;
        nAlignDown = ALIGNMENT_CHAOTIC;
    }
    else return -1; // signal reward failure
    // reward PC for answering in character
    if ( nAlignment == nResponse )
    {
        nMisAligned = 0;
        GiveXPToCreature( oPC, nXPReward ); // no misalignment
    }
    else
        // no match, neutral cannot differ by more than one alignment
        if ( (nAlignment == ALIGNMENT_NEUTRAL) || (nResponse == ALIGNMENT_NEUTRAL) )
        {
            nMisAligned = 1; // slight misalignment
        }
        else
        {
            nMisAligned = 2; // complete misalignment
        }
    // shift alignment toward that of response
    if ( nResponse != ALIGNMENT_NEUTRAL )
    {
        // if alignment and response opposed, double penalty
        AdjustAlignment( oPC, nResponse, nAlignReward*(1+nMisAligned/2) );
    }
    else
    {
        if ( nAlignmentValue > 50 )      // high side of neutral
        {
            AdjustAlignment( oPC, nAlignDown, nAlignReward );
        }
        else if ( nAlignmentValue < 50 ) // low side of neutral
        {
           AdjustAlignment( oPC, nAlignUp, nAlignReward );
        }
    }
    return nMisAligned;
}
//::///////////////////////////////////////////////
//:: Reward for Evil dialogue
//:: lr_reward_evil
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
    Cause PC alignment to shift toward Evil;
    and give Evil PC some XP for answering in character
*/
//:://////////////////////////////////////////////
//:: Created By: Keith Voss (fendis_khan)
//:: Created On: 30 Jun 2002
//:://////////////////////////////////////////////
#include "aa_conv_rewards"
void main()
{
    int nResponse       = ALIGNMENT_EVIL; // alignment of response
    int nAlignmentAxis  = ALIGNMENT_GOOD; // alignment axis (GOOD/EVIL or LAW/CHAOS)
    int nXPReward       = 20; // XP reward for answering in character
    int nAlignReward    = 1; // Alignment shift in direction of response
    int nMisAligned     = 0; // Assume alignment matches response
    object oPC = GetPCSpeaker(); // assign reward to conversation speaker
    if ( GetLocalInt( oPC, "lr_reward" ) == FALSE )
    {
        nMisAligned = RewardRolePlay( oPC, nResponse, nAlignmentAxis, nXPReward, nAlignReward );
        if ( nMisAligned >= 0 )
        {
            // Remember the correlation between PC alignment and response
            SetLocalInt( oPC, "lr_reward", TRUE + nMisAligned );
        }
        else
        {
            SendMessageToPC( oPC, "Response Reward System Failed" );
        }
    }
}

thanks this is somewhat what I am looking for. I have found it before but I feel it does not match it entirely…
I really appreciate this do not get me wrong!

I think a copmbination of this

NWScript:
//::///////////////////////////////////////////////
//:: Resting Script
//:: boz_o1_resting
//:: Copyright (c) 2002 Brotherhood of Zock
//:://////////////////////////////////////////////
/*
This script allows the players to rest after a specified amount of hours
has passed and only (optional) if they are in possession of a “Bedroll” or use a local
“placeable” item that allows them to rest (and sets the LocalInt “iRestAllowed” to 1).
/
//:://////////////////////////////////////////////
//:: Created By: Kihon
//:: Created On: July 8, 2002
//:://////////////////////////////////////////////
// Counting the actual date from Year0 Month0 Day0 Hour0 in hours
int GetHourTimeZero()
{
int iHourTimeZero;
iHourTimeZero = (GetCalendarYear()-1)1228
24 + (GetCalendarMonth()-1)2824 + (GetCalendarDay()-1)*24 + GetTimeHour();
return iHourTimeZero;
}

// The main function placed in the onRest event
void main()
{
object oPlayer = GetLastPCRested();
int iRestDelay = 8; //The ammount of hours a player must wait between Rests
int iBedrollRequired = 1; // 0=No requirements for resting
// 1=A “Bedroll” is needed in order to rest.
// Optional may a “Rest-allowing-placable” be used,
// that sets the value of the local “iRestAllowed”
// variable on the player to “1”.

if (GetLastRestEventType() == REST_EVENTTYPE_REST_STARTED)
{
// Check if the Rest Dely is over.
if (GetHourTimeZero() < GetLocalInt (oPlayer, “iNextRestHourTimeZero”))
{
AssignCommand (oPlayer, ClearAllActions()); // Prevent Resting
SendMessageToPC (oPlayer, “You must wait " + IntToString (GetLocalInt (oPlayer, “iNextRestHourTimeZero”)-GetHourTimeZero()) + " hour(s) before resting again.”);
}
else // Resting possible.
{
// Resting allowed if No Bedroll required or Player has a Bedroll or a Rest-allowing-placeable set the local “iRestAllowed” variable to 1
if (iBedrollRequired == 0 || iBedrollRequired == 1 && (GetIsObjectValid (GetItemPossessedBy (oPlayer,“Bedroll”)) || GetLocalInt (oPlayer,“iRestAllowed”) == 1))
{
SetLocalInt (oPlayer, “iRestAllowed”, 0);
SetLocalInt (oPlayer, “iNextRestHourTimeZero”, GetHourTimeZero()+iRestDelay);
}
else // Resting not allowed
{
AssignCommand (oPlayer, ClearAllActions()); // Prevent Resting
SendMessageToPC (oPlayer, “No Bed(roll) - No Rest”);
}
}
}
}

The script placed in the onUsed event of the “Rest-allowing- placable”:

NWScript:
//Function placed on the onUsed Event of a placeable item that allows resting (a bed, or a bedroll…)
void main()
{
object oLastUser = GetLastUsedBy();
if (GetIsPC (oLastUser) && GetIsObjectValid (oLastUser))
{
SetLocalInt (oLastUser, “iRestAllowed”, 1);
AssignCommand (oLastUser, ActionRest());
}
}

And this

NWScript:
//::///////////////////////////////////////////////
//:: Name restricted_rest 1.0
//:: Copyright (c) 2002 Forest Zachman
//:://////////////////////////////////////////////
/*
*/
//:://////////////////////////////////////////////
//:: Created By: Forest Zachman
//:: Created On: 7/10/02
//:://////////////////////////////////////////////

void main()
{
int iRestEvent = GetLastRestEventType();
//Check to see if the PC is starting to rest
if (iRestEvent == REST_EVENTTYPE_REST_STARTED) {
object oRestingPC = GetLastPCRested();
// This variable is set either by a trigger around a “campsite”
// or in the OnEnter event of an Area.
int iAllowedToRest = GetLocalInt(oRestingPC, “ALLOWED_TO_REST”);
if (iAllowedToRest == 0) {
// This area is off limits for resting
// and the character is not in a rest area.
AssignCommand(oRestingPC, ClearAllActions());
FloatingTextStringOnCreature(“You are not allowed to rest here.”, oRestingPC, FALSE);
}
}
}

This basically disallows rest everywhere in your module. Now, two scripts will allow a player to rest. One goes in the OnEnter of a Trigger (around a campsite for example) or Area (on the entire second floor of an Inn containing rooms or a secluded glade for example) and the other goes in the OnExit of the same Trigger/Area.

OnEnter:
NWScript:
void main()
{
object oPC = GetEnteringObject();
if (GetIsPC(oPC)) {
SetLocalInt(oPC, “ALLOWED_TO_REST”, 1);
}
}

OnExit:
NWScript:
void main()
{
object oPC = GetExitingObject();
if (GetIsPC(oPC)) {
DeleteLocalInt(oPC, “ALLOWED_TO_REST”);
}
}

I used the RP system waaay back in the day (feels old now) where one could actually choose his reward. It looked like a green bar ingame, so sorry that is also not what I am looking for though I do appreciate the suggestion!

the system I been looking for was to allow DM’s to reward players for RP, give them points so the player could buy something with said points

Ok, then I’m afraid I can’t help you, and as I said in another thread, it’s hard to follow what your script does when you put all the curly brackets in a row on top of one another.

well I simply copy paste it in here. It shows up like this >.<

Alright, I understand. It looks that way in the toolset then?