mirror of
https://github.com/gooba42/adventureland.git
synced 2026-10-14 10:33:47 -05:00
Merge pull request #222 from FreezePhoenix/patch-17
Pass the target parameter to consume_mp for more skills
This commit is contained in:
+8
-8
@@ -8571,7 +8571,7 @@ function init_io() {
|
|||||||
xy_emit(player, "disappear", { id: player.id, invis: true, reason: "invis" });
|
xy_emit(player, "disappear", { id: player.id, invis: true, reason: "invis" });
|
||||||
player.to_resend = " ";
|
player.to_resend = " ";
|
||||||
} else if (data.name == "pickpocket") {
|
} else if (data.name == "pickpocket") {
|
||||||
consume_mp(player, gSkill.mp);
|
consume_mp(player, gSkill.mp, target);
|
||||||
player.c[data.name] = {
|
player.c[data.name] = {
|
||||||
ms: gSkill.duration_min + Math.random() * (gSkill.duration_max - gSkill.duration_min),
|
ms: gSkill.duration_min + Math.random() * (gSkill.duration_max - gSkill.duration_min),
|
||||||
target: target.name,
|
target: target.name,
|
||||||
@@ -8991,12 +8991,12 @@ function init_io() {
|
|||||||
} else if (data.name == "absorb") {
|
} else if (data.name == "absorb") {
|
||||||
var ids = [];
|
var ids = [];
|
||||||
if (is_same(player, target, 1)) {
|
if (is_same(player, target, 1)) {
|
||||||
consume_mp(player, gSkill.mp);
|
consume_mp(player, gSkill.mp, target);
|
||||||
} else {
|
} else {
|
||||||
if (player.mp < gSkill.mp * 6 || player.level < 75) {
|
if (player.mp < gSkill.mp * 6 || player.level < 75) {
|
||||||
return socket.emit("game_response", { response: "non_friendly_target", place: data.name, failed: true });
|
return socket.emit("game_response", { response: "non_friendly_target", place: data.name, failed: true });
|
||||||
}
|
}
|
||||||
consume_mp(player, gSkill.mp * 6);
|
consume_mp(player, gSkill.mp * 6, target);
|
||||||
if (Math.random() < 0.95) {
|
if (Math.random() < 0.95) {
|
||||||
consume_skill(player, data.name);
|
consume_skill(player, data.name);
|
||||||
resend(player, "u+cid");
|
resend(player, "u+cid");
|
||||||
@@ -9086,7 +9086,7 @@ function init_io() {
|
|||||||
xy_emit(player, "ui", { type: "huntersmark", name: player.name, id: target.id });
|
xy_emit(player, "ui", { type: "huntersmark", name: player.name, id: target.id });
|
||||||
player.to_resend = "u+cid";
|
player.to_resend = "u+cid";
|
||||||
} else if (data.name == "charm") {
|
} else if (data.name == "charm") {
|
||||||
consume_mp(player, gSkill.mp);
|
consume_mp(player, gSkill.mp, target);
|
||||||
if (Math.random() > player.a.charm.attr0 / 100) {
|
if (Math.random() > player.a.charm.attr0 / 100) {
|
||||||
socket.emit("game_response", "charm_failed");
|
socket.emit("game_response", "charm_failed");
|
||||||
xy_emit(player, "ui", { type: "charm", name: player.name, id: target.id, fail: true });
|
xy_emit(player, "ui", { type: "charm", name: player.name, id: target.id, fail: true });
|
||||||
@@ -9151,7 +9151,7 @@ function init_io() {
|
|||||||
resolve = c_resolve;
|
resolve = c_resolve;
|
||||||
}
|
}
|
||||||
} else if (data.name == "magiport") {
|
} else if (data.name == "magiport") {
|
||||||
consume_mp(player, gSkill.mp);
|
consume_mp(player, gSkill.mp, target);
|
||||||
if (!is_pvp && mode.pve_safe_magiports) {
|
if (!is_pvp && mode.pve_safe_magiports) {
|
||||||
if (!magiportations[player.name]) {
|
if (!magiportations[player.name]) {
|
||||||
magiportations[player.name] = {};
|
magiportations[player.name] = {};
|
||||||
@@ -9222,7 +9222,7 @@ function init_io() {
|
|||||||
player.to_resend = "u+cid";
|
player.to_resend = "u+cid";
|
||||||
// #TODO: Appear animation for non-self's [21/05/18]
|
// #TODO: Appear animation for non-self's [21/05/18]
|
||||||
} else if (data.name == "mluck") {
|
} else if (data.name == "mluck") {
|
||||||
consume_mp(player, gSkill.mp);
|
consume_mp(player, gSkill.mp, target);
|
||||||
if (
|
if (
|
||||||
!target.s[gSkill.condition] ||
|
!target.s[gSkill.condition] ||
|
||||||
!target.s[gSkill.condition].strong ||
|
!target.s[gSkill.condition].strong ||
|
||||||
@@ -9237,7 +9237,7 @@ function init_io() {
|
|||||||
resend(target, "u+cid");
|
resend(target, "u+cid");
|
||||||
resend(player, "u+cid");
|
resend(player, "u+cid");
|
||||||
} else if (data.name == "rspeed") {
|
} else if (data.name == "rspeed") {
|
||||||
consume_mp(player, gSkill.mp);
|
consume_mp(player, gSkill.mp, target);
|
||||||
target.s[gSkill.condition] = { ms: G.conditions.rspeed.duration, f: player.name };
|
target.s[gSkill.condition] = { ms: G.conditions.rspeed.duration, f: player.name };
|
||||||
xy_emit(player, "ui", { type: "rspeed", from: player.name, to: target.name });
|
xy_emit(player, "ui", { type: "rspeed", from: player.name, to: target.name });
|
||||||
resend(target, "u+cid");
|
resend(target, "u+cid");
|
||||||
@@ -9246,7 +9246,7 @@ function init_io() {
|
|||||||
add_pdps(player, target, 2000);
|
add_pdps(player, target, 2000);
|
||||||
}
|
}
|
||||||
} else if (data.name == "reflection") {
|
} else if (data.name == "reflection") {
|
||||||
consume_mp(player, gSkill.mp);
|
consume_mp(player, gSkill.mp, target);
|
||||||
target.s[gSkill.condition] = { ms: G.conditions.reflection.duration, f: player.name };
|
target.s[gSkill.condition] = { ms: G.conditions.reflection.duration, f: player.name };
|
||||||
xy_emit(player, "ui", { type: "reflection", from: player.name, to: target.name });
|
xy_emit(player, "ui", { type: "reflection", from: player.name, to: target.name });
|
||||||
resend(target, "u+cid");
|
resend(target, "u+cid");
|
||||||
|
|||||||
Reference in New Issue
Block a user