I really hate to ask but I am in need of a little help!I have been messing with different ways to give food attributes...
I do not want to show the attributes on the item itself just have it actually enable these attributes.
This is what I have tried and actually got it to Compile with
When the person eats it should give them the Spell Damage Bonus as well as the Damage Increase Bonus!
Thanks for your help!
I do not want to show the attributes on the item itself just have it actually enable these attributes.
This is what I have tried and actually got it to Compile with
Code:
using System;
using Server;
using Server.Mobiles;
namespace Server.Items
{
public class WrathGrapes : BaseMagicalFood
{
public override MagicalFood FoodID{ get{ return MagicalFood.WrathGrapes; } }
public override TimeSpan Cooldown{ get{ return TimeSpan.FromMinutes( 2 ); } }
public override TimeSpan Duration{ get{ return TimeSpan.FromSeconds( 20 ); } }
public override int EatMessage{ get{ return 1074847; } } // The grapes of wrath invigorate you for a short time, allowing you to deal extra damage.
[Constructable]
public WrathGrapes() : base( 0x2FD7 )
{
Weight = 1.0;
Hue = 0x482;
}
public WrathGrapes( Serial serial ) : base( serial )
{
}
public override bool Eat( Mobile from )
{
if ( base.Eat( from ) )
{
from.PlaySound( 0x1EA );
from.FixedParticles( 0x373A, 10, 15, 5018, EffectLayer.Waist );
int DamageBonus = AosAttributes.GetValue( from, AosAttribute.WeaponDamage );
int SpellDamageBonus = AosAttributes.GetValue( from, AosAttribute.SpellDamage );
DamageBonus += 35;
SpellDamageBonus += 15;
return true;
}
return false;
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}
When the person eats it should give them the Spell Damage Bonus as well as the Damage Increase Bonus!
Thanks for your help!