Thread: need help with altar

Results 1 to 3 of 3
  1. #1 need help with altar 
    Registered Member pk3r john's Avatar
    Join Date
    Apr 2009
    Posts
    877
    Thanks given
    16
    Thanks received
    30
    Rep Power
    63
    I need it so that you can't access curses if you're under 30 defence.

    Code:
    				case 411:
    		 if (c.playerLevel[1] <= 29) {
    			c.sendMessage("You need a defence level of 30 to access curses.");
    		 } else {
    				if(c.altarPrayed == 0) {
    				c.altarPrayed = 1;
    				c.setSidebarInterface(5, 22500);
    				c.startAnimation(645);
    				c.sendMessage("You sense a surge of power flow through your body!");
    				c.getCombat().resetPrayers();
    			 	if (c.altarPrayed == 1) {
    				c.altarPrayed = 0;
    				c.setSidebarInterface(5, 5608);
    				c.startAnimation(645);
    				c.sendMessage("You sense a surge of purity flow through your body!");
     				c.getCurse().resetCurse();
    				}
    			}
    		}
    		break;
    I've tried a lot of minor changes and none of them have worked...
    Reply With Quote  
     

  2. #2  
    Registered Member Recursion's Avatar
    Join Date
    Feb 2010
    Posts
    638
    Thanks given
    0
    Thanks received
    29
    Rep Power
    41
    This looks right just make sure that the altar id is 411.

    Code:
    case 411:
    	if (c.playerLevel[1] < 30)
    	{
    		c.sendMessage("You need a defence level of 30 to access curses.");
    		break;
    	}
    	if(c.altarPrayed == 0) 
    	{
    		c.altarPrayed = 1;
    		c.setSidebarInterface(5, 22500);
    		c.startAnimation(645);
    		c.sendMessage("You sense a surge of power flow through your body!");
    		c.getCombat().resetPrayers();
                    break;
    	} 
    	if (c.altarPrayed == 1)
    	{
    		c.altarPrayed = 0;
    		c.setSidebarInterface(5, 5608);
    		c.startAnimation(645);
    		c.sendMessage("You sense a surge of purity flow through your body!");
     		c.getCurse().resetCurse();
                    break;
    	}
    break;
    Edit: Changed up the code a bit as yours had a mistake with "if (c.altarPrayed == 0) {" then "if (c.altarPrayed == 1) {". This would mean that if it was 0, it would make it 1, and then make it go back to 0. Should be good now.
    Reply With Quote  
     

  3. #3  
    Registered Member pk3r john's Avatar
    Join Date
    Apr 2009
    Posts
    877
    Thanks given
    16
    Thanks received
    30
    Rep Power
    63
    Quote Originally Posted by Recursion View Post
    This looks right just make sure that the altar id is 411.

    Code:
    case 411:
    	if (c.playerLevel[1] < 30)
    	{
    		c.sendMessage("You need a defence level of 30 to access curses.");
    		break;
    	}
    	if(c.altarPrayed == 0) 
    	{
    		c.altarPrayed = 1;
    		c.setSidebarInterface(5, 22500);
    		c.startAnimation(645);
    		c.sendMessage("You sense a surge of power flow through your body!");
    		c.getCombat().resetPrayers();
                    break;
    	} 
    	if (c.altarPrayed == 1)
    	{
    		c.altarPrayed = 0;
    		c.setSidebarInterface(5, 5608);
    		c.startAnimation(645);
    		c.sendMessage("You sense a surge of purity flow through your body!");
     		c.getCurse().resetCurse();
                    break;
    	}
    break;
    Edit: Changed up the code a bit as yours had a mistake with "if (c.altarPrayed == 0) {" then "if (c.altarPrayed == 1) {". This would mean that if it was 0, it would make it 1, and then make it go back to 0. Should be good now.

    Thanks!! rep++
    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. Replies: 27
    Last Post: 08-02-2015, 09:50 PM
  2. [PI] Altar
    By Charlie' in forum Help
    Replies: 4
    Last Post: 09-30-2011, 04:16 AM
  3. Blood altar
    By Dexter Morgan in forum Requests
    Replies: 0
    Last Post: 07-30-2009, 07:08 PM
  4. altar
    By jer123 in forum Help
    Replies: 0
    Last Post: 06-28-2009, 10:41 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
  •