Hammerhand
Knight
Stat Deeds help
I'm currently revamping my Dragonkin event pack using Kiasta's new upgradable Dragonkin weapons system. So far, so good, but.. it also comes with 47 custom ItemStatDeeds. What I'm wanting to do is add them to the Dragonkin loot in a bag of 5 with the deeds being random. Not exactly sure how to call them or even where to begin. Below is one of the deeds. Any help would be appreciated. Trying to call either BaseItemStatDeed or just ItemStatDeed got me errors of the "cant find it" type..
I'm currently revamping my Dragonkin event pack using Kiasta's new upgradable Dragonkin weapons system. So far, so good, but.. it also comes with 47 custom ItemStatDeeds. What I'm wanting to do is add them to the Dragonkin loot in a bag of 5 with the deeds being random. Not exactly sure how to call them or even where to begin. Below is one of the deeds. Any help would be appreciated. Trying to call either BaseItemStatDeed or just ItemStatDeed got me errors of the "cant find it" type..
Code:
using System;
using Server.Network;
using Server.Prompts;
using Server.Items;
using Server.Targeting;
using Server;
namespace Server.Items
{
public class AttackChanceTarget : Target
{
private AttackChanceDeed m_Deed;
public AttackChanceTarget(AttackChanceDeed deed)
: base(1, false, TargetFlags.None)
{
m_Deed = deed;
}
protected override void OnTarget(Mobile from, object target)
{
if (m_Deed.Deleted || m_Deed.RootParent != from)
{
from.SendMessage("You cannot add attack chance increase to that.");
return;
}
if (target is BaseDragonkinWeapon)
{
BaseDragonkinWeapon item = (BaseDragonkinWeapon)target;
if (item is BaseDragonkinWeapon)
{
if (((BaseDragonkinWeapon)item).Attributes.AttackChance >= 100)
{
from.SendMessage("That item has max attack chance increase.");
}
else
{
((BaseDragonkinWeapon)item).Attributes.AttackChance += 5;
from.SendMessage("Attack chance increase successfully added to item.");
m_Deed.Delete();
}
}
}
else if (target is BaseDragonkinArmor)
{
BaseDragonkinArmor item = (BaseDragonkinArmor)target;
if (item is BaseDragonkinArmor)
{
if (((BaseDragonkinArmor)item).Attributes.AttackChance >= 100)
{
from.SendMessage("That item has max attack chance increase.");
}
else
{
((BaseDragonkinArmor)item).Attributes.AttackChance += 5;
from.SendMessage("Attack chance increase successfully added to item.");
m_Deed.Delete();
}
}
}
else if (target is BaseDragonkinShield)
{
BaseDragonkinShield item = (BaseDragonkinShield)target;
if (item is BaseDragonkinShield)
{
if (((BaseDragonkinShield)item).Attributes.AttackChance >= 100)
{
from.SendMessage("That item has max attack chance increase.");
}
else
{
((BaseDragonkinShield)item).Attributes.AttackChance += 5;
from.SendMessage("Attack chance increase successfully added to item.");
m_Deed.Delete();
}
}
}
else if (target is BaseDragonkinClothing)
{
BaseDragonkinClothing item = (BaseDragonkinClothing)target;
if (item is BaseDragonkinClothing)
{
if (((BaseDragonkinClothing)item).Attributes.AttackChance >= 100)
{
from.SendMessage("That item has max attack chance increase.");
}
else
{
((BaseDragonkinClothing)item).Attributes.AttackChance += 5;
from.SendMessage("Attack chance increase successfully added to item.");
m_Deed.Delete();
}
}
}
else if (target is BaseDragonkinJewel)
{
BaseDragonkinJewel item = (BaseDragonkinJewel)target;
if (item is BaseDragonkinJewel)
{
if (((BaseDragonkinJewel)item).Attributes.AttackChance >= 100)
{
from.SendMessage("That item has max attack chance increase.");
}
else
{
((BaseDragonkinJewel)item).Attributes.AttackChance += 5;
from.SendMessage("Attack chance increase successfully added to item.");
m_Deed.Delete();
}
}
}
else
{
from.SendMessage("You cannot put attack chance increase on that.");
}
}
}
public class AttackChanceDeed : BaseItemStatDeed
{
[Constructable]
public AttackChanceDeed()
: base(0x14F0)
{
LootType = LootType.Blessed;
Name = "a attack chance increase deed";
Hue = 1150;
Weight = 1.0;
}
public AttackChanceDeed(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
public override void OnDoubleClick(Mobile from)
{
if (!IsChildOf(from.Backpack))
{
from.SendMessage("The item needs to be in your pack");
}
else
{
from.SendMessage("Which item would you like to add attack chance increase to?");
from.Target = new AttackChanceTarget(this);
}
}
}
}