Full Version : about monsters dropping blessed items on death
xmlspawner >>Scripting Support >>about monsters dropping blessed items on death


<< Prev | Next >>

clevins- 08-17-2006
alright you gave the code smile.gif
CODE
// ARTEGORDONMOD
// allow equipped blessed items to drop into corpses  
public override DeathMoveResult GetParentMoveResultFor(Item item)
{
 if (item.LootType == LootType.Blessed) return DeathMoveResult.MoveToCorpse;
 return item.OnParentDeath(this);
}

// ARTEGORDONMOD
// allow blessed items to drop into corpses
public override DeathMoveResult GetInventoryMoveResultFor(Item item)
{
 if (item.LootType == LootType.Blessed) return DeathMoveResult.MoveToCorpse;
 return item.OnInventoryDeath(this);
}


where does it go in basecreatures.cs sad.gif everywhere i seem to put it .. i get this error:

CS1518: line 130: Expected class, delegate, enum, interface, or struct
CS1518: line 138; Expected class, delegate, enum, interface, or struct


ArteGordon- 08-18-2006
you need to put it inside of the basecreature class definition.

Here is where I have it in my basecreature.cs around line 250 or so

CODE

       public override bool IsDeadBondedPet { get { return m_IsDeadPet; } }

       private bool m_IsBonded;
       private bool m_IsDeadPet;
       private DateTime m_BondingBegin;
       private DateTime m_OwnerAbandonTime;

       // ARTEGORDONMOD
       // allow equipped blessed items to drop into corpses  
       public override DeathMoveResult GetParentMoveResultFor(Item item)
       {
           if (item.LootType == LootType.Blessed) return DeathMoveResult.MoveToCorpse;
           return item.OnParentDeath(this);
       }

       // ARTEGORDONMOD
       // allow blessed items to drop into corpses
       public override DeathMoveResult GetInventoryMoveResultFor(Item item)
       {
           if (item.LootType == LootType.Blessed) return DeathMoveResult.MoveToCorpse;
           return item.OnInventoryDeath(this);
       }

       [CommandProperty(AccessLevel.GameMaster)]
       public Mobile LastOwner
       {
           get
           {
               if (m_Owners == null || m_Owners.Count == 0)
                   return null;

               return m_Owners[m_Owners.Count - 1];
           }
       }



clevins- 08-18-2006
CODE
Server Crash Report
===================

RunUO Version 2.0, Build 2357.32527
Operating System: Microsoft Windows NT 5.1.2600 Service Pack 2
.NET Framework: 2.0.50727.42
Time: 8/18/2006 5:10:38 AM
Mobiles: 693
Items: 27816
Clients:
- Count: 0

Exception:
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
  at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
  at System.Collections.Generic.Dictionary`2.ValueCollection.Enumerator.MoveNext()
  at Server.StandardSaveStrategy.SaveItems(SaveMetrics metrics)
  at Server.StandardSaveStrategy.Save(SaveMetrics metrics)
  at Server.World.Save(Boolean message)
  at Server.World.Save()
  at Server.Misc.ServerConsole.Next(String input)
  at Server.Misc.ServerConsole.ConsoleListen()
  at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
  at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
  at System.Threading.ThreadHelper.ThreadStart()




thats what i got after i added the code :x and i used the back ups twice

ArteGordon- 08-18-2006
that is unrelated. It is due to some custom system that is modifying the world item list during saves.