func void useitpo_mana_03() {
var int manares;
if (self.id == 0) {
snd_play3d(hero, "BOTTLE_OPEN");
rx_restoremana(150);
if (!rx_instantpotions) {
restoremana = true;
sumtempmanares = false;
if (playerissick) {
restoremana_proc = restoremana_proc / 2;
};
restoremana_proc = (hero.attribute[atr_mana_max] /*3*/ * 85) / 100;
if (rx_isvampire()) {
restoremana_proc = (restoremana_proc * 50) / 100;
};
if (rx_roadoftrialsactive()) {
if (rx_getintmaskvalue("RX_RT_DebuffMask", 10) == true) {
restoremana_proc = (restoremana_proc * 50) / 100;
};
};
if (isnewkarmaenabled()) {
if (isnewkarmagiftenabled(64)) {
restoremana_proc = (restoremana_proc * 150) / 100;
};
};
}
else {
manares = 1 + ((self.attribute[atr_mana_max] /*3*/ * 85) / 100);
if (playerissick) {
manares = manares / 2;
};
npc_changeattribute(self, atr_mana, manares);
if (self.attribute[atr_mana] /*2*/ > self.attribute[atr_mana_max] /*3*/) {
self.attribute[atr_mana] /*2*/ = self.attribute[atr_mana_max] /*3*/;
};
};
rx_usedmana3 += 1;
}
else {
manares = 1 + ((self.attribute[atr_mana_max] /*3*/ * 85) / 100);
npc_changeattribute(self, atr_mana, manares);
if (self.attribute[atr_mana] /*2*/ > self.attribute[atr_mana_max] /*3*/) {
self.attribute[atr_mana] /*2*/ = self.attribute[atr_mana_max] /*3*/;
};
};
};