More fixes (#235)

- Dwarf cannon can now be seen by anyone and not just the person who sets it down (they can also see the rotation now)
- Fixed doors being removed when clicking them
- Removed banking command for regular players
- Fixed nulodion now only gives if you have space
- Updated nulodion message so it doesnt say to find him at home
- Npcs wont follow you if you turn on the cantAttack comamand (for admins
- Fixed gate at KBD
- Fixed the gates at Ice giants in wildy

#closes 132
#closes 203
#closes 211
#closes 6

also this one should be closed from previous patch

#closes 219
This commit is contained in:
Mr Extremez
2019-12-05 11:55:25 -06:00
committed by Daniel Ginovker
parent 9fb110bb41
commit 8af938548b
11 changed files with 42 additions and 32 deletions
@@ -7,10 +7,12 @@ import com.rebotted.event.CycleEventHandler;
import com.rebotted.game.content.combat.CombatConstants;
import com.rebotted.game.npcs.Npc;
import com.rebotted.game.npcs.NpcHandler;
import com.rebotted.game.objects.Objects;
import com.rebotted.game.players.Client;
import com.rebotted.game.players.Player;
import com.rebotted.game.players.PlayerHandler;
import com.rebotted.util.Misc;
import com.rebotted.world.clip.Region;
/**
* Cannon
@@ -97,7 +99,7 @@ public class DwarfCannon {
player.turnPlayerTo(player.absX, player.absY);
player.cannonX = player.absX;
player.cannonY = player.absY;
placeObject(OBJECT_PARTS[setUpStage], player.absX, player.absY);
placeObject(OBJECT_PARTS[setUpStage], player.absX, player.absY, true);
player.getItemAssistant().deleteItem(ITEM_PARTS[setUpStage], 1);
setUpStage ++;
}
@@ -120,7 +122,7 @@ public class DwarfCannon {
public void loginCheck() {
if (needsCannon()) {
player.getPacketSender().sendMessage("@red@You can collect your cannon at home from Nulodion.");
player.getPacketSender().sendMessage("@red@You can collect your cannon from Nulodion.");
}
}
@@ -342,17 +344,14 @@ public class DwarfCannon {
player.cannonY = 0;
}
public void placeObject(int id, int x, int y) {
for (int j = 0; j < PlayerHandler.players.length; j++) {
if (PlayerHandler.players[j] != null) {
Client a = (Client)PlayerHandler.players[j];
a.getPacketSender().object(id, x, y, 516, 10);
}
}
public void placeObject(int id, int x, int y, boolean add) {
GameEngine.objectHandler.placeObject(new Objects(id, x, y, 0, 516, 10, 0));
if (add)
Region.addObject(id, x, y, 0, 10, 516, true);
}
public void removeObject(int x, int y) {
placeObject(-1, x, y);
placeObject(-1, x, y, false);
}
public boolean noSetUpArea() {
@@ -6854,12 +6854,17 @@ public class DialogueHandler {
case 3501:
if (player.getCannon().needsCannon()) {
sendNpcChat1("Here is your cannon, try not to lose it again.", player.talkingNpc, "Nulodion");
for (int i = 0; i < 4; i++) {
if (player.getItemAssistant().freeSlots() >= 4) {
sendNpcChat1("Here is your cannon, try not to lose it again.", player.talkingNpc, "Nulodion");
for (int i = 0; i < 4; i++) {
player.getItemAssistant().addItem(player.getCannon().ITEM_PARTS[i], 1);
}
player.lostCannon = false;
player.nextChat = 0;
} else {
sendNpcChat1("You need at least 4 free inventory spots.", player.talkingNpc, "Nulodion");
player.nextChat = 0;
}
player.lostCannon = false;
player.nextChat = 0;
} else {
sendNpcChat1("" + Misc.capitalize(player.playerName) + " you do not have a cannon to collect currently.", player.talkingNpc, "Nulodion");
player.nextChat = 0;
@@ -54,12 +54,12 @@ public class Doors {
return null;
}
public boolean handleDoor(int id, int x, int y, int z, Player player) {
public boolean handleDoor(Player player, int id, int x, int y, int z) {
Doors d = getDoor(id, x, y, z);
if (d == null) {
if (DoubleDoors.getSingleton().handleDoor(id, x, y, z)) {
if (DoubleDoors.getSingleton().handleDoor(player, id, x, y, z)) {
return true;
}
return false;
@@ -9,6 +9,7 @@ import java.util.Scanner;
import com.rebotted.GameEngine;
import com.rebotted.game.objects.Objects;
import com.rebotted.game.players.Player;
/**
*
@@ -45,11 +46,11 @@ public class DoubleDoors {
return null;
}
public boolean handleDoor(int id, int x, int y, int z) {
public boolean handleDoor(Player player, int id, int x, int y, int z) {
DoubleDoors doorClicked = getDoor(id, x, y, z);
if (doorClicked == null) {
GameEngine.objectHandler.placeObject(new Objects(-1, x, y, z, 0, 0, 0));
//GameEngine.objectHandler.placeObject(new Objects(-1, x, y, z, 0, 0, 0));
return true;
}
if (doorClicked.doorId > 12000) {
@@ -148,6 +148,12 @@ public class DoubleGates extends GateHandler {
handleMetalGate(player, 1596, 1597, 2815, 3182, 2815, 3183, 2816, 3182, 2816, 3183, 3);
} else if (player.objectY > 3449 && player.objectY < 3452) {
handleMetalGate(player, 1596, 1597, 2936, 3451, 2936, 3450, 2935, 3451, 2935, 3450, 7);
} else if (player.objectY > 3848 && player.objectY < 3851) {
handleMetalGate(player, 1596, 1597, 3007, 3849, 3007, 3850, 3008, 3849, 3008, 3850, 3);
} else if (player.objectX > 3223 && player.objectX < 3226) {
handleMetalGate(player, 1596, 1597, 3225, 3903, 3224, 3903, 3225, 3904, 3224, 3904, 0);
} else if (player.objectX > 2946 && player.objectX < 2949) {
handleMetalGate(player, 1596, 1597, 2948, 3903, 2947, 3903, 2948, 3904, 2947, 3904, 0);
}
break;
case 1597:
@@ -161,6 +167,12 @@ public class DoubleGates extends GateHandler {
handleMetalGate(player, 1597, 1596, 2815, 3183, 2815, 3182, 2816, 3183, 2816, 3182, 1);
} else if (player.objectY > 3449 && player.objectY < 3452) {
handleMetalGate(player, 1597, 1596, 2936, 3450, 2936, 3451, 2935, 3450, 2935, 3451, 5);
} else if (player.objectY > 3848 && player.objectY < 3851) {
handleMetalGate(player, 1597, 1596, 3007, 3850, 3007, 3849, 3008, 3850, 3008, 3849, 1);
} else if (player.objectX > 3223 && player.objectX < 3226) {
handleMetalGate(player, 1597, 1596, 3224, 3903, 3225, 3903, 3224, 3904, 3225, 3904, 2);
} else if (player.objectX > 2946 && player.objectX < 2949) {
handleMetalGate(player, 1597, 1596, 2947, 3903, 2948, 3903, 2947, 3904, 2948, 3904, 2);
}
break;
case 1557:
@@ -20,9 +20,7 @@ public class NPCDefinition {
}
public static NPCDefinition forId(int id) {
NPCDefinition d = definitions[id];
if (d == null) {
d = produceDefinition(id);
}
@@ -1010,6 +1010,9 @@ public class NpcHandler {
if (PlayerHandler.players[playerId] == null) {
return;
}
if (PlayerHandler.players[playerId].npcCanAttack == false) {
return;
}
if (PlayerHandler.players[playerId].respawnTimer > 0) {
npcs[i].facePlayer(0);
npcs[i].randomWalk = true;
@@ -40,9 +40,9 @@ public class PlayerAssistant {
public void objectAnim(int X, int Y, int animationID, int tileObjectType, int orientation) {
for (Player p : PlayerHandler.players) {
if(p != null) {
Client players = (Client)p;
Player players = (Player)p;
if(players.distanceToPoint(X, Y) <= 25) {
player.getPacketSender().createPlayersObjectAnim(X, Y, animationID, tileObjectType, orientation);
players.getPacketSender().createPlayersObjectAnim(X, Y, animationID, tileObjectType, orientation);
}
}
}
@@ -89,8 +89,7 @@ public class Bank10 implements PacketType {
case 1121:
case 1122:
case 1123:
player.getSmithing().readInput(player.playerLevel[player.playerSmithing],
Integer.toString(removeId), player, 10);
player.getSmithing().readInput(player.playerLevel[player.playerSmithing], Integer.toString(removeId), player, 10);
break;
}
@@ -122,11 +122,7 @@ public class ClickObject implements PacketType {
}
//todo: check if it's a door before fire handle
Doors.getSingleton().handleDoor(p.objectId, p.objectX, p.objectY, p.heightLevel, p);
/*if (client.performingAction) {
return;
}*/
Doors.getSingleton().handleDoor(p, p.objectId, p.objectX, p.objectY, p.heightLevel);
if (Stalls.isObject(p.objectId)) {
Stalls.attemptStall(p, p.objectId, p.objectX, p.objectX);
@@ -42,9 +42,6 @@ public class Commands implements PacketType {
public static void playerCommands(Player player, String playerCommand, String[] arguments) {
switch (playerCommand.toLowerCase())
{
case "bank":
player.getPacketSender().openUpBank();
break;
case "claimvote":
if(!GameEngine.ersSecret.equals("")) {
final String playerName = player.playerName;