Exemplo n.º 1
0
        public override void UseThingWith(Player user, Position posWith, GameWorld world,
                                          byte stackposWith)
        {
            string attr = GetAttribute(Constants.ATTRIBUTE_RUNES_SPELL_NAME);

            if (attr != null)
            {
                Spell spell = Spell.CreateRuneSpell(attr, user, posWith);
                spell.Rune            = this;
                spell.UseWithPos      = posWith;
                spell.UseWithStackpos = stackposWith;
                world.GetSpellSystem().CastSpell(spell.Name, user, spell, world);
                return;
            }

            if (useItemsWith.ContainsKey(ItemID))
            {
                useItemsWith[ItemID](this, user, world, posWith, stackposWith);
            }
        }
Exemplo n.º 2
0
        protected virtual string GetDetailedInformation(Player player)
        {
            string atk  = GetAttribute(Constants.ATTRIBUTE_ATTACK);
            string def  = GetAttribute(Constants.ATTRIBUTE_DEFENSE);
            string rune = GetAttribute(Constants.ATTRIBUTE_RUNES_SPELL_NAME);

            if (atk != null && def != null)
            {
                return(" (Atk:" + atk + " Def:" + def + ")");
            }

            string arm = GetAttribute(Constants.ATTRIBUTE_ARMOR);

            if (arm != null)
            {
                return(" (Arm: " + arm + ")");
            }

            if (rune != null)
            {
                Spell  spell = Spell.CreateRuneSpell(rune, player, player.CurrentPosition);
                string desc  = " for magic level " + spell.RequiredMLevel + " .";
                desc += " It's an \"" + rune + "\"-spell (" + Charges + "x)";
                return(desc);
            }

            if (IsOfType(Constants.TYPE_FLUID_CONTAINER))
            {
                if (FluidType != Fluids.FLUID_NONE)
                {
                    return(" of " + GetFluidName());
                }
                else
                {
                    return(". It is empty");
                }
            }

            return("");
        }