Exemplo n.º 1
0
        public virtual void OnLootRoll(DungeonLootEntry entry, DungeonLootRoll roll)
        {
            if (entry == null || !entry.Valid)
            {
                return;
            }

            GroupMessage(
                m =>
                String.Format(
                    "{0} select{1} {2} for:  {3}",
                    m == roll.Mobile ? "You" : roll.Mobile.RawName,
                    m != roll.Mobile ? "s" : String.Empty,
                    roll.Action,
                    entry.Item.ResolveName(m).ToUpperWords()));
        }
Exemplo n.º 2
0
        public virtual void OnLootWin(DungeonLootEntry entry, DungeonLootRoll roll, bool timeout)
        {
            if (entry == null || !entry.Valid)
            {
                return;
            }

            entry.Item.Movable = true;

            if (!GiveLoot(roll.Mobile, entry.Item, false))
            {
                entry.Winner = null;
                entry.Rolls.Remove(roll.Mobile);
                roll.Free();
                return;
            }

            foreach (var val in entry.Rolls.Values)
            {
                DungeonLootRoll r;

                if (val != null)
                {
                    r = val.Value;
                }
                else
                {
                    continue;
                }

                GroupMessage(
                    m =>
                    String.Format(
                        "{0} roll{1} {2}",
                        m == r.Mobile ? "You" : r.Mobile.RawName,
                        m != r.Mobile ? "s" : String.Empty,
                        r.Value));
            }

            GroupMessage(
                m =>
                String.Format(
                    "{0} receive{1} loot: {2}",
                    m == roll.Mobile ? "You" : roll.Mobile.RawName,
                    m != roll.Mobile ? "s" : String.Empty,
                    entry.Item.ResolveName(m).ToUpperWords()));
        }