Gibbo Newbie
Number of posts : 3 Age : 32 Location : Newcastle, England Registration date : 2008-09-15
| Subject: Guthans Effect... Mon Sep 15, 2008 2:32 pm | |
| In this guide I will be teaching you how to add a simple guthans effect, that has a 1/2 chance of healing what you hit. This is great for servers with bosses, etc. Lets begin, and remember to leave feedback! Open up client.java... and add this method: - Code:
-
public void guthan() { if(misc.random(2) == 1) { stillgfx(398, EnemyY, EnemyX); sendMessage("You drain your opponents health."); NewHP += hitDiff; if(NewHP > getLevelForXP(playerXP[3])) { NewHP = getLevelForXP(playerXP[3]); } } }
The misc.random(2) == 1) is like flipping a coin. It randomly chooses a number, either 1 or 2 in this case, and if the number happens to be 1, the effect heals. the GFX is those purple things that float up in the air when it heals sendMessage is it will send you the messages in the "". and this: - Code:
-
NewHP += hitDiff; if(NewHP > getLevelForXP(playerXP[3])) { NewHP = getLevelForXP(playerXP[3])
Adjusts your hitpoints after you heal. Now that we have the method, you may want to make guthans work in PVP. Search for ( were in client.java the whole time): - Code:
-
public boolean Attack() {
If you scroll down you may see codes like this: - Code:
-
if (playerEquipment[playerWeapon] == (1333)) // rune scimi here { PkingDelay = 8; actionTimer = 8; }
Add in those codes: - Code:
-
if (playerEquipment[playerHat] == 4724 && playerEquipment[playerChest] == 4728 && playerEquipment[playerLegs] == 4730 && playerEquipment[playerWeapon] == 4726) { guthan(); }
What this is doing is that if the player is equipping full guthans, ( helm, body, spear, AND skirt) it will go to the method guthan();. Note this code was for PVP, npcs are next. ----------------For NPCS-------------------- search for - Code:
-
public boolean attacknpc
Scroll down until you see something like: - Code:
-
if (GoodDistance(EnemyX, EnemyY, absX, absY, 1) == true || playerEquipment[playerWeapon] == 859 || playerEquipment[playerWeapon] == 4214 || playerEquipment[playerWeapon] == 839 || playerEquipment[playerWeapon] == 841 || playerEquipment[playerWeapon] == 843 || playerEquipment[playerWeapon] == 845 || playerEquipment[playerWeapon] == 847 || playerEquipment[playerWeapon] == 849 || playerEquipment[playerWeapon] == 851 || playerEquipment[playerWeapon] == 853 || playerEquipment[playerWeapon] == 855 || playerEquipment[playerWeapon] == 857 || playerEquipment[playerWeapon] == 4734 || playerEquipment[playerWeapon] == 15156 || playerEquipment[playerWeapon] == 4675) { if (LoopAttDelay <= 1) { if (server.npcHandler.npcs[attacknpc].IsDead == true) { } else if(!UseBow) { //actionAmount++; setAnimation(GetWepAnim()); if ((EnemyHP - hitDiff) < 0) { hitDiff = EnemyHP; }
Under that, add: - Code:
-
if (playerEquipment[playerHat] == 4724 && playerEquipment[playerChest] == 4728 && playerEquipment[playerLegs] == 4730 && playerEquipment[playerWeapon] == 4726) { if(misc.random(2) == 1) { PkingDelay = 6; wepdelay = 6; stillgfx(398, EnemyY, EnemyX); sendMessage("You Drain Your Oponents Health"); NewHP += hitDiff; if(NewHP > getLevelForXP(playerXP[3])) { NewHP = getLevelForXP(playerXP[3]); } } }
[ Save, and compile. If you get errors, go ahead and post them and I will answer right away. MY FIRST TUT ON THESE FORUMS! YAY! | |
|
R0b1n H0od Newbie
Number of posts : 18 Registration date : 2008-08-27
| Subject: Re: Guthans Effect... Mon Sep 15, 2008 3:36 pm | |
| nice leeched guide,atleast give credits next time | |
|
Cookie Donator
Number of posts : 306 Age : 116 Location : null Registration date : 2008-08-12
| Subject: Re: Guthans Effect... Tue Sep 16, 2008 12:19 am | |
| Gibbo.. Don't post noneeded tuts.. There is guthan's healing speed already -.-" | |
|
Cookie Donator
Number of posts : 306 Age : 116 Location : null Registration date : 2008-08-12
| Subject: Re: Guthans Effect... Fri Oct 10, 2008 10:50 am | |
| Lock? Rofl | |
|
Sponsored content
| Subject: Re: Guthans Effect... | |
| |
|