Thread: [HELP] PI Combat

Results 1 to 7 of 7
  1. #1 [HELP] PI Combat 
    Registered Member
    Join Date
    Nov 2014
    Posts
    215
    Thanks given
    0
    Thanks received
    0
    Rep Power
    10
    Hello, I've been around searching for a fix on the weapon swapping on my [pi] server. It's the issue where you switch from dds to dh axe and hit high, iv'e tried this combat fix for [pi] I've also tried putting in delay's for the switching weapon and delays between attack's ect.. nothing seems to be going right i've looked into other servers that i downloaded where they didn't have this issue and tried to fix it like that. I'm not entirely sure how to calculate the hitsplat/xp before the actual hit which could be the problem please if any new information since this occurred if someone could share how to fix this, thank you for your help.


    I've tried using this tutorial
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  2. #2  
    Rune-Server Affiliate
    Jack's Avatar
    Join Date
    Mar 2009
    Posts
    6,852
    Thanks given
    1,823
    Thanks received
    2,558
    Rep Power
    5000
    You need to do anything related to damage calculation prior to the hit landing, that'll fix your issue.
    [Only registered and activated users can see links. ]

    OS-Exile Discord: [Only registered and activated users can see links. ]
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Nov 2014
    Posts
    215
    Thanks given
    0
    Thanks received
    0
    Rep Power
    10
    Quote Originally Posted by Jack View Post
    You need to do anything related to damage calculation prior to the hit landing, that'll fix your issue.
    Where is a good place to start? CombatAssistance ect..?
    Reply With Quote  
     

  4. #4  
    Rune-Server Affiliate
    Jack's Avatar
    Join Date
    Mar 2009
    Posts
    6,852
    Thanks given
    1,823
    Thanks received
    2,558
    Rep Power
    5000
    Quote Originally Posted by scoping king View Post
    Where is a good place to start? CombatAssistance ect..?
    Rewriting the entire thing.
    [Only registered and activated users can see links. ]

    OS-Exile Discord: [Only registered and activated users can see links. ]
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Nov 2014
    Posts
    215
    Thanks given
    0
    Thanks received
    0
    Rep Power
    10
    Quote Originally Posted by Jack View Post
    Rewriting the entire thing.
    I think i actually got it figured out, but rewritting it wouldn't be much of an option for me considering i wouldn't even know where to begin besides the basic stuff in combatassistance.
    Reply With Quote  
     

  6. #6  
    Registered Member 2nubs1cup's Avatar
    Join Date
    Jan 2013
    Posts
    969
    Thanks given
    77
    Thanks received
    88
    Rep Power
    0
    Quote Originally Posted by scoping king View Post
    I think i actually got it figured out, but rewritting it wouldn't be much of an option for me considering i wouldn't even know where to begin besides the basic stuff in combatassistance.
    Honestly if you have a combat system that still does that in 2019 you're better off writing a new combat or using someone else's combat system. But either it has to with your item switch where your strength bonus is not updating on the switch before you use a special attack or you have to fix up your damage calculation. I won't be able to give you a proper answer without seeing code. Post your combat code.
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Nov 2014
    Posts
    215
    Thanks given
    0
    Thanks received
    0
    Rep Power
    10
    Quote Originally Posted by 2nubs1cup View Post
    Honestly if you have a combat system that still does that in 2019 you're better off writing a new combat or using someone else's combat system. But either it has to with your item switch where your strength bonus is not updating on the switch before you use a special attack or you have to fix up your damage calculation. I won't be able to give you a proper answer without seeing code. Post your combat code.
    OK, here is what I have for combat: I believe it only had something to do with Dharoks I'm sure it don't do it with any other item but I could be wrong of course.

    Code:
    public static double calculateBaseDamage(Client c, boolean special) {
    		
    		double base = 0;
    		int attBonus = c.playerBonus[10]; // attack
    		int attack = c.playerLevel[0]; // attack
    		int strength = c.playerLevel[2]; // strength
    		int defBonus = c.playerBonus[10]; // defense
    		int defense = c.playerLevel[1]; // defense
    		int attlvlForXP = c.getLevelForXP(c.playerXP[0]); // attack
    		int strlvlForXP = c.getLevelForXP(c.playerXP[2]); // strength
    		int deflvlForXP = c.getLevelForXP(c.playerXP[1]); // defense
    		int lvlForXP = c.getLevelForXP(c.playerXP[2]);
    		
    		double effective = getEffectiveStr(c);
    		double specialBonus = getSpecialStr(c);
    		double strengthBonus = c.playerBonus[10];
    		
    		base = (13 + effective + (c.getCombat().strBonus / 8) + ((effective * c.getCombat().strBonus) / 64)) / 10;
    		
    		if (EquipmentSet.DHAROK.isWearingBarrows(c)) {
    			base *= ((c.getLevelForXP(c.playerXP[3]) - c.playerLevel[3]) * .01) + 1;
    		}
    
    		if (c.usingSpecial) {
    			base = (base * specialBonus);
    		}
    		if (hasObsidianEffect(c) || hasVoid(c)) {
    			base = (base * 1.2);
    		}		
    		if(c.prayerActive[1]) {
    			strength += (int)(lvlForXP * .05);
    		} else
    		if(c.prayerActive[6]) {
    			strength += (int)(lvlForXP * .1);
    		} else
    		if(c.prayerActive[14]) {
    			strength += (int)(lvlForXP * .15);
    		} else
    		if(c.prayerActive[24]) {
    			strength += (int)(lvlForXP * .18);
    		} else
    		if(c.prayerActive[25]) {
    			strength += (int)(lvlForXP * .23);
    		}
    		return Math.floor(base);
    	}
    	
    	public static double getEffectiveStr(Client c) {
    		return ((c.playerLevel[2]) * getPrayerStr(c)) + getStyleBonus(c);		
    	}
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

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

Similar Threads

  1. HELP!! [Pi] combat formula's
    By kaleb in forum Requests
    Replies: 2
    Last Post: 06-19-2011, 04:24 AM
  2. HELP!! [Pi] combat formula's
    By kaleb in forum Requests
    Replies: 0
    Last Post: 06-18-2011, 06:11 AM
  3. [PI] Combat help - Cant spec
    By Jake1 in forum Help
    Replies: 24
    Last Post: 12-09-2010, 10:36 AM
  4. [PI] Combat help
    By Jake1 in forum Help
    Replies: 4
    Last Post: 09-08-2010, 05:33 PM
  5. [pi] combat problem please help
    By rexz0rd in forum Help
    Replies: 2
    Last Post: 08-01-2010, 10:37 PM
Tags for this Thread

View Tag Cloud

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