Addition of Racial Harvest bonuses, Elven nightsight, and rename of OreInfo.cs to ResourceInfo.cs
This commit is contained in:
parent
51ef5111f6
commit
1a241e17f1
11 changed files with 54 additions and 13 deletions
|
|
@ -1195,6 +1195,11 @@ namespace Server.Mobiles
|
|||
}
|
||||
else
|
||||
{
|
||||
if( Core.ML && from.Race == Race.Human )
|
||||
{
|
||||
hides = (int)Math.Ceiling( hides * 1.1 ); //10% Bonus Only applies to Hides, Ore & Logs
|
||||
}
|
||||
|
||||
if ( corpse.Map == Map.Felucca )
|
||||
{
|
||||
feathers *= 2;
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ namespace Server.Engines.Harvest
|
|||
m_Vein = m_DefaultVein;
|
||||
}
|
||||
|
||||
public void Consume( HarvestDefinition def, int amount )
|
||||
public void Consume( HarvestDefinition def, int amount, Mobile from )
|
||||
{
|
||||
CheckRespawn();
|
||||
|
||||
|
|
@ -60,7 +60,12 @@ namespace Server.Engines.Harvest
|
|||
double rnd = Utility.RandomDouble();
|
||||
|
||||
m_Current = m_Maximum - amount;
|
||||
m_NextRespawn = DateTime.Now + TimeSpan.FromMinutes( min + (rnd * (max - min)) );
|
||||
|
||||
double minutes = min + (rnd * (max - min));
|
||||
if( def.RaceBonus && from.Race == Race.Elf ) //def.RaceBonus = Core.ML
|
||||
minutes *= .75; //25% off the time.
|
||||
|
||||
m_NextRespawn = DateTime.Now + TimeSpan.FromMinutes( minutes );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ namespace Server.Engines.Harvest
|
|||
private object m_NoResourcesMessage, m_OutOfRangeMessage, m_TimedOutOfRangeMessage, m_DoubleHarvestMessage, m_FailMessage, m_PackFullMessage, m_ToolBrokeMessage;
|
||||
private HarvestResource[] m_Resources;
|
||||
private HarvestVein[] m_Veins;
|
||||
private bool m_RaceBonus;
|
||||
|
||||
public int BankWidth{ get{ return m_BankWidth; } set{ m_BankWidth = value; } }
|
||||
public int BankHeight{ get{ return m_BankHeight; } set{ m_BankHeight = value; } }
|
||||
|
|
@ -50,6 +51,7 @@ namespace Server.Engines.Harvest
|
|||
public object ToolBrokeMessage{ get{ return m_ToolBrokeMessage; } set{ m_ToolBrokeMessage = value; } }
|
||||
public HarvestResource[] Resources{ get{ return m_Resources; } set{ m_Resources = value; } }
|
||||
public HarvestVein[] Veins{ get{ return m_Veins; } set{ m_Veins = value; } }
|
||||
public bool RaceBonus { get { return m_RaceBonus; } set { m_RaceBonus = value; } }
|
||||
|
||||
private Hashtable m_BanksByMap;
|
||||
|
||||
|
|
|
|||
|
|
@ -163,15 +163,29 @@ namespace Server.Engines.Harvest
|
|||
}
|
||||
else
|
||||
{
|
||||
//The whole harvest system is kludgy and I'm sure this is just adding to it.
|
||||
if ( item.Stackable )
|
||||
{
|
||||
if ( map == Map.Felucca && bank.Current >= def.ConsumedPerFeluccaHarvest )
|
||||
item.Amount = def.ConsumedPerFeluccaHarvest;
|
||||
int amount = def.ConsumedPerHarvest;
|
||||
int feluccaAmount = def.ConsumedPerFeluccaHarvest;
|
||||
|
||||
int racialAmount = (int)Math.Ceiling( amount * 1.1 );
|
||||
int feluccaRacialAmount = (int)Math.Ceiling( feluccaAmount * 1.1 );
|
||||
|
||||
bool eligableForRacialBonus = ( def.RaceBonus && from.Race == Race.Human );
|
||||
bool inFelucca = (map == Map.Felucca);
|
||||
|
||||
if( eligableForRacialBonus && inFelucca && bank.Current >= feluccaRacialAmount )
|
||||
item.Amount = feluccaRacialAmount;
|
||||
else if( inFelucca && bank.Current >= feluccaAmount )
|
||||
item.Amount = feluccaAmount;
|
||||
else if( eligableForRacialBonus && bank.Current >= racialAmount )
|
||||
item.Amount = racialAmount;
|
||||
else
|
||||
item.Amount = def.ConsumedPerHarvest;
|
||||
item.Amount = amount;
|
||||
}
|
||||
|
||||
bank.Consume( def, item.Amount );
|
||||
bank.Consume( def, item.Amount, from );
|
||||
|
||||
if ( Give( from, item, def.PlaceAtFeetIfFull ) )
|
||||
{
|
||||
|
|
@ -283,7 +297,9 @@ namespace Server.Engines.Harvest
|
|||
|
||||
public virtual HarvestResource MutateResource( Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestVein vein, HarvestResource primary, HarvestResource fallback )
|
||||
{
|
||||
if ( vein.ChanceToFallback > Utility.RandomDouble() )
|
||||
bool racialBonus = (def.RaceBonus && from.Race == Race.Elf );
|
||||
|
||||
if( vein.ChanceToFallback > (Utility.RandomDouble() + (racialBonus ? .20 : 0)) )
|
||||
return fallback;
|
||||
|
||||
double skillValue = from.Skills[def.Skill].Value;
|
||||
|
|
|
|||
|
|
@ -85,6 +85,8 @@ namespace Server.Engines.Harvest
|
|||
lumber.Resources = res;
|
||||
lumber.Veins = veins;
|
||||
|
||||
lumber.RaceBonus = Core.ML;
|
||||
|
||||
m_Definition = lumber;
|
||||
Definitions.Add( lumber );
|
||||
#endregion
|
||||
|
|
|
|||
|
|
@ -110,6 +110,8 @@ namespace Server.Engines.Harvest
|
|||
oreAndStone.Resources = res;
|
||||
oreAndStone.Veins = veins;
|
||||
|
||||
oreAndStone.RaceBonus = Core.ML;
|
||||
|
||||
Definitions.Add( oreAndStone );
|
||||
#endregion
|
||||
|
||||
|
|
@ -177,7 +179,8 @@ namespace Server.Engines.Harvest
|
|||
{
|
||||
if ( def == m_OreAndStone )
|
||||
{
|
||||
if ( from is PlayerMobile && ((PlayerMobile)from).StoneMining && ((PlayerMobile)from).ToggleMiningStone && from.Skills[SkillName.Mining].Base >= 100.0 && 0.1 > Utility.RandomDouble() )
|
||||
PlayerMobile pm = from as PlayerMobile;
|
||||
if ( pm != null && pm.StoneMining && pm.ToggleMiningStone && from.Skills[SkillName.Mining].Base >= 100.0 && 0.1 > Utility.RandomDouble() )
|
||||
return resource.Types[1];
|
||||
|
||||
return resource.Types[0];
|
||||
|
|
|
|||
|
|
@ -1029,12 +1029,13 @@ namespace Server.Items
|
|||
BaseShield shield = defender.FindItemOnLayer( Layer.TwoHanded ) as BaseShield;
|
||||
|
||||
double parry = defender.Skills[SkillName.Parry].Value;
|
||||
double parryNonRacial = defender.Skills[SkillName.Parry].NonRacialValue;
|
||||
double bushidoNonRacial = defender.Skills[SkillName.Bushido].NonRacialValue;
|
||||
double bushido = defender.Skills[SkillName.Bushido].Value;
|
||||
|
||||
if ( shield != null )
|
||||
{
|
||||
double chance = (parryNonRacial - bushido) / 400.0; //As per OSI, no negitive effect from the Racial stuffs, ie, 120 bushido and '0' parry with humans
|
||||
double chance = (parry - bushidoNonRacial) / 400.0; //As per OSI, no negitive effect from the Racial stuffs, ie, 120 parry and '0' bushido with humans
|
||||
|
||||
|
||||
// Parry over 100 grants a 5% bonus.
|
||||
if ( parry >= 100.0 )
|
||||
|
|
|
|||
|
|
@ -439,7 +439,9 @@ namespace Server.Mobiles
|
|||
{
|
||||
global = LightCycle.ComputeLevelFor( this );
|
||||
|
||||
if ( this.LightLevel < 21 && AosAttributes.GetValue( this, AosAttribute.NightSight ) > 0 )
|
||||
bool racialNightSight = (Core.ML && this.Race == Race.Elf);
|
||||
|
||||
if ( this.LightLevel < 21 && ( AosAttributes.GetValue( this, AosAttribute.NightSight ) > 0 || racialNightSight ))
|
||||
personal = 21;
|
||||
else
|
||||
personal = this.LightLevel;
|
||||
|
|
|
|||
|
|
@ -201,9 +201,14 @@ namespace Server.SkillHandlers
|
|||
if ( !Core.AOS || !m.Player )
|
||||
return true;
|
||||
|
||||
int tracking = from.Skills[SkillName.Tracking].Fixed;
|
||||
|
||||
|
||||
int tracking = from.Skills[SkillName.Tracking].Fixed;
|
||||
int detectHidden = from.Skills[SkillName.DetectHidden].Fixed;
|
||||
|
||||
if( Core.ML && m.Race == Race.Elf )
|
||||
tracking /= 2; //The 'Guide' says that it requires twice as Much tracking SKILL to track an elf. Not the total difficulty to track.
|
||||
|
||||
int hiding = m.Skills[SkillName.Hiding].Fixed;
|
||||
int stealth = m.Skills[SkillName.Stealth].Fixed;
|
||||
int divisor = hiding + stealth;
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ namespace Server.Targets
|
|||
}
|
||||
else
|
||||
{
|
||||
bank.Consume( def, 5 );
|
||||
bank.Consume( def, 5, from );
|
||||
|
||||
Item item = new Kindling();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue