本文整理汇总了C#中Server.Mobiles.BaseVendor类的典型用法代码示例。如果您正苦于以下问题:C# BaseVendor类的具体用法?C# BaseVendor怎么用?C# BaseVendor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BaseVendor类属于Server.Mobiles命名空间,在下文中一共展示了BaseVendor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: RefillGump
public RefillGump(BaseVendor vendor, Mobile from, QuestReagentBag bag, List<RefillEntry> refillEntryList)
: base(50, 50)
{
from.CloseGump(typeof(RefillGump));
m_Vendor = vendor;
m_Bag = bag;
m_RefillEntryList = refillEntryList;
this.Closable = true;
this.Disposable = true;
this.Dragable = true;
this.Resizable = false;
this.AddPage(0);
this.AddBackground(0, 0, 453, 285, 2620);
this.AddAlphaRegion(4, 7, 443, 271);
this.AddLabel(bag.Type == QuestReagentBag.ReagentBagType.Mage ? 160 : 140, 13, 955, string.Format("Refill {0}", bag.Name));
this.AddLabel(22, 45, 955, @"Reagents");
this.AddLabel(106, 45, 955, @"Amount to refill");
this.AddLabel(371, 45, 955, @"Total Cost");
this.AddLabel(239, 45, 955, @"Cost per reagent");
this.AddButton(410, 250, 4017, 4018, (int)Buttons.Cancel, GumpButtonType.Reply, 0);
m_Price = ShowReagentCostList(refillEntryList);
if (m_Price > 0)
{
this.AddLabel(100, 229, 955, string.Format("Do you want to refill your bag for {0} gp?", m_Price));
this.AddButton(210, 250, 4023, 4024, (int)Buttons.OK, GumpButtonType.Reply, 0);
}
}
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:33,代码来源:RefillGump.cs
示例2: GetPriceFromVendor
public static int GetPriceFromVendor(BaseVendor vendor, Type itemType)
{
IBuyItemInfo[] buyInfo = vendor.GetBuyInfo();
for (int i = 0; i < buyInfo.Length; ++i)
{
IBuyItemInfo buyItem = (IBuyItemInfo)buyInfo[i];
GenericBuyInfo gbi = (GenericBuyInfo)buyItem;
if (gbi.Type == itemType)
return buyItem.Price;
}
return 0;
}
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:15,代码来源:ERefillUtility.cs
示例3: RefillBag
public static bool RefillBag(BaseVendor vendor, Mobile from, Item dropped)
{
if (dropped is QuestReagentBag)
{
QuestReagentBag regBag = (QuestReagentBag)dropped;
List<RefillEntry> refillEntryList = ERefillUtility.Refill(regBag, regBag.ReagentTypes, vendor, from, false, regBag.BagRefillAmount);
//int cost = 0;
int amount = 0;
foreach (RefillEntry entry in refillEntryList)
amount += entry.AmountToRefill;
//cost += entry.TotalCost;
if (amount <= 0)
vendor.Say("That bag seems to be full.");
else
from.SendGump(new RefillGump(vendor, from, (QuestReagentBag)dropped, refillEntryList));
return true;
}
return false;
}
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:21,代码来源:GabrielleTheElderWizard.cs
示例4: AAnimalTrainerCancelMenu
public AAnimalTrainerCancelMenu(Mobile from, BaseVendor vendor) : base(6129, 3) //Dismissal //HERE
{
m_Vendor = vendor as AAnimalTrainer;//HERE
m_Mobile = from;
}
开发者ID:greeduomacro,项目名称:dragonknights-uo,代码行数:5,代码来源:AAnimalTrainer.cs
示例5: CheckVendorAccess
public virtual bool CheckVendorAccess( BaseVendor vendor, Mobile from )
{
if ( from.AccessLevel >= AccessLevel.GameMaster || IsDisabled() )
return true;
return !IsConstantCandidate( from );
}
开发者ID:greeduomacro,项目名称:divinity,代码行数:7,代码来源:GuardedRegion.cs
示例6: BulkOrderInfoEntry
public BulkOrderInfoEntry( Mobile from, BaseVendor vendor )
: base( 6152 )
{
m_From = from;
m_Vendor = vendor;
}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:6,代码来源:BaseVendor.cs
示例7: CheckVendorAccess
public virtual bool CheckVendorAccess( BaseVendor vendor, Mobile from )
{
return !from.Criminal || from.AccessLevel >= AccessLevel.GameMaster || IsDisabled();
}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:4,代码来源:GuardedRegion.cs
示例8: GetContextMenuEntries
public static void GetContextMenuEntries(Mobile from, BaseVendor vendor, List<ContextMenuEntry> list)
{
list.Add( new AProvisionerCancelMenu( from, vendor ) );//HERE
}
开发者ID:greeduomacro,项目名称:dragonknights-uo,代码行数:4,代码来源:AProvisioner.cs
示例9: Refill
public static List<RefillEntry> Refill(Container cont, Type[] itemTypes, BaseVendor vendor, Mobile from, bool Refill, int amount)
{
List<RefillEntry> refillEntryList = new List<RefillEntry>();
RefillEntry refillEntry;
foreach (Type itemType in itemTypes)
{
bool foundReagentInBag = false;
refillEntry = new RefillEntry();
refillEntry.ItemType = itemType;
for (int i = 0; i < cont.Items.Count; i++)
{
Item item = (Item)cont.Items[i];
if (itemType == item.GetType())
{
// Add amount to refill to entry
int amountToRefill = amount - item.Amount;
refillEntry.AmountToRefill = amountToRefill;
// Add price on vendor to entry
int priceOnVendor = GetPriceFromVendor(vendor, itemType);
refillEntry.PriceOnVendor = priceOnVendor;
if (priceOnVendor > 0)
{
refillEntry.HasVendorGotItem = true;
if (Refill)
item.Amount += amountToRefill;
}
else
{
// Vendor does not have this item
}
foundReagentInBag = true;
break;
}
}
// We could not find the item in the players bag, create the item
// and set the amount.
if (!foundReagentInBag)
{
// Add amount to refill to entry
refillEntry.AmountToRefill = amount;
// Add price on vendor to entry
int priceOnVendor = GetPriceFromVendor(vendor, itemType);
refillEntry.PriceOnVendor = priceOnVendor;
if (priceOnVendor > 0)
{
refillEntry.HasVendorGotItem = true;
if (Refill)
DirectRefillType(cont, itemType, amount);
}
else
{
// Vendor does not have this item
}
}
// Add the entry
refillEntryList.Add(refillEntry);
}
return refillEntryList;
}
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:72,代码来源:ERefillUtility.cs
示例10: ABlacksmithCancelMenu
public ABlacksmithCancelMenu(Mobile from, BaseVendor vendor) : base(6129, 3) //Dismissal //HERE
{
m_Vendor = vendor as ABlacksmith;//HERE
m_Mobile = from;
}
开发者ID:greeduomacro,项目名称:dragonknights-uo,代码行数:5,代码来源:ABlacksmith.cs
示例11: ChangeHairstyleGump
public ChangeHairstyleGump(Mobile from, BaseVendor vendor, int price, bool facialHair, ChangeHairstyleEntry[] entries)
: base(50, 50)
{
m_From = from;
m_Vendor = vendor;
m_Price = price;
m_FacialHair = facialHair;
m_Entries = entries;
from.CloseGump(typeof(HairstylistBuyGump));
from.CloseGump(typeof(ChangeHairHueGump));
from.CloseGump(typeof(ChangeHairstyleGump));
int tableWidth = (m_FacialHair ? 2 : 3);
int tableHeight = ((entries.Length + tableWidth - (m_FacialHair ? 1 : 2)) / tableWidth);
int offsetWidth = 123;
int offsetHeight = (m_FacialHair ? 70 : 65);
AddPage(0);
AddBackground(0, 0, 81 + (tableWidth * offsetWidth), 105 + (tableHeight * offsetHeight), 2600);
AddButton(45, 45 + (tableHeight * offsetHeight), 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(77, 45 + (tableHeight * offsetHeight), 90, 35, 1006044, false, false); // Ok
AddButton(
81 + (tableWidth * offsetWidth) - 180, 45 + (tableHeight * offsetHeight), 4005, 4007, 0, GumpButtonType.Reply, 0);
AddHtmlLocalized(
81 + (tableWidth * offsetWidth) - 148, 45 + (tableHeight * offsetHeight), 90, 35, 1006045, false, false); // Cancel
if (!facialHair)
{
AddHtmlLocalized(50, 15, 350, 20, 1018353, false, false); // <center>New Hairstyle</center>
}
else
{
AddHtmlLocalized(55, 15, 200, 20, 1018354, false, false); // <center>New Beard</center>
}
for (int i = 0; i < entries.Length; ++i)
{
int xTable = i % tableWidth;
int yTable = i / tableWidth;
if (entries[i].GumpID != 0)
{
AddRadio(40 + (xTable * offsetWidth), 70 + (yTable * offsetHeight), 208, 209, false, i);
AddBackground(87 + (xTable * offsetWidth), 50 + (yTable * offsetHeight), 50, 50, 2620);
AddImage(
87 + (xTable * offsetWidth) + entries[i].X, 50 + (yTable * offsetHeight) + entries[i].Y, entries[i].GumpID);
}
else if (!facialHair)
{
AddRadio(40 + ((xTable + 1) * offsetWidth), 240, 208, 209, false, i);
AddHtmlLocalized(60 + ((xTable + 1) * offsetWidth), 240, 85, 35, 1011064, false, false); // Bald
}
else
{
AddRadio(40 + (xTable * offsetWidth), 70 + (yTable * offsetHeight), 208, 209, false, i);
AddHtmlLocalized(60 + (xTable * offsetWidth), 70 + (yTable * offsetHeight), 85, 35, 1011064, false, false); // Bald
}
}
}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:63,代码来源:CustomHairstylist.cs
示例12: ChangeHairHueGump
public ChangeHairHueGump(
Mobile from, BaseVendor vendor, int price, bool hair, bool facialHair, ChangeHairHueEntry[] entries)
: base(50, 50)
{
m_From = from;
m_Vendor = vendor;
m_Price = price;
m_Hair = hair;
m_FacialHair = facialHair;
m_Entries = entries;
from.CloseGump(typeof(HairstylistBuyGump));
from.CloseGump(typeof(ChangeHairHueGump));
from.CloseGump(typeof(ChangeHairstyleGump));
AddPage(0);
AddBackground(100, 10, 350, 370, 2600);
AddBackground(120, 54, 110, 270, 5100);
AddHtmlLocalized(155, 25, 240, 30, 1011013, false, false); // <center>Hair Color Selection Menu</center>
AddHtmlLocalized(150, 330, 220, 35, 1011014, false, false); // Dye my hair this color!
AddButton(380, 330, 4005, 4007, 1, GumpButtonType.Reply, 0);
for (int i = 0; i < entries.Length; ++i)
{
ChangeHairHueEntry entry = entries[i];
AddLabel(130, 59 + (i * 22), entry.Hues[0] - 1, entry.Name);
AddButton(207, 60 + (i * 22), 5224, 5224, 0, GumpButtonType.Page, 1 + i);
}
for (int i = 0; i < entries.Length; ++i)
{
ChangeHairHueEntry entry = entries[i];
int[] hues = entry.Hues;
string name = entry.Name;
AddPage(1 + i);
for (int j = 0; j < hues.Length; ++j)
{
AddLabel(278 + ((j / 16) * 80), 52 + ((j % 16) * 17), hues[j] - 1, name);
AddRadio(260 + ((j / 16) * 80), 52 + ((j % 16) * 17), 210, 211, false, (j * entries.Length) + i);
}
}
}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:48,代码来源:CustomHairstylist.cs
示例13: HairstylistBuyGump
public HairstylistBuyGump(Mobile from, BaseVendor vendor, HairstylistBuyInfo[] sellList)
: base(50, 50)
{
m_From = from;
m_Vendor = vendor;
m_SellList = sellList;
from.CloseGump(typeof(HairstylistBuyGump));
from.CloseGump(typeof(ChangeHairHueGump));
from.CloseGump(typeof(ChangeHairstyleGump));
bool isFemale = (from.Female || from.Body.IsFemale);
int balance = Banker.GetBalance(from, vendor.TypeOfCurrency);
int canAfford = sellList.Count(t => balance >= t.Price && (!t.FacialHair || !isFemale));
AddPage(0);
AddBackground(50, 10, 450, 100 + (canAfford * 25), 2600);
AddHtmlLocalized(100, 40, 350, 20, 1018356, false, false); // Choose your hairstyle change:
int index = 0;
for (int i = 0; i < sellList.Length; ++i)
{
if (balance < sellList[i].Price || (sellList[i].FacialHair && isFemale))
{
continue;
}
if (sellList[i].TitleString != null)
{
AddHtml(140, 75 + (index * 25), 300, 20, sellList[i].TitleString, false, false);
}
else
{
AddHtmlLocalized(140, 75 + (index * 25), 300, 20, sellList[i].Title, false, false);
}
AddButton(100, 75 + (index++ * 25), 4005, 4007, 1 + i, GumpButtonType.Reply, 0);
}
}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:43,代码来源:CustomHairstylist.cs
示例14: RechargeEntry
public RechargeEntry(Mobile from, BaseVendor vendor)
: base(6271, 6)
{
m_From = from;
m_Vendor = vendor;
}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:6,代码来源:TinkerGuildmaster.cs
示例15: AAlchemistCancelMenu
public AAlchemistCancelMenu(Mobile from, BaseVendor vendor) : base(6129, 3) //Dismissal //HERE
{
m_Vendor = vendor as AAlchemist;//HERE
m_Mobile = from;
}
开发者ID:greeduomacro,项目名称:dragonknights-uo,代码行数:5,代码来源:AAlchemist.cs
示例16: DeliveryArrived
public static bool DeliveryArrived(PlayerMobile player, BaseVendor vendor)
{
for (int i = 0; i < player.Quests.Count; i ++)
{
BaseQuest quest = player.Quests[i];
for (int j = 0; j < quest.Objectives.Count; j ++)
{
BaseObjective objective = quest.Objectives[j];
if (objective is DeliverObjective)
{
DeliverObjective deliver = (DeliverObjective)objective;
if (deliver.Update(vendor))
{
if (quest.Completed)
{
player.SendLocalizedMessage(1046258, null, 0x23); // Your quest is complete.
player.PlaySound(quest.CompleteSound);
quest.OnCompleted();
if (vendor is MondainQuester)
player.SendGump(new MondainQuestGump(player, quest, MondainQuestGump.Section.Complete, false, true, (MondainQuester)vendor));
else
player.SendGump(new MondainQuestGump(quest, MondainQuestGump.Section.Complete, false, true));
}
return true;
}
}
}
}
return false;
}
开发者ID:jasegiffin,项目名称:JustUO,代码行数:37,代码来源:QuestHelper.cs
示例17: VendorBuyEntry
public VendorBuyEntry(Mobile from, BaseVendor vendor)
: base(6103, 8)
{
this.m_Vendor = vendor;
this.Enabled = vendor.CheckVendorAccess(from);
}
开发者ID:Drilikath,项目名称:ForkUO,代码行数:6,代码来源:BaseVendor.cs
示例18: AProvisionerCancelMenu
public AProvisionerCancelMenu(Mobile from, BaseVendor vendor) : base(6129, 3) //Dismissal //HERE
{
m_Vendor = vendor as AProvisioner;//HERE
m_Mobile = from;
}
开发者ID:greeduomacro,项目名称:dragonknights-uo,代码行数:5,代码来源:AProvisioner.cs
示例19: InternalSellBagTarget
public InternalSellBagTarget(BaseVendor vendor)
: base(1, false, TargetFlags.None)
{
m_Vendor = vendor;
}
开发者ID:greeduomacro,项目名称:dragonknights-uo,代码行数:5,代码来源:BaseVendor.cs
示例20: InteractTimer
public InteractTimer(Mobile from, BaseVendor vendor)
: base(TimeSpan.FromSeconds(60.0))
{
m_From = from;
m_Vendor = vendor;
}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:6,代码来源:VendorAI.cs
注:本文中的Server.Mobiles.BaseVendor类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论