Thread: How to add FULL High Alch with Magic bar set Back, once the Alch is finished.

Results 1 to 7 of 7
  1. #1 How to add FULL High Alch with Magic bar set Back, once the Alch is finished. 
    Banned

    Join Date
    Jun 2008
    Posts
    913
    Thanks given
    30
    Thanks received
    94
    Rep Power
    0
    Purpose: To add FULL high alchemy, Which will also set the side bar back to the magic interface once the alch is finished, and A timer will be added so that you cannot mass alch, You will only be able to alch once the Magic interface is set back.

    Difficulty: 2/10

    Files modified: Client.java.



    PROCEDURE




    First off add this Int:

    Code:
    public int alchtimer = 0;

    And these Methods:

    Code:
        private void setMageInterface() {
            try {
                outStream.createFrame(106);
                outStream.writeByteC(6);
                updateRequired = true; 
                appearanceUpdateRequired = true;
            } catch (Exception E) {
                sendMessage("Error switching to Magic Side bar.");
            }
        }
    
        public boolean fireStaff() {
            if (playerEquipment[playerWeapon] == 1387) {
                return true;
            }
                return false;
        }
    The 'setMagicInterface' method, Makes the Side bar switch back to the Magic interface when Declared.
    The 'fireStaff' Method Recognises that When your Weapon is the ID 1387, you are wielding a fire staff, and We will use this in our High Alchemy spell.




    Next, Either search for:

    Code:
    (castSpell == 1178)
    Or:

    Code:
    (spellID == 1178)

    You will have one of those, they are the Spell ID's of the High Alchemy spell.



    Replace the Whole contents of that Spell with this:

    Code:
                    if (fireStaff()) {
                        if (!playerHasItemAmount(561, 1)) {
                                sendMessage("You need 1 nature rune to cast this spell.");
                        }
                    if (playerHasItemAmount(561, 1)) {
    		    if (alchtimer <= 0) {
                            if (playerLevel[6] >= 55) {
                                deleteItem(castOnItem, castOnSlot, 1);
                                deleteItem(561, getItemSlot(561), 1);
                                addItem(995, alchvaluez);
                                addSkillXP((2500), 6);
                                startAnimation(713);
    			    alchtimer = 6;
                                gfx100(113);
                            } else if (playerLevel[6] <= 54) {
                                sendMessage("You need 55 magic to cast this.");
                           				}
                        			}
    				}
    			}
                    } else if (!fireStaff()) {
                        if (!playerHasItemAmount(561, 1) && !playerHasItemAmount(554, 5)) {
                            sendMessage("You need 1 nature rune and 5 fire runes to cast this spell.");
                        }
                        if (playerHasItemAmount(561, 1) && playerHasItemAmount(554, 5)) {
    		    if (alchtimer <= 0) {
                            if (playerLevel[6] >= 55) {
                                deleteItem(castOnItem, castOnSlot, 1);
                                deleteItem(561, getItemSlot(561), 1);
                                deleteItem(554, getItemSlot(554), 5);
                                addItem(995, alchvaluez);
                                addSkillXP((2500), 6);
                                startAnimation(713);
                                gfx100(113);
    			    alchtimer = 6;
                            } else if (playerLevel[6] <= 54) {
                                sendMessage("You need 55 magic to cast this.");
                            }
                        }
                    }
    	    }
    That spell also sets the Requirements for when you are wielding the Fire staff, so when you Wield it, you will need 55 magic, and One nature rune.



    You can change the XP given from casting the spell to Whatever you like.

    Also if you Don't already have this method, Add it:

    Code:
        public void gfx100(int gfx) {
            mask100var1 = gfx;
            mask100var2 = 5898240;
            mask100update = true;
            updateRequired = true;
        }
    That Method, when used, Makes GFX's Higher up than usual, because the normal Alching GFX, when you just use gfx(113); the GFX is halfway into the floor.



    Now in your process(), add these:

    Code:
    		if (alchtimer > 0) {
    			alchtimer -= 1;
    		}
    		if (alchtimer == 1) {
                		setMageInterface();
    		}
    Those Make the Alchtimer go down by one every around half a second, and also makes the side bar switch back to the Magic Interface when the alchtimer = 1.


    Now when you alch With, or without a firestaff It should have the correct GFX, the correct emote, and It will switch back to the Magic Interface once the alch is finished, PLUS, you cannot mass alch, because a timer has been added, making it so you can only alch once the Interface has been switched back.


    PICTURES:



    Your alching should now look like this:




    And the Magic Interface switching back:

     

  2. #2  
    red_rooster
    Guest
    i did this i got 100 errors. and i know i did it right. i did tut over 2 times
     

  3. #3  
    Community Veteran


    Join Date
    Sep 2007
    Posts
    370
    Thanks given
    127
    Thanks received
    170
    Rep Power
    408
    I put it in correctly, no compile errors, and when i went to use high alch, it said "client hack detected" Im using devolution v7
    Original founder of this site
    8 Year RSPS Veteran
    Java programmer of 7 years
    Advanced PHP Programmer
     

  4. #4  
    'Sora
    Guest
    got a poopload of errors. i did it right tbh
    100 errors, then fixed, 4 errors, and then i got orphaned case. fixed it and more orphaned cases came up.
     

  5. #5  
    joshscape123
    Guest
    the magic spell is all messed up maybe you should clean it?

    i got it to work had to remove the staff bit though try this

    Code:
     if (castSpell == 1178) // High Alch
                {
                    if (playerHasItemAmount(561, 1) && playerHasItemAmount(554, 5)) {
    		    if (alchtimer <= 0) {
                            if (playerLevel[6] >= 55) {
                                deleteItem(castOnItem, castOnSlot, 1);
                                deleteItem(561, getItemSlot(561), 1);
                                deleteItem(554, getItemSlot(554), 5);
                                addItem(995, alchvaluez);
                                addSkillXP((2500), 6);
                                startAnimation(713);
                                gfx100(113);
    			    alchtimer = 6;
                            } else if (playerLevel[6] <= 54) {
                                sendMessage("You need 55 magic to cast this.");
                            }
                        }
                    }
     

  6. #6  
    J_m_2_k
    Guest
    Maybe fix it up a bit?
     

  7. #7  
    Donator

    tj007razor's Avatar
    Join Date
    Feb 2007
    Posts
    895
    Thanks given
    2
    Thanks received
    9
    Rep Power
    210
    Quote Originally Posted by red_rooster View Post
    i did this i got 100 errors. and i know i did it right. i did tut over 2 times
    Means you put it in the wrong place somewhere with a { or }, not that the tut is wrong.

    [Only registered and activated users can see links. ]

    [Only registered and activated users can see links. ] | [Only registered and activated users can see links. ] | [Only registered and activated users can see links. ]
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

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