Mikthebug
Member
So im trying to make a scroll that gives pets weapon abilitys.
And when i try this it says that BaseVreature dosen't contain weaponability.
Thankful for any help
And when i try this it says that BaseVreature dosen't contain weaponability.
Thankful for any help
using System;
using Server.Network;
using Server.Prompts;
using Server.Items;
using System.Collections;
using Server.Gumps;
using Server.Targeting;
using Server.Misc;
using Server.Accounting;
using System.Xml;
using Server.Mobiles;
namespace Server.Items
{
public class BleedingScroll : Item
{
[Constructable]
public BleedingScroll() : base( 0x14F0 )
{
base.Weight = 1.0;
base.Name = "a bleeding scroll";
base.Hue = 0x481;
LootType = LootType.Cursed;
}
public override void OnDoubleClick( Mobile from )
{
if ( IsChildOf( from.Backpack ) )
{
from.Target = new BleedTarget(from, this);
}
else
{
from.SendMessage("That must be in your backpack for you to use it.");
}
}
public BleedingScroll( Serial serial ) : base( serial )
{
}
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();
}
}
public class BleedTarget : Target
{
private Mobile m_From;
private BleedingScroll m_Deed;
public BleedTarget( Mobile from, BleedingScroll deed ) : base ( 3, false, TargetFlags.None )
{
m_Deed = deed;
m_From = from;
from.SendMessage("Select the companion which you want to enhance.");
}
protected override void OnTarget( Mobile from, object targeted )
{
if (m_Deed.IsChildOf( m_From.Backpack ) )
{
if ( targeted is Mobile )
{
if ( targeted is BaseCreature )
{
BaseCreature creature = (BaseCreature)targeted;
if( !creature.Tamable ){
from.SendMessage("This animal is not tame.");
}
else if( !creature.Controlled || creature.ControlMaster != from ){
from.SendMessage("This is not you animal.");
}
else if( creature.IsDeadPet ){
from.SendMessage("This animal is dead.");
}
else if( creature.Summoned ){
from.SendMessage("You can not enhance a summoned creature defence.");
}
else if( creature.Body.IsHuman ){
from.SendMessage("You can not enhance a humans defence.");
}
else if( creature.IsBonded == false ){
from.SendMessage("You need to bond with your companion to use that.");
}
else if( from.Skills[SkillName.AnimalLore].Base < creature.MinTameSkill ){
from.SendMessage("You do not know enough about your companion to enhance its defence.");
}
else if( creature.WeaponAbility.BleedAttack >= 1 ){
from.SendMessage("You can not enhance your companions anymore.");
}
else{
try{
creature.WeaponAbility.BleedAttack += 1;
from.SendMessage("Your companions defences seems stronger.");
m_Deed.Delete();
Effects.SendLocationParticles( EffectItem.Create( from.Location, from.Map, EffectItem.DefaultDuration ), 0, 0, 0, 0, 0, 5060, 0 );
Effects.PlaySound( from.Location, from.Map, 0x243 );
Effects.SendMovingParticles( new Entity( Serial.Zero, new Point3D( from.X - 6, from.Y - 6, from.Z + 15 ), from.Map ), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100 );
Effects.SendMovingParticles( new Entity( Serial.Zero, new Point3D( from.X - 4, from.Y - 6, from.Z + 15 ), from.Map ), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100 );
Effects.SendMovingParticles( new Entity( Serial.Zero, new Point3D( from.X - 6, from.Y - 4, from.Z + 15 ), from.Map ), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100 );
}
catch{
from.SendMessage("Oh no!");
}
}
}
}
}
}
}
}