☻ Wild Pkerz The Next Revelution! ☻

Server IP: Wildpkz.no-ip.info!
 
HomeLATEST NEWS!RegisterLog in
ANNOUNCMENT: THE SERVER IS NOW BACK ON! GO DOWNLOAD THE CLIENT AND LOG ON NOW! WILDPKERZ.NO-IP.INFO! HAVE FUN!

Share | 
 

 A Coders Introduction and tutorial.

Go down 
AuthorMessage
Encrypted
Wanksta
Wanksta


Male Number of posts : 8
Age : 28
Location : Burlington, Ontario Canada
Humor : Extreme
Registration date : 2009-11-25

PostSubject: A Coders Introduction and tutorial.   Sun Nov 29, 2009 11:13 am

Hey guys, it's Encrypted.

I applied to be a head administrator, or maybe even a Co-Owner of WildPKZ.
I have been coding ever since I was 12. Now I am 19, It's been 7 whole years.
I've been improving through the years and now I would like to share codes.

This code below, is D-Claws 4 Hit Spec.
If you mess up make sure you have a copy of your client.java


Quote :
first
under
Code:
public class client extends Player implements Runnable {
add

Code:
public boolean DCDamg = false;
public int DCdown = 0;
next add this above
Code:
public int GetWepAnim(int id)
Code:
public int dclaws = 0;

public void dclawed2() {
client AttackingOn2 = (client) server.playerHandler.players[AttackingOn];
int clawed2 = misc.random(playerMaxHit/2);
if(AttackingOn2 != null) {
if(AttackingOn2.currentHealth <= 0) {
dclaws = 0;
} else {
PlayerHandler.players[AttackingOn].hitUpdateRequired = true;
PlayerHandler.players[AttackingOn].updateRequired = true;
PlayerHandler.players[AttackingOn].appearanceUpdateRequired = true;
if(misc.random(3) != 1) {
PlayerHandler.players[AttackingOn].dealDamage(clawed2);
PlayerHandler.players[AttackingOn].hitDiff = clawed2;
} else {
PlayerHandler.players[AttackingOn].dealDamage(0);
PlayerHandler.players[AttackingOn].hitDiff = 0;
}
PlayerHandler.players[AttackingOn].killers[playerId] += hitDiff;
PlayerHandler.players[AttackingOn].KilledBy[playerId] += hitDiff;
}
}
}
public void dclawed() {
client AttackingOn2 = (client) server.playerHandler.players[AttackingOn];
int clawed = misc.random(playerMaxHit);
if(AttackingOn2 != null) {
if(AttackingOn2.currentHealth <= 0) {
dclaws = 0;
} else {
PlayerHandler.players[AttackingOn].hitUpdateRequired = true;
PlayerHandler.players[AttackingOn].updateRequired = true;
PlayerHandler.players[AttackingOn].appearanceUpdateRequired = true;
if(misc.random(3) != 1) {
PlayerHandler.players[AttackingOn].dealDamage(clawed);
PlayerHandler.players[AttackingOn].hitDiff = clawed;
} else {
PlayerHandler.players[AttackingOn].dealDamage(0);
PlayerHandler.players[AttackingOn].hitDiff = 0;
}
PlayerHandler.players[AttackingOn].killers[playerId] += hitDiff;
PlayerHandler.players[AttackingOn].KilledBy[playerId] += hitDiff;
}
}
}

next
search for
Code:
if(playerEquipment[playerWeapon] == 5698 && specialAmount > 24){
then under the }
add this

Code:
if(playerEquipment[playerWeapon] == 8050 && specialAmount > 49){
dclaws = 4;
getHit(65);
usingSpecial = true;
}

next under
Code:
public boolean process() {
add this
Code:
if(dclaws == 3) {
dclawed();
}

if(dclaws == 2) {
startAnimation(2068);
dclawed2();
}

if(dclaws == 1) {
dclawed2();
actionInterval = getbattleTimer() + getbattleTimer()/2;
}

if(dclaws > 0) {
dclaws -= 1;
}
under that add

Code:
if ((IsAttackingNPC) && DCDamg == true ) {
if (DCdown == 2 ) {
startAnimation(2068);
}
SpecDamgNPC(30);
DCdown -= 1;
if (DCdown == 0 ) {
DCDamg = false;
}
}
if (IsAttacking == true && DCDamg == true ) {
if (DCdown == 2 ) {
startAnimation(2068);
}
SpecDamg(25);
DCdown -= 1;
if (DCdown == 0 ) {
DCDamg = false;
}
}
then find

Code:
}
if(playerEquipment[playerWeapon] == 5698 && specialAmount > 24){
specialAtkNPC(true, 25, 252, 0x426);
npcDamage(Cool;
}
add this under

if(playerEquipment[playerWeapon] == 8050 && specialAmount > 49){
specialAtkNPC(true, 75, 282, 2068);
DCdown = 4;
DCDamg = true;
npcDamage(Cool;
}


Lastly in special.java add

case 8050:
under
case 5698:

Make sure u do that 2 times!!!! in special.java
Make sure you change all 8050 to 8002 or whatever your dragon claw ID is.

I hope you will use this cause I highly recommend it.
I also recommend fixing duped trades here is the code


Quote :
This should fix one of the trade Dupe on most bases.
Also, it automatically sends a message to all Mods & admins.

Duping
We assume a player has a non-stackable item in his/her inventory.
The person clicks the item (so it adds it to the trade screen) and
then right clicks the item really fast, before it appears in the Trade Screen.
When the Item shops up in the Trade screen, click Offer 1 and you should see
the item twice in the trade screen, with the other item still in your inventory.
----------------------------------------------------------------
1. Open up client.java.

2. Search for this line.

Code:
} else if (interfaceID == 3322) {
3. It should look something like this.

Code:
} else if (interfaceID == 3322) {
// remove from bag to trade window
tradeItem(removeID, removeSlot, 1);
}
4. Replace it with this.

Code:
} else if (interfaceID == 3322) {
// remove from bag to trade window
if ((removeID == (playerItems[removeSlot] -1)) && (removeID > 0)){

tradeItem(removeID, removeSlot, 1);
} else {
modYell("[REPORT] " + playerName + " & client-" + trade_other + " tried to Trade dupe " + getItemName(removeID) + ".");
}

These are just a small portion of codes I have worked on.
I hope you guys will recommend me as a Java Developer, Co-Owner.
On both server and forums.

Thank you.

Sincerely: Encrypted


Admin Application Link - Click Here.
Back to top Go down
View user profile
 
A Coders Introduction and tutorial.
Back to top 
Page 1 of 1
 Similar topics
-
» HOw to make ranks on forum-detail tutorial
» Forum Padding Adjustment, Pizza's Boi Tutorial Help
» [Tutorial] Apple Touch Icon: how does it work?
» Rank Bars Tutorial Photoshop-Needed
» Members Introduction

Permissions in this forum:You cannot reply to topics in this forum
☻ Wild Pkerz The Next Revelution! ☻ :: General Discussion :: Welcome To the Best Server Ever!-
Jump to: