Files

33 lines
1.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# bariskeser_skills.js — cast_totem() (satır 2009)
[← bariskeser_skills.js](index.md) · [← Master](../../wiki.md)
```javascript
function cast_totem(c) {
var p = c.getPlayer(); if (!p) return;
if (guard(p, "totem")) return;
var w = c.getWorld(), pos = p.getPosition();
var tx = pos.x, ty = pos.y, tz = pos.z;
title(p, "§a§lŞİFA TOTEMİ", "§2dikildi");
w.playSound("minecraft:block.beacon.activate", tx, ty, tz, 1.5, 1.6);
var t = 0, DUR = 120;
function loop(ctx) {
var ww = ctx.getWorld(), caster = ctx.getPlayer();
showHead(ww, tx, ty + 0.5, tz, 1.4, 2);
showHead(ww, tx, ty + 1.7, tz, 1.2, 2);
fx(ww, "happyVillager", tx, ty + 1, tz, 6, 0.5, 0.8, 0.5, 0.05);
fx(ww, "heart", tx, ty + 1.5, tz, 2, 0.4, 0.5, 0.4, 0);
var cp = caster.getPosition();
if (dist3(cp.x, cp.y, cp.z, tx, ty, tz) < 6 && t % 10 === 0) {
try { var mx = caster.getMaxHp(), hp = caster.getHp(); if (hp < mx) caster.setHp(Math.min(mx, hp + 2)); } catch (e) {}
fx(ww, "heart", cp.x, cp.y + 1.2, cp.z, 2, 0.4, 0.5, 0.4, 0);
}
t++;
if (t >= DUR) { fx(ww, "largesmoke", tx, ty + 1, tz, 15, 0.4, 0.6, 0.4, 0.05); return; }
ctx.scheduleScript(2, loop);
}
c.scheduleScript(1, loop);
}
```