JBob

Member
I was wondering where i could edit how the loyalty system gives exp to the player. I was hoping to try to make it so it gives exp in trammel and felucca for monster kills.

I'm still not even sure how this new system works or where to find it in the scripts. All i see for it is in playermobile.

Situation Update:--------------------------------------

I was able to find some sections in PlayerMobile.cs but I'm still not sure how its applied. Where do i have to be to get the exp or what do i have to kill. Still a little fuzzy on what this system actually applies to.

Second Update:--------------------------------------
I went into more detail with my version of getting loyatly points.

More Detailed Code
 
Last edited:
In honesty the Queen's Loyalty in distro servuo is actually from OrbUO and it's not complete,.. in fact it's not even osi/ea accurate and can cause issues with you save games if you remove its code.

All the queen's loyalty locations in playermobile.cs should be marked with #region QueensLoyaltySystem
The display title is marked with // Xml spawner 3.26c QueensLoyaltyTitle near the bottom of the 5th region

There are SA quests that grant the exp,. but again they're not ea/osi accurate or don't even grant the exp.
for instance in some of the scripts in ...scripts\Quests\SA... you'll see things like // ((PlayerMobile)Owner).Exp += 100;
Example: Scripts\Quests\SA TerMur Axem The Curator Quests\Axem.cs

It is an issue I've brought up with the dev's but they continue to ignore its critical status. Maybe if more people make a stink about it.
 
Last edited by a moderator:
Hank, watch your mouth. I dont wanna hear the word Orb, Orbsydia or otherwise ever again! o_O
 
I know its not what your looking for but around line 4276 in playermobile

If you comment out the #QueensLoyaltySystem like below it will remove the annoying part under player names
Code:
/*
				#region QueensLoyaltySystem
				if (m_Exp >= m_LevelExp)
				{
					while (m_Exp >= m_LevelExp)
					{
						m_Exp -= m_LevelExp;
						m_Level += 1;
						m_LevelExp = (long)(1000 * (Math.Pow(1.4, m_Level)));
					}
				}

				if (m_Exp < 0)
				{
					while (m_Exp < 0)
					{
						if (m_Level == 0)
						{
							m_Exp = 0;
						}
						else
						{
							m_LevelExp = (long)(1000 * (Math.Pow(1.4, m_Level - 1)));
							m_Exp += (m_LevelExp);
							m_Level -= 1;
						}
					}
				}

				m_LevelExp = (long)(1000 * (Math.Pow(1.4, m_Level)));
				if (m_Level == 0)
				{
					m_ExpTitle = "TerMur-guest";
				}
				else if (m_Level >= 1 && m_Level <= 5)
				{
					m_ExpTitle = "Friend of TerMur";
				}
				else if (m_Level >= 6 && m_Level <= 10)
				{
					m_ExpTitle = "Friend of TerMur";
				}
				else if (m_Level >= 11 && m_Level <= 15)
				{
					m_ExpTitle = "Friend of TerMur";
				}
				else if (m_Level >= 16 && m_Level <= 20)
				{
					m_ExpTitle = "Friend of TerMur";
				}
				else if (m_Level >= 21 && m_Level <= 25)
				{
					m_ExpTitle = "Friend of TerMur";
				}
				else if (m_Level >= 26 && m_Level <= 30)
				{
					m_ExpTitle = "A Citizen of TerMur";
				}
				else if (m_Level >= 31 && m_Level <= 35)
				{
					m_ExpTitle = "A Citizen of TerMur";
				}
				else if (m_Level >= 36 && m_Level <= 40)
				{
					m_ExpTitle = "A Citizen of TerMur";
				}
				else if (m_Level >= 41 && m_Level <= 45)
				{
					m_ExpTitle = "A Citizen of TerMur";
				}
				else if (m_Level >= 46 && m_Level <= 50)
				{
					m_ExpTitle = "A Citizen of TerMur";
				}
				else if (m_Level >= 51 && m_Level <= 60)
				{
					m_ExpTitle = "A Citizen of TerMur";
				}
				else if (m_Level >= 61 && m_Level <= 70)
				{
					m_ExpTitle = "A Noble of Termur";
				}
				else if (m_Level >= 71 && m_Level <= 80)
				{
					m_ExpTitle = "A Noble of Termur";
				}
				else if (m_Level >= 80 && m_Level <= 100)
				{
					m_ExpTitle = "A Noble of Termur";
				}
				else if (m_Level >= 101)
				{
					m_ExpTitle = "A Noble of Termur";
				}

				// Xml spawner 3.26c QueensLoyaltyTitle
				XmlData QueenTitle = (XmlData)XmlAttach.FindAttachment(this, typeof(XmlData), "QueenTitle");

				if (QueenTitle != null && QueenTitle.Data == "True")
				{
					return;
				}
				else
				{
					list.Add(
						String.Concat(
							"Queens Loyalty Level: ",
							String.Format("<BASEFONT COLOR={0}>{1}", "#FF0000", m_Level),
							"  ",
							String.Format("<BASEFONT COLOR={0}>{1}", "#000FFF", (int)(100 * m_Exp / m_LevelExp)),
							" %  ",
							String.Format("<BASEFONT COLOR={0}>{1}", "#0FFF00", m_ExpTitle)));
					InvalidateMyRunUO();
				}
				// Xml Spawner 3.26c QueensLoyaltyTitle
				#endregion
                  */
 
Thanks, I'm still interested in using it as a level system. I was thinking about doing something in certain monsters to give exp also. Still doing the thinking of what i want to do with it part now that i have a better understanding with what it does.

I really appreciate the info on the matter.
 
UPDATE:
I was able to get a monster to give me Exp when i killed it.
Add the below code to a Monster to get Exp on it's Death

C#:
        public override void OnDeath(Container c)
		{
			/* Give Queens Loyalty Points Start*/
			if (LastKiller is PlayerMobile)
			{
				((PlayerMobile)LastKiller).Exp += 50;/* 10 = 1 Loyalty Point */
				LastKiller.SendMessage("You have been awarded 5 Loyalty Points for killing a Lumyrian Foe!");
			}
			/* Give Queens Loyalty Points End*/
			base.OnDeath( c );	
		}
 
I think you'd be better served to do that inside the BaseCreature, as you won't have to add it to each one.

Then you run into decided how much each creature is worth. Most exp/token systems use fame and/or karma.
 
After i got this portion of the code to work for me, I was thinking about putting it in BaseCreature.
But then EVERY BaseCreature will get the points to hand out. I would have to find a way to only give the points only to creatures that are aggressive.

I'll look into it in about an hour... Gotta mow the lawn.
 
@Hank, I was just joking around man..

JBob, you might just make it a property in BaseCreature that null, and then call it within whatever Creature script that has the loyalty points, and how many.
 
Here is some simple code i wrote up that does almost what i want it to.
I put this code in BaseCreature.cs
This code will determine what creature gets to give a Loyalty Point.
I still have to go into depth with it figuring out the points per karma ratio
C#:
/* Loyalty Points Start */
				if (LastKiller is PlayerMobile)
				{
					if ( (this.FightMode != FightMode.Aggressor) && (this.Karma <= -1) )
					{
							((PlayerMobile)LastKiller).Exp += 10;/* 10 = 1 Loyalty Point */
							LastKiller.SendMessage("You have been awarded 1 Loyalty Point for killing an enemy of the Queen!");
					}
				}
/* Loyalty Points End */

I put the above code near the end of the OnDeath method.
C#:
					for (int i = 0; i < titles.Count; ++i)
					{
						Titles.AwardFame(titles[i], fame[i], true);
						Titles.AwardKarma(titles[i], karma[i], true);
					}
				}
				
/* Loyalty Points Start */
				//Insert Above Code Here.
/* Loyalty Points End */

				base.OnDeath(c);

				if (DeleteCorpseOnDeath)
				{
					c.Delete();
				}

Just for the heck of it i added a little somthing to my BaseCreature to give the players a heads up on what will give Loyalty Points.
C#:
/* Loyalty Points Name Property Start */
		public override void GetProperties(ObjectPropertyList list)
		{
			base.GetProperties(list);
			if ((this.FightMode != FightMode.Aggressor) && (this.Karma <= -1))
			{
				list.Add( String.Concat( "Queen's Foe" ));//Shows under name so players know what gives Loyalty Points.
			}
		}
/* Loyalty Points Name Property End */

(Place this code right under the Ondeath Method)
C#:
				base.OnDeath(c);

				if (DeleteCorpseOnDeath)
				{
					c.Delete();
				}
			}
		}
/* Loyalty Points Name Property Start */
		//Insert Above Code Here.
/* Loyalty Points Name Property End */

If you have any more suggestions let me know.
This is Just the Basic setup I have,I'm still working on this to get it all good.
 
Last edited:
Thanks I totally forgot about that.

Still working on this part of the code...
C#:
/* Loyalty Points Start */
				if ( LastKiller is PlayerMobile )
				{
					if ( (this.Controlled != false) || (this.Summoned != false) )
					{
						return;
					}
					else if ( this.FightMode != FightMode.Aggressor )
					{//Should i start from -15000 karma and go down to lowest negative karma?
						if ( this.Karma <= -1 )
						{
								((PlayerMobile)LastKiller).Exp += 10;//10=1 Point
								LastKiller.SendMessage("You have been awarded 1 Loyalty Point for killing an enemy of the Queen!");
						}
						/*else if ( this.Karma <= -1999 )
						{
								((PlayerMobile)LastKiller).Exp += 20;
								LastKiller.SendMessage("You have been awarded 2 Loyalty Point for killing an enemy of the Queen!");
						}*/
					}
				}
/* Loyalty Points End */
The above code is now just the basics.
--------------------------------------------------
The below code goes into more detail.

C#:
/* Loyalty Points Start */
				if (LastKiller is PlayerMobile)
				{
					if ( (this.Controlled != false) || (this.Summoned != false) )
					{
						return;
					}
					else if ( this.FightMode != FightMode.Aggressor ) 
					{
						if ( (this.Karma <= -12001) && (this.Karma >= -15001) )
						{
								((PlayerMobile)LastKiller).Exp += 60;/* 10 = 1 Loyalty Point */
								LastKiller.SendMessage("You have been awarded 6 Loyalty Points for killing an enemy of the Queen!");
						}
						else if ( (this.Karma <= -8001) && (this.Karma >= -12000) )
						{
								((PlayerMobile)LastKiller).Exp += 50;
								LastKiller.SendMessage("You have been awarded 5 Loyalty Points for killing an enemy of the Queen!");
						}
						else if ( (this.Karma <= -4001) && (this.Karma >= -8000) )
						{
								((PlayerMobile)LastKiller).Exp += 40;
								LastKiller.SendMessage("You have been awarded 4 Loyalty Points for killing an enemy of the Queen!");
						}
						else if ( (this.Karma <= -2001) && (this.Karma >= -4000) )
						{
								((PlayerMobile)LastKiller).Exp += 30;
								LastKiller.SendMessage("You have been awarded 3 Loyalty Points for killing an enemy of the Queen!");
						}
						else if ( (this.Karma <= -501) && (this.Karma >= -2000) )
						{
								((PlayerMobile)LastKiller).Exp += 20;
								LastKiller.SendMessage("You have been awarded 2 Loyalty Point for killing an enemy of the Queen!");
						}
						else if ( this.Karma <= -1 )
						{
								((PlayerMobile)LastKiller).Exp += 10;
								LastKiller.SendMessage("You have been awarded 1 Loyalty Point for killing an enemy of the Queen!");
						}
					}
				}
/* Loyalty Points End */
Above code may need refining.
C#:
/* Loyalty Points Name Property Start */
		public override void GetProperties(ObjectPropertyList list)
		{
			base.GetProperties(list);
			if ( (this.Controlled != false) || (this.Summoned != false) )
			{
				return;
			}
			else if ( (this.FightMode != FightMode.Aggressor) && (this.Karma <= -1) )//anything that attacks on its own and has negative karma
			{
				list.Add( String.Concat( "Queen's Foe" ));//Shows under name so players know what gives Loyalty Points.
			}
		}
/* Loyalty Points Name Property End */
 
Last edited:

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back