Thread: [FIXED]100% Vengeance[/FIXED]

Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1 [FIXED]100% Vengeance[/FIXED] 
    Registered Member

    Join Date
    May 2008
    Posts
    972
    Thanks given
    0
    Thanks received
    9
    Rep Power
    234
    Ok, I managed to make the person actually casting the spell say "Taste Vengeance".
    I also fixed the hitting constantly thing.



    Difficulty: 2/10? Maybe... :/

    Assumed Knowledge: C&P, Where to put stuff.

    Tested Server: Pali's 508.

    Files/Classes Modified: ActionButtons.java, PlayerCombat.java, Player.java

    Procedure
    Step One:
    Declare these in Player.java
    Code:
    public long lastVeng;
    public boolean vengOn = false;
    Step Two:
    Add this in ActionButtons.java
    Code:
    case 430:
    if(buttonId == 14) {
    if(p.skillLvl[6] >= 94) {
     if (Engine.playerItems.invItemCount(p, 557) > 10 && Engine.playerItems.invItemCount(p, 560) > 2 && Engine.playerItems.invItemCount(p, 9075) > 4) {
    if(!p.vengOn) {
    if(System.currentTimeMillis() - p.lastVeng >= 30000) {
    p.requestAnim(4410, 0);
    p.requestGFX(726, 0);
    p.vengOn = true;
    p.lastVeng = System.currentTimeMillis();
    Engine.playerItems.deleteItem(p, 557, Engine.playerItems.getItemSlot(p, 557), 10);
    Engine.playerItems.deleteItem(p, 560, Engine.playerItems.getItemSlot(p, 560), 2);
    Engine.playerItems.deleteItem(p, 9075, Engine.playerItems.getItemSlot(p, 9075), 4);
    }
    else {
    p.frames.sendMessage(p, "You can only cast vengeance spells every 30 seconds.");
    }
    }
    else {
    p.frames.sendMessage(p, "You already have vengeance casted.");
    }
    }
    else {
    p.frames.sendMessage(p, "You don't have enough runes to cast this spell.");
    }
    }
    else {
    p.frames.sendMessage(p, "You need a magic level of 94 to cast this spell.");
    }
    }
    break;
    Step Three: In PlayerCombat.java replace your appendHit method with this:
    Search for
    Code:
    if(p.attackStyle == 0) {
    Above that you should see
    Code:
                    		if (Defence(p)) {
    		p2.appendHit(hitDamage, 0);
    		} else {
    		p2.appendHit(0, 0);
    		}
    Now replace
    Code:
    		p2.appendHit(hitDamage, 0);
    with
    Code:
           if(p2.vengOn) {
    		p.appendHit((int)((hitDamage/4)*3), 0);
    		p2.chatText = "Taste Vengeance!";
            p2.chatTextUpdateReq = true;
            p.updateReq = true;
    		p2.vengOn = false;
    		}
            p2.appendHit(hitDamage, 0);
    Here's the maxMeleeHit method if you don't have it:
    Code:
        public int maxMeleeHit(Player p) {
    		int a = p.skillLvl[2];
    		int b = p.equipmentBonus[10];
    		double c = (double)a;
    		double d = (double)b;
    		double f = 0;
    		double h = 0;
    		f = (d*0.00175)+0.1;
    		h = Math.floor(c*f+2.05);
    		return (int) h;
    	}
    Credits: Me, Skiiii and ofc. Pali.

    EDIT: RUNES/LEVEL REQUIREMENTS ADDED BY REQUEST OF JONAS [/QUOTE]

    Code:
    Support Rule-12:http://tinyurl.com/supportsig
    Reply With Quote  
     

  2. #2  
    Registered Member sure im crazy's Avatar
    Join Date
    Jan 2009
    Age
    29
    Posts
    539
    Thanks given
    25
    Thanks received
    7
    Rep Power
    10
    Nice but i wont use.
    No signature no problem.
    Reply With Quote  
     

  3. #3  
    Registered Member Dr Satan's Avatar
    Join Date
    Mar 2008
    Posts
    286
    Thanks given
    0
    Thanks received
    1
    Rep Power
    16
    very nice man
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Jul 2008
    Age
    28
    Posts
    5,827
    Thanks given
    1,301
    Thanks received
    197
    Rep Power
    0
    i lol'd at this,
    Code:
    case 430:
    if(buttonId == 14) {
    if(p.skillLvl[6] >= 94) {
     if (Engine.playerItems.invItemCount(p, 557) > 10 && Engine.playerItems.invItemCount(p, 560) > 2 && Engine.playerItems.invItemCount(p, 9075) > 4) {
    if(!p.vengOn) {
    if(System.currentTimeMillis() - p.lastVeng >= 30000) {
    p.requestAnim(4410, 0);
    p.requestGFX(726, 0);
    p.vengOn = true;
    p.lastVeng = System.currentTimeMillis();
    Engine.playerItems.deleteItem(p, 557, Engine.playerItems.getItemSlot(p, 557), 10);
    Engine.playerItems.deleteItem(p, 560, Engine.playerItems.getItemSlot(p, 560), 2);
    Engine.playerItems.deleteItem(p, 9075, Engine.playerItems.getItemSlot(p, 9075), 4);
    }
    else {
    p.frames.sendMessage(p, "You can only cast vengeance spells every 30 seconds.");
    }
    }
    else {
    p.frames.sendMessage(p, "You already have vengeance casted.");
    }
    }
    else {
    p.frames.sendMessage(p, "You don't have enough runes to cast this spell.");
    }
    }
    else {
    p.frames.sendMessage(p, "You need a magic level of 94 to cast this spell.");
    }
    }
    break;
    please learn conventions. Try making that into only one if statement..
    Reply With Quote  
     

  5. #5  
    Donator

    iZAjz's Avatar
    Join Date
    Mar 2007
    Age
    29
    Posts
    3,675
    Thanks given
    105
    Thanks received
    47
    Rep Power
    1882
    Code:
    		case 430:
    				if(buttonId == 14) {
    				if(p.skillLvl[6] >= 94) {
    			if (Engine.playerItems.invItemCount(p, 557) > 10 && Engine.playerItems.invItemCount(p, 560) > 2 && Engine.playerItems.invItemCount(p, 9075) > 4) {
    			if(!p.vengOn) {
    			if(System.currentTimeMillis() - p.lastVeng >= 30000) {
    				p.requestAnim(4410, 0);
    				p.requestGFX(726, 0);
    				p.vengOn = true;
    				p.lastVeng = System.currentTimeMillis();
    			Engine.playerItems.deleteItem(p, 557, Engine.playerItems.getItemSlot(p, 557), 10);
    			Engine.playerItems.deleteItem(p, 560, Engine.playerItems.getItemSlot(p, 560), 2);
    			Engine.playerItems.deleteItem(p, 9075, Engine.playerItems.getItemSlot(p, 9075), 4);
    				}
    				else {
    					p.frames.sendMessage(p, "You can only cast vengeance spells every 30 seconds.");
    					}
    				}
    				else {
    					p.frames.sendMessage(p, "You already have vengeance casted.");
    				}
    					}
    				else {
    					p.frames.sendMessage(p, "You don't have enough runes to cast this spell.");
    					}
    				}
    				else {
    					p.frames.sendMessage(p, "You need a magic level of 94 to cast this spell.");
    					}
    			}
    					break;
    Doesnt this looks better (A)
    Reply With Quote  
     

  6. #6  
    Registered Member

    Join Date
    Mar 2008
    Posts
    2,072
    Thanks given
    21
    Thanks received
    74
    Rep Power
    1841
    Lol, yep xgtest.
    Reply With Quote  
     

  7. #7  
    Registered Member
    Santaher0's Avatar
    Join Date
    Sep 2008
    Posts
    2,033
    Thanks given
    324
    Thanks received
    49
    Rep Power
    1282
    why using conventions it only looks nicer as long as you know what the code means it doesn't have to be a code with conventions.
    @cubsmiles:I'm gonna use this thanx
    - Support my project ArkScape

    - Santaher0's MusicBot

    - Santaher0's MovieBot
    Reply With Quote  
     

  8. #8  
    Donator

    iZAjz's Avatar
    Join Date
    Mar 2007
    Age
    29
    Posts
    3,675
    Thanks given
    105
    Thanks received
    47
    Rep Power
    1882
    Quote Originally Posted by Santaher0 View Post
    why using conventions it only looks nicer as long as you know what the code means it doesn't have to be a code with conventions.
    @cubsmiles:I'm gonna use this thanx
    It shows your pro and ownage. (lol)

    Naw but it looks nicer and better readable for starters.

    Altough if you dont release your source you can keep it how you want it.
    Reply With Quote  
     

  9. #9  
    Registered Member
    Santaher0's Avatar
    Join Date
    Sep 2008
    Posts
    2,033
    Thanks given
    324
    Thanks received
    49
    Rep Power
    1282
    Quote Originally Posted by xGTest View Post
    It shows your pro and ownage. (lol)

    Naw but it looks nicer and better readable for starters.

    Altough if you dont release your source you can keep it how you want it.
    yea you right about its cleaner to read for starters
    - Support my project ArkScape

    - Santaher0's MusicBot

    - Santaher0's MovieBot
    Reply With Quote  
     

  10. #10  
    Registered Member
    Ninja assassin's Avatar
    Join Date
    Oct 2008
    Posts
    1,961
    Thanks given
    217
    Thanks received
    115
    Rep Power
    77
    great! you can also fix venge other?
    Reply With Quote  
     

Page 1 of 2 12 LastLast

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
  •