Skip to content

Instantly share code, notes, and snippets.

View Shadowrs's full-sized avatar

Jak Shadowrs

  • UK
View GitHub Profile
@Shadowrs
Shadowrs / AStarPathFinder.java
Created May 26, 2020 05:25
Graham's A* Path Finder
package org.hyperion.rs2.pf;
import java.util.HashSet;
import java.util.Set;
import org.hyperion.rs2.model.Location;
/**
* An implementation of a <code>PathFinder</code> which uses the A* search
* algorithm. Unlike the <code>DumbPathFinder</code>, this will attempt to find
@Shadowrs
Shadowrs / PathFinder.java
Created May 26, 2020 05:29
484 rs2hd Jedi PathFinder
/*******************************************************************************
* Azureify Revision 498 RuneScape Emulator
* Copyright (C) 2012 Ryan ryry-@sympatico.ca
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@Shadowrs
Shadowrs / CombatMovement.java
Created May 26, 2020 05:44
Dementhium 637 combat following
public static boolean combatFollow(Mob mob, Mob other, CombatType type) {
mob.turnTo(other);
int distance = mob.getLocation().getDistance(other.getLocation());
if (distance > 17) {
mob.getCombatExecutor().reset();
return false;
}
if ((type == CombatType.MELEE || type == CombatType.DEFAULT) && canMelee(mob, other)) {
if (diagonal(mob.getLocation(), other.getLocation())) {
mob.requestClippedWalk(other.getLocation().getX(), mob.getLocation().getY());