Yea, I know... I have been making alot of them... But it this one will help hopefully alot.
I built this so that I can get the client.java down alot by doing this. I figured that making
a config file out of attacking emotes, I could make alot of things happen easier. But now
I'm going to give my copy to everyone.
It will detect what weapon your using and if you have your weapon in normal attack,
str attack, or balanced attack. I didn't add def attack because (AS WHAT I REMEMBER)
there mostly all 1 emote (I MAYBE WRONG, AND IM SORRY IF I AM.)
Make a backup of your server JUST IN CASE.
The code:
Code:
public static boolean attack_emote(String FileName) {
String line = "";
String token = "";
String token2 = "";
String token2_2 = "";
String[] token3 = new String[10];
boolean EndOfFile = false;
int ReadMode = 0;
BufferedReader ObjectFile = null;
int weaponid = 0;
try {
ObjectFile = new BufferedReader(new FileReader("./" + FileName));
} catch (FileNotFoundException fileex) {
System.out.println(FileName + ": file not found.");
return false;
}
try {
line = ObjectFile.readLine();
} catch (IOException ioexception) {
System.out.println(FileName + ": error loading file.");
return false;
}
while (EndOfFile == false && line != null) {
line = line.trim();
int spot = line.indexOf("=");
if (spot > -1) {
token = line.substring(0, spot);
token = token.trim();
token2 = line.substring(spot + 1);
token2 = token2.trim();
token2_2 = token2.replaceAll("\t\t", "\t");
token2_2 = token2_2.replaceAll("\t\t", "\t");
token2_2 = token2_2.replaceAll("\t\t", "\t");
token2_2 = token2_2.replaceAll("\t\t", "\t");
token2_2 = token2_2.replaceAll("\t\t", "\t");
token2_2 = token2_2.replaceAll("\t\t\t", "\t");
token2_2 = token2_2.replaceAll("\t\t\t\t", "\t");
token2_2 = token2_2.replaceAll("\t\t\t\t\t", "\t");
token3 = token2_2.split("\t");
if (token.equals("item")) {
weaponid = Integer.parseInt(token3[0]);
atk_emote = Integer.parseInt(token3[1]);
str_emote = Integer.parseInt(token3[2]);
bal_emote = Integer.parseInt(token3[3]);
if (playerEquipment[playerWeapon] == weaponid){
if (FightType == 1) {setAnimation(atk_emote);} //normal attack
if (FightType == 2) {setAnimation(str_emote);} //str attack
if (FightType == 3) {setAnimation(bal_emote);} //balanced attack
}
}
} else {
if (line.equals("[EOF]")) {
try {ObjectFile.close();} catch (IOException ioexception) {} return true;}
}
try {
line = ObjectFile.readLine();} catch (IOException ioexception1) {EndOfFile = true; }
}
try {ObjectFile.close();
} catch (IOException ioexception) {}
return false;
}
Here is premade a list for you.
[php]
//---weapon-atk-str-bal--------------The atk, str, bal is the emotes showed when attacking on attack type---//
//---The weapon attack emotes I mean---//
|----------------------------------------------------|
|{1} = weapon ID
|{2} = normal attack emote
|{3} = agressive attck emote
|{4} = balance attack emote
|Note: {4} you will need to change if you want to, I never got the time to add them.
|----------------------------------------------------|
|------{1}--{2}-{3}-{4}---|
|-----short swords / daggers----------|
item = 1277 412 451 1
item = 1279 412 451 1
item = 1281 412 451 1
item = 1283 412 451 1
item = 1285 412 451 1
item = 1287 412 451 1
item = 1289 412 451 1
item = 1203 412 451 1
item = 1205 412 451 1
item = 1207 412 451 1
item = 1209 412 451 1
item = 1211 412 451 1
item = 1213 412 451 1
item = 1217 412 451 1
item = 1237 412 451 1
item = 1239 412 451 1
item = 1241 412 451 1
item = 1243 412 451 1
item = 1245 412 451 1
item = 1247 412 451 1
item = 1249 412 451 1
//Long swords and scimmys//
item = 1291 451 412 1
item = 1293 451 412 1
item = 1295 451 412 1
item = 1297 451 412 1
item = 1299 451 412 1
item = 1301 451 412 1
item = 1303 451 412 1
item = 1321 451 412 1
item = 1323 451 412 1
item = 1325 451 412 1
item = 1327 451 412 1
item = 1329 451 412 1
item = 1331 451 412 1
item = 1333 451 412 1
item = 1420 451 412 1
item = 1422 451 412 1
item = 1424 451 412 1
item = 1426 451 412 1
item = 1428 451 412 1
item = 1430 451 412 1
item = 1432 451 412 1
item = 1305 451 412 412
item = 6739 451 412 1
item = 4587 451 412 1
item = 746 451 412 1
item = 5018 451 412 1
item = 3101 451 412 1
//Axes//
item = 1349 1833 401 1
item = 1351 1833 401 1
item = 1353 1833 401 1
item = 1355 1833 401 1
item = 1357 1833 401 1
item = 1359 1833 401 1
item = 1361 1833 401 1
item = 1363 1833 401 1
item = 1365 1833 401 1
item = 1367 1833 401 1
item = 1369 1833 401 1
item = 1371 1833 401 1
item = 1373 1833 401 1
item = 1377 1833 401 1
item = 1434 1833 401 1
item = 4566 1833 1833 1
//2 handed swords//
item = 6609 406 407 1
item = 1307 406 407 1
item = 1309 406 407 1
item = 1311 406 407 1
item = 1313 406 407 1
item = 1315 406 407 1
item = 1317 406 407 1
item = 1319 406 407 1
item = 7158 406 407 1
[EOF]
[/php]
Where to add:
In client.java, find packet 73. (As by my server) its attacking. You can add this, removing
alot of the attack emotes. BUT you can use this on other things too.
You can mostly find the codes by finding this
Code:
if (playerEquipment[playerWeapon] == 4151)
{setAnimation(1658);}
Which is the abby whip, which mostly everyone uses. So look around for something like this,
Or contains what you see here. You can also use this for like attacking objects. (To make them
look cooler.)
I HOPE this helps you.