Powerscroll.CS

Humzie

Member
Nov 20, 2016
12
1
22
London
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

Lokai

Moderator
ServUO Developer
Dec 4, 2014
1,199
189
Western New York State
Shard Name
Test Center
Donate
Donate money to this user
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;
        }
 

Humzie

Member
Nov 20, 2016
12
1
22
London
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.
 

Lokai

Moderator
ServUO Developer
Dec 4, 2014
1,199
189
Western New York State
Shard Name
Test Center
Donate
Donate money to this user
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.
 

Humzie

Member
Nov 20, 2016
12
1
22
London
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