alclient
Version:
A node client for interacting with Adventure Land - The Code MMORPG. This package extends the functionality of 'alclient' by managing a mongo database.
54 lines • 2.24 kB
JavaScript
import { PingCompensatedCharacter } from "./PingCompensatedCharacter.js";
export class Priest extends PingCompensatedCharacter {
ctype = "priest";
async absorbSins(target) {
if (!this.ready)
throw new Error("We aren't ready yet [absorbSins].");
const response = this.getResponsePromise("absorb");
this.socket.emit("skill", { id: target, name: "absorb" });
return response;
}
async curse(target) {
if (!this.ready)
throw new Error("We aren't ready yet [curse].");
const response = this.getResponsePromise("curse");
this.socket.emit("skill", { id: target, name: "curse" });
return response;
}
async darkBlessing() {
if (!this.ready)
throw new Error("We aren't ready yet [darkBlessing].");
const response = this.getResponsePromise("darkblessing");
this.socket.emit("skill", { name: "darkblessing" });
return response;
}
/**
* NOTE: We can't name this function `heal` because of the property `heal` that tells us how much we heal for.
* @param id The ID of the entity or player to heal
*/
async healSkill(id) {
if (!this.ready)
throw new Error("We aren't ready yet [healSkill].");
const response = this.getResponsePromise("heal");
this.socket.emit("heal", { id: id });
return response;
}
async partyHeal() {
if (!this.ready)
throw new Error("We aren't ready yet [partyHeal].");
const response = this.getResponsePromise("partyheal");
this.socket.emit("skill", { name: "partyheal" });
return response;
}
// NOTE: Untested. We might need to increase the timeout?
async revive(target, essenceOfLife = this.locateItem("essenceoflife")) {
if (!this.ready)
throw new Error("We aren't ready yet [revive].");
if (essenceOfLife === undefined)
throw new Error("We don't have any essenceoflife in our inventory.");
const response = this.getResponsePromise("revive");
this.socket.emit("skill", { id: target, name: "revive", num: essenceOfLife });
return response;
}
}
//# sourceMappingURL=Priest.js.map