ugh @ baseescortable formatting

This commit is contained in:
mark 2009-09-06 03:45:12 +00:00
parent 06e5c8b732
commit 1320f14adf
13 changed files with 723 additions and 612 deletions

View file

@ -0,0 +1,97 @@
using System;
using Server;
using Server.Mobiles;
using Server.Spells;
using System.Collections;
using System.Collections.Generic;
namespace Server.Items
{
public class AcidSlime : Item
{
private TimeSpan m_Duration;
private int m_MinDamage;
private int m_MaxDamage;
private DateTime m_Created;
private bool m_Drying;
private Timer m_Timer;
[Constructable]
public AcidSlime() : this( TimeSpan.FromSeconds( 10.0 ), 5, 10 )
{
}
public override string DefaultName { get { return "slime"; } }
[Constructable]
public AcidSlime( TimeSpan duration, int minDamage, int maxDamage )
: base( 0x122A )
{
Hue = 0x3F;
Movable = false;
m_MinDamage = minDamage;
m_MaxDamage = maxDamage;
m_Created = DateTime.Now;
m_Duration = duration;
m_Timer = Timer.DelayCall( TimeSpan.Zero, TimeSpan.FromSeconds( 1 ), new TimerCallback( OnTick ) );
}
public override void OnAfterDelete()
{
if( m_Timer != null )
m_Timer.Stop();
}
private void OnTick()
{
DateTime now = DateTime.Now;
TimeSpan age = now - m_Created;
if( age > m_Duration )
Delete();
else
{
if( !m_Drying && age > (m_Duration - age) )
{
m_Drying = true;
ItemID = 0x122B;
}
foreach( Mobile m in GetMobilesInRange( 0 ) )
{
BaseCreature bc = m as BaseCreature;
if( m.Alive && !m.IsDeadBondedPet && (bc == null || bc.Controlled || bc.Summoned) )
{
Damage ( m );
}
}
}
}
public override bool OnMoveOver( Mobile m )
{
Damage( m );
return true;
}
public void Damage ( Mobile m )
{
int damage = Utility.RandomMinMax( m_MinDamage, m_MaxDamage );
if ( Core.AOS )
AOS.Damage( m, damage, 0, 0, 0, 100, 0 );
else
m.Damage( damage );
}
public AcidSlime( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
}
public override void Deserialize( GenericReader reader )
{
}
}
}

View file

@ -1,4 +1,5 @@
using System;
using System.Globalization;
using Server;
using Server.Items;
using Server.Mobiles;
@ -68,7 +69,14 @@ namespace Server.Items
{
base.GetProperties( list );
list.Add( 1060738, Core.ML ? m_Worth.ToString( "N0" ) : m_Worth.ToString() ); // value: ~1_val~
string worth;
if ( Core.ML )
worth = m_Worth.ToString( "N0", CultureInfo.GetCultureInfo( "en-US" ) );
else
worth = m_Worth.ToString();
list.Add( 1060738, worth ); // value: ~1_val~
}
public override void OnSingleClick( Mobile from )

View file

@ -12,70 +12,10 @@ namespace Server.Items
private TimeSpan m_Duration;
private int m_MinDamage;
private int m_MaxDamage;
private DateTime m_Created;
private bool m_Drying;
private Timer m_Timer;
[CommandProperty( AccessLevel.GameMaster )]
public bool Drying
{
get
{
return m_Drying;
}
set
{
m_Drying = value;
if( m_Drying )
ItemID = 0x122A;
else
ItemID = 0x122B;
}
}
[CommandProperty( AccessLevel.GameMaster )]
public TimeSpan Duration{ get{ return m_Duration; } set{ m_Duration = value; } }
[CommandProperty( AccessLevel.GameMaster )]
public int MinDamage
{
get
{
return m_MinDamage;
}
set
{
if ( value < 1 )
value = 1;
m_MinDamage = value;
}
}
[CommandProperty( AccessLevel.GameMaster )]
public int MaxDamage
{
get
{
return m_MaxDamage;
}
set
{
if ( value < 1 )
value = 1;
if ( value < MinDamage )
value = MinDamage;
m_MaxDamage = value;
}
}
[Constructable]
public PoolOfAcid() : this( TimeSpan.FromSeconds( 10.0 ), 2, 5 )
{
@ -113,37 +53,31 @@ namespace Server.Items
Delete();
else
{
if( !Drying && age > (m_Duration - age) )
Drying = true;
List<Mobile> toDamage = new List<Mobile>();
if( !m_Drying && age > (m_Duration - age) )
{
m_Drying = true;
ItemID = 0x122B;
}
foreach( Mobile m in GetMobilesInRange( 0 ) )
{
BaseCreature bc = m as BaseCreature;
if( m.Alive && !m.IsDeadBondedPet && (bc == null || bc.Controlled || bc.Summoned) )
{
toDamage.Add( m );
Damage ( m );
}
}
for( int i = 0; i < toDamage.Count; i++ )
Damage( toDamage[i] );
}
}
public override bool OnMoveOver( Mobile m )
{
Damage( m );
return true;
}
public void Damage( Mobile m )
public void Damage ( Mobile m )
{
m.Damage( Utility.RandomMinMax( MinDamage, MaxDamage ) );
m.Damage( Utility.RandomMinMax( m_MinDamage, m_MaxDamage ) );
}
public PoolOfAcid( Serial serial ) : base( serial )

View file

@ -128,6 +128,7 @@ namespace Server.Items
}
Explode( from, true, loc, map );
m_Timer = null;
}
else
{

View file

@ -3362,7 +3362,7 @@ namespace Server.Items
Type resourceType = typeRes;
if ( resourceType == null )
resourceType = craftItem.Ressources.GetAt( 0 ).ItemType;
resourceType = craftItem.Resources.GetAt( 0 ).ItemType;
if ( Core.AOS )
{

View file

@ -107,7 +107,7 @@ namespace Server.Mobiles
}
else if ( from != null && from != this && InRange( from, 1 ) )
{
SpillAcid( TimeSpan.FromSeconds( 10 ), 30, 30, from );
SpillAcid( from, 1 );
}
}
@ -116,7 +116,7 @@ namespace Server.Mobiles
public override bool OnBeforeDeath()
{
SpillAcid( TimeSpan.FromSeconds( 10 ), 30, 30, 1, 4 );
SpillAcid( 4 );
return base.OnBeforeDeath();
}

View file

@ -108,7 +108,7 @@ namespace Server.Mobiles
}
else if ( from != null && from != this && InRange( from, 1 ) )
{
SpillAcid( TimeSpan.FromSeconds( 10 ), 30, 30, from );
SpillAcid( from, 1 );
}
}
@ -117,7 +117,7 @@ namespace Server.Mobiles
public override bool OnBeforeDeath()
{
SpillAcid( TimeSpan.FromSeconds( 10 ), 30, 30, 1, 4 );
SpillAcid( 4 );
return base.OnBeforeDeath();
}

View file

@ -107,7 +107,7 @@ namespace Server.Mobiles
}
else if ( from != null && from != this && InRange( from, 1 ) )
{
SpillAcid( TimeSpan.FromSeconds( 10 ), 30, 30, from );
SpillAcid( from, 1 );
}
}
@ -116,7 +116,7 @@ namespace Server.Mobiles
public override bool OnBeforeDeath()
{
SpillAcid( TimeSpan.FromSeconds( 10 ), 30, 30, 1, 4 );
SpillAcid( 4 );
return base.OnBeforeDeath();
}

View file

@ -107,7 +107,7 @@ namespace Server.Mobiles
}
else if ( from != null && from != this && InRange( from, 1 ) )
{
SpillAcid( TimeSpan.FromSeconds( 10 ), 30, 30, from );
SpillAcid( from, 1 );
}
}
@ -116,7 +116,7 @@ namespace Server.Mobiles
public override bool OnBeforeDeath()
{
SpillAcid( TimeSpan.FromSeconds( 10 ), 30, 30, 1, 4 );
SpillAcid( 4 );
return base.OnBeforeDeath();
}

File diff suppressed because it is too large Load diff

View file

@ -8,15 +8,24 @@ namespace Server.Mobiles
public class SeekerOfAdventure : BaseEscortable
{
private static string[] m_Dungeons = new string[]
{
"Covetous", "Deceit", "Despise",
"Destard", "Hythloth", "Shame",
"Wrong"
};
{
"Covetous", "Deceit", "Despise",
"Destard", "Hythloth", "Shame", // Old Code for Pre-ML shards.
"Wrong"
};
private static string[] m_MLDestinations = new string[]
{
"Cove", "Serpent's Hold", "Jhelom", // ML List
"Nujel'm"
};
public override string[] GetPossibleDestinations()
{
return m_Dungeons;
if ( Core.ML )
return m_MLDestinations;
else
return m_Dungeons;
}
[Constructable]

View file

@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using Server;
using Server.Items;
using Server.Mobiles;
@ -33,6 +34,17 @@ namespace Server.Mobiles
public Item Item{ get{ return m_Item; } }
public int Price{ get{ return m_Price; } }
public string FormattedPrice
{
get
{
if ( Core.ML )
return m_Price.ToString( "N0", CultureInfo.GetCultureInfo( "en-US" ) );
return m_Price.ToString();
}
}
public string Description
{
get{ return m_Description; }
@ -197,7 +209,7 @@ namespace Server.Mobiles
else if ( vi.IsForFree )
list.Add( 1043306 ); // Price: FREE!
else
list.Add( 1043304, vi.Price.ToString() ); // Price: ~1_COST~
list.Add( 1043304, vi.FormattedPrice ); // Price: ~1_COST~
}
public override void GetChildProperties( ObjectPropertyList list, Item item )
@ -230,7 +242,7 @@ namespace Server.Mobiles
else if ( vi.IsForFree )
item.LabelTo( from, 1043306 ); // Price: FREE!
else
item.LabelTo( from, 1043304, vi.Price.ToString() ); // Price: ~1_COST~
item.LabelTo( from, 1043304, vi.FormattedPrice ); // Price: ~1_COST~
if ( !String.IsNullOrEmpty( vi.Description ) )
{

View file

@ -169,6 +169,19 @@ namespace Server.Spells
return false;
}
public static bool CanRevealCaster( Mobile m )
{
if ( m is BaseCreature )
{
BaseCreature c = (BaseCreature)m;
if ( !c.Controlled )
return true;
}
return false;
}
public static void GetSurfaceTop( ref IPoint3D p )
{
@ -532,19 +545,21 @@ namespace Server.Spells
new TravelValidator( IsDoomFerry ),
new TravelValidator( IsFactionStronghold ),
new TravelValidator( IsChampionSpawn ),
new TravelValidator( IsTokunoDungeon )
new TravelValidator( IsTokunoDungeon ),
new TravelValidator( IsLampRoom ),
new TravelValidator( IsGuardianRoom ),
};
private static bool[,] m_Rules = new bool[,]
{
/*T2A(Fel) Ilshenar Wind(Tram), Wind(Fel), Dungeons(Fel), Solen(Tram), Solen(Fel), CrystalCave(Malas), Gauntlet(Malas), Gauntlet(Ferry), Stronghold, ChampionSpawn, Dungeons(Tokuno[Malas]) */
/* Recall From */ { false, true, true, false, false, true, false, false, false, false, true, true, true },
/* Recall To */ { false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Gate From */ { false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Gate To */ { false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Mark In */ { false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Tele From */ { true, true, true, true, true, true, true, false, true, true, false, true, true },
/* Tele To */ { true, true, true, true, true, true, true, false, true, false, false, true, true },
/*T2A(Fel) Ilshenar Wind(Tram), Wind(Fel), Dungeons(Fel), Solen(Tram), Solen(Fel), CrystalCave(Malas), Gauntlet(Malas), Gauntlet(Ferry), Stronghold, ChampionSpawn, Dungeons(Tokuno[Malas]), LampRoom(Doom), GuardianRoom(Doom) */
/* Recall From */ { false, true, true, false, false, true, false, false, false, false, true, true, true, false, false },
/* Recall To */ { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Gate From */ { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Gate To */ { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Mark In */ { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Tele From */ { true, true, true, true, true, true, true, false, true, true, false, true, true, true, true },
/* Tele To */ { true, true, true, true, true, true, true, false, true, false, false, true, true, true, true },
};
public static bool CheckTravel( Mobile caster, TravelCheckType type )
@ -736,6 +751,26 @@ namespace Server.Spells
return (x >= 0 && y >= 0 && x < 256 && y < 256);
}
public static bool IsLampRoom( Map map, Point3D loc )
{
if ( map != Map.Malas )
return false;
int x = loc.X, y = loc.Y;
return ( x >= 465 && y >= 92 && x < 474 && y < 102 );
}
public static bool IsGuardianRoom( Map map, Point3D loc )
{
if ( map != Map.Malas )
return false;
int x = loc.X, y = loc.Y;
return ( x >= 356 && y >= 5 && x < 375 && y < 25 );
}
public static bool IsInvalid( Map map, Point3D loc )
{
if( map == null || map == Map.Internal )