Thread: Working veng For Bulby

Results 1 to 5 of 5
  1. #1 Working veng For Bulby 
    Dutch Knight
    Explorz's Avatar
    Join Date
    Feb 2008
    Age
    27
    Posts
    519
    Thanks given
    10
    Thanks received
    6
    Rep Power
    90
    Title says

    if you could help my please do it.

    Repped
     

  2. #2  
    5simple5
    Guest
    Please. I've already tried implementing Vengance from the Tutorial but it doesn't hit. I need this working too!
     

  3. #3  
    Registered Member Carl owns's Avatar
    Join Date
    Apr 2007
    Posts
    229
    Thanks given
    0
    Thanks received
    4
    Rep Power
    12
    Well, this is what ive got and it works fine for me:

    Declare these in Player.java

    Code:
        /**
         * veng.
         */
        public long lastVeng;
        public boolean vengOn = false;
    Save and close.

    In Actionbuttons.java, search for
    Code:
    case 430
    in case 430, add this:

    Code:
    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, 100);
    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.");
    }
    }
    Save and close.

    Replace your appendhit method with this:

    Code:
            int hitDamage = Misc.random(maxMeleeHit(p));
                    if(p2.vengOn) {
    		p.appendHit((int)((hitDamage/4)*3), 0);
    		p2.chatText = "Taste Vengeance!";
                   p.chatTextUpdateReq = true;
                    p.updateReq = true;
    		p2.vengOn = false;
    		}
            p2.appendHit(hitDamage, 0);
    Here, for example is mine:

    Code:
            if(p2.vengOn) {
    		p.appendHit((int)((hitDamage/4)*3), 0);
    		p2.chatText = "Taste Vengeance!";
            p2.chatTextUpdateReq = true;
            p.updateReq = true;
    		p2.vengOn = false;
    		}
                    if(rangedAtk > rangedDef) {
                    p2.appendHit(hitDamage, 0);
                    } else {
    		p2.appendHit(0, 0);
    		}
    Here is the maxMeleeHit method if you dont 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;
    	}
    That should work. Hope i helped.
     

  4. #4  
    Dutch Knight
    Explorz's Avatar
    Join Date
    Feb 2008
    Age
    27
    Posts
    519
    Thanks given
    10
    Thanks received
    6
    Rep Power
    90
    Quote Originally Posted by Carl owns View Post
    Well, this is what ive got and it works fine for me:

    Declare these in Player.java

    Code:
        /**
         * veng.
         */
        public long lastVeng;
        public boolean vengOn = false;
    Save and close.

    In Actionbuttons.java, search for
    Code:
    case 430
    in case 430, add this:

    Code:
    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, 100);
    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.");
    }
    }
    Save and close.

    Replace your appendhit method with this:

    Code:
            int hitDamage = Misc.random(maxMeleeHit(p));
                    if(p2.vengOn) {
    		p.appendHit((int)((hitDamage/4)*3), 0);
    		p2.chatText = "Taste Vengeance!";
                   p.chatTextUpdateReq = true;
                    p.updateReq = true;
    		p2.vengOn = false;
    		}
            p2.appendHit(hitDamage, 0);
    Here, for example is mine:

    Code:
            if(p2.vengOn) {
    		p.appendHit((int)((hitDamage/4)*3), 0);
    		p2.chatText = "Taste Vengeance!";
            p2.chatTextUpdateReq = true;
            p.updateReq = true;
    		p2.vengOn = false;
    		}
                    if(rangedAtk > rangedDef) {
                    p2.appendHit(hitDamage, 0);
                    } else {
    		p2.appendHit(0, 0);
    		}
    Here is the maxMeleeHit method if you dont 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;
    	}
    That should work. Hope i helped.
    Thanks for trying but id don't help if i put it in i get this:



    Even't without veng
    Only by clicking on the player the get hitted (anywhere they are.
     

  5. #5  
    Codex
    Rowan's Avatar
    Join Date
    Sep 2008
    Age
    25
    Posts
    1,593
    Thanks given
    0
    Thanks received
    20
    Rep Power
    1092
    Quote Originally Posted by rohafin View Post
    Title says

    if you could help my please do it.

    Repped
    In player.java add:
    Code:
    public long lastVeng;
    public boolean vengOn = false;
    in actionbuttons.java add:
    Code:
    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.");
    }
    }
    beneath it remove the actionbutton == 14 or u will constantly be able to do the emote (because if u keep it there, u'll have 2 sorts of veng..1 working and 1 for the emote)

    in playercombat.java replace somewhere around sentence 285 (ctrl + g)
    the sentence: p2.appendHit(hitDamage, 0);
    with:
    Code:
            if(p2.vengOn) {
    		p.appendHit((int)((hitDamage/4)*3), 0);
    		p2.chatText = "Taste Vengeance!";
            p.chatTextUpdateReq = true;
            p.updateReq = true;
    		p2.vengOn = false;
    		}
            p2.appendHit(hitDamage, 0);
    can't find the sentence? its above if(p.attackStyle == 0) {
    [Only registered and activated users can see links. ] - [Only registered and activated users can see links. ] - [Only registered and activated users can see links. ] - [Only registered and activated users can see links. ] - [Only registered and activated users can see links. ]
     


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
  •