So for room one floorId would equal 0 and so on. Is this what you wanted?Code:c.roomId = ROOM_IDS[floorId][0] c.absX = ROOM_IDS[floorId][1] c.absY = ROOM_IDS[floorId][2]
|
|




Well I am working on dung system now and I'm trying to clean things up a bit. For my rooms I wanted to use an array like this:
But I was wondering how I would return each value so it read it as I want it to be read. Like the Room Id, X Cord and Y Cord. So the final code would be like:Code:public static final int[][] ROOM_IDS = { {1, 3291, 9177}, {2, 3291, 9179} }; //room id, xcord, ycord
Also the X & Y cord is where the player is standing. So it would have to return it as like:Code:if (c.dungLevel <= 0 && c.getItems().playerHasItem(20880, 1) && return the value here for the room id, xcord, ycord) { c.getPA().movePlayer(3291, 9179, 0); c.dungLevel = 1; } else if (c.dungLevel >= 1 && return the value here for the room id, xcord, ycord) { c.getPA().movePlayer(3291, 9177, 0); } else { c.sendMessage("You need a key to get through here."); }
Code:c.absX == # && c.absY == ##

So for room one floorId would equal 0 and so on. Is this what you wanted?Code:c.roomId = ROOM_IDS[floorId][0] c.absX = ROOM_IDS[floorId][1] c.absY = ROOM_IDS[floorId][2]




No that's not what I wanted. What I want it to do is something like this:
Code:public static int roomId() { return (the first number); }As so on but in the code I would be like:Code:public static int getXCord() { return (the second number); }
Code:if (c.dungLevel <= 0 && c.getItems().playerHasItem(20880, 1) && (roomId == 1, xCord == ##, yCord == ##)) { c.getPA().movePlayer(3291, 9179, 0); c.dungLevel = 1; } else if (c.dungLevel >= 1 && (roomId == 2, xCord == ##, yCord == ##)) { c.getPA().movePlayer(3291, 9177, 0); } else { c.sendMessage("You need a key to get through here."); }

You get the idea? add your own size check if you want to prevent errors.Code:public static int roomId(int floorId) { return ROOM_IDS[floorId][0]; }

l2enumbro



c.absX ==
c.absY ==
and make an int for roomID
if (c.dungLevel <= 0 && c.getItems().playerHasItem(20880, 1) && c.absX == ## && c.absY == ## && RoomID == ##) {

| « Paying 25$ for someone to help me add plimus auto donation or any auto donation! | Portforwarding on NETGEAR » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |