RuneScape 2 Development > Snippets
Post your code snippets here! [Updated 08/09/2012]
<<< (22/172) >>>
recker450:
Title: How to add Dragon Claws Special for Czar
NOTE: please, if you don't like this tutorial I am not forcing you to use it, many people who used czar requested me for an tutorial for It
Difficulty: 2/10
Purpose: To add an Dragon Claw Special for Allstar, Czar,...
Tested On: Tested onto an Allstar v2
Files Editted: Client.java

1) Declare these Ints and Booleans in Client.java along with your other ints and booleans

--- Quote ---public boolean DCDamg = false;
public boolean DC2Damg = false;
public int DCTimer = 0;
public int DC2Timer = 0;
--- End quote ---

2) Goto
--- Quote ---Public Void Process
--- End quote ---
add this

--- Quote ---        if ((IsAttackingNPC) && DCDamg == true && DCTimer == 0) {
            SpecDamgNPC(25);
            DCDamg = false;
        }
        if (IsAttacking == true && DCDamg == true && DCTimer == 0) {
            SpecDamg(25);
            DCDamg = false;
        }
        if ((IsAttackingNPC) && DC2Damg == true && DC2Timer == 0) {
            SpecDamgNPC(25);
            DC2Damg = false;
        }
        if (IsAttacking == true && DC2Damg == true && DC2Timer == 0) {
            SpecDamg(25);
            DC2Damg = false;
        }
        if (DCTimer > 0) { DCTimer -= 1; }
 if (DC2Timer > 0) { DC2Timer -= 1; }
--- End quote ---

3) Now find
--- Quote ---public void maulSpec() {
--- End quote ---
under the last }
add this

--- Quote ---    public void DCSpec() {
        if (IsAttackingNPC && playerEquipment[playerWeapon] == @@@@) {
            setAnimation(2068);
            actionTimer = 4;
            SpecDamgNPC(30);
            DDS2Damg = true;
            DDStimer = 1;
            DCDamg = true;
            DCTimer = 2;
            DC2Damg = true;
            DC2Timer = 3;
            resetAnimation();
            teleportToX = absX;
            teleportToY = absY;
            SpecDamgNPC(30);
            SpecialDelay -= 1;
        } else if (IsAttacking && playerEquipment[playerWeapon] == @@@@) {
            int j = PlayerHandler.players[AttackingOn].absX;
            int k = PlayerHandler.players[AttackingOn].absY;
            int l = PlayerHandler.players[AttackingOn].playerLevel[playerHitpoints];

            SpecDamg(30);
            DDS2Damg = true;
            DDStimer = 1;
            DCDamg = true;
            DCTimer = 2;
            DC2Damg = true;
            DC2Timer = 3;
            startAnimation(2068);
            actionTimer = 4;
            teleportToX = absX;
            teleportToY = absY;
            SpecialDelay -= 1;
        }
    }
--- End quote ---
Change @@@@ to your dragon claw ID This code is kind of long but it just checks believe me the old one i made up just made you hit continuous d claw spec

4) Find something like this

--- Quote ---        if (playerEquipment[playerWeapon] == 861 && specialAmount <= 50) { // bow
            startAnimation(426);
            DDZ();
            specialDamage = 20 + misc.random(10);
            specialAmount -= 75;
            sendMessage("You do not have enough special energy left.");
        }
        if (playerEquipment[playerWeapon] == 861 && specialAmount >= 100) { // bow
            startAnimation(426);
            DDZ();
            specialDamage = 20 + misc.random(10);
            specialAmount -= 75;
        }
--- End quote ---

under it add this


--- Quote ---        if (playerEquipment[playerWeapon] == @@@@ && specialAmount <= 50) { // D Claws
            startAnimation(2068);
            DCSpec();
            specialDamage = 20 + misc.random(10);
            specialAmount -= 50;
            sendMessage("You do not have enough special energy left.");
        }
        if (playerEquipment[playerWeapon] == @@@@ && specialAmount >= 100) { // D Claws
            startAnimation(2068);
            DCSpec();
            specialDamage = 20 + misc.random(10);
            specialAmount -= 50;
        }
--- End quote ---
Change @@@@ to your D Claws ID

5) Next find something like this

--- Quote ---                                    if (playerEquipment[playerWeapon] == 861
                                            && specialAmount >= 100) {
                                        calculateSpecial();
                                        DDZ();
                                        usingSpecial = false;
                                        specialDamage = 0;
                                        specialDamage2 = 0;
                                    }
--- End quote ---
under it add this


--- Quote ---                                    if (playerEquipment[playerWeapon] == @@@@
                                            && specialAmount >= 50) {
                                        calculateSpecial();
                                        DCSpec();
                                        usingSpecial = false;
                                        specialDamage = 0;
                                        specialDamage2 = 0;
                                    }
--- End quote ---
change @@@@ to your D Claws ID

6) Repeat find something like this again(there are 2 of them)

--- Quote ---                                    if (playerEquipment[playerWeapon] == 861
                                            && specialAmount >= 100) {
                                        calculateSpecial();
                                        DDZ();
                                        usingSpecial = false;
                                        specialDamage = 0;
                                        specialDamage2 = 0;
                                    }
--- End quote ---
under it readd this code


--- Quote ---                                    if (playerEquipment[playerWeapon] == @@@@
                                            && specialAmount >= 50) {
                                        calculateSpecial();
                                        DCSpec();
                                        usingSpecial = false;
                                        specialDamage = 0;
                                        specialDamage2 = 0;
                                    }
--- End quote ---
change @@@@ to your D Claws ID

close and compile it should work if you have any errors pm me
again if you dont like this, I am not forcing you to use it just many people ask me to add an tut for em
DeathsChaos9:
Since Halloween is just around the corner, I figured Id post the zombie head emotes from the 2005 Halloween event

Step 1: Talk-At option (ALAS!)
Find packet 122

--- Code: Java ---case 122:Add:

--- Code: Java ---        if (ItemID == 6722) {                setAnimation(2840);                plrText = "ALAS!";                plrTextUpdateRequired = true;                break;        }   
Step 2: Display option (Muahahahah!)
Find packet 41

--- Code: Java ---case 41:Add:

--- Code: Java ---        if (wearID == 6722) {                setAnimation(2844);                plrText = "Muahahahah!";                plrTextUpdateRequired = true;                break;        }   
Sorry I didn't add the dialogue for the question option, if you want to add it yourself, it goes in packet 16.
   
   
loled2:
This is a tut for [614]

How add Objects, Npcs:
http://pastebin.com/FbXqHm4x

loled2,
AuDiOdreams:
So here it is.... Hyperion Castlewars Base...

If you are really slow and don't know how to add it in, just leave a post and I will try to get back to you...

Also! Near the end of the script is a part where I fixed somethings up, you will know what I'm talking about it starts at line number 715 I'm pretty sure.

You don't need to past that in the script... Only if you want more of the ladders and stairs working... Just copy from 732 and under.



and put it in the right spot... don't be a nerd and ask where to put it, thats an easy thing to do.... anyway here is the code. Enjoy.


https://pastebin.ca/1969411
xneonx:
Hello everyone.  First you need to go into your Dialogue.java. Scroll all the way down. Then there should be something kind of like
--- Code: ---case 352:
c.ptalk("Sorry to hear that..", 591);
break;
--- End code ---
Well where you see the case ###, you change it to a variable that is +1 to the last case. For me I would type case 353. Once you have done that you should make do something like this
--- Code: ---case ###:
c.ptalk("Exchange 1,000,000,000 coins for a Archery Ticket", "Exchange Archery Ticker for a 1,000,000,000" 591);
break;
--- End code ---
Now you are done with the dialogue. Now you need to open up clicking.java. Type ctrl f and the search bar should come up. Search for dialogue. You might find something like this.
--- Code: ---case 32029:
if(c.NpcDialogue == 158){
c.closeAll();
c.triggerTele(2666, 3714, 0);
c.sM("Hans teleports you to the rock crab training area.");
}

--- End code ---
Ok now revise it something like this...
--- Code: ---case 64589://use this case
if(c.NpcDialogue == ###){//put the case number in for the ### this case was the one in the dialogue part not the one above
c.HasItemAmount(995, 1000000000)
c.giveItems(archery ticket id, amount);
c.closeAll();
c.sM("Thanks for your exchange.");
}
case 64590://use this case
if(c.NpcDialogue == ###){//put the case number in for the ### this case was the one in the dialogue part not the one above
c.HasItemAmount(archery ticket id, amount)
c.giveItems(995, 1000000000);
c.closeAll();
c.sM("Thanks for your exchange.");
}

--- End code ---
I hope this works for you guys. P.S. Don't flame saying that this is so simple and shouldn't be posted because I have gotten a lot of pms saying they needed this. This is for newcomers and maybe even some not so new people =P.
Navigation
Message Index
Next page
Previous page

Go to full version
Powered by SMFPacks SEO Pro Mod |