RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

{Beta 34} {Playermobile.cs} Errors

S

Seven

Guest
{Beta 34} {Playermobile.cs} Errors

Im having some trouble. here are my errors and playermobile.cs The playermobile.cs Will be on a different post.
Errors :

EDITED : NEW ERRORS!
[code:1]
- Warning: Scripts\Custom\QuestKeeper\QuestControlStones\QuestStoneVirtueVortex
.cs: CS0162: (line 43, column 50) Unreachable code detected
- Warning: Scripts\Custom\QuestKeeper\QuestControlStones\QuestStoneVirtueVortex
.cs: CS0162: (line 44, column 52) Unreachable code detected
- Warning: Scripts\Custom\QuestKeeper\QuestControlStones\QuestStoneVirtueVortex
.cs: CS0162: (line 45, column 51) Unreachable code detected
- Warning: Scripts\Custom\QuestKeeper\QuestControlStones\QuestStoneVirtueVortex
.cs: CS0162: (line 46, column 45) Unreachable code detected
- Warning: Scripts\Custom\FortuneTellerQuests\Items\TamireyasGem.cs: CS0162: (l
ine 40, column 4) Unreachable code detected
- Warning: Scripts\Custom\chat.cs: CS0219: (line 19, column 17) The variable 's
endText' is assigned but its value is never used
- Warning: Scripts\Custom\Gypsy.cs: CS0183: (line 122, column 56) The given exp
ression is always of the provided ('Server.Mobiles.TheFortuneTeller') type
- Warning: Scripts\Custom\motd.cs: CS0183: (line 58, column 18) The given expre
ssion is always of the provided ('Server.Mobiles.PlayerMobile') type
- Warning: Scripts\Custom\Pointsystem.cs: CS0183: (line 61, column 13) The give
n expression is always of the provided ('Server.Mobiles.PlayerMobile') type
- Warning: Scripts\Custom\SupplyStone.cs: CS0642: (line 30, column 59) Possible
mistaken null statement
- Warning: Scripts\Custom\TravelStone.cs: CS0642: (line 28, column 59) Possible
mistaken null statement
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.

[/code:1]
 
S

Seven

Guest
Here is the {Beta 34} {Playermobile.cs} Script.
Playermobile.cs

[code:1]
using System;
using System.Collections;
using Server;
using Server.Misc;
using Server.Items;
using Server.Gumps;
using Server.Multis;
using Server.Engines.Help;
using Server.ContextMenus;
using Server.Network;
using Server.Spells;
using Server.Spells.Fifth;
using Server.Spells.Seventh;
using Server.Targeting;

namespace Server.Mobiles
{
[Flags]
public enum PlayerFlag // First 16 bits are reserved for default-distro use, start custom flags at 0x00010000
{
None = 0x00000000,
Glassblowing = 0x00000001,
Masonry = 0x00000002,
SandMining = 0x00000004,
StoneMining = 0x00000008,
ToggleMiningStone = 0x00000010,
KarmaLocked = 0x00000020,
AutoRenewInsurance = 0x00000040,
UseOwnFilter = 0x00000080
}

public enum NpcGuild
{
None,
MagesGuild,
WarriorsGuild,
ThievesGuild,
RangersGuild,
HealersGuild,
MinersGuild,
MerchantsGuild,
TinkersGuild,
TailorsGuild,
FishermensGuild,
BardsGuild,
BlacksmithsGuild
}

public class PlayerMobile : Mobile
{


// Tourny Points
private int m_TPoints = 0;
private int minTPoints = 0;
[CommandProperty(AccessLevel.Counselor)]
public int TPoints
{
get{return m_TPoints;}
set{m_TPoints = value;}
}
public void SubTPoints(int chunk){
if((m_TPoints - chunk) > minTPoints){
m_TPoints -= chunk;
}else{
m_TPoints = minTPoints;
}
}
public void AddTPoints(int chunk){
m_TPoints += chunk;
}
public bool HasEnoughTPoints(int chunk){
if((m_TPoints - chunk) < 0){
return false; //does not have enough points
}else{
return true; //has enough points
}
}
// End Tourny Points
// Point System
private int m_Points = 0;
private int minPoints = -3;
private ArrayList killers = new ArrayList();

//here are your variables to store the needed info

public void AddKiller( PlayerMobile killer){
killers.Add(killer);
}

//this function is to add a killer to the list to check later if he has killed you within 4 hours

public void RemoveKiller( PlayerMobile killer){
killers.Remove(killer);
}

//after 4 hours, remove the killer

public bool KillerIsTimed( PlayerMobile killer){
return killers.Contains(killer);
}

//this is the function that looks to see if the killer is already in the list

[CommandProperty(AccessLevel.Counselor)]
public int Points{
get{return m_Points;}
set{m_Points = value;}
}

//this is the in game properties set up, when you [props on a player you will see Points as one of setable variables on each player

public int GetPoints(){ return m_Points; }
public void AddPoint(){ m_Points++; }
public void SubPoint(){
if(m_Points > minPoints){
m_Points--;
}
}

//these are the standard adding and subtracting functions for regular combat scenarios

public void SubPoints(int chunk){
if((m_Points - chunk) > minPoints){
m_Points -= chunk;
}else{
m_Points = minPoints;
}
}
public void AddPoints(int chunk){
m_Points += chunk;
}

//these two functions are for later when we impliment being able to officially set a duel for points with other players. You will be bet how many points (up to as many as you have) will be wagered on the duel.

public bool HasEnoughPoints(int chunk){
if((m_Points - chunk) < 0){
return false; //does not have enough points
}else{
return true; //has enough points
}
}

//this is a check for our points vendor, which you can use your points to buy cool stuff from

public bool HasMoreThanMin(int chunk){
if((m_Points - chunk) < minPoints){
return false;
}else{
return true;
}
}

//this is a check to see if the player has hit minimum points yet, if he has, no more points will be removed.
//End Point System


private class CountAndTimeStamp
{
private int m_Count;
private DateTime m_Stamp;

public CountAndTimeStamp()
{
}

public DateTime TimeStamp { get{ return m_Stamp; } }
public int Count
{
get { return m_Count; }
set { m_Count = value; m_Stamp = DateTime.Now; }
}
}

private DesignContext m_DesignContext;

private NpcGuild m_NpcGuild;
private DateTime m_NpcGuildJoinTime;
private TimeSpan m_NpcGuildGameTime;
private PlayerFlag m_Flags;
private int m_StepsTaken;

public int StepsTaken
{
get{ return m_StepsTaken; }
set{ m_StepsTaken = value; }
}

[CommandProperty( AccessLevel.GameMaster )]
public NpcGuild NpcGuild
{
get{ return m_NpcGuild; }
set{ m_NpcGuild = value; }
}

[CommandProperty( AccessLevel.GameMaster )]
public DateTime NpcGuildJoinTime
{
get{ return m_NpcGuildJoinTime; }
set{ m_NpcGuildJoinTime = value; }
}

[CommandProperty( AccessLevel.GameMaster )]
public TimeSpan NpcGuildGameTime
{
get{ return m_NpcGuildGameTime; }
set{ m_NpcGuildGameTime = value; }
}

public PlayerFlag Flags
{
get{ return m_Flags; }
set{ m_Flags = value; }
}

[CommandProperty( AccessLevel.GameMaster )]
public bool Glassblowing
{
get{ return GetFlag( PlayerFlag.Glassblowing ); }
set{ SetFlag( PlayerFlag.Glassblowing, value ); }
}

[CommandProperty( AccessLevel.GameMaster )]
public bool Masonry
{
get{ return GetFlag( PlayerFlag.Masonry ); }
set{ SetFlag( PlayerFlag.Masonry, value ); }
}

[CommandProperty( AccessLevel.GameMaster )]
public bool SandMining
{
get{ return GetFlag( PlayerFlag.SandMining ); }
set{ SetFlag( PlayerFlag.SandMining, value ); }
}

[CommandProperty( AccessLevel.GameMaster )]
public bool StoneMining
{
get{ return GetFlag( PlayerFlag.StoneMining ); }
set{ SetFlag( PlayerFlag.StoneMining, value ); }
}

[CommandProperty( AccessLevel.GameMaster )]
public bool ToggleMiningStone
{
get{ return GetFlag( PlayerFlag.ToggleMiningStone ); }
set{ SetFlag( PlayerFlag.ToggleMiningStone, value ); }
}

[CommandProperty( AccessLevel.GameMaster )]
public bool KarmaLocked
{
get{ return GetFlag( PlayerFlag.KarmaLocked ); }
set{ SetFlag( PlayerFlag.KarmaLocked, value ); }
}

[CommandProperty( AccessLevel.GameMaster )]
public bool AutoRenewInsurance
{
get{ return GetFlag( PlayerFlag.AutoRenewInsurance ); }
set{ SetFlag( PlayerFlag.AutoRenewInsurance, value ); }
}

[CommandProperty( AccessLevel.GameMaster )]
public bool UseOwnFilter
{
get{ return GetFlag( PlayerFlag.UseOwnFilter ); }
set{ SetFlag( PlayerFlag.UseOwnFilter, value ); }
}

public bool GetFlag( PlayerFlag flag )
{
return ( (m_Flags & flag) != 0 );
}

public void SetFlag( PlayerFlag flag, bool value )
{
if ( value )
m_Flags |= flag;
else
m_Flags &= ~flag;
}

public DesignContext DesignContext
{
get{ return m_DesignContext; }
set{ m_DesignContext = value; }
}

public static void Initialize()
{
EventSink.Login += new LoginEventHandler( OnLogin );
EventSink.Logout += new LogoutEventHandler( OnLogout );
EventSink.Disconnected += new DisconnectedEventHandler(EventSink_Disconnected);
}

public override void OnSkillInvalidated( Skill skill )
{
if ( Core.AOS && skill.SkillName == SkillName.MagicResist )
UpdateResistances();
}

public override int GetMaxResistance( ResistanceType type )
{
int max = base.GetMaxResistance( type );

if ( 60 < max && Spells.Fourth.CurseSpell.UnderEffect( this ) )
max = 60;

return max;
}

public override int GetMinResistance( ResistanceType type )
{
int magicResist = (int)(Skills[SkillName.MagicResist].Value * 10);
int min = int.MinValue;

if ( magicResist >= 1000 )
min = 40 + ((magicResist - 1000) / 50);
else if ( magicResist >= 400 )
min = (magicResist - 400) / 15;

if ( min > MaxPlayerResistance )
min = MaxPlayerResistance;

int baseMin = base.GetMinResistance( type );

if ( min < baseMin )
min = baseMin;

return min;
}

private static void OnLogin( LoginEventArgs e )
{
Mobile from = e.Mobile;
PlayerMobile pm = from as PlayerMobile;

if ( pm != null )
pm.m_SessionStart = DateTime.Now;

SacrificeVirtue.CheckAtrophy( from );
JusticeVirtue.CheckAtrophy( from );
}

private static void OnLogout( LogoutEventArgs e )
{
PlayerMobile pm = e.Mobile as PlayerMobile;

if ( pm != null )
pm.m_GameTime += (DateTime.Now - pm.m_SessionStart);
}

private static void EventSink_Disconnected( DisconnectedEventArgs e )
{
Mobile from = e.Mobile;
DesignContext context = DesignContext.Find( from );

if ( context != null )
{
/* Client disconnected
* - Remove design context
* - Eject client from house
*/

// Remove design context
DesignContext.Remove( from );

// Eject client from house
from.RevealingAction();
from.Map = context.Foundation.Map;
from.Location = context.Foundation.BanLocation;
}
}

public override void RevealingAction()
{
if ( m_DesignContext != null )
return;

base.RevealingAction();
}

public override void OnSubItemAdded( Item item )
{
if ( AccessLevel < AccessLevel.GameMaster && item.IsChildOf( this.Backpack ) )
{
int maxWeight = WeightOverloading.GetMaxWeight( this );
int curWeight = Mobile.BodyWeight + this.TotalWeight;

if ( curWeight > maxWeight )
this.SendLocalizedMessage( 1019035, true, String.Format( " : {0} / {1}", curWeight, maxWeight ) );
}
}

public override bool CanBeHarmful( Mobile target, bool message, bool ignoreOurBlessedness )
{
if ( m_DesignContext != null || (target is PlayerMobile && ((PlayerMobile)target).m_DesignContext != null) )
return false;

if ( target is BaseVendor || target is PlayerVendor )
{
if ( message )
{
if ( target.Title == null )
SendMessage( "{0} the vendor cannot be harmed.", target.Name );
else
SendMessage( "{0} {1} cannot be harmed.", target.Name, target.Title );
}

return false;
}

return base.CanBeHarmful( target, message, ignoreOurBlessedness );
}

public override bool CanBeBeneficial( Mobile target, bool message, bool allowDead )
{
if ( m_DesignContext != null || (target is PlayerMobile && ((PlayerMobile)target).m_DesignContext != null) )
return false;

return base.CanBeBeneficial( target, message, allowDead );
}

public override bool CheckContextMenuDisplay( IEntity target )
{
return ( m_DesignContext == null );
}

public override void OnItemAdded( Item item )
{
base.OnItemAdded( item );

if ( item is BaseArmor || item is BaseWeapon )
{
Hits=Hits; Stam=Stam; Mana=Mana;
}
}

public override void OnItemRemoved( Item item )
{
base.OnItemRemoved( item );

if ( item is BaseArmor || item is BaseWeapon )
{
Hits=Hits; Stam=Stam; Mana=Mana;
}
}

public override int HitsMax
{
get{ return base.HitsMax + AosAttributes.GetValue( this, AosAttribute.BonusHits ); }
}

public override int StamMax
{
get{ return base.StamMax + AosAttributes.GetValue( this, AosAttribute.BonusStam ); }
}

public override int ManaMax
{
get{ return base.ManaMax + AosAttributes.GetValue( this, AosAttribute.BonusMana ); }
}

public override bool Move( Direction d )
{
NetState ns = this.NetState;

if ( ns != null )
{
Gump[] gumps = ns.Gumps;

for ( int i = 0; i < gumps.Length; ++i )
{
if ( gumps is ResurrectGump )
{
if ( Alive )
{
CloseGump( typeof( ResurrectGump ) );
}
else
{
SendLocalizedMessage( 500111 ); // You are frozen and cannot move.
return false;
}
}
}
}

return base.Move( d );
}

public override bool CheckMovement( Direction d, out int newZ )
{
DesignContext context = m_DesignContext;

if ( context == null )
return base.CheckMovement( d, out newZ );

HouseFoundation foundation = context.Foundation;

newZ = foundation.Z + HouseFoundation.GetLevelZ( context.Level );

int newX = this.X, newY = this.Y;
Movement.Movement.Offset( d, ref newX, ref newY );

int startX = foundation.X + foundation.Components.Min.X + 1;
int startY = foundation.Y + foundation.Components.Min.Y + 1;
int endX = startX + foundation.Components.Width - 1;
int endY = startY + foundation.Components.Height - 2;

return ( newX >= startX && newY >= startY && newX < endX && newY < endY && Map == foundation.Map );
}

public override bool AllowItemUse( Item item )
{
return DesignContext.Check( this );
}

public override bool AllowSkillUse( SkillName skill )
{
return DesignContext.Check( this );
}

private bool m_LastProtectedMessage;
private int m_NextProtectionCheck = 10;

public override void SetLocation( Point3D loc, bool isTeleport )
{
base.SetLocation( loc, isTeleport );

if ( isTeleport || --m_NextProtectionCheck == 0 )
{
m_NextProtectionCheck = 10;

Regions.GuardedRegion reg = this.Region as Regions.GuardedRegion;
bool isProtected = ( reg != null && !reg.IsDisabled() );

if ( isProtected != m_LastProtectedMessage )
{
if ( isProtected )
SendLocalizedMessage( 500112 ); // You are now under the protection of the town guards.
else
SendLocalizedMessage( 500113 ); // You have left the protection of the town guards.

m_LastProtectedMessage = isProtected;
}
}
}

public override void GetContextMenuEntries( Mobile from, ArrayList list )
{
base.GetContextMenuEntries( from, list );

if ( from == this )
{
if ( InsuranceEnabled )
{
list.Add( new CallbackEntry( 6201, new ContextCallback( ToggleItemInsurance ) ) );

if ( AutoRenewInsurance )
list.Add( new CallbackEntry( 6202, new ContextCallback( CancelRenewInventoryInsurance ) ) );
else
list.Add( new CallbackEntry( 6200, new ContextCallback( AutoRenewInventoryInsurance ) ) );
}

// TODO: Toggle champ titles

if ( Core.AOS )
{
BaseHouse house = BaseHouse.FindHouseAt( this );

if ( house != null )
list.Add( new CallbackEntry( 6207, new ContextCallback( LeaveHouse ) ) );
}

if ( m_JusticeProtectors.Count > 0 )
list.Add( new CallbackEntry( 6157, new ContextCallback( CancelProtection ) ) );
}
}

private void CancelProtection()
{
for ( int i = 0; i < m_JusticeProtectors.Count; ++i )
{
Mobile prot = (Mobile)m_JusticeProtectors;

string args = String.Format( "{0}\t{1}", this.Name, prot.Name );

prot.SendLocalizedMessage( 1049371, args ); // The protective relationship between ~1_PLAYER1~ and ~2_PLAYER2~ has been ended.
this.SendLocalizedMessage( 1049371, args ); // The protective relationship between ~1_PLAYER1~ and ~2_PLAYER2~ has been ended.
}

m_JusticeProtectors.Clear();
}

private void ToggleItemInsurance()
{
BeginTarget( -1, false, TargetFlags.None, new TargetCallback( ToggleItemInsurance_Callback ) );
SendLocalizedMessage( 1060868 ); // Target the item you wish to toggle insurance status on <ESC> to cancel
}

private bool CanInsure( Item item )
{
if ( item is Container )
return false;

if ( item is Spellbook || item is Runebook || item is PotionKeg )
return false;

if ( item.Stackable )
return false;

if ( item.LootType == LootType.Cursed )
return false;

return true;
}

private void ToggleItemInsurance_Callback( Mobile from, object obj )
{
Item item = obj as Item;

if ( item == null || !item.IsChildOf( this ) )
{
BeginTarget( -1, false, TargetFlags.None, new TargetCallback( ToggleItemInsurance_Callback ) );
SendLocalizedMessage( 1060871, "", 0x23 ); // You can only insure items that you have equipped or that are in your backpack
}
else if ( item.Insured )
{
item.Insured = false;

SendLocalizedMessage( 1060874, "", 0x35 ); // You cancel the insurance on the item

BeginTarget( -1, false, TargetFlags.None, new TargetCallback( ToggleItemInsurance_Callback ) );
SendLocalizedMessage( 1060868, "", 0x23 ); // Target the item you wish to toggle insurance status on <ESC> to cancel
}
else if ( !CanInsure( item ) )
{
BeginTarget( -1, false, TargetFlags.None, new TargetCallback( ToggleItemInsurance_Callback ) );
SendLocalizedMessage( 1060869, "", 0x23 ); // You cannot insure that
}
else if ( item.LootType == LootType.Blessed || item.LootType == LootType.Newbied || item.BlessedFor == from )
{
BeginTarget( -1, false, TargetFlags.None, new TargetCallback( ToggleItemInsurance_Callback ) );
SendLocalizedMessage( 1060870, "", 0x23 ); // That item is blessed and does not need to be insured
SendLocalizedMessage( 1060869, "", 0x23 ); // You cannot insure that
}
else
{
if ( !m_PayedInsurance.Contains( item ) )
{
if ( Banker.Withdraw( from, 600 ) )
{
SendLocalizedMessage( 1060398, "600" ); // ~1_AMOUNT~ gold has been withdrawn from your bank box.
m_PayedInsurance.Add( item );
}
else
{
SendLocalizedMessage( 1061079, "", 0x23 ); // You lack the funds to purchase the insurance
return;
}
}

item.Insured = true;

SendLocalizedMessage( 1060873, "", 0x23 ); // You have insured the item

BeginTarget( -1, false, TargetFlags.None, new TargetCallback( ToggleItemInsurance_Callback ) );
SendLocalizedMessage( 1060868, "", 0x23 ); // Target the item you wish to toggle insurance status on <ESC> to cancel
}
}

private ArrayList m_PayedInsurance;

private void AutoRenewInventoryInsurance()
{
SendLocalizedMessage( 1060881, "", 0x23 ); // You have selected to automatically reinsure all insured items upon death
AutoRenewInsurance = true;
}

private void CancelRenewInventoryInsurance()
{
SendLocalizedMessage( 1061075, "", 0x23 ); // You have cancelled automatically reinsuring all insured items upon death
AutoRenewInsurance = false;
}

// TODO: Champ titles, toggle

private void LeaveHouse()
{
BaseHouse house = BaseHouse.FindHouseAt( this );

if ( house != null )
this.Location = house.BanLocation;
}

private delegate void ContextCallback();

private class CallbackEntry : ContextMenuEntry
{
private ContextCallback m_Callback;

public CallbackEntry( int number, ContextCallback callback ) : this( number, -1, callback )
{
}

public CallbackEntry( int number, int range, ContextCallback callback ) : base( number, range )
{
m_Callback = callback;
}

public override void OnClick()
{
if ( m_Callback != null )
m_Callback();
}
}

public override void OnDoubleClick( Mobile from )
{
if ( this == from && !Warmode )
{
IMount mount = Mount;

if ( mount != null && !DesignContext.Check( this ) )
return;
}

base.OnDoubleClick( from );
}

public override void DisplayPaperdollTo( Mobile to )
{
if ( DesignContext.Check( this ) )
base.DisplayPaperdollTo( to );
}

private static bool m_NoRecursion;

protected override void OnLocationChange( Point3D oldLocation )
{
DesignContext context = m_DesignContext;

if ( context == null || m_NoRecursion )
return;

m_NoRecursion = true;

HouseFoundation foundation = context.Foundation;

int newX = this.X, newY = this.Y;
int newZ = foundation.Z + HouseFoundation.GetLevelZ( context.Level );

int startX = foundation.X + foundation.Components.Min.X + 1;
int startY = foundation.Y + foundation.Components.Min.Y + 1;
int endX = startX + foundation.Components.Width - 1;
int endY = startY + foundation.Components.Height - 2;

if ( newX >= startX && newY >= startY && newX < endX && newY < endY && Map == foundation.Map )
{
if ( Z != newZ )
Location = new Point3D( X, Y, newZ );

m_NoRecursion = false;
return;
}

Location = new Point3D( foundation.X, foundation.Y, newZ );
Map = foundation.Map;

m_NoRecursion = false;
}

protected override void OnMapChange( Map oldMap )
{
DesignContext context = m_DesignContext;

if ( context == null || m_NoRecursion )
return;

m_NoRecursion = true;

HouseFoundation foundation = context.Foundation;

if ( Map != foundation.Map )
Map = foundation.Map;

m_NoRecursion = false;
}

public override void OnDamage( int amount, Mobile from, bool willKill )
{
if ( amount > 0 )
{
BandageContext c = BandageContext.GetContext( this );

if ( c != null )
c.Slip();
}

WeightOverloading.FatigueOnDamage( this, amount );

base.OnDamage( amount, from, willKill );
}

public static int ComputeSkillTotal( Mobile m )
{
int total = 0;

for ( int i = 0; i < m.Skills.Length; ++i )
total += m.Skills.BaseFixedPoint;

return ( total / 10 );
}

public override void Resurrect()
{
bool wasAlive = this.Alive;

base.Resurrect();

if ( this.Alive && !wasAlive )
{
Item deathRobe = new DeathRobe();

if ( !EquipItem( deathRobe ) )
deathRobe.Delete();
}
}

private Mobile m_InsuranceAward;
private int m_InsuranceCost;
private int m_InsuranceBonus;

Public override bool OnBeforeDeath()
{
m_InsuranceCost = 0;
m_InsuranceAward = base.FindMostRecentDamager( false );

if ( m_InsuranceAward != null && !m_InsuranceAward.Player )
//m_InsuranceAward = null;

if ( m_InsuranceAward is PlayerMobile )
//((PlayerMobile)m_InsuranceAward).m_InsuranceBonus = 0;

return base.OnBeforeDeath();
}

private bool CheckInsuranceOnDeath( Item item )
{
if ( InsuranceEnabled && item.Insured )
{
if ( AutoRenewInsurance )
{
int cost = ( m_InsuranceAward == null ? 600 : 300 );

if ( Banker.Withdraw( this, cost ) )
{
m_InsuranceCost += cost;

if ( !m_PayedInsurance.Contains( item ) )
m_PayedInsurance.Add( item );
}
else
{
SendLocalizedMessage( 1061079, "", 0x23 ); // You lack the funds to purchase the insurance
m_PayedInsurance.Remove( item );
item.Insured = false;
}
}
else
{
m_PayedInsurance.Remove( item );
item.Insured = false;
}

if ( m_InsuranceAward != null )
{
if ( Banker.Deposit( m_InsuranceAward, 300 ) )
{
if ( m_InsuranceAward is PlayerMobile )
((PlayerMobile)m_InsuranceAward).m_InsuranceBonus += 300;
}
}

return true;
}

return false;
}

public override DeathMoveResult GetParentMoveResultFor( Item item )
{
if ( CheckInsuranceOnDeath( item ) )
return DeathMoveResult.MoveToBackpack;

return base.GetParentMoveResultFor( item );
}

public override DeathMoveResult GetInventoryMoveResultFor( Item item )
{
if ( CheckInsuranceOnDeath( item ) )
return DeathMoveResult.MoveToBackpack;

return base.GetInventoryMoveResultFor( item );
}

public override void OnDeath( Container c )
{
base.OnDeath( c );
//**********Added for DEATH to appear on Death
//{
//Mobile m = new VisitingDEATH();
//m.Location = c.Location;
//m.Map = c.Map;
//}
//**********End Added for DEATH to appear on Death


HueMod = -1;
NameMod = null;
SavagePaintExpiration = TimeSpan.Zero;

SetHairMods( -1, -1 );

PolymorphSpell.StopTimer( this );
IncognitoSpell.StopTimer( this );
DisguiseGump.StopTimer( this );

EndAction( typeof( PolymorphSpell ) );
EndAction( typeof( IncognitoSpell ) );

if ( m_PermaFlags.Count > 0 )
{
m_PermaFlags.Clear();

if ( c is Corpse )
((Corpse)c).Criminal = true;

if ( SkillHandlers.Stealing.ClassicMode )
Criminal = true;
}

if ( this.Kills >= 5 && DateTime.Now >= m_NextSacrificeGain )
{
Mobile m = FindMostRecentDamager( false );

if ( m != null )
{
bool gainedPath = false;

int theirTotal = ComputeSkillTotal( m );
int ourTotal = ComputeSkillTotal( this );

int pointsToGain = 1 + ((theirTotal - ourTotal) / 50);

if ( pointsToGain < 1 )
pointsToGain = 1;
else if ( pointsToGain > 4 )
pointsToGain = 4;

if ( VirtueHelper.Award( m, VirtueName.Justice, pointsToGain, ref gainedPath ) )
{
if ( gainedPath )
m.SendLocalizedMessage( 1049367 ); // You have gained a path in Justice!
else
m.SendLocalizedMessage( 1049363 ); // You have gained in Justice.

m.FixedParticles( 0x375A, 9, 20, 5027, EffectLayer.Waist );
m.PlaySound( 0x1F7 );

m_NextSacrificeGain = DateTime.Now + TimeSpan.FromMinutes( pointsToGain * 2 );
}
}
}

if ( m_InsuranceCost > 0 )
SendLocalizedMessage( 1060398, m_InsuranceCost.ToString() ); // ~1_AMOUNT~ gold has been withdrawn from your bank box.

if ( m_InsuranceAward is PlayerMobile )
{
PlayerMobile pm = (PlayerMobile)m_InsuranceAward;

if ( pm.m_InsuranceBonus > 0 )
pm.SendLocalizedMessage( 1060397, pm.m_InsuranceBonus.ToString() ); // ~1_AMOUNT~ gold has been deposited into your bank box.
}
}

private ArrayList m_PermaFlags;
private ArrayList m_VisList;
private Hashtable m_AntiMacroTable;
private TimeSpan m_GameTime;
private TimeSpan m_ShortTermElapse;
private TimeSpan m_LongTermElapse;
private DateTime m_SessionStart;
private DateTime m_LastEscortTime;
private DateTime m_NextSmithBulkOrder;
private DateTime m_NextTailorBulkOrder;
private DateTime m_SavagePaintExpiration;
private SkillName m_Learning = (SkillName)(-1);

public SkillName Learning
{
get{ return m_Learning; }
set{ m_Learning = value; }
}

[CommandProperty( AccessLevel.GameMaster )]
public TimeSpan SavagePaintExpiration
{
get
{
TimeSpan ts = m_SavagePaintExpiration - DateTime.Now;

if ( ts < TimeSpan.Zero )
ts = TimeSpan.Zero;

return ts;
}
set
{
m_SavagePaintExpiration = DateTime.Now + value;
}
}

[CommandProperty( AccessLevel.GameMaster )]
public TimeSpan NextSmithBulkOrder
{
get
{
TimeSpan ts = m_NextSmithBulkOrder - DateTime.Now;

if ( ts < TimeSpan.Zero )
ts = TimeSpan.Zero;

return ts;
}
set
{
try{ m_NextSmithBulkOrder = DateTime.Now + value; }
catch{}
}
}

[CommandProperty( AccessLevel.GameMaster )]
public TimeSpan NextTailorBulkOrder
{
get
{
TimeSpan ts = m_NextTailorBulkOrder - DateTime.Now;

if ( ts < TimeSpan.Zero )
ts = TimeSpan.Zero;

return ts;
}
set
{
try{ m_NextTailorBulkOrder = DateTime.Now + value; }
catch{}
}
}

public DateTime LastEscortTime
{
get{ return m_LastEscortTime; }
set{ m_LastEscortTime = value; }
}

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_PayedInsurance = new ArrayList();

m_JusticeProtectors = new ArrayList();
}

public override bool MutateSpeech( ArrayList hears, ref string text, ref object context )
{
if ( Alive )
return false;

for ( int i = 0; i < hears.Count; ++i )
{
object o = hears;

if ( o != this && o is Mobile && ((Mobile)o).Skills[SkillName.SpiritSpeak].Value >= 100.0 )
return false;
}

return base.MutateSpeech( hears, ref text, ref context );
}

public override void Damage( int amount, Mobile from )
{
if ( Spells.Necromancy.EvilOmenSpell.CheckEffect( this ) )
amount = (int)(amount * 1.25);

Mobile oath = Spells.Necromancy.BloodOathSpell.GetBloodOath( from );

if ( oath == this )
{
amount = (int)(amount * 1.1);
from.Damage( amount, from );
}

base.Damage( amount, from );
}

public override ApplyPoisonResult ApplyPoison( Mobile from, Poison poison )
{
if ( Spells.Necromancy.EvilOmenSpell.CheckEffect( this ) )
return base.ApplyPoison( from, PoisonImpl.IncreaseLevel( poison ) );

return base.ApplyPoison( from, poison );
}

public PlayerMobile( Serial s ) : base( s )
{
m_VisList = new ArrayList();
m_AntiMacroTable = new Hashtable();
}

public ArrayList VisibilityList
{
get{ return m_VisList; }
}

public ArrayList PermaFlags
{
get{ return m_PermaFlags; }
}

public override int Luck{ get{ return AosAttributes.GetValue( this, AosAttribute.Luck ); } }

public override bool IsHarmfulCriminal( Mobile target )
{
if ( target is PlayerMobile && ((PlayerMobile)target).m_PermaFlags.Count > 0 && SkillHandlers.Stealing.ClassicMode )
{
int noto = Notoriety.Compute( this, target );

if ( noto == Notoriety.Innocent )
target.Delta( MobileDelta.Noto );

return false;
}

return base.IsHarmfulCriminal( target );
}

public bool AntiMacroCheck( Skill skill, object obj )
{
if ( obj == null || m_AntiMacroTable == null || this.AccessLevel != AccessLevel.Player )
return true;

Hashtable tbl = (Hashtable)m_AntiMacroTable[skill];
if ( tbl == null )
m_AntiMacroTable[skill] = tbl = new Hashtable();

CountAndTimeStamp count = (CountAndTimeStamp)tbl[obj];
if ( count != null )
{
if ( count.TimeStamp + SkillCheck.AntiMacroExpire <= DateTime.Now )
{
count.Count = 1;
return true;
}
else
{
++count.Count;
if ( count.Count <= SkillCheck.Allowance )
return true;
else
return false;
}
}
else
{
tbl[obj] = count = new CountAndTimeStamp();
count.Count = 1;

return true;
}
}

private void RevertHair()
{
SetHairMods( -1, -1 );
}

private Engines.BulkOrders.BOBFilter m_BOBFilter;

public Engines.BulkOrders.BOBFilter BOBFilter
{
get{ return m_BOBFilter; }
}

public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();

switch ( version )
{
//Added
case 14:
{
m_Points = reader.ReadInt();
goto case 13;
}
case 13:
{
m_TPoints = reader.ReadInt();
goto case 12;


}
//End Added

case 12:
{
m_BOBFilter = new Engines.BulkOrders.BOBFilter( reader );
goto case 11;
}
case 11:
{
m_PayedInsurance = reader.ReadItemList();
goto case 10;
}
case 10:
{
if ( reader.ReadBool() )
{
m_HairModID = reader.ReadInt();
m_HairModHue = reader.ReadInt();
m_BeardModID = reader.ReadInt();
m_BeardModHue = reader.ReadInt();

// We cannot call SetHairMods( -1, -1 ) here because the items have not yet loaded
Timer.DelayCall( TimeSpan.Zero, new TimerCallback( RevertHair ) );
}

goto case 9;
}
case 9:
{
SavagePaintExpiration = reader.ReadTimeSpan();

if ( SavagePaintExpiration > TimeSpan.Zero )
{
BodyMod = ( Female ? 184 : 183 );
HueMod = 0;
}

goto case 8;
}
case 8:
{
m_NpcGuild = (NpcGuild)reader.ReadInt();
m_NpcGuildJoinTime = reader.ReadDateTime();
m_NpcGuildGameTime = reader.ReadTimeSpan();
goto case 7;
}
case 7:
{
m_PermaFlags = reader.ReadMobileList();
goto case 6;
}
case 6:
{
NextTailorBulkOrder = reader.ReadTimeSpan();
goto case 5;
}
case 5:
{
NextSmithBulkOrder = reader.ReadTimeSpan();
goto case 4;
}
case 4:
{
m_LastJusticeLoss = reader.ReadDeltaTime();
m_JusticeProtectors = reader.ReadMobileList();
goto case 3;
}
case 3:
{
m_LastSacrificeGain = reader.ReadDeltaTime();
m_LastSacrificeLoss = reader.ReadDeltaTime();
m_AvailableResurrects = reader.ReadInt();
goto case 2;
}
case 2:
{
m_Flags = (PlayerFlag)reader.ReadInt();
goto case 1;
}
case 1:
{
m_LongTermElapse = reader.ReadTimeSpan();
m_ShortTermElapse = reader.ReadTimeSpan();
m_GameTime = reader.ReadTimeSpan();
goto case 0;
}
case 0:
{
break;
}
}

if ( m_PayedInsurance == null )
m_PayedInsurance = new ArrayList();

if ( m_PermaFlags == null )
m_PermaFlags = new ArrayList();

if ( m_JusticeProtectors == null )
m_JusticeProtectors = new ArrayList();

if ( m_BOBFilter == null )
m_BOBFilter = new Engines.BulkOrders.BOBFilter();

ArrayList list = this.Stabled;

for ( int i = 0; i < list.Count; ++i )
{
BaseCreature bc = list as BaseCreature;

if ( bc != null )
bc.IsStabled = true;
}
}

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 );
}

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

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

base.Serialize( writer );

writer.Write( (int) 12 ); // version

m_BOBFilter.Serialize( writer );
//Added
writer.Write( m_Points );
writer.Write( m_TPoints );
//EndAdded
writer.WriteItemList( m_PayedInsurance, true );

bool useMods = ( m_HairModID != -1 || m_BeardModID != -1 );

writer.Write( useMods );

if ( useMods )
{
writer.Write( (int) m_HairModID );
writer.Write( (int) m_HairModHue );
writer.Write( (int) m_BeardModID );
writer.Write( (int) m_BeardModHue );
}

writer.Write( SavagePaintExpiration );

writer.Write( (int) m_NpcGuild );
writer.Write( (DateTime) m_NpcGuildJoinTime );
writer.Write( (TimeSpan) m_NpcGuildGameTime );

writer.WriteMobileList( m_PermaFlags, true );

writer.Write( NextTailorBulkOrder );

writer.Write( NextSmithBulkOrder );

writer.WriteDeltaTime( m_LastJusticeLoss );
writer.WriteMobileList( m_JusticeProtectors, true );

writer.WriteDeltaTime( m_LastSacrificeGain );
writer.WriteDeltaTime( m_LastSacrificeLoss );
writer.Write( m_AvailableResurrects );

writer.Write( (int) m_Flags );

writer.Write( m_LongTermElapse );
writer.Write( m_ShortTermElapse );
writer.Write( this.GameTime );
}

public void ResetKillTime()
{
m_ShortTermElapse = this.GameTime + TimeSpan.FromHours( 8 );
m_LongTermElapse = this.GameTime + TimeSpan.FromHours( 40 );
}

[CommandProperty( AccessLevel.GameMaster )]
public TimeSpan GameTime
{
get
{
if ( NetState != null )
return m_GameTime + (DateTime.Now - m_SessionStart);
else
return m_GameTime;
}
}

public override bool CanSee( Mobile m )
{
if ( m is PlayerMobile && ((PlayerMobile)m).m_VisList.Contains( this ) )
return true;

return base.CanSee( m );
}

public override bool CanSee( Item item )
{
if ( m_DesignContext != null && m_DesignContext.Foundation.IsHiddenToCustomizer( item ) )
return false;

return base.CanSee( item );
}

#region Enemy of One
private Type m_EnemyOfOneType;
private bool m_WaitingForEnemy;

public Type EnemyOfOneType
{
get{ return m_EnemyOfOneType; }
set
{
Type oldType = m_EnemyOfOneType;
Type newType = value;

if ( oldType == newType )
return;

m_EnemyOfOneType = value;

DeltaEnemies( oldType, newType );
}
}

public bool WaitingForEnemy
{
get{ return m_WaitingForEnemy; }
set{ m_WaitingForEnemy = value; }
}

private void DeltaEnemies( Type oldType, Type newType )
{
Map map = this.Map;

if ( map == null )
return;

IPooledEnumerable eable = map.GetMobilesInRange( this.Location, 18 );

foreach ( Mobile m in eable )
{
Type t = m.GetType();

if ( t == oldType || t == newType )
Send( new MobileMoving( m, Notoriety.Compute( this, m ) ) );
}

eable.Free();
}
#endregion

#region Hair and beard mods
private int m_HairModID = -1, m_HairModHue;
private int m_BeardModID = -1, m_BeardModHue;

public void SetHairMods( int hairID, int beardID )
{
if ( hairID == -1 )
InternalRestoreHair( true, ref m_HairModID, ref m_HairModHue );
else if ( hairID != -2 )
InternalChangeHair( true, hairID, ref m_HairModID, ref m_HairModHue );

if ( beardID == -1 )
InternalRestoreHair( false, ref m_BeardModID, ref m_BeardModHue );
else if ( beardID != -2 )
InternalChangeHair( false, beardID, ref m_BeardModID, ref m_BeardModHue );
}

private Item CreateHair( bool hair, int id, int hue )
{
switch ( id )
{
case 0x203B: return new ShortHair( hue );
case 0x203C: return new LongHair( hue );
case 0x203D: return new PonyTail( hue );
case 0x203E: return new LongBeard( hue );
case 0x203F: return new ShortBeard( hue );
case 0x2040: return new Goatee( hue );
case 0x2041: return new Mustache( hue );
case 0x2044: return new Mohawk( hue );
case 0x2045: return new PageboyHair( hue );
case 0x2046: return new BunsHair( hue );
case 0x2047: return new Afro( hue );
case 0x2048: return new ReceedingHair( hue );
case 0x2049: return new TwoPigTails( hue );
case 0x204A: return new KrisnaHair( hue );
case 0x204B: return new MediumShortBeard( hue );
case 0x204C: return new MediumLongBeard( hue );
case 0x204D: return new Vandyke( hue );
default:
{
Console.WriteLine( "Warning: Unknown hair ID specified: {0}", id );

if ( hair )
return new GenericHair( id );
else
return new GenericBeard( id );
}
}
}

private void InternalRestoreHair( bool hair, ref int id, ref int hue )
{
if ( id == -1 )
return;

Item item = FindItemOnLayer( hair ? Layer.Hair : Layer.FacialHair );

if ( item != null )
item.Delete();

if ( id != 0 )
AddItem( CreateHair( hair, id, hue ) );

id = -1;
hue = 0;
}

private void InternalChangeHair( bool hair, int id, ref int storeID, ref int storeHue )
{
Item item = FindItemOnLayer( hair ? Layer.Hair : Layer.FacialHair );

if ( item != null )
{
if ( storeID == -1 )
{
storeID = item.ItemID;
storeHue = item.Hue;
}

item.Delete();
}
else if ( storeID == -1 )
{
storeID = 0;
storeHue = 0;
}

if ( id == 0 )
return;

AddItem( CreateHair( hair, id, 0 ) );
}
#endregion

#region Virtue stuff
private DateTime m_LastSacrificeGain;
private DateTime m_LastSacrificeLoss;
private int m_AvailableResurrects;

public DateTime LastSacrificeGain{ get{ return m_LastSacrificeGain; } set{ m_LastSacrificeGain = value; } }
public DateTime LastSacrificeLoss{ get{ return m_LastSacrificeLoss; } set{ m_LastSacrificeLoss = value; } }
public int AvailableResurrects{ get{ return m_AvailableResurrects; } set{ m_AvailableResurrects = value; } }

private DateTime m_NextSacrificeGain;
private DateTime m_LastJusticeLoss;
private ArrayList m_JusticeProtectors;

public DateTime LastJusticeLoss{ get{ return m_LastJusticeLoss; } set{ m_LastJusticeLoss = value; } }
public ArrayList JusticeProtectors{ get{ return m_JusticeProtectors; } set{ m_JusticeProtectors = value; } }
#endregion
}
}[/code:1]
 

phoenix_zhs

Wanderer
These errors are not in your playermobile from what i can see. They are

- Warning: Scripts\Custom\Gypsy.cs: CS0183: (line 122, column 56) The given exp
ression is always of the provided ('Server.Mobiles.TheFortuneTeller') type
- Warning: Scripts\Custom\motd.cs: CS0183: (line 58, column 18) The given expre
ssion is always of the provided ('Server.Mobiles.PlayerMobile') type
- Warning: Scripts\Custom\Pointsystem.cs: CS0183: (line 61, column 13) The give
n expression is always of the provided ('Server.Mobiles.PlayerMobile') type
- Warning: Scripts\Custom\SupplyStone.cs: CS0642: (line 30, column 59) Possible
mistaken null statement
- Warning: Scripts\Custom\TravelStone.cs: CS0642: (line 28, column 59) Possible
mistaken null statement
Scripts: One or more scripts failed to compile or no script files were found.

Check those errors in the different files

You will ususally see unreachable code messages when you have errors in other files...I am still fairly new to this so i really cant explain why...i just know that is has always been that way for me.
 
S

Seven

Guest
Warnings : Warnings are caused from other errors.
Warnings : Warnings happen because the error causes the system not to reach them.[i think?]

Its fixed now..none of the files have any "wrong" code in it just was unreachable
 

Tru

Knight
seven remove the QuestKeeper folder then run again and youll probably be able to see the actual errors

unless someone knows how to see the errors farther up.....
 
S

Seven

Guest
//This has been fixed//
:)

//These errors where caused from :
handlers.cs
keywords.cs//

Im still having trouble with keywords.cs :)
 
Top