Thread: PI - Dragon Spear + Morrigans Javelins

Results 1 to 4 of 4
  1. #1 PI - Dragon Spear + Morrigans Javelins 
    Registered Member
    Join Date
    Mar 2016
    Posts
    362
    Thanks given
    102
    Thanks received
    24
    Rep Power
    60
    A lot of servers have a terrible dragon spear, so here is a basic one that works.
    Change your special attack for the dragon spear in CombatAssistant to this:
    Code:
    			case 5730: // dragon spear
    			case 11716: // zamorakspear
    			c.startAnimation(1064);
    			c.gfx100(253);
    			c.specDamage = 0.00;
    			if (c.playerIndex > 0 && o1.stunTicks < -4) {
    			o1.stunTicks = 5;
    			o1.sendMessage("You have been stunned!");
    			o1.gfx100(254);
    			}	
    			break;
    Then go to your client.java and in your process() method add:
    Code:
    		if(stunTicks > -5) {
                            stunTicks --;
    			if(stunTicks == 0)
    			{
    			sendMessage("@gre@You are no longer stunned.");
    			}
            	}
    And in player.java add the following:
    Code:
    	public int stunTicks = -4;
    Extremely basic, wrote in a couple minutes.

    Most servers don't have a morrigan javelin special at all.
    For the bleed, it is slightly different. Add this in your combatassistant.java activateSpecial

    Code:
    			case 13879: // Morrigan Javelin
    				c.usingRangeWeapon = true;
    				c.rangeItemUsed = c.playerEquipment[c.playerWeapon];
    				c.lastWeaponUsed = weapon;
    				c.startAnimation(10501);
    				c.gfx0(1836);
    				c.specAccuracy = 2.00;
    				c.specDamage = 1.50;
    				c.hitDelay = 3;
    				c.specEffect = 18;
    				c.projectileStage = 1;
    				c.hitDelay = getHitDelay(c.getItems().getItemName(c.playerEquipment[c.playerWeapon]).toLowerCase());
    				if (c.fightMode == 2)
    				c.attackTimer--;
    				if (c.playerIndex > 0)
    				fireProjectilePlayer();
    				else if (c.npcIndex > 0)
    				fireProjectileNpc();
    			break;
    In combatassistant again in playerdelayed hit under
    Code:
    				if(dropArrows) {
    					c.getItems().dropArrowPlayer();	
    				}
    Add this
    Code:
    				switch (c.specEffect) {
    				case 19:
    				if (damage > 0) {
    				c.javelinDamage = damage;
    				c.javHits = 16;
    				if(c.javelinDamage > 250)
    				c.javelinDamage = 250;
    				}
    				break;
    				}
    This declares the javelinDamage variable and gives the javHits variable 15, which equates to 15 ticks.
    In the client process() method add somewhere:
    Code:
    if(javHits > 0){
    handleJavelin()
    }
    This tells the client to process the handleJavelin() method every tick

    Then add this void somewhere:
    Code:
    	public void handleJavelin()
    			int ripdamage = 0;
    			if(javelinDamage >= 50){
    			ripDamage = 50;
    			}
    			else if(javelinDamage < 50){
    			ripDamage = javelinDamage;
    			}
    			if(javHits == 13 || javHits == 10 || javHits == 7 || javHits == 4 || javHits == 1){
    			handleHitMask(ripdamage, 0, 1, 0, false);
    			dealDamage(ripdamage);
    			javelinDamage = javelinDamage - ripDamage;
    			}
    			javHits -= 1;	
    			if(constitution < 1 || javelinDamage == 0)
    			{
    			javHits = 0;
    			}
    			if(javHits == 0)
    			{
    			sendMessage("@gre@The bleed is no longer affecting you..");
    			} 
    		}
    You will also need to declare the following ints in the Player class
    Code:
    javelinDamage
    javHits
    This will handle the bleeding, declare the damage (0-50) and hit every 3 ticks until 0 ticks or the damage hits 0.
    Improved code is allowed
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Oct 2012
    Posts
    4,710
    Thanks given
    1,679
    Thanks received
    1,105
    Rep Power
    0
    Process..... why are you picking up PIs bad habbits?
    Reply With Quote  
     

  3. #3  
    Respected Member


    Kris's Avatar
    Join Date
    Jun 2016
    Age
    26
    Posts
    3,638
    Thanks given
    820
    Thanks received
    2,642
    Rep Power
    5000
    Quote Originally Posted by _Patrick_ View Post
    Process..... why are you picking up PIs bad habbits?
    ^.
    Basically if you wish to learn how to code in java, you should open up a PI source. A PI source will tell you exactly what not to do.
    Not going to bother explaining what I even mean here, I just posted a reply in your other snippet. It's not an attack against your actual code but rather a suggestion to move on to better grounds, lad.
    Attached image
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Mar 2016
    Posts
    362
    Thanks given
    102
    Thanks received
    24
    Rep Power
    60
    Quote Originally Posted by _Patrick_ View Post
    Process..... why are you picking up PIs bad habbits?
    nvm, most of the kids here don't deserve anything written better
    but nah, i redid this with cycleevents because process was just a 5 minute speed writeup
    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. [PI] Morrigan Javelin Dupe
    By Gershon in forum Help
    Replies: 4
    Last Post: 01-07-2012, 09:53 PM
  2. Replies: 4
    Last Post: 08-28-2010, 10:58 AM
  3. Dragon spear pushes back?
    By myK- in forum Help
    Replies: 59
    Last Post: 01-14-2010, 04:25 AM
  4. Dragon Spear Special Attack
    By Sanity in forum Requests
    Replies: 4
    Last Post: 12-30-2008, 10:23 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
  •