SilabGarza - RS Private Server  
Home Forum Play Register Store Market Highscores Mark Forums Read
Go Back   SilabGarza - RS Private Server > SilGar Media > Computers > Programming
Reload this Page [PI] Entering Altars


[PI] Entering Altars
Old
  (#1 (permalink))
phl0w is Offline
ARE YOU MAD?
image
 
phl0w's Avatar
 
Posts: 59
Cookies Given: 0
Cookies Received: 0
Time Online: 20 h 55 m
   
Default [PI] Entering Altars - 01-24-2012, 12:23 PM

I recommend you add this, too: http://sg-forum.com/silgar-media/computers/programming/112694-%5Bpi%5D-tiaras-configuration.html#post918280

Add this to runecrafting.java:
Code:
	private enum Altars {
		AIR_ALTAR(2452, new int[] {1438, 5527}, new int[] {2842, 4829}),
		MIND_ALTAR(2453, new int[] {1448, 5529}, new int[] {2793, 4828}),
		WATER_ALTAR(2454, new int[] {1444, 5531}, new int[] {2713, 4836}),
		EARTH_ALTAR(2455, new int[] {1440, 5535}, new int[] {2655, 4831}),
		FIRE_ALTAR(2456, new int[] {1442, 5537}, new int[] {2577, 4845}),
		BODY_ALTAR(2457, new int[] {1446, 5533}, new int[] {2521, 4834}),
		COSMIC_ALTAR(2458, new int[] {1454, 5539}, new int[] {2162, 4833 }),
		CHAOS_ALTAR(2461, new int[] {1452, 5543}, new int[] {2268, 4842}),
		NATURE_ALTAR(2460, new int[] {1462, 5541}, new int[] {2400, 4835}),
		LAW_ALTAR(2459, new int[] {1458, 5545}, new int[] {2464, 4819}),
		DEATH_ALTAR(2462, new int[] {1456, 5547}, new int[] {2208, 4831});


		int objId;
		int[] keys, loc;

		private Altars(int objId, int[] keys, int[] loc) {
			this.objId = objId;
			this.loc = loc;
			this.keys = keys;
		}

		private int getObj() {
			return objId;
		}

		private int[] getKeys() {
			return keys;
		}

		private int[] getNewLoc() {
			return loc;
		}
	}

	public Altars forAltar(int id) {
		for (Altars a : Altars.values()) {
			if (a.getObj() == id) {
				return a;
			}
		}
		return null;
	}

	public void enterAltar(int objId, int itemUse) {
		Altars a = forAltar(objId);
		if (a != null) {
			if (a.getKeys()[1] == c.playerEquipment[c.playerHat] || a.getKeys()[0] == itemUse) {
			c.getPA().movePlayer(a.getNewLoc()[0], a.getNewLoc()[1], 0);
			c.sendMessage("You enter the mysterious ruins.");
			} else {
				c.sendMessage("Nothing interesting happens.");
			}
		}
	}
Add this in ActionHandler.java under switch (objectType) {:
Code:
		case 2452:
		case 2453:
		case 2454:
		case 2455:
		case 2456:
		case 2457:
		case 2458:
		case 2459:
		case 2460:
		case 2461:
		case 2462:
			c.getRunecrafting().enterAltar(objectType, 0);
			break;
Add this in ItemOnObject.java under switch (objectId) {:
Code:
		case 2452:
		case 2453:
		case 2454:
		case 2455:
		case 2456:
		case 2457:
		case 2458:
		case 2459:
		case 2460:
		case 2461:
		case 2462:
			c.getRunecrafting().enterAltar(objectId, itemId);
			break;




~[email protected]
  
adsense code2.3
Closed Thread

Bookmarks

[PI] Entering Altars

Programming




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
adsense2.6
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 12:01 AM.





Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2017, vBulletin Solutions, Inc.