public DuelAcceptGump(DuelRune rune, DuelAcceptTimer timer) : base(rune) { m_Rune = rune; Active = (DateTime.Now + TimeSpan.FromMinutes(1.0)); AddType(); AddOptions(); AddBackOpponent(); AddAccept(); m_Timer = timer; int score = DuelScoreSystem.GetScore(m_Rune.Starter, m_Rune.DType.TypeNumber); int place = DuelScoreSystem.GetRank(m_Rune.Starter, m_Rune.DType.TypeNumber); string rank = "N/A"; if (place != 0) rank = place.ToString(); string points = "N/A"; if (score > -99) points = score.ToString(); List<string> arr = new List<string>(); arr.Add("Name:"); arr.Add(m_Rune.Starter.Name); arr.Add("Raw Strength:"); arr.Add(m_Rune.Starter.RawStr.ToString()); arr.Add("Points:"); arr.Add(points); arr.Add("Raw Dexterty:"); arr.Add(m_Rune.Starter.RawDex.ToString()); arr.Add("Rank:"); arr.Add(rank); arr.Add("Raw Intelligence:"); arr.Add(m_Rune.Starter.RawInt.ToString()); AddTable(20, 430, new int[] { 48, 135, 135, 56 }, arr, new string[] { "ffffff", "ffffff", "ffffff", "ffffff", }); }
protected override void OnTarget(Mobile from, object target) { from.RevealingAction(); //Lets see who challenged. if (target == m_Rune.Starter) from.SendMessage("You cannot duel yourself."); else if (target is PlayerMobile) { Mobile targ = (Mobile)target; DuelData targdata; DuelScoreSystem.DuelDataDictionaryArray[m_Rune.DType.TypeNumber].TryGetValue(targ, out targdata); if (!m_Rune.Npc.FactionOnly || Faction.Find(targ) != null) { if (!((PlayerMobile)targ).Young) { if (!m_Rune.Npc.Deleted && targ.InRange(m_Rune.Npc, 15)) { if (m_Rune.Npc.Participants != null && !(Array.BinarySearch(m_Rune.Npc.Participants, targ) < 0)) from.SendMessage("That opponent is already duelling."); else if (targ.HasGump( typeof( DuelAcceptGump )) ) from.SendMessage("That opponent is currently considering another challenge. Please try again later."); // else if (targdata != null && targdata.Points < -5) // from.SendMessage("That character is probably not interested in this type of duel."); else { from.SendMessage("You have challenged your opponent, please wait for their reaction."); if (m_Partnr == 0) { Targeting.Target.Cancel(targ); //added by Blady - let's see if it will correctly cancel the target. Dueller.CloseGumps(targ); m_Rune.Participants[1] = targ; DuelAcceptTimer timer = new DuelAcceptTimer(from, targ, m_Rune.DType.TypeNumber); timer.Start(); targ.SendGump(new DuelAcceptGump(m_Rune, timer)); return; } else { if (!(Array.BinarySearch(m_Rune.Participants, targ) < 0)) from.SendMessage("You cannot duel any of the other participants that you have already challenged."); else { m_Rune.Participants[m_Partnr] = targ; Dueller.CloseGumps(from); from.SendGump(new DuelStarterGump(m_Rune)); return; } } } } else // More than 15 tiles for dueller, lets not bother the player with a gump. from.SendMessage("That opponent is too far away from the arena."); } else // too young from.SendMessage("That opponent is too young."); } else// Not in faction from.SendMessage("This Duel Arena is only open to faction members."); } else // Not Mobile from.SendMessage("You cannot duel that!"); ResendOnFailure(); }