mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-07 08:39:07 +00:00
Added some sound, refactored fletching and arrowmaking a bit... I've … (#314)
* Added some sound, refactored fletching and arrowmaking a bit... I've maybe fixed the issue with fletching.. idk Added some sound, refactored fletching and arrowmaking a bit... I've maybe fixed the issue with fletching.. idk * Commented clipping server side check so we can work on it Commented and brought back the old code so gates works while we work in the clipping check server side. * Added Canifis bank to the bank boolean
This commit is contained in:
@@ -104,55 +104,52 @@ public class ArrowMaking {
|
||||
player.getPacketSender().sendMessage("Not enough space in your inventory.");
|
||||
return false;
|
||||
}
|
||||
player.playerIsFletching = true;
|
||||
int factor = 1;
|
||||
final int multiplier = factor;
|
||||
int count1 = player.getItemAssistant().getItemAmount(arrowData.getItem1()) < 15 ? player
|
||||
.getItemAssistant().getItemAmount(arrowData.getItem1()) : 15;
|
||||
int count2 = player.getItemAssistant().getItemAmount(arrowData.getItem2()) < 15 ? player
|
||||
.getItemAssistant().getItemAmount(arrowData.getItem2()) : 15;
|
||||
final int count = count1 < count2 ? count1 : count2;
|
||||
CycleEventHandler.getSingleton().addEvent(player, new CycleEvent() {
|
||||
|
||||
@Override
|
||||
public void execute(CycleEventContainer container) {
|
||||
if (!player.getItemAssistant().playerHasItem(arrowData.getItem1(),
|
||||
count)
|
||||
|| !player.getItemAssistant().playerHasItem(
|
||||
arrowData.getItem2(), count)
|
||||
|| player.playerIsFletching == false) {
|
||||
container.stop();
|
||||
return;
|
||||
if (!player.playerIsFletching)
|
||||
{
|
||||
player.playerIsFletching = true;
|
||||
CycleEventHandler.getSingleton().addEvent(player, new CycleEvent() {
|
||||
int factor = 1;
|
||||
final int multiplier = factor;
|
||||
int count1 = player.getItemAssistant().getItemAmount(arrowData.getItem1()) < 15 ? player
|
||||
.getItemAssistant().getItemAmount(arrowData.getItem1()) : 15;
|
||||
int count2 = player.getItemAssistant().getItemAmount(arrowData.getItem2()) < 15 ? player
|
||||
.getItemAssistant().getItemAmount(arrowData.getItem2()) : 15;
|
||||
final int count = count1 < count2 ? count1 : count2;
|
||||
@Override
|
||||
public void execute(CycleEventContainer container) {
|
||||
if (!player.getItemAssistant().playerHasItem(arrowData.getItem1(),
|
||||
count)
|
||||
|| !player.getItemAssistant().playerHasItem(
|
||||
arrowData.getItem2(), count) || player.isWoodcutting || player.isCrafting || player.isMoving || player.isMining || player.isBusy || player.isShopping || player.isSmithing || player.isFiremaking || player.isSpinning || player.isPotionMaking || player.playerIsFishing || player.isBanking || player.isSmelting || player.isTeleporting || player.isHarvesting || player.playerIsCooking || player.isPotCrafting) {
|
||||
container.stop();
|
||||
return;
|
||||
}
|
||||
player.getPacketSender().sendSound(375, 100, 0);
|
||||
player.getItemAssistant().deleteItem(arrowData.getItem1(), count);
|
||||
player.getItemAssistant().deleteItem(arrowData.getItem2(), count);
|
||||
player.getItemAssistant().addItem(arrowData.getProduct(),
|
||||
count / multiplier);
|
||||
player.getPacketSender().sendMessage(
|
||||
"You attach the "
|
||||
+ ItemAssistant.getItemName(arrowData
|
||||
.getItem1())
|
||||
+ " to "
|
||||
+ count
|
||||
/ multiplier
|
||||
+ " "
|
||||
+ ItemAssistant.getItemName(arrowData
|
||||
.getItem2()) + "s.");
|
||||
player.getPlayerAssistant().addSkillXP(
|
||||
count / multiplier * arrowData.getXp(), 9);
|
||||
}
|
||||
if (player.isWoodcutting == true) {
|
||||
container.stop();
|
||||
}
|
||||
player.getItemAssistant().deleteItem(arrowData.getItem1(), count);
|
||||
player.getItemAssistant().deleteItem(arrowData.getItem2(), count);
|
||||
player.getItemAssistant().addItem(arrowData.getProduct(),
|
||||
count / multiplier);
|
||||
player.getPacketSender().sendMessage(
|
||||
"You attach the "
|
||||
+ ItemAssistant.getItemName(arrowData
|
||||
.getItem1())
|
||||
+ " to "
|
||||
+ count
|
||||
/ multiplier
|
||||
+ " "
|
||||
+ ItemAssistant.getItemName(arrowData
|
||||
.getItem2()) + "s.");
|
||||
player.getPlayerAssistant().addSkillXP(
|
||||
count / multiplier * arrowData.getXp(), 9);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
player.playerIsFletching = false;
|
||||
return;
|
||||
}
|
||||
}, 1);
|
||||
@Override
|
||||
public void stop() {
|
||||
player.playerIsFletching = false;
|
||||
}
|
||||
}, 1);
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -22,83 +22,45 @@ public class LogCutting {
|
||||
}
|
||||
}
|
||||
|
||||
public static void cutLog(final Player c, final int product, final int level, final double xp, int amount) {
|
||||
if (c.isSpinning) {
|
||||
c.isSpinning = false;
|
||||
}
|
||||
if (c.isWoodcutting) {
|
||||
c.isWoodcutting = false;
|
||||
}
|
||||
c.doAmount = amount;
|
||||
c.getPacketSender().closeAllWindows();
|
||||
if (c.playerLevel[9] < level) {
|
||||
c.getPacketSender().sendMessage("You need a fletching level of " + level + " to make this.");
|
||||
public static void cutLog(final Player player, final int product, final int level, final double xp, int amount) {
|
||||
player.doAmount = amount;
|
||||
player.getPacketSender().closeAllWindows();
|
||||
if (player.playerLevel[9] < level) {
|
||||
player.getPacketSender().sendMessage("You need a fletching level of " + level + " to make this.");
|
||||
return;
|
||||
}
|
||||
c.playerIsFletching = true;
|
||||
c.startAnimation(1248);
|
||||
c.getPacketSender().sendSound(CUT_SOUND, 100, 0);
|
||||
|
||||
CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
|
||||
|
||||
@Override
|
||||
public void execute(CycleEventContainer container) {
|
||||
if (c.getItemAssistant().playerHasItem(LogCuttingInterface.log) && c.getItemAssistant().playerHasItem(KNIFE)) {
|
||||
c.getItemAssistant().deleteItem(LogCuttingInterface.log, 1);
|
||||
if (product == 52) {
|
||||
c.getItemAssistant().addItem(product, 15);
|
||||
} else {
|
||||
c.getItemAssistant().addItem(product, 1);
|
||||
if (!player.playerIsFletching)
|
||||
{
|
||||
player.playerIsFletching = true;
|
||||
CycleEventHandler.getSingleton().addEvent(player, new CycleEvent() {
|
||||
@Override
|
||||
public void execute(CycleEventContainer container) {
|
||||
if (player.doAmount <= 0 || !player.getItemAssistant().playerHasItem(LogCuttingInterface.log) || !player.getItemAssistant().playerHasItem(KNIFE) || player.isWoodcutting || player.isCrafting || player.isMoving || player.isMining || player.isBusy || player.isShopping || player.isSmithing || player.isFiremaking || player.isSpinning || player.isPotionMaking || player.playerIsFishing || player.isBanking || player.isSmelting || player.isTeleporting || player.isHarvesting || player.playerIsCooking || player.isPotCrafting) {
|
||||
container.stop();
|
||||
return;
|
||||
}
|
||||
c.getPacketSender().sendMessage("You carefully cut the " + ItemAssistant.getItemName(LogCuttingInterface.log) + " into an " + ItemAssistant.getItemName(product) + ".");
|
||||
c.getPlayerAssistant().addSkillXP(xp, c.playerFletching);
|
||||
c.doAmount--;
|
||||
player.startAnimation(1248);
|
||||
player.getItemAssistant().deleteItem(LogCuttingInterface.log, 1);
|
||||
if (product == 52)
|
||||
{
|
||||
player.getItemAssistant().addItem(product, 15);
|
||||
}
|
||||
else
|
||||
{
|
||||
player.getItemAssistant().addItem(product, 1);
|
||||
}
|
||||
player.getPacketSender().sendMessage("You carefully cut the " + ItemAssistant.getItemName(LogCuttingInterface.log) + " into an " + ItemAssistant.getItemName(product) + ".");
|
||||
player.getPlayerAssistant().addSkillXP(xp, player.playerFletching);
|
||||
player.doAmount--;
|
||||
player.getPacketSender().sendSound(CUT_SOUND, 100, 0);
|
||||
}
|
||||
|
||||
if (!c.getItemAssistant().playerHasItem(LogCuttingInterface.log)) {
|
||||
container.stop();
|
||||
return;
|
||||
@Override
|
||||
public void stop() {
|
||||
player.playerIsFletching = false;
|
||||
}
|
||||
|
||||
if (c.playerIsFletching == false) {
|
||||
container.stop();
|
||||
return;
|
||||
}
|
||||
|
||||
if (c.doAmount <= 0) {
|
||||
container.stop();
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
c.playerIsFletching = false;
|
||||
c.startAnimation(65535);
|
||||
return;
|
||||
}
|
||||
}, 3);
|
||||
CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
|
||||
|
||||
@Override
|
||||
public void execute(CycleEventContainer container) {
|
||||
if (c.playerIsFletching == false) {
|
||||
container.stop();
|
||||
return;
|
||||
}
|
||||
c.getPacketSender().sendSound(CUT_SOUND, 100, 0);
|
||||
c.startAnimation(1248);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
c.playerIsFletching = false;
|
||||
c.startAnimation(65535);
|
||||
return;
|
||||
}
|
||||
}, 3);
|
||||
}, 3);
|
||||
}
|
||||
}
|
||||
|
||||
public static void handleClick(Player c, int buttonId) {
|
||||
|
||||
+5
-4
@@ -20,12 +20,14 @@ public class LogCuttingInterface {
|
||||
}
|
||||
|
||||
public static void fletchInterface(Player c, int item) {
|
||||
if (c.playerIsFletching == true && (item > 1510 && item < 1522)) {
|
||||
LogCutting.resetFletching(c);
|
||||
if (c.playerIsFletching) {
|
||||
c.playerIsFletching = false;
|
||||
return;
|
||||
} else if (c.playerIsFletching == true && (item < 1510 || item > 1521)) {
|
||||
}
|
||||
if (item < 1510 || item > 1521) {
|
||||
c.playerIsFletching = false;
|
||||
c.getPacketSender().sendMessage("Nothing interesting happens.");
|
||||
return;
|
||||
}
|
||||
log = item;
|
||||
if (item == 1511) {
|
||||
@@ -73,7 +75,6 @@ public class LogCuttingInterface {
|
||||
c.getPacketSender().sendFrame126(ItemAssistant.getItemName(72), 8874);
|
||||
c.getPacketSender().sendFrame126(ItemAssistant.getItemName(70), 8878);
|
||||
}
|
||||
c.playerIsFletching = true;
|
||||
}
|
||||
|
||||
public static void handleItemOnItem(Player player, int itemUsed, int useWith) {
|
||||
|
||||
@@ -86,10 +86,11 @@ public class Stringing {
|
||||
|
||||
@Override
|
||||
public void execute(CycleEventContainer container) {
|
||||
if (!player.getItemAssistant().playerHasItem(loadData.getItem1()) || !player.getItemAssistant().playerHasItem(loadData.getItem2()) || player.playerIsFletching == false) {
|
||||
if (!player.getItemAssistant().playerHasItem(loadData.getItem1()) || !player.getItemAssistant().playerHasItem(loadData.getItem2()) || !player.playerIsFletching) {
|
||||
container.stop();
|
||||
return;
|
||||
}
|
||||
player.getPacketSender().sendSound(1311, 100, 0);
|
||||
player.getItemAssistant().deleteItem(loadData.getItem1(), 1);
|
||||
player.getItemAssistant().deleteItem(loadData.getItem2(), 1);
|
||||
player.getPacketSender().sendMessage("You add a string to the bow.");
|
||||
|
||||
Reference in New Issue
Block a user