Thread: Super Energy [PI]

Results 1 to 6 of 6
  1. #1 Super Energy [PI] 
    Registered Member
    Join Date
    Mar 2012
    Posts
    710
    Thanks given
    19
    Thanks received
    5
    Rep Power
    37
    I have limited run on my server so it runs down. How can I make Super Energy potions work?
    Reply With Quote  
     

  2. #2  
    Donator
    Darkness's Avatar
    Join Date
    Nov 2012
    Age
    26
    Posts
    876
    Thanks given
    121
    Thanks received
    75
    Rep Power
    47
    Here :
    potions.java
    Code:
    case 3008:
    case 3010:
    case 3012:
    case 3014:
    	c.getItems().deleteItem(itemId, 1);
    	c.getItems().addItem(itemId + 2,1);
    	c.sendMessage("You drink a dose of your energy potion, you have "+((itemId - 3008) > 0 ? ((itemId - 3016) / 2) : 0)+" doses left.");
    	c.startAnimation(829);
    	c.runEnergy = c.runEnergy + 10 < 100 ? c.runEnergy + 10 : 100;
    		break;
    case 3016:
    case 3018:
    case 3020:
    case 3022:
    	c.getItems().deleteItem(itemId, 1);
    	c.getItems().addItem(itemId + 2,1);
    	c.sendMessage("You drink a dose of your energy potion, you have "+((itemId - 3016) > 0 ? ((itemId - 3016) / 2) : 0)+" doses left.");
    	c.startAnimation(829);
    	c.runEnergy = c.runEnergy + 20 < 100 ? c.runEnergy + 20 : 100;
    		break;
    Might need a few imports! Credits to some guy I just forgot the name who wrote the main method, i've done a few edits to fix errors. I think (?) It should work as i only tested in the compiler. there's normal energy + supers in that
    Attached image
    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    Dec 2011
    Posts
    967
    Thanks given
    234
    Thanks received
    208
    Rep Power
    0
    Well it matters how your normal potions are stored

    I'm guessing they are in something called potion.java

    Code:
    				case 4dose:
    				runrestore(itemId,3dose,slot);
    				break;
    				case 3dose:
    				runrestore(itemId,2dose,slot);
    				break;
    				case 2dose:
    				runrestore(itemId,1dose,slot);
    				break;
    				case 1dose:
    				runrestore(itemId,vial,slot);
    				break;
    Code:
    	public void runrestore(int itemId, int replaceItem, int slot) {
    		c.startAnimation(829);
    		c.playerItems[slot] = replaceItem + 1;
    		c.getItems().resetItems(3214);
    		c.runEnergy += 23;
    		if (c.runEnergy > 100) c.runEnergy = 100;
                    c.updateRequired = true;
    		
                    
    	}
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Jun 2013
    Posts
    30
    Thanks given
    4
    Thanks received
    0
    Rep Power
    11
    Code:
    src\server\game\players\Potions.java:237: error: cannot find symbol
                                            c.runEnergy = c.runEnergy + 10 < 100 ? c
    .runEnergy + 10 : 100;
                                             ^
      symbol:   variable runEnergy
      location: variable c of type Client
    src\server\game\players\Potions.java:237: error: cannot find symbol
                                            c.runEnergy = c.runEnergy + 10 < 100 ? c
    .runEnergy + 10 : 100;
                                                           ^
      symbol:   variable runEnergy
      location: variable c of type Client
    src\server\game\players\Potions.java:237: error: cannot find symbol
                                            c.runEnergy = c.runEnergy + 10 < 100 ? c
    .runEnergy + 10 : 100;
    
    ^
      symbol:   variable runEnergy
      location: variable c of type Client
    src\server\game\players\Potions.java:247: error: cannot find symbol
                                            c.runEnergy = c.runEnergy + 20 < 100 ? c
    .runEnergy + 20 : 100;
                                             ^
      symbol:   variable runEnergy
      location: variable c of type Client
    src\server\game\players\Potions.java:247: error: cannot find symbol
                                            c.runEnergy = c.runEnergy + 20 < 100 ? c
    .runEnergy + 20 : 100;
                                                           ^
      symbol:   variable runEnergy
      location: variable c of type Client
    src\server\game\players\Potions.java:247: error: cannot find symbol
                                            c.runEnergy = c.runEnergy + 20 < 100 ? c
    .runEnergy + 20 : 100;
    
    ^
      symbol:   variable runEnergy
      location: variable c of type Client
    src\server\game\players\Potions.java:257: error: cannot find symbol
                    c.runEnergy += 23;
                     ^
      symbol:   variable runEnergy
      location: variable c of type Client
    src\server\game\players\Potions.java:258: error: cannot find symbol
                    if (c.runEnergy > 100) c.runEnergy = 100;
                         ^
      symbol:   variable runEnergy
      location: variable c of type Client
    src\server\game\players\Potions.java:258: error: cannot find symbol
                    if (c.runEnergy > 100) c.runEnergy = 100;
                                            ^
      symbol:   variable runEnergy
      location: variable c of type Client
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    9 errors
    Press any key to continue . . .
    Mine can't find the symbol for runEnergy? How would you go about doing this and please help lol I need this!
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Jul 2013
    Posts
    66
    Thanks given
    12
    Thanks received
    5
    Rep Power
    55
    Bit of a bump, but when you handled energy draining, which variable handled how much energy they had? Example being runEnergy
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Jun 2013
    Posts
    30
    Thanks given
    4
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by Giovanni View Post
    is it so hard to edit all the "runEnergy" with the method name you have? is it so hard to make rundraining stop?
    I wasn't sure what it meant but now I fixed both so I have them working. Thanks for the help I guess...
    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. Buying super stable pi
    By Holocaust in forum Buying
    Replies: 7
    Last Post: 03-18-2012, 11:05 PM
  2. 508/525 Energy & super energy potion
    By Huztler in forum Tutorials
    Replies: 2
    Last Post: 02-17-2011, 03:27 PM
  3. energy {pi}
    By Romania Clan in forum Help
    Replies: 5
    Last Post: 06-07-2010, 05:05 PM
  4. [PI]Energy Potion
    By Mr.PedoBear in forum Help
    Replies: 3
    Last Post: 05-30-2010, 05:23 PM
  5. Full super energy potions! [/delta]
    By SourDeeez in forum Tutorials
    Replies: 22
    Last Post: 03-23-2009, 02:53 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
  •