|
||
|
|||||||
| Script Support Get support for modifying RunUO Scripts, or writing your own! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Forum Novice
Join Date: May 2005
Location: In the world of candies
Age: 40
Posts: 151
|
How would I add a fillfactor to this script?
Code:
using System;
using System.Collections;
using Server;
using Server.Network;
namespace Server.Items
{
public class ChocolateSwampDragon : Food
{
[Constructable]
public ChocolateSwampDragon() : this( 1 )
{
Hue = 443;
Name = "Chocolate Swamp Dragon";
Movable = true;
ItemID = 9753;
Amount = 1;
}
[Constructable]
public ChocolateSwampDragon( int amount ) : base( 0xF8F, amount )
{
this.FillFactor = 3;
}
public ChocolateSwampDragon( Serial serial ) : base( serial )
{
}
public override Item Dupe( int amount )
{
return base.Dupe( new ChocolateSwampDragon( amount ), amount );
}
public override void OnDoubleClick( Mobile from )
{
from.PlaySound( Utility.Random( 0x3A, 3 ) );
if ( from.Body.IsHuman && !from.Mounted )
{
from.Animate( 34, 5, 1, true, false, 0 );
Consume();
}
}
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();
}
}
}
Or would I need to put THIS in Food.cs so it would work? Help please XSTG |
|
|
|
|
|
#2 (permalink) |
|
Forum Expert
Join Date: Feb 2004
Age: 27
Posts: 1,834
|
Hue = 443;
Name = "Chocolate Swamp Dragon"; Movable = true; ItemID = 9753; First off, this all should be in the next constructor maybe? I didn't try it, but are you sure this one doesn't have a correct fillfactor? It should have. O.o Anyways: Damn cute idea! ^_^ |
|
|
|
|
|
#4 (permalink) |
|
Forum Novice
Join Date: May 2005
Location: In the world of candies
Age: 40
Posts: 151
|
No it doesn't work, I put all fillfactor and all, but it still doesn't work (even in 2nd constructable) Is there another way to do it?
EDIT: Im not using this in FOod.cs but really in a custom item script so if it can help to solve... |
|
|
|
|
|
#5 (permalink) |
|
Forum Expert
Join Date: Oct 2002
Location: Iowa, USA
Age: 38
Posts: 395
|
As long ans the constructors are like this it should work.
Code:
[Constructable]
public ChocolateSwampDragon() : this( 1 )
{
}
[Constructable]
ChocolateSwampDragon( int amount ) : base( amount, 0xF8F )
{
Hue = 443;
Name = "Chocolate Swamp Dragon";
Movable = true;
ItemID = 9753;
this.FillFactor = 3;
}
![]() also I think this: Code:
public override void OnDoubleClick( Mobile from )
{
from.PlaySound( Utility.Random( 0x3A, 3 ) );
if ( from.Body.IsHuman && !from.Mounted )
{
from.Animate( 34, 5, 1, true, false, 0 );
Consume();
}
}
Code:
public override void OnDoubleClick( Mobile from )
{
from.PlaySound( Utility.Random( 0x3A, 3 ) );
if ( from.Body.IsHuman && !from.Mounted )
{
from.Animate( 34, 5, 1, true, false, 0 );
this.Consume();
}
}
|
|
|
|
|
|
#7 (permalink) | |
|
Forum Expert
Join Date: Oct 2002
Location: Iowa, USA
Age: 38
Posts: 395
|
Quote:
if you do a search on the forum for FillFactor, I'll bet you'll get a lot of good examples. some friendly advice: if you plan to learn to script, learn to use the runuo search engine first. 2 main reasons: 1. most cases can be quicker than waiting on response (that may never come). 2. will keep you from getting flamed. ![]() |
|
|
|
|
|
|
#8 (permalink) |
|
Forum Expert
Join Date: Feb 2004
Age: 27
Posts: 1,834
|
Code:
using System;
using System.Collections;
using Server;
using Server.Network;
namespace Server.Items
{
public class ChocolateSwampDragon : Food
{
[Constructable]
public ChocolateSwampDragon() : this( 1 )
{
}
[Constructable]
public ChocolateSwampDragon( int amount ) : base( 0xF8F, amount )
{
this.Stackable = true;
this.Hue = 443;
this.Name = "Chocolate Swamp Dragon";
this.ItemID = 9753;
this.Amount = amount;
this.Weight = 1;
this.FillFactor = 3;
}
public ChocolateSwampDragon( Serial serial ) : base( serial )
{
}
public override Item Dupe( int amount )
{
return base.Dupe( new ChocolateSwampDragon( amount ), amount );
}
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();
}
}
}
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|