Initial Upload
Initial Upload
This commit is contained in:
93
_module/nss/_oncliententer.nss
Normal file
93
_module/nss/_oncliententer.nss
Normal file
@@ -0,0 +1,93 @@
|
||||
void Login(object oPC)
|
||||
{
|
||||
object oPC = GetEnteringObject();
|
||||
|
||||
if (!GetIsPC(oPC)) return;
|
||||
|
||||
string sPrint;
|
||||
sPrint = "Player Name: "+ GetName(oPC)+"\n";
|
||||
sPrint =sPrint + "Player IP Address: "+ GetPCIPAddress(oPC)+"\n";
|
||||
sPrint =sPrint + "Player Logon: "+ GetPCPlayerName(oPC)+"\n";
|
||||
sPrint =sPrint + "Player CDKEY: "+ GetPCPublicCDKey(oPC)+"\n";
|
||||
sPrint =sPrint + "\n";
|
||||
PrintString(sPrint);
|
||||
SendMessageToPC(oPC,"User Details Recorded");
|
||||
|
||||
if (GetLocalInt(oPC,"PCDead")==1)
|
||||
{
|
||||
effect eKill = EffectDeath(TRUE);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT,eKill,oPC);
|
||||
}
|
||||
//xp loss quest
|
||||
int nInt = GetCampaignInt("deathquest","exp_loss",oPC);
|
||||
if(nInt==1)
|
||||
{
|
||||
ExecuteScript("lose_xp_quest_oc",oPC);
|
||||
}
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
int index, iLev, iCurLev;
|
||||
object oPC = GetEnteringObject();
|
||||
sLevels = GetCampaignString( "mycampaign", GetName( oPC ) + "Levels" );
|
||||
if ( sLevels != "" )
|
||||
{
|
||||
iCurLev = GetCurrentHitPoints( oPC );
|
||||
iLev = FindPreviousLevel( "HP=" );
|
||||
if ( iLev > -100 && iCurLev > iLev )
|
||||
{
|
||||
effect eDamage = EffectDamage( iCurLev - iLev, DAMAGE_TYPE_DIVINE, DAMAGE_POWER_ENERGY );
|
||||
ApplyEffectToObject( DURATION_TYPE_INSTANT, eDamage, oPC );
|
||||
}
|
||||
for( index = 0; index < 622; index++ )
|
||||
{
|
||||
iCurLev = GetHasSpell( index, oPC );
|
||||
if ( iCurLev > 0 )
|
||||
{
|
||||
iLev = FindPreviousLevel( "S" + IntToString( index ) + "=" );
|
||||
if ( iLev == -100 )
|
||||
iLev = 0;
|
||||
while ( iLev < iCurLev )
|
||||
{
|
||||
DecrementRemainingSpellUses( oPC, index );
|
||||
iLev++;
|
||||
}
|
||||
}
|
||||
}
|
||||
for( index = 0; index < 480; index++ )
|
||||
{
|
||||
iCurLev = GetHasFeat( index, oPC );
|
||||
if ( iCurLev > 0 )
|
||||
{
|
||||
iLev = FindPreviousLevel( "F" + IntToString( index ) + "=" );
|
||||
if ( iLev == -100 )
|
||||
iLev = 0;
|
||||
while ( iLev < iCurLev )
|
||||
{
|
||||
DecrementRemainingFeatUses( oPC, index );
|
||||
iLev++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Login(oPC);
|
||||
}
|
Reference in New Issue
Block a user