Author Topic: Give RP award item storage thingie on client enter?  (Read 210 times)

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Give RP award item storage thingie on client enter?
« on: June 09, 2016, 11:03:53 am »


               

okay guys this is what I am looking for: 


 


On client enter I want the script to also check if the pc has rp_awards item on them, if not then it should be given.


For some reason I cannot seem to get it to work  (even when trying to alter some of the coding on there myself) I feel really ignorantnow for not knowing this but am hoping someone can help me out here....


 


ITEM TAG: rp_awards


 

 


 




#include "habd_include"

#include "fugue_xpdebt_inc"

#include "pgs_inc_events"

#include "pgs_inc_uidsys"

#include "pqj_inc"

#include "omw_plns"

#include "vg_give_items"

#include "vg_move_rates"

#include "doa_gold_hrtbt"

#include "vg_factions_inc"

#include "ww_inc"

#include "vamp_inc"

#include "b_rep_factions"

#include "sha_subr_methds"

//#include "x3_inc_horse"

void main()

{

object oMod = GetModule();

// The object entering the area

object oPC = GetEnteringObject();

// Used to check if PC is new to module or not

string sRegion = GetCampaignString("Regions","Region",oPC);

// Possible region codes PC could be native to

int iRegion01 = TestStringAgainstPattern("01",sRegion);

int iRegion02 = TestStringAgainstPattern("02",sRegion);

int iRegion03 = TestStringAgainstPattern("03",sRegion);

int iRegion04 = TestStringAgainstPattern("04",sRegion);

int iRegion05 = TestStringAgainstPattern("05",sRegion);

int iRegion06 = TestStringAgainstPattern("06",sRegion);

// Prep the STARTING_GOLD INT for use in section giving starting gold

int STARTING_GOLD = 0;

 

// update 1.69 ridable horses add-on

ExecuteScript("x3_mod_def_enter",OBJECT_SELF);

 

// Remove invulnerability

DelayCommand(2.0,SetPlotFlag(oPC, FALSE));

 

// Rebuild the persistant journals for clients when they enter

DelayCommand(2.2,RebuildJournalQuestEntries(oPC));

 

//---***---\\

//Turns out this script calls x3_mod_def_enter, which calls x3_mod_pre_enter, which

//calls sha_on_cl_enter which calls this function already.  So, not needed here.

//SubraceOnClientEnter();

//***---***\\

 

// Handles the initialization of the werewolf system and vampire subrace

if(GetIsPC(oPC))

    {

    if(GetLocalInt(GetModule(),"Werewolf")==1)

        {

        // werewolf system initialization

        DelayCommand(2.4,SetLocalInts(oPC));

 

        // run pseudo heartbeat for werewolf system

        DelayCommand(2.6,WWHrtbt(oPC));

        }

 

    if(GetLocalInt(GetModule(),"Vampire")==1)

        {

        // vampire system initialization

        if (GetSubRace(oPC) == "VAMPIRE")

            {

            init_subrace(oPC);

            }

        }

    }

 

// Get DB info and make sure clients have Death/Bleed items when they enter

HABDGetDBOnClientEnter(oPC);

DelayCommand(2.8, HABDItemsOnClientEnter(oPC));

 

// Set up XPDebt Persistence

DelayCommand(3.0,XPonEnter(oPC));

 

// Set up player guild info when client enters

DelayCommand(3.2,PGS_OnClientEnter (oPC));

 

// Set up Loot Notification

if (GetLocalInt(oMod,"PCLootTool")==1)

    {

    DelayCommand(3.4,PLNSLoadNotificationOnClientEnter(oPC));

    }

 

// Give PC a Subdual Tool if they dont have one and set Subdual Mode to "Full Damage"

if (GetLocalInt(oMod,"PCSubdualTool")==1)

    {

    DelayCommand(3.6,GivePCSubdualTool(oPC));

    DelayCommand(3.8, SetLocalInt(oPC,"SUBDUAL",0));

    }

 

// Set up factions for persistence

if (GetLocalInt(oMod,"Factions")==1)

    {

    // This tracks what faction the PC started with in the very beginning

    int nOriginalFaction = GetCampaignInt("Factions",CHAR_FACTION_ORIGINAL(oPC),oMod);

    SetLocalInt(GetModule(),CHAR_FACTION_ORIGINAL(oPC),nOriginalFaction);

    // This tracks what faction the PC currently belongs to

    int nCurrentFaction = GetCampaignInt("Factions",CHAR_FACTION(oPC),oMod);

    SetLocalInt(GetModule(),CHAR_FACTION(oPC),nCurrentFaction);

    }

 

// Give PC a Persistent Location Saving Tool

if (GetLocalInt(oMod,"PLSTool")==0)

    {

    GivePCPLSTool(oPC);

    }

 

// Give PC their DMFI tools

if (GetLocalInt(oMod,"DMFITools")==1)

    {

    GiveDMFITools(oPC);

    }

 

// Give PC their climb tool

if (GetLocalInt(oMod,"PCClimbTool")==1)

    {

    GivePCClimbTool(oPC);

    }

 

// Set up the player's starting gold as per PnP rules (two variants included)

if (!iRegion01&&!iRegion02&&!iRegion03&&!iRegion04&&!iRegion05&&!iRegion06&&GetLocalInt(oMod,"STARTING_GOLD")!=0)

    {

    if (GetLocalInt(oMod,"STARTING_GOLD")==0)       // Full amount of class based gold

        {

        if (GetLevelByClass(CLASS_TYPE_BARBARIAN, oPC))     STARTING_GOLD = 160;

        else if (GetLevelByClass(CLASS_TYPE_BARD, oPC))     STARTING_GOLD = 160;

        else if (GetLevelByClass(CLASS_TYPE_CLERIC, oPC))   STARTING_GOLD = 200;

        else if (GetLevelByClass(CLASS_TYPE_DRUID, oPC))    STARTING_GOLD = 80;

        else if (GetLevelByClass(CLASS_TYPE_FIGHTER, oPC))  STARTING_GOLD = 240;

        else if (GetLevelByClass(CLASS_TYPE_MONK, oPC))     STARTING_GOLD = 20;

        else if (GetLevelByClass(CLASS_TYPE_PALADIN, oPC))  STARTING_GOLD = 240;

        else if (GetLevelByClass(CLASS_TYPE_RANGER, oPC))   STARTING_GOLD = 240;

        else if (GetLevelByClass(CLASS_TYPE_ROGUE, oPC))    STARTING_GOLD = 200;

        else if (GetLevelByClass(CLASS_TYPE_SORCERER, oPC)) STARTING_GOLD = 120;

        else if (GetLevelByClass(CLASS_TYPE_WIZARD, oPC))   STARTING_GOLD = 120;

        else STARTING_GOLD = 160;

        }

    if (GetLocalInt(oMod,"STARTING_GOLD")==0)       // Roll for amount of class based gold

        {

        if (GetLevelByClass(CLASS_TYPE_BARBARIAN, oPC))     STARTING_GOLD = d4(4)*10;

        else if (GetLevelByClass(CLASS_TYPE_BARD, oPC))     STARTING_GOLD = d4(4)*10;

        else if (GetLevelByClass(CLASS_TYPE_CLERIC, oPC))   STARTING_GOLD = d4(5)*10;

        else if (GetLevelByClass(CLASS_TYPE_DRUID, oPC))    STARTING_GOLD = d4(2)*10;

        else if (GetLevelByClass(CLASS_TYPE_FIGHTER, oPC))  STARTING_GOLD = d4(6)*10;

        else if (GetLevelByClass(CLASS_TYPE_MONK, oPC))     STARTING_GOLD = d4(5);

        else if (GetLevelByClass(CLASS_TYPE_PALADIN, oPC))  STARTING_GOLD = d4(6)*10;

        else if (GetLevelByClass(CLASS_TYPE_RANGER, oPC))   STARTING_GOLD = d4(6)*10;

        else if (GetLevelByClass(CLASS_TYPE_ROGUE, oPC))    STARTING_GOLD = d4(5)*10;

        else if (GetLevelByClass(CLASS_TYPE_SORCERER, oPC)) STARTING_GOLD = d4(3)*10;

        else if (GetLevelByClass(CLASS_TYPE_WIZARD, oPC))   STARTING_GOLD = d4(3)*10;

        else STARTING_GOLD = d4(4)*10;

        }

        AssignCommand(oPC, DelayCommand(3.6, TakeGoldFromCreature(GetGold(oPC), oPC, FALSE)));

        AssignCommand(oPC, DelayCommand(3.8, GiveGoldToCreature(oPC, STARTING_GOLD)));

    }

 

// Set up PC with proper racial movement rate if system is turned on

if (GetLocalInt(oMod,"RacialMovement")==1)

    {

    SetRacialMovementRate(oPC);

    }

 

/* ===== PC pseudo-heartbeat ====

DOA Gold Encumbrance System 1.0   */

if (GetLocalInt(oMod,"GoldEncumbrance")==1)

    {

    GoldHrtbt(oPC);

 

    // Get the creature who triggered this event.

    object oPC = GetEnteringObject();

 

    // Only fire for (real) PCs.

    if ( !GetIsPC(oPC)  ||  GetIsDMPossessed(oPC) )

        return;

 

    // Update all players' journals.

    AddJournalQuestEntry("RULES", 1, oPC, FALSE, TRUE);

 

    // Update the party's journals.

    AddJournalQuestEntry("GAME INFO", 1, oPC);

}

 

ExecuteScript ("cnr_module_oce", OBJECT_SELF);

 

 

//Looks at the trade journal and adjusts the player's reputations based on the variables stored there.

RestoreReputations(oPC);

//The very first time a player enters this sets their reputations

NewCharacter_SetReputations(oPC);

}


 


 



 



               
               

               
            

Legacy_KMdS!

  • Sr. Member
  • ****
  • Posts: 364
  • Karma: +0/-0
Give RP award item storage thingie on client enter?
« Reply #1 on: June 09, 2016, 03:59:21 pm »


               


Place this couple of lines of code to drop the item in the players inventory


 


 




    if(GetItemPossessedBy(oPC, "rp_awards") == OBJECT_INVALID)
        CreateItemOnObject("resref_of_item", oPC);



You need to put in the resref of the item you wish created whee indicated in the code.


               
               

               
            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Give RP award item storage thingie on client enter?
« Reply #2 on: June 14, 2016, 06:01:53 pm »


               

thank you so much!! '<img'>