APPROVED: Epic gems (armor upgrade system) -

Locked
User avatar
OldManAlewar
Legendary Scribe
Posts: 408
Joined: Sun Jan 06, 2008 3:42 pm

APPROVED: Epic gems (armor upgrade system) -

Post by OldManAlewar »

Finally, it is done.

Here you have it Colibri, my submition for an armor upgrade system. (code in attachment)


Some minor additional instructions needed

add basic getters and setters to BaseArmor.cs

Code: Select all

  public AosAttributes getAttributes()
        {
            return this.m_AosAttributes;
        }

        public void setAttributes(AosAttributes newAttributes)
        {
            this.m_AosAttributes = newAttributes;
        }



        public AosArmorAttributes getArmorAttributes() 
        {
            return m_AosArmorAttributes;
        }


        public void setArmorAttributes(AosArmorAttributes newAttributes)
        {
            this.m_AosArmorAttributes = newAttributes;
        }



also, ive used silver as primary cost to the crafted gems, you may want to use tokens or ElvenNotes
in DefEpic.cs (in my code, privided as attachment)

the entry example below has a cost of 25 SIlver

Code: Select all

epicIngredients(index);
			index = AddCraft( typeof( EpicGemOfTheElves), "Epic Gems", "Gem of the Elves", 110.5, 115.5, typeof( Silver ), 1044572, 25, 1044253 );	
i've included a function that adds a standard set of ingredients with one function call, you can tweak this to your liking.

Code: Select all

/// <summary>
		/// Since i call this after every entry here you can define the 'standard' cost of an epic gem
        /// you can alway add more under individual entries in the menu by hand, for the very special customs.
		/// </summary>
		/// <param name="index"></param>
		private void epicIngredients(int index)
		{
			AddRes( index, typeof( rawEpicGem ), "Unworked epic gems", 1, "Insufficient materials" );
			AddRes( index, typeof( IronIngot ), 1044036, 10, 1044037 );
			AddRes( index, typeof( MithrilIngot ), "a single bar of Mithril", 1, "Insufficient materials" );
			AddSkill( index, SkillName.Magery, 110.5, 115.5 );
		}


The Quest
Somewhere in trammel is an epic tinker, a crafter of enhancement gems that add powerfull abilities to armors. But before he will show you, and provide the necicary tools (a toolkit) you must defeat three challengers, a knight, an archer, and a mage, of considerable power.

once all three are defeated, Bob the epic tinker will hand you the tools. now to gather the parts for crafting ...

Crafting
works like normal crafting, the tool has a menu with items to craft. when crafted you will have a gem that can be applied like an arcane gem, but works on all materials and armor types, as long as it *is* armor.

Most gems ive supplied as examples give a mix of abilities to an armor, for example, a "gem of the dwarves" wil add self repair, strength and stamina bonusses.
Attachments
Epic Gems.zip
(19.67 KiB) Downloaded 331 times
User avatar
OldManAlewar
Legendary Scribe
Posts: 408
Joined: Sun Jan 06, 2008 3:42 pm

Re: APPROVED: Epic gems (armor upgrade system) -

Post by OldManAlewar »

P.S. the raw uncut gems arent provided by the NPC or monsters, you get to decide how/where people get them. (loot, auctions, etc )

(ration them sparesely, or people will go bat crazy :D )

nice way is waybe to make them a vet reward (i have 19 points left >:D )
Last edited by OldManAlewar on Sat Nov 15, 2008 1:14 pm, edited 1 time in total.
Lyandrin
Elder Scribe
Posts: 136
Joined: Mon Sep 08, 2008 3:40 am
Location: Stockholm, Sweden
Contact:

Re: APPROVED: Epic gems (armor upgrade system) -

Post by Lyandrin »

is this added ingame already?
User avatar
+Colibri
Administrator
Posts: 4073
Joined: Sat Feb 25, 2006 4:08 pm
Location: static void Main

Re: APPROVED: Epic gems (armor upgrade system) -

Post by +Colibri »

Not yet.
+Colibri, Administrator of UO Excelsior Shard

Don't know what the purpose of your life is? Well then make something up! ;)
(Old Colibrian proverb)
Lyandrin
Elder Scribe
Posts: 136
Joined: Mon Sep 08, 2008 3:40 am
Location: Stockholm, Sweden
Contact:

Re: APPROVED: Epic gems (armor upgrade system) -

Post by Lyandrin »

waiting then :)
User avatar
OldManAlewar
Legendary Scribe
Posts: 408
Joined: Sun Jan 06, 2008 3:42 pm

Re: APPROVED: Epic gems (armor upgrade system) -

Post by OldManAlewar »

note to the wise:

* did you remember to test the set-suits with the gems ?
Llexa
Legendary Scribe
Posts: 294
Joined: Mon May 08, 2006 3:42 pm

Re: APPROVED: Epic gems (armor upgrade system) -

Post by Llexa »

you do realize this is basically spellcrafting.... and when a shard has spellcrafting, they dont have runic crafting too, lol. Just a note :wink:

love,
Llexa
"We push and we push away,
For fear of facing our mistakes.
So we call it judgment,
And watch our friends, our world, ourselves... go comatose, inside."
User avatar
OldManAlewar
Legendary Scribe
Posts: 408
Joined: Sun Jan 06, 2008 3:42 pm

Re: APPROVED: Epic gems (armor upgrade system) -

Post by OldManAlewar »

well, this is a LOT more expensive (mithril bars are involved) , and the inflow of raw materials isnt controlled by the quest, only the toolkit to make it.
basically only people who are already millionaires can do this, and at the expense of a mill per armorpiece, per upgrade.

coli has absolute control on raw uncut gems, and how they come in game. and runic gear is still in new people's price range :)
User avatar
OldManAlewar
Legendary Scribe
Posts: 408
Joined: Sun Jan 06, 2008 3:42 pm

Re: APPROVED: Epic gems (armor upgrade system) -

Post by OldManAlewar »

BUMP for ETA ? ( i know you're busy and all :P )
User avatar
+Colibri
Administrator
Posts: 4073
Joined: Sat Feb 25, 2006 4:08 pm
Location: static void Main

Re: APPROVED: Epic gems (armor upgrade system) -

Post by +Colibri »

Just spent some time looking at how it works. I will defenately have to put caps on that, since over time you can get some really uber armor.

Would be much cleaner if you used account tags to mark the quest, but the marker you made is still very nicely coded. I've however changed the itemid to something smaller, set movable=true (the loottype.blessed will make sure it doesn't go away), also set TotalItems = -1, which will make sure that if you have an empty backpack it will actually say 0 items (the marker counts as 1 item, and it has "-1" subitems (not really, but runuo will never know :lol:), so +1-1=0).

How about if i make the spawn area larger?
Also, how would this work if 2 or 3 people wanted to do the quest at once? There would fro example be 3 knights out there, and would the players just have to try kill eachone until they see which one doesn't respawn?


Here's what i changed so far

Code: Select all

		public EpicTinkerMarker() : base ( 0xF24) // base(0x176B)
        {
            Weight = 0;
            Name = "EpicTinkerMarker";
            Hue = 0;
            pm_counter = 0;
            pm_state = EpicTinkerState.ONE;
            LootType = LootType.Blessed;            
            Visible = false;
			TotalItems = -1;
            markTimer = new MarkerTimer(this);
            markTimer.Start();
        }
Also this (if you dont have errors.report in your Server namespace just replace with console.writeline)
This is because if the ontick happens just as the world is saving, you're in trouble mister :D (already crashed the shard once with that)

Code: Select all

				try
				{
					m_Marker.Delete();  // kill the marker after 7 days (timespan.fromdays)
                }
				catch {
					Errors.Report("EpicTinkerMarker.MarkerTimer.OnTick cannot delete marker");
				}
If you wonder why there's so many other .Delete() in the scripts, it's usually because that Delete() gets triggered on user action. And when the world is saving, messagepump gets paused so basically it's impossible to get anyone to trigger that delete() while it's saving.


Buuuuttt... this is not done very right. Consider this: A player gets a marker that will get deleted after 7 days. We restart the shard after 3 days. The timer never gets started again. If you want you can recode this, if not i will. It needs to be made so that the time when it should be deleted gets stored on the marker, then you try to delete it for example after the world has saved (not during, that wouldnt work).



O and :) this isnt really important, but i find it funny:

Code: Select all

 if ( obj is BaseArmor && obj != null)	// is this actually an armor ?
            {
                ....
                    if (item is BaseArmor)	// check again if the Item is TRULY an armor
                    {
In case obj is null, you will first call "obj is BaseArmor" which will crash. Whenever you have:
if ( A() && B() && C() ) then it will first call A(), if true then it will call B(), and if that also succeeds then C().
If you have an: if( A() || B() || C() ) then it will first call A(), and if that doesn't succeed it will call B(), and so on.

So the upper code should be:

Code: Select all

 if ( obj != null && obj is BaseArmor )	// is this actually an armor ?
            {
                we get to this part only if obj is BaseArmor. The below branch would always succeed.
                ....
                    // not needed if (item is BaseArmor)	// check again if the Item is TRULY an armor
                    {

As for the ETA, i got 4 sites on my hands right now and a 5th one wants me to make his so ... since the caps need to be put in i wouldn't count on it very soon. Maybe if i just copy paste this to the test shard for now, just as a preview and for opinions?
+Colibri, Administrator of UO Excelsior Shard

Don't know what the purpose of your life is? Well then make something up! ;)
(Old Colibrian proverb)
User avatar
OldManAlewar
Legendary Scribe
Posts: 408
Joined: Sun Jan 06, 2008 3:42 pm

Re: APPROVED: Epic gems (armor upgrade system) -

Post by OldManAlewar »

Also, how would this work if 2 or 3 people wanted to do the quest at once? There would fro example be 3 knights out there, and would the players just have to try kill eachone until they see which one doesn't respawn?
whoever makes the final slow (the kill) will get their marker "one upped"

theoretically you could cheat the system by having two mates also summon a knight, and kill them all (the cheat being: the knight is easier to kill, and not a paragon), but the mates would be stuck on the quest for a week, untill their marker decays. (easily fixed by an 'if is Knight' and so on as a check on every kill step)

if they do summon 3 at once, considering the speed at which these guys move, murder will ensue, and most likely unless they have 100 stealth they will be griefed out of their equipment by an NPC Res-killing party.

Also this (if you dont have errors.report in your Server namespace just replace with console.writeline)
This is because if the ontick happens just as the world is saving, you're in trouble mister :D (already crashed the shard once with that)
yeah, thats the kind of things you find out after running a server for years, i had no clue about that :D
Consider this: A player gets a marker that will get deleted after 7 days. We restart the shard after 3 days. The timer never gets started again. If you want you can recode this, if not i will. It needs to be made so that the time when it should be deleted gets stored on the marker, then you try to delete it for example after the world has saved (not during, that wouldnt work).
as far as i understood it will check if teh date has passed on the next ServerSave and delete it anyway :)

since you're already doing edits my code is now less 'fresh' than yours :) and its basically trivial stuff :)
i humblysuggest you do it, especially with the part that might crash the shard.
(wich is hard to achieve, they would have to receive the marker exactly DURING a save... which is rare ^_^)
As for the ETA, i got 4 sites on my hands right now and a 5th one wants me to make his so ... since the caps need to be put in i wouldn't count on it very soon. Maybe if i just copy paste this to the test shard for now, just as a preview and for opinions?
i would love to find out if i can even handle my own creations:D and i'm sure the rest of the shard would LOVE a preview too :)
even if there isn't yet a cap.just to see how the system works
Locked