本文整理汇总了C#中DOL.Database.InventoryItem类的典型用法代码示例。如果您正苦于以下问题:C# InventoryItem类的具体用法?C# InventoryItem怎么用?C# InventoryItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InventoryItem类属于DOL.Database命名空间,在下文中一共展示了InventoryItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsAllowedToCombine
/// <summary>
/// This function is called when player accept the combine
/// </summary>
/// <param name="player"></param>
/// <param name="item"></param>
public override bool IsAllowedToCombine(GamePlayer player, InventoryItem item)
{
if (!base.IsAllowedToCombine(player, item))
return false;
if (((InventoryItem)player.TradeWindow.TradeItems[0]).Object_Type !=
(int)eObjectType.AlchemyTincture)
{
player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language,
"Alchemy.IsAllowedToCombine.AlchemyTinctures"), PacketHandler.eChatType.CT_System,
PacketHandler.eChatLoc.CL_SystemWindow);
return false;
}
if (player.TradeWindow.ItemsCount > 1)
{
player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language,
"Alchemy.IsAllowedToCombine.OneTincture"), PacketHandler.eChatType.CT_System,
PacketHandler.eChatLoc.CL_SystemWindow);
return false;
}
if (item.ProcSpellID != 0 || item.SpellID != 0)
{
player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language,
"Alchemy.IsAllowedToCombine.AlreadyImbued", item.Name),
PacketHandler.eChatType.CT_System, PacketHandler.eChatLoc.CL_SystemWindow);
return false;
}
return true;
}
示例2: CreateFromTemplate
/// <summary>
/// Creates a new GameInventoryItem based on an
/// InventoryTemplateID. Will disappear after 3 minutes if
/// added to the world
/// </summary>
/// <param name="item">The InventoryItem to load and create an item from</param>
/// <returns>Found item or null</returns>
public static WorldInventoryItem CreateFromTemplate(InventoryItem item)
{
if (item.Template is ItemUnique)
return null;
return CreateFromTemplate(item.Id_nb);
}
示例3: ReceiveItem
/// <summary>
/// Handle an item given to the scholar.
/// </summary>
/// <param name="source"></param>
/// <param name="item"></param>
/// <param name="target"></param>
/// <returns></returns>
public override bool ReceiveItem(GameLiving source, GameLiving target, InventoryItem item)
{
if (base.ReceiveItem(source, target, item))
return true;
GamePlayer player = source as GamePlayer;
Scholar scholar = target as Scholar;
if (player == null || scholar == null)
return false;
if (Step == 2 && ArtifactMgr.GetArtifactID(item.Name) == ArtifactID)
{
Dictionary<String, ItemTemplate> versions = ArtifactMgr.GetArtifactVersions(ArtifactID,
(eCharacterClass)player.CharacterClass.ID, (eRealm)player.Realm);
if (versions.Count > 0 && RemoveItem(player, item))
{
GiveItem(scholar, player, ArtifactID, versions[";;"]);
String reply = String.Format("Here is the Healer's Embrace Cloak, {0} {1} {2} {3}, {4}!",
"restored to its original power. It is a fine cloak and I wish I could keep",
"it, but it is for you and you alone. Do not destroy it because you will never",
"have access to its full power again. Take care of it and it shall aid you in",
"the trials",
player.CharacterClass.Name);
scholar.TurnTo(player);
scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
FinishQuest();
return true;
}
}
return false;
}
示例4: ReceiveItem
/// <summary>
/// Handle an item given to the scholar.
/// </summary>
/// <param name="source"></param>
/// <param name="item"></param>
/// <param name="target"></param>
/// <returns></returns>
public override bool ReceiveItem(GameLiving source, GameLiving target, InventoryItem item)
{
if (base.ReceiveItem(source, target, item))
return true;
GamePlayer player = source as GamePlayer;
Scholar scholar = target as Scholar;
if (player == null || scholar == null)
return false;
if (Step == 2 && ArtifactMgr.GetArtifactID(item.Name) == ArtifactID)
{
Dictionary<String, ItemTemplate> versions = ArtifactMgr.GetArtifactVersions(ArtifactID,
(eCharacterClass)player.CharacterClass.ID, (eRealm)player.Realm);
if (versions.Count > 0 && RemoveItem(player, item))
{
GiveItem(scholar, player, ArtifactID, versions[";;"]);
String reply = String.Format("Ahh. This is a tale about some great {0} {1} {2} {3}.",
"crazy champion named Remus. There's not much known about him, or his father,",
"except what is in this tale. I've read pieces of it, but never did we find all",
"the letters. It's a great find. Thank you,",
player.Name);
scholar.TurnTo(player);
scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
FinishQuest();
return true;
}
}
return false;
}
示例5: BeginWork
/// <summary>
/// Called when player try to use a secondary crafting skill
/// </summary>
/// <param name="item"></param>
/// <param name="player"></param>
/// <returns></returns>
public static int BeginWork(GamePlayer player, InventoryItem item)
{
if (!IsAllowedToBeginWork(player, item, 50))
{
return 0;
}
GamePlayer tradePartner = null;
if (player.TradeWindow != null) tradePartner = player.TradeWindow.Partner;
if (player.IsMoving || player.IsStrafing)
{
player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "Repair.BeginWork.StopRepair1", item.Name), eChatType.CT_System, eChatLoc.CL_SystemWindow);
if (tradePartner != null) tradePartner.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "Repair.BeginWork.StopRepair2", player.Name, item.Name), eChatType.CT_System, eChatLoc.CL_SystemWindow);
return 0;
}
player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "Repair.BeginWork.BeginRepairing2", item.Name, CalculateSuccessChances(player, item).ToString()), eChatType.CT_System, eChatLoc.CL_SystemWindow);
if (tradePartner != null) tradePartner.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "Repair.BeginWork.BeginRepairing2", player.Name, item.Name), eChatType.CT_System, eChatLoc.CL_SystemWindow);
int workDuration = GetRepairTime(player, item);
player.Out.SendTimerWindow(LanguageMgr.GetTranslation(player.Client.Account.Language, "Repair.BeginWork.Repairing", item.Name), workDuration);
player.CraftTimer = new RegionTimer(player);
player.CraftTimer.Callback = new RegionTimerCallback(Proceed);
player.CraftTimer.Properties.setProperty(AbstractCraftingSkill.PLAYER_CRAFTER, player);
player.CraftTimer.Properties.setProperty(PLAYER_PARTNER, tradePartner);
player.CraftTimer.Properties.setProperty(AbstractCraftingSkill.RECIPE_BEING_CRAFTED, item);
player.CraftTimer.Start(workDuration * 1000);
return 1;
}
示例6: ReceiveItem
/// <summary>
/// Invoked when scholar receives an item.
/// </summary>
/// <param name="source"></param>
/// <param name="item"></param>
/// <returns></returns>
public override bool ReceiveItem(GameLiving source, InventoryItem item)
{
GamePlayer player = source as GamePlayer;
if (player != null)
{
lock (QuestListToGive.SyncRoot)
{
foreach (AbstractQuest quest in player.QuestList)
{
if (quest is ArtifactTurnInQuest)
{
ArtifactTurnInQuest aquest = quest as ArtifactTurnInQuest;
if (HasQuest(aquest.GetType()) != null && aquest.ReceiveItem(player, this, item))
{
return true;
}
}
}
}
}
return base.ReceiveItem(source, item);
}
示例7: ReceiveItem
/// <summary>
/// Handle an item given to the scholar.
/// </summary>
/// <param name="source"></param>
/// <param name="item"></param>
/// <param name="target"></param>
/// <returns></returns>
public override bool ReceiveItem(GameLiving source, GameLiving target, InventoryItem item)
{
if (base.ReceiveItem(source, target, item))
return true;
GamePlayer player = source as GamePlayer;
Scholar scholar = target as Scholar;
if (player == null || scholar == null)
return false;
if (Step == 2 && ArtifactMgr.GetArtifactID(item.Name) == ArtifactID)
{
Dictionary<String, ItemTemplate> versions = ArtifactMgr.GetArtifactVersions(ArtifactID,
(eCharacterClass)player.CharacterClass.ID, (eRealm)player.Realm);
if (versions.Count > 0 && RemoveItem(player, item))
{
GiveItem(scholar, player, ArtifactID, versions[";;"]);
String reply = String.Format("Great! Thanks! This should help us in {0} {1}",
"our studies. We've found several other references to this shield. Don't know how",
"much this book will help, but it certainly can't hurt!");
scholar.TurnTo(player);
scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
FinishQuest();
return true;
}
}
return false;
}
示例8: ReceiveItem
public override bool ReceiveItem(GameLiving source, InventoryItem item)
{
GamePlayer t = source as GamePlayer;
if (t == null || item == null)
return false;
if (item.Level >= 10 && item.IsCrafted)
{
if (item.Object_Type != (int) eObjectType.Magical && item.Object_Type != (int) eObjectType.Bolt && item.Object_Type != (int) eObjectType.Poison)
{
if (item.Bonus == 0)
{
t.TempProperties.setProperty(ENCHANT_ITEM_WEAK, new WeakRef(item));
t.Client.Out.SendCustomDialog(LanguageMgr.GetTranslation(t.Client, "Enchanter.ReceiveItem.Text1", Money.GetString(CalculEnchantPrice(item))), new CustomDialogResponse(EnchanterDialogResponse));
}
else
SayTo(t, eChatLoc.CL_SystemWindow, LanguageMgr.GetTranslation(t.Client, "Enchanter.ReceiveItem.Text2"));
}
else
SayTo(t, eChatLoc.CL_SystemWindow, LanguageMgr.GetTranslation(t.Client, "Enchanter.ReceiveItem.Text3"));
}
else
SayTo(t, eChatLoc.CL_SystemWindow, LanguageMgr.GetTranslation(t.Client, "Enchanter.ReceiveItem.Text4"));
return false;
}
示例9: ReceiveItem
/// <summary>
/// Handle an item given to the scholar.
/// </summary>
/// <param name="source"></param>
/// <param name="item"></param>
/// <param name="target"></param>
/// <returns></returns>
public override bool ReceiveItem(GameLiving source, GameLiving target, InventoryItem item)
{
GamePlayer player = source as GamePlayer;
Scholar scholar = target as Scholar;
if (player == null || scholar == null)
return false;
if (Step == 2 && ArtifactMgr.GetArtifactID(item.Name) == ArtifactID)
{
Dictionary<String, ItemTemplate> versions = ArtifactMgr.GetArtifactVersions(ArtifactID,
(eCharacterClass)player.CharacterClass.ID, (eRealm)player.Realm);
IDictionaryEnumerator versionsEnum = versions.GetEnumerator();
versionsEnum.MoveNext();
if (versions.Count > 0 && RemoveItem(player, item))
{
GiveItem(scholar, player, ArtifactID, versionsEnum.Value as ItemTemplate);
String reply = String.Format("Thank you! Here, take this cloak. {0}",
"I hope you find it useful. Please don't lose it, I can't replace it!");
scholar.TurnTo(player);
scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
FinishQuest();
return true;
}
}
return base.ReceiveItem(source, target, item);
}
示例10: ReceiveItem
/// <summary>
/// Handle an item given to the scholar.
/// </summary>
/// <param name="source"></param>
/// <param name="item"></param>
/// <param name="target"></param>
/// <returns></returns>
public override bool ReceiveItem(GameLiving source, GameLiving target, InventoryItem item)
{
if (base.ReceiveItem(source, target, item))
return true;
GamePlayer player = source as GamePlayer;
Scholar scholar = target as Scholar;
if (player == null || scholar == null)
return false;
if (Step == 2 && ArtifactMgr.GetArtifactID(item.Name) == ArtifactID)
{
Dictionary<String, ItemTemplate> versions = ArtifactMgr.GetArtifactVersions(ArtifactID,
(eCharacterClass)player.CharacterClass.ID, (eRealm)player.Realm);
if (versions.Count > 0 && RemoveItem(player, item))
{
GiveItem(scholar, player, ArtifactID, versions[";;"]);
String reply = String.Format("Brilliant, thank you! Here, take the artifact. {0} {1} {2}",
"I've unlocked its powers for you. As I've said before, I'm more interested",
"in the stories and the history behind these artifacts than the actual items",
"themselves.");
scholar.TurnTo(player);
scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
FinishQuest();
return true;
}
}
return false;
}
示例11: ReceiveItem
public override bool ReceiveItem(GameLiving source, InventoryItem item)
{
GamePlayer player = source as GamePlayer;
if (player == null || item == null) return false;
bool output = false;
#region messages
if (player.BountyPoints < 300)
{
SendReply(player, "You need 300 bounty points to use my service!");
return false;
}
if (WorldMgr.GetDistance(this, player) > WorldMgr.INTERACT_DISTANCE)
{
player.Out.SendMessage("You are too far away to give anything to " + GetName(0, false) + ".", eChatType.CT_System, eChatLoc.CL_SystemWindow);
return false;
}
if ((player.TempProperties.getProperty<InventoryItem>(TempProperty)) != null)
{
item = player.TempProperties.getProperty<InventoryItem>(TempProperty);
SendReply(player, "You already gave me an item! What was it again?");
output = true;
}
SendReply(player, "Ok, now whisper me the model ID.");
player.TempProperties.setProperty(TempProperty, item);
return true;
#endregion messages
}
示例12: ReceiveItem
/// <summary>
/// Handle an item given to the scholar.
/// </summary>
/// <param name="source"></param>
/// <param name="item"></param>
/// <param name="target"></param>
/// <returns></returns>
public override bool ReceiveItem(GameLiving source, GameLiving target, InventoryItem item)
{
if (base.ReceiveItem(source, target, item))
return true;
GamePlayer player = source as GamePlayer;
Scholar scholar = target as Scholar;
if (player == null || scholar == null)
return false;
if (Step == 2 && ArtifactMgr.GetArtifactID(item.Name) == ArtifactID)
{
Dictionary<String, ItemTemplate> versions = ArtifactMgr.GetArtifactVersions(ArtifactID,
(eCharacterClass)player.CharacterClass.ID, (eRealm)player.Realm);
if (versions.Count > 0 && RemoveItem(player, item))
{
IDictionaryEnumerator versionsEnum = versions.GetEnumerator();
versionsEnum.MoveNext();
GiveItem(scholar, player, ArtifactID, versionsEnum.Value as ItemTemplate);
String reply = String.Format("Here is your gloves. Do not lose it, it is irreplaceable.");
scholar.TurnTo(player);
scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
FinishQuest();
return true;
}
}
return false;
}
示例13: ReceiveItem
/// <summary>
/// Handle an item given to the scholar.
/// </summary>
/// <param name="source"></param>
/// <param name="item"></param>
/// <param name="target"></param>
/// <returns></returns>
public override bool ReceiveItem(GameLiving source, GameLiving target, InventoryItem item)
{
if (base.ReceiveItem(source, target, item))
return true;
GamePlayer player = source as GamePlayer;
Scholar scholar = target as Scholar;
if (player == null || scholar == null)
return false;
if (Step == 2 && ArtifactMgr.GetArtifactID(item.Name) == ArtifactID)
{
scholar.TurnTo(player);
if (RemoveItem(player, item))
{
String reply = String.Format("You now have a decision to make, {0}. {1} {2} {3} {4} {5}",
player.CharacterClass.Name,
"I can unlock your Battler so it uses [slashing] skills or so it uses",
"[crushing] skills. In both cases, I can unlock it as a one-handed weapon",
"or a two-handed one. All you must do is decide which kind of damage you",
"would like to do to your enemies. Once you have chosen, you cannot change",
"your mind.");
scholar.SayTo(player, eChatLoc.CL_PopupWindow, reply);
Step = 3;
return true;
}
}
return false;
}
示例14: AttackDamage
public override double AttackDamage(InventoryItem weapon)
{
if (this.Name.ToLower().Contains("air"))
return (base.AttackDamage(weapon) * 0.6 * ServerProperties.Properties.THEURGIST_PET_DAMAGE_MULTIFLIER);
else if (this.Name.ToLower().Contains("ice"))
return (base.AttackDamage(weapon) * 0.8 * ServerProperties.Properties.THEURGIST_PET_DAMAGE_MULTIFLIER);
return (base.AttackDamage(weapon) * 1.0 * ServerProperties.Properties.THEURGIST_PET_DAMAGE_MULTIFLIER);
}
示例15: ReceiveItem
public override bool ReceiveItem(GameLiving source, InventoryItem item)
{
GamePlayer player = source as GamePlayer;
if (player == null || item == null)
return false;
if (item.Count != 1)
{
player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language,
"Scripts.Blacksmith.StackedObjets", GetName(0, false)),
eChatType.CT_System, eChatLoc.CL_SystemWindow);
return false;
}
switch (item.Object_Type)
{
case (int)eObjectType.GenericItem:
case (int)eObjectType.Magical:
case (int)eObjectType.Instrument:
case (int)eObjectType.Poison:
SayTo(player, LanguageMgr.GetTranslation(player.Client.Account.Language,
"Scripts.Blacksmith.CantRepairThat"));
return false;
}
if (item.Condition < item.MaxCondition)
{
if (item.Durability <= 0)
{
player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language,
"Scripts.Blacksmith.ObjectCantRepaired"), eChatType.CT_System,
eChatLoc.CL_SystemWindow);
return false;
}
else
{
player.TempProperties.setProperty(REPAIR_ITEM_WEAK, new WeakRef(item));
player.Client.Out.SendCustomDialog(LanguageMgr.GetTranslation(player.Client.Account.Language,
"Scripts.Blacksmith.RepairCostAccept",
Money.GetString(item.RepairCost), item.Name),
new CustomDialogResponse(BlacksmithDialogResponse));
}
}
else
{
player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language,
"Scripts.Blacksmith.NoNeedRepair"), eChatType.CT_System,
eChatLoc.CL_SystemWindow);
}
return false;
}