Home viewtut
User Name
passwordPassword
x
Hello guest!, by login to this site, you can add and edit your own server, if you haven't registered yet, click me

Fixing the poisoning splash [Delta]
August 20, 2015, 11:41AM Posted by: Thejuzo
This tutorial has been updated August 20, 2015, 11:54AM by: Thejuzo
In delta servers wow.. you might have noticed that it gives red splash instead green when you get poisoned. This will fix it.





in player.java

replace protected void appendHitUpdate(stream str) {

Code:
protected void appendHitUpdate(stream str) {		
		try {
			str.writeByte(hitDiff); // What the perseon got 'hit' for

			if(hitDiff > 0 && healUpdateRequired && poisonDmg == false){
				str.writeByteA(0);
			} else if (hitDiff > 0 && newhptype == false && poisonDmg == false) {
				str.writeByteA(1); // 0: red hitting - 1: blue hitting
			} else {
				str.writeByteA(0); // 0: red hitting - 1: blue hitting
			}

			if(!healUpdateRequired){
				/*currentHealth -= hitDiff;
				if (currentHealth  maxHealth){
					currentHealth=maxHealth;
				}
			}
			healUpdateRequired=false;
			str.writeByteC(currentHealth); // Their current hp, for HP bar
			str.writeByte(getLevelForXP(playerXP[playerHitpoints])); // Their max hp, for HP bar
                        inCombat=true;
			lastCombat=System.currentTimeMillis();
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
and if you dont already have, declare this

Code:
protected void appendHitUpdate2(stream str) {		
		if(str != null)
		{
			str.writeByte(hitDiff2); // What the perseon got 'hit' for

			if (hitDiff2 > 0) {
				str.writeByteS(2); // 0: red hitting - 1: blue hitting 2: poison 3: orange

			} else if (hitDiff2 == 0 && healUpdateRequired) {
				str.writeByteS(2); // 0: red hitting - 1: blue hitting 2: poison 3: orange
			} else {
				str.writeByteS(2); // 0: red hitting - 1: blue hitting
			}

			str.writeByte(currentHealth); // Their current hp, for HP bar
			str.writeByteC(getLevelForXP(playerXP[playerHitpoints])); // Their max hp, for HP bar
                        inCombat=true;
			lastCombat=System.currentTimeMillis();
		}
		
	}
search
public void appendPlayerUpdateBlock(stream str) {

replace the void with this

Code:
public void appendPlayerUpdateBlock(stream str) {
		if (!updateRequired && !chatTextUpdateRequired)
			return;
		// nothing required
		int updateMask=0;
		if (mask400update)
			updateMask |= 0x400; // Xerozcheez: Very interesting
		// update mask!
		if (mask100update)
			updateMask |= 0x100; // Xerozcheez: Graphics on player
		// update mask
                if(animationRequest != -1) updateMask |= 8;
		if (chatTextUpdateRequired)
			updateMask |= 0x80;
        	if (faceNPCupdate)
            	updateMask |= 1;
		if (appearanceUpdateRequired)
			updateMask |= 0x10;
		if (FocusPointX != -1)
			updateMask |= 2;
		if (hitUpdateRequired)
			updateMask |= 0x20;
if (hitUpdateRequired2)
			updateMask |= 0x200;
		if (dirUpdateRequired)
			updateMask |= 0x40;
		if (plrTextUpdateRequired)
			updateMask |= 4;
                if(animationRequest != -1) updateMask |= 8;
		if (updateMask >= 0x100) {
			// byte isn't sufficient
			updateMask |= 0x40;
			// indication for the client that updateMask is stored in a word
			str.writeByte(updateMask & 0xFF);
			str.writeByte(updateMask >> 8);
		} else
			str.writeByte(updateMask);

		// now writing the various update blocks itself - note that their order
		// crucial
		if (mask400update)
			appendMask400Update(str); // Xerozcheez: Very
		// interesting update mask!
		if (mask100update)
			appendMask100Update(str); // Xerozcheez: Graphics on
		// player update mask
                if(animationRequest != -1) appendAnimationRequest(str);
		if (plrTextUpdateRequired)
			appendString4(str);
		if (chatTextUpdateRequired)
			appendPlayerChatText(str);
		if (faceNPCupdate)
           		appendFaceNPCUpdate(str);
		if (appearanceUpdateRequired)
			appendPlayerAppearance(str);
		if (FocusPointX != -1)
			appendSetFocusDestination(str);
		if (hitUpdateRequired)
			appendHitUpdate(str);
if (hitUpdateRequired2)
			appendHitUpdate2(str);
		if (dirUpdateRequired)
			appendDirUpdate(str);
                //if(animationRequest != -1) appendAnimationRequest(str);
		// TODO: add the various other update blocks

	}
find public void clearUpdateFlags() {

add this

Code:
hitUpdateRequired2=false;
declare these

Code:
protected boolean hitUpdateRequired2=false;
protected int hitDiff2=0;
then find
Code:
public void applyPoisonToMe() {
replace it with this

Code:
public void applyPoisonToMe() {		
		poisonDelay=misc.random(60);
		hitDiff2=misc.random(6);
		currentHealth -= hitDiff2;
		updateRequired=true;
		hitUpdateRequired2=true;
	}
post any errors or missed methods

credits: me
  Fixing the poisoning splash [Delta] Comments (1)
 (#1)
Shogun (Forum)
Comment of: Fixing the poisoning splash [Delta] - 20 August, 2015, 12:42PM

yes
Post A Comment



Next server list update: 23 Minutes and 51 seconds (08:00:09 am)
21%

Newest Server: testgame213324
Newest member: specedo100
Last logged members in 24hours: