Need help with adding a new prayer
I've got the prayer added client sided, and the button set to activate prayer 29, but it still seems like it doesn't want to work. The prayer is supposed to heal for 10% of the damage dealt, but it doesn't heal.
I added this code to MeleeExtras.java, MagicExtras.java, RangeExtras.java, and AttackNPC.java:
Code:
public static void applyVamp(Player c, int index, int damage) {
if (c.prayerActive[29] == false) {
return;
} else {
if (damage <= 0) {
return;
} else {
c.gfx0(911);
int heal = damage / 10;
if (c.getHealth().getAmount() > c.getHealth().getMaximum()) {
c.getHealth().reset();
c.getHealth().increase(heal);
c.getPA().refreshSkill(3);
}
}
}
}
This has also been added under applySmite in CombatAssistant.java:
Code:
public void applyVamp(int index, int damage) {
MeleeExtras.applyVamp(c, index, damage);
}
I've also added an extra "500", "95", "29", "Vampirism", "714", "-1", and "false" to make them all 0-29 options, but what I think is happening is it's not recognizing prayer 29.
Code:
public boolean usingPrayer;
public final int[] PRAYER_DRAIN_RATE = { 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500,
500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500 };
public final int[] PRAYER_LEVEL_REQUIRED = { 1, 4, 7, 8, 9, 10, 13, 16, 19, 22, 25, 26, 27, 28, 31, 34, 37, 40, 43,
44, 45, 46, 49, 52, 55, 60, 70, 74, 77, 95 };
public final int[] PRAYER = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29 };
public final String[] PRAYER_NAME = { "Thick Skin", "Burst of Strength", "Clarity of Thought", "Sharp Eye",
"Mystic Will", "Rock Skin", "Superhuman Strength", "Improved Reflexes", "Rapid Restore", "Rapid Heal",
"Protect Item", "Hawk Eye", "Mystic Lore", "Steel Skin", "Ultimate Strength", "Incredible Reflexes",
"Protect from Magic", "Protect from Missiles", "Protect from Melee", "Eagle Eye", "Mystic Might",
"Retribution", "Redemption", "Smite", "Preserve", "Chivalry", "Piety", "Rigour", "Augury", "Vampirism" };
public final int[] PRAYER_GLOW = { 83, 84, 85, 700, 701, 86, 87, 88, 89, 90, 91, 702, 703, 92, 93, 94, 95, 96, 97,
704, 705, 98, 99, 100, 708, 706, 707, 710, 712, 714 };
public boolean isSelectingQuickprayers = false;
public final int[] PRAYER_HEAD_ICONS = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 1, 0,
-1, -1, 3, 5, 4, -1, -1, -1, -1, -1, -1 };
public boolean[] prayerActive = { false, false, false, false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false, false, false, false, false, false, false, false,
false, false, false, false };
EDIT: This is Ascend source
I've figured out that it's not what I thought earlier, it's something else. When attacking myself on another character, it does the gfx, but it doesn't heal me.
I've figured out that it doesn't like this check for current hp, I've removed it and it's working now.