Thread: Basic Server/Demonik source Fixes.

Results 1 to 2 of 2
  1. #1 Basic Server/Demonik source Fixes. 
    anc13nts
    Guest
    Well I feel like being nice and I just know how lazy you all are out there so I just decided to do some MINOR releases because Im bored and yeah...


    The Range fix:
    File edit: RangeEvent Class

    well the bug with Ranging in Demonik\Basic is that you can MASS click the player\monster to shoot more then 1 arrow at once making you hit multiple or more times at once leading to a 1 hit death. In order to fix this you simply set a DELAY.

    This is what you should see.

    Code:
    	public void run() {
    		if(!owner.checkAttack(target) || owner.getRangeEquip() < 0)  {
    			stop();
    			return;
    		}
    This is what it SHOULD BE

    Code:
    public void run() {
    		if(System.currentTimeMillis() - owner.getLastRanged() <= 1450)
    		{
    			owner.getActionSender().sendMessage("You must wait " + (1.45 - ((System.currentTimeMillis() - owner.getLastRanged()) / 1000)) + " seconds before you can shoot again");
    			return;
    		}
    5 Minute logout Dupe:
    File edit : ClientUpdater Class

    The next bug in the Demonik\Basic source is the 5 Minute logout bug, the dupe is worked by standing in one spot for 5 minutes, and letting monsters repeatedly attack you and when you logout you will have a duplicate of your account fighting a monster.

    To fix this make it REMOVE your character, or just Extend the Logout TIME

    Im not ganna show how to make it REMOVE the character hence that would fix another like 5 dupes that I think you should work and fix them your self.

    So to extend the TIME you should see

    Code:
    			if(curTime - p.getLastMoved() >= 360000)
    			{
    				p.getActionSender().sendLogout();
    				world.unregisterPlayer(p, true);
    				p.getSession().close();
    			}
    		} else
    		if(curTime - p.getLastMoved() >= 300000)
    		{
    			p.getActionSender().sendMessage("@cya@You have not moved for 5 mins! Please move to a new area to avoid logout.");
    			p.warnToMove();
    	   	}
    Just EXTEND both of those times, and then it should be good for then....


    NOT A BUG BUT SOMETHING TO ADD..

    Feature : Following
    Files edited: Client side, Mudclient class

    Well I am deciding to release following in the Demonik\Basic **** source because I don't care anymore.

    Open up the Mudclient Class and search for this

    Code:
    public final class mudclient extends GameWindowMiddleMan
    Under that somewhere you should find.

    Code:
    	private int server1Status = -1;
    	private int server2Status = -1;
    	private int serverStatusBox = -1;
    Right under that add,

    Code:
    	private boolean diditonce = false;
    	private boolean allDone = true;
    	private boolean sentbyfollow = false;
    Yay now its time for some VOID making YIPEE.

    So this is what it should look like so far.

    Code:
    	private int server1Status = -1;
    	private int server2Status = -1;
    	private int serverStatusBox = -1;
    	private boolean diditonce = false;
    	private boolean allDone = true;
    	private boolean sentbyfollow = false;
    Now right under that put

    Code:
    	protected final void startfollow() 
    	{
    Now under that add

    Code:
    		allDone = false;
    		//debug("startfollow");
    Then under that add

    Code:
    		if(diditonce == false)
    		{
    Then under that add

    Code:
    			//makethread();
    			diditonce = true;
    		}
    	}
    Yay time to make another void guess what it is?
    Wrong its to stop the follow.
    So add this under what we just did...

    Code:
    	protected final void stopfollow()
    	{
    Now under this add.....

    Code:
    		allDone = true;
    		//debug("stopfollow");
    	}
    Alright now its time to change something else.

    Search this in the Mudclient class

    Code:
    if (currentMenuID == 2820)
    You should see this

    Code:
            if (currentMenuID == 2820)
            {
                super.streamClass.createPacket(68);
                super.streamClass.add2ByteInt(actionType);
                super.streamClass.formatPacket();
                return;
            }
    Change that to..

    Code:
            if (currentMenuID == 2820)
            {
                // id = actionType
    			followid = actionType;
    			startfollow();
                return;
            }
    Now search

    Code:
    if (currentMenuID == 920)
    You should see

    Code:
            if (currentMenuID == 920)
            {
                method112(sectionX, sectionY, actionX, actionY, false);
                if (actionPictureType == -24)
                    actionPictureType = 24;
    
                debug("(" + (actionX + areaX) + "," + (actionY + areaY) + ")");
                copiedObjectType = -1;
    
                return;
            }
    Change that to..

    Code:
     if (currentMenuID == 920)
            {
                method112(sectionX, sectionY, actionX, actionY, false);
    			if(sentbyfollow == false)
    			{
    	            if (actionPictureType == -24)
    				{
    	                actionPictureType = 24;
    				}
    
    	            debug("(" + (actionX + areaX) + "," + (actionY + areaY) + ")");
    				
    				stopfollow();
    				followid = 0;
    			} else {
    	                actionPictureType = 0;
    			}
    			sentbyfollow = false;
                copiedObjectType = -1;
    
                return;
            }
    Now search this

    Code:
     private final void drawRightClickMenu() {
    Right ABOVE that you should see.

    Code:
            gameGraphics.drawImage(aGraphics936, 0, 0);
        }
    Right under that add...

    Code:
    if (allDone == false)
    		{
    			followtimer++;
    			if (followtimer >= 50) 
    			{
    				if(followid != 0)
    				{
    					try {
    						int coords[] = GetPlayerById(followid);					
    							sentbyfollow = true;
    							int asq = (int)Math.pow(Math.abs(coords[1]-GetX()), 2);
    							int bsq = (int)Math.pow(Math.abs(coords[2]-GetY()), 2);
    							int distance = (int)Math.sqrt(asq+bsq);
    							if(distance < 20)
    							{
    									if(distance > 1)
    									{
    										WalkTo(playerDestX(coords[0]), playerDestY(coords[0]));
    									} else
    									{
    									WalkTo(/*playerDestX(coords[0])*/coords[1], /*playerDestY(coords[0])*/coords[2]);
    									}
    							} else 
    							{
    								stopfollow();
    								followid = 0;
    							}
    					} catch(Exception e) { }
    				} else 
    				{
    					stopfollow();
    					followid = 0;
    				}
    				//debug("alldone = false");
    				followtimer = 0;
    			}
    		}
        }
    Now search

    Code:
    private int tradeMyItemsCount[];
    Right under that add

    Code:
    	private int followid = 0;
    	private int followtimer = 0;
    Then there you NOW have following ADDED! Oh em gee was that so hard??

    And now Ill be releasing some more stuff later Im just to lazy to put it up at this moment of time.

    So yea
    Thanks,
    Anc13nts.
     

  2. #2  
    jjman112
    Guest
    yo dude following does not work when i try to add it and yes i used all your steps
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •