potions: create separate new pot when d-click stack, as on OSI, fixes second explosion when exp pot is not thrown, misc accuracy fixes to exp pots, mobiles that cant take damage from an explosion pot also shouldn't absorb their share of the damage.
This commit is contained in:
parent
478439ef52
commit
36c6ecee6c
2 changed files with 42 additions and 19 deletions
|
|
@ -97,10 +97,36 @@ namespace Server.Items
|
|||
|
||||
if ( from.InRange( this.GetWorldLocation(), 1 ) )
|
||||
{
|
||||
if ( !RequireFreeHand || HasFreeHand( from ) )
|
||||
Drink( from );
|
||||
if (!RequireFreeHand || HasFreeHand(from))
|
||||
{
|
||||
if (Amount > 1)
|
||||
{
|
||||
BasePotion pot = (BasePotion)Activator.CreateInstance(this.GetType());
|
||||
|
||||
if (pot != null)
|
||||
{
|
||||
Amount--;
|
||||
|
||||
if (from.Backpack != null && !from.Backpack.Deleted)
|
||||
{
|
||||
from.Backpack.DropItem(pot);
|
||||
}
|
||||
else
|
||||
{
|
||||
pot.MoveToWorld(from.Location, from.Map);
|
||||
}
|
||||
pot.Drink( from );
|
||||
}
|
||||
}
|
||||
else if( Amount == 1 )
|
||||
{
|
||||
this.Drink( from );
|
||||
}
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage( 502172 ); // You must have a free hand to drink a potion.
|
||||
{
|
||||
from.SendLocalizedMessage(502172); // You must have a free hand to drink a potion.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue