Author Topic: Rp Ranking?  (Read 239 times)

Legacy_Jenna WSI

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Rp Ranking?
« on: February 25, 2011, 05:54:55 pm »


               I've seen a system used on a server that allows the dm to give you a special ranking that causes the game to give out a small xp bonus every hour. It doesn't give the xp if you're idle though. Seems well built... but I can't find it on the vault. Anyone know if it's on there?
               
               

               
            

Legacy_ehye_khandee

  • Hero Member
  • *****
  • Posts: 1415
  • Karma: +0/-0
Rp Ranking?
« Reply #1 on: February 25, 2011, 08:18:20 pm »


               I've scoured the vault, not looking for that in particular, but I've never seen it there in my travels that I recall. We use a custom built system that requires no DM interaction - it awards XP based on IC interaction (negative for PARTY chatter, positive for TALK & WHISPER if not // flagged, and for emotes). Though we give XP also for many other things, like exploration, and class suited action (like rogues looting/PP/openlocks), etc..



Good luck on your quest.



               
               

               
            

Legacy_NWN DM

  • Hero Member
  • *****
  • Posts: 661
  • Karma: +0/-0
Rp Ranking?
« Reply #2 on: February 25, 2011, 08:21:43 pm »


               I think there's something similar for NWN2, but I can't say as I've seen anything like that for NWN.

Then again, this would involve scripting, so it's not like I'd realize it if/when I saw the guts of the system regardless.
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Rp Ranking?
« Reply #3 on: February 25, 2011, 09:55:09 pm »


               Do you get a certain amount of xp based on the item you have or is it just one item and anyone who has it gets the xp?

If it is just one item you could use my AFK/RP XP system. I altered this one from the one on the vault to accomidate you. If it is more a multiple item system with different amounts of XP you could sill alter this further for your needs.

//////////////////////////////GOGS AutoAFK System///////////////////////////////
//Name: "gogs_afk_inc"
//Date: 8-4-2010
//Type: include
////////////////////////////////////////////////////////////////////////////////
#include "x3_inc_string"
/////////////////////////////CONFIGURABLE OPTIONS///////////////////////////////

                             //!!!IMPORTANT!!//
//!!Be sure to "Build" you module after making any changes to this script!!

//Set timer for chat check and movement detection. After this time has expired
//for both checks then the AFK effect type will be applied.
//Default: 600 seconds(10 minutes)
const int TIMER = 600;//Seconds
//If using the RP XP option, decreasing the chat timer will mean that players
//will have to chat more often to recieve the XP reward.
const int CHAT_TIMER = 600;//Seconds

//Available AFK types:
//1 = Repeating floating text on player.
//2 = A visual effect will be applied to the player.
//3 = Transport player to an object in AFK area.
//4 = Boot player.
//5 = Play Animation(looping type only).
//6 = Do nothing.
const int AFK_TYPE = 6;

//Options for AFK_TYPE 1:
//Enter message that you want to float over the players head when he/she is AFK.
//Default: "AFK"
const string AFK_FLOATING_MESSAGE = "AFK";
//Change the color of the floating text. Options for colors:
//STRING_COLOR_BLACK
//STRING_COLOR_BLUE
//STRING_COLOR_GREEN
//STRING_COLOR_PINK
//STRING_COLOR_RED
//STRING_COLOR_ROSE
//STRING_COLOR_WHITE
const string FLOATY_COLOR = STRING_COLOR_RED;
//Allow floaty text with all AFK types. Default: FALSE
const int FLOATY_TEXT_ALWAYS = FALSE;

//Option for AFK_TYPE 2:
//Enter desired VFX number or constant. Default: VFX_DUR_FLAG_GOLD
const int AFK_EFFECT = VFX_DUR_FLAG_GOLD;

//AFK OBJECT. This object is used for AFK_TYPE 2 and AFK_TYPE 3.
//Simply pick any placeable of your choosing and give it the tag below.
//Also make sure the object is checked "plot".If using the object for TYPE 2 you
//can put it in any area. If using it for TYPE 3 place it in the AFK area that
//players will be teleported to.
//Note for AFK_TYPE 3: This option sets a location on the player that they can
//be auto-ported back to. However should the player log out and log back in or
//if the server crashes, this location will be lost. Therefore you should have
//an alternate way of leaving the AKF area.
//Default: "GOGS_AFK_OBJECT"
const string AFK_OBJECT = "GOGS_AFK_OBJECT";
//Additional note for AFK type 3: I have made it so that a player who is in the
//AFK area must type something/anything in the chat bar for them to return to
//their stored location. This is to prevent other players from simply pushing
//the player around and causing a change in location which would teleport them.
//A repeating message is sent to the player until they type something.
//Message:
const string AFK_AREA_MESSAGE = "Type anything in the chat bar to be ported back to saved location.";
//Select color of message. Same color options as above apply.
const string AREA_MESSAGE_COLOR = STRING_COLOR_RED;

//Option for AFK_TYPE 5:
//Enter desired looping animation constant for the AFK animation.
//Default: ANIMATION_LOOPING_SIT_CROSS
const int AFK_ANIMATION = ANIMATION_LOOPING_SIT_CROSS;

//Send a message to the party members of the player that is AFK. This will
//display a message once when the player has gone AFK and once when the player
//is no longer AFK.
//If TRUE, message will be displayed to all party members. DEFAULT: TRUE
const int SEND_FACTION_MESSAGE = TRUE;
//Select color of message. Same color options as above apply.
const string FACTION_MESSAGE_COLOR = STRING_COLOR_PINK;

//Options for awarding RP XP. Basically, if the player is not AFK and has
//chatted within the last timer delay, the player will receive XP.
//Set to TRUE to give RP XP.
const int RP_XP_REWARD = FALSE;
//Set desired amount of XP to give every cycle.
const int XP_AMOUNT = 100;
//Set TRUE if you want to require that the player have an RP item to get the XP.
const int RP_ITEM_REQUIRED = TRUE;
//Tag of your required RP item.
const string RP_ITEM_TAG = "Your item tag here";

////////////////////////////END CONFIGURABLE OPTIONS////////////////////////////

////////////////////////////////////////////////////////////////////////////////
void SendAFKFactionMessage(object oPC)
{
int iActive = GetLocalInt(oPC, "AFK_ACTIVE");
string sName = GetName(oPC);
string sMessage;
if (iActive == TRUE) sMessage = sName + " has gone AFK.";
else sMessage = sName + " is no longer AFK.";
object oMember = GetFirstFactionMember(oPC);
while (GetIsObjectValid(oMember))
    {
    SendMessageToPC(oMember, StringToRGBString(sMessage, FACTION_MESSAGE_COLOR));
    oMember = GetNextFactionMember(oPC);
    }
}
////////////////////////////////////////////////////////////////////////////////
void CheckNoAFK(object oPC)
{
location lPC = GetLocation(oPC);
location lCheck = GetLocalLocation(oPC, "AFK_LOC_CHECK");
int iChatty = GetLocalInt(oPC, "CHATTY");
if (iChatty == TRUE || lPC != lCheck)
    {
    if (AFK_TYPE == 1)
        {
        SetLocalInt(oPC, "AFK_ACTIVE", FALSE);
        if (SEND_FACTION_MESSAGE == TRUE) SendAFKFactionMessage(oPC);
        }
    if (AFK_TYPE == 2)
        {
        effect eEffect = GetFirstEffect(oPC);
        while (GetIsEffectValid(eEffect))
            {
            if (GetEffectCreator(eEffect)== GetObjectByTag("GOGS_AFK_OBJECT"))
                {
                RemoveEffect(oPC, eEffect);
                }
            eEffect = GetNextEffect(oPC);
            }
        SetLocalInt(oPC, "AFK_ACTIVE", FALSE);
        if (SEND_FACTION_MESSAGE == TRUE) SendAFKFactionMessage(oPC);
        }
    if (AFK_TYPE == 3)
        {
        location lLoc = GetLocalLocation(oPC, "AFK_RETURN_LOC");
        if (iChatty == TRUE)
            {
            SetLocalInt(oPC, "AFK_ACTIVE", FALSE);
            if (SEND_FACTION_MESSAGE == TRUE) SendAFKFactionMessage(oPC);
            DelayCommand(2.0, AssignCommand(oPC, ActionJumpToLocation(lLoc)));
            }
        else
            {
            SendMessageToPC(oPC, StringToRGBString(AFK_AREA_MESSAGE, AREA_MESSAGE_COLOR));
            DelayCommand(3.0, CheckNoAFK(oPC));
            }
        }
    if (AFK_TYPE == 5)
        {
        SetLocalInt(oPC, "AFK_ACTIVE", FALSE);
        if (SEND_FACTION_MESSAGE == TRUE) SendAFKFactionMessage(oPC);
        }
    if (AFK_TYPE == 6)
        {
        SetLocalInt(oPC, "AFK_ACTIVE", FALSE);
        }
    }
else
    {
    DelayCommand(3.0, CheckNoAFK(oPC));
    if (AFK_TYPE == 1 || FLOATY_TEXT_ALWAYS == TRUE)
        {
        string sAFK = StringToRGBString(AFK_FLOATING_MESSAGE, FLOATY_COLOR);
        FloatingTextStringOnCreature(sAFK, oPC);
        }
    }
}
////////////////////////////////////////////////////////////////////////////////
void RunAFKType(object oPC)
{
if (AFK_TYPE == 1)
    {
    //
    }
if (AFK_TYPE == 2)
    {
    object oAFKObject = GetObjectByTag(AFK_OBJECT);
    AssignCommand(oAFKObject, ApplyEffectToObject(DURATION_TYPE_PERMANENT, SupernaturalEffect(EffectVisualEffect(AFK_EFFECT)), oPC));
    }
if (AFK_TYPE == 3)
    {
    SetLocalLocation(oPC, "AFK_RETURN_LOC", GetLocation(oPC));
    AssignCommand(oPC, ActionJumpToObject(GetObjectByTag(AFK_OBJECT)));
    }
if (AFK_TYPE == 4)
    {
    //SendMessageToPC(oPC, "Boot!");//Used for testing in single player.
    BootPC(oPC);
    }
if (AFK_TYPE == 5)
    {
    AssignCommand(oPC, ActionPlayAnimation(AFK_ANIMATION, 1.0, 10000.0));
    }
if (AFK_TYPE == 6)
    {
    //Do nothing
    }
SetLocalInt(oPC, "AFK_ACTIVE", TRUE);
if (SEND_FACTION_MESSAGE == TRUE) SendAFKFactionMessage(oPC);
CheckNoAFK(oPC);
}
////////////////////////////////////////////////////////////////////////////////
void ChatCheck(object oPC)
{
int iChatty = GetLocalInt(oPC, "CHATTY");
if (iChatty != TRUE)
    {
    SetLocalInt(oPC, "CHATTY", TRUE);
    DelayCommand(IntToFloat(CHAT_TIMER), SetLocalInt(oPC, "CHATTY", FALSE));
    }
}
////////////////////////////////////////////////////////////////////////////////
void RunAFKDetection(object oPC)
{
location lPC = GetLocation(oPC);
location lCheck = GetLocalLocation(oPC, "AFK_LOC_CHECK");
int iAFKActive = GetLocalInt(oPC, "AFK_ACTIVE");
int iChatty = GetLocalInt(oPC, "CHATTY");

if (lPC == lCheck && iChatty != TRUE && iAFKActive != TRUE)
    {
    RunAFKType(oPC);
    }
SetLocalLocation(oPC, "AFK_LOC_CHECK", lPC);

if (RP_ITEM_REQUIRED == TRUE)
    {
    object oRPItem = GetItemPossessedBy(oPC, RP_ITEM_TAG);
    if (GetIsObjectValid(oRPItem) && iChatty == TRUE && RP_XP_REWARD == TRUE)
        {
        GiveXPToCreature(oPC, XP_AMOUNT);
        }
    }
else if (iChatty == TRUE && RP_XP_REWARD == TRUE)
    {
    GiveXPToCreature(oPC, XP_AMOUNT);
    }
DelayCommand(IntToFloat(TIMER), RunAFKDetection(oPC));
}
////////////////////////////////////////////////////////////////////////////////
void GOGsAFKDetector(object oPC)
{
DelayCommand(10.0, RunAFKDetection(oPC));
}

/*

Example "OnPlayerChat" script:

//::////////////////////////////////////////////////////////////////////////////
//::A bunch of stuff here.....
//:://///////////////////////////////////////////////////////////////////////////

#include "???????????"
#include "gogs_afk_inc"  <------Add this line to your script!

void main()
{
    object oPC = GetPCChatSpeaker();
    ChatCheck(oPC)       <------Add this line to your script!
    OtherStuff.......
    Ect........
    Ect...........

}


Example "OnClientEnter" script:

//::////////////////////////////////////////////////////////////////////////////
//::A bunch of stuff here.....
//:://///////////////////////////////////////////////////////////////////////////

#include "???????????"
#include "gogs_afk_inc"        <------Add this line to your script!

void main()
{
    object oPC = GetEnteringObject();
    GOGsAFKDetector(oPC)       <------Add this line to your script!
    OtherStuff.......
    Ect........
    Ect...........

}

*/

It uses a pseudo heartbeat to check that the player has been chatting and hasn't remained in the same location if not chatting. If the player appears to be active then they get XP. And if you don't want to use any of the auto afk stuff then just use option 6(nothing), and the xp part will still work. This is an include type script. At the bottom it shows you how to implement it by adding a lines to your OnPlayerChat and OnClientEnter.

Hope this at least gets you going in the right direction. Off to work. Good luck.
               
               

               


                     Modifié par GhostOfGod, 26 février 2011 - 09:00 .
                     
                  


            

Legacy_Jenna WSI

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Rp Ranking?
« Reply #4 on: February 26, 2011, 04:03:40 pm »


               Oh nice! Thanks will use that.
               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Rp Ranking?
« Reply #5 on: February 28, 2011, 10:15:59 am »


               Do you really want to just distribute xp at intervals?
Would it not be better to create a modifyer int, which gets used to modify the amount of xp the player gains?

eg -
Being in character for chat etc, rewards something like +50% xp per kill.
Being out of Character for chat etc, rewards something like -25% xp per kill.

It would just involve making a modification to your xp script to pull the int value of the player in question, and then change it to a float, and then multiply the xp reward, by the (float / 100.00)

eg
Player is in character chat,
gets awarded a +25% xp bonus for each kill

The on Kill Script fires the xp script, the base xp value for that monster was 300 xp.

300 x (125 / 100) = 375 xp  (bonus xp of 75)

Of course, Its early morning, and my math may be off.