osd_daedalus
Knight
[SVN] Skinning Knives to return you cut leather
If you use a skinning knife, it returns you hides in the corpse. But if you equip it and you use it, it returns cut leather directly in your backpack. If you go overweight, they go on the ground.
EDIT: there are some questions below that still need an answer before signal this as ready for commit
This is a fix. I tried and it works. It involves 2 files, becuase in Corpse.cs there is the need to add another variable for OnCarve: the item used.Type: Missing Feature
Basic Description: Skinning knives, when used to carve, should return you cut leather directly in your backpack. But only if equipped
Way to experience: Skin a creature with a skinning knife equipped and you still have hides.
Detailed Description: As above. This is also the base for the ML Butcher War Cleaver, that has the same behaviour but doesn't need to be equipped. About this one, it's already included in MalGanis' ML and it will be implemented when ML is going to be implemented.
Links: http://www.uoguide.com/Leather
Code: see below
If you use a skinning knife, it returns you hides in the corpse. But if you equip it and you use it, it returns cut leather directly in your backpack. If you go overweight, they go on the ground.
Code:
Index: Scripts/Engines/AI/Creature/BaseCreature.cs
===================================================================
--- Scripts/Engines/AI/Creature/BaseCreature.cs (revision 319)
+++ Scripts/Engines/AI/Creature/BaseCreature.cs (working copy)
@@ -1191,7 +1191,7 @@
{
}
- public virtual void OnCarve( Mobile from, Corpse corpse )
+ public virtual void OnCarve( Mobile from, Corpse corpse, Item with )
{
int feathers = Feathers;
int wool = Wool;
@@ -1243,7 +1243,33 @@
from.SendLocalizedMessage( 500467 ); // You carve some meat, which remains on the corpse.
}
- if ( hides != 0 )
+ if ( hides != 0 && with is SkinningKnife && with.Parent == from && Core.AOS )
+
+ {
+ Item leather = null;
+
+ if (HideType == HideType.Regular)
+ leather = new Leather(hides);
+ else if (HideType == HideType.Spined)
+ leather = new SpinedLeather(hides);
+ else if (HideType == HideType.Horned)
+ leather = new HornedLeather(hides);
+ else if (HideType == HideType.Barbed)
+ leather = new BarbedLeather(hides);
+
+ if (leather != null)
+ {
+ if (!from.PlaceInBackpack(leather))
+ {
+ leather.MoveToWorld(from.Location, from.Map);
+ from.SendLocalizedMessage(1077182); // Your backpack is too full, and it falls to the ground.
+ }
+ else
+ from.SendLocalizedMessage(1073555); // You skin it and place the cut-up hides in your backpack.
+ }
+ }
+
+ else if ( hides != 0 )
{
if ( HideType == HideType.Regular )
corpse.DropItem( new Hides( hides ) );
Index: Scripts/Items/Misc/Corpses/Corpse.cs
===================================================================
--- Scripts/Items/Misc/Corpses/Corpse.cs (revision 319)
+++ Scripts/Items/Misc/Corpses/Corpse.cs (working copy)
@@ -959,7 +959,7 @@
}
else if ( dead is BaseCreature )
{
- ((BaseCreature)dead).OnCarve( from, this );
+ ((BaseCreature)dead).OnCarve( from, this, item );
}
else
{
EDIT: there are some questions below that still need an answer before signal this as ready for commit