Tips25

Last-modified: 2011-08-29 (月) 15:26:23

殺人カウントの減少間隔(バグ修正含む)

  • カテゴリー: 設定
  • 重要性: 普通
  • 投稿日: 2005-08-11 (木) 21:01:18

殺人カウントは通常長期40時間、短期8時間で減少します。 Scripts\Mobiles\PlayerMobile.cs

public override void Serialize( GenericWriter writer )
//decay our kills
if ( m_ShortTermElapse < this.GameTime )
{
m_ShortTermElapse += TimeSpan.FromHours( 8 );
if ( ShortTermMurders > 0 )
--ShortTermMurders;
}

if ( m_LongTermElapse < this.GameTime )
{
m_LongTermElapse += TimeSpan.FromHours( 40 );
if ( Kills > 0 )
--Kills;
}
public void ResetKillTime()
{
m_ShortTermElapse = this.GameTime + TimeSpan.FromHours( 8 );
m_LongTermElapse = this.GameTime + TimeSpan.FromHours( 40 );
}

バグ修正

PlayerMobile.cs

public PlayerMobile()
{
m_VisList = new ArrayList();
m_PermaFlags = new ArrayList();
m_AntiMacroTable = new Hashtable();

m_BOBFilter = new Engines.BulkOrders.BOBFilter();

m_GameTime = TimeSpan.Zero;
//m_ShortTermElapse = TimeSpan.FromHours( 8.0 );
//m_LongTermElapse = TimeSpan.FromHours( 40.0 );
m_ShortTermElapse = m_ShortTerm;
m_LongTermElapse = m_LongTerm;

m_JusticeProtectors = new ArrayList();

InvalidateMyRunUO();
}
private static TimeSpan m_ShortTerm = TimeSpan.FromHours( 8.0 );//短期カウント減少時間
private static TimeSpan m_LongTerm = TimeSpan.FromHours( 40.0 );//長期カウント減少時間
public override void Serialize( GenericWriter writer )
{
//cleanup our anti-macro table
foreach ( Hashtable t in m_AntiMacroTable.Values )
{
ArrayList remove = new ArrayList();
foreach ( CountAndTimeStamp time in t.Values )
{
if ( time.TimeStamp + SkillCheck.AntiMacroExpire <= DateTime.Now )
remove.Add( time );
}

for (int i=0;i<remove.Count;++i)
t.Remove( remove[i] );
}

//decay our kills
TimeSpan elapse = this.GameTime - m_ShortTermElapse;
if ( elapse < TimeSpan.Zero )
elapse = TimeSpan.Zero;

while ( elapse > m_ShortTerm )
{
elapse -= m_ShortTerm;
if ( ShortTermMurders > 0 )
--ShortTermMurders;
}
m_ShortTermElapse = this.GameTime - elapse;

elapse = this.GameTime - m_LongTermElapse;
if ( elapse < TimeSpan.Zero )
elapse = TimeSpan.Zero;

while ( elapse > m_LongTerm )
{
elapse -= m_LongTerm;
if ( Kills > 0 )
--Kills;
}
m_LongTermElapse = this.GameTime - elapse;
/*
if ( m_ShortTermElapse < this.GameTime )
{
m_ShortTermElapse += TimeSpan.FromHours( 8 );
if ( ShortTermMurders > 0 )
--ShortTermMurders;
}

if ( m_LongTermElapse < this.GameTime )
{
m_LongTermElapse += TimeSpan.FromHours( 40 );
if ( Kills > 0 )
--Kills;
}
*/
public void ResetKillTime()
{
//m_ShortTermElapse = this.GameTime + TimeSpan.FromHours( 8 );
//m_LongTermElapse = this.GameTime + TimeSpan.FromHours( 40 );
m_ShortTermElapse = this.GameTime;
m_LongTermElapse = this.GameTime;
}