Ejemplo 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);
            }
        }
Ejemplo n.º 2
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);
            }
        }