AwardKarma() public static method

public static AwardKarma ( Mobile m, int offset, bool message ) : void
m Mobile
offset int
message bool
return void
コード例 #1
0
        public static void PayAssassin(Mobile m, Mobile leader)
        {
            string victim = CharacterDatabase.GetQuestInfo(m, "AssassinQuest");

            if (CharacterDatabase.GetQuestState(m, "AssassinQuest"))
            {
                string sAssassinTarget   = "";
                string sAssassinTitle    = "";
                string sAssassinName     = "";
                string sAssassinRegion   = "";
                int    nAssassinDone     = 0;
                int    nAssassinFee      = 0;
                string sAssassinWorld    = "";
                string sAssassinCategory = "";
                string sAssassinStory    = "";

                string[] victims = victim.Split('#');
                int      nEntry  = 1;
                foreach (string victimz in victims)
                {
                    if (nEntry == 1)
                    {
                        sAssassinTarget = victimz;
                    }
                    else if (nEntry == 2)
                    {
                        sAssassinTitle = victimz;
                    }
                    else if (nEntry == 3)
                    {
                        sAssassinName = victimz;
                    }
                    else if (nEntry == 4)
                    {
                        sAssassinRegion = victimz;
                    }
                    else if (nEntry == 5)
                    {
                        nAssassinDone = Convert.ToInt32(victimz);
                    }
                    else if (nEntry == 6)
                    {
                        nAssassinFee = Convert.ToInt32(victimz);
                    }
                    else if (nEntry == 7)
                    {
                        sAssassinWorld = victimz;
                    }
                    else if (nEntry == 8)
                    {
                        sAssassinCategory = victimz;
                    }
                    else if (nEntry == 9)
                    {
                        sAssassinStory = victimz;
                    }

                    nEntry++;
                }

                if (nAssassinDone > 0 && nAssassinFee > 0)
                {
                    m.SendSound(0x3D);
                    m.AddToBackpack(new Gold(nAssassinFee));
                    string sMessage = "";
                    switch (Utility.RandomMinMax(0, 9))
                    {
                    case 0: sMessage = "I assume the death was quick. Here is " + nAssassinFee.ToString() + " gold for you.";               break;

                    case 1: sMessage = "I bet they never seen you coming. Here is " + nAssassinFee.ToString() + " gold for you.";           break;

                    case 2: sMessage = "Was the death swift? Here is " + nAssassinFee.ToString() + " gold for you.";                break;

                    case 3: sMessage = "Were there any witnesses? Here is " + nAssassinFee.ToString() + " gold for you.";           break;

                    case 4: sMessage = "I am impressed. Here is " + nAssassinFee.ToString() + " gold for you.";             break;

                    case 5: sMessage = "Word of your deed already reached my ears. Here is " + nAssassinFee.ToString() + " gold for you.";          break;

                    case 6: sMessage = "How you did that one, I'll never know. Here is " + nAssassinFee.ToString() + " gold for you.";              break;

                    case 7: sMessage = "You are one of my best. Here is " + nAssassinFee.ToString() + " gold for you.";             break;

                    case 8: sMessage = "Did you leave the body behind? Here is " + nAssassinFee.ToString() + " gold for you.";              break;

                    case 9: sMessage = "Next time, strike from the shadows. Here is " + nAssassinFee.ToString() + " gold for you.";         break;
                    }
                    leader.Say(sMessage);

                    int totalKarma = nAssassinFee;
                    if (sAssassinCategory == "Innocent")
                    {
                        totalKarma = nAssassinFee * 2;
                    }                                                                                                    // MORE KARMA LOSS FOR CITIZENS

                    Titles.AwardFame(m, ((int)(totalKarma / 100)), true);
                    Titles.AwardKarma(m, -((int)(totalKarma / 100)), true);

                    AssassinFunctions.QuestTimeAllowed(m);

                    m.Criminal = false;
                    if (sAssassinCategory == "Innocent" && m.Kills > 0)
                    {
                        m.Kills = m.Kills - 1;
                    }                                                                                                   // REMOVE THE KILL FOR THIS CIVILIAN
                }
            }
        }
コード例 #2
0
        public static void PayAdventurer(Mobile m)
        {
            string explorer = CharacterDatabase.GetQuestInfo(m, "StandardQuest");

            if (CharacterDatabase.GetQuestState(m, "StandardQuest"))
            {
                string sPCTarget   = "";
                string sPCTitle    = "";
                string sPCName     = "";
                string sPCRegion   = "";
                int    nPCDone     = 0;
                int    nPCFee      = 0;
                string sPCWorld    = "";
                string sPCCategory = "";
                string sPCStory    = "";

                string[] explorers = explorer.Split('#');
                int      nEntry    = 1;
                foreach (string explorerz in explorers)
                {
                    if (nEntry == 1)
                    {
                        sPCTarget = explorerz;
                    }
                    else if (nEntry == 2)
                    {
                        sPCTitle = explorerz;
                    }
                    else if (nEntry == 3)
                    {
                        sPCName = explorerz;
                    }
                    else if (nEntry == 4)
                    {
                        sPCRegion = explorerz;
                    }
                    else if (nEntry == 5)
                    {
                        nPCDone = Convert.ToInt32(explorerz);
                    }
                    else if (nEntry == 6)
                    {
                        nPCFee = Convert.ToInt32(explorerz);
                    }
                    else if (nEntry == 7)
                    {
                        sPCWorld = explorerz;
                    }
                    else if (nEntry == 8)
                    {
                        sPCCategory = explorerz;
                    }
                    else if (nEntry == 9)
                    {
                        sPCStory = explorerz;
                    }

                    nEntry++;
                }

                if (nPCDone > 0 && nPCFee > 0)
                {
                    m.SendSound(0x3D);
                    m.AddToBackpack(new Gold(nPCFee));
                    string sMessage = "Here is " + nPCFee.ToString() + " gold for you.";
                    m.PrivateOverheadMessage(MessageType.Regular, 1150, false, sMessage, m.NetState);
                    StandardQuestFunctions.QuestTimeAllowed(m);

                    Titles.AwardFame(m, ((int)(nPCFee / 100)), true);
                    if (((PlayerMobile)m).KarmaLocked == true)
                    {
                        Titles.AwardKarma(m, -((int)(nPCFee / 100)), true);
                    }
                    else
                    {
                        Titles.AwardKarma(m, ((int)(nPCFee / 100)), true);
                    }
                }
            }
        }
コード例 #3
0
        public static void WellTheyDied(Mobile m, BaseCreature b)
        {
            if (m.EmoteHue == 505)
            {
                Mobile killer = m.LastKiller;
                if (killer != null)
                {
                    if (killer is BaseCreature)
                    {
                        killer = ((BaseCreature)killer).GetMaster();
                    }

                    if (!(killer is PlayerMobile))
                    {
                        killer = m.FindMostRecentDamager(true);

                        if (killer != null)
                        {
                            if (killer is BaseCreature)
                            {
                                killer = ((BaseCreature)killer).GetMaster();
                            }
                        }
                    }
                }

                Map map = m.Map;

                if (map != null)
                {
                    for (int x = -12; x <= 12; ++x)
                    {
                        for (int y = -12; y <= 12; ++y)
                        {
                            double dist = Math.Sqrt(x * x + y * y);

                            if (dist <= 12)
                            {
                                new GoodiesTimer(map, m.X + x, m.Y + y).Start();
                            }
                        }
                    }

                    SummonChest MyChest = new SummonChest(killer);
                    MyChest.Prisoner = System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase((m.Name).ToLower());

                    string myName = GetFirstName(m.Name);
                    int    myHue  = m.Hue;

                    Item        reward     = new SummonReward();
                    List <Item> belongings = new List <Item>();
                    foreach (Item i in m.Backpack.Items)
                    {
                        if (i is SummonPrison)
                        {
                            SummonPrison prison = (SummonPrison)i;
                            reward.Hue    = prison.RewardHue;
                            reward.ItemID = prison.RewardID;
                            reward.Name   = prison.RewardName;
                            MyChest.AddItem(reward);

                            if (prison.PrisonerFullNameUsed > 0)
                            {
                                myName = m.Name;
                            }
                            if (prison.PrisonerClothColorUsed > 0)
                            {
                                for (int c = 0; c < m.Items.Count; ++c)
                                {
                                    Item item = m.Items[c];

                                    if (!(item is Cloak) && !(item is BaseWeapon) && !(item is WornHumanDeco))
                                    {
                                        myHue = item.Hue;
                                    }
                                }

                                if (myHue == 0)
                                {
                                    myHue = prison.RewardHue;
                                }
                            }
                        }
                    }

                    if (killer is PlayerMobile)
                    {
                        Party p = Engines.PartySystem.Party.Get(killer);
                        if (p != null)
                        {
                            foreach (PartyMemberInfo pmi in p.Members)
                            {
                                if (pmi.Mobile is PlayerMobile && pmi.Mobile.InRange(m.Location, 20))
                                {
                                    LoggingFunctions.LogSlayingLord(pmi.Mobile, m.Name + " from the Magical Prison");
                                    Titles.AwardFame(pmi.Mobile, 300, true);
                                    if (((PlayerMobile)(pmi.Mobile)).KarmaLocked == true)
                                    {
                                        Titles.AwardKarma(pmi.Mobile, -300, true);
                                    }
                                    else
                                    {
                                        Titles.AwardKarma(pmi.Mobile, 300, true);
                                    }

                                    ManualOfItems book = new ManualOfItems();
                                    book.Hue        = myHue;
                                    book.Name       = "Tome of " + myName + " Relics";
                                    book.m_Charges  = 1;
                                    book.m_Skill_1  = 99;
                                    book.m_Skill_2  = 0;
                                    book.m_Skill_3  = 0;
                                    book.m_Skill_4  = 0;
                                    book.m_Skill_5  = 0;
                                    book.m_Value_1  = 10.0;
                                    book.m_Value_2  = 0.0;
                                    book.m_Value_3  = 0.0;
                                    book.m_Value_4  = 0.0;
                                    book.m_Value_5  = 0.0;
                                    book.m_Slayer_1 = 5;
                                    book.m_Slayer_2 = 0;
                                    book.m_Owner    = pmi.Mobile;
                                    book.m_Extra    = "of " + myName;
                                    book.m_FromWho  = "From " + m.Name;
                                    book.m_HowGiven = "Won by";
                                    book.m_Points   = 300;
                                    book.m_Hue      = myHue;
                                    MyChest.AddItem(book);
                                }
                            }
                        }
                        else
                        {
                            LoggingFunctions.LogSlayingLord(killer, m.Name + " from the Magical Prison");
                            Titles.AwardFame(killer, 300, true);
                            if (((PlayerMobile)killer).KarmaLocked == true)
                            {
                                Titles.AwardKarma(killer, -300, true);
                            }
                            else
                            {
                                Titles.AwardKarma(killer, 300, true);
                            }

                            ManualOfItems book = new ManualOfItems();
                            book.Hue        = myHue;
                            book.Name       = "Tome of " + myName + " Relics";
                            book.m_Charges  = 1;
                            book.m_Skill_1  = 99;
                            book.m_Skill_2  = 0;
                            book.m_Skill_3  = 0;
                            book.m_Skill_4  = 0;
                            book.m_Skill_5  = 0;
                            book.m_Value_1  = 10.0;
                            book.m_Value_2  = 0.0;
                            book.m_Value_3  = 0.0;
                            book.m_Value_4  = 0.0;
                            book.m_Value_5  = 0.0;
                            book.m_Slayer_1 = 5;
                            book.m_Slayer_2 = 0;
                            book.m_Owner    = killer;
                            book.m_Extra    = "of " + myName;
                            book.m_FromWho  = "From " + m.Name;
                            book.m_HowGiven = "Won by";
                            book.m_Points   = 300;
                            book.m_Hue      = myHue;
                            MyChest.AddItem(book);
                        }
                    }

                    MyChest.MoveToWorld(m.Location, m.Map);
                }

                if (!(m is PlayerMobile))
                {
                    Server.Misc.IntelligentAction.BurnAway(m);
                    m.Delete();
                }
            }
        }