Thread: Dungeoneering Party Interface (Fully working)

Page 1 of 2 12 LastLast
Results 1 to 10 of 19
  1. #1 Dungeoneering Party Interface (Fully working) 
    Banned

    Join Date
    Jul 2011
    Posts
    691
    Thanks given
    163
    Thanks received
    161
    Rep Power
    0
    Well, I just grabbed the sprites and methods for the dungeoneering party interface and my co-developer Jason
    was already starting to write up the system, so I made the interface and implemented it with the system Jason made.

    Spoiler for Pics:





    a lot harder than it looks
    Reply With Quote  
     

  2. Thankful user:


  3. #2  
    Registered Member
    Join Date
    Apr 2013
    Posts
    88
    Thanks given
    3
    Thanks received
    6
    Rep Power
    20
    Looks nice, goodjob.
    Reply With Quote  
     

  4. #3  
    Donator

    Jason's Avatar
    Join Date
    Aug 2009
    Posts
    6,092
    Thanks given
    2,402
    Thanks received
    2,823
    Rep Power
    4550
    Great progress made on the interface Mark. The team-based system was designed in a such a polymorphic matter that I may release the base basics of the Minigame/Skill because i'm sure many users could get some use out of it and create some exciting minigames.
    Reply With Quote  
     

  5. #4  
    Quality over quantity


    Join Date
    Dec 2011
    Age
    28
    Posts
    1,318
    Thanks given
    74
    Thanks received
    157
    Rep Power
    110
    This looks awesome. Great job!
    Reply With Quote  
     

  6. #5  
    Banned

    Join Date
    Mar 2013
    Posts
    3,036
    Thanks given
    82
    Thanks received
    375
    Rep Power
    0
    Looks amazing Mark.
    Reply With Quote  
     

  7. #6  
    Registered Member
    Join Date
    Dec 2012
    Posts
    134
    Thanks given
    10
    Thanks received
    6
    Rep Power
    20
    This looks really good, Nice Job!
    Attached image
    Reply With Quote  
     

  8. #7  
    Banned

    Join Date
    Jul 2011
    Posts
    691
    Thanks given
    163
    Thanks received
    161
    Rep Power
    0
    Quote Originally Posted by Visuall View Post
    This looks awesome. Great job!
    Quote Originally Posted by GoNao View Post
    Looks amazing Mark.
    Quote Originally Posted by Dokan View Post
    This looks really good, Nice Job!
    Thank you guys very much. And like Jason said, we will most likely release our team system so you guys don't rattle your brains like i did.
    Reply With Quote  
     

  9. #8  
    true

    DerekH's Avatar
    Join Date
    Dec 2011
    Age
    19
    Posts
    1,183
    Thanks given
    590
    Thanks received
    261
    Rep Power
    164
    If I may ask, you basically based it around clan chat, am I correct?
    Reply With Quote  
     

  10. #9  
    Banned

    Join Date
    Jul 2011
    Posts
    691
    Thanks given
    163
    Thanks received
    161
    Rep Power
    0
    Quote Originally Posted by derekh View Post
    If I may ask, you basically based it around clan chat, am I correct?
    Meaning? If you are asking if I utilized the work of someone else to accomplish this, I wrote it from scratch myself. Just got the interfaces and RSInterface methods from a tut released.

    Spoiler for DungeoneeringTeam Class:

    Code:
    package server.innovation.minigames.dungeoneering;
    
    import server.model.players.*;
    
    /**
    * @author Mark (http://www.rune-server.org/members/jesse+pinkman/)
    */
    
    public class DungeoneeringTeam {
    	
    	private Client c;
    	private final int MAX_MEMBERS = 4,MAX_REQUEST = 5;
    	private Client[] members = new Client[MAX_MEMBERS];
    	private Client[] requested = new Client[MAX_REQUEST];
    
    	public DungeoneeringTeam(Client c) {
    		this.c = c;
    		c.sendMessage("<col=250>You have successfuly started a Dungeoneering Party!");
    		c.inDungTeam = true;
    	}
    	
    	public Client getLeader() {
    		return this.c;
    	}
    	
    	public Client[] getMembers() {
    		return this.members;
    	}
    	
    	public int getMemberCount() {
    		return this.members.length;
    	}
    	
    	public Client[] updateMembers() {
    		int count = 0;
    		Client[] temp = new Client[MAX_MEMBERS];
    		for(int i = 0;i < members.length;i++){
    			if(members[i] != null){
    				temp[count] = members[i];
    				count++;
    			}
    		}
    		return this.members = temp;
    	}
    	
    	public boolean isMember(Client o) {
    		for(int i = 0;i < members.length;i++){
    			if(members[i] != null){
    				if(members[i] == o){
    					return true;
    				}
    			}
    		}
    		return false;
    	}
    	
    	private boolean hasRequest(Client o) {
    		for(int i = 0;i < requested.length;i++){
    			if(requested[i] != null){
    				if(requested[i] == o){
    					return true;
    				}
    			}
    		}
    		//c.sendMessage("You have already invited this player to your party.");
    		return false;
    	}
    	
    	private boolean addMember(Client o) {
    		for(int i = 0;i < members.length;i++) {
    			if(members[i] == null) {
    				members[i] = o;
    				return true;
    			}
    		}
    		o.sendMessage("<col=250>That party is currently full.");
    		c.sendMessage("<col=250>Your party is currently full, "+o.playerName+" was not able to join.");
    		return false;
    	}
    	
    	private void removeMember(Client o) {
    		for(int i = 0;i < members.length;i++) {
    			if(members[i] != null) {
    				if(members[i] == o){
    					members[i].dungTeam = null;
    					members[i].inDungTeam = false;
    					members[i].sendMessage("<col=250>You have been removed the Party.");
    					members[i] = null;
    					updateMembers();
    					return;
    				}
    			}
    		}
    	}
    	
    	private void editRequests(Client o, boolean remove) {
    		if(!remove) {
    			for(int i = 0;i < requested.length;i++) {
    				if(requested[i] == null) {
    					requested[i] = o;
    					return;
    				}
    			}
    		} else {
    			for(int i = 0;i < requested.length;i++){
    				if(requested[i] != null)
    					if(requested[i] == o){
    						requested[i] = null;
    						break;
    				}
    			}
    		}
    	}
    	
    	public void request(Client o) {
    		try{
    			if(requested.length >= MAX_REQUEST) {
    				c.debug("Other Team: "+o.inDungTeam);
    				if(!o.inDungTeam) {
    					if(!hasRequest(o)){
    						if(!isMember(o)){
    							editRequests(o,false);
    							o.sendMessage("<col=250>You have been invited to join "+c.playerName+"'s Party.");
    							c.sendMessage("<col=250>You have sent an invitation to "+o.playerName+".");
    						} else {
    							c.sendMessage("<col=250>This player is already in your party.");
    						}
    					}
    				} else {
    					c.sendMessage("This player is already in a Dungeoneering Party.");
    				}
    			} else {
    				c.sendMessage("You can only request 5 people at a time. Requests expire after 30 seconds.");
    			}
    		} catch (Exception e) {
    			e.printStackTrace();
    		}
    	}
    	
    	public void join(Client o) {
    		try{
    			if(hasRequest(o)){
    				editRequests(o,true);
    				if(addMember(o)){
    					o.inDungTeam = true;
    					o.dungTeam = c.dungTeam;
    					o.dungTeam.joinParty(o);
    					c.sendMessage("<col=250>"+o.playerName+" has just joined your Dungeoneering Party!");
    					o.sendMessage("<col=250>You have joined "+c.playerName+"'s Dungeoneering Party!");
    					c.dungTeam.refreshParty();
    				}
    			} else {
    				o.sendMessage("<col=250>This player has not invited you to a Party yet.");
    			}
    		} catch (Exception e) {
    			e.printStackTrace();
    		}
    	}
    	
    	public void leaveTeam(Client o) {
    		if(isMember(o)){
    			removeMember(o);
    		}
    	}
    	
    	public void endTeam(){
    		c.sendMessage("<col=250>You have ended your party.");
    		c.inDungTeam = false;
    		for(int i = 0;i < members.length;i++){
    			if(members[i] != null) {
    				members[i].dungInterface.openInterface();
    				members[i].sendMessage("<col=250>Your party leader has ended the party.");
    				members[i].inDungTeam = false;
    				members[i].dungTeam = null;
    				members[i] = null;
    			}
    		}
    		c.dungTeam = null;
    		this.c = null;
    		members = null;
    		requested = null;
    	}
    
    }


    Spoiler for PlayerInterface (before they join or form a party):

    Code:
    package server.innovation.minigames.dungeoneering;
    
    import server.model.players.*;
    
    /**
    * @author Mark (http://www.rune-server.org/members/jesse+pinkman/)
    */
    
    public class PlayerInterface {
    	
    	private Client c;
    	private int killCount,deathCount,floor,complexity,currentProgress,previousProgress;
    	
    	public PlayerInterface(Client c) {
    		this.c = c;
    	}
    	
    	public void setKC(int kc){
    		this.killCount = kc;
    	}
    	
    	public void setDC(int dc){
    		this.deathCount = dc;
    	}
    	
    	public void setFloor(int floor){
    		this.floor = floor;
    	}
    	
    	public void setComplexity(int comp){
    		this.complexity = comp;
    	}
    	
    	public void setCurrentProgress(int progress){
    		this.currentProgress = progress;
    	}
    	
    	public void setPreviousProgress(int progress){
    		this.previousProgress = progress;
    	}
    	
    	public void resetProgress() {
    		this.currentProgress = 0;
    		this.previousProgress = 0;
    		refreshInterfaces();
    	}
    	
    	public void openInterface() {
    		refreshInterfaces();
    		c.setSidebarInterface(2, 27124);
    	}
    	
    	public void refreshInterfaces() {
    		PlayerAssistant p = c.getPA();
    		p.sendFrame126(c.playerName, 27148);
    		p.sendFrame126("@or2@Kills: "+killCount, 27146);
    		p.sendFrame126("@or2@Deaths: "+deathCount, 27147);
    		p.sendFrame126(""+floor, 27135);
    		p.sendFrame126(""+complexity, 27136);
    		p.sendFrame126(""+currentProgress, 27137);
    		p.sendFrame126(""+previousProgress, 27138);
    		p.sendFrame126(""+floor, 26240);
    		p.sendFrame126(""+complexity, 26241);
    		p.sendFrame126(""+currentProgress, 26242);
    		p.sendFrame126(""+previousProgress, 26243);
    	}
    	
    	public void handleButtons(int id) {
    		try{
    			if(id == 105249){
    				c.dungTeam = new DungeoneeringInterface(c);
    				c.dungTeam.openParty();
    			} else if (id == 102117) {
    				if (c.inDungTeam){
    					if(c.dungTeam.getLeader() == c)
    						c.dungTeam.getLeader().dungTeam.endParty();
    					else {
    						c.dungTeam.getLeader().dungTeam.exitParty(c);
    					}
    				}
    			} else if (id == 105252 || id == 102120) {
    				resetProgress();
    			}
    		} catch (Exception e) {
    			e.printStackTrace();
    		}
    	}
    }


    Spoiler for PartyInterface:

    Code:
    package server.innovation.minigames.dungeoneering;
    
    import java.util.ArrayList;
    
    import server.model.players.*;
    
    /**
    * @author Mark (http://www.rune-server.org/members/jesse+pinkman/)
    */
    
    public class DungeoneeringInterface extends DungeoneeringTeam {
    	
    	public static final int[] buttons = { 105249 , 102117 , 105252 , 102120 };
    	
    	private Client c;
    	
    	public DungeoneeringInterface (Client c) {
    		super(c);
    		this.c = c;
    	}
    	
    	public Client getLeader() {
    		return this.c;
    	}
    	
    	public void openParty() {
    		refreshParty();
    		c.setSidebarInterface(2, 26224);
    	}
    	
    	public void joinParty(Client o) {
    		refreshParty();
    		o.setSidebarInterface(2, 26224);
    	}
    	
    	public void exitParty(Client o) {
    		leaveTeam(o);
    		getLeader().dungTeam.refreshParty();
    		o.setSidebarInterface(2, 27124);
    	}
    	
    	public void endParty() {
    		endTeam();
    		refreshParty();
    		c.setSidebarInterface(2, 27124);
    	}
    	
    	public void resetInterface(Client c,Client[] members) {
    		int[] ids = {26235,26236,26237,26238,26239};
    		for(int i = 0;i < ids.length;i++){
    			if(c != null){
    				c.getPA().sendFrame126("", ids[i]);
    				c.debug("yessssir");
    			}
    			if(members != null){
    				for(int h = 0;h < members.length;h++){
    					if(members[h] != null)
    						members[h].getPA().sendFrame126("", ids[i]);
    				}
    			}
    		}
    	}
    	
    	public void refreshParty() {
    		try{
    			c.debug("Yup");
    			int[] ids = {26235,26236,26237,26238,26239};
    			int count;
    			resetInterface(getLeader(),null);
    			c.getPA().sendFrame126(getLeader().playerName, ids[0]);
    			Client[] members = getMembers();
    			resetInterface(null,members);
    			if(members != null){
    				for(int h = 0;h < members.length;h++){
    					try{
    						if(members[h] == null)
    							continue;
    						count = 1;
    						System.out.println("Refreshing party member: "+members[h].playerName);
    						members[h].getPA().sendFrame126(c.playerName, ids[0]);
    						for(int j = 0;j < members.length;j++){
    							if(members[j] == null)
    								continue;
    							members[h].getPA().sendFrame126(members[j].playerName, ids[count]);
    							getLeader().getPA().sendFrame126(members[j].playerName, ids[count]);
    							count++;
    						}
    					} catch (Exception e) {
    						e.printStackTrace();
    					}
    				}
    			}
    		} catch (Exception e) {
    			e.printStackTrace();
    		}
    		/*try{
    		int count = 0;
    		Client[] members = new Client[c.getDungeoneeringTeam().getMembers().size() - 1];
    		for(int i = 0;i < ids.length;i++){
    			c.getPA().sendFrame126("", ids[i]);
    		}
    		c.getPA().sendFrame126(c.playerName, ids[0]);
    		for(int i = 0;i < c.getDungeoneeringTeam().getMembers().size();i++){
    			Client o = c.getDungeoneeringTeam().getMembers().get(i);
    			if(o != null){
    				if(o != c){
    					members[count] = c.getDungeoneeringTeam().getMembers().get(i);
    					count++;
    				}
    			} else {
    				System.out.println("Null Member Index: "+i);
    			}
    		}
    		count = 0;
    		for(int h = 0;h < members.length;h++){
    			if(members[h] != null){
    				for(int i = 0;i < ids.length;i++){
    					members[h].getPA().sendFrame126("", ids[i]);
    				}
    				members[count] = members[h];
    				count++;
    			} else {
    				System.out.println("Refreshing party member: NULL");
    				continue;
    			}
    		}
    		count = 1;
    		for(int h = 0;h < members.length;h++){
    			try{
    				count = 1;
    				for(int i = 0;i < ids.length;i++){
    					members[h].getPA().sendFrame126("", ids[i]);
    				}
    				System.out.println("Refreshing party member: "+members[h].playerName);
    				members[h].getPA().sendFrame126(c.playerName, ids[0]);
    				for(int j = 0;j < members.length;j++){
    					members[h].getPA().sendFrame126(members[j].playerName, ids[count]);
    					c.getPA().sendFrame126(members[j].playerName, ids[count]);
    					count++;
    				}
    			}catch (Exception e) {
    				e.printStackTrace();
    			}
    		}
    		}catch(Exception a) {
    			a.printStackTrace();
    		}*/
    	}
    	
    }
    Reply With Quote  
     

  11. #10  
    Registered Member
    Join Date
    Jan 2013
    Posts
    42
    Thanks given
    42
    Thanks received
    5
    Rep Power
    24
    By looking at your classes, I cannot see how the "XP" button gets updated to red or green.

    Really nice job. ;-) You're ahead of me...Again...Like the banktabs...

    Haha.
    Reply With Quote  
     

Page 1 of 2 12 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. Dungeoneering Party invite interface
    By Mr House in forum Snippets
    Replies: 10
    Last Post: 08-01-2012, 08:23 PM
  2. [HELP] Dungeoneering party interface
    By Dumb Dork in forum Help
    Replies: 10
    Last Post: 05-04-2012, 05:11 AM
  3. Replies: 26
    Last Post: 12-27-2011, 05:40 AM
  4. fully working dungeon with npc!
    By hontiris1 in forum Tutorials
    Replies: 24
    Last Post: 08-26-2010, 04:11 PM
  5. Fully working CWars Capes AND Team Capes!
    By Fr33b1e in forum Tutorials
    Replies: 11
    Last Post: 08-14-2007, 07:58 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •