Thread: Vengeance Against Npc's Snippet

Results 1 to 10 of 10
  1. #1 Vengeance Against Npc's Snippet 
    Registered Member
    Join Date
    Jul 2011
    Posts
    158
    Thanks given
    4
    Thanks received
    7
    Rep Power
    14


    This new method goes into NPCHandler.java :
    Code:
    /**
    	@param c , the Client , the player that got hit.
    	@param i , the NPC that hit the player and will receive the rebound damage.
    	@param damage , the damage the NPC has dealt to the player.
    	*/
    	public void appendNPCVeng(Client c, int i, int damage) {
    		if (damage <= 0)
    			return;
    		c.forcedText = "Taste Vengeance!";
    		c.forcedChatUpdateRequired = true;
    		c.updateRequired = true;
    		c.vengOn = false;
    		if ((c.playerLevel[3] - damage) > 0) {
    			int rebound = (int)(damage*0.75);
    			if (rebound > npcs[i].HP) {
    				rebound = npcs[i].HP;
    			}
    			npcs[i].HP -= rebound;
    			npcs[i].hitDiff2 = rebound;
    			npcs[i].hitUpdateRequired2 = true;
    		}
    		npcs[i].updateRequired = true;
    	}
    And now to call that method directly from where the NPC deals damage to the player...
    In the NPCHandler class go to the applyDamage method.
    Go to the end of that method and you should see a line of code that lowers the players HP by the damage calculated in that method...
    ( the line is c.playerLevel[3] -= damage; )

    After that line we are going to call our new method if the player's vengeance is on , so we have to use an IF - statement like so :
    Code:
    				if (c.vengOn) {
    					appendNPCVeng(c, i, damage);
    				}
    and that should do it.

    NOTE
    You still have to add a way to activate Vengeance in your source.
    There are tutorials for the lunar interface out there , but the method used to activate vengeance is : ( has to be added in clickingButtons class )
    Code:
    			case xxxx:
    				if (c.playerLevel[6] >= 94){
    					if (System.currentTimeMillis() - c.lastVeng > 30000) {                      
    						if (c.getItems().playerHasItem(557,10) && c.getItems().playerHasItem(9075,4) && c.getItems().playerHasItem(560,2)) {
    							c.vengOn = true;
    							c.lastVeng = System.currentTimeMillis();
    							c.startAnimation(4410);
    							.getItems().deleteItem(557,c.getItems().getItemSlot(557),10);
    							c.getItems().deleteItem(560,c.getItems().getItemSlot(560),2);
    							c.getItems().deleteItem(9075,c.getItems().getItemSlot(9075),4);
    						} else {
    							c.sendMessage("You don't have the runes required to cast this spell.");
    						}
    		
    					} else {
    						c.sendMessage("You must wait 30 seconds before casting Vengeance again.");
    					}
    				} else {
    					c.sendMessage("Your magic level isn't high enough to cast this spell."); 
    				}
    			break;
    Done
    If you saw this on another site that rhymes with bune bocus.
    I posted this on there as-well.
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  2. #2  
    Banned
    Join Date
    Aug 2011
    Posts
    113
    Thanks given
    21
    Thanks received
    65
    Rep Power
    0
    Fail this was already released.
    Reply With Quote  
     

  3. #3  
    Registered Member

    Join Date
    May 2011
    Age
    27
    Posts
    1,765
    Thanks given
    379
    Thanks received
    514
    Rep Power
    222
    Gj, and Lmfao @ your signature.
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Jul 2011
    Posts
    158
    Thanks given
    4
    Thanks received
    7
    Rep Power
    14
    Lol
    He trolls all my topics he's a wannabemod, or just likes riding my dick.
    Yeah it was released by me..
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  5. #5  
    Banned
    Join Date
    Jul 2011
    Posts
    293
    Thanks given
    3
    Thanks received
    1
    Rep Power
    0
    Bump
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Jul 2011
    Posts
    158
    Thanks given
    4
    Thanks received
    7
    Rep Power
    14
    Bump
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  7. #7  
    The One And Only

    01053's Avatar
    Join Date
    Apr 2011
    Age
    25
    Posts
    2,888
    Thanks given
    416
    Thanks received
    884
    Rep Power
    856
    Nice although i already had this. /:


    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Jul 2011
    Posts
    158
    Thanks given
    4
    Thanks received
    7
    Rep Power
    14
    ^ Thanks
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  9. #9  
    Banned

    Join Date
    Mar 2011
    Posts
    4,064
    Thanks given
    194
    Thanks received
    689
    Rep Power
    0
    Quote Originally Posted by Mete View Post
    Go to [Only registered and activated users can see links. ] and search for "metes rsps" giving admin for first joiner.


    ot: common sense, but gj i suppose
    Reply With Quote  
     

  10. #10  
    Registered Member
    Join Date
    Jul 2011
    Posts
    158
    Thanks given
    4
    Thanks received
    7
    Rep Power
    14
    Thanks,
    Just trying to help new people
    [Only registered and activated users can see links. ]
    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] Vengeance on NPC's
    By Cheetos in forum Snippets
    Replies: 11
    Last Post: 06-04-2011, 12:56 AM
  2. Replies: 1
    Last Post: 05-06-2011, 02:38 AM
  3. Replies: 2
    Last Post: 01-05-2011, 09:48 PM
  4. vengeance on npc's
    By Grim Raper in forum Configuration
    Replies: 13
    Last Post: 02-14-2009, 06:16 PM
  5. Replies: 21
    Last Post: 02-29-2008, 10:17 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
  •