Thread: [Pi] PvP Armour - Degrading to (deg)

Results 1 to 5 of 5
  1. #1 [Pi] PvP Armour - Degrading to (deg) 
    Registered Member Skarlett's Avatar
    Join Date
    Apr 2013
    Posts
    405
    Thanks given
    47
    Thanks received
    7
    Rep Power
    13
    Hello --

    So, currently on my project, you could possibly scam players with PvP gear, that is about to break.
    I would like to make it so that with my PvP gears when you take a certain amount of damage (100 damage) it will turned to the (deg) version.
    ♡Lovvveeee♡
    Reply With Quote  
     

  2. #2  
    Registered Member
    Karma_K's Avatar
    Join Date
    Nov 2012
    Posts
    4,283
    Thanks given
    152
    Thanks received
    610
    Rep Power
    108
    Quote Originally Posted by AinProds View Post
    Hello --

    So, currently on my project, you could possibly scam players with PvP gear, that is about to break.
    I would like to make it so that with my PvP gears when you take a certain amount of damage (100 damage) it will turned to the (deg) version.
    how are they doing that when the pvp armor is suppose to save for each player, unless you made it save for each individual item, like how the f did you do that.

    ot: what you requested is somewhat easy, i dont know how your handling your degrading, but yeah. just go to where it handles your degrading and add in like..

    if (c.degrading < 90) {
    delete the item and replace it with the degraded item, also do this for if they're wearing it.
    }
    Reply With Quote  
     

  3. #3  
    Registered Member Skarlett's Avatar
    Join Date
    Apr 2013
    Posts
    405
    Thanks given
    47
    Thanks received
    7
    Rep Power
    13
    Quote Originally Posted by Karma_K View Post
    how are they doing that when the pvp armor is suppose to save for each player, unless you made it save for each individual item, like how the f did you do that.

    ot: what you requested is somewhat easy, i dont know how your handling your degrading, but yeah. just go to where it handles your degrading and add in like..

    if (c.degrading < 90) {
    delete the item and replace it with the degraded item, also do this for if they're wearing it.
    }
    Oh does it save per person? How does the system figure that out though?

    How does it save each little piece, could someone not get like re-scammed for a piece they sold previously?
    ♡Lovvveeee♡
    Reply With Quote  
     

  4. #4  
    Beast

    Join Date
    May 2010
    Posts
    301
    Thanks given
    6
    Thanks received
    27
    Rep Power
    40
    To make it save in characters file use something like this.

    client.java
    public void degradeVls() {
    if (playerEquipment[playerWeapon] == 13899 && vlsLeft < 1) {
    playerEquipment[playerWeapon] = -1;
    playerEquipmentN[playerWeapon] = 0;
    getItems().wearItem(-1, 1, 3);
    sendMessage("Your Vesta longsword crumbles to dust!");
    vlsLeft = 10000;
    }
    }

    public void degradeVSpear() {
    if (playerEquipment[playerWeapon] == 13905 && vSpearLeft < 1) {
    playerEquipment[playerWeapon] = -1;
    playerEquipmentN[playerWeapon] = 0;
    getItems().wearItem(-1, 1, 3);
    sendMessage("Your Vesta spear crumbles to dust!");
    vSpearLeft = 10000;
    }
    }

    public void degradeStat() {
    if (playerEquipment[playerWeapon] == 13902 && statLeft < 1) {
    playerEquipment[playerWeapon] = -1;
    playerEquipmentN[playerWeapon] = 0;
    getItems().wearItem(-1, 1, 3);
    sendMessage("Your Statius warhammer crumbles to dust!");
    statLeft = 10000;
    }
    }

    public void degradeVTop() {// vesta top
    if (playerEquipment[playerChest] == 13887 && vTopLeft < 1) {
    playerEquipment[playerChest] = -1;
    playerEquipmentN[playerChest] = 0;
    getItems().wearItem(-1, 1, playerChest);
    sendMessage("Your Vesta chainbody crumbles to dust!");
    vTopLeft = 10000;
    }
    }

    public void degradeVLegs() {// vesta legs
    if (playerEquipment[playerLegs] == 13893 && vLegsLeft < 1) {
    playerEquipment[playerLegs] = -1;
    playerEquipmentN[playerLegs] = 0;
    getItems().wearItem(-1, 1, playerLegs);
    sendMessage("Your Vesta plateskirt crumbles to dust!");
    vLegsLeft = 10000;
    }
    }

    public void degradeSTop() {// statius top
    if (playerEquipment[playerChest] == 13884 && sTopLeft < 1) {
    playerEquipment[playerChest] = -1;
    playerEquipmentN[playerChest] = 0;
    getItems().wearItem(-1, 1, playerChest);
    sendMessage("Your Statius platebody crumbles to dust!");
    sTopLeft = 10000;
    }
    }

    public void degradeSLegs() {// statius legs
    if (playerEquipment[playerLegs] == 13890 && sLegsLeft < 1) {
    playerEquipment[playerLegs] = -1;
    playerEquipmentN[playerLegs] = 0;
    getItems().wearItem(-1, 1, playerLegs);
    sendMessage("Your Statius platelegs crumbles to dust!");
    sLegsLeft = 10000;
    }
    }

    public void degradeSHelm() {// statius helm
    if (playerEquipment[playerHat] == 13896 && sHelmLeft < 1) {
    playerEquipment[playerHat] = -1;
    playerEquipmentN[playerHat] = 0;
    getItems().wearItem(-1, 1, playerHat);
    sendMessage("Your Statius full helm crumbles to dust!");
    sHelmLeft = 10000;
    }
    }

    public void degradeZHood() {// zuriel hood
    if (playerEquipment[playerHat] == 13864 && zHoodLeft < 1) {
    playerEquipment[playerHat] = -1;
    playerEquipmentN[playerHat] = 0;
    getItems().wearItem(-1, 1, playerHat);
    sendMessage("Your Zuriel hood crumbles to dust!");
    zHoodLeft = 10000;
    }
    }

    public void degradeZTop() {// zuriel hood
    if (playerEquipment[playerChest] == 13858 && zTopLeft < 1) {
    playerEquipment[playerChest] = -1;
    playerEquipmentN[playerChest] = 0;
    getItems().wearItem(-1, 1, playerChest);
    sendMessage("Your Zuriel robe top crumbles to dust!");
    zTopLeft = 10000;
    }
    }

    public void degradeZBottom() {// zuriel hood
    if (playerEquipment[playerLegs] == 13861 && zBottomLeft < 1) {
    playerEquipment[playerLegs] = -1;
    playerEquipmentN[playerLegs] = 0;
    getItems().wearItem(-1, 1, playerLegs);
    sendMessage("Your Zuriel robe bottom crumbles to dust!");
    zBottomLeft = 10000;
    }
    }

    public void degradeZStaff() {// zuriel staff
    if (playerEquipment[playerWeapon] == 13868 && zStaffLeft < 1) {
    playerEquipment[playerWeapon] = -1;
    playerEquipmentN[playerWeapon] = 0;
    getItems().wearItem(-1, 1, 3);
    sendMessage("Your Zuriel staff crumbles to dust!");
    zStaffLeft = 10000;
    }
    }

    public void degradeMBody() {// morrigans body
    if (playerEquipment[playerChest] == 13870 && mBodyLeft < 1) {
    playerEquipment[playerChest] = -1;
    playerEquipmentN[playerChest] = 0;
    getItems().wearItem(-1, 1, playerChest);
    sendMessage("Your Morrigans leather body crumbles to dust!");
    mBodyLeft = 10000;
    }
    }

    public void degradeMChaps() {// morrigans chaps
    if (playerEquipment[playerLegs] == 13873 && mChapsLeft < 1) {
    playerEquipment[playerLegs] = -1;
    playerEquipmentN[playerLegs] = 0;
    getItems().wearItem(-1, 1, playerLegs);
    sendMessage("Your Morrigans chaps crumbles to dust!");
    mChapsLeft = 10000;
    }
    }
    in combatass below
    if(c.crystalBowArrowCount >= 250){
    switch(c.playerEquipment[c.playerWeapon]) {

    case 4223: // 1/10 bow
    c.getItems().wearItem(-1, 1, 3);
    c.sendMessage("Your crystal bow has fully degraded.");
    if(!c.getItems().addItem(4207, 1)) {
    Server.itemHandler.createGroundItem(c, 4207, c.getX(), c.getY(), 1, c.getId());
    }
    c.crystalBowArrowCount = 0;
    break;

    default:
    c.getItems().wearItem(++c.playerEquipment[c.playerWeapon], 1, 3);
    c.sendMessage("Your crystal bow degrades.");
    c.crystalBowArrowCount = 0;
    break;


    }
    }
    }
    add
    if(c.playerEquipment[c.playerWeapon] == 13899) {
    c.vlsLeft -= 1;
    c.degradeVls();
    }
    if(c.playerEquipment[c.playerWeapon] == 13905) {
    c.vSpearLeft -=1;
    c.degradeVSpear();
    }
    if(c.playerEquipment[c.playerChest] == 13858) {
    c.zTopLeft -=1;
    c.degradeZTop();
    }
    if(c.playerEquipment[c.playerLegs] == 13861) {
    c.zBottomLeft -=1;
    c.degradeZBottom();
    }
    if(c.playerEquipment[c.playerWeapon] == 13902){
    c.statLeft -= 1;
    c.degradeStat();
    }
    if(c.playerEquipment[c.playerChest] == 13887) {
    c.vTopLeft -=1;
    c.degradeVTop();
    }
    if(c.playerEquipment[c.playerLegs] == 13893) {
    c.vLegsLeft -=1;
    c.degradeVLegs();
    }
    if(c.playerEquipment[c.playerWeapon] == 13867) {
    c.zStaffLeft -=1;
    c.degradeZStaff();
    }
    if(c.playerEquipment[c.playerHat] == 13864) {
    c.zHoodLeft -=1;
    c.degradeZHood();
    }
    if(c.playerEquipment[c.playerChest] == 13870) {
    c.mBodyLeft -=1;
    c.degradeMBody();
    }
    if(c.playerEquipment[c.playerLegs] == 13873) {
    c.mChapsLeft -=1;
    c.degradeMChaps();
    }
    if(c.playerEquipment[c.playerChest] == 13884) {
    c.sTopLeft -=1;
    c.degradeSTop();
    }
    if(c.playerEquipment[c.playerLegs] == 13890) {
    c.sLegsLeft -=1;
    c.degradeSLegs();
    }
    if(c.playerEquipment[c.playerHat] == 13896) {
    c.sHelmLeft -=1;
    c.degradeSHelm();
    }
    then for saving add in player.java
    public int vlsLeft = 1000;
    public int statLeft = 1000;
    public int vTopLeft = 1000;
    public int vLegsLeft = 1000;
    public int sTopLeft = 1000;
    public int sLegsLeft = 1000;
    public int sHelmLeft = 1000;
    public int zHoodLeft = 1000;
    public int zStaffLeft = 1000;
    public int zTopLeft = 1000;
    public int zBottomLeft = 1000;
    public int mBodyLeft = 1000;
    public int mChapsLeft = 1000;
    public int vSpearLeft = 1000;
    now player save by your other ones
    } else if (token.equals("character-longsword")) {
    p.vlsLeft = Integer.parseInt(token2);
    } else if (token.equals("character-warhammer")) {
    p.statLeft = Integer.parseInt(token2);
    } else if (token.equals("character-spear")) {
    p.vSpearLeft = Integer.parseInt(token2);
    } else if (token.equals("character-chainbody")) {
    p.vTopLeft = Integer.parseInt(token2);
    } else if (token.equals("character-chainskirt")) {
    p.vLegsLeft = Integer.parseInt(token2);
    } else if (token.equals("character-full helm")) {
    p.sHelmLeft = Integer.parseInt(token2);
    } else if (token.equals("character-platebody")) {
    p.sTopLeft = Integer.parseInt(token2);
    } else if (token.equals("character-platelegs")) {
    p.sLegsLeft = Integer.parseInt(token2);
    } else if (token.equals("character-hood")) {
    p.zHoodLeft = Integer.parseInt(token2);
    } else if (token.equals("character-staff")) {
    p.zStaffLeft = Integer.parseInt(token2);
    } else if (token.equals("character-robe top")) {
    p.zTopLeft = Integer.parseInt(token2);
    } else if (token.equals("character-robe bottom")) {
    p.zBottomLeft = Integer.parseInt(token2);
    } else if (token.equals("character-leather body")) {
    p.mBodyLeft = Integer.parseInt(token2);
    } else if (token.equals("character-chaps")) {
    p.mChapsLeft = Integer.parseInt(token2);
    and
    characterfile.write("character-longsword = ", 0, 22);
    characterfile.write(Integer.toString(p.vlsLeft), 0, Integer.toString(p.vlsLeft).length());
    characterfile.newLine();
    characterfile.write("character-warhammer = ", 0, 22);
    characterfile.write(Integer.toString(p.statLeft), 0, Integer.toString(p.statLeft).length());
    characterfile.newLine();
    characterfile.write("character-spear = ", 0, 18);
    characterfile.write(Integer.toString(p.vSpearLeft) , 0, Integer.toString(p.vSpearLeft).length());
    characterfile.newLine();
    characterfile.write("character-chainbody = ", 0, 22);
    characterfile.write(Integer.toString(p.vTopLeft), 0, Integer.toString(p.vTopLeft).length());
    characterfile.newLine();
    characterfile.write("character-chainskirt = ", 0, 23);
    characterfile.write(Integer.toString(p.vLegsLeft), 0, Integer.toString(p.vLegsLeft).length());
    characterfile.newLine();
    characterfile.write("character-full helm = ", 0, 22);
    characterfile.write(Integer.toString(p.sHelmLeft), 0, Integer.toString(p.sHelmLeft).length());
    characterfile.newLine();
    characterfile.write("character-platebody = ", 0, 22);
    characterfile.write(Integer.toString(p.sTopLeft), 0, Integer.toString(p.sTopLeft).length());
    characterfile.newLine();
    characterfile.write("character-platelegs = ", 0, 22);
    characterfile.write(Integer.toString(p.sLegsLeft), 0, Integer.toString(p.sLegsLeft).length());
    characterfile.newLine();
    characterfile.write("character-hood = ", 0, 17);
    characterfile.write(Integer.toString(p.zHoodLeft), 0, Integer.toString(p.zHoodLeft).length());
    characterfile.newLine();
    characterfile.write("character-staff = ", 0, 18);
    characterfile.write(Integer.toString(p.zStaffLeft) , 0, Integer.toString(p.zStaffLeft).length());
    characterfile.newLine();
    characterfile.write("character-robe top = ", 0, 21);
    characterfile.write(Integer.toString(p.zTopLeft), 0, Integer.toString(p.zTopLeft).length());
    characterfile.newLine();
    characterfile.write("character-robe bottom = ", 0, 24);
    characterfile.write(Integer.toString(p.zBottomLeft ), 0, Integer.toString(p.zBottomLeft).length());
    characterfile.newLine();
    characterfile.write("character-leather body = ", 0, 25);
    characterfile.write(Integer.toString(p.mBodyLeft), 0, Integer.toString(p.mBodyLeft).length());
    characterfile.newLine();
    characterfile.write("character-chaps = ", 0, 18);
    characterfile.write(Integer.toString(p.mChapsLeft) , 0, Integer.toString(p.mChapsLeft).length());
    characterfile.newLine();
    Reply With Quote  
     

  5. #5  
    Registered Member Skarlett's Avatar
    Join Date
    Apr 2013
    Posts
    405
    Thanks given
    47
    Thanks received
    7
    Rep Power
    13
    Quote Originally Posted by slimjimm000 View Post
    To make it save in characters file use something like this.
    client.java
    in combatass below
    add
    then for saving add in player.java
    now player save by your other ones
    and
    Ok, GREAT. I had already added all that in there!

    if (c.degrading < 90) {
    delete the item and replace it with the degraded item, also do this for if they're wearing it.
    }
    So how would I go around making it turn into the (deg) version after 100 hits, or if it's easier the first hit?
    ♡Lovvveeee♡
    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. Replies: 0
    Last Post: 06-12-2013, 06:11 AM
  2. [PI] PvP armour/weps dissapear on death
    By Polkaman in forum Help
    Replies: 3
    Last Post: 10-31-2011, 08:29 PM
  3. PVP Armour Degrading [Delta]
    By Xot Tzox in forum Tutorials
    Replies: 38
    Last Post: 05-22-2011, 10:50 AM
  4. [PI] PvP armour bug!
    By Owner godlys in forum Help
    Replies: 4
    Last Post: 04-09-2011, 11:40 AM
  5. [PI] pvp armours looking wrong
    By im slickk in forum Help
    Replies: 5
    Last Post: 11-24-2010, 10:04 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
  •