Thread: [z508] Jad has only got ranged/mage attack, errors afther I tryed to add melee [z508]

Results 1 to 4 of 4
  1. #1 [z508] Jad has only got ranged/mage attack, errors afther I tryed to add melee [z508] 
    Registered Member

    Join Date
    Jul 2007
    Posts
    268
    Thanks given
    0
    Thanks received
    1
    Rep Power
    101
    [z508] Jad has only got ranged/mage attack, errors afther I tryed to add melee [z508]
    -------------------------------------------------------------------------------------------------------

    Hello,

    I tryed to add jad's third (Melee) attack because it wasnt added in z508 allready.
    I was pretty sure I was going to forget something, and it whould cause errors, but I Thought it be better if I tryed before asking for help

    Here are my errors
    Code:
    Compiling net/com/codeusa/Engine.java
    .\net\com\codeusa\npcs\combat\NpcCombat.java:503: 'else' without 'if'
                                            } else {
                                              ^
    .\net\com\codeusa\npcs\combat\NpcCombat.java:992: 'else' without 'if'
                                    } else {
                                      ^
    Note: .\net\com\codeusa\clanchat\Room.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    2 errors
    Druk op een toets om door te gaan. . .

    Here are my two changes in npccombat.java (whats red is what I added and probbaly is something wrong with, whats yellow is added but doesnt cause errors.):

    Code:
    				case 2745:
    					if (getRandom(1) == 1) {
    						n.requestGFX(1625, 0);
    						n.requestAnim(9276, 0);
    						n.rockAppear = 2;
    						n.farCastDelay = 4;
    						n.switchJadAttack(true, false); /* @param 1 ranged @param 2 mage */
    					} else {
    						n.requestGFX(1626, 100);
    						n.requestAnim(9300, 0);
    						n.projectileShowDelay = 1;
    						n.farCastDelay = 5;
    						n.switchJadAttack(false, true);
    					} else {
    						n.requestAnim(2655, 0);
    						n.farCastDelay = 5;
    						n.switchJadAttack(false, true);
    					}
    					if (p.rangedPrayer) {
    					p.appendNPCHit(0, 0);
    					}
    					if (p.magicPrayer) {
    					p.appendNPCHit(0, 0);
    					}
    					if (p.meleePrayer) {
    					p.appendNPCHit(0, 0);
    					}
    				break;
    and change 2:

    Code:
    			if (n.npcType == 2745) {
    				if (p == null || n == null || n.currentHP <= 0 || p.skillLvl[3] <= 0) {
    					n.farCastDelay = -1;
    					return;
    				}
    				if (n.rangeType) {
    					if (Misc.getDistance(n.absX, n.absY, p.absX, p.absY) <= 12) {
    						if (!p.usingPrayer(18)) {
    							p.requestGFX(157, 0);
    							p.appendNPCHit(getRandom(97), 0);
    						} else {
    							p.appendNPCHit(0, 0);
    						}
    					}	
    				} else {
    					if (!p.usingPrayer(17)) {
    						p.requestGFX(157, 0);
    						p.appendNPCHit(getRandom(97), 0);
    					} else {
    						p.appendNPCHit(0, 0);
    					}
    					n.farCastDelay = -1;
    				} else {
    					if (!p.usingPrayer(19)) {
    						p.appendNPCHit(getRandom(97), 0);
    					} else {
    						p.appendNPCHit(0, 0);
    					}
    					n.farCastDelay = -1;
    				}
    			}
    Im not posting my whole Npccombat file, as z508s npc combat was pretty bad and I made it loads better allready.

    I hope YOU! can help me.

    Thanks for reading.
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Jul 2007
    Posts
    268
    Thanks given
    0
    Thanks received
    1
    Rep Power
    101
    Basicly: how you make an npc has 3 attacks, since Im adding corperal beast to.
    Reply With Quote  
     

  3. #3  
    Registered Member
    The Lizard King's Avatar
    Join Date
    Jun 2008
    Posts
    837
    Thanks given
    13
    Thanks received
    12
    Rep Power
    169
    Dont double post please

    maybe you wana do like this?

    Code:
    if (getRandom(3) == 1) {
    						n.requestGFX(1625, 0);
    						n.requestAnim(9276, 0);
    						n.rockAppear = 2;
    						n.farCastDelay = 4;
    						n.switchJadAttack(true, false); /* @param 1 ranged @param 2 mage */
    					} else if (getRandom(3) == 2) {
    						n.requestGFX(1626, 100);
    						n.requestAnim(9300, 0);
    						n.projectileShowDelay = 1;
    						n.farCastDelay = 5;
    						n.switchJadAttack(false, true);
    					} else if (getRandom(3) == 3){
    						n.requestAnim(2655, 0);
    						n.farCastDelay = 5;
    						n.switchJadAttack(false, true);
    					}
    if random (3) = 1 range, if random (3) = 2 mage, if random (3) = 3, melee?

    but btw jad ONLY should melee if you get to close else it will range, mage swap

    Dono if it works lol just a guess (not good at such stuff)

    500st post wooooop
    Quote Originally Posted by Jim Morrison
    These days, I think you have to be a politician or an assassin to really be a superstar
    Quote Originally Posted by Jim Morrison
    This is the strangest life I've ever known.
    From los angeles california The Doors.
    Reply With Quote  
     

  4. #4  
    Registered Member

    Join Date
    Jul 2007
    Posts
    268
    Thanks given
    0
    Thanks received
    1
    Rep Power
    101
    thanks it fixed one error, and the other one on case 2745:
    I think, hope i can fix that myself, I'll tell you if i cant lol.

    if i get the other one fixed to I rep you.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •