RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

[2.2] Kill Tracker Ball

Bittiez

Sorceror
This item will track player kills(monsters and animals, not pvp kills), you can use the points for rewards if you'd like(I use the custom vendor package available in custom script release to make a vendor stone that users can purchase items with kill points)

It will display Points and Total Kills(Both are the same, except Points get taken away when purchasing things, Total Kills stays the same)


Check out Mortis's version, it has many new and great additions to this script, see it here. - updated version here.

Mortis + Bittiez Version here. - This version has a vast amount of improvements, and is worth checking out! (This post has most of the details of the improvements)


First you need to edit Mobiles/BaseCreature
Find the OnDamage method and add the following somewhere in there:


Code to count kills made by player and pets:
Code:
          #region Tad's Kill Points
            if (willKill && from is PlayerMobile || willKill && from is BaseCreature)
            {
                if (from is BaseCreature)
                {
                    BaseCreature pet = from as BaseCreature;
                    if (pet.Controlled)
                    {
                        Mobile master1 = pet.ControlMaster as Mobile;
                        foreach (Item i in master1.Backpack.Items)
                        {
                            if (i is KillPointTracker)
                            {
                                KillPointTracker kpt = i as KillPointTracker;
 
                                kpt.Points++;
                                kpt.TotalPt++;
                                break;
                            }
                        }
                    }
                }
                else
                {
                    foreach (Item i in from.Backpack.Items)
                    {
                        if (i is KillPointTracker)
                        {
                            KillPointTracker kpt = i as KillPointTracker;
 
                            kpt.Points++;
                            kpt.TotalPt++;
                            break;
                        }
                    }
                }
            }
#endregion

Code to only track player kills:
Code:
#region Tad's Kill Points
            if (willKill && from is PlayerMobile)
            {
                    foreach (Item i in from.Backpack.Items)
                    {
                        if (i is KillPointTracker)
                        {
                            KillPointTracker kpt = i as KillPointTracker;
 
                            kpt.Points++;
                            kpt.TotalPt++;
                            break;
                        }
                    }
            }
#endregion



The custom vendor I use with this for players to spend points:
http://www.runuo.com/community/threads/runu-o-2-0-rc1-rc2-the-complete-customizable-vendor.91051/


Put killpoints.cs somewhere within your Scripts folder(Probably in your customs folder)

[add KillPointTracker to add the item

Every time you or your pet kills a monster/animal you get one point
If you have multiple balls in your pack, this only adds a point to the first one it finds

Enjoy
 

Attachments

  • killpoints.cs
    1.7 KB · Views: 46

Bittiez

Sorceror
If you can find out where in the scripts a player dies, then yes, easily but I don't know what script is called on player death =/
 

bazspeed

Sorceror
no i mean i want the ball to only take the kills that the player makes, not what a pet kills. that way forcing a player to make kills himself not leaving an evo dragon to do it all
 

Bittiez

Sorceror
Yep, change the above code in OnDamage to this:
Code:
#region Tad's Kill Points
            if (willKill && from is PlayerMobile)
            {
                    foreach (Item i in from.Backpack.Items)
                    {
                        if (i is KillPointTracker)
                        {
                            KillPointTracker kpt = i as KillPointTracker;
 
                            kpt.Points++;
                            kpt.TotalPt++;
                            break;
                        }
                    }
            }
#endregion
 

bazspeed

Sorceror
Great, its working fine. Next question is, can you give a link to the custom vendor package, or if anyone can help to create a stone or something for this to sell stuff.
 

Mortis

Knight
Great job.

I had a problem with the items name disappearing when the total kills appeared.
So I changed it to use only one line and added some color to the font.
With Color
Code:
        public override void GetProperties( ObjectPropertyList list )
        {
       
            base.GetProperties( list );
 
                    if (m_Points > 0)
 
                    list.Add("  <BASEFONT COLOR=#1DF0101>{0}<BASEFONT COLOR=#FFFFFF> <BASEFONT COLOR=#1EFF00>Kill Points<BASEFONT COLOR=#FFFFFF>  <BASEFONT COLOR=#0000FF>|<BASEFONT COLOR=#FFFFFF>  <BASEFONT COLOR=#1DF0101>{1}<BASEFONT COLOR=#FFFFFF> <BASEFONT COLOR=#1EFF00>Kills Total<BASEFONT COLOR=#FFFFFF>",m_Points.ToString(), m_TotalPoints1.ToString());
                    else { list.Add(" *Empty* "); }
 
        }
With out color
Code:
        public override void GetProperties( ObjectPropertyList list )
 
        {
 
     
 
            base.GetProperties( list );
 
                    if (m_Points > 0)
 
                    list.Add("  {0}  Kill Points    |    {1}  Kills Total ",m_Points.ToString(), m_TotalPoints1.ToString());
 
                    else { list.Add("*Empty* "); }
 
        }
 

Mortis

Knight
Great, its working fine. Next question is, can you give a link to the custom vendor package, or if anyone can help to create a stone or something for this to sell stuff.

I am working on a stone and some other modifications. Close to done. Will post here when finished.
Of course Bittiez still gets full credit as the original idea was his.
 

Mortis

Knight
Well so far what I have
your killtracker that shows points,kills,redeemed points.
Kill tracker is set by dclick to player by serial so it only works for him . You can unbind it later to sell or trade(option can be turned on/off in script).
Redeem points has a max of ten million then it will no longer accept points/kills. You must at this point redeem. (shard owners can change this amount)
you can res for redemption points command [kpt or dlick stone for gump like an ankh.( only works if you have a killpointtracker in your backpack with enough points.
res option can be turned on off in script.

Reward gump shows also your points and redeemed points
has options for hundred point rewards only , thousand point rewards only or both hundred and thousand. can be set in script for one of the three. only shows reward option if you have enough points to claim it.
script has option to use [ktp for res, redeem or buy a kill point tracker. Or you can turn off command and they will have to dclick the stone for options.

Added in basecreature.cs code checks for different mobs. I feel a champion should get you more points than a zombie.
I just added a couple for testing. Shard owners can add more or turn it on/off in script.

Right now I just have to finish the gump. Tedious work. 20 pages with 190 cases.
may add option to send item to bank or backpack.
I only populated one item for testing. who ever downloads it when it is done will have to put their own rewards in the cases and on the gump.

Would there be any other function any one would like while I am working on it?

Double click killpointtracker
gump8.jpg
if dead [kpt or dclick stone
gump2.jpg
Hundred enabled
gump3.jpg
Thousand enabled
gump4.jpg
Both enabled
gump5.jpg
Both enabled with less than 3000 points
gump6.jpg
Both enabled with less than 3000 points with KillPointTracker mouse over
gump7.jpg
dclick stone
gump1.jpg

I think I need to re size two of the gumps the res and buy / redeem. To fit better. They are the same gump. Just different by checks. I can re size them by the same checks.

Any way this is what I have not finished in case I die or something before done.




Newest Update link.
[2.2] Kill Tracker Ball
 

Bittiez

Sorceror
Just an idea you could do something with hp, for example hp * 0.01 = kill points recieved(1% of hp as kill points), but anyways your modifications look great! Feel free to relabel your version as your own, your modifications alone are more code then the original, thanks for the contributions, looks great!
 

Mortis

Knight
I will try. It may be beyond my abilities. If so maybe some one else will jump in and be able to do so.

I was thinking about an onlogin gift in increments of 250,000
Like a statue with player name and points.

an honorable statue of persistence for "playername" 250,000 kills.

No way. Your idea is what sparked this. It is nothing without your original idea.
I just took your idea and ran with it.
It should stay in your thread. Maybe some day you will mod it more.

Besides I have made a stage mob system I added this to. That one I would post as my own with credits to you.

btw, I made it all in one .cs file so far it is 2732 lines. it will be more when done.
 

bazspeed

Sorceror
Just a question before i go in and replace the original kill tracker. If i upload this one, and remove the other one, will it delete all the old balls? I dont want my players to have their original balls removed with their well earned kill points.
 

Bittiez

Sorceror
Hmm, as long as he didn't change the names inside the script you should be perfectly fine replacing it, ill test it when he releases it.
 

Mortis

Knight
Just a question before i go in and replace the original kill tracker. If i upload this one, and remove the other one, will it delete all the old balls? I dont want my players to have their original balls removed with their well earned kill points.

Serialize/Deserialize has been changed.

In the new KillPointTracker.cs

Just to be safe make a copy of your server to test this in first. Though I am sure it will work.
Comment out lines 2709 and 2710.
like
Code:
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );
 
            int version = reader.ReadInt();
            m_Points = reader.ReadInt();
                  m_TotalPoints1 = reader.ReadInt();
                // m_RedeemedPoints = reader.ReadInt();
                  //  BoundTo = reader.ReadInt();//Read on startup who it is bound to.
        }
 
    }
Start the server and do a save. Shut down the server and uncomment out both lines.
as
Code:
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );
 
            int version = reader.ReadInt();
            m_Points = reader.ReadInt();
                  m_TotalPoints1 = reader.ReadInt();
                  m_RedeemedPoints = reader.ReadInt();
                    BoundTo = reader.ReadInt();//Read on startup who it is bound to.
        }
 
    }
Start up the server and it should be all good to go.
 

bazspeed

Sorceror
i made the changes, but do i need to delete the original ball first. if i do, i get a question do i want to delete?
 

bazspeed

Sorceror
i tried 3 different ways.

1. left original in with the new one and commented out the lines
2. left original in, but changed name in file to OldKillPointTracker
3. Removed old file and followed instructions.

Not one worked. any other suggestions?
 
Top