Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • ASDss: where do u download source and clients now
      August 18, 2017, 10:39:31 PM
    • ASDss: yo
      August 18, 2017, 10:39:20 PM
    • dan v jad: click me 4 da fun ;)[link]
      August 18, 2017, 04:39:58 PM
    • stCky: Palidinho is your OpenGL (was it OpenGL?) stuff open source anywhere?
      August 16, 2017, 09:07:22 PM
    • Travas:BUILD THE WALL
      August 15, 2017, 09:28:49 PM
    • Travas: i have ass cancer
      August 15, 2017, 09:23:29 PM
    • stCky: what are the fudge are you tryna ask?
      August 15, 2017, 08:21:35 PM
    • bader: what are the rsps community alive ?
      August 15, 2017, 05:46:16 PM
    • bader: yo guys
      August 15, 2017, 05:46:08 PM
    • Spacehost:[link] Updated our thread :)
      August 15, 2017, 09:40:34 AM
    • Adaro: The client is in Download section at Homepage
      August 15, 2017, 01:09:20 AM
    • FaTe_Of_GoDs: where do i get the client?????????????
      August 14, 2017, 05:23:14 PM
    • stCky: can anyone help me? I cant login to the shoutbox
      August 13, 2017, 05:45:15 PM
    • drubrkletern: appeal denied
      August 13, 2017, 02:35:27 PM
    • King_Trout:[link]
      August 13, 2017, 11:17:12 AM
    • Cole1497: no sorry
      August 13, 2017, 10:27:14 AM
    • ayz: yo can anyone explain something to me
      August 13, 2017, 08:08:51 AM
    • coolking12: Hi
      August 13, 2017, 04:16:06 AM
    • stCky: n+1
      August 11, 2017, 06:09:24 PM
    • PalidinoDH: How many more pages are going to show errors before this dude gets on and fixes shit
      August 11, 2017, 04:57:00 PM

    Author Topic: Smithing Interface  (Read 602 times)

    0 Members and 1 Guest are viewing this topic.

    Offlinesuseto

    • Member
    • **
    • Posts: 48
    • Thanks: +0/-0
      • View Profile
    Smithing Interface
    « on: February 21, 2016, 05:36:24 PM »
    I'm using a unique anvil for a unique smithing class and I was wondering if this particular bit of code in Objecthandler.java would be accurate.

    Code: [Select]
    } } else if (id == 2672) {
    player.getInterfaceManager().sendInterface(300);
    if (Skills.SMITHING < 99)
    player.getPackets().sendGameMessage("You need 99 smithing in order to smith this armour");
    } else {
    player.getInterfaceManager().containsInterface(Smithing.SMITHING_INTERFACE);

    If not how else would I declare the method with the required smithing level?
    « Last Edit: February 21, 2016, 05:47:24 PM by suseto »


    Offlinesk8rdude461

    • MOPARSCAPE WAS HACKED
    • Member
    • ****
    • *
    • Posts: 12,471
    • Thanks: +0/-0
      • View Profile
    Re: Smithing Interface
    « Reply #1 on: February 21, 2016, 05:39:41 PM »
    Doesn't look like it.
    Skills.SMITHING seems to be a constant.. Which means the value of it will NEVER change. So the player would never be able to use the anvil.

    You need to get the level from the player object.

    Assuming you had an array of ints called "playerLevel" for your player's levels, you'd do:
    Code: Java
    1. if(player.playerLevel[Skills.SMITHING]<99){
    2.     player.getPackets().sendGameMessage("You need 99 smithing in order to smith this armour");
    3. }else{
    4.     player.getInterfaceManager().sendSkills(Smithing.ForgingInterface);
    5. }

    Offlinesuseto

    • Member
    • **
    • Posts: 48
    • Thanks: +0/-0
      • View Profile
    Re: Smithing Interface
    « Reply #2 on: February 21, 2016, 05:52:25 PM »
    Okay, Playerlevel isn't a method in my source atleast, perhaps I would need to retrieve the level?  Something like:

    Code: [Select]
    player.getskills(13, 99);
    } else {
    player.getpackets.sendGameMessage("You need 99 Smithing in order to use this anvil.");

    Offlinesk8rdude461

    • MOPARSCAPE WAS HACKED
    • Member
    • ****
    • *
    • Posts: 12,471
    • Thanks: +0/-0
      • View Profile
    Re: Smithing Interface
    « Reply #3 on: February 21, 2016, 06:22:42 PM »
    Okay, Playerlevel isn't a method in my source atleast, perhaps I would need to retrieve the level?  Something like:

    Code: [Select]
    player.getskills(13, 99);
    } else {
    player.getpackets.sendGameMessage("You need 99 Smithing in order to use this anvil.");
    You clearly didn't read anything I said.
    I said that I'm assuming your server has the variable (It is a variable, not a method).
    Take a look at literally any other skill, see how it does level requirements. Do the same for smithing, but change the skill id to smithing.. Which would be that "Skills.SMITHING" constant you tried using.

     

    Copyright © 2017 MoparScape. All rights reserved.
    Powered by SMFPacks SEO Pro Mod |
    SimplePortal 2.3.5 © 2008-2012, SimplePortal