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!

Archeological system

Hammerhand

Knight
The Archeological system..by Hammerhand
Assistance by Vorspire, Thagoras, PigPen-divinity and whoever else tossed in their 2 cents. You folks kept me plugging away at it until it actually worked like I wanted. Thankyou.
Players can dig in an Archeological region (that you need to set up) for treasure from the past. It starts off as a small quest to recover the Logbook of old Archeologist John Aubrey (1626 - 1697) from a band of graverobbers. When returned, the Archeologist gives the player an Archeologists Pack containing 2 Archeological Brushes and a book to learn how to dig for artifacts. This requires 100 mining to learn.
Each of the artifacts found bears the label of "Recovered from an Archeological site", just like you would get when fishing with an SOS. All the items are deco, for display and/or sale only.
System is set to mine sand tiles only and only in the region you create. A suggested site would be near the Forgotten Pyramid in Malas.
The graverobbers are all pretty much identical in stats & title, including the leader who actually drops the Logbook. You cant tell which is the leader until you kill him/her and check the loot. And then it isnt dropped every time. I suggest spawning several graverobbers and only 1 GRLeader. The rate for getting an artifact is a bit faster than that of getting sand with an unmodified mining.cs. AKA... slightly faster than "Once in a Blue Moon" which should serve to make the artifacts rare. Should also provide hours of hearing "I cant get ANYTHING!" from your players. Archeological Brushes come with 10 uses each and are not craftable. Once the player has used them up, they need to do the quest again to get more. (ArcheologicalDigRegion not included) Requires 2 small PlayerMobile edits.

In PlayerMobile.cs / Enums
Archeology = 0x008000000,
then farther down in the Player Flags region
[CommandProperty(AccessLevel.GameMaster)]
public bool Archeology
{
get { return GetFlag(PlayerFlag.Archeology); }
set { SetFlag(PlayerFlag.Archeology, value); }
}
 

Attachments

  • ScreenHunter_02 Jul. 24 09.23.jpg
    ScreenHunter_02 Jul. 24 09.23.jpg
    20.8 KB · Views: 251
  • ScreenHunter_03 Jul. 24 09.25.jpg
    ScreenHunter_03 Jul. 24 09.25.jpg
    19 KB · Views: 221
  • ScreenHunter_04 Jul. 24 09.25.jpg
    ScreenHunter_04 Jul. 24 09.25.jpg
    17 KB · Views: 210
  • Archeological.rar
    11.1 KB · Views: 125
  • Which is the graverobber leader....jpg
    Which is the graverobber leader....jpg
    69.8 KB · Views: 222
  • Whos loot is it....jpg
    Whos loot is it....jpg
    36.9 KB · Views: 226
  • Quest giver.jpg
    Quest giver.jpg
    62 KB · Views: 196
  • Reward 1.jpg
    Reward 1.jpg
    32.5 KB · Views: 225

migzilla

Sorceror
The Archeological system..by Hammerhand
Assistance by Vorspire, Thagoras, PigPen-divinity and whoever else tossed in their 2 cents. You folks kept me plugging away at it until it actually worked like I wanted. Thankyou.
Players can dig in an Archeological region (that you need to set up) for treasure from the past. It starts off as a small quest to recover the Logbook of old Archeologist John Aubrey (1626 - 1697) from a band of graverobbers. When returned, the Archeologist gives the player an Archeologists Pack containing 2 Archeological Brushes and a book to learn how to dig for artifacts. This requires 100 mining to learn.
Each of the artifacts found bears the label of "Recovered from an Archeological site", just like you would get when fishing with an SOS. All the items are deco, for display and/or sale only.
System is set to mine sand tiles only and only in the region you create. A suggested site would be near the Forgotten Pyramid in Malas.
The graverobbers are all pretty much identical in stats & title, including the leader who actually drops the Logbook. You cant tell which is the leader until you kill him/her and check the loot. And then it isnt dropped every time. I suggest spawning several graverobbers and only 1 GRLeader. The rate for getting an artifact is a bit faster than that of getting sand with an unmodified mining.cs. AKA... slightly faster than "Once in a Blue Moon" which should serve to make the artifacts rare. Should also provide hours of hearing "I cant get ANYTHING!" from your players. Archeological Brushes come with 10 uses each and are not craftable. Once the player has used them up, they need to do the quest again to get more. (ArcheologicalDigRegion not included) Requires 2 small PlayerMobile edits.

In PlayerMobile.cs / Enums
Archeology = 0x008000000,
then farther down in the Player Flags region
[CommandProperty(AccessLevel.GameMaster)]
public bool Archeology
{
get { return GetFlag(PlayerFlag.Archeology); }
set { SetFlag(PlayerFlag.Archeology, value); }
}
I looked in the download but couldnt find instructions on how to modify a region for this system. Looks like a great system and Im anxious to get it working. Thanks!!
 

Hammerhand

Knight
I originally creating this for the server I play & staff on. Since it was done on a custom map, that region wouldnt exactly work for you.
 

Pure Insanity

Sorceror
This could be easily adapted to work work by a region's name. Then you'd be able to make a region using the regions in a box system, name it the region you need...and you'd have working digging regions. This would also allow you to add/edit/remove them without the need of a restart too.
 

Macil

Sorceror
Code:
RunUO - [www.runuo.com] Version 2.1, Build 4247.24217
Core: Running on .NET Framework Version 2.0.50727
Core: Optimizing for 4 64-bit processors
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
Errors:
 + !Customs/Archeological/Archeological Brush.cs:
    CS0234: Line 31: The type or namespace name 'ArcheologicalDigRegion' does no
t exist in the namespace 'Server.Regions' (are you missing an assembly reference
?)
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.
 

Iraq-

Sorceror
EITHER a) Hardcode the region you want in your regions.xml using an xmleditor with the region name "ArcheologicalDigRegion"
OR b) change line to this:
Code:
if (from.Region.Name == "ArcheologicalDigRegion" )
and then add a custom region in game using custom-regions-in a-box using the region name "ArcheologicalDigRegion"

And then you're done.

Another thing worth mentioning for GM's and players alike is that if your character hasn't read the ArcheologyBook, or if your character isn't GM Mining, it will simply tell you "you cannot dig there", even if it is a valid location.

I hope, Hammerhand, that you don't mind, but I think a more specific way to inform the digger would be to have a specific message for it.
If you agree, simply change the CheckHarvest method in Archeology.cs to:
Code:
        public override bool CheckHarvest(Mobile from, Item tool, HarvestDefinition def, object toHarvest)
        {
            if (!base.CheckHarvest(from, tool, def, toHarvest))
                return false;

        if ( from is PlayerMobile && !((PlayerMobile).from).Archeology ) // mod for non-read archeology book message
        {
        from.SendMessage( "You do not know how to dig for artifacts." );
        return false;
        }

      else if ( from is PlayerMobile && !( from.Skills[SkillName.Mining].Base >= 100.0 ) ) // mod for players without gm mining message
        {
        from.SendMessage( "You are not skilled enough to dig for artifacts." );
        return false;
        }

            else if (def == m_Archeological && !(from is PlayerMobile && from.Skills[SkillName.Mining].Base >= 100.0 && ((PlayerMobile)from).Archeology))
            {
                OnBadHarvestTarget(from, tool, toHarvest);
                return false;
            }
            else if (from.Mounted)
            {
                from.SendLocalizedMessage(501864); // You can't mine while riding.
                return false;
            }
            else if (from.IsBodyMod && !from.Body.IsHuman)
            {
                from.SendLocalizedMessage(501865); // You can't mine while polymorphed.
                return false;
            }

            return true;
        }

You can also remove the region restriction all together to allow players to dig in sand anywhere, by simply removing the region check and the fail message in ArcheologyBrush.cs's OnDoubleClick override method. Although, it brings players together if they have to be in the same few, scattered locations, IMO.
 

Macil

Sorceror
Okay I got this working by removing the entire reference to the regions since I have no clue how to set that up. First of all, great quest! I love it. Its simple, fun, rewarding, good quest conversation. But I do see a bit of an issue with the archeology part of it. Although it is pretty challenging to take down the grave robbers and their leader to complete the quest to obtain the tools to begin digging. Its way too easy to actually dig up artifacts. Might I suggest making some danger in doing this? Perhaps a random chance of disturbing ancient spirits? Maybe a Scorpion here or there? Or even a Mummy?

Also, 1 in 1 chance on dig is kind of cheap. Throw in some worthless items as rewards like maybe some sand (not even usable sand, just like the scattered hay graphic renamed so its literally useless), or some sea shells. Or even entire failures where you dig up nothing. I think the monsters and some fail chances would perfect this system.

Also more documentation on setting it up is absolutely needed. I don't think the average Joe is going to have an easy time setting this up. :-/

All in all fantastic. I love it so far. =)
 

Iraq-

Sorceror
As for the ease of unavailing an artifact... In Archeology.cs simply change:
Code:
res = new HarvestResource[]
{
        new HarvestResource( 100.0, 70.0, 200.0, "You find an artifact and put it in your backpack", typeof (Archeological) )
};

to

Code:
res = new HarvestResource[]
{
        new HarvestResource( 99.0, 95.0, 139.0, "You find an artifact and put it in your backpack", typeof (Archeological) )
};

(This comes out to 4% chance... 99-95 = 4. 195-95 = 100. 4/100 = 4%)
99.0 = RequiredSkill
95.0 = MinSkill
195.0 = MaxSkill

To increase the difficulty, raise the 95.0 (not to exceed the RequiredSkill) and 195.0.
 

Iraq-

Sorceror
For chance of digging up monsters and rarer artifacts.

Get this:
 

Attachments

  • Archeology.cs
    9.4 KB · Views: 43

Hammerhand

Knight
Also, 1 in 1 chance on dig is kind of cheap.
I just tested the chance of getting artis at 120, 150, 175 and 200 mining skill. The only one that got a "1 in 1" chance was the 200 skill. If your server runs that high, raise the 200 to 400 in the Archeology script.
 

Macil

Sorceror
Oh my god. LOL. I feel so goofy now. I was testing this on my Admin who had like 5000 mining haha. TOTALLY slipped my mind! XD

Sorry about that, in that case then monsters were my only concern heh.
 

Iraq-

Sorceror
Judging from the tidbit of code left in place by Hammerhand, the monster creation USED to be a part of the system, it was really easy to simply add that back in, as there is already the method created for it (though it's not used atm)
 

Hammerhand

Knight
Testing your monster addin Iraq....
*Edit* No monsters spawned at all. Went thru a brush, gained 10 artifacts & no critters.

Oh, and Macil? 5000 mining? All I can say to that is [CENSORED]! lol No wonder you got a 1 in 1. *sigh* lol
 

milva

Sorceror
haaa that is pretty high mining ;) Ok for anyone wanting to add a "new region" in Regions.Xml
Open runuo folder- then open Data Folder----next open Regions.xml script
Look for the area where you plan to add your region-being Tram or Fel or Malas
You can add your code as this- "but with the cords you have figured for the area to be able
to dig in. You can play with the cords which you set and test in game easy enough to see
if the area is large enough or to large for what you need.
***Example below**
This will take a server restart!
</region>
- <region type="ArcheologyDigRegion" priority="50" name="Archeology Dig Region">
<music name="Nujelm" />
<guards disabled="true" />
<zrange min="0" />
- <region>
<rect x="3783" y="1017" width="200" height="200" />
<rect x="3767" y="945" width="200" height="200" />
<rect x="3907" y="1026" width="200" height="200" />
<rect x="3903" y="1017" width="200" height="200" />
<zrange min="-20" />
<go x="3834" y="967" z="0" />
<logoutDelay active="false" />
</region>
--------------------
With the script which I'm posting- you can add this in your custom folder- basically this script defines
the region which you have set up, it will either allow marking or not- housing or not- Sacred Journey
or not... you can change the name of this script and the names inside the script to match your region.
 

Attachments

  • MyCustomRegionArcheology.cs
    2 KB · Views: 32

Iraq-

Sorceror
Testing your monster addin Iraq....
*Edit* No monsters spawned at all. Went thru a brush, gained 10 artifacts & no critters.

Code:
if (Utility.RandomDouble() < 0.15 )
It's set to 15% to spawn a monster, this number can be easily modified.
Removing this line is 1:1 monster spawn:brush stroke.

Since failing doesn't use a use while mining in the mining harvest system, and this was based off that, failing here doesn't use any uses on your brush. Therefore, you'll always get 10 artifacts with 1 shovel... it just depends how many times you "fail to dig up any treasure" before you do so. (can be changed if desired by simply removing a use after each stroke from the brush...)

Another bug with the way things are currently is that you can remain hidden and dig.
You should add
Code:
from.RevealingAction();
into the OnHarvestStarted method of Archeology.cs as well.

The monsters spawn in the same manner an elemental would spawn when using a gargoyal's pickaxe.
 
Top