[Add-On]Staff Tools 1.0]

Page 2 of 6 FirstFirst 123456 LastLast
Results 16 to 30 of 76
  1. #16
    Alpha Member XxОsirisxX is offline
    MemberRank
    Aug 2009 Join Date
    2,727Posts

    Re: Staff Tools 1.0

    I see a lot of useless stuff, but it's really the best thing I have seen in a while released in RaGEZONE have to say (Best as, working and that effort is shown). However, removeAll is not a method everyone does have I believe, but I will assume it's just a loop using removeFromSlot, if you do are directly altering the inventory list, you're probably really into risking at getting ConcurrentModificationException if user drop the item, or if you're looping trough the collection and then remove it.

    I haven't check the whole thing, but, those were my 72 cents. Good job, I guess...

  2. #17
    You'll never know what th AskHugo is offline
    MemberRank
    Jun 2010 Join Date
    The InternetLocation
    234Posts

    Re: Staff Tools 1.0

    Quote Originally Posted by XxОsirisxX View Post
    I see a lot of useless stuff, but it's really the best thing I have seen in a while released in RaGEZONE have to say (Best as, working and that effort is shown). However, removeAll is not a method everyone does have I believe, but I will assume it's just a loop using removeFromSlot, if you do are directly altering the inventory list, you're probably really into risking at getting ConcurrentModificationException if user drop the item, or if you're looping trough the collection and then remove it.

    I haven't check the whole thing, but, those were my 72 cents. Good job, I guess...


    You're right, it does loop removeFromSlot.
    PHP Code:
        public static void removeAllById(MapleClient cint itemIdboolean checkEquipped) {
            
    MapleInventoryType type MapleItemInformationProvider.getInstance().getInventoryType(itemId);
            for (
    IItem item c.getPlayer().getInventory(type).listById(itemId)) {
                if (
    item != null) {
                    
    removeFromSlot(ctypeitem.getPosition(), item.getQuantity(), truefalse);
                }
            }
            if (
    checkEquipped) {
                
    IItem ii c.getPlayer().getInventory(type).findById(itemId);
                if (
    ii != null) {
                    
    c.getPlayer().getInventory(MapleInventoryType.EQUIPPED).removeItem(ii.getPosition());
                    
    c.getPlayer().equipChanged();
                }
            }
        } 
    But I think most sources do have that. At least the two I've tested: ThePack and XiuzSource. I'm sure it's been used many times before, shouldn't be too much of a risk.

    Now that I look at it, since I'm using removeAll anyways I should just make a function that takes an id as a parameter and wipes all. I originally had it only delete the amount in the certain slot and it was too much of a task to delete each one individually. Specially if the player notices their items getting deleted and decides to log off. I might recode that bit.

    EDIT: Changed that. And thanks to you I found out a pretty embarrassing error I made. I actually re-coded this npc prior to releasing it to make it neater, and thanks to Murphy's law; I messed up on a section. Read the bottom of the original post for instructions on how to fix it.
    Last edited by AskHugo; 03-02-11 at 11:47 PM.

  3. #18
    Account Upgraded | Title Enabled! HorrorChix89 is offline
    MemberRank
    May 2010 Join Date
    ArkansasLocation
    1,279Posts

    Re: Staff Tools 1.0

    This looks good, great job and thanks for this release.

  4. #19
    You'll never know what th AskHugo is offline
    MemberRank
    Jun 2010 Join Date
    The InternetLocation
    234Posts

    Re: Staff Tools 1.0

    Quote Originally Posted by HorrorChix89 View Post
    This looks good, great job and thanks for this release.
    Thank you!

    But did anyone implement this? Just wondering, because if anyone needs any help I'm willing to help. This works 100% in my server though.

  5. #20
    :) iJFAC is offline
    MemberRank
    Sep 2007 Join Date
    SomewhereLocation
    519Posts

    Re: Staff Tools 1.0

    Great job, epic stuff o.o

  6. #21
    Enthusiast anitawu is offline
    MemberRank
    Feb 2011 Join Date
    25Posts

    Re: Staff Tools 1.0

    Nice ~~

    Three methods are help GM check out status, really. Thank you.

  7. #22
    Alpha Member Hennessy`' is offline
    MemberRank
    Dec 2009 Join Date
    in a CaveLocation
    2,298Posts

    Re: Staff Tools 1.0

    Just a Small mistake you did there, Just so that People dont have to wonder "Why am i getting this red line?"

    PHP Code:
        public int getSetupId(byte slot) {
            
    MapleInventory setup = .getInventory(MapleInventoryType.SETUP);
            return 
    setup.getItem(slot).getItemId();
        } 
    Replace that to:

    PHP Code:
        public int getSetupId(byte slot) {
            
    MapleInventory setup getInventory(MapleInventoryType.SETUP);
            return 
    setup.getItem(slot).getItemId();
        } 

  8. #23
    I'm overrated. Fraysa is offline
    MemberRank
    Apr 2008 Join Date
    4,891Posts

    Re: Staff Tools 1.0

    Quote Originally Posted by Soulfist View Post
    Yeah, while I was waiting for your post I made the commands myself :)
    cool u feel pro now??/
    now gtfo and make a new acct

    @thread, pretty awesome! gj.

  9. #24
    You'll never know what th AskHugo is offline
    MemberRank
    Jun 2010 Join Date
    The InternetLocation
    234Posts

    Re: Staff Tools 1.0

    Quote Originally Posted by iAlex View Post
    Just a Small mistake you did there, Just so that People dont have to wonder "Why am i getting this red line?"

    PHP Code:
        public int getSetupId(byte slot) {
            
    MapleInventory setup = .getInventory(MapleInventoryType.SETUP);
            return 
    setup.getItem(slot).getItemId();
        } 
    Replace that to:

    PHP Code:
        public int getSetupId(byte slot) {
            
    MapleInventory setup getInventory(MapleInventoryType.SETUP);
            return 
    setup.getItem(slot).getItemId();
        } 

    Thanks. Sorry about that, I left that dot there by accident because it was a NPCConversationManager function previously.
    Last edited by AskHugo; 04-02-11 at 06:57 PM.

  10. #25
    Account Upgraded | Title Enabled! iCris is offline
    MemberRank
    Nov 2008 Join Date
    251Posts

    Re: Staff Tools 1.0

    Thanks, this is some really good work. I've already implemented your first NPC into my server and it's working great. I went ahead and made it so I could view equipped items as well (copy pasta + change equip to equipped in InventoryType). Deleting from equipped it a bit sketchy, I'll probably make it unequip the item then delete it, but for now viewing is all I need. Also I'm probably going to make it so if you select an equip, it will show the stats in the window that displays the item quantity.

  11. #26
    You'll never know what th AskHugo is offline
    MemberRank
    Jun 2010 Join Date
    The InternetLocation
    234Posts

    Re: Staff Tools 1.0

    Quote Originally Posted by iCris View Post
    Thanks, this is some really good work. I've already implemented your first NPC into my server and it's working great. I went ahead and made it so I could view equipped items as well (copy pasta + change equip to equipped in InventoryType). Deleting from equipped it a bit sketchy, I'll probably make it unequip the item then delete it, but for now viewing is all I need. Also I'm probably going to make it so if you select an equip, it will show the stats in the window that displays the item quantity.
    Great idea! I'll add that option to it right now. Will update the thread with it once it's tested and working on my server.

    I don't think it should be so much of an issue for deleting equipped items, since it deletes by id not slot byte. Though it used to, that's why equip quantity is just "+= 1", thanks for reminding me; changed it.
    Last edited by AskHugo; 04-02-11 at 07:30 PM.

  12. #27
    Account Upgraded | Title Enabled! redeemer34 is offline
    MemberRank
    Aug 2008 Join Date
    335Posts

    Re: Staff Tools 1.0

    Great release. Lots of effort was put in, and it's something that I haven't seen before. Props.

  13. #28
    TranquilityStory JarrYD is offline
    MemberRank
    Jan 2010 Join Date
    764Posts

    Re: Staff Tools 1.0

    shouldnt it be
    Code:
    EquipList(cm.getClient()));
    instead of
    Code:
    EquipList(cm.getC()));
    ?

  14. #29
    Alpha Member Soulfist is offline
    MemberRank
    Dec 2010 Join Date
    a hovelLocation
    1,835Posts

    Re: Staff Tools 1.0

    Quote Originally Posted by Fraysa View Post
    cool u feel pro now??/
    now gtfo and make a new acct
    Who stuck a pole up your ass today?

  15. #30
    You'll never know what th AskHugo is offline
    MemberRank
    Jun 2010 Join Date
    The InternetLocation
    234Posts

    Re: Staff Tools 1.0

    Quote Originally Posted by JarrYD View Post
    shouldnt it be
    Code:
    EquipList(cm.getClient()));
    instead of
    Code:
    EquipList(cm.getC()));
    ?
    It's the same thing. Some sources have getClient() some have getC() and most have both. No one has posted an issue about it, so I'm not really worrying.



Page 2 of 6 FirstFirst 123456 LastLast

Advertisement