Purpose: Real Special Attacks With Handler
Difficulty: 3/10
Assumed Knowledge: copy and paste, extract
Server Base: Any
Classes Modified: client.java, server.java
Procedure
MEGAUPLOAD - The leading online storage and file delivery service
Step 1:
Download the attached file below. Extract the file into your server folder with all your other Java files. This step is crutial that you do because its the base to the special attacks.
Step 2:
Search for in your client: boolean process() - and right above that place these (make sure you are not placing them in any voids, booleans, etc.):
Step 3:Code:public void fsBar(int id1, int id2, int id3) { outStream.createFrame(70); outStream.writeWord(id1); outStream.writeWordBigEndian(id2); outStream.writeWordBigEndian(id3); } public void l33thax(int id) { outStream.createFrame(171); outStream.writeByte(0); outStream.writeWord(id); flushOutStream(); } public boolean specspell(int castID, int casterY, int casterX, int offsetY, int offsetX, int angle, int speed, int startHeight, int endHeight, int enemyY,int enemyX, int Lockon) { try { fcastid = castID; fcasterY = casterY; fcasterX = casterX; foffsetY = offsetY; foffsetX = offsetX; fangle = angle; fspeed = speed; fsh = startHeight; feh = endHeight; fenemyY = enemyY; fenemyX = enemyX; fLockon = Lockon; actionTimer = 0; //Casts Spell In Hands if(cast == false) { createProjectile(casterY, casterX, offsetY, offsetX, angle, speed, castID, startHeight, endHeight, Lockon); cast = true; firingspell = true; } //Fires Projectile if(cast == true && fired == false) { firingspell = false; cast = false; fired = false; } } catch(Exception E) { } return true; } public void ProjectileSpec(int startID, int casterY, int casterX, int offsetY, int offsetX, int index, int enemyY, int enemyX) { { try { server.specialHandler.createSpec(startID, casterY, casterX, offsetY, offsetX, 50, 95, 43, 31, enemyY, enemyX, index+1); } catch(Exception E) { } } }
Add this under boolean process() in your client:
Step 4:Code:if (server.specialHandler.specialAmount <= 99 && server.specialHandler.specialDelay <= 0) { server.specialHandler.specialAmount += 1; server.specialHandler.SpecialBarLength(); } l33thax(12323); l33thax(7574); l33thax(7599); l33thax(7549); l33thax(8493); l33thax(7499);
Search for: boolean attack() - and with the other ints in that add these (make sure they are below int EnemyX and EnemyY):
Step 5:Code:int offsetX = (absX - EnemyX) * -1; int offsetY = (absY - EnemyY) * -1;
Go down just alittle until you see:
Code:if ((EnemyHP - hitDiff) < 0) { hitDiff = EnemyHP; }
And add this right bleolow the }:
Step 6:Code:if (server.specialHandler.returnWeapon(playerEquipment[playerWeapon])==true && server.specialHandler.usingSpecial == true) { if (server.specialHandler.GetSpecCost(playerEquipment[playerWeapon]) < server.specialHandler.specialAmount) { server.specialHandler.specialAmount -= server.specialHandler.GetSpecCost(playerEquipment[playerWeapon]); setAnimation(server.specialHandler.returnWeaponEmote(playerEquipment[playerWeapon])); ProjectileSpec(server.specialHandler.GetSpecProjectile(playerEquipment[playerWeapon]), absY, absX, offsetY, offsetX, AttackingOn, EnemyY, EnemyX); hitDiff = server.specialHandler.GetSpecDamage(playerEquipment[playerWeapon]); server.specialHandler.usingSpecial = false; server.specialHandler.SpecialBarLength(); } else if (server.specialHandler.GetSpecCost(playerEquipment[playerWeapon]) > server.specialHandler.specialAmount) { sendMessage("You need atleast "+server.specialHandler.GetSpecCost(playerEquipment[playerWeapon])+ "special energy."); server.specialHandler.SpecialBarLength(); } else if (server.specialHandler.returnWeapon(playerEquipment[playerWeapon])==false) { sendMessage("You need a special attack weapon."); server.specialHandler.SpecialBarLength(); } }
search for: most buttons - in your client and add under the switch:
Step 7:Code:case 33033://halberds case 29113://bows case 29163://swords case 29138://dds case 48023://whip try { if (server.specialHandler.usingSpecial == true) { server.specialHandler.usingSpecial = false; } else if (server.specialHandler.usingSpecial == false) { server.specialHandler.usingSpecial = true; } server.specialHandler.SpecialBarLength(); } catch (Exception popo) { } break;
Search for: boolean attacknpc() - and with the other ints in that add these (make sure they are below int EnemyX and EnemyY):
Step 8:Code:int offsetX = (absX - EnemyX) * -1; int offsetY = (absY - EnemyY) * -1;
Go down just alittle until you see:
Code:if ((EnemyHP - hitDiff) < 0) { hitDiff = EnemyHP; }
And add this right bleolow the }:
Step 9:Code:if (server.specialHandler.returnWeapon(playerEquipment[playerWeapon])==true && server.specialHandler.usingSpecial == true) { if (server.specialHandler.GetSpecCost(playerEquipment[playerWeapon]) < server.specialHandler.specialAmount) { server.specialHandler.specialAmount -= server.specialHandler.GetSpecCost(playerEquipment[playerWeapon]); setAnimation(server.specialHandler.returnWeaponEmote(playerEquipment[playerWeapon])); ProjectileSpec(server.specialHandler.GetSpecProjectile(playerEquipment[playerWeapon]), absY, absX, offsetY, offsetX, attacknpc, EnemyY, EnemyX); hitDiff = server.specialHandler.GetSpecDamage(playerEquipment[playerWeapon]); server.specialHandler.usingSpecial = false; server.specialHandler.SpecialBarLength(); } else if (server.specialHandler.GetSpecCost(playerEquipment[playerWeapon]) > server.specialHandler.specialAmount) { sendMessage("You need atleast "+server.specialHandler.GetSpecCost(playerEquipment[playerWeapon])+ "special energy."); server.specialHandler.SpecialBarLength(); } else if (server.specialHandler.returnWeapon(playerEquipment[playerWeapon])==false) { sendMessage("You need a special attack weapon."); server.specialHandler.SpecialBarLength(); } }
Open server.java and find: public static void main(java.lang.String args[]) { - and under that add:
Code:specialHandler = new SpecialHandler();
Now find: playerHandler.process(); - and under that add:
Code:specialHandler.process();
Now find: public static PlayerHandler playerHandler = null; - and under that add:
Code:public static SpecialHandler specialHandler = null;



![[Tut] [317] Making special attack](http://ragezone.com/hyper728.png)


