Axle said:try this
if (p.RaceType =! Race.Elf) {
- Error: Scripts\ElvenBow.cs: CS0023: (line 59, column 17) Operador '!' não pod
e ser aplicado a operando do tipo 'Server.Mobiles.Race'
Operator '!' cant be applied a operating of type 'Server.Mobiles.Race'
- Error: Scripts\ElvenBow.cs: CS0161: (line 54, column 22) 'Server.Items.ElvenB
ow.OnEquip(Server.Mobile)': nem todos os caminhos de código retornam um valor
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
'Server.Items.ElvenBow.OnEquip(Server.Mobile)': not all the ways of the code return a valoue.
using System;
using Server.Network;
using Server.Items;
using Server.Mobiles;
namespace Server.Items
{
[FlipableAttribute( 0x13B2, 0x13B1 )]
public class ElvenBow : BaseRanged
{
public override int EffectID{ get{ return 0xF42; } }
public override Type AmmoType{ get{ return typeof( Arrow ); } }
public override Item Ammo{ get{ return new Arrow(); } }
public override WeaponAbility PrimaryAbility{ get{ return WeaponAbility.ParalyzingBlow; } }
public override WeaponAbility SecondaryAbility{ get{ return WeaponAbility.MortalStrike; } }
public override int AosStrengthReq{ get{ return 30; } }
public override int AosMinDamage{ get{ return 16; } }
public override int AosMaxDamage{ get{ return 18; } }
public override int AosSpeed{ get{ return 25; } }
public override int OldStrengthReq{ get{ return 20; } }
public override int OldMinDamage{ get{ return 9; } }
public override int OldMaxDamage{ get{ return 41; } }
public override int OldSpeed{ get{ return 20; } }
public override int DefMaxRange{ get{ return 10; } }
public override int InitMinHits{ get{ return 255; } }
public override int InitMaxHits{ get{ return 255; } }
public override WeaponAnimation DefAnimation{ get{ return WeaponAnimation.ShootBow; } }
[Constructable]
public ElvenBow() : base( 0x13B2 )
{
LootType = LootType.Blessed;
Name = "Elven Bow";
Hue = 1109;
Attributes.SpellChanneling = 1;
Attributes.WeaponSpeed = 20;
Weight = 6.0;
Layer = Layer.TwoHanded;
}
public override void GetDamageTypes( Mobile wielder, out int phys, out int fire, out int cold, out int pois, out int nrgy )
{
phys = fire = cold = pois = 0;
nrgy = 100;
}
[COLOR="Red"]public override bool OnEquip( Mobile from )[/COLOR]
{
if ( from is PlayerMobile )
{
PlayerMobile p = from as PlayerMobile;
if (p.RaceType != Race.Elf) {
from.SendMessage( "Only elves may use this weapon." );
return false;
}
else
{
return true;
}
}
}
public ElvenBow( 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();
if ( Weight == 7.0 )
Weight = 6.0;
}
}
}
public override [COLOR="Blue"]bool[/COLOR] OnEquip( Mobile from )
{
if ( from is PlayerMobile )
{
PlayerMobile p = from as PlayerMobile;
if (p.RaceType != Race.Elf) {
from.SendMessage( "Only elves may use this weapon." );
return [COLOR="#ff0000"]false[/COLOR];
}
else
{
return [COLOR="Red"]true[/COLOR];
}
}
}
public override bool OnEquip( Mobile from )
{
if ( from is PlayerMobile )
{
PlayerMobile p = from as PlayerMobile;
if (p.RaceType != Race.Elf) {
from.SendMessage( "Only elves may use this weapon." );
return false;
}
}
return true;
}
I'm realy glad that it worked and I realy hope that you learned how to create a new property and how to access itdarksky said:It worked!!!!!!!!!!!!!!!!!!!!!!!!!
Thank you a lot!
After 5 pages it worked... I cant believe...
Thanks again
And again!
I think he shouldn't.Kireko said:I think you should post it when you get it done. Id like to use it rather than the one I have!
Just a thought.
daat99 said:I think he shouldn't.
He edited playermobile and most of the admins will use it and then will end up wiping their entire shard because 90% of the people that download pre-made scripts doesn't know how to solve those problems (the other 10% won't need his script because they probably made their own version already).
2 major differences.Heartless said:First time i agreed with you daat
Just like your daat99 pack, 99% of all shards use it,
so that why i DONT use it