Skip to content

Commit

Permalink
Merge pull request #28 from ServUO/master
Browse files Browse the repository at this point in the history
merge with master
  • Loading branch information
kevin-10 committed Nov 29, 2016
2 parents 9619825 + e95f91f commit 05a20f8
Show file tree
Hide file tree
Showing 8 changed files with 222 additions and 14 deletions.
1 change: 1 addition & 0 deletions Scripts/Items/Artifacts/Equipment/Weapons/AbyssalBlade.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public AbyssalBlade()
this.WeaponAttributes.HitFatigue = 50;
this.WeaponAttributes.HitLeechHits = 60;
this.WeaponAttributes.HitLeechStam = 60;
this.WeaponAttributes.HitLeechMana = 60;
this.Attributes.WeaponSpeed = 20;
this.Attributes.WeaponDamage = 60;
this.AosElementDamages.Chaos = 100;
Expand Down
2 changes: 1 addition & 1 deletion Scripts/Items/Equipment/Armor/BaseArmor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,7 @@ public int GetDurabilityBonus()
return bonus;
}

public bool Scissor(Mobile from, Scissors scissors)
public virtual bool Scissor(Mobile from, Scissors scissors)
{
if (!this.IsChildOf(from.Backpack))
{
Expand Down
198 changes: 197 additions & 1 deletion Scripts/Items/Equipment/Armor/GargishClothArmor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,55 @@ public GargishClothArmsArmor(int hue)
this.Weight = 2.0;
}

public override bool Scissor(Mobile from, Scissors scissors)
{
if (!this.IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(502437); // Items you wish to cut must be in your backpack.
return false;
}

if (Ethics.Ethic.IsImbued(this))
{
from.SendLocalizedMessage(502440); // Scissors can not be used on that to produce anything.
return false;
}

CraftSystem system = DefTailoring.CraftSystem;

CraftItem item = system.CraftItems.SearchFor(this.GetType());

if (item != null && item.Resources.Count == 1 && item.Resources.GetAt(0).Amount >= 2)
{
try
{
Type resourceType = null;

CraftResourceInfo info = CraftResources.GetInfo(this.Resource);

if (info != null && info.ResourceTypes.Length > 0)
resourceType = info.ResourceTypes[0];

if (resourceType == null)
resourceType = item.Resources.GetAt(0).ItemType;

Item res = (Item)Activator.CreateInstance(resourceType);

this.ScissorHelper(from, res, this.PlayerConstructed ? (item.Resources.GetAt(0).Amount / 2) : 1);

res.LootType = LootType.Regular;

return true;
}
catch
{
}
}

from.SendLocalizedMessage(502440); // Scissors can not be used on that to produce anything.
return false;
}

public override Race RequiredRace
{
get
Expand Down Expand Up @@ -178,6 +227,55 @@ public GargishClothChestArmor(int hue)
this.Weight = 2.0;
}

public override bool Scissor(Mobile from, Scissors scissors)
{
if (!this.IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(502437); // Items you wish to cut must be in your backpack.
return false;
}

if (Ethics.Ethic.IsImbued(this))
{
from.SendLocalizedMessage(502440); // Scissors can not be used on that to produce anything.
return false;
}

CraftSystem system = DefTailoring.CraftSystem;

CraftItem item = system.CraftItems.SearchFor(this.GetType());

if (item != null && item.Resources.Count == 1 && item.Resources.GetAt(0).Amount >= 2)
{
try
{
Type resourceType = null;

CraftResourceInfo info = CraftResources.GetInfo(this.Resource);

if (info != null && info.ResourceTypes.Length > 0)
resourceType = info.ResourceTypes[0];

if (resourceType == null)
resourceType = item.Resources.GetAt(0).ItemType;

Item res = (Item)Activator.CreateInstance(resourceType);

this.ScissorHelper(from, res, this.PlayerConstructed ? (item.Resources.GetAt(0).Amount / 2) : 1);

res.LootType = LootType.Regular;

return true;
}
catch
{
}
}

from.SendLocalizedMessage(502440); // Scissors can not be used on that to produce anything.
return false;
}

public override Race RequiredRace
{
get
Expand Down Expand Up @@ -338,6 +436,55 @@ public GargishClothLegsArmor(int hue)
this.Weight = 2.0;
}

public override bool Scissor(Mobile from, Scissors scissors)
{
if (!this.IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(502437); // Items you wish to cut must be in your backpack.
return false;
}

if (Ethics.Ethic.IsImbued(this))
{
from.SendLocalizedMessage(502440); // Scissors can not be used on that to produce anything.
return false;
}

CraftSystem system = DefTailoring.CraftSystem;

CraftItem item = system.CraftItems.SearchFor(this.GetType());

if (item != null && item.Resources.Count == 1 && item.Resources.GetAt(0).Amount >= 2)
{
try
{
Type resourceType = null;

CraftResourceInfo info = CraftResources.GetInfo(this.Resource);

if (info != null && info.ResourceTypes.Length > 0)
resourceType = info.ResourceTypes[0];

if (resourceType == null)
resourceType = item.Resources.GetAt(0).ItemType;

Item res = (Item)Activator.CreateInstance(resourceType);

this.ScissorHelper(from, res, this.PlayerConstructed ? (item.Resources.GetAt(0).Amount / 2) : 1);

res.LootType = LootType.Regular;

return true;
}
catch
{
}
}

from.SendLocalizedMessage(502440); // Scissors can not be used on that to produce anything.
return false;
}

public override Race RequiredRace
{
get
Expand Down Expand Up @@ -493,12 +640,61 @@ public GargishClothKiltArmor()

[Constructable]
public GargishClothKiltArmor(int hue)
: base(0x040A)
: base(0x0408)
{
Hue = hue;
this.Weight = 2.0;
}

public override bool Scissor(Mobile from, Scissors scissors)
{
if (!this.IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(502437); // Items you wish to cut must be in your backpack.
return false;
}

if (Ethics.Ethic.IsImbued(this))
{
from.SendLocalizedMessage(502440); // Scissors can not be used on that to produce anything.
return false;
}

CraftSystem system = DefTailoring.CraftSystem;

CraftItem item = system.CraftItems.SearchFor(this.GetType());

if (item != null && item.Resources.Count == 1 && item.Resources.GetAt(0).Amount >= 2)
{
try
{
Type resourceType = null;

CraftResourceInfo info = CraftResources.GetInfo(this.Resource);

if (info != null && info.ResourceTypes.Length > 0)
resourceType = info.ResourceTypes[0];

if (resourceType == null)
resourceType = item.Resources.GetAt(0).ItemType;

Item res = (Item)Activator.CreateInstance(resourceType);

this.ScissorHelper(from, res, this.PlayerConstructed ? (item.Resources.GetAt(0).Amount / 2) : 1);

res.LootType = LootType.Regular;

return true;
}
catch
{
}
}

from.SendLocalizedMessage(502440); // Scissors can not be used on that to produce anything.
return false;
}

public override Race RequiredRace
{
get
Expand Down
7 changes: 5 additions & 2 deletions Scripts/Mobiles/NPCs/BaseVendor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,17 @@ private class BulkOrderInfoEntry : ContextMenuEntry
private readonly BaseVendor m_Vendor;

public BulkOrderInfoEntry(Mobile from, BaseVendor vendor)
: base(6152)
: base(6152, 3)
{
m_From = from;
m_Vendor = vendor;
}

public override void OnClick()
{
{
if (!m_From.InRange(m_Vendor.Location, 3))
return;

EventSink.InvokeBODOffered(new BODOfferEventArgs(m_From, m_Vendor));
if (m_Vendor.SupportsBulkOrders(m_From))
{
Expand Down
2 changes: 2 additions & 0 deletions Scripts/Services/High Seas/Items/CorgulAltar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ public bool IsKey(Item item, Mobile from)

if (m_KeyStage >= 0 && m_KeyStage < m_Keys.Length && type == m_Keys[m_KeyStage])
return true;
else if (m_KeyStage == 1 && item is PresetMap && item.LabelNumber == 1041204)
return true;
else if (m_KeyStage == 1 && item is TreasureMap)
from.SendLocalizedMessage(1116360); // The island's location cannot be marked on a treasure map.
else if (m_KeyStage == 1 && item is MapItem)
Expand Down
18 changes: 13 additions & 5 deletions Scripts/Services/PointsSystems/CleanUpBritanniaData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -704,20 +704,28 @@ protected override void OnTarget(Mobile m, object targeted)
if (targeted is Item)
{
Item item = (Item)targeted;


if (!item.IsChildOf(m_Mobile))
return;

double points = CleanUpBritanniaData.GetPoints(item);
if(points == 0)

if (points == 0)
m_Mobile.SendLocalizedMessage(1151271); // This item has no turn-in value for Clean Up Britannia.
else if (points < 1)
m_Mobile.SendLocalizedMessage(1151272, points.ToString()); // This item is worth less than one point for Clean Up Britannia.
else if(points == 1)
else if (points == 1)
m_Mobile.SendLocalizedMessage(1151273, points.ToString()); // This item is worth approximately one point for Clean Up Britannia.
else
m_Mobile.SendLocalizedMessage(1151274, points.ToString()); //This item is worth approximately ~1_VALUE~ points for Clean Up Britannia.
m_Mobile.SendLocalizedMessage(1151274, points.ToString()); //This item is worth approximately ~1_VALUE~ points for Clean Up Britannia.

m_Mobile.Target = new AppraiseforCleanupTarget(m_Mobile);
}
else
{
m_Mobile.SendLocalizedMessage(1151271); // This item has no turn-in value for Clean Up Britannia.
m_Mobile.Target = new AppraiseforCleanupTarget(m_Mobile);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public Hephaestus(bool antique)
PhysicalBonus = 15;
ArmorAttributes.SelfRepair = 5;

SkillBonuses.SetValues(0, SkillName.Parry, 15.0);
SkillBonuses.SetValues(0, SkillName.Parry, 10.0);

if (antique)
{
Expand Down Expand Up @@ -80,7 +80,7 @@ public GargishHephaestus(bool antique)
PhysicalBonus = 15;
ArmorAttributes.SelfRepair = 5;

SkillBonuses.SetValues(0, SkillName.Parry, 15.0);
SkillBonuses.SetValues(0, SkillName.Parry, 10.0);

if (antique)
{
Expand Down
4 changes: 1 addition & 3 deletions Scripts/Skills/Imbuing/Core/Imbuing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,7 @@ public static void ImbueItem(Mobile from, Item i, int mod, int value)
int totalItemMods = GetTotalMods(i, mod);
int maxint = GetMaxIntensity(i, def);

double propWeight = ((double)def.Weight / (double)maxint) * value;
propWeight = Math.Round(propWeight);
int propweight = Convert.ToInt32(propWeight);
int propweight = (int)(((double)def.Weight / (double)maxint) * value);

if ((totalItemWeight + propweight) > maxWeight)
{
Expand Down

0 comments on commit 05a20f8

Please sign in to comment.