Code-x
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Code-x

Code-x Private Server
 
HomeHome  PortalPortal  Latest imagesLatest images  SearchSearch  RegisterRegister  Log inLog in  

 

 Guthans Effect...

Go down 
3 posters
AuthorMessage
Gibbo
Newbie
Newbie
Gibbo


Number of posts : 3
Age : 32
Location : Newcastle, England
Registration date : 2008-09-15

Guthans Effect... Empty
PostSubject: Guthans Effect...   Guthans Effect... Icon_minitimeMon 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! Very Happy
Back to top Go down
R0b1n H0od
Newbie
Newbie



Number of posts : 18
Registration date : 2008-08-27

Guthans Effect... Empty
PostSubject: Re: Guthans Effect...   Guthans Effect... Icon_minitimeMon Sep 15, 2008 3:36 pm

nice leeched guide,atleast give credits next time
Back to top Go down
Cookie
Donator
Donator
Cookie


Number of posts : 306
Age : 115
Location : null
Registration date : 2008-08-12

Guthans Effect... Empty
PostSubject: Re: Guthans Effect...   Guthans Effect... Icon_minitimeTue Sep 16, 2008 12:19 am

Gibbo.. Don't post noneeded tuts.. There is guthan's healing speed already -.-"
Back to top Go down
http://runescape.com
Cookie
Donator
Donator
Cookie


Number of posts : 306
Age : 115
Location : null
Registration date : 2008-08-12

Guthans Effect... Empty
PostSubject: Re: Guthans Effect...   Guthans Effect... Icon_minitimeFri Oct 10, 2008 10:50 am

Lock? Rofl Razz
Back to top Go down
http://runescape.com
Sponsored content





Guthans Effect... Empty
PostSubject: Re: Guthans Effect...   Guthans Effect... Icon_minitime

Back to top Go down
 
Guthans Effect...
Back to top 
Page 1 of 1
 Similar topics
-
» byuing guthans
» SELLING GUTHANS AND Full DHAROKS

Permissions in this forum:You cannot reply to topics in this forum
Code-x :: Mod Zone :: Coding that may help Owner-
Jump to: