On entering server, help. (Toolset)
Casper
Member Posts: 11
I am trying to make it to where characters get gold ONE time when entering the server. How do i do such? This is my script on enter in module properties. Thank you!
//MODULE ONENTER SCRIPT/////////////////
#include "omw_plns"
//#include "pqj_inc"
#include "inc_gsystem_evnt"
#include "10_inc_modsystem"
#include "gz_inc_db"
#include "horse_include"
#include "cin_subr_func"
void main()
{
//Horse System:
object oPC = GetEnteringObject();
GPA_HorseOCE(oPC);
SubraceOnClientEnter(oPC);
//Talus Listener System:
ExecuteScript("lds_module_cli_e", GetModule());
//Higher Ground Legendary Levels:
ExecuteScript ("hgll_cliententer", OBJECT_SELF);
//Player Guild System v3.7b:
PGSModuleClientEnterEvent (GetEnteringObject());
//OMW Loot Notification System:
DelayCommand(6.0, PLNSLoadNotificationOnClientEnter(oPC));
//Knat's Persistant Journal Entries:
//RebuildJournalQuestEntries(oPC);
//Nexus Ring Remove:
//ExecuteScript ("04_nexring_oe", OBJECT_SELF);
//Give Netheria Newspaper to PC.
ExecuteScript ("04_nethnews_oe", OBJECT_SELF);
//Nexus Stone Give:
DelayCommand (2.0, ExecuteScript ("04_nexstone_oe", OBJECT_SELF));
// HunterAP's Housing System OnEnter Event:
ExecuteScript ("hh_mod_enter", OBJECT_SELF);
//Henchmen:
ExecuteScript ("69_client_enter", OBJECT_SELF);
// Kill dead PCs
if (!GetIsDM(oPC))
{
GTRestorePlayerStatus(oPC);
// ECL Notification
CinSetECLModifier(oPC);
DestroySkin(oPC);
}
}
//MODULE ONENTER SCRIPT/////////////////
#include "omw_plns"
//#include "pqj_inc"
#include "inc_gsystem_evnt"
#include "10_inc_modsystem"
#include "gz_inc_db"
#include "horse_include"
#include "cin_subr_func"
void main()
{
//Horse System:
object oPC = GetEnteringObject();
GPA_HorseOCE(oPC);
SubraceOnClientEnter(oPC);
//Talus Listener System:
ExecuteScript("lds_module_cli_e", GetModule());
//Higher Ground Legendary Levels:
ExecuteScript ("hgll_cliententer", OBJECT_SELF);
//Player Guild System v3.7b:
PGSModuleClientEnterEvent (GetEnteringObject());
//OMW Loot Notification System:
DelayCommand(6.0, PLNSLoadNotificationOnClientEnter(oPC));
//Knat's Persistant Journal Entries:
//RebuildJournalQuestEntries(oPC);
//Nexus Ring Remove:
//ExecuteScript ("04_nexring_oe", OBJECT_SELF);
//Give Netheria Newspaper to PC.
ExecuteScript ("04_nethnews_oe", OBJECT_SELF);
//Nexus Stone Give:
DelayCommand (2.0, ExecuteScript ("04_nexstone_oe", OBJECT_SELF));
// HunterAP's Housing System OnEnter Event:
ExecuteScript ("hh_mod_enter", OBJECT_SELF);
//Henchmen:
ExecuteScript ("69_client_enter", OBJECT_SELF);
// Kill dead PCs
if (!GetIsDM(oPC))
{
GTRestorePlayerStatus(oPC);
// ECL Notification
CinSetECLModifier(oPC);
DestroySkin(oPC);
}
}
Post edited by Casper on
0
Comments
void main()
{
object oPC = GetEnteringObject();
//check if it's a new new character by xp amount
if (GetXP(oPC) == 0)
{
//replace 10 with the gold you want to give
GiveGoldToCreature(oPC, 10 - GetGold(oPC));
//give them 1xp to prevent them from relogging to get more gold
if (GetXP(oPC) == 0)
SetXP(oPC, 1);
}
}
You can have this run by adding an execute script from your current on enter script. So, if you named this script "enter_givegold," You would add this line to your on enter script: ExecuteScript ("enter_givegold", OBJECT_SELF);
{
object oPC = GetEnteringObject();
//check if it's a new new character by xp amount
if (GetXP(oPC) == 0)
{
//replace 10 with the gold you want to give
GiveGoldToCreature(oPC, 10);
//give them 1xp to prevent them from relogging to get more gold
if (GetXP(oPC) == 0)
SetXP(oPC, 1);
}
}
This might be better if the latter doesn't work.
And then place it here:
SubraceOnClientEnter(oPC);
//Talus Listener System:
ExecuteScript("lds_module_cli_e", GetModule());
//give gold
ExecuteScript ("enter_givegold", OBJECT_SELF);
//Higher Ground Legendary Levels:
It would be better to save a var with value 1 into your DB instead, after all the initial "one time only" PC stuff is done.
Or save the var on some plot-nodrop item.
If you are actually providing your characters a player wand that allows them to access a menu of features then simply checking for the existence of that wand is enough. Assuming the player wand has all the plot and no-drop flags set from the item palette, then if the tag (and resref for simplicity) of the wand is "this_is_a_pc_wand" the following should work: This example creates a player wand that was mentioned in one of the threads about this. It only works if the player does not have such a wand, hence it will only ever work once. The example gives 100 gold, change the value as needed, nobody knows what a certain value is, only the person running the module knows what a certain value is, it could be 1, 100, or maybe 999. You set that value yourself.
It all depends on the circumstances of your module. Like if there is or isn't exp loss, what database you're using, if your characters have wands or data tracking items.