Checking Traits using NPC Scripts.

Results 1 to 4 of 4
  1. #1
    Enthusiast Inaloma is offline
    MemberRank
    Jan 2014 Join Date
    34Posts

    Checking Traits using NPC Scripts.

    It really sucks that I don't have a v140+ source handy on me.

    I don't know if it even exists, but is there a code that I can put in my script that'll check if the player has max Diligence?


  2. #2
    Moderator Eric is offline
    ModeratorRank
    Jan 2010 Join Date
    DEV CityLocation
    3,188Posts

    Re: Checking Traits using NPC Scripts.

    Code:
    if (cm.getPlayer().getTrait(Packages.client.MapleTrait.MapleTraitType.craft).getExp() == 96000) {
    	// code here
    }
    Tested and works. Good luck with your development!

  3. #3
    Enthusiast Inaloma is offline
    MemberRank
    Jan 2014 Join Date
    34Posts

    Re: Checking Traits using NPC Scripts.

    Quote Originally Posted by chunkarama View Post
    Code:
    if (cm.getPlayer().getTrait(Packages.client.MapleTrait.MapleTraitType.craft).getExp() == 96000) {
        // code here
    }
    Tested and works. Good luck with your development!
    Thanks!

    EDIT : Last thing, does anyone know how to check if the item has a Lucky Day Scroll or any of those types of scrolls (I.E : Protection/Safety)?

  4. #4
    Proficient Member iFate is offline
    MemberRank
    Apr 2008 Join Date
    168Posts

    Re: Checking Traits using NPC Scripts.

    In my Lithium-based source, ItemFlag.java (Client.inventory) has SLOTS_PROTECT and SCROLL_PROTECT. Not entirely sure how you'd reference them back in a check, but I'm sure there's a good starting point.



Advertisement