Initial Upload
Initial Upload
This commit is contained in:
91
_module/nss/m_oncliententer.nss
Normal file
91
_module/nss/m_oncliententer.nss
Normal file
@@ -0,0 +1,91 @@
|
||||
#include "lod_include"
|
||||
#include "nw_i0_plot"
|
||||
|
||||
string sLevels;
|
||||
int FindPreviousLevel( string sVar )
|
||||
{
|
||||
string sTmp;
|
||||
int iPos = FindSubString( sLevels, sVar );
|
||||
if ( iPos > -1 )
|
||||
{
|
||||
iPos += GetStringLength( sVar);
|
||||
while ( GetSubString( sLevels, iPos, 1 ) != ";" )
|
||||
sTmp += GetSubString( sLevels, iPos++, 1 );
|
||||
if ( sTmp != "" )
|
||||
{
|
||||
return StringToInt( sTmp );
|
||||
}
|
||||
}
|
||||
return -100;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
object oEnteringPlayer = GetEnteringObject();
|
||||
|
||||
int bIsDead = GetCampaignInt("p_death","is_dead",oEnteringPlayer);
|
||||
int bAlreadyJoinedThisReset = GetLocalInt(oEnteringPlayer, "alreadyJoined");
|
||||
|
||||
string sIP = GetPCIPAddress(oEnteringPlayer);
|
||||
WriteTimestampedLogEntry(sIP);
|
||||
|
||||
if(!bAlreadyJoinedThisReset)
|
||||
{
|
||||
FloatingTextStringOnCreature("Please Read your Rules!", oEnteringPlayer, FALSE);
|
||||
|
||||
// Add Journal entries
|
||||
AddJournalQuestEntry("rules1", 1, oEnteringPlayer, FALSE, FALSE, FALSE);
|
||||
AddJournalQuestEntry("rules2", 1, oEnteringPlayer, FALSE, FALSE, FALSE);
|
||||
AddJournalQuestEntry("BannedList", 1, oEnteringPlayer, FALSE, FALSE, FALSE);
|
||||
AddJournalQuestEntry("forum", 1, oEnteringPlayer, FALSE, FALSE, FALSE);
|
||||
}
|
||||
|
||||
// This is to relate to the new check for the 5k gold for new char
|
||||
if (GetXP(oEnteringPlayer) == 0)
|
||||
{
|
||||
GiveGoldToCreature(oEnteringPlayer, 5000);
|
||||
GiveXPToCreature(oEnteringPlayer, 1);
|
||||
}
|
||||
|
||||
string sName = GetPCPlayerName(oEnteringPlayer);
|
||||
|
||||
//SoulFlame - Added to simplify the DM check function. DM's should be added in
|
||||
// the IsLodDM function of elv_guildchecker
|
||||
if(IsLodDM(sName))
|
||||
{
|
||||
SetLocalInt(oEnteringPlayer, "IsDm", TRUE);
|
||||
}
|
||||
|
||||
SetLocalInt(oEnteringPlayer, "sBleeding", TRUE);
|
||||
|
||||
if(bIsDead == TRUE)
|
||||
{
|
||||
ApplyPenalty(oEnteringPlayer);
|
||||
SetCampaignInt("p_death","is_dead",FALSE,oEnteringPlayer);
|
||||
|
||||
if(bAlreadyJoinedThisReset)
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDamage(GetCurrentHitPoints(oEnteringPlayer), DAMAGE_TYPE_DIVINE), oEnteringPlayer);
|
||||
}
|
||||
|
||||
if(!bAlreadyJoinedThisReset)
|
||||
SetLocalInt(oEnteringPlayer, "alreadyJoined", TRUE);
|
||||
|
||||
//Balance Hide
|
||||
//Ba'al
|
||||
|
||||
|
||||
|
||||
int index, iLev, iCurLev;
|
||||
sLevels = GetCampaignString( "mycampaign", GetPCPlayerName( oEnteringPlayer ) + GetName( oEnteringPlayer ) + "Levels" );
|
||||
if ( sLevels != "" )
|
||||
{
|
||||
iCurLev = GetCurrentHitPoints( oEnteringPlayer );
|
||||
iLev = FindPreviousLevel( "HP=" );
|
||||
|
||||
if ( iLev > -100 && iCurLev > iLev )
|
||||
{
|
||||
effect eDamage = EffectDamage( iCurLev - iLev, DAMAGE_TYPE_DIVINE, DAMAGE_POWER_ENERGY );
|
||||
ApplyEffectToObject( DURATION_TYPE_INSTANT, eDamage, oEnteringPlayer );
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user