示例#1
0
        private void BuyLot(GamePlayer player, byte response)
        {
            if (response != 0x01)
            {
                return;
            }

            lock (DatabaseItem)             // Mannen 10:56 PM 10/30/2006 - Fixing every lock(this)
            {
                if (!string.IsNullOrEmpty(DatabaseItem.OwnerID))
                {
                    return;
                }

                if (HouseMgr.GetHouseNumberByPlayer(player) != 0 && player.Client.Account.PrivLevel != (int)ePrivLevel.Admin)
                {
                    ChatUtil.SendMerchantMessage(player, "You already own another lot or house (Number " + HouseMgr.GetHouseNumberByPlayer(player) + ").");
                    return;
                }

                long totalCost = HouseTemplateMgr.GetLotPrice(DatabaseItem);
                if (player.RemoveMoney(totalCost, "You just bought this lot for {0}.",
                                       eChatType.CT_Merchant, eChatLoc.CL_SystemWindow))
                {
                    InventoryLogging.LogInventoryAction(player, this, eInventoryActionType.Merchant, totalCost);
                    DatabaseItem.LastPaid = DateTime.Now;
                    DatabaseItem.OwnerID  = player.ObjectId;
                    CreateHouse(player, 0);
                }
                else
                {
                    ChatUtil.SendMerchantMessage(player, "You dont have enough money!");
                }
            }
        }
示例#2
0
        public override void FinishQuest()
        {
            base.FinishQuest(); // Defined in Quest, changes the state, stores in DB etc ...

            RemoveItem(dalikor, QuestPlayer, necklaceOfDoppelganger);

            // Give reward to player here ...
            if (QuestPlayer.HasAbilityToUseItem(recruitsBoots))
            {
                GiveItem(dalikor, QuestPlayer, recruitsBoots);
            }
            else
            {
                GiveItem(dalikor, QuestPlayer, recruitsQuiltedBoots);
            }

            QuestPlayer.GainExperience(GameLiving.eXPSource.Quest, 40, true);
            long money = Money.GetMoney(0, 0, 0, 4, Util.Random(50));

            QuestPlayer.AddMoney(money, "You recieve {0} as a reward.");
            InventoryLogging.LogInventoryAction("(QUEST;" + Name + ")", QuestPlayer, eInventoryActionType.Quest, money);

            GameEventMgr.RemoveHandler(QuestPlayer, GamePlayerEvent.UseSlot, new DOLEventHandler(PlayerUseSlot));
            GameEventMgr.RemoveHandler(QuestPlayer, GamePlayerEvent.Quit, new DOLEventHandler(PlayerLeftWorld));
        }
示例#3
0
        private static void HouseUpgradeDialog(GamePlayer player, byte response)
        {
            if (response != 0x01)
            {
                return;
            }

            var itemWeak = player.TempProperties.getProperty <WeakReference>(DeedWeak, new WeakRef(null));

            player.TempProperties.removeProperty(DeedWeak);

            var item  = (InventoryItem)itemWeak.Target;
            var house = (House)player.TempProperties.getProperty <object>(TargetHouse, null);

            player.TempProperties.removeProperty(TargetHouse);

            if (house == null)
            {
                ChatUtil.SendSystemMessage(player, "No House selected!");
                return;
            }

            if (item == null || item.SlotPosition == (int)eInventorySlot.Ground ||
                item.OwnerID == null || item.OwnerID != player.InternalID)
            {
                ChatUtil.SendSystemMessage(player, "This does not work without a House Deed.");
                return;
            }

            if (HouseMgr.UpgradeHouse(house, item))
            {
                player.Inventory.RemoveItem(item);
                InventoryLogging.LogInventoryAction(player, $"(HOUSE;{house.HouseNumber})", eInventoryActionType.Other, item.Template, item.Count);
            }
        }
示例#4
0
        protected void RespecDialogResponse(GamePlayer player, byte response)
        {
            if (response != 0x01)
            {
                return;                               //declined
            }
            int specPoints      = player.SkillSpecialtyPoints;
            int realmSpecPoints = player.RealmSpecialtyPoints;

            if (player.TempProperties.getProperty(ALL_RESPEC, false))
            {
                player.RespecAll();
                player.TempProperties.removeProperty(ALL_RESPEC);
            }
            if (player.TempProperties.getProperty(DOL_RESPEC, false))
            {
                player.RespecDOL();
                player.TempProperties.removeProperty(DOL_RESPEC);
            }
            if (player.TempProperties.getProperty(RA_RESPEC, false))
            {
                player.RespecRealm();
                player.TempProperties.removeProperty(RA_RESPEC);
            }
            if (player.TempProperties.getProperty <object>(LINE_RESPEC, null) != null)
            {
                Specialization specLine = (Specialization)player.TempProperties.getProperty <object>(LINE_RESPEC, null);
                player.RespecSingle(specLine);
                player.TempProperties.removeProperty(LINE_RESPEC);
            }
            if (player.TempProperties.getProperty(BUY_RESPEC, false))
            {
                player.TempProperties.removeProperty(BUY_RESPEC);
                if (player.RespecCost >= 0 && player.RemoveMoney(player.RespecCost * 10000))
                {
                    InventoryLogging.LogInventoryAction(player, "(respec)", eInventoryActionType.Merchant, player.RespecCost * 10000);
                    player.RespecAmountSingleSkill++;
                    player.RespecBought++;
                    DisplayMessage(player, "You bought a single line respec!");
                }
                player.Out.SendUpdateMoney();
            }
            // Assign full points returned
            if (player.SkillSpecialtyPoints > specPoints)
            {
                player.RemoveAllStyles();                 // Kill styles
                DisplayMessage(player, "You regain " + (player.SkillSpecialtyPoints - specPoints) + " specialization points!");
            }
            if (player.RealmSpecialtyPoints > realmSpecPoints)
            {
                DisplayMessage(player, "You regain " + (player.RealmSpecialtyPoints - realmSpecPoints) + " realm specialization points!");
            }
            player.RefreshSpecDependantSkills(false);
            // Notify Player of points
            player.Out.SendUpdatePlayerSkills();
            player.Out.SendUpdatePoints();
            player.Out.SendUpdatePlayer();
            player.SendTrainerWindow();
            player.SaveIntoDatabase();
        }
示例#5
0
        public override void FinishQuest()
        {
            base.FinishQuest();             //Defined in Quest, changes the state, stores in DB etc ...

            //Give reward to player here ...
            RemoveItem(dalikor, m_questPlayer, dustyOldMap);

            if (m_questPlayer.HasAbilityToUseItem(recruitsArms))
            {
                GiveItem(dalikor, m_questPlayer, recruitsArms);
            }
            else
            {
                GiveItem(dalikor, m_questPlayer, recruitsSleeves);
            }

            m_questPlayer.GainExperience(GameLiving.eXPSource.Quest, 240, true);
            long money = Money.GetMoney(0, 0, 0, 6, Util.Random(50));

            m_questPlayer.AddMoney(money, "You recieve {0} as a reward.");
            InventoryLogging.LogInventoryAction("(QUEST;" + Name + ")", m_questPlayer, eInventoryActionType.Quest, money);

            GameEventMgr.RemoveHandler(m_questPlayer, GamePlayerEvent.UseSlot, new DOLEventHandler(PlayerUseSlot));
            GameEventMgr.RemoveHandler(m_questPlayer, GamePlayerEvent.Quit, new DOLEventHandler(PlayerLeftWorld));
        }
        public override void Perform(DOLEvent e, object sender, EventArgs args)
        {
            GamePlayer player = BehaviourUtils.GuessGamePlayerFromNotify(e, sender, args);

            player.AddMoney(P);
            InventoryLogging.LogInventoryAction(NPC, player, eInventoryActionType.Quest, P);
        }
示例#7
0
        public void HandlePacket(GameClient client, GSPacketIn packet)
        {
            packet.Skip(4);
            int           slot = packet.ReadShort();
            InventoryItem item = client.Player.Inventory.GetItem((eInventorySlot)slot);

            if (item != null)
            {
                if (item.IsIndestructible)
                {
                    client.Out.SendMessage(String.Format("You can't destroy {0}!",
                                                         item.GetName(0, false)), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                    return;
                }

                if (item.Id_nb == "ARelic")
                {
                    client.Out.SendMessage("You cannot destroy a relic!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
                    return;
                }

                if (client.Player.Inventory.EquippedItems.Contains(item))
                {
                    client.Out.SendMessage("You cannot destroy an equipped item!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
                    return;
                }

                if (client.Player.Inventory.RemoveItem(item))
                {
                    client.Out.SendMessage("You destroy the " + item.Name + ".", eChatType.CT_System, eChatLoc.CL_SystemWindow);
                    InventoryLogging.LogInventoryAction(client.Player, "(destroy)", eInventoryActionType.Other, item.Template, item.Count);
                }
            }
        }
示例#8
0
 protected static void RemoveItem(GameLiving target, GamePlayer player, ItemTemplate itemTemplate, bool notify)
 {
     if (itemTemplate == null)
     {
         log.Error("itemtemplate is null in RemoveItem:" + Environment.StackTrace);
         return;
     }
     lock (player.Inventory)
     {
         InventoryItem item = player.Inventory.GetFirstItemByID(itemTemplate.Id_nb, eInventorySlot.FirstBackpack, eInventorySlot.LastBackpack);
         if (item != null)
         {
             player.Inventory.RemoveItem(item);
             InventoryLogging.LogInventoryAction(player, target, eInventoryActionType.Quest, item.Template, item.Count);
             if (target != null)
             {
                 player.Out.SendMessage("You give the " + itemTemplate.Name + " to " + target.GetName(0, false), eChatType.CT_System, eChatLoc.CL_SystemWindow);
             }
         }
         else if (notify)
         {
             player.Out.SendMessage("You cannot remove the \"" + itemTemplate.Name + "\" because you don't have it.", eChatType.CT_System, eChatLoc.CL_SystemWindow);
         }
     }
 }
示例#9
0
        /// <summary>
        /// Called to finish the task.
        /// </summary>
        public virtual void FinishTask()
        {
            if (RewardXP > 0)
            {
                m_taskPlayer.GainExperience(GameLiving.eXPSource.Task, RewardXP);
            }

            if (RewardMoney > 0)
            {
                m_taskPlayer.AddMoney(RewardMoney, "You recieve {0} for completing your task.");
                InventoryLogging.LogInventoryAction("(TASK;" + m_dbTask.TaskType + ")", m_taskPlayer, eInventoryActionType.Quest, RewardMoney);
            }

            if (RewardItems != null && RewardItems.Count > 0)
            {
                m_taskPlayer.Inventory.BeginChanges();
                foreach (InventoryItem item in RewardItems)
                {
                    if (m_taskPlayer.Inventory.AddItem(eInventorySlot.FirstEmptyBackpack, item))
                    {
                        InventoryLogging.LogInventoryAction("(TASK;" + m_dbTask.TaskType + ")", m_taskPlayer, eInventoryActionType.Quest, item.Template, item.Count);
                    }
                }
                m_taskPlayer.Inventory.CommitChanges();
            }
            m_taskPlayer.Out.SendMessage("You finish the " + Name + "!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
            m_dbTask.TaskType = typeof(AbstractTask).ToString();
            m_dbTask.CustomPropertiesString = null;
            m_customProperties.Clear();
            m_dbTask.TasksDone += 1;

            SaveIntoDatabase();
        }
示例#10
0
文件: Repair.cs 项目: mywebext/DOL
        public static int CalculatePlayersWood(GamePlayer player, int removeamount)
        {
            int amount = 0;

            foreach (InventoryItem item in player.Inventory.GetItemRange(eInventorySlot.FirstBackpack, eInventorySlot.LastBackpack))
            {
                foreach (string name in WoodNames)
                {
                    if (item.Name.Replace(" wooden boards", "").ToLower() == name)
                    {
                        int woodvalue = GetWoodValue(item.Name.ToLower());
                        amount += item.Count * woodvalue;
                        if (removeamount > 0)
                        {
                            if (item.Count * woodvalue < removeamount)
                            {
                                int removecount = Math.Min(1, removeamount / woodvalue);
                                removeamount -= removecount * woodvalue;
                                player.Inventory.RemoveCountFromStack(item, removecount);
                                InventoryLogging.LogInventoryAction(player, "(craft)", eInventoryActionType.Craft, item.Template, removecount);
                            }
                            else
                            {
                                removeamount -= item.Count * woodvalue;
                                player.Inventory.RemoveItem(item);
                                InventoryLogging.LogInventoryAction(player, "(craft)", eInventoryActionType.Craft, item.Template, item.Count);
                            }
                        }
                        break;
                    }
                }
            }
            return(amount);
        }
示例#11
0
文件: CraftTask.cs 项目: mywebext/DOL
        /// <summary>
        /// This method needs to be implemented in each task.
        /// It is the core of the task. The global event hook of the GamePlayer.
        /// This method will be called whenever a GamePlayer with this task
        /// fires ANY event!
        /// </summary>
        /// <param name="e">The event type</param>
        /// <param name="sender">The sender of the event</param>
        /// <param name="args">The event arguments</param>
        public override void Notify(DOLEvent e, object sender, EventArgs args)
        {
            // Filter only the events from task owner
            if (sender != m_taskPlayer)
            {
                return;
            }

            if (CheckTaskExpired())
            {
                return;
            }

            GamePlayer player = (GamePlayer)sender;

            if (e == GamePlayerEvent.GiveItem)
            {
                GiveItemEventArgs gArgs  = (GiveItemEventArgs)args;
                GameLiving        target = gArgs.Target as GameLiving;
                InventoryItem     item   = gArgs.Item;

                if (player.Task.RecieverName == target.Name && item.Name == player.Task.ItemName)
                {
                    player.Inventory.RemoveItem(item);
                    InventoryLogging.LogInventoryAction(player, target, eInventoryActionType.Quest, item.Template, item.Count);
                    FinishTask();
                }
            }
        }
示例#12
0
        public override void FinishQuest()
        {
            base.FinishQuest();             //Defined in Quest, changes the state, stores in DB etc ...

            //Give reward to player here ...
            m_questPlayer.GainExperience(GameLiving.eXPSource.Quest, 145, true);
            m_questPlayer.AddMoney(Money.GetMoney(0, 0, 0, 0, 50), "You are awarded 50 copper!");
            InventoryLogging.LogInventoryAction("(QUEST;" + Name + ")", m_questPlayer, eInventoryActionType.Quest, 50);
        }
示例#13
0
        /* This is the method we declared as callback for the hooks we set to
         * NPC. It will be called whenever a player right clicks on NPC
         * or when he whispers something to him.
         */

        protected static void TalkToVerNuren(DOLEvent e, object sender, EventArgs args)
        {
            // We get the player from the event arguments and check if he qualifies
            GamePlayer player = ((SourceEventArgs)args).Source as GamePlayer;

            if (player == null)
            {
                return;
            }

            // We also check if the player is already doing the quest
            AndrewsSkins quest = player.IsDoingQuest(typeof(AndrewsSkins)) as AndrewsSkins;

            verNuren.TurnTo(player);

            // Did the player rightclick on NPC?
            if (e == GameObjectEvent.Interact)
            {
                if (quest != null)
                {
                    if (quest.Step < 3)
                    {
                        // Player is doing the quest...
                        verNuren.SayTo(player, "Greetings to you traveler.  Is there something I can help you with today?");
                        return;
                    }
                }
            }

            // The player whispered to NPC (clicked on the text inside the [] or with /whisper)
            else if (e == GameLivingEvent.WhisperReceive)
            {
                WhisperReceiveEventArgs wArgs = (WhisperReceiveEventArgs)args;
                if (quest != null)
                {
                    switch (wArgs.Text)
                    {
                    case "thread":
                        if (quest.Step == 2)
                        {
                            verNuren.SayTo(player, "Oh yes.  I know what you're talking about.  Geor told me the other day that he was out of the thread he needs to make his armor.  No worries.  I have some right here.  Now please, take this straight to Geor.");

                            GiveItem(verNuren, player, spoolOfLeatherworkingThread);

                            player.GainExperience(GameLiving.eXPSource.Quest, 40, true);
                            long money = Money.GetMoney(0, 0, 0, 3, Util.Random(50));
                            player.AddMoney(money, "You are awarded 3 silver and some copper!");
                            InventoryLogging.LogInventoryAction("(QUEST;" + quest.Name + ")", player, eInventoryActionType.Quest, money);

                            quest.Step = 3;
                        }

                        break;
                    }
                }
            }
        }
示例#14
0
        public override void FinishQuest()
        {
            base.FinishQuest(); // Defined in Quest, changes the state, stores in DB etc ...

            // Give reward to player here ...
            QuestPlayer.GainExperience(GameLiving.eXPSource.Quest, (long)(QuestPlayer.ExperienceForNextLevel / 15.5), true);
            QuestPlayer.AddMoney(Money.GetMoney(0, 0, 0, 0, 67), "You are awarded 67 copper!");
            InventoryLogging.LogInventoryAction("(QUEST;" + Name + ")", QuestPlayer, eInventoryActionType.Quest, 67);
        }
        public void HandlePacket(GameClient client, GSPacketIn packet)
        {
            // player is null, return

            // active consignment merchant is null, return
            if (!(client.Player?.ActiveInventoryObject is GameConsignmentMerchant conMerchant))
            {
                return;
            }

            // current house is null, return
            House house = HouseMgr.GetHouse(conMerchant.HouseNumber);

            if (house == null)
            {
                return;
            }

            // make sure player has permissions to withdraw from the consignment merchant
            if (!house.CanUseConsignmentMerchant(client.Player, ConsignmentPermissions.Withdraw))
            {
                client.Player.Out.SendMessage("You don't have permission to withdraw money from this merchant!", eChatType.CT_Important, eChatLoc.CL_ChatWindow);
                return;
            }

            lock (conMerchant.LockObject())
            {
                long totalConMoney = conMerchant.TotalMoney;

                if (totalConMoney > 0)
                {
                    if (ServerProperties.Properties.CONSIGNMENT_USE_BP)
                    {
                        client.Player.Out.SendMessage($"You withdraw {totalConMoney} BountyPoints from your Merchant.", eChatType.CT_Important, eChatLoc.CL_ChatWindow);
                        client.Player.BountyPoints += totalConMoney;
                        client.Player.Out.SendUpdatePoints();
                    }
                    else
                    {
                        ChatUtil.SendMerchantMessage(client, "GameMerchant.OnPlayerWithdraw", Money.GetString(totalConMoney));
                        client.Player.AddMoney(totalConMoney);
                        InventoryLogging.LogInventoryAction(conMerchant, client.Player, eInventoryActionType.Merchant, totalConMoney);
                    }

                    conMerchant.TotalMoney -= totalConMoney;

                    if (ServerProperties.Properties.MARKET_ENABLE_LOG)
                    {
                        Log.Debug($"CM: [{client.Player.Name}:{client.Account.Name}] withdraws {totalConMoney} from CM on lot {conMerchant.HouseNumber}.");
                    }

                    client.Out.SendConsignmentMerchantMoney(conMerchant.TotalMoney);
                }
            }
        }
        public override void FinishQuest()
        {
            base.FinishQuest();             //Defined in Quest, changes the state, stores in DB etc ...

            //Give reward to player here ...
            m_questPlayer.GainExperience(GameLiving.eXPSource.Quest, m_questPlayer.ExperienceForNextLevel / 25, true);
            long money = Money.GetMoney(0, 0, 0, 0, m_questPlayer.Level * 10 + 30);

            m_questPlayer.AddMoney(money, "You are awarded " + Money.GetString(money) + "!");
            InventoryLogging.LogInventoryAction("(QUEST;" + Name + ")", m_questPlayer, eInventoryActionType.Quest, money);
        }
示例#17
0
        public override void FinishQuest()
        {
            base.FinishQuest(); // Defined in Quest, changes the state, stores in DB etc ...

            // Give reward to player here ...
            QuestPlayer.GainExperience(GameLiving.eXPSource.Quest, 507, true);
            long money = Money.GetMoney(0, 0, 0, 7, Util.Random(50));

            QuestPlayer.AddMoney(money, "You recieve {0} as a reward.");
            InventoryLogging.LogInventoryAction("(QUEST;" + Name + ")", QuestPlayer, eInventoryActionType.Quest, money);
        }
示例#18
0
        public override void FinishQuest()
        {
            base.FinishQuest(); //Defined in Quest, changes the state, stores in DB etc ...

            //Give reward to player here ...
            m_questPlayer.GainExperience(GameLiving.eXPSource.Quest, (long)((m_questPlayer.ExperienceForNextLevel - m_questPlayer.ExperienceForCurrentLevel) / 20), true);
            long money = Money.GetMoney(0, 0, 0, 1, 30 + Util.Random(50));

            m_questPlayer.AddMoney(money, "You recieve {0} for your service.");
            InventoryLogging.LogInventoryAction("(QUEST;" + Name + ")", m_questPlayer, eInventoryActionType.Quest, money);
        }
示例#19
0
        public override void FinishQuest()
        {
            base.FinishQuest();             //Defined in Quest, changes the state, stores in DB etc ...

            //Give reward to player here ...
            m_questPlayer.GainExperience(GameLiving.eXPSource.Quest, (long)(m_questPlayer.ExperienceForNextLevel / 35), true);
            long money = Money.GetMoney(0, 0, 0, 1, Util.Random(50));

            m_questPlayer.AddMoney(money, "You are awarded 1 silver and some copper!");
            InventoryLogging.LogInventoryAction("(QUEST;" + Name + ")", m_questPlayer, eInventoryActionType.Quest, money);
        }
示例#20
0
        public override void FinishQuest()
        {
            base.FinishQuest(); // Defined in Quest, changes the state, stores in DB etc ...

            // Give reward to player here ...
            QuestPlayer.GainExperience(GameLiving.eXPSource.Quest, QuestPlayer.Level * 10, true);
            QuestPlayer.AddMoney(Money.GetMoney(0, 0, 0, 0, 35 + QuestPlayer.Level), "You are awarded " + (35 + QuestPlayer.Level) + " copper!");
            InventoryLogging.LogInventoryAction("(QUEST;" + Name + ")", QuestPlayer, eInventoryActionType.Quest, 35 + QuestPlayer.Level);

            GameEventMgr.RemoveHandler(QuestPlayer, GamePlayerEvent.UseSlot, new DOLEventHandler(PlayerUseSlot));
            GameEventMgr.RemoveHandler(QuestPlayer, GamePlayerEvent.Quit, new DOLEventHandler(PlayerLeftWorld));
        }
示例#21
0
 /// <summary>
 /// Remove an item from the player's inventory.
 /// </summary>
 /// <param name="player"></param>
 /// <param name="item"></param>
 /// <returns></returns>
 public virtual bool RemoveItem(GamePlayer player, InventoryItem item)
 {
     lock (player.Inventory)
     {
         if (player.Inventory.RemoveItem(item))
         {
             InventoryLogging.LogInventoryAction(player, "(ARTIFACT;" + Name + ")", eInventoryActionType.Quest, item.Template, item.Count);
             return(true);
         }
     }
     return(false);
 }
示例#22
0
        public override void FinishQuest()
        {
            base.FinishQuest(); // Defined in Quest, changes the state, stores in DB etc ...

            // Give reward to player here ...
            GiveItem(freagus, QuestPlayer, recruitsCloak);

            QuestPlayer.GainExperience(GameLiving.eXPSource.Quest, 12);
            long money = Money.GetMoney(0, 0, 0, 1, Util.Random(50));

            QuestPlayer.AddMoney(money, LanguageMgr.GetTranslation(QuestPlayer.Client, "Hib.ImportantDelivery.FinishQuest.RecieveReward"));
            InventoryLogging.LogInventoryAction("(QUEST;" + Name + ")", QuestPlayer, eInventoryActionType.Quest, money);
        }
示例#23
0
        public override void FinishQuest()
        {
            base.FinishQuest(); // Defined in Quest, changes the state, stores in DB etc ...

            // Give reward to player here ...
            GiveItem(argusBowman, QuestPlayer, dullBlackGem);

            QuestPlayer.GainExperience(GameLiving.eXPSource.Quest, 160, true);
            long money = Money.GetMoney(0, 0, 0, 10, 30 + Util.Random(50));

            QuestPlayer.AddMoney(money, "You are awarded 10 silver and some copper!");
            InventoryLogging.LogInventoryAction("(QUEST;" + Name + ")", QuestPlayer, eInventoryActionType.Quest, money);
        }
示例#24
0
        public override void FinishQuest()
        {
            base.FinishQuest(); // Defined in Quest, changes the state, stores in DB etc ...

            // Give reward to player here ...
            GiveItem(ydeniaPhilpott, QuestPlayer, silverRingOfHealth);

            QuestPlayer.GainExperience(GameLiving.eXPSource.Quest, 20 + (QuestPlayer.Level - 1) * 5, true);
            long money = Money.GetMoney(0, 0, 0, 5, Util.Random(50));

            QuestPlayer.AddMoney(money, "You are awarded 5 silver and some copper!");
            InventoryLogging.LogInventoryAction("(QUEST;" + Name + ")", QuestPlayer, eInventoryActionType.Quest, money);
        }
示例#25
0
        public override void FinishQuest()
        {
            base.FinishQuest(); // Defined in Quest, changes the state, stores in DB etc ...

            // Give reward to player here ...
            QuestPlayer.GainExperience(GameLiving.eXPSource.Quest, 507, true);
            long money = Money.GetMoney(0, 0, 0, 7, Util.Random(50));

            QuestPlayer.AddMoney(money, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.StolenEggs.FinishQuest.Text1"));
            InventoryLogging.LogInventoryAction("(QUEST;" + Name + ")", QuestPlayer, eInventoryActionType.Quest, money);

            GameEventMgr.RemoveHandler(QuestPlayer, GamePlayerEvent.Quit, new DOLEventHandler(PlayerLeftWorld));
        }
示例#26
0
        public override void FinishQuest()
        {
            base.FinishQuest();

            m_questPlayer.GainExperience(GameLiving.eXPSource.Quest, 40 + (m_questPlayer.Level - 1) * 4, true);
            long money = Money.GetMoney(0, 0, 0, 7, Util.Random(50));

            m_questPlayer.AddMoney(money, "You are awarded 7 silver and some copper!");
            InventoryLogging.LogInventoryAction("(QUEST;" + Name + ")", m_questPlayer, eInventoryActionType.Quest, money);

            GameEventMgr.RemoveHandler(m_questPlayer, GamePlayerEvent.UseSlot, new DOLEventHandler(PlayerUseSlot));
            GameEventMgr.RemoveHandler(m_questPlayer, GamePlayerEvent.Quit, new DOLEventHandler(PlayerLeftWorld));
        }
示例#27
0
        public override void FinishQuest()
        {
            base.FinishQuest(); // Defined in Quest, changes the state, stores in DB etc ...

            // Give reward to player here ...
            GiveItem(andrewWyatt, QuestPlayer, chokerOfTheBear);

            QuestPlayer.GainExperience(GameLiving.eXPSource.Quest, 80, true);
            long money = Money.GetMoney(0, 0, 0, 4, Util.Random(50));

            QuestPlayer.AddMoney(money, "You are awarded 4 silver and some copper!");
            InventoryLogging.LogInventoryAction("(QUEST;" + Name + ")", QuestPlayer, eInventoryActionType.Quest, money);
        }
示例#28
0
        public override void FinishQuest()
        {
            base.FinishQuest();             //Defined in Quest, changes the state, stores in DB etc ...

            //Give reward to player here ...

            m_questPlayer.GainExperience(GameLiving.eXPSource.Quest, 40, true);
            long money = Money.GetMoney(0, 0, 0, 0, 10 + Util.Random(50));

            m_questPlayer.AddMoney(money, "You recieve {0} for your service.");
            GiveItem(m_questPlayer, SilverRingofHealth, false);
            InventoryLogging.LogInventoryAction("(QUEST;" + Name + ")", m_questPlayer, eInventoryActionType.Quest, money);
        }
示例#29
0
文件: Frontiers.cs 项目: mywebext/DOL
        public override void AbortQuest()
        {
            base.AbortQuest();             //Defined in Quest, changes the state, stores in DB etc ...

            if (Step < 3 && m_questPlayer.Inventory.GetFirstItemByID(ticketToSvasudFaste.Id_nb, eInventorySlot.Min_Inv, eInventorySlot.Max_Inv) == null)
            {
                m_questPlayer.RemoveMoney(Money.GetMoney(0, 0, 0, 6, 0), null);
                InventoryLogging.LogInventoryAction(m_questPlayer, "(QUEST;" + Name + ")", eInventoryActionType.Quest, 600);
            }

            RemoveItem(m_questPlayer, ticketToSvasudFaste, false);
            RemoveItem(m_questPlayer, askefruerPlans, false);
            RemoveItem(m_questPlayer, ticketToMularn, false);
            RemoveItem(m_questPlayer, noteForNjiedi, false);
            RemoveItem(m_questPlayer, translatedPlans, false);
        }
示例#30
0
        public override void FinishQuest()
        {
            base.FinishQuest(); // Defined in Quest, changes the state, stores in DB etc ...

            // Give reward to player here ...
            GiveItem(godelevaDowden, QuestPlayer, reedBracer);

            QuestPlayer.GainExperience(GameLiving.eXPSource.Quest, 40 + (QuestPlayer.Level - 1) * 4, true);
            long money = Money.GetMoney(0, 0, 0, 7, Util.Random(50));

            QuestPlayer.AddMoney(money, "You are awarded 7 silver and some copper!");
            InventoryLogging.LogInventoryAction("(QUEST;" + Name + ")", QuestPlayer, eInventoryActionType.Quest, money);

            GameEventMgr.RemoveHandler(QuestPlayer, GamePlayerEvent.UseSlot, new DOLEventHandler(PlayerUseSlot));
            GameEventMgr.RemoveHandler(QuestPlayer, GamePlayerEvent.Quit, new DOLEventHandler(PlayerLeftWorld));
        }