88 lines
2.1 KiB
Plaintext
88 lines
2.1 KiB
Plaintext
void Login(object oPC)
|
|
{
|
|
object oPC = GetEnteringObject();
|
|
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);
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
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);
|
|
}
|