Thread: Rune Crossbow random special

Results 1 to 9 of 9
  1. #1 Rune Crossbow random special 
    Registered Member

    Join Date
    Aug 2008
    Posts
    2,823
    Thanks given
    362
    Thanks received
    448
    Rep Power
    965
    I've tried to add this and my hit does not change even though I'm using hitDiff = blahblahblah; Anyone know how to either fix that or just remove the hit altogether so I can add a getHitManager().addHit(AttackingOn, misc.random(cbowhit), 1); without the original hit? Here is my code so far:
    Code:
    if(playerEquipment[playerWeapon] == 837 && playerEquipment[playerArrows] == 881){
    int cbowhit = maxRangeHit()*2;
    if(playerEquipment[playerWeapon] == 837 && playerEquipment[playerArrows] == 881){
    hitDiff = misc.random(cbowhit);
    if(AttackingOn2 != null){
    EnemyX = PlayerHandler.players[AttackingOn].absX;
    EnemyY = PlayerHandler.players[AttackingOn].absY;
    }
    hitDiff = misc.random(cbowhit);
    int offsetX = (absY - EnemyY) * -1;
    int offsetY = (absX - EnemyX) * -1;
    CreateProjectile(absY, absX, offsetY, offsetX, 50, 95, 26, 43, 31, AttackingOn+1);
    stillgfx(346, AttackingOn2.absY, AttackingOn2.absX);
    sM("Your bolt rips through your enemy's defence!");
    //getHitManager().addHit(AttackingOn, misc.random(cbowhit), 1);
    }
    hitDiff = misc.random(cbowhit);
    
    }
    P.S. I know it's not neat so don't comment on that
    Reply With Quote  
     

  2. #2  
    Extreme Donator

    Wolf's Avatar
    Join Date
    Jul 2006
    Age
    34
    Posts
    398
    Thanks given
    0
    Thanks received
    2
    Rep Power
    177
    Uh well.... You have the actual damage being created, but you don't have it being updated on the target, and from the looks of it, the target is another Player?

    Bear in mind, when damage is done, the targeted entity needs to have 2 updates called, hitupdate and standard update:
    Code:
    hitUpdateRequired = true;
    updateRequired = true;

    RuneCMS member / Early Sythe member
    RS-Server ex-admin [Member #38]
    Dodian ex-admin / developer
    SRL Developer
    MITB member

    Project16/Flight creator
    Reply With Quote  
     

  3. #3  
    Registered Member

    Join Date
    Aug 2008
    Posts
    2,823
    Thanks given
    362
    Thanks received
    448
    Rep Power
    965
    Hmmm, I'll try and see if it fixes
    Reply With Quote  
     

  4. #4  
    Registered Member

    Join Date
    Aug 2008
    Posts
    2,823
    Thanks given
    362
    Thanks received
    448
    Rep Power
    965
    Nope, oh well
    Reply With Quote  
     

  5. #5  
    Extreme Donator

    Wolf's Avatar
    Join Date
    Jul 2006
    Age
    34
    Posts
    398
    Thanks given
    0
    Thanks received
    2
    Rep Power
    177
    Post your new code after you've added the hitupdate and standard update.

    RuneCMS member / Early Sythe member
    RS-Server ex-admin [Member #38]
    Dodian ex-admin / developer
    SRL Developer
    MITB member

    Project16/Flight creator
    Reply With Quote  
     

  6. #6  
    Registered Member

    Join Date
    Aug 2008
    Posts
    2,823
    Thanks given
    362
    Thanks received
    448
    Rep Power
    965
    Code:
    if(playerEquipment[playerWeapon] == 837 && playerEquipment[playerArrows] == 881){
    int cbowhit = maxRangeHit()*2;
    if(playerEquipment[playerWeapon] == 837 && playerEquipment[playerArrows] == 881){
    if(AttackingOn2 != null){
    EnemyX = PlayerHandler.players[AttackingOn].absX;
    EnemyY = PlayerHandler.players[AttackingOn].absY;
    }
    int offsetX = (absY - EnemyY) * -1;
    int offsetY = (absX - EnemyX) * -1;
    CreateProjectile(absY, absX, offsetY, offsetX, 50, 95, 26, 43, 31, AttackingOn+1);
    stillgfx(346, AttackingOn2.absY, AttackingOn2.absX);
    sM("Your bolt rips through your enemy's defence!");
    }
    AttackingOn2.hitUpdateRequired = true;
    AttackingOn2.updateRequired = true;
    hitDiff = misc.random(cbowhit);
    }
    Reply With Quote  
     

  7. #7  
    Banned
    Join Date
    May 2009
    Posts
    1,220
    Thanks given
    4
    Thanks received
    61
    Rep Power
    0
    make that a new void. Call it ranSpec().

    In your range void type this
    Code:
    if (Misc.random(10) < 8) {
    ranSpec();
    }
    
    make cbowhit a public int and make it hitDiff + misc.random(maxRangeHit()*2);
    Idk if this will work, looks good though.
    Reply With Quote  
     

  8. #8  
    Extreme Donator

    Wolf's Avatar
    Join Date
    Jul 2006
    Age
    34
    Posts
    398
    Thanks given
    0
    Thanks received
    2
    Rep Power
    177
    Code:
    AttackingOn2.hitUpdateRequired = true;
    AttackingOn2.updateRequired = true;
    Those should come after the damage has been made, not before, otherwise you'd be updating the target for no reason.

    Put this before the updates:
    Code:
    hitDiff = misc.random(cbowhit);

    RuneCMS member / Early Sythe member
    RS-Server ex-admin [Member #38]
    Dodian ex-admin / developer
    SRL Developer
    MITB member

    Project16/Flight creator
    Reply With Quote  
     

  9. #9  
    Registered Member

    Join Date
    Aug 2008
    Posts
    2,823
    Thanks given
    362
    Thanks received
    448
    Rep Power
    965
    It shows a double hit, the hit from before and the hit now and takes the damage from the current hit...
    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
  •