This one has got me stuck so I would appreciate any pointers from the community.
When I use a Bonded Pet to slay this monster the lights go out. I have looked it over and tried following the scripts through but am at a dead end (no pun).
Help is greatly appreciated.
*bows*
Here are two separate Crash Logs from the same pet killing this monster.
Here is the OnDeath(Container c) portion of my BaseCreature.cs
and . . here is my TreasuresOfTokuno.cs
and . . here is the script for the custom monster being killed
When I use a Bonded Pet to slay this monster the lights go out. I have looked it over and tried following the scripts through but am at a dead end (no pun).
Help is greatly appreciated.
*bows*
Here are two separate Crash Logs from the same pet killing this monster.
Code:
Server Crash Report #1:
======================
RunUO Version 2.1, Build 6905.732
Operating System: Microsoft Windows NT 6.2.9200.0
.NET Framework: 4.0.30319.42000
Time: 2020-08-20 4:26:56 PM
Mobiles: 26208
Items: 924811
Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Multis.BaseBoat.FindBoatAt(IPoint2D loc, Map map)
at Server.Misc.TreasuresOfTokuno.CheckLocation(Mobile m)
at Server.Misc.TreasuresOfTokuno.HandleKill(Mobile victim, Mobile killer)
at Server.Mobiles.BaseCreature.OnDeath(Container c)
at Server.Mobile.Kill()
at Server.Mobile.Damage(Int32 amount, Mobile from, Boolean informMount)
at Server.Mobiles.BaseCreature.Damage(Int32 amount, Mobile from)
at Server.Items.BleedAttack.DoBleed(Mobile m, Mobile from, Int32 level)
at Server.Items.BleedAttack.InternalTimer.OnTick()
at Server.Timer.Slice()
at Server.Core.Main(String[] args)
==================================================================
[b]Crash Log #2[/b]
Server Crash Report
===================
RunUO Version 2.1, Build 6905.732
Operating System: Microsoft Windows NT 6.2.9200.0
.NET Framework: 4.0.30319.42000
Time: 2020-08-20 5:02:05 PM
Mobiles: 26176
Items: 924511
Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Multis.BaseBoat.FindBoatAt(IPoint2D loc, Map map)
at Server.Misc.TreasuresOfTokuno.CheckLocation(Mobile m)
at Server.Misc.TreasuresOfTokuno.HandleKill(Mobile victim, Mobile killer)
at Server.Mobiles.BaseCreature.OnDeath(Container c)
at Server.Mobile.Kill()
at Server.Mobile.Damage(Int32 amount, Mobile from, Boolean informMount)
at Server.Mobiles.BaseCreature.Damage(Int32 amount, Mobile from)
at Server.AOS.Damage(Mobile m, Mobile from, Int32 damage, Boolean ignoreArmor, Int32 phys, Int32 fire, Int32 cold, Int32 pois, Int32 nrgy, Int32 chaos, Int32 direct, Boolean keepAlive, Boolean archer)
at Server.Items.BaseWeapon.OnHit(Mobile attacker, Mobile defender, Double damageBonus)
at Server.Items.BaseWeapon.OnSwing(Mobile attacker, Mobile defender, Double damageBonus)
at Server.Items.Fists.OnSwing(Mobile attacker, Mobile defender)
at Server.Mobile.CombatTimer.OnTick()
at Server.Timer.Slice()
at Server.Core.Main(String[] args)
==================================================================
Here is the OnDeath(Container c) portion of my BaseCreature.cs
Code:
public override void OnDeath(Container c)
{
MeerMage.StopEffect(this, false);
if (IsBonded)
{
int sound = this.GetDeathSound();
if (sound >= 0)
Effects.PlaySound(this, this.Map, sound);
Warmode = false;
Poison = null;
Combatant = null;
Hits = 0;
Stam = 0;
Mana = 0;
IsDeadPet = true;
ControlTarget = ControlMaster;
ControlOrder = OrderType.Follow;
ProcessDeltaQueue();
SendIncomingPacket();
SendIncomingPacket();
List<AggressorInfo> aggressors = this.Aggressors;
for (int i = 0; i < aggressors.Count; ++i)
{
AggressorInfo info = aggressors[i];
if (info.Attacker.Combatant == this)
info.Attacker.Combatant = null;
}
List<AggressorInfo> aggressed = this.Aggressed;
for (int i = 0; i < aggressed.Count; ++i)
{
AggressorInfo info = aggressed[i];
if (info.Defender.Combatant == this)
info.Defender.Combatant = null;
}
Mobile owner = this.ControlMaster;
if (owner == null || owner.Deleted || owner.Map != this.Map || !owner.InRange(this, 12) || !this.CanSee(owner) || !this.InLOS(owner))
{
if (this.OwnerAbandonTime == DateTime.MinValue)
this.OwnerAbandonTime = DateTime.Now;
}
else
{
this.OwnerAbandonTime = DateTime.MinValue;
}
GiftOfLifeSpell.HandleDeath(this);
CheckStatTimers();
}
else
{
if (!Summoned && !m_NoKillAwards)
{
int totalFame = Fame / 100;
int totalKarma = -Karma / 100;
if (Map == Map.Felucca)
{
totalFame += ((totalFame / 10) * 3);
totalKarma += ((totalKarma / 10) * 3);
}
List<DamageStore> list = GetLootingRights(this.DamageEntries, this.HitsMax);
bool givenQuestKill = false;
bool givenFactionKill = false;
bool givenToTKill = false;
for (int i = 0; i < list.Count; ++i)
{
DamageStore ds = list[i];
if (!ds.m_HasRight)
continue;
Titles.AwardFame(ds.m_Mobile, totalFame, true);
Titles.AwardKarma(ds.m_Mobile, totalKarma, true);
// modification to support XmlQuest Killtasks
XmlQuest.RegisterKill( this, ds.m_Mobile);
OnKilledBy(ds.m_Mobile);
if (!givenFactionKill)
{
givenFactionKill = true;
Faction.HandleDeath(this, ds.m_Mobile);
}
if (!givenToTKill)
{
givenToTKill = true;
TreasuresOfTokuno.HandleKill(this, ds.m_Mobile);
VirtueArtifactSystem.HandleKill(this, ds.m_Mobile);
}
if (givenQuestKill)
continue;
PlayerMobile pm = ds.m_Mobile as PlayerMobile;
if (pm != null)
{
QuestSystem qs = pm.Quest;
if (qs != null)
{
qs.OnKill(this, c);
givenQuestKill = true;
}
#region Mondain's Legacy
QuestHelper.CheckCreature(pm, this);
#endregion
}
}
}
base.OnDeath(c);
if (DeleteCorpseOnDeath)
c.Delete();
}
}
and . . here is my TreasuresOfTokuno.cs
Code:
using System;
using Server;
using Server.Network;
using System.Collections;
using System.Collections.Generic;
using Server.Items;
using Server.Gumps;
using Server.Misc;
using Server.Mobiles;
namespace Server.Misc
{
public class TreasuresOfTokuno
{
private static bool m_Enabled = (Core.Expansion >= Expansion.SE);
public static bool Enabled { get { return m_Enabled; } }
public const int ItemsPerReward = 10;
private static Type[] m_LesserArtifacts = new Type[]
{
typeof( AncientFarmersKasa ), typeof( AncientSamuraiDo ), typeof( ArmsOfTacticalExcellence ), typeof( BlackLotusHood ),
typeof( DaimyosHelm ), typeof( DemonForks ), typeof( DragonNunchaku ), typeof( Exiler ), typeof( GlovesOfTheSun ),
typeof( HanzosBow ), typeof( LegsOfStability ), typeof( PeasantsBokuto ), typeof( PilferedDancerFans ), typeof( TheDestroyer ),
typeof( TomeOfEnlightenment ), typeof( AncientUrn ), typeof( HonorableSwords ), typeof( LesserPigmentsOfTokuno ), typeof( FluteOfRenewal ),
typeof( LeurociansMempoOfFortune ), typeof( ChestOfHeirlooms )
};
public static Type[] LesserArtifacts { get { return m_LesserArtifacts; } }
private static Type[] m_GreaterArtifacts = null;
public static Type[] GreaterArtifacts
{
get
{
if( m_GreaterArtifacts == null )
{
m_GreaterArtifacts = new Type[ToTRedeemGump.NormalRewards.Length];
for( int i = 0; i < m_GreaterArtifacts.Length; i++ )
{
m_GreaterArtifacts[i] = ToTRedeemGump.NormalRewards[i].Type;
}
}
return m_GreaterArtifacts;
}
}
private static bool CheckLocation( Mobile m )
{
Region r = m.Region;
if( r.IsPartOf( typeof( Server.Regions.HouseRegion ) ) || Server.Multis.BaseBoat.FindBoatAt( m, m.Map ) != null )
return false;
//TODO: a CanReach of something check as opposed to above?
if( r.IsPartOf( "Yomotsu Mines" ) || r.IsPartOf( "Fan Dancer's Dojo" ) )
return true;
return (m.Map == Map.Tokuno);
}
public static void HandleKill( Mobile victim, Mobile killer )
{
PlayerMobile pm = killer as PlayerMobile;
BaseCreature bc = victim as BaseCreature;
if( !Enabled || pm == null || bc == null || !CheckLocation( bc ) || !CheckLocation( pm )|| !killer.InRange( victim, 18 ))
return;
if( bc.Controlled || bc.Owners.Count > 0 || bc.Fame <= 0 )
return;
//25000 for 1/100 chance, 10 hyrus
//1500, 1/1000 chance, 20 lizard men for that chance.
pm.ToTTotalMonsterFame += (int)(bc.Fame * (1 + Math.Sqrt( pm.Luck ) / 100));
//This is the Exponentional regression with only 2 datapoints.
//A log. func would also work, but it didn't make as much sense.
//This function isn't OSI exact beign that I don't know OSI's func they used ;p
int x = pm.ToTTotalMonsterFame;
//const double A = 8.63316841 * Math.Pow( 10, -4 );
const double A = 0.000863316841;
//const double B = 4.25531915 * Math.Pow( 10, -6 );
const double B = 0.00000425531915;
double chance = A * Math.Pow( 10, B * x );
if( chance > Utility.RandomDouble() )
{
Item i = null;
try
{
i = Activator.CreateInstance( m_LesserArtifacts[Utility.Random( m_LesserArtifacts.Length )] ) as Item;
}
catch
{ }
if( i != null )
{
if( pm.AddToBackpack( i ) )
{
pm.SendLocalizedMessage( 1062317 ); // For your valor in combating the fallen beast, a special artifact has been bestowed on you.
pm.ToTTotalMonsterFame = 0;
}
else
{
//Place in bank possibly?
i.Delete();
}
}
}
}
}
}
namespace Server.Mobiles
{
public class IharaSoko : BaseVendor
{
public override bool IsActiveVendor { get { return false; } }
public override bool IsInvulnerable { get { return true; } }
public override bool DisallowAllMoves { get { return true; } }
public override bool ClickTitle { get { return true; } }
public override bool CanTeach { get { return false; } }
private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
public override void InitSBInfo()
{
}
public override void InitOutfit()
{
AddItem( new Waraji( 0x711 ) );
AddItem( new Backpack() );
AddItem( new Kamishimo( 0x483 ) );
Item item = new LightPlateJingasa();
item.Hue = 0x711;
AddItem( item );
}
[Constructable]
public IharaSoko() : base( "the Imperial Minister of Trade" )
{
Name = "Ihara Soko";
Female = false;
Body = 0x190;
Hue = 0x8403;
}
public IharaSoko( 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();
}
public override bool CanBeDamaged()
{
return false;
}
public override void OnMovement( Mobile m, Point3D oldLocation )
{
//if( !TreasuresOfTokuno.Enabled ) //He still accepts items even if ToTs are turned off.
// return;
if( m.Alive && m is PlayerMobile )
{
PlayerMobile pm = (PlayerMobile)m;
int range = 3;
if( m.Alive && Math.Abs( Z - m.Z ) < 16 && InRange( m, range ) && !InRange( oldLocation, range ) )
{
if( pm.ToTItemsTurnedIn >= TreasuresOfTokuno.ItemsPerReward )
{
SayTo( pm, 1070980 ); // Congratulations! You have turned in enough minor treasures to earn a greater reward.
pm.CloseGump( typeof( ToTTurnInGump ) ); //Sanity
if( !pm.HasGump( typeof( ToTRedeemGump ) ) )
pm.SendGump( new ToTRedeemGump( this, false ) );
}
else
{
if( pm.ToTItemsTurnedIn == 0 )
SayTo( pm, 1071013 ); // Bring me 10 of the lost treasures of Tokuno and I will reward you with a valuable item.
else
SayTo( pm, 1070981, String.Format( "{0}\t{1}", pm.ToTItemsTurnedIn, TreasuresOfTokuno.ItemsPerReward ) ); // You have turned in ~1_COUNT~ minor artifacts. Turn in ~2_NUM~ to receive a reward.
ArrayList buttons = ToTTurnInGump.FindRedeemableItems( pm );
if( buttons.Count > 0 && !pm.HasGump( typeof( ToTTurnInGump ) ) )
pm.SendGump( new ToTTurnInGump( this, buttons ) );
}
}
int leaveRange = 7;
if( !InRange( m, leaveRange ) && InRange( oldLocation, leaveRange ) )
{
pm.CloseGump( typeof( ToTRedeemGump ) );
pm.CloseGump( typeof( ToTTurnInGump ) );
}
}
}
public override void TurnToTokuno(){}
}
}
namespace Server.Gumps
{
public class ItemTileButtonInfo : ImageTileButtonInfo
{
private Item m_Item;
public Item Item
{
get { return m_Item; }
set { m_Item = value; }
}
public ItemTileButtonInfo( Item i ) : base( i.ItemID, i.Hue, ((i.Name == null || i.Name.Length <= 0)? (TextDefinition)i.LabelNumber : (TextDefinition)i.Name ) )
{
m_Item = i;
}
}
public class ToTTurnInGump : BaseImageTileButtonsGump
{
public static ArrayList FindRedeemableItems( Mobile m )
{
Backpack pack = (Backpack)m.Backpack;
if( pack == null )
return new ArrayList();
ArrayList items = new ArrayList( pack.FindItemsByType( TreasuresOfTokuno.LesserArtifacts ) );
ArrayList buttons = new ArrayList();
for( int i = 0; i < items.Count; i++ )
{
Item item = (Item)items[i];
//bool acceptable = true;
if( item is ChestOfHeirlooms && !((ChestOfHeirlooms)item).Locked )
continue;
if( item is ChestOfHeirlooms && ((ChestOfHeirlooms)item).TrapLevel != 10 )
continue;
if( item is PigmentsOfTokuno && ((PigmentsOfTokuno)item).Type != PigmentType.None )
continue;
buttons.Add( new ItemTileButtonInfo( item ) );
}
return buttons;
}
Mobile m_Collector;
public ToTTurnInGump( Mobile collector, ArrayList buttons ) : base( 1071012, buttons ) // Click a minor artifact to give it to Ihara Soko.
{
m_Collector = collector;
}
public ToTTurnInGump( Mobile collector, ItemTileButtonInfo[] buttons ) : base( 1071012, buttons ) // Click a minor artifact to give it to Ihara Soko.
{
m_Collector = collector;
}
public override void HandleButtonResponse( NetState sender, int adjustedButton, ImageTileButtonInfo buttonInfo )
{
PlayerMobile pm = sender.Mobile as PlayerMobile;
Item item = ((ItemTileButtonInfo)buttonInfo).Item;
if( !( pm != null && item.IsChildOf( pm.Backpack ) && pm.InRange( m_Collector.Location, 7 )) )
return;
item.Delete();
if( ++pm.ToTItemsTurnedIn >= TreasuresOfTokuno.ItemsPerReward )
{
m_Collector.SayTo( pm, 1070980 ); // Congratulations! You have turned in enough minor treasures to earn a greater reward.
pm.CloseGump( typeof( ToTTurnInGump ) ); //SAnity
if( !pm.HasGump( typeof( ToTRedeemGump ) ) )
pm.SendGump( new ToTRedeemGump( m_Collector, false ) );
}
else
{
m_Collector.SayTo( pm, 1070981, String.Format( "{0}\t{1}", pm.ToTItemsTurnedIn, TreasuresOfTokuno.ItemsPerReward ) ); // You have turned in ~1_COUNT~ minor artifacts. Turn in ~2_NUM~ to receive a reward.
ArrayList buttons = FindRedeemableItems( pm );
pm.CloseGump( typeof( ToTTurnInGump ) ); //Sanity
if( buttons.Count > 0 )
pm.SendGump( new ToTTurnInGump( m_Collector, buttons ) );
}
}
public override void HandleCancel( NetState sender )
{
PlayerMobile pm = sender.Mobile as PlayerMobile;
if( pm == null || !pm.InRange( m_Collector.Location, 7 ) )
return;
if( pm.ToTItemsTurnedIn == 0 )
m_Collector.SayTo( pm, 1071013 ); // Bring me 10 of the lost treasures of Tokuno and I will reward you with a valuable item.
else if( pm.ToTItemsTurnedIn < TreasuresOfTokuno.ItemsPerReward ) //This case should ALWAYS be true with this gump, jsut a sanity check
m_Collector.SayTo( pm, 1070981, String.Format( "{0}\t{1}", pm.ToTItemsTurnedIn, TreasuresOfTokuno.ItemsPerReward ) ); // You have turned in ~1_COUNT~ minor artifacts. Turn in ~2_NUM~ to receive a reward.
else
m_Collector.SayTo( pm, 1070982 ); // When you wish to choose your reward, you have but to approach me again.
}
}
}
namespace Server.Gumps
{
public class ToTRedeemGump : BaseImageTileButtonsGump
{
public class TypeTileButtonInfo : ImageTileButtonInfo
{
private Type m_Type;
public Type Type { get { return m_Type; } }
public TypeTileButtonInfo( Type type, int itemID, int hue, TextDefinition label, int localizedToolTip ) : base( itemID, hue, label, localizedToolTip )
{
m_Type = type;
}
public TypeTileButtonInfo( Type type, int itemID, TextDefinition label ) : this( type, itemID, 0, label, -1 )
{
}
public TypeTileButtonInfo( Type type, int itemID, TextDefinition label, int localizedToolTip ) : this( type, itemID, 0, label, localizedToolTip )
{
}
}
public class PigmentsTileButtonInfo : ImageTileButtonInfo
{
private PigmentType m_Pigment;
public PigmentType Pigment
{
get
{
return m_Pigment;
}
set
{
m_Pigment = value;
}
}
public PigmentsTileButtonInfo( PigmentType p ) : base( 0xEFF, PigmentsOfTokuno.PigmentInfo.GetInfo( p ).Hue, PigmentsOfTokuno.PigmentInfo.GetInfo( p ).Label )
{
m_Pigment = p;
}
}
private static TypeTileButtonInfo[] m_NormalRewards = new TypeTileButtonInfo[]
{
new TypeTileButtonInfo( typeof( SwordsOfProsperity ), 0x27A9, 1070963, 1071002 ),
new TypeTileButtonInfo( typeof( SwordOfTheStampede ), 0x27A2, 1070964, 1070978 ),
new TypeTileButtonInfo( typeof( WindsEdge ), 0x27A3, 1070965, 1071003 ),
new TypeTileButtonInfo( typeof( DarkenedSky ), 0x27AD, 1070966, 1071004 ),
new TypeTileButtonInfo( typeof( TheHorselord ), 0x27A5, 1070967, 1071005 ),
new TypeTileButtonInfo( typeof( RuneBeetleCarapace ), 0x277D, 1070968, 1071006 ),
new TypeTileButtonInfo( typeof( KasaOfTheRajin ), 0x2798, 1070969, 1071007 ),
new TypeTileButtonInfo( typeof( Stormgrip ), 0x2792, 1070970, 1071008 ),
new TypeTileButtonInfo( typeof( TomeOfLostKnowledge ), 0xEFA, 0x530, 1070971, 1071009 ),
new TypeTileButtonInfo( typeof( PigmentsOfTokuno ), 0xEFF, 1070933, 1071011 )
};
public static TypeTileButtonInfo[] NormalRewards { get { return m_NormalRewards; } }
private static PigmentsTileButtonInfo[] m_PigmentRewards = new PigmentsTileButtonInfo[]
{
#region Greater Metallic PoTs
new PigmentsTileButtonInfo( PigmentType.FadedCoal ),
new PigmentsTileButtonInfo( PigmentType.Coal ),
new PigmentsTileButtonInfo( PigmentType.FadedGold ),
new PigmentsTileButtonInfo( PigmentType.StormBronze ),
new PigmentsTileButtonInfo( PigmentType.Rose ),
new PigmentsTileButtonInfo( PigmentType.MidnightCoal ),
new PigmentsTileButtonInfo( PigmentType.FadedBronze ),
new PigmentsTileButtonInfo( PigmentType.FadedRose ),
new PigmentsTileButtonInfo( PigmentType.DeepRose ),
#endregion
#region Greater Neon PoTs
new PigmentsTileButtonInfo( PigmentType.ParagonGold ),
new PigmentsTileButtonInfo( PigmentType.VioletCouragePurple ),
new PigmentsTileButtonInfo( PigmentType.InvulnerabilityBlue ),
new PigmentsTileButtonInfo( PigmentType.LunaWhite ),
new PigmentsTileButtonInfo( PigmentType.DryadGreen ),
new PigmentsTileButtonInfo( PigmentType.ShadowDancerBlack ),
new PigmentsTileButtonInfo( PigmentType.BerserkerRed ),
new PigmentsTileButtonInfo( PigmentType.NoxGreen ),
new PigmentsTileButtonInfo( PigmentType.RumRed ),
new PigmentsTileButtonInfo( PigmentType.FireOrange )
#endregion
};
public static PigmentsTileButtonInfo[] PigmentRewards { get { return m_PigmentRewards; } }
private Mobile m_Collector;
public ToTRedeemGump( Mobile collector, bool pigments ) : base( pigments ? 1070986 : 1070985, pigments ? (ImageTileButtonInfo[])m_PigmentRewards : (ImageTileButtonInfo[])m_NormalRewards )
{
m_Collector = collector;
}
public override void HandleButtonResponse( NetState sender, int adjustedButton, ImageTileButtonInfo buttonInfo )
{
PlayerMobile pm = sender.Mobile as PlayerMobile;
if( pm == null || !pm.InRange( m_Collector.Location, 7 ) || !(pm.ToTItemsTurnedIn >= TreasuresOfTokuno.ItemsPerReward) )
return;
bool pigments = (buttonInfo is PigmentsTileButtonInfo);
Item item = null;
if( pigments )
{
PigmentsTileButtonInfo p = buttonInfo as PigmentsTileButtonInfo;
item = new PigmentsOfTokuno( p.Pigment );
}
else
{
TypeTileButtonInfo t = buttonInfo as TypeTileButtonInfo;
if( t.Type == typeof( PigmentsOfTokuno ) ) //Special case of course.
{
pm.CloseGump( typeof( ToTTurnInGump ) ); //Sanity
pm.CloseGump( typeof( ToTRedeemGump ) );
pm.SendGump( new ToTRedeemGump( m_Collector, true ) );
return;
}
try
{
item = (Item)Activator.CreateInstance( t.Type );
}
catch { }
}
if( item == null )
return; //Sanity
if( pm.AddToBackpack( item ) )
{
pm.ToTItemsTurnedIn -= TreasuresOfTokuno.ItemsPerReward;
m_Collector.SayTo( pm, 1070984, (item.Name == null || item.Name.Length <= 0)? String.Format( "#{0}", item.LabelNumber ) : item.Name ); // You have earned the gratitude of the Empire. I have placed the ~1_OBJTYPE~ in your backpack.
}
else
{
item.Delete();
m_Collector.SayTo( pm, 500722 ); // You don't have enough room in your backpack!
m_Collector.SayTo( pm, 1070982 ); // When you wish to choose your reward, you have but to approach me again.
}
}
public override void HandleCancel( NetState sender )
{
PlayerMobile pm = sender.Mobile as PlayerMobile;
if( pm == null || !pm.InRange( m_Collector.Location, 7 ) )
return;
if( pm.ToTItemsTurnedIn == 0 )
m_Collector.SayTo( pm, 1071013 ); // Bring me 10 of the lost treasures of Tokuno and I will reward you with a valuable item.
else if( pm.ToTItemsTurnedIn < TreasuresOfTokuno.ItemsPerReward ) //This and above case should ALWAYS be FALSE with this gump, jsut a sanity check
m_Collector.SayTo( pm, 1070981, String.Format( "{0}\t{1}", pm.ToTItemsTurnedIn, TreasuresOfTokuno.ItemsPerReward ) ); // You have turned in ~1_COUNT~ minor artifacts. Turn in ~2_NUM~ to receive a reward.
else
m_Collector.SayTo( pm, 1070982 ); // When you wish to choose your reward, you have but to approach me again.
}
}
}
/* Notes
Pigments of tokuno do NOT check for if item is already hued 0; APPARENTLY he still accepts it if it's < 10 charges.
Chest of Heirlooms don't show if unlocked.
Chest of heirlooms, locked, HARD to pick at 100 lock picking but not impossible. had 95 health to 0, cause it's trapped >< (explosion i think)
*/
and . . here is the script for the custom monster being killed
Code:
using System;
using Server.Items;
using Xanthos.Interfaces;
using Xanthos.Evo;
using Server.SpellCrafting.Items;
namespace Server.Mobiles
{
[CorpseName( "a brutish corpse" )]
public class CPMoloch : BaseCreature
{
public override WeaponAbility GetWeaponAbility()
{
return WeaponAbility.ConcussionBlow;
}
[Constructable]
public CPMoloch() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "a crystal brute";
Body = 0x311;
Hue = 91;
BaseSoundID = 0x300;
SetStr( 945, 1200 );
SetDex( 266, 285 );
SetInt( 41, 65 );
SetHits( 945, 1200 );
SetDamage( 20, 25 );
SetResistance( ResistanceType.Physical, 60, 70 );
SetResistance( ResistanceType.Fire, 60, 70 );
SetResistance( ResistanceType.Cold, 40, 50 );
SetResistance( ResistanceType.Poison, 20, 30 );
SetResistance( ResistanceType.Energy, 20, 30 );
SetSkill( SkillName.MagicResist, 125.1, 140.0 );
SetSkill( SkillName.Tactics, 90.1, 100.0 );
SetSkill( SkillName.Wrestling, 90.1, 100.0 );
Fame = 7500;
Karma = -7500;
VirtualArmor = 50;
switch ( Utility.Random( 5 ))
{
case 0: PackItem( new MagicJewel(5) ); break;
case 1: PackItem( new MagicJewel(10) ); break;
case 2: PackItem( new MagicJewel(15) ); break;
case 3: PackItem( new MagicJewel(20) ); break;
case 4: PackItem( new MagicJewel(25) ); break;
}
switch ( Utility.Random( 10 ) )
{
case 0: PackItem( new StarDust(2) ); break;
case 1: PackItem( new StaffImbuingPotion() ); break;
case 2: PackItem( new PowderOfTranslocation (5) ); break;
case 3: PackItem( new TravelEssence() ); break;
case 4: PackItem( new dishingstump() ); break;
case 5: PackItem( new PetrafiedWood(5) ); break;
case 6: PackItem( new AncientMortarPestle() ); break;
case 7: PackItem( new BasketMakingMaterials(5) ); break;
case 8: PackItem( new BasketMakingTool() ); break;
case 9: PackItem( new LacquerPot() ); break;
}
if ( 0.45 > Utility.RandomDouble() )
PackItem( new MB_RandomPowerScrollDeed() );
}
public override void GenerateLoot()
{
AddLoot( LootPack.SuperBoss, 3 );
AddLoot( LootPack.FilthyRich, 4 );
AddLoot( LootPack.Gems, Utility.RandomMinMax( 5, 20 ) );
}
public override Poison PoisonImmune{ get{ return Poison.Regular; } }
public override void OnDeath( Container c )
{
switch ( Utility.Random( 7 ) )
{
case 0: c.DropItem( new Blight() ); break;
case 1: c.DropItem( new CapturedEssence() ); break;
case 2: c.DropItem( new Corruption() ); break;
case 3: c.DropItem( new DiseasedBark() ); break;
case 4: c.DropItem( new DreadHornMane() ); break;
case 5: c.DropItem( new EyeOfTheTravesty() ); break;
case 6: c.DropItem( new GrizzledBones() ); break;
}
switch ( Utility.Random( 7 ) )
{
case 0: c.DropItem( new LardOfParoxysmus() ); break;
case 1: c.DropItem( new LuminescentFungi() ); break;
case 2: c.DropItem( new Muculent() ); break;
case 3: c.DropItem( new ParasiticPlant() ); break;
case 4: c.DropItem( new Putrefication() ); break;
case 5: c.DropItem( new Scourge() ); break;
case 6: c.DropItem( new Taint() ); break;
}
if ( Utility.RandomDouble() < 0.25 )
{
switch ( Utility.Random( 16 ) )
{
case 0: c.DropItem( new MyrmidonGloves() ); break;
case 1: c.DropItem( new MyrmidonGorget() ); break;
case 2: c.DropItem( new MyrmidonLegs() ); break;
case 3: c.DropItem( new MyrmidonArms() ); break;
case 4: c.DropItem( new PaladinArms() ); break;
case 5: c.DropItem( new PaladinGorget() ); break;
case 6: c.DropItem( new LeafweaveLegs() ); break;
case 7: c.DropItem( new DeathChest() ); break;
case 8: c.DropItem( new DeathGloves() ); break;
case 9: c.DropItem( new DeathLegs() ); break;
case 10: c.DropItem( new GreymistGloves() ); break;
case 11: c.DropItem( new GreymistArms() ); break;
case 12: c.DropItem( new AssassinChest() ); break;
case 13: c.DropItem( new AssassinArms() ); break;
case 14: c.DropItem( new GlovesOfHunter() ); break;
case 15: c.DropItem( new LegsOfHunter() ); break;
}
}
if ( Utility.RandomDouble() <= 0.25 ) //.05
{
switch ( Utility.Random( 8 ))
{
case 0: c.DropItem( new Aegis() ); break;
case 1: c.DropItem( new DragonheartShield() ); break;
case 2: c.DropItem( new GuardianCrest() ); break;
case 3: c.DropItem( new ShieldOfInvulnerability() ); break;
case 4: c.DropItem( new BladeOfInsanity() ); break;
case 5: c.DropItem( new SerpentsFang() ); break;
case 6: c.DropItem( new Infamia() ); break;
case 7: c.DropItem( new BoneCrusher() ); break;
}
}
if ( Utility.RandomDouble() < 0.25 )
{
switch ( Utility.Random( 101 ) )
{
case 0: c.DropItem( new Aegis() ); break;
case 1: c.DropItem( new AlchemistsBauble() ); break;
case 2: c.DropItem( new ArcaneArms() ); break;
case 3: c.DropItem( new ArcaneCap() ); break;
case 4: c.DropItem( new ArcaneGloves() ); break;
case 5: c.DropItem( new ArcaneGorget() ); break;
case 6: c.DropItem( new ArcaneLeggings() ); break;
case 7: c.DropItem( new ArcaneShield() ); break;
case 8: c.DropItem( new ArcaneTunic() ); break;
case 9: c.DropItem( new ArcticDeathDealer() ); break;
case 10: c.DropItem( new ArmorOfFortune() ); break;
case 11: c.DropItem( new ArmorOfInsight() ); break;
case 12: c.DropItem( new ArmorOfNobility() ); break;
case 13: c.DropItem( new ArmsOfAegis() ); break;
case 14: c.DropItem( new ArmsOfBane() ); break;
case 15: c.DropItem( new ArmsOfFire() ); break;
case 16: c.DropItem( new ArmsOfFortune() ); break;
case 17: c.DropItem( new ArmsOfHunter() ); break;
case 18: c.DropItem( new ArmsOfInsight() ); break;
case 19: c.DropItem( new ArmsOfNobility() ); break;
case 20: c.DropItem( new ArmsOfTheFallenKing() ); break;
case 21: c.DropItem( new ArmsOfTheHarrower() ); break;
case 22: c.DropItem( new AssassinArms() ); break;
case 23: c.DropItem( new AssassinChest() ); break;
case 24: c.DropItem( new AssassinGloves() ); break;
case 25: c.DropItem( new AssassinGorget() ); break;
case 26: c.DropItem( new AssassinHood() ); break;
case 27: c.DropItem( new AssassinLegs() ); break;
case 28: c.DropItem( new AwesomeDisturbingPortraitDeed() ); break;
case 29: c.DropItem( new AxeOfTheHeavens() ); break;
case 31: c.DropItem( new BanditsBlade() ); break;
case 32: c.DropItem( new BaneEnlighten() ); break;
case 33: c.DropItem( new BedOfNailsDeed() ); break;
case 34: c.DropItem( new BladeOfInsanity() ); break;
case 35: c.DropItem( new BladeofTorment() ); break;
case 36: c.DropItem( new BlazeOfDeath() ); break;
case 37: c.DropItem( new BlueDecorativeRugDeed() ); break;
case 38: c.DropItem( new BlueFancyRugDeed() ); break;
case 39: c.DropItem( new BluePlainRugDeed() ); break;
case 40: c.DropItem( new BoilingCauldronDeed() ); break;
case 41: c.DropItem( new BoneCouchDeed() ); break;
case 42: c.DropItem( new BoneCrusher() ); break;
case 43: c.DropItem( new BoneTableDeed() ); break;
case 44: c.DropItem( new BoneThroneDeed() ); break;
case 45: c.DropItem( new BowOfTheJukaKing() ); break;
case 46: c.DropItem( new BraceletOfHealth() ); break;
case 47: c.DropItem( new BraceletOfTheElements() ); break;
case 48: c.DropItem( new BraceletOfTheVile() ); break;
case 49: c.DropItem( new BreathOfTheDead() ); break;
case 50: c.DropItem( new BrokenArmoireDeed() ); break;
case 51: c.DropItem( new BrokenBedDeed() ); break;
case 52: c.DropItem( new BrokenBookcaseDeed() ); break;
case 53: c.DropItem( new BrokenChestOfDrawersDeed() ); break;
case 54: c.DropItem( new BrokenCoveredChairDeed() ); break;
case 55: c.DropItem( new BrokenFallenChairDeed() ); break;
case 56: c.DropItem( new BrokenVanityDeed() ); break;
case 57: c.DropItem( new BucBow() ); break;
case 58: c.DropItem( new CandelabraOfSouls() ); break;
case 59: c.DropItem( new CapOfFortune() ); break;
case 60: c.DropItem( new CapOfTheFallenKing() ); break;
case 61: c.DropItem( new CaptainQuacklebushsCutlass() ); break;
case 62: c.DropItem( new CavortingClub() ); break;
case 63: c.DropItem( new CinnamonFancyRugDeed() ); break;
case 64: c.DropItem( new CoifOfBane() ); break;
case 65: c.DropItem( new CoifOfFire() ); break;
case 66: c.DropItem( new CoifOfNobility() ); break;
case 67: c.DropItem( new ColdBlood() ); break;
case 68: c.DropItem( new ConjurersGarb() ); break;
case 69: c.DropItem( new ConjurersGrimoire() ); break;
case 70: c.DropItem( new ConjurersTrinket() ); break;
case 71: c.DropItem( new CreepyPortraitDeed() ); break;
case 72: c.DropItem( new CurtainsDeed() ); break;
case 73: c.DropItem( new DisturbingPortraitDeed() ); break;
case 74: c.DropItem( new DivineArms() ); break;
case 75: c.DropItem( new DivineCountenance() ); break;
case 76: c.DropItem( new DivineGloves() ); break;
case 77: c.DropItem( new DivineGorget() ); break;
case 78: c.DropItem( new DivineLeggings() ); break;
case 79: c.DropItem( new DivineTunic() ); break;
case 80: c.DropItem( new DragClaw() ); break;
case 81: c.DropItem( new DragonHeartArms() ); break;
case 82: c.DropItem( new DragonHeartChest() ); break;
case 83: c.DropItem( new DragonHeartGloves() ); break;
case 84: c.DropItem( new DragonHeartGorget() ); break;
case 85: c.DropItem( new DragonHeartHelm() ); break;
case 86: c.DropItem( new DragonHeartLegs() ); break;
case 87: c.DropItem( new DragonheartSword() ); break;
case 88: c.DropItem( new DragonsEnd() ); break;
case 89: c.DropItem( new DruidFemaleLeafChest() ); break;
case 90: c.DropItem( new DruidLeafArms() ); break;
case 91: c.DropItem( new DruidLeafChest() ); break;
case 92: c.DropItem( new DruidLeafGloves() ); break;
case 93: c.DropItem( new DruidLeafGorget() ); break;
case 94: c.DropItem( new DruidLeafLegs() ); break;
case 95: c.DropItem( new DupresShield() ); break;
case 96: c.DropItem( new EarringsOfHealth() ); break;
case 97: c.DropItem( new EarringsOfTheElements() ); break;
case 98: c.DropItem( new EarringsOfTheMagician() ); break;
case 99: c.DropItem( new EarringsOfTheVile() ); break;
}
}
base.OnDeath( c );
}
public CPMoloch( 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();
}
}
}