Opywang

Member
Hey there I've spend all day trying to find ways to get token to work, and finally got it to work, and now I need to find a way how to make the token drop in players pack.

I want to make specific monster drop with small percentage, and paragon also if anybody can help I'll appreciate it very much!

I would like to make it reward to players randomly that get loots right with 100% chance, and paragons with less chance of course.
 
So I did a quick search, if you look in BaseCreature.cs there's a method called OnKilledBy that you can override in your mob class to give stuff to people involved with killing it. This is how artifacts are given out. At least, the code I'm looking at, I believe I've got a recent RunUO from github, I can't imagine it'd be too much different in ServUO.

If you're not sure how to add to the players backpack, find and look at Paragon.cs there's a method in that class called GiveArtifactTo that you could learn from probably.
 
Interesting I guess token can be part of paragon artifacts. Good idea!

O.K. I check BaseCreature.cs, and it has 7,000 lines.

Is it possible that I can edit each monster cause I want the token to be rare, and only drop from boss, and paragons.

I mean this gotta be a common thing cause there is many custom shard they fix many monster, but it probably just drop in corps, and what I'm trying to do is make it drop in back pack instead so it might be a challenge.

If anybody get any idea how it'll be great, and thank you!
 
If you want all creatures to drop tokens, you would modify BaseCreature.cs (Sure it has 7000 lines or whatever, but I told you the method name, and your editor SHOULD have some sort of "find" or "search" function).
If you want just your custom creatures to drop tokens, you would override the method I mentioned. If you are unclear what that means, https://www.dotnetperls.com/override and you should brush up on C# and OOP. :)

edit: Also, I only mentioned the paragon file, because it had an example of how to add something to someone's pack. It's the one I looked at, because artifacts are put directly into a killing players pack.
 
O.K. wow I don't mean to sound noob, or anything, but I am getting close, and thank you arvoreen for helping me.

For some odd reason I download a ticket reward system, and for some odd reason it is not putting them in the corps pack, and I even tried other item it works fine, and drop every time, but not this specific custom item.

Here is link where I download reward ticket
https://www.servuo.com/archive/reward-ticket-vendor-stone-and-ledger.366/

This is what I put in for drop item, everything else work, but not this one when I put RewardTicket.

PackItem(new RewardTicket());
break;

Can anybody explain to me why I am unable to make custom item drop in corps I would appreciate it so much thank you.

This is RewardTicket.cs
/************************************************************************
*
* This script was made by milt, AKA Pokey.
*
* Email: [email protected]
*
* AIM: TrueBornStunna
*
* Website: www.f13nd.net
*
* Version: 1.0.3
*
* Release Date: December 25, 2005
*
*************************************************************************/
using System;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Gumps;

namespace Server.Items
{
public class RewardTicket : Item
{
[Constructable]
public RewardTicket() : base( 0x14F0 )
{
Name = "a Reward ticket";
Movable = true;
LootType = LootType.Blessed;
Hue = 1161;
}

public RewardTicket( Serial serial ) : base( serial )
{
}

public override void OnDoubleClick(Mobile from)
{
if ( this.IsChildOf( from.Backpack ) )
{
// keithn - Add to Reward Ticket Ledger
Item[] items = from.Backpack.FindItemsByType( typeof( RewardTicketLedger ) );

foreach( RewardTicketLedger ttl in items )
{
if ( ttl.Owner == from.Serial )
{
if ((ttl.RewardTickets + 1) <= 1000000 )
{
if (!(this.Deleted))
{
from.CloseGump( typeof( RewardTicketsGump ) );
ttl.RewardTickets = (ttl.RewardTickets + 1);
from.SendMessage( 1161, "Reward ticket has been added to your Reward ticket ledger.");
from.SendMessage( 1161, "Redeem Reward tickets at the Reward vendor stone to receive your prize or save them up to get better prizes!");
from.SendGump( new RewardTicketsGump( from, ttl ) );
this.Delete();
break;
}
else
{
from.PlaySound(1069); //play Hey!! sound
from.SendMessage(1173, "Hey, don't try to rob the bank!!!");
from.SendGump( new RewardTicketsGump( from, this ) );
}
}
else
{
from.SendMessage(1173, "You have a full Reward ticket ledger, please pick up an extra ledger in the lounge.");
}
}
}
}
else
{
from.SendMessage(1173, "The Reward ticket must be in your backpack to be used.");
}
//keithn - Add to Reward Ticket Ledger - End
}

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();
}
}
}
 
blessed items wont drop you need to make an exception
here is one example on how to make blessed items drop.
youll need to reconstruct it to make it work how you want.

public override void OnDeath( Container c )
{
base.OnDeath( c );
switch ( Utility.Random( 19 ) )
{
case 0: c.AddItem( new EtherealShroud() ); break;
case 1: c.AddItem( new EtherealHorse() ); break;
case 2: c.AddItem( new EtherealLlama() ); break;
case 3: c.AddItem( new EtherealOstard() ); break;
case 4: c.AddItem( new EtherealUnicorn() ); break;
case 5: c.AddItem( new EtherealKirin() ); break;
case 6: c.AddItem( new EtherealBeetle() ); break;
case 7: c.AddItem( new EtherealSwampDragon() ); break;
case 8: c.AddItem( new RideablePolarBear() ); break;
case 9: c.AddItem( new EtherealCuSidhe() ); break;
case 10: c.AddItem( new EtherealLlama() ); break;
case 11: c.AddItem( new EtherealHiryu() ); break;
case 12: c.AddItem( new ChargerOfTheFallen() ); break;
case 13: c.AddItem( new EtherealReptalon() ); break;
case 14: c.AddItem( new EtherealBoura() ); break;
case 15: c.AddItem( new EtherealAncientHellHound() ); break;
case 16: c.AddItem( new EtherealTiger() ); break;
case 17: c.AddItem( new EtherealLasher() ); break;
case 18: c.AddItem( new EtherealTarantula() ); break;
}
 
Oh thank you so much! That make sense lol.
[doublepost=1510651180][/doublepost]O.K. I tried to put this in basecreature.cs and it did not work i had error what line do I put these in?

I tried to put these in two place, and maybe I made a slight mistake, but not sure.
[doublepost=1510652512][/doublepost]O.K. I solve a problem I just had to add a collom in the other line like this {
[doublepost=1510652945][/doublepost]LOL! Now it drop all bless item in every corps.

It has 100% drop chance, and dropping in every single corps.
[doublepost=1510654334][/doublepost]O.K. I appreciate your help I just remove the Blessed it did the job wonderfully thank you for trying to help!
 

Active Shards

Donations

Total amount
$80.00
Goal
$1,000.00
Back