@@ -1337,6 +1337,53 @@ public override void OnUse(Sprite sprite, byte slot)
13371337 return ;
13381338 }
13391339
1340+ client . SendServerMessage ( ServerMessageType . ActiveMessage , "{=bIt's Locked!" ) ;
1341+ return ;
1342+ }
1343+ case "Bahamut's Treasure Chest" :
1344+ {
1345+ if ( aisling . HasItem ( "Copper Lockpick" ) )
1346+ {
1347+ var chance = Generator . RandomPercentPrecise ( ) ;
1348+
1349+ if ( chance <= .80 )
1350+ {
1351+ client . SendServerMessage ( ServerMessageType . ActiveMessage , "{=qClick! Nice, it opened!" ) ;
1352+ client . Aisling . SendTargetedClientMethod ( PlayerScope . NearbyAislings , c => c . SendSound ( 132 , false ) ) ;
1353+ client . Aisling . GiveGold ( ( uint ) Random . Shared . Next ( 5000000 , 10000000 ) ) ;
1354+
1355+ var rand = Generator . RandomPercentPrecise ( ) ;
1356+ var stockingItem = new Item ( ) ;
1357+ var quality = ItemQualityVariance . DetermineQuality ( ) ;
1358+ var variance = ItemQualityVariance . DetermineVariance ( ) ;
1359+ var wVariance = ItemQualityVariance . DetermineWeaponVariance ( ) ;
1360+
1361+ stockingItem = rand switch
1362+ {
1363+ > 0 and <= 0.20 => stockingItem . Create ( aisling , "Excalibur" , quality , variance ,
1364+ wVariance ) ,
1365+ > 0.20 and <= 0.40 => stockingItem . Create ( aisling , "Slick Shades" , quality , variance ,
1366+ wVariance ) ,
1367+ > 0.40 and <= 0.60 => stockingItem . Create ( aisling , "Bahamut's Blood Ruby Eye" , quality , variance ,
1368+ wVariance ) ,
1369+ > 0.60 and <= 0.80 => stockingItem . Create ( aisling , "Bahamut's Blood Ruby Eye" , quality , variance ,
1370+ wVariance ) ,
1371+ > 0.80 => stockingItem . Create ( aisling , "Obsidian" , quality , variance ,
1372+ wVariance ) ,
1373+ _ => stockingItem
1374+ } ;
1375+
1376+ stockingItem . GiveTo ( client . Aisling ) ;
1377+ client . Aisling . Inventory . RemoveFromInventory ( client , Item ) ;
1378+ return ;
1379+ }
1380+
1381+ var lockpick = aisling . HasItemReturnItem ( "Copper Lockpick" ) ;
1382+ aisling . Inventory . RemoveRange ( client , lockpick , 1 ) ;
1383+ client . SendServerMessage ( ServerMessageType . ActiveMessage , "{=bLockpick snapped!" ) ;
1384+ return ;
1385+ }
1386+
13401387 client . SendServerMessage ( ServerMessageType . ActiveMessage , "{=bIt's Locked!" ) ;
13411388 return ;
13421389 }
0 commit comments