
Originally Posted by
Zivik
It happens when ranging/maging npcs and then teleporting right as you shoot. Common on every server I ever been on.
zivik my teleportation method shows resetting of player attack. and i tried what you said but couldn't get the glitch to occur. any ideas :\?
Code:
public void startTeleport(int x, int y, int height, String teleportType) {
if(c.completedPin == false && c.myPin.length() > 0) {
c.Pin();
return;
}
if (c.respawnEvent != false) {
return;
}
if (c.shouldSetPin == true) {
c.getDH().sendDialogues(15001, 0);
return;
}
if (c.safeTimer > 0) {
c.sendMessage("You cannot teleport while pking, that's noobish.");
c.getPA().closeAllWindows();
return;
}
if (c.inF2p()) {
c.sendMessage("The only way out is death or victory.");
c.getPA().closeAllWindows();
return;
}
if (c.f2pWaitingRoom()) {
c.sendMessage("Please leave through the ladder exit.");
c.getPA().closeAllWindows();
return;
}
if (c.mustremoveequipment) {
c.getPA().closeAllWindows();
return;
}
if (!c.chosenstarter) {
c.getPA().closeAllWindows();
c.sendMessage("You must understand the rules before playing.");
return;
}
InterfaceEvent.getInstance().startInterfaceEvent(c);
c.canDepositAll = false;
if (c.inPits || inPitsWait()) {
c.getPA().closeAllWindows();
c.sendMessage("You can't teleport during fight pits!");
return;
}
if (PestControl.isInGame(c)) {
c.getPA().closeAllWindows();
c.sendMessage("You can't teleport from a Pest Control Game!");
return;
}
if (c.inTrade) {
c.getPA().closeAllWindows();
c.sendMessage("You can't teleport in a trade.");
return;
}
if (c.duelStatus == 5) {
c.getPA().closeAllWindows();
c.sendMessage("You can't teleport during a duel!");
return;
}
if (c.isInJail()) {
removeAllWindows();
c.sendMessage("@[email protected] can't escape from here! Be patient.");
return;
}
if ((c.inWild() && c.wildLevel > Config.NO_TELEPORT_WILD_LEVEL && c.playerRights != 3)) {
c.getPA().closeAllWindows();
c.sendMessage("You can't teleport above level "
+ Config.NO_TELEPORT_WILD_LEVEL + " in the wilderness.");
return;
}
if (System.currentTimeMillis() - c.teleBlockDelay < c.teleBlockLength) {
c.sendMessage("You are teleblocked and can't teleport. @[email protected] can use ::untb!");
return;
}
if (!c.isDead && c.teleTimer == 0) {
if (c.playerIndex > 0 || c.npcIndex > 0)
c.getCombat().resetPlayerAttack();
c.stopMovement();
removeAllWindows();
c.usingSpecial = false;
c.teleX = x;
c.teleY = y;
c.npcIndex = 0;
c.playerIndex = 0;
c.faceUpdate(0);
c.teleHeight = height;
if (c.underAttackBy > 0 || c.underAttackBy2 > 0) {
}
if (teleportType.equalsIgnoreCase("modern")) {
c.startAnimation(4731);
c.gfx0(1228);
c.teleTimer = 9;
c.teleEndAnimation = 715;
}
if (teleportType.equalsIgnoreCase("spiritTree")) {
c.startAnimation(4731);
c.gfx0(1228);
c.teleTimer = 9;
c.teleEndAnimation = 715;
}
if (teleportType.equalsIgnoreCase("ancient")) {
c.startAnimation(4731);
c.gfx0(1228);
c.teleTimer = 9;
c.teleEndAnimation = 715;
}
}
}
update:
i've added
Code:
if(c.teleTimer > 0) {
return;
}
under all //range hit delay or //range hit damage and //magic hit damage via the combatassistant class. hoping it will work will be waiting for your response