I'm trying to modify the powerscroll.cs so that when players want to reach 120 of any skill, you have have to eat scrolls in order (example 105 > 110 > 115 > 120).

I currently get this error below:


thanks,

Humzie
 

Attachments

  • powerscroll.cs.png
    powerscroll.cs.png
    71.3 KB · Views: 21
Here is the key part:

Code:
        public override bool CanUse(Mobile from)
        {
            if (!base.CanUse(from))
                return false;

            Skill skill = from.Skills[this.Skill];

            if (skill == null)
                return false;

            if (skill.Cap >= this.Value)
            {
                from.SendLocalizedMessage(1049511, this.GetNameLocalized()); // Your ~1_type~ is too high for this power scroll.
                return false;
            }

            // They need to have a cap exactly 5 less than this power scroll.
            if (skill.Cap < (this.Value - 5))
            {
                from.SendMessage("Your {0} is too low for this power scroll.", this.GetNameLocalized());
                return false;
            }

            return true;
        }
 
Thanks I will give it a shot and let you know.
[doublepost=1552511919][/doublepost]So I have replaced my PowerScroll.cs with the one you have provided and I receive this error below
upload_2019-3-13_21-17-24.png
[doublepost=1552514752][/doublepost]So I have managed to fix those error listed above, now I have come by another issue.

When I attempt to eat a power-scroll it doesn't raise my skill cap, their isn't even a window prompting before eating the scroll.
 
You must have broken something else. When I changed "PlayerMobile" to "Mobile" in both the CanUse and Use methods, the powerscroll worked fine for me. Post what you have again.
 
I have fixed it, so I have set use type which is on top of the script to using.Server.Mobile;
[doublepost=1552600253][/doublepost]Here is the corrected powerscroll.cs for sequenced scroll order.
 

Attachments

  • PowerScroll.cs
    9.2 KB · Views: 36
Back