using System;
using System.Collections;
using Server;
using Server.daat99;
using Server.Gumps;
using Server.Items;
using Server.Mobiles;
using Server.Network;
using Server.Engines.BulkOrders;
namespace Server.daat99
{
public class OWLTR //Custom OWLTR == Ores Wood Leather Tokens Recipes
{
public static readonly bool UbberResources = false;
public static readonly bool Daat99Mining = true;
public static readonly bool Daat99Lumberjacking = true;
public static readonly bool A_Li_NCleanChamp = true;
public static readonly bool A_Li_NSaveCleanChampGold = true;
public static readonly bool RecipeCraft = false;
public static readonly bool CraftingBankHive = true;
public static readonly bool CraftingToolRunicHouse = true;
public static readonly bool CraftingMobileForge = true;
public static readonly bool CraftingResourceKeys = true;
public static readonly bool MuleForge = true;
public static readonly bool CraftRunicJewlery = true;
public static readonly bool UseSpellcastersKeyReagents = true;
public static readonly bool MonsterGiveTokens = true;
public static readonly bool BodGiveTokens = true;
public static readonly bool HarvestGiveTokens = true;
public static readonly bool CraftGiveTokens = true;
public static readonly bool Alchemy = true;
public static readonly bool Blacksmithy = true;
public static readonly bool BowFletching = true;
public static readonly bool Carpentry = true;
public static readonly bool Cooking = true;
public static readonly bool Glassblowing = true;
public static readonly bool Inscription = true;
public static readonly bool Masonry = true;
public static readonly bool Tailoring = true;
public static readonly bool Tinkering = true;
public static readonly bool RecipeHarvesting = true;
}
public class Daat99OWLTR : Item
{
[Constructable]
public Daat99OWLTR() : base( 10900 )
{
Hue = 2;
Name = "Daat99's OWLTR Control and Information Center";
Movable = false;
Light = LightType.Circle300;
}
public override void OnDoubleClick( Mobile from )
{
from.CloseGump( typeof( Daat99CustomOWLTRGump ) );
if (Ops == null)
GenOWLTRSettings();
if ( !from.Player )
return;
if (from.AccessLevel == AccessLevel.Administrator)
from.SendGump( new Daat99CustomOWLTRGump((PlayerMobile)from) );
else
from.SendGump( new Daat99CustomOWLTRGump((PlayerMobile)from) );
}
public static OwltOps[] Ops;
public static void Initialize()
{
Server.Commands.Register( "OWLTR", AccessLevel.Player, new CommandEventHandler( OWLTR_OnCommand ) );
if ( Core.AOS )
Server.Commands.Register( "OWLTRBOD", AccessLevel.Player, new CommandEventHandler( OWLTRBOD_OnCommand ) );
if (Ops == null)
GenOWLTR();
}
[Usage( "OWLTR" )]
[Description( "Open the OWLTR Control Center Gump." )]
public static void OWLTR_OnCommand( CommandEventArgs e )
{
if (!(e.Mobile is PlayerMobile))
return;
if (Daat99OWLTR.Ops != null)
{
}
if (e.Mobile.AccessLevel == AccessLevel.Administrator)
e.Mobile.SendGump(new Daat99CustomOWLTRGump((PlayerMobile)e.Mobile));
else
e.Mobile.SendGump(new Daat99CustomOWLTRGump((PlayerMobile)e.Mobile));
}
[Usage( "OWLTRBOD" )]
[Description( "Open the bods request Gump." )]
public static void OWLTRBOD_OnCommand( CommandEventArgs e )
{
if (e.Mobile is PlayerMobile)
e.Mobile.SendGump(new OWLTRbod((PlayerMobile)e.Mobile));
}
public static void GenOWLTR()
{
Daat99OWLTR dowl = new Daat99OWLTR();
dowl.MoveToWorld( new Point3D(1434,1707,18), Map.Trammel );
Daat99OWLTR dowl2 = new Daat99OWLTR();
dowl2.MoveToWorld( new Point3D(1434,1707,18), Map.Felucca );
Daat99OWLTR dowl3 = new Daat99OWLTR();
dowl3.Visible = false;
dowl3.MoveToWorld( new Point3D(0,0,0), Map.Tokuno );
GenOWLTRSettings();
}
public static string[] s_Titles = new string[]
{
/*0*/ "Ubber Resources",
/*1*/ "Daat99 Mining",
/*2*/ "Daat99 Lumberjacking",
/*3*/ "A_Li_N CleanChamp",
/*4*/ "Save CleanChamp Gold",
/*5*/ "Recipe Craft",
/*6*/ "Crafting BankHive",
/*7*/ "Crafting Tool Runic House",
/*8*/ "Crafting Mobile Forge",
/*9*/ "Crafting Resource Keys",
/*10*/ "Mule Forge",
/*11*/ "Craft Runic Jewlery",
/*12*/ "Use Spellcasters Key Reagents",
/*13*/ "Monster Give Tokens",
/*14*/ "Bod Give Tokens",
/*15*/ "Harvest Give Tokens",
/*16*/ "Craft Give Tokens",
/*17*/ "Alchemy",
/*18*/ "Blacksmithy",
/*19*/ "BowFletching",
/*20*/ "Carpentry",
/*21*/ "Cooking",
/*22*/ "Glassblowing",
/*23*/ "Inscription",
/*24*/ "Masonry",
/*25*/ "Tailoring",
/*26*/ "Tinkering",
/*27*/ "Recipe Harvesting"
};
public static string[] s_Descriptions = new string[]
{
/*0*/ "Enabling Ubber Resources will make the armor hold the max resists and the runics will be more powerfull. Disabling it will make the armor take random resists and less powerfull runics.",
/*1*/ "Enabling Daat99 Mining will Make the players mine random ores (acording to their skills) everywhere. Disabling it will use the standard OSI vein mining system (they could camp platinum vein 24/7).",
/*2*/ "Enabling Daat99 Lumberjacking will Make the players lumberjack random woods (acording to their skills) everywhere. Disabling it will use the standard OSI vein lumberjacking system (they could camp petrified vein 24/7).",
/*3*/ "Enabling A_Li_N CleanChamp will delete all the corpses every time a new white skull will be spawned in the champ. It will not delete players corpses or bonded pets.",
/*4*/ "Enabling A_Li_N Save Clean Champ Gold will save the gold from the corpses it delete and spawn it when the champion spawns (need A_Li_N CleanChamp enabled to work).",
/*5*/ "Enabling Recipe Craft will make the players need to learn how to craft items and how to harvest ores from crafting recipies.",
/*6*/ "Enabling Crafting Bank Hive will enable the bank hive to be craftable in the tinkering menu (need custom craftables to be enabled).",
/*7*/ "Enabling Crafting Tool Runic House will enable the tool and runic houses to be craftable in the tinkering menu (need custom craftables to be enabled).",
/*8*/ "Enabling Crafting Mobile Forge will enable the mobile forge to be craftable in the tinkering menu (need custom craftables to be enabled).",
/*9*/ "Enabling Crafting Resource Keys will enable the resource keys to be craftable in the tinkering menu (need custom craftables to be enabled).",
/*10*/ "Enabling Mule Forge will enable the mules that spawned with master of the arts to smelt ores just like normal forge, dclick the ore and target the mule that you own.",
/*11*/ "Enabling Craft Runic Jewlery will enable players to craft runic jewlery (rings, bracelets, earings) with runic tinker tools.",
/*12*/ "Enabling Use Spellcasters Key Reagents will check the Spellcasters Key for reagents when the players cast a spell after looking at their backpack.",
/*13*/ "Enabling Monster Give Tokens add tokens to players token ledger (assuming they have one that belong to them in their pack) when they kill monsters.",
/*14*/ "Enabling Bod Give Tokens add tokens to players token ledger (assuming they have one that belong to them in their pack) when they return a full bod to the apropriate vendor.",
/*15*/ "Enabling Harvest Give Tokens will add tokens to the players token ledger (assuming they have one that belong to them in their pack) when they successfully mine ores or lumberjack wood, Only work with random ores/woods. if ores set to vein you can't get tokens for mining and if lumberjacking is set to vein you won't get tokens for lumberjacking. Players will get 50% more tokens when harvesting in Felucca.",
/*16*/ "Enabling Craft Give Tokens will add tokens to the players token ledger (assuming they have one that belong to them in their pack) when they successfully craft items. Tokens amount will be based on the amount of the main resource, the type of the main resource and a bonus if the item is exceptional, When the player repair an item he'll get 0-4 tokens.",
/*17*/ "Alchemy",
/*18*/ "Blacksmithy",
/*19*/ "BowFletching",
/*20*/ "Carpentry",
/*21*/ "Cooking",
/*22*/ "Glassblowing",
/*23*/ "Inscription",
/*24*/ "Masonry",
/*25*/ "Tailoring",
/*26*/ "Tinkering",
/*27*/ "Recipe Harvesting"
};
public static void GenOWLTRSettings()
{
Ops = new OwltOps[28]; //don't forget to update this when you add new switches
Ops[0] = new OwltOps(s_Titles[0], OWLTR.UbberResources, s_Descriptions[0] );
Ops[1] = new OwltOps(s_Titles[1], OWLTR.Daat99Mining, s_Descriptions[1] );
Ops[2] = new OwltOps(s_Titles[2], OWLTR.Daat99Lumberjacking, s_Descriptions[2] );
Ops[3] = new OwltOps(s_Titles[3], OWLTR.A_Li_NCleanChamp, s_Descriptions[3] );
Ops[4] = new OwltOps(s_Titles[4], OWLTR.A_Li_NSaveCleanChampGold, s_Descriptions[4] );
Ops[5] = new OwltOps(s_Titles[5], OWLTR.RecipeCraft, s_Descriptions[5] );
Ops[6] = new OwltOps(s_Titles[6], OWLTR.CraftingBankHive, s_Descriptions[6] );
Ops[7] = new OwltOps(s_Titles[7], OWLTR.CraftingToolRunicHouse, s_Descriptions[7] );
Ops[8] = new OwltOps(s_Titles[8], OWLTR.CraftingMobileForge, s_Descriptions[8] );
Ops[9] = new OwltOps(s_Titles[9], OWLTR.CraftingResourceKeys, s_Descriptions[9] );
Ops[10] = new OwltOps(s_Titles[10], OWLTR.MuleForge, s_Descriptions[10] );
Ops[11] = new OwltOps(s_Titles[11], OWLTR.CraftRunicJewlery, s_Descriptions[11] );
Ops[12] = new OwltOps(s_Titles[12], OWLTR.UseSpellcastersKeyReagents, s_Descriptions[12] );
Ops[13] = new OwltOps(s_Titles[13], OWLTR.MonsterGiveTokens, s_Descriptions[13] );
Ops[14] = new OwltOps(s_Titles[14], OWLTR.BodGiveTokens, s_Descriptions[14] );
Ops[15] = new OwltOps(s_Titles[15], OWLTR.HarvestGiveTokens, s_Descriptions[15] );
Ops[16] = new OwltOps(s_Titles[16], OWLTR.CraftGiveTokens, s_Descriptions[16] );
Ops[17] = new OwltOps(s_Titles[17], OWLTR.Alchemy, s_Descriptions[17] );
Ops[18] = new OwltOps(s_Titles[18], OWLTR.Blacksmithy, s_Descriptions[18] );
Ops[19] = new OwltOps(s_Titles[19], OWLTR.BowFletching, s_Descriptions[19] );
Ops[20] = new OwltOps(s_Titles[20], OWLTR.Carpentry, s_Descriptions[20] );
Ops[21] = new OwltOps(s_Titles[21], OWLTR.Cooking, s_Descriptions[21] );
Ops[22] = new OwltOps(s_Titles[22], OWLTR.Glassblowing, s_Descriptions[22] );
Ops[23] = new OwltOps(s_Titles[23], OWLTR.Inscription, s_Descriptions[23] );
Ops[24] = new OwltOps(s_Titles[24], OWLTR.Masonry, s_Descriptions[24] );
Ops[25] = new OwltOps(s_Titles[25], OWLTR.Tailoring, s_Descriptions[25] );
Ops[26] = new OwltOps(s_Titles[26], OWLTR.Tinkering, s_Descriptions[26] );
Ops[27] = new OwltOps(s_Titles[27], OWLTR.RecipeHarvesting, s_Descriptions[27] );
}
public Daat99OWLTR( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
OwltOps[] OwltOps = Ops;
writer.Write( (int) OwltOps.Length ); //ops lenght
foreach( OwltOps ops in OwltOps )
{
writer.Write( (bool)ops.Setting );
}
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
int i_Limit = reader.ReadInt();
switch (i_Limit) //this will increase the array size when needed.
{
case 27: Ops = new OwltOps[28]; break;
default: Ops = new OwltOps[i_Limit]; break;
}
for (int i = 0; i < i_Limit; i++)
{
Ops[i] = new OwltOps(s_Titles[i], reader.ReadBool(), s_Descriptions[i] );
}
if (i_Limit == 27) //this will add the new setting
Ops[28] = new OwltOps(s_Titles[28], OWLTR.RecipeHarvesting, s_Descriptions[28] );
if (Ops == null)
GenOWLTRSettings();
}
public class OwltOps
{
private string s_Title;
private bool b_Setting;
private string s_Desctiption;
public string Title{ get{ return s_Title;} set{ s_Title = value;} }
public bool Setting{ get{ return b_Setting;} set{ b_Setting= value;} }
public string Desctiption{ get{ return s_Desctiption;} set{ s_Desctiption= value;} }
public OwltOps(string name, bool setting, string desc)
{
s_Title = name;
b_Setting = setting;
s_Desctiption = desc;
}
}
}
}