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

Mortis

Knight
Wait till i am done. I have to put the KillPointTracker in it's own file for people who were already using it on a live shard. Almost done with the gumps. I will change it when I am to be more backward compatible.
 

bazspeed

Sorceror
dont get an error, just asked to delete the old tracker, i can have the old and new on the same server but the old ones are there but people have built up a nice score on the ones i have, i dont want to delete them, they will get right miffed.
 

Mortis

Knight
Just wait. Like I said. It is because I have it all in one .cs. I will make it three files then you can update.
Without deleting anything.
 

Mortis

Knight
Ok all set download new file and follow readme.txt instructions.

I have tested and confirmed it will work if you follow directions to update from Bittiez script.

Problem being the tracker was in the stone and needed be the stone in the tracker for backward compatibility.

MY old BaseCreature edit will not work with new backward compatible version.

You will need to populate the Items for rewards.
Readme
Code:
KillPointTracker
 
Original Idea by Bittiez
 
Modified by Mortis
 
What to do to install if you already have Bittiez version installed and in use by players.
Remove old version script.
Replace Base creature edit with one supplied below.
Comment out lines 7400 and 7401
 
        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 [save  shutdown server.
 
Uncomment lines 7400 and 7401
 
        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.
        }
 
Restart server [save  Your all raedy to rock.
 
If using for first time. Just add script and use below Basecreature.cs edit
 
Configurable options:
 
Lines 295 - 298
 
private bool Hundred = true; // Default:Change to false if thousand or both = true
private bool Thousand = false; // Change to true if you want Thousands and change Hundred to false. Leave false also it both = true.
private bool Both = false; // Change to true if you want Hundred and Thousand. Leave false if Hundred or Thousand = true.
private bool BankOverPack = false; //Change to true to use add item to players bank instead of Back pack.
 
Line 7313
 
public static bool ResOnOff = true;//Change to false if you do not want the resurrect option.
 
Line 16
PointsCap
 
Two lines in BaseCreature.cs
if (kpt.RedeemedPoints >= 10000000)
 
Summery:
 
Commands:
[add KillPointStone
[kpt  brings up a gump to res for points if enabled.
 
Items:
Kill point stone
kill point tracker
 
Kill Point Stone if dclicked brings up option to buy a kill point tracker or redeem points.
 
Kill point tracker if dclicked brings up option to bind to your kill point tracker or unbind for gold.
You need to bind to it to recieve killpoints.
 
BaseCreature.cs edit.
 
 
Add it under these lines. around 1299 and 1230
 
            if ( willKill && from is PlayerMobile )
                Timer.DelayCall( TimeSpan.FromSeconds( 10 ), new TimerCallback( ((PlayerMobile) from).RecoverAmmo ) );
 
          #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)
                            {
 
                        if(KillPointTracker.BoundTo == master1.Serial)
                          {
 
                        KillPointTracker kpt = i as KillPointTracker;
                        if (kpt.RedeemedPoints >= 10000000)
 
                            master1.SendMessage(32, "You need to get another Kill Point Tracker as this one has reached the redeemed points cap!");
 
                        else
                        if (kpt.Points >= kpt.PointsCap)
 
                            master1.SendMessage( 32, "You need to redeem points or get another Kill Point Tracker as this one has reached the cap!");
 
                        else
 
            if (this is AncientWyrm || this is WhiteWyrm)
            {
                                kpt.Points+= 20;
                                kpt.TotalPt++;
                                break;
            }
            else if (this is BaseChampion || IsParagon )
            {
 
                                kpt.Points+=100;
                                kpt.TotalPt++;
                                break;
            }
            else
            {
                                kpt.Points++;
                                kpt.TotalPt++;
                                break;
            }
        }
        else
        {
 
           
                        if ( KillPointTracker.BoundTo != master1.Serial )
           
                                master1.SendMessage( 62,"This kill point tracker does not belong or is not bound to you! Therefore you recieve no points.");
 
                            }
            }
 
        }
    }
                }
                else
                {
                    foreach (Item i in from.Backpack.Items)
                    {
 
                        if (i is KillPointTracker)
                        {
                        if(KillPointTracker.BoundTo == from.Serial)
                          {
 
                        KillPointTracker kpt = i as KillPointTracker;
                        if (kpt.RedeemedPoints >= 10000000)
 
                            from.SendMessage(32, "You need to get another Kill Point Tracker as this one has reached the redeemed points cap!");
 
                        else
 
                        if (kpt.Points >= kpt.PointsCap)
 
                            from.SendMessage( 32,"You need to redeemed points or get another Kill Point Tracker as this one has reached the cap!");
 
                        else
 
            if (this is AncientWyrm || this is WhiteWyrm)
            {
                                kpt.Points+= 20;
                                kpt.TotalPt++;
                                break;
            }
            else if (this is BaseChampion || IsParagon )
            {
 
                                kpt.Points+=100;
                                kpt.TotalPt++;
                                break;
            }
            else
            {
                            kpt.Points++;
                            kpt.TotalPt++;
                            break;
                }
                  }
                  else
                  {
 
           
                                      if ( KillPointTracker.BoundTo != from.Serial )
           
                                    from.SendMessage( 62,"This kill point tracker does not belong or is not bound to you! Therefore you recieve no points.");
 
                            }
            }
        }
    }
}
#endregion
 
 
You can add different point amounts for different mobs by adding more under the else if's
like
            else if (this is BaseChampion || IsParagon )
            {
 
                                kpt.Points+=200;
                                kpt.TotalPt++;
                                break;
            }
            else if (this is Balron || this is GargoyleDestroyer || this is DemonKnight || this is Devourer )
            {
 
                                kpt.Points+=100;
                                kpt.TotalPt++;
                                break;
            }

Latest update link
[2.2] Kill Tracker Ball
 

bazspeed

Sorceror
Sorry for this, followed your instructions for updating with old kill tracker, but when starting the server it asks.

Error : type 'server.items.killpointstone' was not found. Delete all of these types?

I didnt go any further because this will mean losing the old kill trackers. Any suggestions?
 

Mortis

Knight
I thought you were only using Bittiez script.

His had no stone.

The update was made for people already using his script. I told people to wait in using mine.
As it was not completed.

From your earlier post. I was led to believe you did not use mine on your "Live" server.

Make a new copy of your "Live" server that only has Bittiez script and mod and TEST the update.
That is what I made the update for.
 

Bittiez

Sorceror
Should this part:
Code:
                        if (kpt.RedeemedPoints >= 10000000)
 
                            master1.SendMessage(32, "You need to get another Kill Point Tracker as this one has reached the redeemed points cap!");
 
                        else
                        if (kpt.Points >= kpt.PointsCap)
 
                            master1.SendMessage( 32, "You need to redeem points or get another Kill Point Tracker as this one has reached the cap!");
 
                        else

Look like this?
Code:
                        if (kpt.RedeemedPoints >= 10000000)
 
                            master1.SendMessage(32, "You need to get another Kill Point Tracker as this one has reached the redeemed points cap!");
                            break;
                        else
                        if (kpt.Points >= kpt.PointsCap)
 
                            master1.SendMessage( 32, "You need to redeem points or get another Kill Point Tracker as this one has reached the cap!");
                            break;
                        else
 

Mortis

Knight
i did just use his stone. but dont both scripts relate to the kilpointtracker?

I just looked at his script again. He does not have a stone. Just a KillPointTracker (ball).

I made the update to work for Bittiez original script only. Not my old one.
 

Mortis

Knight
Should this part:
Code:
                        if (kpt.RedeemedPoints >= 10000000)
 
                            master1.SendMessage(32, "You need to get another Kill Point Tracker as this one has reached the redeemed points cap!");
 
                        else
                        if (kpt.Points >= kpt.PointsCap)
 
                            master1.SendMessage( 32, "You need to redeem points or get another Kill Point Tracker as this one has reached the cap!");
 
                        else

Look like this?
Code:
                        if (kpt.RedeemedPoints >= 10000000)
 
                            master1.SendMessage(32, "You need to get another Kill Point Tracker as this one has reached the redeemed points cap!");
                            break;
                        else
                        if (kpt.Points >= kpt.PointsCap)
 
                            master1.SendMessage( 32, "You need to redeem points or get another Kill Point Tracker as this one has reached the cap!");
                            break;
                        else

I could. though it worked without the
Code:
break;
 

Mortis

Knight
bazspeed

Check your test server and make sure it only has Bittiez script and mod in it. Because that is what you stated before that your "Live" server was running.
 

Mortis

Knight
Well his is only 69 lines and mine was over 2000 at the time.

Anyway I am posting mine broken down to three scripts.

Maybe that will help you. Though I had no problem updating from his to mine in my finished version.

Latest update link
[2.2] Kill Tracker Ball
 

MrNice

Squire
Found a bug using a fresh install :) When you double click it and click on the button to bind it it unbinds it and when you click to unbind it, it binds it :)
 

Bittiez

Sorceror
Found a bug using a fresh install :) When you double click it and click on the button to bind it it unbinds it and when you click to unbind it, it binds it :)
The problem here is not that they are switched, its that the item name doesn't update when you bind it, and then when you un bind it it updates to the last update so it will show the name as being bound when its really not, if you log out and back in it will be fixed, I think he needs to add a invalidateproperties to when you bind and unbind it, but I'm not 100% sure if that will fix it or not.
 

bazspeed

Sorceror
Thank you Bittiez. I haver added the gump and the stone to my server, merged the killtracker scripts together using mine as the base and come up with something working using the original balls and not losing points.

I even have the rez command as well, i wasnt too concerned over the stone as i already use the customizable vendor. So thank you very much for your help.
 

Mortis

Knight
The name updates on the next doubleclick of the tracker.
I was having trouble getting it to update via gump.
Was planning on figuring it out later as it was not crucial to the system.

Anyone willing to fix that part is welcome to :rolleyes:.
 
Top