当前位置: 首页>>代码示例>>C#>>正文


C# GamePlayer.RemoveBountyPoints方法代码示例

本文整理汇总了C#中GamePlayer.RemoveBountyPoints方法的典型用法代码示例。如果您正苦于以下问题:C# GamePlayer.RemoveBountyPoints方法的具体用法?C# GamePlayer.RemoveBountyPoints怎么用?C# GamePlayer.RemoveBountyPoints使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GamePlayer的用法示例。


在下文中一共展示了GamePlayer.RemoveBountyPoints方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Invoke

		public void Invoke(GamePlayer player, int payType, GameKeepHookPoint hookpoint, GameKeepComponent component)
		{
			if (!hookpoint.IsFree)
			{
				player.Out.SendMessage("The hookpoint is already used!", eChatType.CT_Merchant, eChatLoc.CL_SystemWindow);
				return;
			}
			//1=or 2=BP 3=GuildBP 4=contract
			//todo enum
			switch (payType)
			{
				case 1:
					{
						if (!player.RemoveMoney(Gold * 100 * 100, "You buy " + this.GetName(1, false) + "."))
						{
                            InventoryLogging.LogInventoryAction(player, "(keep)", eInventoryActionType.Merchant, Gold * 10000);
							player.Out.SendMessage("You dont have enough money!", eChatType.CT_Merchant, eChatLoc.CL_SystemWindow);
							return;
						}
					} break;
				case 2:
					{
						if (!player.RemoveBountyPoints(Gold, "You buy " + this.GetName(1, false) + "."))
						{
							player.Out.SendMessage("You dont have enough bounty point!", eChatType.CT_Merchant, eChatLoc.CL_SystemWindow);
							return;
						}
					} break;
				case 3:
					{
						if (player.Guild == null) return;
						if (!player.Guild.RemoveBountyPoints(Gold))
						{
							player.Out.SendMessage("You dont have enough bounty point!", eChatType.CT_Merchant, eChatLoc.CL_SystemWindow);
							return;
						}
						else
							player.Out.SendMessage("You buy " + this.GetName(1, false) + ".", eChatType.CT_Merchant, eChatLoc.CL_SystemWindow);

					} break;
				case 4:
					{
						player.Out.SendMessage("NOT IMPLEMENTED YET, SORRY", eChatType.CT_Merchant, eChatLoc.CL_SystemWindow);
						return;
					}

			}

			GameLiving hookPointObj = CreateHPInstance(this.GameObjectType);
			if (hookPointObj == null) return;
			//use default value so no need to load
			//hookPointObj.LoadFromDatabase(this.ObjectTemplate);
			hookPointObj.CurrentRegion = player.CurrentRegion;
			hookPointObj.Realm = hookpoint.Component.Keep.Realm;

			if (hookPointObj is GameSiegeWeapon)
				((GameSiegeWeapon)hookPointObj).EnableToMove = false;
			hookPointObj.X = hookpoint.X;
			hookPointObj.Y = hookpoint.Y;
			hookPointObj.Z = hookpoint.Z;
			hookPointObj.Heading = hookpoint.Heading;

			if (hookPointObj is GameSiegeWeapon)
				(hookPointObj as GameSiegeWeapon).HookPoint = hookpoint;
			if (hookPointObj is IKeepItem)
				(hookPointObj as IKeepItem).Component = component;
			if (hookPointObj is GameSiegeCauldron)
				(hookPointObj as GameSiegeCauldron).Component = component;
			if (hookPointObj is GameKeepGuard)
			{
				(hookPointObj as GameKeepGuard).HookPoint = hookpoint;
				Keeps.TemplateMgr.RefreshTemplate(hookPointObj as GameKeepGuard);
			}
			if (hookPointObj is GameNPC)
			{
				((GameNPC)hookPointObj).RespawnInterval = -1;//do not respawn
			}
			hookPointObj.AddToWorld();
			if (hookPointObj is GameKeepGuard)
			{
				(hookPointObj as GameKeepGuard).Component.Keep.Guards.Add(hookPointObj.ObjectID, hookPointObj);
				((GameNPC)hookPointObj).RespawnInterval = Util.Random(10, 30) * 60 * 1000;
			}
			hookpoint.Object = hookPointObj;

			//create the db entry
			Database.DBKeepHookPointItem item = new DOL.Database.DBKeepHookPointItem(component.Keep.KeepID, component.ID, hookpoint.ID, GameObjectType);
			GameServer.Database.AddObject(item);
		}
开发者ID:boscorillium,项目名称:dol,代码行数:89,代码来源:HookPointInventory.cs

示例2: SetProc

        public void SetProc(GamePlayer player, int proc)
        {
            InventoryItem item = player.TempProperties.getProperty<InventoryItem>(TempProperty);
            player.TempProperties.removeProperty(TempProperty);

            if (item == null || item.OwnerID != player.InternalID || item.OwnerID == null)
                return;

            player.Inventory.RemoveItem(item);

            ItemUnique unique = new ItemUnique(item.Template);
            unique.ProcSpellID = proc;
            GameServer.Database.AddObject(unique);

            player.RemoveBountyPoints(300);

            InventoryItem newInventoryItem = GameInventoryItem.Create<ItemUnique>(unique);
            player.Inventory.AddItem(eInventorySlot.FirstEmptyBackpack, newInventoryItem);
            player.Out.SendInventoryItemsUpdate(new InventoryItem[] { newInventoryItem });
            SendReply(player, "My work upon " + item.Name + " is complete.\n Farewell " + player.Name + ".");
        }
开发者ID:mynew4,项目名称:DAoC,代码行数:21,代码来源:ProcNPC.cs

示例3: SetModel

        public void SetModel(GamePlayer player, int number)
        {
            InventoryItem item = player.TempProperties.getProperty<InventoryItem>(TempProperty);
            player.TempProperties.removeProperty(TempProperty);

            if (item == null || item.OwnerID != player.InternalID || item.OwnerID == null)
                return;

            player.Inventory.RemoveItem(item);

            ItemUnique unique = new ItemUnique(item.Template);
            unique.Model = number;
            GameServer.Database.AddObject(unique);

            InventoryItem newInventoryItem = GameInventoryItem.Create<ItemUnique>(unique);
            player.Inventory.AddItem(eInventorySlot.FirstEmptyBackpack, newInventoryItem);
            player.Out.SendInventoryItemsUpdate(new InventoryItem[] { newInventoryItem });
            player.RemoveBountyPoints(300);
            player.SaveIntoDatabase();
        }
开发者ID:mynew4,项目名称:DAoC,代码行数:20,代码来源:ItemModel.cs


注:本文中的GamePlayer.RemoveBountyPoints方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。