コード例 #1
0
            public override void OnClick()
            {
                if (!(m_Mobile is PlayerMobile))
                {
                    return;
                }

                PlayerMobile mobile = (PlayerMobile)m_Mobile;

                string myQuest = CharacterDatabase.GetQuestInfo(m_Mobile, "AssassinQuest");

                int    nAllowedForAnotherQuest = AssassinFunctions.QuestTimeNew(m_Mobile);
                int    nServerQuestTimeAllowed = DifficultyLevel.GetTimeBetweenQuests();
                int    nWhenForAnotherQuest    = nServerQuestTimeAllowed - nAllowedForAnotherQuest;
                string sAllowedForAnotherQuest = nWhenForAnotherQuest.ToString();

                if (CharacterDatabase.GetQuestState(m_Mobile, "AssassinQuest"))
                {
                    m_Giver.Say("You already have your orders. Return to me when you are done with the task.");
                }
                else if (mobile.NpcGuild != NpcGuild.AssassinsGuild)                   // HE WILL ONLY TALK GUILD MEMBERS
                {
                    m_Giver.Say("Hmmm...you do not seem the type I wish to discuss matters with.");
                }
                else if (m_Mobile.Karma > -1250)                   // HE WILL ONLY TALK TO THE UNSAVORY GUILD MEMBERS
                {
                    m_Giver.Say("Hmmm...maybe show me that you could handle such tasks first.");
                }
                else if (nWhenForAnotherQuest > 0)
                {
                    m_Giver.Say("I have nothing for you at the moment. Check back in " + sAllowedForAnotherQuest + " minutes.");
                }
                else
                {
                    int nFame = m_Mobile.Fame * 2;
                    nFame = Utility.RandomMinMax(0, nFame) + 2000;

                    if (Utility.RandomMinMax(1, 100) > 30)
                    {
                        AssassinFunctions.FindTarget(m_Mobile, nFame);
                    }
                    else
                    {
                        AssassinFunctions.FindInnocentTarget(m_Mobile);
                    }

                    string TellQuest = AssassinFunctions.QuestStatus(m_Mobile) + ".";
                    m_Giver.Say(TellQuest);
                }
            }