Full Version : Dragon Armor problem
xmlspawner >>Scripting Support >>Dragon Armor problem
<< Prev | Next >>
Erica- 12-27-2007
Hi ArteGordon how would i make it so the the ChaosDragoon when it spawns it would randomly have the set of dragon armor color cant figure out how to do this heres the script thanks.

CODE
using System; using Server; using Server.Misc; using Server.Items; namespace Server.Mobiles
{
[CorpseName( "a chaos dragoon corpse" )]
public class ChaosDragoon : BaseCreature
{
public CraftResource res;
[Constructable]
public ChaosDragoon() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.15, 0.4 )
{
Name = "a chaos dragoon";
Body = 0x190;
Hue = Utility.RandomSkinHue();
SetStr( 176, 225 );
SetDex( 81, 95 );
SetInt( 61, 85 );
SetHits( 176, 225 );
SetDamage( 24, 26 );
SetDamageType( ResistanceType.Physical, 25 );
SetDamageType( ResistanceType.Fire, 25 );
SetDamageType( ResistanceType.Cold, 25 );
SetDamageType( ResistanceType.Energy, 25 );
SetResistance( ResistanceType.Physical, 45, 55 );
SetResistance( ResistanceType.Fire, 15, 25 );
SetResistance( ResistanceType.Cold, 50 );
SetResistance( ResistanceType.Poison, 25, 35 );
SetResistance( ResistanceType.Energy, 25, 35 );
SetSkill( SkillName.Fencing, 77.6, 92.5 );
SetSkill( SkillName.Healing, 60.3, 90.0 );
SetSkill( SkillName.Macing, 77.6, 92.5 );
SetSkill( SkillName.Anatomy, 77.6, 87.5 );
SetSkill( SkillName.MagicResist, 77.6, 97.5 );
SetSkill( SkillName.Swords, 77.6, 92.5 );
SetSkill( SkillName.Tactics, 77.6, 87.5 );
Fame = 5000;
Karma = -5000;
switch ( Utility.Random( 6 ) )
{
case 0: PackItem( new RedScales( Utility.RandomMinMax( 1, 3 ) ) ); break;
case 1: PackItem( new YellowScales( Utility.RandomMinMax( 1, 3 ) ) ); break;
case 2: PackItem( new BlackScales( Utility.RandomMinMax( 1, 3 ) ) ); break;
case 3: PackItem( new GreenScales( Utility.RandomMinMax( 1, 3 ) ) ); break;
case 4: PackItem( new WhiteScales( Utility.RandomMinMax( 1, 3 ) ) ); break;
case 5: PackItem( new BlueScales( Utility.RandomMinMax( 1, 3 ) ) ); break;
}
BaseWeapon melee = new Kryss();
switch (Utility.Random( 2 ))
{
case 0: melee = new Kryss(); break;
case 1: melee = new Broadsword(); break;
}
DragonHelm helm = new DragonHelm();
helm.Resource = res;
helm.Movable = false;
AddItem( helm );
DragonChest chest = new DragonChest();
chest.Resource = res;
chest.Movable = false;
AddItem( chest );
DragonArms arms = new DragonArms();
arms.Resource = res;
arms.Movable = false;
AddItem( arms );
DragonGloves gloves = new DragonGloves();
gloves.Resource = res;
gloves.Movable = false;
AddItem( gloves );
DragonLegs legs = new DragonLegs();
legs.Resource = res;
legs.Movable = false;
AddItem( legs );
melee.Movable = false;
AddItem( melee );
ChaosShield shield = new ChaosShield();
shield.Movable = false;
AddItem( shield );
AddItem( new Shirt() );
AddItem( new Boots() );
int amount = Utility.RandomMinMax( 1, 3 );
switch ( res )
{
case CraftResource.BlackScales: AddItem( new BlackScales( amount ) ); break;
case CraftResource.RedScales: AddItem( new RedScales( amount ) ); break;
case CraftResource.BlueScales: AddItem( new BlueScales( amount ) ); break;
case CraftResource.YellowScales: AddItem( new YellowScales( amount ) ); break;
case CraftResource.GreenScales: AddItem( new GreenScales( amount ) ); break;
case CraftResource.WhiteScales: AddItem( new WhiteScales( amount ) ); break;
}
new SwampDragon().Rider = this;
}
public override void GenerateLoot()
{
AddLoot( LootPack.Rich );
}
public override bool AlwaysMurderer{ get{ return true; } }
public override bool ShowFameTitle{ get{ return false; } }
public override bool HasBreath{ get{ return true; } }
public ChaosDragoon( 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();
}
}
}

Erica- 12-27-2007
Figured it out had this on top wrong

CODE
Fame = 5000; Karma = -5000; switch ( Utility.Random( 6 ) ) { case 0: PackItem( new RedScales( Utility.RandomMinMax( 1, 3 ) ) ); break;
case 1: PackItem( new YellowScales( Utility.RandomMinMax( 1, 3 ) ) ); break;
case 2: PackItem( new BlackScales( Utility.RandomMinMax( 1, 3 ) ) ); break;
case 3: PackItem( new GreenScales( Utility.RandomMinMax( 1, 3 ) ) ); break;
case 4: PackItem( new WhiteScales( Utility.RandomMinMax( 1, 3 ) ) ); break;
case 5: PackItem( new BlueScales( Utility.RandomMinMax( 1, 3 ) ) ); break;

Should look like this

CODE
Fame = 5000; Karma = -5000; switch ( Utility.Random( 6 ) ) { case 0: res = CraftResource.BlackScales; break;
case 1: res = CraftResource.RedScales; break;
case 2: res = CraftResource.BlueScales; break;
case 3: res = CraftResource.YellowScales; break;
case 4: res = CraftResource.GreenScales; break;
case 5: res = CraftResource.WhiteScales; break;
}