Thread: Firescape v2 Droping Items Fix

Results 1 to 2 of 2
  1. #1 Firescape v2 Droping Items Fix 
    Registered Member
    Join Date
    Dec 2007
    Posts
    41
    Thanks given
    0
    Thanks received
    0
    Rep Power
    16
    I noticed firescape v2 does not drop inventory items onto the world ground, So I made a fix and thought id share it

    Tutorial Rated: Easy, just copy and past.
    Base Firescape: v2.
    Files used: 2
    File Names: InvActionHandler.java , DropEvent.java

    Open your InvActionHandler.java

    find code

    Code:
    if(p.getID() == 147) // Drop
    replace the entire if statment with this 1, This adds the item on to the world ground.

    Code:
    		if(p.getID() == 147) // Drop 
    		{
    			
    			int idx = (int)p.readShort();
    			if(idx < 0 || idx >= player.getInventory().size()) 
    			{
    				player.setSuspicious(true);
    				return;
    			}
    
    			if(System.currentTimeMillis() - player.getLastDrop() <= 300)
    				return;
    				
    			InvItem item = player.getInventory().get(idx);
    			//System.out.println("Drop Slot: "+idx);
    			//System.out.println("Drop Item: "+item.getId());
    			world.getDelayedEventHandler().add(new DropEvent(player, idx));
    		}
    Save it.

    Then open DropEvent.java
    In
    Code:
    public void run() {
    look for the code:

    Code:
    if(owner.isBusy()
    Add into the line:
    Code:
    || !owner.getInventory().contains(item)
    It should look something like this after:

    Code:
    if(owner.isBusy() || !owner.getInventory().contains(item)) {
    					owner.resetPath();
    					super.running = false;
    					return;
    				}
    Then your all done. Yay compile and run it.
     

  2. #2  
    Banned

    Join Date
    May 2008
    Posts
    2,583
    Thanks given
    99
    Thanks received
    22
    Rep Power
    0
    Nice job
    repped
     


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
  •