Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
101
Scripts/Quests/Eodon/Hawkwind/Hawkwind.cs
Normal file
101
Scripts/Quests/Eodon/Hawkwind/Hawkwind.cs
Normal file
@@ -0,0 +1,101 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Engines;
|
||||
using Server.Engines.Quests;
|
||||
using Server.Gumps;
|
||||
using Server.Spells.SkillMasteries;
|
||||
|
||||
namespace Server.Engines.Quests.TimeLord
|
||||
{
|
||||
public class Hawkwind : BaseQuester
|
||||
{
|
||||
[Constructable]
|
||||
public Hawkwind()
|
||||
: base("the Time Lord")
|
||||
{
|
||||
}
|
||||
|
||||
public Hawkwind(Serial serial) : base(serial) { }
|
||||
|
||||
public override bool CanBeDamaged() { return false; }
|
||||
public override bool ChangeRace { get { return false; } }
|
||||
|
||||
public override void InitBody()
|
||||
{
|
||||
Name = "Hawkwind";
|
||||
Female = false;
|
||||
Body = Race.Human.MaleBody;
|
||||
Hue = 33823;
|
||||
HairItemID = 8252;
|
||||
FacialHairItemID = 8267;
|
||||
HairHue = FacialHairHue = 1129;
|
||||
InitStats(100, 75, 75);
|
||||
}
|
||||
|
||||
public override bool CanPaperdollBeOpenedBy(Mobile from)
|
||||
{
|
||||
return from.AccessLevel > AccessLevel.Player;
|
||||
}
|
||||
|
||||
public override void InitOutfit()
|
||||
{
|
||||
Robe robe = new Robe();
|
||||
robe.ItemID = 0x7816;
|
||||
|
||||
AddItem(robe); // TODO: Fancy Robe
|
||||
}
|
||||
|
||||
public override int GetAutoTalkRange(PlayerMobile pm)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (from is PlayerMobile)
|
||||
{
|
||||
OnTalk((PlayerMobile)from, false);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnTalk(PlayerMobile player, bool contextMenu)
|
||||
{
|
||||
if (player.Quest is TimeForLegendsQuest && ((TimeForLegendsQuest)player.Quest).Objectives.Count == 0)
|
||||
player.SendGump(new ChooseMasteryGump(player, (TimeForLegendsQuest)player.Quest));
|
||||
else if (player.Quest == null && CanRecieveQuest(player))
|
||||
{
|
||||
Direction = GetDirectionTo(player);
|
||||
TimeForLegendsQuest quest = new TimeForLegendsQuest(player);
|
||||
quest.SendOffer();
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
public bool CanRecieveQuest(Mobile m)
|
||||
{
|
||||
foreach (SkillName sk in MasteryInfo.Skills)
|
||||
{
|
||||
if (!m.Skills[sk].HasLearnedMastery())
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
51
Scripts/Quests/Eodon/Hawkwind/Objective.cs
Normal file
51
Scripts/Quests/Eodon/Hawkwind/Objective.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Engines.Quests.TimeLord
|
||||
{
|
||||
public class TimeForLegendsObjective : QuestObjective
|
||||
{
|
||||
public override object Message { get { return 1156341; } } // Prove yourself to Hawkwind, defeat thy foe in order to begin your journey among the Legendary.
|
||||
|
||||
public override int MaxProgress { get { return 1; } }
|
||||
|
||||
public TimeForLegendsObjective()
|
||||
{
|
||||
}
|
||||
|
||||
public override void RenderProgress( BaseQuestGump gump )
|
||||
{
|
||||
if (System is TimeForLegendsQuest)
|
||||
{
|
||||
TimeForLegendsQuest q = System as TimeForLegendsQuest;
|
||||
|
||||
if (q.ToSlay == null)
|
||||
gump.AddHtmlObject(70, 260, 270, 100, this.Completed ? 1049077 : 1049078, BaseQuestGump.Blue, false, false);
|
||||
else
|
||||
{
|
||||
int index = Array.IndexOf(TimeForLegendsQuest.Targets, q.ToSlay);
|
||||
|
||||
gump.AddHtmlObject(70, 260, 150, 100, index <= 13 ? 1156324 + index : 1156354 + (index - 14), BaseQuestGump.Blue, false, false);
|
||||
gump.AddHtmlObject(230, 260, 10, 100, ":", BaseQuestGump.Blue, false, false);
|
||||
gump.AddHtmlObject(235, 260, 150, 100, this.Completed ? 1046033 : 1046034, BaseQuestGump.Blue, false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnKill(BaseCreature creature, Container corpse)
|
||||
{
|
||||
if(System is TimeForLegendsQuest && creature.GetType() == ((TimeForLegendsQuest)System).ToSlay)
|
||||
{
|
||||
Complete();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Complete()
|
||||
{
|
||||
base.Complete();
|
||||
System.Complete();
|
||||
}
|
||||
}
|
||||
}
|
||||
190
Scripts/Quests/Eodon/Hawkwind/TimeForLegendsQuest.cs
Normal file
190
Scripts/Quests/Eodon/Hawkwind/TimeForLegendsQuest.cs
Normal file
@@ -0,0 +1,190 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Gumps;
|
||||
using Server.Spells.SkillMasteries;
|
||||
|
||||
namespace Server.Engines.Quests.TimeLord
|
||||
{
|
||||
public class TimeForLegendsQuest : QuestSystem
|
||||
{
|
||||
private Type[] _TypeReferenceTable = new Type[]
|
||||
{
|
||||
typeof(TimeForLegendsObjective)
|
||||
};
|
||||
|
||||
public override Type[] TypeReferenceTable { get { return _TypeReferenceTable; } }
|
||||
|
||||
public override object Name { get { return 1156338; } } // A Time For Legends
|
||||
public override object OfferMessage { get { return 1156339; } } /*Greetings Brave Traveler!<br><br>Throughout my travels in time I have forever
|
||||
encountered those who've reached the pinnacle of their profession. These Legends
|
||||
are told of in our most cherished tales and are the fabric by which heroes are born.
|
||||
I offer you now a chance to walk the path of these Legends. Complete my task and
|
||||
you too shall know the secrets of the Master.*/
|
||||
|
||||
public override TimeSpan RestartDelay { get { return TimeSpan.Zero; } }
|
||||
public override bool IsTutorial { get { return false; } }
|
||||
public override int Picture { get { return 0x1581; } }
|
||||
|
||||
public SkillName Mastery { get; set; }
|
||||
public Type ToSlay { get; set; }
|
||||
|
||||
public TimeForLegendsQuest(PlayerMobile from)
|
||||
: base(from)
|
||||
{
|
||||
}
|
||||
|
||||
public TimeForLegendsQuest()
|
||||
{
|
||||
}
|
||||
|
||||
public override void Accept()
|
||||
{
|
||||
base.Accept();
|
||||
|
||||
From.SendGump(new ChooseMasteryGump(From, this));
|
||||
}
|
||||
|
||||
public override void Complete()
|
||||
{
|
||||
base.Complete();
|
||||
|
||||
From.SendLocalizedMessage(1156342); // You have proven your prowess on the battlefield and have completed the first step on the path of the Master!
|
||||
From.SendLocalizedMessage(1156209); // You have received a mastery primer!
|
||||
From.SendLocalizedMessage(1152339, "#1028794"); // A reward of ~1_ITEM~ has been placed in your backpack.
|
||||
|
||||
From.AddToBackpack(new BookOfMasteries());
|
||||
|
||||
var primer = new SkillMasteryPrimer(Mastery, 1);
|
||||
|
||||
if(primer != null)
|
||||
From.AddToBackpack(primer);
|
||||
}
|
||||
|
||||
public static Type[] Targets { get { return _Targets; } }
|
||||
private static Type[] _Targets = new Type[]
|
||||
{
|
||||
typeof(Semidar), typeof(Mephitis), typeof(Rikktor), typeof(LordOaks), typeof(Neira), typeof(Barracoon), typeof(Serado), typeof(Meraktus), typeof(Ilhenir),
|
||||
typeof(Twaulo), typeof(AbyssalInfernal), typeof(PrimevalLich), typeof(CorgulTheSoulBinder), typeof(CorgulTheSoulBinder) /*dragon turtle*/,
|
||||
typeof(DreadHorn), typeof(Travesty), typeof(ChiefParoxysmus), typeof(LadyMelisande), typeof(MonstrousInterredGrizzle), typeof(ShimmeringEffusion)
|
||||
};
|
||||
|
||||
public static Type TargetOfTheDay { get; set; }
|
||||
public static DateTime NextTarget { get; set; }
|
||||
|
||||
public static void OnSave(WorldSaveEventArgs e)
|
||||
{
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(30), () =>
|
||||
{
|
||||
if (DateTime.UtcNow > NextTarget)
|
||||
{
|
||||
NextTarget = DateTime.UtcNow + TimeSpan.FromHours(24);
|
||||
TargetOfTheDay = _Targets[Utility.Random(_Targets.Length)];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
EventSink.WorldSave += OnSave;
|
||||
|
||||
TargetOfTheDay = _Targets[Utility.Random(_Targets.Length)];
|
||||
|
||||
Server.Commands.CommandSystem.Register("NewTargetOfTheDay", AccessLevel.GameMaster, e =>
|
||||
{
|
||||
TargetOfTheDay = _Targets[Utility.Random(_Targets.Length)];
|
||||
|
||||
e.Mobile.SendMessage("New Target of the Day: {0}", TargetOfTheDay.Name);
|
||||
});
|
||||
}
|
||||
|
||||
public override void ChildSerialize(GenericWriter writer)
|
||||
{
|
||||
writer.WriteEncodedInt((int)0); // version
|
||||
|
||||
writer.Write((int)Mastery);
|
||||
|
||||
if (ToSlay != null)
|
||||
{
|
||||
writer.Write(0);
|
||||
writer.Write(ToSlay.Name);
|
||||
}
|
||||
else
|
||||
writer.Write(1);
|
||||
}
|
||||
|
||||
public override void ChildDeserialize(GenericReader reader)
|
||||
{
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
Mastery = (SkillName)reader.ReadInt();
|
||||
|
||||
string name = null;
|
||||
|
||||
if(reader.ReadInt() == 0)
|
||||
name = reader.ReadString();
|
||||
|
||||
if(name != null)
|
||||
ToSlay = ScriptCompiler.FindTypeByName(name);
|
||||
}
|
||||
}
|
||||
|
||||
public class ChooseMasteryGump : Gump
|
||||
{
|
||||
public TimeForLegendsQuest Quest { get; set; }
|
||||
public PlayerMobile User { get; set; }
|
||||
|
||||
public ChooseMasteryGump(PlayerMobile user, TimeForLegendsQuest quest)
|
||||
: base(50, 50)
|
||||
{
|
||||
Quest = quest;
|
||||
User = user;
|
||||
|
||||
AddImage(0, 0, 8000);
|
||||
AddImage(20, 37, 8001);
|
||||
AddImage(20, 107, 8002);
|
||||
AddImage(20, 177, 8001);
|
||||
AddImage(20, 247, 8002);
|
||||
AddImage(20, 317, 8001);
|
||||
AddImage(20, 387, 8002);
|
||||
AddImage(20, 457, 8003);
|
||||
|
||||
AddHtmlLocalized(125, 40, 345, 16, 1156340, false, false); // Choose Your Path
|
||||
|
||||
int y = 60;
|
||||
|
||||
foreach (SkillName skName in MasteryInfo.Skills)
|
||||
{
|
||||
Skill sk = User.Skills[skName];
|
||||
|
||||
if (sk == null || skName == SkillName.Discordance || skName == SkillName.Provocation || skName == SkillName.Peacemaking)
|
||||
continue;
|
||||
|
||||
if (sk.IsMastery && sk.VolumeLearned == 0)
|
||||
{
|
||||
AddButton(30, y, 4005, 4007, (int)skName + 1, GumpButtonType.Reply, 0);
|
||||
|
||||
AddHtmlLocalized(75, y, 200, 16, MasteryInfo.GetLocalization(skName), 0x000F, false, false);
|
||||
|
||||
y += 20;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnResponse(Network.NetState state, RelayInfo info)
|
||||
{
|
||||
if (info.ButtonID == 0 && User.Quest != null && User.Quest is TimeForLegendsQuest)
|
||||
User.Quest.Cancel();
|
||||
|
||||
int id = info.ButtonID - 1;
|
||||
|
||||
if (id >= 0 && id < SkillInfo.Table.Length)
|
||||
{
|
||||
Quest.Mastery = (SkillName)id;
|
||||
Quest.ToSlay = TimeForLegendsQuest.TargetOfTheDay;
|
||||
Quest.AddObjective(new TimeForLegendsObjective());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user