本文整理汇总了C#中DOL.Database.InventoryItem类的典型用法代码示例。如果您正苦于以下问题:C# InventoryItem类的具体用法?C# InventoryItem怎么用?C# InventoryItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InventoryItem类属于DOL.Database命名空间,在下文中一共展示了InventoryItem类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:mynew4,项目名称:DAoC,代码行数:40,代码来源:Alchemy.cs
示例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);
}
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:14,代码来源:WorldInventoryItem.cs
示例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;
}
开发者ID:mynew4,项目名称:DAoC,代码行数:40,代码来源:AHealersEmbrace.cs
示例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;
}
开发者ID:mynew4,项目名称:DAoC,代码行数:39,代码来源:AtensShield.cs
示例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;
}
开发者ID:mynew4,项目名称:DAoC,代码行数:36,代码来源:Repair.cs
示例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);
}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:31,代码来源:ArtifactScholar.cs
示例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;
}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:37,代码来源:ShieldOfKhaos.cs
示例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;
}
开发者ID:mynew4,项目名称:DAoC,代码行数:26,代码来源:Enchanter.cs
示例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);
}
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:36,代码来源:Cloudsong.cs
示例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;
}
开发者ID:mynew4,项目名称:DAoC,代码行数:38,代码来源:BeltofOglidarsh.cs
示例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
}
开发者ID:mynew4,项目名称:DAoC,代码行数:27,代码来源:ItemModel.cs
示例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;
}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:37,代码来源:MaddeningScalars.cs
示例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;
}
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:37,代码来源:Battler.cs
示例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);
}
开发者ID:mynew4,项目名称:DAoC,代码行数:8,代码来源:TheurgistPet.cs
示例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;
}
开发者ID:Refizul,项目名称:DOL-Kheldron,代码行数:56,代码来源:Blacksmith.cs
示例16: ReceiveItem
public override bool ReceiveItem(GameLiving source, InventoryItem item)
{
GamePlayer t = source as GamePlayer;
if (t == null || item == null)
return false;
if (item.Emblem != 0)
{
t.Out.SendMessage("This item already has an emblem on it.", eChatType.CT_System, eChatLoc.CL_SystemWindow);
return false;
}
if (item.Object_Type == (int) eObjectType.Shield
|| item.Item_Type == Slot.CLOAK)
{
if (t.Guild == null)
{
t.Out.SendMessage("You have no guild.", eChatType.CT_System, eChatLoc.CL_SystemWindow);
return false;
}
if (t.Guild.Emblem == 0)
{
t.Out.SendMessage("Your guild has no emblem.", eChatType.CT_System, eChatLoc.CL_SystemWindow);
return false;
}
if (t.Level < 20) //if level of player < 20 so can not put emblem
{
if (t.CraftingPrimarySkill == eCraftingSkill.NoCrafting)
{
t.Out.SendMessage("You have to be at least level 20 or have 400 in a tradeskill to be able to wear an emblem.", eChatType.CT_System, eChatLoc.CL_SystemWindow);
return false;
}
else
{
if (t.GetCraftingSkillValue(t.CraftingPrimarySkill) < 400)
{
t.Out.SendMessage("You have to be at least level 20 or have 400 in a tradeskill to be able to wear an emblem.", eChatType.CT_System, eChatLoc.CL_SystemWindow);
return false;
}
}
}
if (!t.Guild.HasRank(t, Guild.eRank.Emblem))
{
t.Out.SendMessage("You do not have enough privileges for that.", eChatType.CT_System, eChatLoc.CL_SystemWindow);
return false;
}
t.TempProperties.setProperty(EMBLEMIZE_ITEM_WEAK, new WeakRef(item));
t.Out.SendCustomDialog("Do you agree to put an emblem on this object?", new CustomDialogResponse(EmblemerDialogResponse));
}
else
t.Out.SendMessage("I can not put an emblem on this item.", eChatType.CT_System, eChatLoc.CL_SystemWindow);
return false;
}
开发者ID:mynew4,项目名称:DAoC,代码行数:56,代码来源:EmblemNPC.cs
示例17: SelfCraftWindow
public SelfCraftWindow(GamePlayer owner, InventoryItem item)
{
if (owner == null)
throw new ArgumentNullException("owner");
m_owner = owner;
m_tradeItems = new ArrayList(10);
m_itemToCombine = new ArrayList(1);
m_itemToCombine.Add(item);
}
开发者ID:mynew4,项目名称:DAoC,代码行数:11,代码来源:SelfCraftWindow.cs
示例18: 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.Recharger.ReceiveItem.StackedObjects",
GetName(0, false, player.Client.Account.Language, this)), eChatType.CT_System, eChatLoc.CL_SystemWindow);
return false;
}
if((item.SpellID == 0 && item.SpellID1 == 0) ||
(item.Object_Type == (int)eObjectType.Poison) ||
(item.Object_Type == (int)eObjectType.Magical && (item.Item_Type == 40 || item.Item_Type == 41)))
{
SayTo(player, LanguageMgr.GetTranslation(player.Client.Account.Language, "Scripts.Recharger.ReceiveItem.CantThat"));
return false;
}
// WHRIA
if (item.SpellID != 0 && item.MaxCharges==0
|| item.SpellID1 != 0 && item.MaxCharges1 == 0)
{
SayTo(player, "MaxCharge should be greater than 0 !!! Report to GM");
return false;
}
// END
if(item.Charges == item.MaxCharges && item.Charges1 == item.MaxCharges1)
{
SayTo(player, LanguageMgr.GetTranslation(player.Client.Account.Language, "Scripts.Recharger.ReceiveItem.FullyCharged"));
return false;
}
long NeededMoney=0;
if (item.Charges < item.MaxCharges)
{
player.TempProperties.setProperty(RECHARGE_ITEM_WEAK, new WeakRef(item));
NeededMoney += (item.MaxCharges - item.Charges)*Money.GetMoney(0,0,10,0,0);
}
if (item.Charges1 < item.MaxCharges1)
{
player.TempProperties.setProperty(RECHARGE_ITEM_WEAK, new WeakRef(item));
NeededMoney += (item.MaxCharges1 - item.Charges1)*Money.GetMoney(0,0,10,0,0);
}
if(NeededMoney > 0)
{
player.Client.Out.SendCustomDialog(LanguageMgr.GetTranslation(player.Client.Account.Language, "Scripts.Recharger.ReceiveItem.Cost", Money.GetString(NeededMoney)), new CustomDialogResponse(RechargerDialogResponse));
return true;
}
return false;
}
开发者ID:mynew4,项目名称:DAoC,代码行数:54,代码来源:Recharger.cs
示例19: ReceiveItem
/// <summary>
/// Called when the living is about to get an item from someone
/// else
/// </summary>
/// <param name="source">Source from where to get the item</param>
/// <param name="item">Item to get</param>
/// <returns>true if the item was successfully received</returns>
public override bool ReceiveItem(GameLiving source, InventoryItem item)
{
if (source == null || item == null) return false;
if (source is GamePlayer)
{
GamePlayer player = (GamePlayer)source;
if (item.Name.ToLower().StartsWith(LanguageMgr.GetTranslation(ServerProperties.Properties.DB_LANGUAGE, "GameStableMaster.ReceiveItem.TicketTo")) && item.Item_Type == 40)
{
foreach (GameNPC npc in GetNPCsInRadius(1500))
{
if (npc is GameTaxiBoat)
{
player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GameBoatStableMaster.ReceiveItem.Departed", this.Name), eChatType.CT_System, eChatLoc.CL_PopupWindow);
return false;
}
}
String destination = item.Name.Substring(LanguageMgr.GetTranslation(ServerProperties.Properties.DB_LANGUAGE, "GameStableMaster.ReceiveItem.TicketTo").Length);
PathPoint path = MovementMgr.LoadPath(item.Id_nb);
//PathPoint path = MovementMgr.Instance.LoadPath(this.Name + "=>" + destination);
if ((path != null) && ((Math.Abs(path.X - this.X)) < 500) && ((Math.Abs(path.Y - this.Y)) < 500))
{
player.Inventory.RemoveCountFromStack(item, 1);
InventoryLogging.LogInventoryAction(player, this, eInventoryActionType.Merchant, item.Template);
GameTaxiBoat boat = new GameTaxiBoat();
boat.Name = "Boat to " + destination;
boat.Realm = source.Realm;
boat.X = path.X;
boat.Y = path.Y;
boat.Z = path.Z;
boat.CurrentRegion = CurrentRegion;
boat.Heading = path.GetHeading( path.Next );
boat.AddToWorld();
boat.CurrentWayPoint = path;
GameEventMgr.AddHandler(boat, GameNPCEvent.PathMoveEnds, new DOLEventHandler(OnHorseAtPathEnd));
//new MountHorseAction(player, boat).Start(400);
new HorseRideAction(boat).Start(30 * 1000);
player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GameBoatStableMaster.ReceiveItem.SummonedBoat", this.Name, destination), eChatType.CT_System, eChatLoc.CL_SystemWindow);
return true;
}
else
{
player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GameBoatStableMaster.ReceiveItem.UnknownWay", this.Name, destination), eChatType.CT_System, eChatLoc.CL_SystemWindow);
}
}
}
return base.ReceiveItem(source, item);
}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:60,代码来源:GameBoatStableMaster.cs
示例20: ReceiveItem
public override bool ReceiveItem(GameLiving source, InventoryItem item)
{
GamePlayer player = source as GamePlayer;
if (player == null)
{
return false;
}
Refund(item, player);
return false;
}
开发者ID:mynew4,项目名称:DAoC,代码行数:12,代码来源:BPRefunder.cs
注:本文中的DOL.Database.InventoryItem类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论