1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Powerscroll.CS

Discussion in 'Script Support' started by Humzie, Mar 13, 2019 at 3:04 PM.

  1. Humzie
    Offline

    Humzie New Member

    Joined:
    Nov 20, 2016
    Messages:
    12
    Likes Received:
    1
    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
     

    Attached Files:

  2. Lokai
    Offline

    Moderator ServUO Developer

    Joined:
    Dec 4, 2014
    Messages:
    1,122
    Likes Received:
    160
    Post your Powerscroll.cs file.
     
  3. Humzie
    Offline

    Humzie New Member

    Joined:
    Nov 20, 2016
    Messages:
    12
    Likes Received:
    1
    upload_2019-3-13_20-40-43.png
     

    Attached Files:

  4. Lokai
    Offline

    Moderator ServUO Developer

    Joined:
    Dec 4, 2014
    Messages:
    1,122
    Likes Received:
    160
    Try this one:
     

    Attached Files:

  5. Lokai
    Offline

    Moderator ServUO Developer

    Joined:
    Dec 4, 2014
    Messages:
    1,122
    Likes Received:
    160
    Here is the key part:

    Code (C#):
    1.  
    2.  
    3.         public override bool CanUse(Mobile from)
    4.         {
    5.             if (!base.CanUse(from))
    6.                 return false;
    7.  
    8.             Skill skill = from.Skills[this.Skill];
    9.  
    10.             if (skill == null)
    11.                 return false;
    12.  
    13.             if (skill.Cap >= this.Value)
    14.             {
    15.                 from.SendLocalizedMessage(1049511, this.GetNameLocalized()); // Your ~1_type~ is too high for this power scroll.
    16.                 return false;
    17.             }
    18.  
    19.             // They need to have a cap exactly 5 less than this power scroll.
    20.             if (skill.Cap < (this.Value - 5))
    21.             {
    22.                 from.SendMessage("Your {0} is too low for this power scroll.", this.GetNameLocalized());
    23.                 return false;
    24.             }
    25.  
    26.             return true;
    27.         }
     
  6. Humzie
    Offline

    Humzie New Member

    Joined:
    Nov 20, 2016
    Messages:
    12
    Likes Received:
    1
    Thanks I will give it a shot and let you know.
    --- Double Post Merged, Mar 13, 2019 at 5:18 PM ---
    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
    --- Double Post Merged, Mar 13, 2019 at 6:05 PM ---
    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.
     
  7. Lokai
    Offline

    Moderator ServUO Developer

    Joined:
    Dec 4, 2014
    Messages:
    1,122
    Likes Received:
    160
    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.
     
  8. Humzie
    Offline

    Humzie New Member

    Joined:
    Nov 20, 2016
    Messages:
    12
    Likes Received:
    1
    I have fixed it, so I have set use type which is on top of the script to using.Server.Mobile;
    --- Double Post Merged, Mar 14, 2019 at 5:50 PM ---
    Here is the corrected powerscroll.cs for sequenced scroll order.
     

    Attached Files: