Files

38 lines
1.7 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.
# Hector_Tudors.js — cast_cage() (satır 1857)
[← Hector_Tudors.js](index.md) · [← Master](../../wiki.md)
```javascript
function cast_cage(c) {
var p = c.getPlayer(); if (!p) return;
if (guard(p, "cage")) return;
var w = c.getWorld();
var target = pickTarget(p, 40);
if (!target) { p.sendActionBar("§7Hedef yok — bir düşmana bak"); p.getStates().setNumber("bk_cd_cage", 0); return; }
var tp = target.getPosition(), cxp = tp.x, cyp = tp.y, czp = tp.z;
title(p, "§7§lKAFA HAPSİ", "§fhapsedildi");
try { target.lockPosition(cxp, cyp, czp); } catch (e) {}
w.playSound("minecraft:block.metal.place", cxp, cyp, czp, 1.5, 0.7);
var slow = mappet.getPotion("slowness");
if (slow) target.applyPotion(slow, 120, 250, false);
var t = 0, DUR = 120;
function loop(ctx) {
var ww = ctx.getWorld(), caster = ctx.getPlayer();
for (var k = 0; k < 8; k++) {
var a = t * 0.1 + (k / 8) * Math.PI * 2;
showHead(ww, cxp + Math.cos(a) * 1.3, cyp + 0.5 + (k % 2) * 1.2, czp + Math.sin(a) * 1.3, 1.0, 2);
}
showHead(ww, cxp, cyp + 2.0, czp, 1.0, 2);
showHead(ww, cxp, cyp, czp, 1.0, 2);
fx(ww, "reddust", cxp, cyp + 1, czp, 6, 0.5, 0.7, 0.5, 0);
try { target.setMotion(0, 0, 0); if (slow) target.applyPotion(slow, 20, 250, false); } catch (e) {}
if (t % 15 === 0) hurt(target, 3, caster);
t++;
if (t >= DUR) { try { target.unlockPosition(); } catch (e) {} ww.playSound("minecraft:block.glass.break", cxp, cyp, czp, 1, 1); return; }
ctx.scheduleScript(1, loop);
}
c.scheduleScript(1, loop);
}
```