Files

1.8 KiB
Raw Permalink Blame History

ezoic_radyasyon.js — runSpeed() (satır 686)

← ezoic_radyasyon.js · ← Master

Parça 1/2 · sonraki

function runSpeed(c) {
    var p = c.getPlayer();
    if (!p) return;
    var w = c.getWorld();

    var speedPot = mappet.getPotion("speed");
    if (speedPot) p.applyPotion(speedPot, SPEED_DURATION, 4, false); // Speed V
    var jumpPot = mappet.getPotion("jump_boost");
    if (jumpPot) p.applyPotion(jumpPot, SPEED_DURATION, 2, false);
    var resPot = mappet.getPotion("resistance");
    if (resPot) p.applyPotion(resPot, SPEED_DURATION, 1, false);

    var pos = p.getPosition();
    w.playSound("minecraft:entity.firework.launch",   pos.x, pos.y, pos.z, 2.5, 2.0);
    w.playSound("minecraft:block.beacon.activate",    pos.x, pos.y, pos.z, 2.0, 1.8);
    w.playSound("minecraft:entity.horse.gallop",      pos.x, pos.y, pos.z, 2.0, 1.5);

    p.sendTitleDurations(0, SPEED_DURATION, 20);
    p.sendTitle("§a§l⚡ HIZ ⚡");

    var t = 0;
    var lastX = pos.x, lastZ = pos.z;
    function speedLoop(ctx) {
        var pp = ctx.getPlayer();
        if (!pp) return;
        if (t >= SPEED_DURATION) {
            ctx.getWorld().playSound("minecraft:block.beacon.deactivate", pp.getPosition().x, pp.getPosition().y, pp.getPosition().z, 1.5, 1.6);
            pp.sendTitleDurations(5, 20, 5);
            pp.sendTitle("§7§lHız Bitti");
            return;
        }

        var ww = ctx.getWorld();
        var ppos = pp.getPosition();
        var cx = ppos.x, cy = ppos.y, cz = ppos.z;

        // İz partikülleri
        spawnFx(ww, "happyVillager", cx, cy + 0.5, cz, 5, 0.3, 0.5, 0.3, 0.05);
        spawnFx(ww, "endRod",        cx, cy + 0.2, cz, 3, 0.2, 0.2, 0.2, 0.1);