PDA

View Full Version : [562] Changing Weapon Attack/Defend/Run/Walk Emotes



Emily
September 25th, 2010, 21:00
Since I've quit Rsps, I've decided to start sharing small bits of what I know every so often. Instead of just releasing things which seems to get pissed, ill just share the knowledge and let you use it as you wish. Now this tutorial is EXTREMELY easy, but not many people are aware of it, so why not start here lul.

First its a good idea to have these ids in mind:
Attack Emote
Defense Emote
Walk Emote
Run Emote
2h or no?
Projectile sent or no?
Custom Gfx on attack?

File: Equipment.java
Found in the folder "model"

Changing the Walk Emote:
Search
public int getWalkAnim() {

After


try {
if(this.tempWalkAnim != -1) {
return this.tempWalkAnim;
} if(get(3) == null) {
return 0x333;
} Item item = get(3);
String weapon = item.getDefinition().getName();
int id = item.getDefinition().getId();
if(weapon.equals("Saradomin staff") || weapon.equals("Guthix staff") || weapon.equals("Zamorak staff")) {
return 0x333;


Add this:

} else if (id == 4755) {
return 2060;

4755 is the Weapon Id
2060 is the Walk Animation Id

Now Search For:

public int getRunAnim() {

After


try {
if(this.tempWalkAnim != -1) {
return this.tempWalkAnim;
} if(get(3) == null) {
return 0x338;
} Item item = get(3);
String weapon = item.getDefinition().getName();
int id = item.getDefinition().getId();
if (id == 4718 || weapon.endsWith("2h sword") || id == 10858 || id == 8880 || id == 6528 || weapon.endsWith("godsword") || weapon.equals("Saradomin sword")) {
return 7039;


Add:


} else if (id == 4153) {
return 1664;

4153 is the Weapon Id
1664 is the Run Animation Id

Changing Defense Animation:
Search


public int getDefenceAnimation() {

Under:


try {
int weapon = this.get(Equipment.SLOT_WEAPON) != null ? this.get(Equipment.SLOT_WEAPON).getId() : -1;
int shield = this.get(Equipment.SLOT_SHIELD) != null ? this.get(Equipment.SLOT_SHIELD).getId() : -1;
if(weapon == -1 && shield == -1) {
return 404;

Add:


if(weapon == 11694) {
return 3939;
}

11694 = Item Id
3939 = Defense Emote

Now if you want to make a shield have a certain defense emote, then it would just be


if(shield == 1189) {
return 1156;
}



Now if you want the Item to be 2h Do this:
Find:
public static boolean isTwoHanded(ItemDefinition def) {

After:


String wepEquiped = def.getName();
int itemId = def.getId();
if (itemId == 4212)
return true;


Add:


else if (itemId == 8880)
return true;

8880 = Item Id
True means it will be 2h, if its a 2h weapon and you want it to be single handed, then make it false

Now Changing the Attack Animation:
Search
public int getAttackAnimation() {

Under:


public int getAttackAnimation() {
try {
int weapon = this.get(Equipment.SLOT_WEAPON) != null ? this.get(Equipment.SLOT_WEAPON).getId() : -1;
int fightStyle = this.player.getAttackStyle();
switch(weapon) {


Add:


case 4151://Abbysal Whip
return 55;

4151 or the case number, is the item Id
55 is the animation you want the weapon to attack with

Now if you want to add a gfx while it attacks make it look like this:


case 4151:
player.graphics(139);
return 55;


The 139 is the Gfx Id it will attack with.

Changing the attack speed:
Search
public int getAttackSpeed() {
Under:


try {
int weapon = this.get(Equipment.SLOT_WEAPON) != null ? this.get(Equipment.SLOT_WEAPON).getId() : -1;
switch(weapon) {


Add:


case 4151:
return 3;

4151 is the item id
3 is the speed it will attack with


Looks like:
Only the registered members can see the link.

i c u n v me
September 25th, 2010, 21:01
great tut :)

Fly
September 25th, 2010, 21:02
You were the best 562 coder I ever met.

420
September 25th, 2010, 21:04
Good job emily :)

Emily
September 25th, 2010, 21:05
ooh shit, forgot the defense emote part, sec adding it.

Thanks Everyone lol :p

Niator
September 25th, 2010, 21:06
Very useful Emily! Thanks.

The Only Cj
September 25th, 2010, 21:09
enjoy the feeding that emilys bringing people loool

Defil3d ko3d
September 25th, 2010, 21:12
Great guide.
I just added the Barrelchest anchor special attack for NPC + PLAYER but when it attacks normallyl (w/o special attack) it still stretches like its default.
Can you tell me how to fix this?

EDIT:
Or you could tell me the emote ID for the Anchor's attack animation, is it the same as obby maul?

Emily
September 25th, 2010, 21:15
Great guide.
I just added the Barrelchest anchor special attack for NPC + PLAYER but when it attacks normallyl (w/o special attack) it still stretches like its default.
Can you tell me how to fix this?

Search For


case 10887:
return 5865;


Idk the attack emote, but change the 5865 to the proper attack emote.

battlezone
September 25th, 2010, 21:16
emily youre a good coder but comon... you realse so much for 562s so many people are leeching you're source and rune slay its bs. why realse all this? people like me who spend time on our servers deserve these players not the leechers. ive coded my server for over 6 months almost at a blank now theres so many leeches its just bleh... please stop realsing tuts.

Defil3d ko3d
September 25th, 2010, 21:18
Search For


case 10887:
return 5865;


Idk the attack emote, but change the 5865 to the proper attack emote.

Yeh, just found out. Might go look at Runeslay's source to find out.

EDIT:
Found it! Its 5870

Emily
September 25th, 2010, 21:18
emily youre a good coder but comon... you realse so much for 562s so many people are leeching you're source and rune slay its bs. why realse all this? people like me who spend time on our servers deserve these players not the leechers. ive coded my server for over 6 months almost at a blank now theres so many leeches its just bleh... please stop realsing tuts.

How could they possibly leech this? I'm giving them a tutorial so they may use it as they wish, i doubt highly that everyone is going to add the exact same emotes for the same weapons

Defil3d ko3d
September 25th, 2010, 21:25
Weird, I changed the id to 5870 and compiled. Still glitched.

420
September 25th, 2010, 21:32
How could they possibly leech this? I'm giving them a tutorial so they may use it as they wish, i doubt highly that everyone is going to add the exact same emotes for the same weapons

Emily, hes mad because I released my source with your anti-flood, you know, the one that blocks numbers? And because his flooder can't hurt it XD

The Only Cj
September 25th, 2010, 21:33
Explain what the RenderAnim does. Cause all of the weapon based stuff are explained, apart from the render.

Defil3d ko3d
September 25th, 2010, 21:33
^
Add me to that list N00B.

On Topic:
420 i changed the attack ID but still stretchy emote. You think you can help?

Niator
September 25th, 2010, 23:07
emily youre a good coder but comon... you realse so much for 562s so many people are leeching you're source and rune slay its bs. why realse all this? people like me who spend time on our servers deserve these players not the leechers. ive coded my server for over 6 months almost at a blank now theres so many leeches its just bleh... please stop realsing tuts.

This isn't for leeching idiot... This is teaching.

Defil3d ko3d
September 26th, 2010, 08:43
Emily, I have completely replaced my Equipment.java with Runeslay's one. Still, the anchor is stretchy. Why?
I don't get any errors when compiling.

Ficho
September 26th, 2010, 08:47
Nice tut emily ;)

battlezone
September 26th, 2010, 20:55
enjoy the feeding that emilys bringing people loool

yeh she spoon foods everyone...but good tut anyways :p

arthur2545
November 28th, 2010, 07:05
dragonkk is #1

Acrylix
November 28th, 2010, 07:44
Dragonkk is pro far better than any of us but emily and caelum and all that are awesome aswell.