Skip to content

Instantly share code, notes, and snippets.

@ljosberinn
Last active January 11, 2024 13:49
Show Gist options
  • Save ljosberinn/674a2b64407b067f97ff40a9e34e188d to your computer and use it in GitHub Desktop.
Save ljosberinn/674a2b64407b067f97ff40a9e34e188d to your computer and use it in GitHub Desktop.
Tindral WCL Script Pins

How to use

  • switch to Queries view
  • switch to New Script
  • paste the script pin code from below
  • set Pin Type (dropdown below the box) to Filter
  • click Create Pin bottom right
  • switch to Events view

Excessive Soaks

IMPORTANT You need to be in the Events pane of Damage Taken and the pin type must be set to Filter:

Shows who soaked multiple seeds. The events shown are already the culprit. Threshold to not soak again is 10 seconds.

var members = new Map

pinMatchesFightEvent = (event, fight) => {
    if (event.ability.id != 430584) {
        return false
    }
        
    if (members.has(event.target.name)) {
        if (event.timestamp - members.get(event.target.name) >= 10_000) {
            members.set(event.target.name, event.timestamp)
            return false
        }

        return true
    } 

    members.set(event.target.name, event.timestamp)

    return false;
}

initializePinForFight = (fight) => {}

Sanitized Death Reasons

IMPORTANT You need to be in the Events pane of Deaths and the pin type must be set to Filter:

image

Shows who died, excluding:

  • Flare Bomb
  • Roots being cleared within < 200ms of death (this includes both regular deaths and actual removals briefly before death)
  • deaths to Shrooms
  • maybe more? let me know on the Discord
const debuffs = new Map();

const rootsId = 424497;
const flareBombId = 425602;
const poisonousShroomsId = 426691;
const blazingShroomsId = 424662;

const threshold = 200;

pinMatchesFightEvent = (event, fight) => {
  switch (event.type) {
    case "applydebuff": {
      if (event.target?.type === "Player" && event.ability.id === rootsId) {
        debuffs.set(event.target.id, {
          apply: event.timestamp,
          remove: 0,
        });
      }

      return false;
    }
    case "removedebuff": {
      if (event.target?.type === "Player" && event.ability.id === rootsId) {
        const meta = debuffs.get(event.target.id);
        meta.remove = event.timestamp;
        debuffs.set(event.target.id, meta);
      }

      return false;
    }
    case "death": {
      if (event.target?.type !== "Player") {
        return false;
      }

      if (event.killingAbility?.id === flareBombId) {
        return false;
      }

      if (event.killingAbility?.id === poisonousShroomsId || event.killingAbility?.id === blazingShroomsId) {
        return false;
      }

      if (!debuffs.has(event.target.id)) {
        return true; // death unrelated to being rooted
      }    

      const meta = debuffs.get(event.target.id);

      if (meta.remove === 0) {
        return true; // was rooted on death
      }

      if (event.timestamp - meta.remove <= threshold) {
        return false; // removedebuff event from dying
      }

      return true;
    }
    default: {
      return false;
    }
  }
};

initializePinForFight = (fight) => {};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment