Thread: [317 PI] Soulsplit and Wrath

Results 1 to 4 of 4
  1. #1 [317 PI] Soulsplit and Wrath 
    Registered Member
    Join Date
    Jul 2013
    Posts
    150
    Thanks given
    3
    Thanks received
    4
    Rep Power
    13
    Hello community,

    Soulsplit
    I am wondering how i would add a delay or like a timer to my soulsplit...
    Becuz now it is doing the gfx and heals everyhit if you have hp 99 or less.
    Would could help me i, would love him.
    Already tired to add a delay but didn't work out.

    My code:
    Code:
        public void applySoulSplit(int index, int damage) {
               if (!c.prayerActive[21])
                       return;
               if (Server.playerHandler.players[index] != null) { 
                       final Client c2 = (Client)Server.playerHandler.players[index];
                       final int pX = c.getX();
                       final int pY = c.getY();
                       final int oX = c2.getX();
                       final int oY = c2.getY();
                       int offX = (pY - oY)* -1;
                       int offY = (pX - oX)* -1;
    					if (c.prayerActive[21] && (c.playerLevel[3] <= 99)) {
    						int heal = 2;
    						if (c2.playerLevel[5] <= 0) {
                               c2.playerLevel[5] = 0;
                               c2.getCombat().resetPrayers();
    						}
    						if (c.playerLevel[3] + heal >= c.getPA().getLevelForXP(c.playerXP[3])) {
    							c.playerLevel[3] = c.getPA().getLevelForXP(c.playerXP[3]);
    						} else {
    							c.playerLevel[3] += heal;
    							c2.playerLevel[5] -= 1;
    						}
                            c.getPA().refreshSkill(3);
                            c2.getPA().refreshSkill(5);
                        }
                       c.getPA().createPlayersProjectile(pX, pY, offX, offY, 50, 45, 2263, 31, 31, - c.oldPlayerIndex - 1, 0);
                       c.soulSplitDelay = 4;
                       EventManager.getSingleton().addEvent(new Event() {
                               public void execute(EventContainer s) {
                                       if (c.soulSplitDelay > 0) {
                                               c.soulSplitDelay--;
                                       }
                                       if (c.soulSplitDelay == 3) {
                                               c2.gfx0(2264);
                                       }
                                       if (c.soulSplitDelay == 2) {
                                               int offX2 = (oY - pY)* -1;
                                               int offY2 = (oX - pX)* -1;
                                               c.getPA().createPlayersProjectile(oX, oY, offX2, offY2, 50, 45, 2263, 31, 31, - c.playerId - 1, 0);
                                       }
                                       if (c.soulSplitDelay == 0) {    
                                               s.stop();
                                       }
                               }
                       }, 500);
               }
       }
    Wrath
    I am trying to add like the wrath damage is based on your last hit but that didn't work out aswell...
    My code:
    Code:
    public void initiateWrath() {
    		try {
    			if(!c.inWild())
    				return;
    			int[] xLoc = new int[25];
    			int[] yLoc = new int[25];
    			if(c.prayerActive[22]) {
    				c.gfx0(2259);
    				int x = c.absX - 3;
    				int y = c.absY - 2;
    				for(int i = 0; i < 25; i++) {
    					x++;
    					if(i == 5 || i == 10 || i == 15 || i == 20) {
    						x-=5;
    						y++;
    					}
    					xLoc[i] = x;
    					yLoc[i] = y;
    					c.getPA().createPlayersStillGfx(2260, x, y, c.heightLevel, 25);
    				}
    				for(int playerId = 0; playerId < PlayerHandler.players.length; playerId++) {
    					Player player = PlayerHandler.players[playerId];
    					if(player != null) {
    						if(player.playerName.equalsIgnoreCase(c.playerName))
    							continue;
    						for(int i = 0; i < 25; i++) {
    							if(player.absX == xLoc[i] && player.absY == yLoc[i]) {
    								if(player.inWild()) {
    									Client target = (Client) player;
    									Client c = (Client) Server.playerHandler.players[playerId];;
    									int wrathDamage = c.playerLevel[5]/10 * 3;
    									target.playerLevel[3] -= wrathDamage;
    									target.handleHitMask(wrathDamage);
    									target.getPA().refreshSkill(3);
    									//int damage = c.playerLevel[5]/10 * 3;
    									//target.handleHitMask(damage);
    									//target.dealDamage(damage);
    									target.sendMessage("You are damaged by the plagued death of the player you killed.");
    								}
    							}
    						}
    					}
    				}
    			}
    		} catch (Exception e) {
    			Misc.println("Error initiating the wrath prayer.");
    			e.printStackTrace();
    		}
    	}

    Thanks for helping,
    Reply With Quote  
     

  2. #2  
    anInt69

    Max _'s Avatar
    Join Date
    Feb 2012
    Age
    23
    Posts
    1,814
    Thanks given
    428
    Thanks received
    727
    Rep Power
    599
    public long lastWrath = 0;

    add
    Code:
    lastWrath = System.currentTimeMillis();
    at the end of the prayer.

    Then wrap it around with
    Code:
     if(lastWrath - System.currentTimeMillis() >= TIMEHEREINMILLISECONDS){
    
    }
    [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Jul 2013
    Posts
    150
    Thanks given
    3
    Thanks received
    4
    Rep Power
    13
    I don't want a delay at wrath? I want it to let it damage is based on the last hit, not on the math operator becuz now it keeps hitting u 17even if u hitted 1
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Oct 2012
    Posts
    4,716
    Thanks given
    1,682
    Thanks received
    1,105
    Rep Power
    0
    Quote Originally Posted by MyrChivvon View Post
    I don't want a delay at wrath? I want it to let it damage is based on the last hit, not on the math operator becuz now it keeps hitting u 17even if u hitted 1
    Pretty sure this is not how wrath works on rs

    If this curse is active when a player dies, it deals damage up to 2500% their Prayer level to enemies in a 5x5 square. Note that this curse will not hurt other players outside of PvP areas. This is an enhanced version of Retribution.
    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

Similar Threads

  1. [REQ] 317 Pi source and client
    By arceus in forum Requests
    Replies: 1
    Last Post: 07-27-2014, 07:23 PM
  2. [PI] Retribution and Wrath - 80% complete
    By Kickyamom in forum Snippets
    Replies: 34
    Last Post: 01-10-2014, 05:20 AM
  3. 317 PI client and server
    By killzoz in forum Help
    Replies: 1
    Last Post: 10-19-2012, 11:11 AM
  4. [PI] Retribution and Wrath - 80% complete
    By Kickyamom in forum Tutorials
    Replies: 25
    Last Post: 02-22-2012, 03:46 AM
  5. Replies: 2
    Last Post: 11-13-2011, 10:45 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •