I want that some spells would cast only by using SpellScrolls
I know how to cancel a cast of a spell But the problem is that in
C#:
public WaterElementalSpell(Mobile caster, Item scroll):base(caster, scroll, m_info)
"Mobile caster" and "Item scroll" are in the same script
 
no Its not works and I think you didn't understand me Let's try another way
How to prevent from dragging-adding some SpellScrolls to a magic book?
 
Well thats by far not what you asked though.

Anyway
Spellbook.cs - OnDragDrop
AddToSpellbookEntry - OnTarget OR
SpellScroll.cs - GetContextMenuEntries

You can also edit both files if you want to
 
C#:
public override bool OnDragDrop(Mobile from, Item dropped)
        {
            if (dropped is SpellScroll && !(dropped is SpellStone))
            {
                SpellScroll scroll = (SpellScroll)dropped;

                SpellbookType type = GetTypeForSpell(scroll.SpellID);

                if (type != SpellbookType || scroll.SpellID==8044 )
                {
                    return false;
                }
OK
How to get-match scroll ID? cause
C#:
if (type != SpellbookType || scroll.SpellID==8044 )
doesn't work
 
Scripts\Spells\Initializer.cs

after Register is the # for each spell

// First circle
Register(00, typeof(First.ClumsySpell));
Register(01, typeof(First.CreateFoodSpell));
Register(02, typeof(First.FeeblemindSpell));
Register(03, typeof(First.HealSpell));
Register(04, typeof(First.MagicArrowSpell));
Register(05, typeof(First.NightSightSpell));
Register(06, typeof(First.ReactiveArmorSpell));
Register(07, typeof(First.WeakenSpell));
 
Thanks It works like this
C#:
if (dropped is SpellScroll && !(dropped is SpellStone))
            {
                SpellScroll scroll = (SpellScroll)dropped;

                SpellbookType type = GetTypeForSpell(scroll.SpellID);
                
                int Intgr=scroll.SpellID;//edited

                if (type != SpellbookType || Intgr == 63  )//editwed
                {
                    return false;
                }
 
Back