Go Back   RunUO - Ultima Online Emulation > RunUO > Script Support

Script Support Get support for modifying RunUO Scripts, or writing your own!

Reply
 
Thread Tools Display Modes
Old 07-20-2008, 04:37 PM   #1 (permalink)
Forum Novice
 
Join Date: Feb 2004
Posts: 107
Default Check on armor issue

Okay, i want to check a player's race and if it is the right race it can wear it. That's my script:
Code:
using System;
using Server;
using Mobiles;

namespace Server.Items
{
    public class SpadaRunicaEsperiana : Broadsword
    {
        public override int InitMinHits{ get{ return 60; } }
        public override int InitMaxHits{ get{ return 100; } }
        public override int AosStrengthReq { get { return 115; } }
        public override int Hue { get { return 11; } }

        [Constructable]
        public SpadaRunicaEsperiana()
        {
            Name = "Spada Runica Esperiana";
            Hue = 11;
            Attributes.AttackChance = 20;
            Attributes.DefendChance = 20;
            WeaponAttributes.HitLightning = 10;
        }

        public override bool OnEquip(Mobile from)
        {

            if (from is PlayerMobile)
            {
                PlayerMobile m = (PlayerMobile)from;
                {
                    if (((PlayerMobile)m).RaceType == RaceType.Mistas || ((PlayerMobile)m).RaceType == RaceType.Archeon || ((PlayerMobile)m).RaceType == RaceType.Garidas || ((PlayerMobile)m).RaceType == RaceType.Raminghi)
                        m.SendMessage("Non sei un Esperiano");
                    return false;
                }

                if (from.Skills[SkillName.Swords].Value <= 110)
                {
                    from.SendMessage("Non hai l'abilità necessaria");
                    return false;
                }
                else
                {
                    return base.OnEquip(from); ;
                }
            }

            else
            {
                from.SendMessage("Non sei un Esperiano");
                return;
            }

        }
           

        public override void GetDamageTypes(Mobile wielder, out int phys, out int fire, out int cold, out int pois, out int nrgy)
        {
            fire = 0;
            cold = 30;
            nrgy = 0;
            phys = 70;
            pois = 0;
        }

        public SpadaRunicaEsperiana(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();
        }
    } 
}
But it tells me that is impossible find the type or the namespace of "Mobiles"...
Zaihur is offline   Reply With Quote
Old 07-20-2008, 04:44 PM   #2 (permalink)
Forum Expert
 
Join Date: Dec 2005
Posts: 272
Default

It should be 'using Server.Mobiles' (happens to me all the time....)
Melchior is offline   Reply With Quote
Old 07-21-2008, 12:48 AM   #3 (permalink)
Forum Novice
 
Join Date: Feb 2004
Posts: 107
Default

You are right..I'm a Noob -_-
Zaihur is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5