public static int QuestFailure(Mobile m) { string victim = CharacterDatabase.GetQuestInfo(m, "AssassinQuest"); int nPenalty = 0; if (CharacterDatabase.GetQuestState(m, "AssassinQuest")) { AssassinFunctions.QuestTimeAllowed(m); 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++; } nPenalty = nAssassinFee; } return(nPenalty); }
public static void FindInnocentTarget(Mobile m) { string searchLocation = "the Land of Sosaria"; switch (Utility.RandomMinMax(0, 13)) { case 0: searchLocation = "the Land of Sosaria"; break; case 1: searchLocation = "the Land of Sosaria"; break; case 2: searchLocation = "the Land of Sosaria"; break; case 3: searchLocation = "the Land of Lodoria"; if (!(CharacterDatabase.GetDiscovered(m, "the Land of Lodoria"))) { searchLocation = "the Land of Sosaria"; } break; case 4: searchLocation = "the Land of Lodoria"; if (!(CharacterDatabase.GetDiscovered(m, "the Land of Lodoria"))) { searchLocation = "the Land of Sosaria"; } break; case 5: searchLocation = "the Land of Lodoria"; if (!(CharacterDatabase.GetDiscovered(m, "the Land of Lodoria"))) { searchLocation = "the Land of Sosaria"; } break; case 6: searchLocation = "the Serpent Island"; if (!(CharacterDatabase.GetDiscovered(m, "the Serpent Island"))) { searchLocation = "the Land of Sosaria"; } break; case 7: searchLocation = "the Serpent Island"; if (!(CharacterDatabase.GetDiscovered(m, "the Serpent Island"))) { searchLocation = "the Land of Sosaria"; } break; case 8: searchLocation = "the Serpent Island"; if (!(CharacterDatabase.GetDiscovered(m, "the Serpent Island"))) { searchLocation = "the Land of Sosaria"; } break; case 9: searchLocation = "the Isles of Dread"; if (!(CharacterDatabase.GetDiscovered(m, "the Isles of Dread"))) { searchLocation = "the Land of Sosaria"; } break; case 10: searchLocation = "the Savaged Empire"; if (!(CharacterDatabase.GetDiscovered(m, "the Savaged Empire"))) { searchLocation = "the Land of Sosaria"; } break; case 11: searchLocation = "the Savaged Empire"; if (!(CharacterDatabase.GetDiscovered(m, "the Savaged Empire"))) { searchLocation = "the Land of Sosaria"; } break; case 12: searchLocation = "the Island of Umber Veil"; if (!(CharacterDatabase.GetDiscovered(m, "the Island of Umber Veil"))) { searchLocation = "the Land of Sosaria"; } break; case 13: searchLocation = "the Bottle World of Kuldar"; if (!(CharacterDatabase.GetDiscovered(m, "the Bottle World of Kuldar"))) { searchLocation = "the Land of Sosaria"; } break; } int aCount = 0; Region reg = null; ArrayList targets = new ArrayList(); foreach (Mobile target in World.Mobiles.Values) { if (target is BaseVendor) { reg = Region.Find(target.Location, target.Map); string tWorld = Worlds.GetMyWorld(target.Map, target.Location, target.X, target.Y); if (target.Blessed == false && reg.IsPartOf(typeof(VillageRegion))) { if (searchLocation == "the Land of Sosaria" && tWorld == searchLocation) { targets.Add(target); aCount++; } else if (searchLocation == "the Land of Lodoria" && tWorld == searchLocation) { targets.Add(target); aCount++; } else if (searchLocation == "the Serpent Island" && tWorld == searchLocation) { targets.Add(target); aCount++; } else if (searchLocation == "the Isles of Dread" && tWorld == searchLocation) { targets.Add(target); aCount++; } else if (searchLocation == "the Savaged Empire" && tWorld == searchLocation) { targets.Add(target); aCount++; } else if (searchLocation == "the Island of Umber Veil" && tWorld == searchLocation) { targets.Add(target); aCount++; } else if (searchLocation == "the Bottle World of Kuldar" && tWorld == searchLocation) { targets.Add(target); aCount++; } } } } aCount = Utility.RandomMinMax(1, aCount); int xCount = 0; for (int i = 0; i < targets.Count; ++i) { xCount++; if (xCount == aCount) { Mobile theVictim = ( Mobile )targets[i]; string kWorld = Worlds.GetMyWorld(theVictim.Map, theVictim.Location, theVictim.X, theVictim.Y); string kVictim = theVictim.GetType().ToString(); int nFee = 1000; string kDollar = ((int)((Server.Misc.MyServerSettings.QuestRewardModifier() * 0.01) * nFee)).ToString(); string myexplorer = kVictim + "#" + theVictim.Title + "#" + theVictim.Name + "#" + Server.Misc.Worlds.GetRegionName(theVictim.Map, theVictim.Location) + "#0#" + kDollar + "#" + kWorld + "#Innocent"; CharacterDatabase.SetQuestInfo(m, "AssassinQuest", myexplorer); string theStory = myexplorer + "#" + AssassinFunctions.QuestSentence(m); // ADD THE STORY PART CharacterDatabase.SetQuestInfo(m, "AssassinQuest", theStory); } } }
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 } } }
public static void FindTarget(Mobile m, int fee) { string searchLocation = "the Land of Sosaria"; switch (Utility.RandomMinMax(0, 15)) { case 0: searchLocation = "the Land of Sosaria"; break; case 1: searchLocation = "the Land of Sosaria"; break; case 2: searchLocation = "the Land of Sosaria"; break; case 3: searchLocation = "the Land of Lodoria"; if (!(CharacterDatabase.GetDiscovered(m, "the Land of Lodoria"))) { searchLocation = "the Land of Sosaria"; } break; case 4: searchLocation = "the Land of Lodoria"; if (!(CharacterDatabase.GetDiscovered(m, "the Land of Lodoria"))) { searchLocation = "the Land of Sosaria"; } break; case 5: searchLocation = "the Land of Lodoria"; if (!(CharacterDatabase.GetDiscovered(m, "the Land of Lodoria"))) { searchLocation = "the Land of Sosaria"; } break; case 6: searchLocation = "the Serpent Island"; if (!(CharacterDatabase.GetDiscovered(m, "the Serpent Island"))) { searchLocation = "the Land of Sosaria"; } break; case 7: searchLocation = "the Serpent Island"; if (!(CharacterDatabase.GetDiscovered(m, "the Serpent Island"))) { searchLocation = "the Land of Sosaria"; } break; case 8: searchLocation = "the Serpent Island"; if (!(CharacterDatabase.GetDiscovered(m, "the Serpent Island"))) { searchLocation = "the Land of Sosaria"; } break; case 9: searchLocation = "the Isles of Dread"; if (!(CharacterDatabase.GetDiscovered(m, "the Isles of Dread"))) { searchLocation = "the Land of Sosaria"; } break; case 10: searchLocation = "the Savaged Empire"; if (!(CharacterDatabase.GetDiscovered(m, "the Savaged Empire"))) { searchLocation = "the Land of Sosaria"; } break; case 11: searchLocation = "the Savaged Empire"; if (!(CharacterDatabase.GetDiscovered(m, "the Savaged Empire"))) { searchLocation = "the Land of Sosaria"; } break; case 12: searchLocation = "the Island of Umber Veil"; if (!(CharacterDatabase.GetDiscovered(m, "the Island of Umber Veil"))) { searchLocation = "the Land of Sosaria"; } break; case 13: searchLocation = "the Bottle World of Kuldar"; if (!(CharacterDatabase.GetDiscovered(m, "the Bottle World of Kuldar"))) { searchLocation = "the Land of Sosaria"; } break; case 14: searchLocation = "the Underworld"; if (!(CharacterDatabase.GetDiscovered(m, "the Underworld"))) { searchLocation = "the Underworld"; } break; case 15: searchLocation = "the Land of Ambrosia"; if (!(CharacterDatabase.GetDiscovered(m, "the Land of Ambrosia"))) { searchLocation = "the Land of Sosaria"; } break; } int aCount = 0; Region reg = null; ArrayList targets = new ArrayList(); foreach (Mobile target in World.Mobiles.Values) { if (target is BaseCreature) { reg = Region.Find(target.Location, target.Map); string tWorld = Worlds.GetMyWorld(target.Map, target.Location, target.X, target.Y); if (target.EmoteHue != 123 && target.Karma < 0 && target.Fame < fee && (Worlds.GetDifficultyLevel(target.Location, target.Map) <= GetPlayerInfo.GetPlayerDifficulty(m)) && reg.IsPartOf(typeof(DungeonRegion))) { if (searchLocation == "the Land of Sosaria" && tWorld == searchLocation) { targets.Add(target); aCount++; } else if (searchLocation == "the Land of Lodoria" && tWorld == searchLocation) { targets.Add(target); aCount++; } else if (searchLocation == "the Serpent Island" && tWorld == searchLocation) { targets.Add(target); aCount++; } else if (searchLocation == "the Isles of Dread" && tWorld == searchLocation) { targets.Add(target); aCount++; } else if (searchLocation == "the Savaged Empire" && tWorld == searchLocation) { targets.Add(target); aCount++; } else if (searchLocation == "the Island of Umber Veil" && tWorld == searchLocation) { targets.Add(target); aCount++; } else if (searchLocation == "the Bottle World of Kuldar" && tWorld == searchLocation) { targets.Add(target); aCount++; } else if (searchLocation == "the Underworld" && tWorld == searchLocation) { targets.Add(target); aCount++; } } if (aCount < 1) // SAFETY CATCH IF IT FINDS NO CREATURES AT ALL...IT WILL FIND AT LEAST ONE IN SOSARIA // { if (target.Karma < 0 && target.Fame < fee && reg.IsPartOf(typeof(DungeonRegion)) && tWorld == "the Land of Sosaria") { targets.Add(target); aCount++; } } } } aCount = Utility.RandomMinMax(1, aCount); int xCount = 0; for (int i = 0; i < targets.Count; ++i) { xCount++; if (xCount == aCount) { Mobile theVictim = ( Mobile )targets[i]; string kWorld = Worlds.GetMyWorld(theVictim.Map, theVictim.Location, theVictim.X, theVictim.Y); string kVictim = theVictim.GetType().ToString(); int nFee = theVictim.Fame / 5; string kDollar = ((int)((Server.Misc.MyServerSettings.QuestRewardModifier() * 0.01) * nFee)).ToString(); string killName = theVictim.Name; string killTitle = theVictim.Title; if (theVictim is Wyrms) { killName = "a wyrm"; killTitle = ""; } if (theVictim is Daemon) { killName = "a daemon"; killTitle = ""; } if (theVictim is Balron) { killName = "a balron"; killTitle = ""; } if (theVictim is RidingDragon || theVictim is Dragons) { killName = "a dragon"; killTitle = ""; } if (theVictim is BombWorshipper) { killName = "a worshipper of the bomb"; killTitle = ""; } if (theVictim is Psionicist) { killName = "a psychic of the bomb"; killTitle = ""; } string myexplorer = kVictim + "#" + killTitle + "#" + killName + "#" + Server.Misc.Worlds.GetRegionName(theVictim.Map, theVictim.Location) + "#0#" + kDollar + "#" + kWorld + "#Monster"; CharacterDatabase.SetQuestInfo(m, "AssassinQuest", myexplorer); string theStory = myexplorer + "#" + AssassinFunctions.QuestSentence(m); // ADD THE STORY PART CharacterDatabase.SetQuestInfo(m, "AssassinQuest", theStory); } } }