Ejemplo n.º 1
0
        public void TrySubmitKill(HuntMaster master, Mobile from, HuntingPermit permit)
        {
            if (permit.KillEntry == null || permit.KillEntry.KillIndex < 0 || permit.KillEntry.KillIndex > HuntingTrophyInfo.Infos.Count)
            {
                master.SayTo(from, 1155706); // That is not a valid kill.
            }
            else
            {
                HuntingTrophyInfo info = HuntingTrophyInfo.Infos[permit.KillEntry.KillIndex];

                if (info != null)
                {
                    if (!m_Leaders.ContainsKey(info.HuntType))
                    {
                        m_Leaders[info.HuntType] = new List <HuntingKillEntry>();
                    }

                    List <HuntingKillEntry> leaders = m_Leaders[info.HuntType];

                    if (leaders.Count == 0 || permit.KillEntry.Measurement >= leaders[0].Measurement)
                    {
                        if (leaders.Count > 0 && permit.KillEntry.Measurement > leaders[0].Measurement)
                        {
                            leaders.Clear();
                        }

                        leaders.Add(new HuntingKillEntry(permit.Owner, permit.KillEntry.Measurement, permit.KillEntry.DateKilled, permit.KillEntry.KillIndex, permit.KillEntry.Location));

                        from.SendGump(new BasicInfoGump(1155722));

                        HuntingDisplayTrophy.InvalidateDisplayTrophies();
                        master.PlaySound(0x3D);
                    }
                    else
                    {
                        master.SayTo(from, 1155721); // Begging thy pardon, but your permit has not broken the current record for this species!
                    }
                    permit.HasSubmitted = true;

                    CheckKill(info.HuntType, permit.KillEntry);

                    if (from is PlayerMobile)
                    {
                        BaseQuest quest = QuestHelper.GetQuest((PlayerMobile)from, typeof(HuntmastersChallengeQuest));

                        if (quest != null && quest is HuntmastersChallengeQuest)
                        {
                            ((HuntmastersChallengeQuest)quest).CompleteChallenge();
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
 public BuyPermitEntry(HuntMaster master) : base(1155701, 3)             // Get Hunting Permit
 {
     m_HuntMaster = master;
 }
Ejemplo n.º 3
0
			public BuyPermitEntry(HuntMaster master) : base(1155701, 3) // Get Hunting Permit
			{
				m_HuntMaster = master;
			}
Ejemplo n.º 4
0
		public void TrySubmitKill(HuntMaster master, Mobile from, HuntingPermit permit)
		{
			if(permit.KillEntry == null || permit.KillEntry.KillIndex < 0 || permit.KillEntry.KillIndex > HuntingTrophyInfo.Infos.Count)
				master.SayTo(from, 1155706); // That is not a valid kill.
			else
			{
				HuntingTrophyInfo info = HuntingTrophyInfo.Infos[permit.KillEntry.KillIndex];
				
				if(info != null)
				{
                    if (!m_Leaders.ContainsKey(info.HuntType))
                        m_Leaders[info.HuntType] = new List<HuntingKillEntry>();

					List<HuntingKillEntry> leaders = m_Leaders[info.HuntType];
					
					if(leaders.Count == 0 || permit.KillEntry.Measurement >= leaders[0].Measurement)
					{
						if (leaders.Count > 0 && permit.KillEntry.Measurement > leaders[0].Measurement)
							leaders.Clear();
						
						leaders.Add(new HuntingKillEntry(permit.Owner, permit.KillEntry.Measurement, permit.KillEntry.DateKilled, permit.KillEntry.KillIndex, permit.KillEntry.Location));
						
						from.SendGump(new BasicInfoGump(1155722));

                        HuntingDisplayTrophy.InvalidateDisplayTrophies();
                        master.PlaySound(0x3D);
					}
					else
						master.SayTo(from, 1155721); // Begging thy pardon, but your permit has not broken the current record for this species!
						
					permit.HasSubmitted = true;

                    CheckKill(info.HuntType, permit.KillEntry);
				}
			}
		}