Thread: [614 loading 634] Dementhium by 'Mystic Flow, `Discardedx2, and Steve

Page 9 of 44 FirstFirst ... 789101119 ... LastLast
Results 81 to 90 of 435
  1. #81  
    :doge:

    Join Date
    Jan 2009
    Posts
    3,759
    Thanks given
    221
    Thanks received
    816
    Rep Power
    2113
    Proof:
    Code:
    package org.dementhium.model.player;
    
    import java.nio.ByteBuffer;
    import java.util.LinkedList;
    import java.util.Queue;
    
    import org.dementhium.model.Animation;
    import org.dementhium.model.Entity;
    import org.dementhium.model.ForceText;
    import org.dementhium.model.Graphics;
    import org.dementhium.model.Heal;
    import org.dementhium.model.Hits;
    import org.dementhium.model.Item;
    import org.dementhium.model.LocalEntityList;
    import org.dementhium.model.Position;
    import org.dementhium.model.Hits.Hit;
    import org.dementhium.model.Hits.HitType;
    import org.dementhium.model.combat.Combat.FightType;
    import org.dementhium.model.npc.Npc;
    import org.dementhium.net.Frames;
    import org.dementhium.net.codec.ConnectionHandler;
    import org.dementhium.skills.cooking.Cooking;
    import org.dementhium.skills.fletching.FletchingManager;
    import org.dementhium.skills.prayer.Prayer;
    import org.dementhium.skills.woodcutting.WoodCutting;
    import org.dementhium.util.BufferUtils;
    import org.jboss.netty.buffer.ChannelBuffer;
    /**
     * 
     * @author Dragonkk
     * @author 'Mystic Flow
     * @author `Discardedx2
     * @author Khaled
     */
    public final class Player extends Entity {
    
    	private String Username;
    	private String DisplayName;
    	private String Password;
    	private byte rights = 2;
    	private boolean isLoggedIn;
    	public boolean autoRetaliate;
    	private int specialAmount = 100;
    
    	private final Appearance appearance = new Appearance();
    	private final Inventory inventory = new Inventory(this);
    	private final Equipment equipment = new Equipment(this);
    	private final Skills skills = new Skills(this);
    	private final Banking bank = new Banking(this);
    	private final Bonuses bonuses = new Bonuses(this);
    
    	private ConnectionHandler connection;
    	private LocalEntityList localEntities;
    
    	private final Frames frames = new Frames(this);
    	private final Mask mask = new Mask(this);
    	private final Gpi gpi = new Gpi(this);
    	private final Gni gni = new Gni(this);
    	private final MusicManager musicmanager = new MusicManager(this);
    	private final InterfaceManager intermanager = new InterfaceManager(this);
    	private final HintIconManager hinticonmanager = new HintIconManager(this);
    
    	private final Queue<Hit> queuedHits = new LinkedList<Hit>();
    	private final Hits hits = new Hits();
    
    	private boolean isOnline;
    	private boolean inClient;
    
    	private WoodCutting woodCutting;
    	private FletchingManager fletching;
    	private Cooking cooking;
    	private final Prayer prayer = new Prayer(this);
    	private int attackStyle;
    
    	public Player(String Username, String Password) {
    		this.setUsername(Username);
    		this.setDisplayName(Username);
    		this.setPassword(Password);
    	}
    
    	public void LoadPlayer(ConnectionHandler connection) {
    		this.setConnection(connection);
    		this.EntityLoad();
    		frames.loginResponce();
    		frames.sendLoginInterfaces();
    		frames.sendLoginConfigurations();
    		frames.sendOtherLoginPackets();
    		setOnline(true);
    		skills.startBoostingSkill();
    		if (isDead())
    			skills.sendDead();
    	}
    
    	public Frames getFrames() {
    		return frames;
    	}
    
    	public void setConnection(ConnectionHandler connection) {
    		this.connection = connection;
    	}
    
    	public ConnectionHandler getConnection() {
    		return connection;
    	}
    
    	public void setUsername(String username) {
    		Username = username;
    	}
    
    	public String getUsername() {
    		return Username;
    	}
    
    	public void setDisplayName(String displayName) {
    		DisplayName = displayName;
    	}
    
    	public String getDisplayName() {
    		if (DisplayName == null) {
    			return Username;
    		}
    		return DisplayName;
    	}
    
    	public void setPassword(String password) {
    		Password = password;
    	}
    
    	public String getPassword() {
    		return Password;
    	}
    
    	public void load(ByteBuffer buffer) {
    		setLocation(Position.create(buffer.getShort(), buffer.getShort(),
    				buffer.get()));
    		for (int i = 0; i < Skills.SKILL_COUNT; i++) {
    			skills.setLevelAndXP(i, buffer.get(), buffer.getInt());
    		}
    		for (int i = 0; i < Inventory.SIZE; i++) {
    			int id = buffer.getShort();
    			if (id == -1) {
    				continue;
    			}
    			inventory.getContainer().set(i,
    					new Item(id, BufferUtils.readItemSmart(buffer)));
    		}
    		for (int i = 0; i < Equipment.SIZE; i++) {
    			int id = buffer.getShort();
    			if (id == -1) {
    				continue;
    			}
    			equipment.getEquipment().set(i,
    					new Item(id, BufferUtils.readItemSmart(buffer)));
    		}
    		for (int i = 0; i < Banking.SIZE; i++) {
    			int id = buffer.getShort();
    			if (id == -1) {
    				continue;
    			}
    			bank.getContainer().set(i,
    					new Item(id, BufferUtils.readItemSmart(buffer)));
    		}
    	}
    
    	public void save(ChannelBuffer buffer) { // we use a dynamic buffer
    		buffer.writeShort((short) getLocation().getX());
    		buffer.writeShort((short) getLocation().getY());
    		buffer.writeByte((byte) getLocation().getZ());
    		for (int i = 0; i < Skills.SKILL_COUNT; i++) {
    			buffer.writeByte((byte) skills.getLevel(i));
    			buffer.writeInt((int) skills.getXp(i)); // channel buffer dun have
    			// double
    		}
    		for (int i = 0; i < Inventory.SIZE; i++) {
    			Item item = inventory.get(i);
    			if (item == null) {
    				buffer.writeShort((short) -1);
    			} else {
    				buffer.writeShort(item.getId());
    				BufferUtils.writeItemSmart(item.getAmount(), buffer);
    			}
    		}
    		for (int i = 0; i < Equipment.SIZE; i++) {
    			Item item = equipment.get(i);
    			if (item == null) {
    				buffer.writeShort((short) -1);
    			} else {
    				buffer.writeShort(item.getId());
    				BufferUtils.writeItemSmart(item.getAmount(), buffer);
    			}
    		}
    		for (int i = 0; i < Banking.SIZE; i++) {
    			Item item = bank.getContainer().get(i);
    			if (item == null) {
    				buffer.writeShort((short) -1);
    			} else {
    				buffer.writeShort(item.getId());
    				BufferUtils.writeItemSmart(item.getAmount(), buffer);
    			}
    		}
    	}
    	
    	public void setSpecialAmount(int amt) {
    		this.specialAmount = amt;
    		getFrames().sendConfig2(300, specialAmount);
    	}
    
    	public void setOnline(boolean isOnline) {
    		this.isOnline = isOnline;
    	}
    
    	public boolean isOnline() {
    		return isOnline;
    	}
    
    	public void setRights(byte rights) {
    		this.rights = rights;
    	}
    
    	public byte getRights() {
    		return rights;
    	}
    
    	public void setNpcListSize(int npcListSize) {
    		localEntities.npcListSize = npcListSize;
    	}
    
    	public int getNpcListSize() {
    		return localEntities.npcListSize;
    	}
    
    	public void setNpcList(Npc[] npcList) {
    		localEntities.npcList = npcList;
    	}
    
    	public Npc[] getNpcList() {
    		return localEntities.npcList;
    	}
    
    	public void setNpcsInList(byte[] npcsInList) {
    		localEntities.npcsInList = npcsInList;
    	}
    
    	public byte[] getNpcsInList() {
    		return localEntities.npcsInList;
    	}
    
    	@Override
    	public void animate(int id) {
    		this.getMask().setLastAnimation(new Animation((short) id, (short) 0));
    		this.getMask().setAnimationUpdate(true);
    
    	}
    
    	@Override
    	public void animate(int id, int delay) {
    		this.getMask().setLastAnimation(
    				new Animation((short) id, (short) delay));
    		this.getMask().setAnimationUpdate(true);
    
    	}
    
    	@Override
        public void graphics(int id) {
            this.getMask().setLastGraphics(new Graphics((short)id, (short)0, (short)0));
            this.getMask().setGraphicUpdate(true);
        }
        
        public void graphics2(int id) {
            this.getMask().setLastGraphics2(new Graphics((short)id, (short)0, (short)0));
            this.getMask().setGraphic2Update(true);
        }
    
        public void graphics2(int id, int delay) {
            this.getMask().setLastGraphics2(new Graphics((short)id, (short)delay, (short)0));
            this.getMask().setGraphic2Update(true);
        }
        
        public void graphics2(int id, int delay, int height) {
            this.getMask().setLastGraphics2(new Graphics((short)id, (short)delay, (short)height));
            this.getMask().setGraphic2Update(true);
        }
    
        @Override
        public void graphics(int id, int delay, int height) {
            this.getMask().setLastGraphics(new Graphics((short)id, (short)delay, (short)height));
            this.getMask().setGraphicUpdate(true);
        }
        
        @Override
        public void graphics(int id, int delay) {
            this.getMask().setLastGraphics(new Graphics((short)id, (short)delay, (short)0));
            this.getMask().setGraphicUpdate(true);
        }
    
    	@Override
    	public void heal(int amount) {
    		getMask().setLastHeal(new Heal((short) amount, (byte) 0, (byte) 0));
    		getMask().setHealUpdate(true);
    	}
    
    	public void heal(int healdelay, int bardelay, int healspeed) {
    		getMask().setLastHeal(
    				new Heal((short) healdelay, (byte) bardelay, (byte) healspeed));
    		getMask().setHealUpdate(true);
    
    	}
    
    	public void processQueuedHits() {
    		if (!this.getMask().isHitUpdate()) {
    			if (queuedHits.size() > 0) {
    				Hit h = queuedHits.poll();
    				this.hit(h.getDamage(), h.getType());
    			}
    		}
    		if (!this.getMask().isHit2Update()) {
    			if (queuedHits.size() > 0) {
    				Hit h = queuedHits.poll();
    				this.hit(h.getDamage(), h.getType());
    			}
    		}
    	}
    
    	public void hit(int damage, Hits.HitType type) {
    		if (this.skills.getHitPoints() <= 0) {
    			return;
    		}
    		if (!this.getMask().isHitUpdate()) {
    			this.hits.setHit1(new Hit(damage, type));
    			this.getMask().setHitUpdate(true);
    			this.getSkills().hit(damage);
    		} else if (!this.getMask().isHit2Update()) {
    			this.hits.setHit2(new Hit(damage, type));
    			this.getMask().setHit2Update(true);
    			this.getSkills().hit(damage);
    		} else {
    			queuedHits.add(new Hit(damage, type));
    		}
    	}
    
    	@Override
    	public void hit(int damage) {
    		if (damage > this.skills.getHitPoints())
    			damage = this.skills.getHitPoints();
    		if (damage == 0) {
    			hit(damage, Hits.HitType.NO_DAMAGE);
    		} else if (damage >= 100) {
    			hit(damage, Hits.HitType.NORMAL_BIG_DAMAGE);
    		} else {
    			hit(damage, Hits.HitType.NORMAL_DAMAGE);
    		}
    	}
    
    	public void hitType(int damage, HitType hitType) {
    		if (damage > this.skills.getHitPoints())
    			damage = this.skills.getHitPoints();
    		hit(damage, hitType);
    	}
    
    	@Override
    	public void resetTurnTo() {
    		this.mask.setTurnToIndex(-1);
    		this.mask.setTurnToReset(true);
    		this.mask.setTurnToUpdate(true);
    	}
    
    	@Override
    	public void turnTemporarilyTo(Entity entity) {
    		this.mask.setTurnToIndex(entity.getClientIndex());
    		this.mask.setTurnToReset(true);
    		this.mask.setTurnToUpdate(true);
    	}
    
    	public void turnTemporarilyTo(Position location) {
    		this.mask.setTurnToLocation(location);
    		this.mask.setTurnToUpdate1(true);
    	}
    
    	@Override
    	public void turnTo(Entity entity) {
    		this.mask.setTurnToIndex(entity.getClientIndex());
    		this.mask.setTurnToReset(false);
    		this.mask.setTurnToUpdate(true);
    	}
    
    	public void forceText(String text) {
    		this.getMask().setLastForceText(new ForceText(text));
    		this.getMask().setForceTextUpdate(true);
    	}
    
    	public Mask getMask() {
    		return mask;
    	}
    
    	public void setLocalEntities(LocalEntityList localEntities) {
    		this.localEntities = localEntities;
    	}
    
    	public LocalEntityList getLocalEntities() {
    		return localEntities;
    	}
    
    	public Appearance getAppearence() {
    		return appearance;
    	}
    
    	public Inventory getInventory() {
    		return inventory;
    	}
    
    	public Equipment getEquipment() {
    		return equipment;
    	}
    
    	public Skills getSkills() {
    		return skills;
    	}
    
    	public InterfaceManager getIntermanager() {
    		return intermanager;
    	}
    
    	public HintIconManager getHinticonmanager() {
    		return hinticonmanager;
    	}
    
    	public void setInClient(boolean inClient) {
    		this.inClient = inClient;
    	}
    
    	public boolean isInClient() {
    		return inClient;
    	}
    
    	public Prayer getPrayer() {
    		return prayer;
    	}
    
    	public Queue<Hit> getQueuedHits() {
    		return queuedHits;
    	}
    
    	public Hits getHits() {
    		return hits;
    	}
    
    	public Gpi getGpi() {
    		return gpi;
    	}
    
    	public MusicManager getMusicmanager() {
    		return musicmanager;
    	}
    
    	public Banking getBank() {
    		return bank;
    	}
    
    	public boolean isLoggedIn() {
    		return isLoggedIn;
    	}
    
    	public void setLoggedIn(boolean b) {
    		this.isLoggedIn = b;
    	}
    
    	public WoodCutting getWoodCutting() {
    		return woodCutting;
    	}
    
    	public Gni getGni() {
    		return gni;
    	}
    
    	@Override
    	public void graphics(short gfx, int i, int j) {
    
    	}
    
    	public int getAttackStyle() {
    		return attackStyle;
    	}
    
    	public void setAttackStyle(int maxSize) {
    		this.attackStyle = maxSize;
    	}
    
    	public FletchingManager getFletching() {
    		return fletching;
    	}
    
    	public Cooking getCooking() {
    		return cooking;
    	}
    
    	public void resetSkills() {
    		cooking.reset();
    		fletching.reset();
    	}
    
    	public boolean itemName(String string) {
    		if(equipment.get(Equipment.SLOT_WEAPON) == null) {
    			return false;
    		}
    		return this.getEquipment().get(Equipment.SLOT_WEAPON).getDefinition().name.toLowerCase().contains(string);
    	}
    
    	@Override
    	public FightType getFightType() {
    		if (equipment.usingRanged()) {
    			return FightType.RANGE;
    		}
    		return FightType.MELEE;
    	}
    
    	@Override
    	public int getAttackAnimation() {
    		if (itemName("whip"))
    			return 1658;
    		else if (itemName("claws"))
    			return 393;
    		else if (itemName("pickaxe"))
    			return attackStyle == 2 ? 402 : 401;
    		else if (itemName("Dharok"))
    			return attackStyle == 2 ? 2067 : 2066;
    		else if (itemName("Verac"))
    			return 2062;
    		else if (itemName("Granite maul"))
    			return 1665;
    		else if (itemName("Guthan"))
    			return attackStyle == 2 ? 2081 : 2080;
    		else if (itemName("godsword") || itemName("2h sword"))
    			return attackStyle == 2 ? 7048 : 7041;
    		else if (itemName("Keris") || itemName("dagger"))
    			return attackStyle == 2 ? 401 : 402;
    		else if (itemName("Karil"))
    			return 2075;
    		else if (!itemName("Karil") && itemName("crossbow"))
    			return 4230;
    		else if (itemName("dart"))
    			return 582;
    		else if (itemName("knife"))
    			return 806;
    		else if (itemName("bow"))
    			return 426;
    		return attackStyle == 2 ? 422 : 423;
    	}
    
    	@Override
    	public int getAttackDelay() {
    		return 3;
    	}
    
    	@Override
    	public int getDefenceAnimation() {
    		return 1156;
    	}
    
    	public Bonuses getBonuses() {
    		return bonuses;
    	}
    
    }
     

  2. #82  
    Hi.

    'Mystic Flow's Avatar
    Join Date
    Nov 2007
    Posts
    7,141
    Thanks given
    256
    Thanks received
    1,247
    Rep Power
    3636
    Well, we don't have vb integration anymore since we took down the NoszScape forums :coolface:

    [Only registered and activated users can see links. ]

     

  3. Thankful user:


  4. #83  
    Chemist

    Advocatus's Avatar
    Join Date
    Dec 2009
    Age
    28
    Posts
    2,549
    Thanks given
    192
    Thanks received
    761
    Discord
    View profile
    Rep Power
    1332
    Goodluck with this, however I find it ironic at how this project topic has progressed. I read the thread, noticed that it was a scratch project, so I thought I might check it out. Turns out that it looks like none of you guys know what you are doing if you had to start with dragonkk's source. I don't care if you cleaned it or what, I just find it ironic that you market something as scratch while it really isn't. Once again, I do not mean to flame, or demean you, I just merely want to state that as someone who doesn't frequent this section much, it appears that this project will not go far at all. It just seems that you are all caught up in some egotistical project that you market as scratch just to support your own vanity.
    Quote Originally Posted by blakeman8192 View Post
    Quitting is the only true failure.
     

  5. #84  
    Registered Member

    Join Date
    Oct 2008
    Age
    26
    Posts
    948
    Thanks given
    43
    Thanks received
    52
    Rep Power
    98
    Hope this one doesn't get dumped after a while like the last one.
     

  6. #85  
    :doge:

    Join Date
    Jan 2009
    Posts
    3,759
    Thanks given
    221
    Thanks received
    816
    Rep Power
    2113


    basic special attack system..
     

  7. #86  
    Community Veteran



    Join Date
    Jan 2008
    Posts
    3,448
    Thanks given
    46
    Thanks received
    973
    Rep Power
    4723
    lol why instance each skill class per a player static to hard for you lot.?

     

  8. #87  
    Hi.

    'Mystic Flow's Avatar
    Join Date
    Nov 2007
    Posts
    7,141
    Thanks given
    256
    Thanks received
    1,247
    Rep Power
    3636
    Quote Originally Posted by Flamable View Post
    lol why instance each skill class per a player static to hard for you lot.?
    We were planning on using attributes to store values, e.g, Fletching keeps track of your index information and how the information is set up, Cooking would keep track of the same as well. Just because we don't use static doesn't mean we're idiots .

    [Only registered and activated users can see links. ]

     

  9. #88 Nice 
    Registered Member Zeros's Avatar
    Join Date
    Nov 2010
    Posts
    16
    Thanks given
    0
    Thanks received
    1
    Rep Power
    3
    I am a leet programmer,I can code just about anything on a 614. If you need more programmers just PM Me on Rune-Server or add my MSN: [Only registered and activated users can see links. ]
    http://www.rune-server.ee/nophp/signaturepics/sigpic146355_1.gif
     

  10. #89  
    Registered Member Zeros's Avatar
    Join Date
    Nov 2010
    Posts
    16
    Thanks given
    0
    Thanks received
    1
    Rep Power
    3
    Want to Test My Skills?
    http://www.rune-server.ee/nophp/signaturepics/sigpic146355_1.gif
     

  11. #90  
    Banned

    Join Date
    Sep 2009
    Posts
    1,878
    Thanks given
    411
    Thanks received
    1,637
    Rep Power
    0
    Quote Originally Posted by Advocatus Diaboli View Post
    Goodluck with this, however I find it ironic at how this project topic has progressed. I read the thread, noticed that it was a scratch project, so I thought I might check it out. Turns out that it looks like none of you guys know what you are doing if you had to start with dragonkk's source. I don't care if you cleaned it or what, I just find it ironic that you market something as scratch while it really isn't. Once again, I do not mean to flame, or demean you, I just merely want to state that as someone who doesn't frequent this section much, it appears that this project will not go far at all. It just seems that you are all caught up in some egotistical project that you market as scratch just to support your own vanity.
    We did it cus we cba to do gpi. We rewrote nearly all of it rather than keeping the same shit so we do know what we are doing...
     

Page 9 of 44 FirstFirst ... 789101119 ... LastLast

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. Replies: 49
    Last Post: 01-04-2011, 01:49 AM
  2. [582] Parenthium by 'Mystic Flow and `Discardedx2
    By Discardedx2 in forum Projects
    Replies: 264
    Last Post: 09-05-2010, 11:48 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
  •