#W# TreasureMaps: Maps now have there own gump. Level 6 maps are locked behind power scrolls. Need a min of 100.1 to attempt them.
This commit is contained in:
parent
c789630cd5
commit
555806150f
7 changed files with 116 additions and 202 deletions
|
|
@ -8,6 +8,7 @@ using Server.Engines.Harvest;
|
|||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Items;
|
||||
|
||||
|
|
@ -63,7 +64,7 @@ public partial class TreasureMap : MapItem
|
|||
public TreasureMap(int level, Map map)
|
||||
{
|
||||
_level = level;
|
||||
_chestMap = map;
|
||||
_chestMap = Map.Trammel; //map;
|
||||
|
||||
_chestLocation = level == 0 ? GetRandomHavenLocation() : GetRandomLocation();
|
||||
|
||||
|
|
@ -377,7 +378,7 @@ public partial class TreasureMap : MapItem
|
|||
3 => 51.0,
|
||||
4 => 61.0,
|
||||
5 => 70.0,
|
||||
6 => 70.0,
|
||||
6 => 100.1,
|
||||
_ => 0.0
|
||||
};
|
||||
}
|
||||
|
|
@ -452,7 +453,11 @@ public partial class TreasureMap : MapItem
|
|||
}
|
||||
|
||||
from.PlaySound(0x249);
|
||||
base.DisplayTo(from);
|
||||
if (from is PlayerMobile pm)
|
||||
{
|
||||
pm.CloseGump<TreasureLocationGump>();
|
||||
pm.SendGump(new TreasureLocationGump(_level, ChestLocation, _chestMap));
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, ref PooledRefList<ContextMenuEntry> list)
|
||||
|
|
|
|||
|
|
@ -118,14 +118,39 @@ public partial class Lockpick : Item
|
|||
return;
|
||||
}
|
||||
|
||||
if (_from.Skills.Lockpicking.Value < _item.RequiredSkill)
|
||||
// 1. Fetch default lock values (used for doors, house locks, standard crates)
|
||||
double minSkill = _item.LockLevel;
|
||||
double maxSkill = _item.MaxLockLevel;
|
||||
double reqSkill = _item.RequiredSkill;
|
||||
|
||||
// 2. Intercept TreasureMapChest to apply our custom tier math
|
||||
if (_item is TreasureMapChest tmChest)
|
||||
{
|
||||
// The LockLevel is higher thant the LockPicking of the player
|
||||
minSkill = tmChest.Level switch
|
||||
{
|
||||
1 => 15.0,
|
||||
2 => 35.0,
|
||||
3 => 55.0,
|
||||
4 => 75.0,
|
||||
5 => 90.0,
|
||||
6 => 100.1, // Requires Lockpicking Power Scroll
|
||||
_ => tmChest.Level * 16.7
|
||||
};
|
||||
|
||||
reqSkill = minSkill; // Sets the floor so they can't even attempt it if too low
|
||||
maxSkill = minSkill + 25.0;
|
||||
}
|
||||
|
||||
// 3. Apply the dynamic required skill
|
||||
if (_from.Skills.Lockpicking.Value < reqSkill)
|
||||
{
|
||||
// The LockLevel is higher than the LockPicking of the player
|
||||
item.SendLocalizedMessageTo(_from, 502072); // You don't see how that lock can be manipulated.
|
||||
return;
|
||||
}
|
||||
|
||||
if (_from.CheckTargetSkill(SkillName.Lockpicking, _item, _item.LockLevel, _item.MaxLockLevel))
|
||||
// 4. Roll the dice using the dynamic min/max variables
|
||||
if (_from.CheckTargetSkill(SkillName.Lockpicking, _item, minSkill, maxSkill))
|
||||
{
|
||||
// Success! Pick the lock!
|
||||
item.SendLocalizedMessageTo(_from, 502076); // The lock quickly yields to your skill.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue