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 02-10-2004, 11:15 PM   #1 (permalink)
 
Join Date: Jan 2004
Posts: 753
Send a message via ICQ to Crack177 Send a message via AIM to Crack177 Send a message via Yahoo to Crack177
Default Me only wearing it.

I don't have time to check this, but will this work right for my character, his serial is 0x1. Here is the script.
[code:1]using System;
using Server;

namespace Server.Items
{
public class YAYsBane : Kryss
{
public override int LabelNumber{ get{ return 1061106; } } // Axe of the Heavens
public override int ArtifactRarity{ get{ return 60; } }

public override int InitMinHits{ get{ return 255; } }
public override int InitMaxHits{ get{ return 255; } }

[Constructable]
public YAYsBane()
{
Hue = 1153;
Name = "The Bane of YAY";
// TODO: Repond Slayer
WeaponAttributes.HitFireball = 50;
WeaponAttributes.HitHarm = 50;
WeaponAttributes.HitLightning = 50;
WeaponAttributes.HitDispel = 50;
WeaponAttributes.HitMagicArrow = 50;
WeaponAttributes.HitLeechHits = 50;
WeaponAttributes.HitLeechMana = 50;
WeaponAttributes.HitLeechStam = 50;
WeaponAttributes.HitLowerAttack = 50;
WeaponAttributes.HitLowerDefend = 50;
WeaponAttributes.SelfRepair = 170;
Attributes.AttackChance = 15;
Attributes.CastRecovery = 1;
Attributes.CastSpeed = 1;
Attributes.DefendChance = 15;
Attributes.SpellChanneling = 1;
Attributes.WeaponDamage = 60;
WeaponAttributes.ResistFireBonus = 20;
WeaponAttributes.ResistPoisonBonus = 20;
WeaponAttributes.ResistColdBonus = 20;
LootType = LootType.Blessed;
}

public YAYsBane( Serial serial ) : base( serial )
{
}

public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );

writer.Write( (int) 0 );
}
public override void OnDoubleClick( Mobile from )
{
if ( from.Serial == 0x1 )
}

public override void Deserialize(GenericReader reader)
{
base.Deserialize( reader );

int version = reader.ReadInt();
}
}
}[/code:1]
I'm talking about his part I just added it.
[code:1] }
public override void OnDoubleClick( Mobile from )
{
if ( from.Serial == 0x1 )
}

[/code:1]
Crack177 is offline   Reply With Quote
Old 02-11-2004, 12:25 AM   #2 (permalink)
Forum Expert
 
Ravenal's Avatar
 
Join Date: Oct 2003
Location: Spokane Valley, WA
Age: 24
Posts: 1,528
Default

Yes it will work!

mine is much more deeper but here ya can look at it...

[code:1]
/////////////////////////////////////////////////////////
// Scripted by BKW of Awaken Lands, Future Online Game //
// URL: www.awakenlands.com //
// © 2004, By Fanatsy World Entertainment //
/////////////////////////////////////////////////////////
/**********PLEASE DO NOT REMOVE THIS HEADER*************/

using System;
using System.Collections;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Network;

namespace Server.Items
{
public abstract class BaseMagicalJewel : Item
{
private AccessLevel m_AccessLevel;
private bool m_TurnedOn;

public abstract int Body{ get; }
public virtual int StaffSerial{ get{ return 0x0; } }
public virtual int ItemHue{ get{ return 0; } }
public abstract string ItemName{ get; }
public virtual Layer ItemLayer{ get{ return Layer; } }
public virtual bool UsingLayers{ get{ return false; } }
public virtual string Message{ get{ return "of the Ancient World"; } }
public virtual bool RegenHits{ get{ return false; } }
public virtual bool RegenMana{ get{ return false; } }
public virtual bool RegenStam{ get{ return false; } }

public abstract string OldTitle{ get; }
public abstract string OldName{ get; }
public virtual int OldHue{ get{ return 0; } }
public virtual int OldKarma{ get{ return 0; } }
public virtual int OldFame{ get{ return 0; } }

public abstract string NewName{ get; }
public virtual string NewTitle{ get{ return ""; } }
public virtual int NewHue{ get{ return 0; } }
public virtual int NewKarma{ get{ return 0; } }
public virtual int NewFame{ get{ return 0; } }

public virtual int EffectID{ get{ return 0x0; } }
public virtual int EffectHue{ get{ return 0; } }
public virtual int EffectID2{ get{ return 0x0; } }
public virtual int EffectHue2{ get{ return 0; } }
public virtual int EffectID3{ get{ return 0x0; } }
public virtual int EffectHue3{ get{ return 0; } }
public virtual int EffectID4{ get{ return 0x0; } }
public virtual int EffectHue4{ get{ return 0; } }
public virtual int EffectID5{ get{ return 0x0; } }
public virtual int EffectHue5{ get{ return 0; } }

public virtual int EffectSpeed{ get{ return 5; } }
public virtual int EffectDur{ get{ return 32; } }
public virtual int Effect{ get{ return 250; } }
public virtual int EffectRenMode{ get{ return 250; } }

public virtual bool UsingBolts{ get{ return false; } }
public virtual int BoltEffectHue{ get{ return 0; } }
public virtual int BoltsAmount { get { return 0; } }

public virtual int PlaySound{ get{ return -1; } }

[CommandProperty( AccessLevel.Administrator )]
public AccessLevel AccessLevel
{
get{ return m_AccessLevel; }
set{ m_AccessLevel = value; }
}

[CommandProperty( AccessLevel.GameMaster )]
public bool TurnedOn
{
get{ return m_TurnedOn; }
set{ m_TurnedOn = value; }
}

public BaseMagicalJewel( AccessLevel level, int itemID ) : base( itemID )
{
Name = this.ItemName;
Hue = this.ItemHue;
Layer = this.ItemLayer;
Stackable = false;
Weight = 0.0;
Movable = true;
LootType = LootType.Blessed;

m_AccessLevel = level;
m_TurnedOn = true;
}

public BaseMagicalJewel( Serial serial ) : base( serial )
{
}

public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );

writer.Write( (int) 1 ); // version

writer.Write( (bool)m_TurnedOn );
writer.Write( (int) m_AccessLevel );
}

public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );

int version = reader.ReadInt();

switch ( version )
{
case 1:
{
m_TurnedOn = (bool)reader.ReadBool();
goto case 0;
}
case 0:
{
m_AccessLevel = (AccessLevel)reader.ReadInt();
break;
}
}
}

public bool Validate()
{
object root = RootParent;

if ( root is Mobile && ((Mobile)root).AccessLevel < m_AccessLevel )
{
Delete();
return false;
}

return true;
}

public override void OnSingleClick( Mobile from )
{
if ( Validate() )
base.OnSingleClick( from );
}

public override void OnDoubleClick( Mobile from )
{
ALPlayerMobile m = ((ALPlayerMobile )from );
if ( Parent != from )
if ( from.AccessLevel <= AccessLevel.GameMaster )
from.SendMessage( "You have found a item that you cannot use, it will now vanish..." );
if ( from.AccessLevel <= AccessLevel.GameMaster )
Delete() ;

if ( this.UsingLayers != true )
{
if ( m.ChangeForm != true && from.Serial == this.StaffSerial && m_TurnedOn != false )
{
from.Say( "*" + this.OldName + " transforms into {0} true form*", from.Female ? "her" : "his" );
from.Name = this.NewName;
from.BodyMod = this.Body;
from.Title = this.NewTitle;
from.Hue = this.NewHue;
from.FixedParticles( this.EffectID, this.EffectSpeed, this.EffectDur, this.EffectHue, this.Effect, this.EffectRenMode, EffectLayer.Waist );
from.FixedParticles( this.EffectID2, this.EffectSpeed, this.EffectDur, this.EffectHue2, this.Effect, this.EffectRenMode, EffectLayer.Waist );
from.FixedParticles( this.EffectID3, this.EffectSpeed, this.EffectDur, this.EffectHue3, this.Effect, this.EffectRenMode, EffectLayer.Waist );
from.FixedParticles( this.EffectID4, this.EffectSpeed, this.EffectDur, this.EffectHue4, this.Effect, this.EffectRenMode, EffectLayer.Waist );
from.FixedParticles( this.EffectID5, this.EffectSpeed, this.EffectDur, this.EffectHue5, this.Effect, this.EffectRenMode, EffectLayer.Waist );
if ( this.UsingBolts != false && this.BoltsAmount > 0 )
{
for ( int i = 0; i < this.BoltsAmount; ++i )
{
from.BoltEffect( this.BoltEffectHue );
}
}
else if ( this.UsingBolts != false )
{
from.BoltEffect( this.BoltEffectHue );
}
Regeneration(m);
from.PlaySound( this.PlaySound );
from.Karma = this.NewKarma;
from.Fame = this.NewFame;
m.ChangeForm = true;
}
else if ( m.ChangeForm != false && from.Serial == this.StaffSerial )
{
from.Say( "*" + this.OldName + " transforms into {0} normal form*", from.Female ? "her" : "his" );
from.BodyMod = 0;
from.Name = this.OldName;
from.Title = this.OldTitle;
from.Hue = this.OldHue;
from.FixedParticles( this.EffectID, this.EffectSpeed, this.EffectDur, this.EffectHue, this.Effect, this.EffectRenMode, EffectLayer.Waist );
from.FixedParticles( this.EffectID2, this.EffectSpeed, this.EffectDur, this.EffectHue2, this.Effect, this.EffectRenMode, EffectLayer.Waist );
from.FixedParticles( this.EffectID3, this.EffectSpeed, this.EffectDur, this.EffectHue3, this.Effect, this.EffectRenMode, EffectLayer.Waist );
from.FixedParticles( this.EffectID4, this.EffectSpeed, this.EffectDur, this.EffectHue4, this.Effect, this.EffectRenMode, EffectLayer.Waist );
from.FixedParticles( this.EffectID5, this.EffectSpeed, this.EffectDur, this.EffectHue5, this.Effect, this.EffectRenMode, EffectLayer.Waist );
if ( this.UsingBolts != false && this.BoltsAmount > 0 )
{
for ( int i = 0; i < this.BoltsAmount; ++i )
{
from.BoltEffect( this.BoltEffectHue );
}
}
else if ( this.UsingBolts != false )
{
from.BoltEffect( this.BoltEffectHue );
}
from.PlaySound( this.PlaySound );
from.Karma = this.OldKarma;
from.Fame = this.OldFame;
m.ChangeForm = false;
}
else
{
from.SendMessage ( 38, "You are not " + this.OldName + ", you may not use this." );
m.ChangeForm = false;
Delete();
}
}
}

public override bool OnEquip( Mobile from )
{
if ( Parent != from )
if ( from.AccessLevel <= AccessLevel.GameMaster )
from.SendMessage( "You have found a item that you cannot use, it will now vanish..." );
if ( from.AccessLevel <= AccessLevel.GameMaster )
Delete() ;

ALPlayerMobile m = ((ALPlayerMobile )from );
if ( from.Serial == this.StaffSerial && m_TurnedOn != true )
{
from.SendMessage( this.NewHue, "{0}, the magical effect of this item has been turned off!", this.OldName );
}
else if ( m.ChangeForm != true && from.Serial == this.StaffSerial && m_TurnedOn != false )
{
from.Say( "*" + this.OldName + " transforms into {0} true form*", from.Female ? "her" : "his" );
from.Name = this.NewName;
from.BodyMod = this.Body;
from.Title = this.NewTitle;
from.Hue = this.NewHue;
from.FixedParticles( this.EffectID, this.EffectSpeed, this.EffectDur, this.EffectHue, this.Effect, this.EffectRenMode, EffectLayer.Waist );
from.FixedParticles( this.EffectID2, this.EffectSpeed, this.EffectDur, this.EffectHue2, this.Effect, this.EffectRenMode, EffectLayer.Waist );
from.FixedParticles( this.EffectID3, this.EffectSpeed, this.EffectDur, this.EffectHue3, this.Effect, this.EffectRenMode, EffectLayer.Waist );
from.FixedParticles( this.EffectID4, this.EffectSpeed, this.EffectDur, this.EffectHue4, this.Effect, this.EffectRenMode, EffectLayer.Waist );
from.FixedParticles( this.EffectID5, this.EffectSpeed, this.EffectDur, this.EffectHue5, this.Effect, this.EffectRenMode, EffectLayer.Waist );
if ( this.UsingBolts != false && this.BoltsAmount > 0 )
{
for ( int i = 0; i < this.BoltsAmount; ++i )
{
from.BoltEffect( this.BoltEffectHue );
}
}
else if ( this.UsingBolts != false )
{
from.BoltEffect( this.BoltEffectHue );
}
Regeneration(m);
from.PlaySound( this.PlaySound );
from.Karma = this.NewKarma;
from.Fame = this.NewFame;
m.ChangeForm = true;
}
else
{
from.SendMessage ( 38, "You are not " + this.OldName + ", you may not use this." );
m.ChangeForm = false;
Delete();
}
return true;
}

public override void OnRemoved( object parent )
{
if ( parent is Mobile )
{
Mobile from = (Mobile)parent;
ALPlayerMobile m = ((ALPlayerMobile )from );
if ( from.Serial == this.StaffSerial && m_TurnedOn != true )
{
return;
}
else if ( m.ChangeForm != true && from.Serial == this.StaffSerial && m_TurnedOn != false )
{
from.Say( "*" + this.OldName + " transforms into {0} true form*", from.Female ? "her" : "his" );
from.Name = this.NewName;
from.BodyMod = this.Body;
from.Title = this.NewTitle;
from.Hue = this.NewHue;
from.FixedParticles( this.EffectID, this.EffectSpeed, this.EffectDur, this.EffectHue, this.Effect, this.EffectRenMode, EffectLayer.Waist );
from.FixedParticles( this.EffectID2, this.EffectSpeed, this.EffectDur, this.EffectHue2, this.Effect, this.EffectRenMode, EffectLayer.Waist );
from.FixedParticles( this.EffectID3, this.EffectSpeed, this.EffectDur, this.EffectHue3, this.Effect, this.EffectRenMode, EffectLayer.Waist );
from.FixedParticles( this.EffectID4, this.EffectSpeed, this.EffectDur, this.EffectHue4, this.Effect, this.EffectRenMode, EffectLayer.Waist );
from.FixedParticles( this.EffectID5, this.EffectSpeed, this.EffectDur, this.EffectHue5, this.Effect, this.EffectRenMode, EffectLayer.Waist );
if ( this.UsingBolts != false && this.BoltsAmount > 0 )
{
for ( int i = 0; i < this.BoltsAmount; ++i )
{
from.BoltEffect( this.BoltEffectHue );
}
}
else if ( this.UsingBolts != false )
{
from.BoltEffect( this.BoltEffectHue );
}
from.PlaySound( this.PlaySound );
from.Karma = this.NewKarma;
from.Fame = this.NewFame;
m.ChangeForm = true;
}
else if ( m.ChangeForm != false && from.Serial == this.StaffSerial )
{
from.Say( "*" + this.OldName + " transforms into {0} normal form*", from.Female ? "her" : "his" );
from.BodyMod = 0;
from.Name = this.OldName;
from.Title = this.OldTitle;
from.Hue = this.OldHue;
from.FixedParticles( this.EffectID, this.EffectSpeed, this.EffectDur, this.EffectHue, this.Effect, this.EffectRenMode, EffectLayer.Waist );
from.FixedParticles( this.EffectID2, this.EffectSpeed, this.EffectDur, this.EffectHue2, this.Effect, this.EffectRenMode, EffectLayer.Waist );
from.FixedParticles( this.EffectID3, this.EffectSpeed, this.EffectDur, this.EffectHue3, this.Effect, this.EffectRenMode, EffectLayer.Waist );
from.FixedParticles( this.EffectID4, this.EffectSpeed, this.EffectDur, this.EffectHue4, this.Effect, this.EffectRenMode, EffectLayer.Waist );
from.FixedParticles( this.EffectID5, this.EffectSpeed, this.EffectDur, this.EffectHue5, this.Effect, this.EffectRenMode, EffectLayer.Waist );
if ( this.UsingBolts != false && this.BoltsAmount > 0 )
{
for ( int i = 0; i < this.BoltsAmount; ++i )
{
from.BoltEffect( this.BoltEffectHue );
}
}
else if ( this.UsingBolts != false )
{
from.BoltEffect( this.BoltEffectHue );
}
from.PlaySound( this.PlaySound );
from.Karma = this.OldKarma;
from.Fame = this.OldFame;
m.ChangeForm = false;
}
}
}

public override void GetProperties( ObjectPropertyList list )
{
base.GetProperties( list );

if ( this.OldName != null )
list.Add( 1060847, "This Belongs to\t{0}", this.OldName );
if ( this.UsingLayers != false && this.NewName != null )
list.Add( 1050039, "{0}\t{1}", this.NewName, this.Message );
}

public void Regeneration( ALPlayerMobile from )
{
if ( this.RegenHits != false )
{
new RegenHitsTimer(from).Start();
}
if ( this.RegenMana != false )
{
new RegenManaTimer(from).Start();
}
if ( this.RegenStam != false )
{
new RegenStamTimer(from).Start();
}
}

public class RegenHitsTimer : Timer
{
private ALPlayerMobile from;
public RegenHitsTimer( ALPlayerMobile m ) : base ( TimeSpan.FromSeconds( 3.0 ), TimeSpan.FromSeconds( 3.0 ) )
{
from = m;
}
protected override void OnTick()
{
if ( from.ChangeForm != false )
{
from.Hits += 5;
}
else
{
Stop();
}
}
}
public class RegenManaTimer : Timer
{
private ALPlayerMobile from;
public RegenManaTimer( ALPlayerMobile m ) : base ( TimeSpan.FromSeconds( 3.0 ), TimeSpan.FromSeconds( 3.0 ) )
{
from = m;
}
protected override void OnTick()
{
if ( from.ChangeForm != false )
{
from.Mana += 5;
}
else
{
Stop();
}
}
}
public class RegenStamTimer : Timer
{
private ALPlayerMobile from;
public RegenStamTimer( ALPlayerMobile m ) : base ( TimeSpan.FromSeconds( 3.0 ), TimeSpan.FromSeconds( 3.0 ) )
{
from = m;
}
protected override void OnTick()
{
if ( from.ChangeForm != false )
{
from.Stam += 5;
}
else
{
Stop();
}
}
}

public override bool VerifyMove( Mobile from )
{
return ( from.AccessLevel >= m_AccessLevel );
}
}
}
[/code:1]
__________________
Creator of Genesis :: genesisworlds.com
-- Genesis is the next replacement program for UO Landscaper & Dragon
Ravenal is offline   Reply With Quote
Old 02-11-2004, 11:13 PM   #3 (permalink)
 
Join Date: Jan 2004
Posts: 753
Send a message via ICQ to Crack177 Send a message via AIM to Crack177 Send a message via Yahoo to Crack177
Default

Is there a program you use to make scripts? I have heard about a C# modulator or something like that. If you had any and you could tell me that would be great. I am not requestng a link.
Crack177 is offline   Reply With Quote
Old 02-11-2004, 11:18 PM   #4 (permalink)
Account Terminated
 
Join Date: Sep 2002
Age: 26
Posts: 3,846
Send a message via ICQ to Phantom Send a message via AIM to Phantom Send a message via MSN to Phantom
Default

Quote:
Originally Posted by Crack177
Is there a program you use to make scripts? I have heard about a C# modulator or something like that. If you had any and you could tell me that would be great. I am not requestng a link.
THERE IS NO PROGRAM TO PROGRAM FOR YOU.

public override void OnDoubleClick( Mobile from )
{
if ( from.Serial == 0x1 )
}


So you know this makes no sense whats so ever.

1) Your Mobiles serial isn't ever going to be 0x1 so that makes no sense there.

2) OnDoubleClick is never called when you equip something.

3) That would do nothing at this point as OnDoubleClick doesn't handle equip event in any form whats so ever.

4) Keep trying.
Phantom is offline   Reply With Quote
Old 02-11-2004, 11:29 PM   #5 (permalink)
 
Join Date: Jan 2004
Posts: 753
Send a message via ICQ to Crack177 Send a message via AIM to Crack177 Send a message via Yahoo to Crack177
Default

Quote:
1) Your Mobiles serial isn't ever going to be 0x1 so that makes no sense there.
There is your flaming again for something that is correct. This is why you can't go onto the newb fourm.
Crack177 is offline   Reply With Quote
Old 02-11-2004, 11:32 PM   #6 (permalink)
 
Join Date: Jan 2004
Posts: 753
Send a message via ICQ to Crack177 Send a message via AIM to Crack177 Send a message via Yahoo to Crack177
Default

Quote:
THERE IS NO PROGRAM TO PROGRAM FOR YOU.
Maybe there is not a program that u can post for me, but I know there is a program. I have heard of it before. Insread of taking you 2 days to make a script, if your a newb like me, it takes 30 mins.
Crack177 is offline   Reply With Quote
Old 02-12-2004, 12:07 AM   #7 (permalink)
Account Terminated
 
Join Date: Sep 2002
Age: 26
Posts: 3,846
Send a message via ICQ to Phantom Send a message via AIM to Phantom Send a message via MSN to Phantom
Default

Quote:
Originally Posted by Crack177
Quote:
1) Your Mobiles serial isn't ever going to be 0x1 so that makes no sense there.
There is your flaming again for something that is correct. This is why you can't go onto the newb fourm.
If you read my entire post it would have made more sense. Also thats not flaming you.

Also a program CANNOT program for you. I know every program that has been posted on these forums since I have been here since the start infact only a few days after they were started.

Thats also not why I canot go into the newb forum so why don't you shut the hell up before I show you why I can't go into the newb forum.
Phantom is offline   Reply With Quote
Old 02-12-2004, 12:44 AM   #8 (permalink)
<censored>
 
Fury's Avatar
 
Join Date: Feb 2003
Location: NewYork
Age: 32
Posts: 581
Default

Quote:
1) Your Mobiles serial isn't ever going to be 0x1 so that makes no sense there.
I read the whole post and that makes no sense to me either.. my staff characters serial is 0x1.
__________________
UoEvolution
www.uoevolution.com

UoGateway
Fury is offline   Reply With Quote
Old 02-12-2004, 12:52 AM   #9 (permalink)
Forum Expert
 
Ravenal's Avatar
 
Join Date: Oct 2003
Location: Spokane Valley, WA
Age: 24
Posts: 1,528
Default

It won't change it thats true, it is detecting to see if his serial is 0x1 if it isn't it won't do nothing on the double click... look how i did mine, it has SERIAL on it too and it works 100%...
__________________
Creator of Genesis :: genesisworlds.com
-- Genesis is the next replacement program for UO Landscaper & Dragon
Ravenal is offline   Reply With Quote
Old 02-12-2004, 01:01 AM   #10 (permalink)
Account Terminated
 
Join Date: Sep 2002
Age: 26
Posts: 3,846
Send a message via ICQ to Phantom Send a message via AIM to Phantom Send a message via MSN to Phantom
Default

Well checking the serial makes no sense.

I would check the account but thats just me :-)

Would allow only your account to use the item.

Also I still say using onDoubleClick event would do nothing at all.

The code has no way to be stopped as its a void, and you can "return" anything.

OnEquip is a bool you can with that.
Phantom is offline   Reply With Quote
Old 02-12-2004, 01:12 AM   #11 (permalink)
Forum Expert
 
Ravenal's Avatar
 
Join Date: Oct 2003
Location: Spokane Valley, WA
Age: 24
Posts: 1,528
Default

aye hehe i got both in my script for items with doubleclick and items with no double click hehe
__________________
Creator of Genesis :: genesisworlds.com
-- Genesis is the next replacement program for UO Landscaper & Dragon
Ravenal is offline   Reply With Quote
Old 02-12-2004, 05:16 AM   #12 (permalink)
 
Join Date: Oct 2002
Age: 23
Posts: 4,689
Default

Crack177, I know it may be hard, but if there was a program to let you program, then where does it stop? Somewhere down the line, you have to stop using programs to make a program. What you are asking for is impossible becuase it would be endless.
XxSP1DERxX is offline   Reply With Quote
Old 02-12-2004, 07:19 PM   #13 (permalink)
 
Join Date: Jan 2004
Posts: 753
Send a message via ICQ to Crack177 Send a message via AIM to Crack177 Send a message via Yahoo to Crack177
Default

Since you guys are experts I changed it. I am just trying to find out how to use C# with Ultima Online. I have found some stuff but it's just stupid stuff. Here is my edited version of it.
[code:1]using System;
using Server;

namespace Server.Items
{
public class YAYsBane : Kryss
{
public override int LabelNumber{ get{ return 1061106; } } // Axe of the Heavens
public override int ArtifactRarity{ get{ return 60; } }

public override int InitMinHits{ get{ return 255; } }
public override int InitMaxHits{ get{ return 255; } }

[Constructable]
public YAYsBane()
{
Hue = 1153;
Name = &quot;The Bane of YAY&quot;;
// TODO: Repond Slayer
WeaponAttributes.HitFireball = 50;
WeaponAttributes.HitHarm = 50;
WeaponAttributes.HitLightning = 50;
WeaponAttributes.HitDispel = 50;
WeaponAttributes.HitMagicArrow = 50;
WeaponAttributes.HitLeechHits = 50;
WeaponAttributes.HitLeechMana = 50;
WeaponAttributes.HitLeechStam = 50;
WeaponAttributes.HitLowerAttack = 50;
WeaponAttributes.HitLowerDefend = 50;
WeaponAttributes.SelfRepair = 170;
Attributes.AttackChance = 15;
Attributes.CastRecovery = 1;
Attributes.CastSpeed = 1;
Attributes.DefendChance = 15;
Attributes.SpellChanneling = 1;
Attributes.WeaponDamage = 60;
WeaponAttributes.ResistFireBonus = 20;
WeaponAttributes.ResistPoisonBonus = 20;
WeaponAttributes.ResistColdBonus = 20;
LootType = LootType.Blessed;
}

public YAYsBane( Serial serial ) : base( serial )
{
}

public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );

writer.Write( (int) 0 );
}
public override void OnEquip( Mobile from )
{
if ( from.Serial == 0x1 )
}

public override void Deserialize(GenericReader reader)
{
base.Deserialize( reader );

int version = reader.ReadInt();
}
}
}[/code:1]
Here is the error.
[code:1] - Error: Scripts\Coustom Scripts\All Scripts\Artis\Copy of YAYsBane.cs: CS0508:
(line 53, column 25) 'Server.Items.YAYsBane.OnEquip(Server.Mobile)': cannot change return type when overriding inherited member 'Server.Items.BaseWeapon.OnEquip(Server.Mobile)'[/code:1]
Crack177 is offline   Reply With Quote
Old 02-12-2004, 07:37 PM   #14 (permalink)
I R TEH POSTING!!1!eleven
 
Join Date: Jan 2004
Posts: 1,617
Default

How is OnEquip() defined in the ancestor?

Cheers,
Ignacio
__________________
Get your C# documentation today!

Quote:
Originally Posted by Thorax
WOW! that is EXACTLY how i feel, to the T. There is nothing more powerfull than a well worded ass kicking.
badger badger badger badger badger badger badger badger badger badger badger badger...mushroom MUSHROOM
abralka@doramail.com
Ignacio Vazquez-Abrams is offline   Reply With Quote
Old 02-12-2004, 07:39 PM   #15 (permalink)
 
Join Date: Jan 2004
Posts: 753
Send a message via ICQ to Crack177 Send a message via AIM to Crack177 Send a message via Yahoo to Crack177
Default

UHHHHH all I can say is HUH?????
Crack177 is offline   Reply With Quote
Old 02-12-2004, 07:48 PM   #16 (permalink)
I R TEH POSTING!!1!eleven
 
Join Date: Jan 2004
Posts: 1,617
Default

This line here:
[code:1] public class YAYsBane : Kryss[/code:1]
indicates that the YAYsBane class inherits directly from the Kryss class. The Kryss class also inherits from another class, and so on up to System.Object. All those classes are YAYsBane's ancestors. Along that chain of inheritance, one of the classes declares a method called "OnEquip". Compare the declaration on the ancestor with the declaration on your new class.

Cheers,
Ignacio
__________________
Get your C# documentation today!

Quote:
Originally Posted by Thorax
WOW! that is EXACTLY how i feel, to the T. There is nothing more powerfull than a well worded ass kicking.
badger badger badger badger badger badger badger badger badger badger badger badger...mushroom MUSHROOM
abralka@doramail.com
Ignacio Vazquez-Abrams is offline   Reply With Quote
Old 02-12-2004, 07:55 PM   #17 (permalink)
 
Join Date: Jan 2004
Posts: 753
Send a message via ICQ to Crack177 Send a message via AIM to Crack177 Send a message via Yahoo to Crack177
Default

lol. As I read I get more confused. I say to myself huh? lol I have not clue what you are talking about.
Crack177 is offline   Reply With Quote
Old 02-12-2004, 07:59 PM   #18 (permalink)
 
Join Date: Jan 2004
Posts: 753
Send a message via ICQ to Crack177 Send a message via AIM to Crack177 Send a message via Yahoo to Crack177
Default

I am trying to do something like this.
[code:1]public override bool OnEquip( Mobile m )
{
if( m.Name != &quot;YAY&quot; )
return false;
else return base.OnEquip( m );
}[/code:1]
except with my serial instead of my name.
Crack177 is offline   Reply With Quote
Old 02-12-2004, 08:11 PM   #19 (permalink)
I R TEH POSTING!!1!eleven
 
Join Date: Jan 2004
Posts: 1,617
Default

Right. Look at how it's declared there, and look how you've declared it in the other script.

Cheers,
Ignacio
__________________
Get your C# documentation today!

Quote:
Originally Posted by Thorax
WOW! that is EXACTLY how i feel, to the T. There is nothing more powerfull than a well worded ass kicking.
badger badger badger badger badger badger badger badger badger badger badger badger...mushroom MUSHROOM
abralka@doramail.com
Ignacio Vazquez-Abrams is offline   Reply With Quote
Old 02-12-2004, 09:38 PM   #20 (permalink)
 
Join Date: Jan 2004
Posts: 753
Send a message via ICQ to Crack177 Send a message via AIM to Crack177 Send a message via Yahoo to Crack177
Default

Ok I changed it and this is what I did.
[code:1]using System;
using Server;

namespace Server.Items
{
public class YAYsBane : Kryss
{
public override int LabelNumber{ get{ return 1061106; } } // Axe of the Heavens
public override int ArtifactRarity{ get{ return 60; } }

public override int InitMinHits{ get{ return 255; } }
public override int InitMaxHits{ get{ return 255; } }

[Constructable]
public YAYsBane()
{
Hue = 1153;
Name = &quot;The Bane of YAY&quot;;
// TODO: Repond Slayer
WeaponAttributes.HitFireball = 50;
WeaponAttributes.HitHarm = 50;
WeaponAttributes.HitLightning = 50;
WeaponAttributes.HitDispel = 50;
WeaponAttributes.HitMagicArrow = 50;
WeaponAttributes.HitLeechHits = 50;
WeaponAttributes.HitLeechMana = 50;
WeaponAttributes.HitLeechStam = 50;
WeaponAttributes.HitLowerAttack = 50;
WeaponAttributes.HitLowerDefend = 50;
WeaponAttributes.SelfRepair = 170;
Attributes.AttackChance = 15;
Attributes.CastRecovery = 1;
Attributes.CastSpeed = 1;
Attributes.DefendChance = 15;
Attributes.SpellChanneling = 1;
Attributes.WeaponDamage = 60;
WeaponAttributes.ResistFireBonus = 20;
WeaponAttributes.ResistPoisonBonus = 20;
WeaponAttributes.ResistColdBonus = 20;
LootType = LootType.Blessed;
}

public YAYsBane( Serial serial ) : base( serial )
{
}

public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );

writer.Write( (int) 0 );
}
public override bool OnEquip( Mobile m )
{
if ( from.Serial == 0x1)
return false;
else return base.OnEquip( m );
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize( reader );

int version = reader.ReadInt();
}
}
}[/code:1]
I get this error.
[code:1] - Error: Scripts\Coustom Scripts\All Scripts\Artis\Copy of YAYsBane.cs: CS0246:
(line 55, column 9) The type or namespace name 'from' could not be found (are you missing a using directive or an assembly reference?)[/code:1]
Crack177 is offline   Reply With Quote
Old 02-12-2004, 09:48 PM   #21 (permalink)
 
Join Date: Jan 2004
Posts: 753
Send a message via ICQ to Crack177 Send a message via AIM to Crack177 Send a message via Yahoo to Crack177
Default

Ok I fixed it. Here is the finally copy.
[code:1]*/Script made by Crack177.
**********TO USE THIS SCRIPT YOU MUST LEAVE THIS HEADER**********/*
using System;
using Server;

namespace Server.Items
{
public class YAYsBane : Kryss
{
public override int LabelNumber{ get{ return 1061106; } } // Axe of the Heavens
public overrid