I am trying to add a statue to a mob as a drop. I can't find any examples or help on any of the forums. The only bit of example I found was the Referral reward program. I tried modifying that bit of code and adding it as such.

Code:
PackItem(new(typeof (MonsterStatuette), "Cow Statuette", 5, 0x2103, new object[] {MonsterStatuetteType.Cow}, "A cow statuette that makes sounds when walked by."));

But obviously that doesnt work. I am at a lost of how to add a statue since they aren't typical items. Any one know how?
 
First, You need to write this code on Top

using Server.Items;

after that, you need to fix OnDeath Function like this
public override void OnDeath(Container c)
{
base.OnDeath(c);
if (Utility.RandomDouble() < 0.200) // Rate( 0.01 = 1% )
c.DropItem(new UnicornRibs());
}

Usually, Scripts except BaseCreature.cs doesn't contains this function because it already exists on BaseScript.
So, You need to Fix this function for individual script.

When you want to Modify Specific function for Only That script, Just Use Override.
 
  • Like
Reactions: ExX
Thanks for the assistance but I know how to add items as drops. What I can't figure out is how to add a statue as a drop. Statuettes aren't typical items I can just call. and I can't seem to figure out the proper way to create a statuette for loot.
 
Not sure if this will work
this.PackItem (MonsterStatuette statue = new MonsterStatuette(MonsterStatuetteType.Cow);
or
this.PackItem typeof(MonsterStatuette), MonsterStatuetteType.Cow);
 
Last edited:
Thanks for your reply. I tried your suggestions and get the following errors.

First I tried
this.PackItem (MonsterStatuette statue = new MonsterStatuette(MonsterStatuetteType.Cow);

but got this:
CS1026: Line 43: ) expected

Then I tried adding another ")" like this:
this.PackItem (MonsterStatuette statue = new MonsterStatuette(MonsterStatuetteType.Cow);

but got this error:
+ Custom/Mobiles/Ill Tempered Bunny.cs:
CS1026: Line 43: ) expected
CS1002: Line 43: ; expected
CS1525: Line 43: Invalid expression term ')'

Then I tried your other suggestion:

this.PackItem typeof(MonsterStatuette), MonsterStatuetteType.Cow);

and got this error:
CS1002: Line 44: ; expected
CS1002: Line 44: ; expected
CS1525: Line 44: Invalid expression term ','
CS1002: Line 44: ; expected

Thanks for trying. I'm completely lost.
 
if you use '(' you need to use ')'
check number of '(' and ')'
if result is different, Consol window will show you an error message.
 
  • Like
Reactions: ExX
Thanks for the reply. I tried your suggestion and this is the error I get. Had no idea it would be so hard to add a statue as a drop. lol
CS1955: Line 44: Non-invocable member 'Server.Items.MonsterStatuetteType.Cow
' cannot be used like a method.
 
Gosh tough one-- do you use Visual Studio? Visual Studio is great for loading a script in, most times it will show a scripting error in red
maybe
this.PackItem ( typeof(MonsterStatuette statue = new MonsterStatuette(MonsterStatuetteType.Cow);
 
  • Like
Reactions: ExX
I use notepad++. Wasn't aware of Visual Studio, I'll definitively grab that and check it out. That suggestion produced the same errors i've goten before. I can't believe how difficult it is just to add a statue. lol
 
PackItem(new MonsterStatuette(MonsterStatuetteType.Cow));
However, its usually preferable to add the item to the corpse unless you want the item in their pack before they die (like if you want people to be able to steal it). Adding it as a pack item means they have to carry it around on each one which adds to the item count.
Add it to OnDeath instead:
Code:
  public override void OnDeath(Container c)
  {
      base.OnDeath(c);
      c.DropItem(new MonsterStatuette(MonsterStatuetteType.Cow));
  }
Or better yet, if you want a chance it will drop, do this:
Code:
  public override void OnDeath(Container c)
  {
      base.OnDeath(c);
      if (Utility.RandomDouble() <= 0.5) // 50% chance to drop
          c.DropItem(new MonsterStatuette(MonsterStatuetteType.Cow));
  }
 
Last edited:
Dude... I had to add an extra ")" but that worked perfectly. Wow I was about to give up. Thank you so much!
 
So if I want it to be a 5% chance I would do

if(Utility.RandomDouble()<=0.05) ? Thanks for the tip. I actually never thought of that aspect before.
 
Code:
  public override void OnDeath(Container c)
  {
      base.OnDeath(c);
      if (Utility.RandomDouble() <= 0.5) // 50% chance to drop
          c.DropItem(new MonsterStatuette(MonsterStatuetteType.Cow));
  }
Is there a way to add this to all mobs in the game without having to define them in each individual CS? Like a custom file that will add a chance of the mob killed to drop it's own monsterstatuettetype ?
 
Back