Overwrite

Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
Unstable Kitsune
2023-11-28 23:20:26 -05:00
parent 3cd54811de
commit b918192e4e
11608 changed files with 2644205 additions and 47 deletions

View File

@@ -0,0 +1,57 @@
using System;
using Server;
namespace Server.Items
{
public class PSCredits : Item
{
[Constructable]
public PSCredits() : this( 1 )
{
}
[Constructable]
public PSCredits( int amountFrom, int amountTo ) : this( Utility.RandomMinMax( amountFrom, amountTo ) )
{
}
[Constructable]
public PSCredits( int amount ) : base( 0xF8E )
{
Stackable = true;
Name = "Powerscroll Credits";
Hue = 1153;
Weight = 0;
LootType = LootType.Blessed;
Amount = amount;
}
public PSCredits( Serial serial ) : base( serial )
{
}
public override int GetDropSound()
{
if ( Amount <= 1 )
return 0x2E4;
else if ( Amount <= 5 )
return 0x2E5;
else
return 0x2E6;
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,124 @@
using System;
using Server;
using Server.Gumps;
using Server.Network;
using Server.Commands;
using Server.Items;
using Server.Engines.CannedEvil;
namespace Server.Gumps
{
public class PSCreditsGump : Gump
{
public PSCreditsGump() : base( 0, 0 )
{
this.Closable=true;
this.Disposable=true;
this.Dragable=true;
this.Resizable=false;
AddPage(0);
AddBackground(1, 0, 789, 382, 9200);
AddLabel(251, 18, 39, @"Powerscroll Exchange System");
AddItem(522, 11, 5360, 1153);
AddHtml( 449, 94, 285, 256, @"Welcome to the Powerscroll Exchange System. You may close this gump, and drop powerscrolls on the barrel to obtain Powerscroll Credits. These credits may be used on this menu to buy better Powerscrolls. The scroll you buy will be a random skill.", (bool)true, (bool)true);
AddButton(24, 122, 247, 248, 1, GumpButtonType.Reply, 0);
AddButton(23, 158, 247, 248, 2, GumpButtonType.Reply, 0);
AddButton(24, 193, 247, 248, 3, GumpButtonType.Reply, 0);
AddLabel(84, 76, 1171, @"Purchase Scrolls");
AddLabel(104, 123, 0, @"110 Powerscroll (10 Credits)");
AddLabel(105, 157, 0, @"115 Powerscroll (100 Credits)");
AddLabel(104, 193, 0, @"120 Powerscroll (1000 Credits)");
AddLabel(23, 348, 0, @"By: DxMonkey");
}
public override void OnResponse(NetState sender, RelayInfo info)
{
Mobile from = sender.Mobile;
switch(info.ButtonID)
{
case 0:
{
from.SendMessage( 68, "You choose not to purchase any Powerscrolls");
return;
}
case 1:
{
Item[] Token = from.Backpack.FindItemsByType( typeof( PSCredits ) );
if ( from.Backpack.ConsumeTotal( typeof( PSCredits ), 10 ) )
{
PowerScroll ps = CreateRandomPowerScroll();
ps.Value = 110;
from.AddToBackpack( ps );
from.SendMessage( "You buy a random 110 Powerscroll." );
}
else
{
from.SendMessage( "You do not have enough funds for that." );
}
break;
}
case 2:
{
Item[] Token = from.Backpack.FindItemsByType( typeof( PSCredits ) );
if ( from.Backpack.ConsumeTotal( typeof( PSCredits ), 100 ) )
{
PowerScroll ps = CreateRandomPowerScroll();
ps.Value = 115;
from.AddToBackpack( ps );
from.SendMessage( "You buy a random 115 Powerscroll." );
}
else
{
from.SendMessage( "You do not have enough funds for that." );
}
break;
}
case 3:
{
Item[] Token = from.Backpack.FindItemsByType( typeof( PSCredits ) );
if ( from.Backpack.ConsumeTotal( typeof( PSCredits ), 1000 ) )
{
PowerScroll ps = CreateRandomPowerScroll();
ps.Value = 120;
from.AddToBackpack( ps );
from.SendMessage( "You buy a random 120 Powerscroll." );
}
else
{
from.SendMessage( "You do not have enough funds for that." );
}
break;
}
}
}
public PowerScroll CreateRandomPowerScroll()
{
int level;
double random = Utility.RandomDouble();
if ( 0.05 >= random )
level = 20;
else if ( 0.4 >= random )
level = 15;
else
level = 10;
return PowerScroll.CreateRandomNoCraft( level, level );
}
}
}

View File

@@ -0,0 +1,89 @@
//PowerScroll Exchange!!
//By: DxMonkey - AKA - Tresdni
//Ultima Eclipse - www.ultimaeclipse.com
using System;
using Server.Items;
using Server.Gumps;
namespace Server.Items
{
public class PowerscrollExchange : Item
{
public static int i_PSReward = 0;
[Constructable]
public PowerscrollExchange() : base( 0xE77 )
{
Movable = false;
Hue = 1153;
Name = "The Powerscroll Exchange (Double-Click For Menu)";
}
public override void OnDoubleClick( Mobile from )
{
if ( !from.HasGump( typeof( PSCreditsGump ) ) )
{
from.SendGump( new PSCreditsGump());
}
else
from.SendMessage ( "You already have this menu open!" );
}
public override bool OnDragDrop( Mobile from, Item dropped )
{
if ( dropped is PowerScroll )
{
PowerScroll deed = (PowerScroll)dropped;
i_PSReward = 0; //default value
if ( deed.Value == 120.0 )
i_PSReward = 500;
else if ( deed.Value == 115.0 )
i_PSReward = 50;
else if ( deed.Value == 110.0 )
i_PSReward = 5;
else if ( deed.Value == 105.0 )
i_PSReward = 1;
}
else i_PSReward = 0;
dropped.Delete();
if ( i_PSReward > 0 )
{
from.AddToBackpack( new PSCredits(i_PSReward) );
from.SendMessage( 1173, "You were rewarded {0} Powerscroll Credits for this scroll.", i_PSReward );
}
else if (i_PSReward == 0 ) from.SendMessage( 1173, "This was not a Powerscroll, but it was deleted anyways." );
return true;
}
public PowerscrollExchange( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}