//Hardcore Client Entering
//Archaegeo 2002 Jun 24
//
// This script goes in OnClientEnter in Module Properties - Events
// It checks to see if they have a Death Amulet on them, and if so
// It sets thier player state to Dead and rekills them.
#include "NW_I0_GENERIC"
#include "hc_inc_on_enter"
#include "hc_text_enter"
#include "anph_inc"
#include "anph_persist_inc"
#include "anph_level_inc"
#include "zep_inc_phenos2"
#include "tk_hips_inc"
#include "moth_inc_effects"
#include "moth_inc_spells"
#include "moth_inc"
#include "cs_persmap__inc"
#include "x3_inc_horse"
void HCRBoot(object oPC, string sReason)
{
SendMessageToPC(oPC,sReason);
DelayCommand(3.0,BootPC(oPC));
}
void UpdateLikeDislike (object oPC)
{
CheckPlayerTeam (oPC);
}
void CreateItemOnPlayer (object oPC, string sResRef)
{
CreateItemOnObject(sResRef, oPC);
}
void main()
{
object oMod = GetModule();
object oPC = GetEnteringObject();
string sArea = GetTag(GetArea(oPC));
//--------1.69 Horses------------------
ExecuteScript("x3_mod_pre_enter",OBJECT_SELF); // Override for other skin systems
if ((GetIsPC(oPC)||GetIsDM(oPC))&&!GetHasFeat(FEAT_HORSE_MENU,oPC))
{ // add horse menu
HorseAddHorseMenu(oPC);
if (GetLocalInt(GetModule(),"X3_ENABLE_MOUNT_DB"))
{ // restore PC horse status from database
DelayCommand(2.0,HorseReloadFromDatabase(oPC,X3_HORSE_DATABASE));
} // restore PC horse status from database
} // add horse menu
if (GetIsPC(oPC))
{ // more details
// restore appearance in case you export your character in mounted form, etc.
if (!GetSkinInt(oPC,"bX3_IS_MOUNTED")) HorseIfNotDefaultAppearanceChange(oPC);
// pre-cache horse animations for player as attaching a tail to the model
HorsePreloadAnimations(oPC);
DelayCommand(3.0,HorseRestoreHenchmenLocations(oPC));
} // more details
// End 1.69 Horse
MothSetFactionInt(oPC);
MothRemovePolymorph(oPC);
MothDontStealDacksKey(oPC);
RemoveRelics(oPC);
TK_HiPS_OnClientEnter(oPC);
zep_Dismount(oPC);
MothSetIsPMCaster(oPC);
MothBonuses(oPC);
MothGiveJournal(oPC);
MothTimeLockCleaner(oPC);
MothBanWandCheck(oPC,oMod);
//MothPPCheck(oPC,oMod);
LoadPersistentMapPins(oPC);
MothSetShifterLevels(oPC);
MothSetRDDLevels(oPC);
MothRestorePlotWeapon(oPC);
SetPanelButtonFlash(oPC,PANEL_BUTTON_JOURNAL,FALSE);
MothDislikeSecondaryFaction(oPC);
MothSetDomain(oPC);
int nPKT = GetLocalInt(oMod,"PKTRACKER");
int nDM = GetIsDM(oPC);
string sCDK = GetPCPublicCDKey(oPC);
string sPlayerName = GetPCPlayerName(oPC);
string sName = GetName(oPC);
int iStripItems = FALSE;
int iLvl;
//--------------------------------------------------------------------------
// DMReserve
//--------------------------------------------------------------------------
if(GetLocalInt(oMod,"DMRESERVE"))
{
int nC;
object oPlayers=GetFirstPC();
if(!nDM)
{
while(GetIsObjectValid(oPlayers))
{
if(!GetIsDM(oPlayers)) nC++;
oPlayers=GetNextPC();
}
}
if(nC > GetLocalInt(oMod,"DMRESERVE") && nDM==FALSE)
{
HCRBoot(oPC,DMRES);
postEvent();
return;
}
}
if (GetIsPC (oPC) && !GetXP (oPC) && !GetIsDM (oPC))
iStripItems = TRUE;
//--------------------------------------------------------------------------
// Factions
//--------------------------------------------------------------------------
// Remember Factions.
if (GetAnphInt (AnphPCID (oPC) + "LamirFaction") == 1){
object oLamirFaction = GetObjectByTag ("LamirFaction");
AdjustReputation (oPC, oLamirFaction, 1);
}
if (GetAnphInt (AnphPCID (oPC) + "RanzingtonFaction") == 1){
object oRanzingtonFaction = GetObjectByTag ("RanzingtonFaction");
AdjustReputation (oPC, oRanzingtonFaction, 1);
}
// RememberedHP is set in the heartbeat.
int nKnown = GetLocalInt (oMod, sName + sPlayerName + "RHP");
if (nKnown == 1)
{
int nHitPoints = GetLocalInt (oMod, sName + sPlayerName + "CHP");
int nCurHitPoints = GetCurrentHitPoints (oPC);
int nDam = nCurHitPoints - nHitPoints;
if (nHitPoints <>
{
effect eDam = EffectDamage(nCurHitPoints + 50, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_FIVE);
ATS_InitializePlayer(oPC);
DelayCommand(5.0, ApplyEffectToObject (DURATION_TYPE_INSTANT, eDam, oPC));
}
else if (nDam > 0)
{
effect eDam = EffectDamage (nDam, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_TWENTY);
DelayCommand (3.0, ApplyEffectToObject (DURATION_TYPE_INSTANT, eDam, oPC));
}
}
//--------------------------------------------------------------------------
// DM Wands
//--------------------------------------------------------------------------
if (nDM)
{
// Give DM's a HCR Helper in inventory
if(GetIsObjectValid(GetItemPossessedBy(oPC,"DMsHelper"))==FALSE)
CreateItemOnObject("DMsHelper", oPC);
if(GetIsObjectValid(GetItemPossessedBy(oPC,"WandOfFX"))==FALSE)
CreateItemOnObject("wandoffx", oPC);
if(!GetIsObjectValid(GetItemPossessedBy(oPC,"XPWand")))
CreateItemOnObject("xpwand", oPC);
if(!GetIsObjectValid(GetItemPossessedBy(oPC,"ATS_D_DMSW_N_NON")))
CreateItemOnObject("ats_d_dmsw_n_non", oPC);
}
//--------------------------------------------------------------------------
// New player?
//--------------------------------------------------------------------------
if (!GetXP (oPC)) SetXP (oPC, 1);
//--------------------------------------------------------------------------
// Log
//--------------------------------------------------------------------------
WriteTimestampedLogEntry (" Player Enter 1:"+ GetPCPlayerName(oPC) +
", Handle:" + GetName(oPC) +
", CD KEY:" + GetPCPublicCDKey(oPC)+
", IP:" + GetPCIPAddress(oPC) +
", XP:" + IntToString(GetXP(oPC))+
", Level:" + IntToString(GetCharacterLevel(oPC)) );
WriteTimestampedLogEntry (" Player Enter 2:"+ GetPCPlayerName(oPC) +
", Gender:" + IntToString(GetGender(oPC))+
", Race:" + IntToString(GetRacialType(oPC))+"/"+GetRace(GetRacialType(oPC))+
", Gold:" + IntToString(GetGold(oPC))+
", class:" + Getclass( oPC )+
", Faction:" + IntToString(AnphFastGetPlayerTeamInt(oPC))+"/"+AnphGetPlayerTeam(oPC)+"/"+AnphFastGetPlayerTeam(oPC) );
// Send a message to DMs and write CD-key to variable
SaveLevelsOnPC(oPC);
string sCDkey = GetPCPublicCDKey(oPC);
DelayCommand(2.5, SendMessageToAllDMs("** Player " + sPlayerName + ", Char " + GetName(oPC) + ", CD-Key " + sCDkey + " joined.\\nXP: " + IntToString(GetXP(oPC)) + " (" + CreateLevelUpMessage(oPC, TRUE) + "). Gold: " + IntToString(GetGold(oPC))+ "."));
DelayCommand(5.0, DeleteLevelsOnPC(oPC));
SetLocalString(GetModule(), GetName(oPC) + "CDKey", GetPCPublicCDKey(oPC));
SetLocalString(GetModule(), GetName(oPC) + "PlayerName", GetPCPlayerName(oPC));
//--------------------------------------------------------------------------
// Send a login message to all players if one exists
//--------------------------------------------------------------------------
if(GetLocalString(oMod,"LOGINMESSAGE") != "NONE")
SendMessageToPC(oPC,GetLocalString(oMod,"LOGINMESSAGE"));
//--------------------------------------------------------------------------
// Update player faction
//--------------------------------------------------------------------------
DelayCommand(10.0, UpdateLikeDislike (oPC));
DelayCommand(8.0,MothUpdateHideFeats(oPC));
if (GetIsObjectValid(GetItemPossessedBy(oPC, "Banished")))
{
object oFaction01Member = GetObjectByTag (GetLocalString(oMod, "FACTION_01_FACTIONOBJECT")); // Cleaven
object oFaction02Member = GetObjectByTag (GetLocalString(oMod, "FACTION_02_FACTIONOBJECT")); // Axfell
object oFaction03Member = GetObjectByTag (GetLocalString(oMod, "FACTION_03_FACTIONOBJECT")); // Ranzington
object oFaction04Member = GetObjectByTag (GetLocalString(oMod, "FACTION_04_FACTIONOBJECT")); // Drow
object oFaction05Member = GetObjectByTag (GetLocalString(oMod, "FACTION_05_FACTIONOBJECT")); // -inactive-
AdjustReputation (oPC, oFaction01Member, -100);
AdjustReputation (oPC, oFaction02Member, -100);
AdjustReputation (oPC, oFaction03Member, -100);
AdjustReputation (oPC, oFaction04Member, -100);
AdjustReputation (oPC, oFaction05Member, -100);
}
}