Thread: Unfinished 667 project [Clean]

Results 1 to 4 of 4
  1. #1 Unfinished 667 project [Clean] 
    Registered Member _Reece's Avatar
    Join Date
    Oct 2014
    Posts
    829
    Thanks given
    176
    Thanks received
    147
    Rep Power
    31
    Decent 667 src that could be useful to a number of people looking to build from a fairly blank src.




    Download:
    https://mega.nz/#!dIVWRKKS!dMjuHy973...DxBiA5RcGJaw74

    Update list:
    Code:
    Repackaged src
    Cleaned src for useless/non-needed basic content (stripped down to basics)
    Implemented Mige's Pathfinding (No longer uses Client based calculations)
    Updated Packet handling
    Updated Object/NPC interactions
    Began utilizing Guava's Stopwatch functions (Vengeance timers etc)
    Rewrote login GameDecoder
    Rewrote basic Combat functionalites & Repackaged each Combat style to there respected Classes (Melee, Ranged, Magic)
    Renamed a large variety of classes
    Implemented ISAAC
    Wrote basic Object Removal


    Credits:
    Matrix Team
    Trey2k
    _Reece
    Jagex
    Reply With Quote  
     

  2. Thankful users:


  3. #2  
    Registered Member
    Tyluur's Avatar
    Join Date
    Jun 2010
    Age
    26
    Posts
    5,103
    Thanks given
    1,819
    Thanks received
    1,767
    Rep Power
    2438


    interesting naming to say the least.

    Code:
    public abstract class SpellHandler {
    
    	public static enum SpellType {
    		LUNARS, ANCIENT, MODERNS;
    	}
    
    
    	private static final HashMap<Integer, SpellHandler> spell = new HashMap<Integer, SpellHandler>();
    
    	static {
    		spell.put(23, new IceBarrage());
    		spell.put(37, new Vengeance());
    		spell.put(25, new WindStrike());
    		spell.put(28, new WaterStrike());
    		spell.put(36, new Bind());
    	}
    
    	public static boolean handle(Player player, int spellId) {
    		SpellHandler castedSpell = spell.get(spellId);
    
    		if (castedSpell == null) {
    			player.getPackets().sendGameMessage("Err: 6913. Oh dear! you've found a spell that is not handled!");
    			return false;
    		}
    		
    
    		if (castedSpell.otherRequirements(player))
    			return false;
    
    		if (castedSpell.requiredLevel() > player.getSkills().getLevel(Skills.MAGIC)) {
    			player.getPackets().sendGameMessage(
    					"You need a magic level of " + castedSpell.requiredLevel() + " to cast this spell.");
    			return true;
    		}
    
    		player.getCombatDefinitions().setSpell(spellId);
    
    		if (castedSpell.isDamageSpell()) {
    
    			if (castedSpell.getCastAnimation() != null)
    				player.setNextAnimation(castedSpell.getCastAnimation());
    			if (castedSpell.getCastGfx() != null)
    				player.setNextGraphics(castedSpell.getCastGfx());
    
    			player.getCombat().getCombatHit().hitTarget(player, 1, 1, CombatStyle.MAGIC);
    		} else {
    			castedSpell.handleSpell(player);
    		}
    		return true;
    	}
    
    	
    	
    	
    	protected CombatHit combat = new CombatHit();
    
    	public abstract int getBaseXP();
    
    	public abstract Animation getCastAnimation();
    
    	public abstract Graphics getCastGfx();
    
    	public abstract int getCastingSound();
    
    	public abstract Graphics getFrozenHitGfx();
    
    	public abstract Graphics getHitGfx();
    
    	public abstract int getHitSound();
    
    	public abstract int getSpellId();
    
    	public abstract SpellType getSpellType();
    
    	public abstract void handleSpell(Player player);
    
    	public abstract boolean isDamageSpell();
    
    	public abstract boolean otherRequirements(Player player);
    
    	public abstract int requiredLevel();
    
    	//public abstract int[] runesRequired();
    	
    	/*
    	 * ICE_BLITZ(SpellType.ANCIENT, 82, 21, 1978, 366, 15, 46, -1, new int[] {
    	 * 367, 367 }, new int[] {171, 169});
    	 */
    
    }
    the idea behind this is good but the design could be improved. leave the data to be stored in a separate class. the 'SpellHandler' should only be for polymorphism, not actual logic.
    also to shorten code and make this easier, ex:

    Code:
    /**
     * @author Tyluur <[email protected]>
     * @since 6/23/2017
     */
    public interface MagicSpellEvent<T extends MagicSpellContext> extends CombatRegistryEvent {
    	
    	/**
    	 * The id of the spell
    	 */
    	int spellId();
    	
    	/**
    	 * The delay on the spell
    	 */
    	int delay();
    	
    	/**
    	 * The animation id for the spell
    	 */
    	int animationId();
    	
    	/**
    	 * The id of the graphics applied when the hit lands
    	 */
    	int hitGfx();
    	
    	/**
    	 * The base damage of the spell
    	 */
    	int maxHit();
    	
    	/**
    	 * The base experience of the spell
    	 */
    	double exp();
    	
    	/**
    	 * The book the spell is on
    	 */
    	MagicBook book();
    	
    	/**
    	 * Casts the magic spell
    	 *
    	 * @param player
    	 * 		The player
    	 * @param context
    	 * 		The context
    	 */
    	void cast(Player player, T context);
    	
    	/**
    	 * The default height of the hit land gfx
    	 */
    	default int gfxHeight() {
    		return 96;
    	}
    	
    }
    Quote Originally Posted by blakeman8192 View Post
    Keep trying. Quitting is the only true failure.
    Spoiler for skrrrrr:

    Attached image
    Reply With Quote  
     

  4. #3  
    Registered Member

    Join Date
    Feb 2011
    Posts
    1,143
    Thanks given
    545
    Thanks received
    110
    Rep Power
    87
    Thanks for the share.

    Reply With Quote  
     

  5. #4  
    Registered Member
    Join Date
    Jan 2013
    Posts
    214
    Thanks given
    55
    Thanks received
    7
    Rep Power
    12
    What client did you use?
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

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


User Tag List

Similar Threads

  1. unfinished 667 project release
    By 24th in forum Downloads
    Replies: 9
    Last Post: 06-20-2017, 03:10 PM
  2. Tanoth 667 Project (Almost clean)
    By Smirnoff in forum Projects
    Replies: 94
    Last Post: 01-13-2017, 06:12 AM
  3. Replies: 5
    Last Post: 07-30-2013, 07:53 AM
  4. Unfinished Runesource Project
    By Myuria in forum Downloads
    Replies: 15
    Last Post: 04-28-2013, 08:50 AM
  5. 667 Need clean packedDrops.d
    By USKO in forum Help
    Replies: 0
    Last Post: 07-03-2012, 09:55 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •