[Release] Fixed Fredrick in ThePack II

Page 1 of 2 12 LastLast
Results 1 to 15 of 24
  1. #1
    Ice Cream Ambiguous is offline
    MemberRank
    Oct 2008 Join Date
    491Posts

    [Release] Fixed Fredrick in ThePack II

    Code:
    /*Fredrick NPC (9030000)
    *By Moogra (Fixed by Ronald)
    */
    importPackage(net.sf.odinms.server);
    
    var status;
    var choice;
    
    function start() {
    	status = -1;
    	action(1, 0, 0);
    } 
    
    function action(mode, type, selection) {
    	if (mode == 1)
    		status++;
    	else {
    		cm.dispose();
    		return;
    	}
    	
    	if (status == 0)
    		cm.sendNext("Hi, I'm the store banker.");
    	else if (status == 1)
    		cm.sendSimple("Would you like to withdraw\r\n#b#L0#Mesos#l    #L1#Items#l");
    	else if (status == 2) {
    		cm.sendNext("Let me check if you have any....");
    		choice = selection;
    	} else {
    		if (choice == 0) {
    			if (status == 3) {
    				var mesoEarnt = cm.getHiredMerchantMesos();
    				if (mesoEarnt > 0)
    					cm.sendYesNo("You have made "+mesoEarnt+" mesos in your store so far. Would you like to withdraw them?");
    				else {
    					cm.sendNext("You have not made any mesos");
    					cm.dispose();
    				}
    			} else if (status == 4) {
    				cm.sendNext("Thank you for using my services, your mesos has been recieved");
    				cm.gainMeso(cm.getHiredMerchantMesos());
    				cm.setHiredMerchantMesos(0);
    				cm.dispose();
    			}
    		} else {
    			if (status == 3) {
    				var items = cm.getHiredMerchantItems();
    				if (items.size() > 0) {
    					var text = "Please select an item\r\n";
    					for (var i = 0; i < items.size(); i++)
    						text += "#L"+i+"##i"+items.get(i).getRight().getItemId()+"##l ";
    					cm.sendSimple(text);
    				} else {
    					cm.sendNext("You do not have any items from your store");
    					cm.dispose();
    				}
    			} else if (status == 4) {
    				var items = cm.getHiredMerchantItems();
    				if (cm.getC() == null)
    					cm.getPlayer().dropMessage("Received");
    				MapleInventoryManipulator.addFromDrop(cm.getC(), items.get(selection).getRight());
    				cm.sendNext("Thank you for using my services, your item has been recieved");
    				cm.removeHiredMerchantItem(items.get(selection).getLeft());
    				cm.dispose();
    			}
    		}
    	}
    }

    Just replace your script with that.

    Credits to Moogra for ThePack II and the Script
    Me for fixing it up.


  2. #2
    Ice Cream Ambiguous is offline
    MemberRank
    Oct 2008 Join Date
    491Posts

    Re: [Release] Fixed Fredrick in ThePack II

    Also, if there are scripts in the Pack II that aren't working you can tell me.

  3. #3
    Account Upgraded | Title Enabled! ridekink08 is offline
    MemberRank
    Jun 2008 Join Date
    AuroraLocation
    411Posts

    Re: [Release] Fixed Fredrick in ThePack II

    What does this fix?

  4. #4
    Ice Cream Ambiguous is offline
    MemberRank
    Oct 2008 Join Date
    491Posts

    Re: [Release] Fixed Fredrick in ThePack II

    Quote Originally Posted by ridekink08 View Post
    What does this fix?
    In The Pack II, Fredrick gives you the mesos, that you earn from your Hired Merchant, and the items.
    It didn't work for some reason, so I fixed.

  5. #5
    Account Upgraded | Title Enabled! ridekink08 is offline
    MemberRank
    Jun 2008 Join Date
    AuroraLocation
    411Posts

    Re: [Release] Fixed Fredrick in ThePack II

    Is their anyway like say if the server restarts. Will the items be retrievable?

  6. #6
    Ice Cream Ambiguous is offline
    MemberRank
    Oct 2008 Join Date
    491Posts

    Re: [Release] Fixed Fredrick in ThePack II

    Quote Originally Posted by ridekink08 View Post
    Is their anyway like say if the server restarts. Will the items be retrievable?
    I haven't restarted my server. So I do not know yet. I'm pretty sure since there's a table for Hired Merchants, the items and mesos will be stored and once you get back on, you can restore your mesos and items.

  7. #7
    Account Upgraded | Title Enabled! ridekink08 is offline
    MemberRank
    Jun 2008 Join Date
    AuroraLocation
    411Posts

    Re: [Release] Fixed Fredrick in ThePack II

    Maybe this fixed that. Is their anyway you can see. Because I know that was sorta a problem with my hired merchants on my server.

  8. #8
    Ice Cream Ambiguous is offline
    MemberRank
    Oct 2008 Join Date
    491Posts

    Re: [Release] Fixed Fredrick in ThePack II

    Quote Originally Posted by ridekink08 View Post
    Maybe this fixed that. Is their anyway you can see. Because I know that was sorta a problem with my hired merchants on my server.
    Uhm, on my next restart for my server, I'll try, okay?

  9. #9
    Account Upgraded | Title Enabled! ridekink08 is offline
    MemberRank
    Jun 2008 Join Date
    AuroraLocation
    411Posts

    Re: [Release] Fixed Fredrick in ThePack II

    Thanks. Would appreciate feedback.

  10. #10
    Member DJMitch is offline
    MemberRank
    May 2007 Join Date
    54Posts

    Re: [Release] Fixed Fredrick in ThePack II

    Tried it on my dev server, didn't work.

    Opened a store, put in some items.
    Logged out properly
    Restarted server
    Logged back on and noticed store was gone (duh)
    Opened Fredrick and clicked on items.
    No items available, FUUUU-

    Anyway, it probably needs some more fixage. ;)

  11. #11
    Account Upgraded | Title Enabled! ridekink08 is offline
    MemberRank
    Jun 2008 Join Date
    AuroraLocation
    411Posts

    Re: [Release] Fixed Fredrick in ThePack II

    Did you shut down the server correctly?

  12. #12
    Ice Cream Ambiguous is offline
    MemberRank
    Oct 2008 Join Date
    491Posts

    Re: [Release] Fixed Fredrick in ThePack II

    Quote Originally Posted by DJMitch View Post
    Tried it on my dev server, didn't work.

    Opened a store, put in some items.
    Logged out properly
    Restarted server
    Logged back on and noticed store was gone (duh)
    Opened Fredrick and clicked on items.
    No items available, FUUUU-

    Anyway, it probably needs some more fixage. ;)
    Lmao, you dummy, my post at first was just my theory.

  13. #13
    Infraction Banned MrMysterious is offline
    MemberRank
    Dec 2008 Join Date
    In a treeLocation
    752Posts

    Re: [Release] Fixed Fredrick in ThePack II

    /*Fredrick NPC (9030000)
    *By Moogra (Fixed by Ronald)
    */


    LOL *AHEM*

  14. #14
    Ice Cream Ambiguous is offline
    MemberRank
    Oct 2008 Join Date
    491Posts

    Re: [Release] Fixed Fredrick in ThePack II

    Quote Originally Posted by MrMysterious View Post
    /*Fredrick NPC (9030000)
    *By Moogra (Fixed by Ronald)
    */


    LOL *AHEM*
    What about it? It didn't work when Moogra made it. And I am Ronald?

  15. #15
    Account Upgraded | Title Enabled! ~Justin~ is offline
    MemberRank
    Jul 2008 Join Date
    Up Your Buttt ALocation
    905Posts

    Re: [Release] Fixed Fredrick in ThePack II

    If you wanna keep the items you will have to make a table in the DB.



Page 1 of 2 12 LastLast

Advertisement