mirror of
https://github.com/moparisthebest/MoparClassic
synced 2024-12-21 23:18:52 -05:00
commit
2227b6f09f
@ -16,6 +16,7 @@ import org.moparscape.msc.gs.external.EntityHandler;
|
|||||||
import org.moparscape.msc.gs.external.ItemCookingDef;
|
import org.moparscape.msc.gs.external.ItemCookingDef;
|
||||||
import org.moparscape.msc.gs.external.ItemCraftingDef;
|
import org.moparscape.msc.gs.external.ItemCraftingDef;
|
||||||
import org.moparscape.msc.gs.external.ItemSmeltingDef;
|
import org.moparscape.msc.gs.external.ItemSmeltingDef;
|
||||||
|
import org.moparscape.msc.gs.external.ItemSmithingDef;
|
||||||
import org.moparscape.msc.gs.external.ItemWieldableDef;
|
import org.moparscape.msc.gs.external.ItemWieldableDef;
|
||||||
import org.moparscape.msc.gs.external.ReqOreDef;
|
import org.moparscape.msc.gs.external.ReqOreDef;
|
||||||
import org.moparscape.msc.gs.model.ActiveTile;
|
import org.moparscape.msc.gs.model.ActiveTile;
|
||||||
@ -66,7 +67,7 @@ public class InvUseOnObject implements PacketHandler {
|
|||||||
owner.getActionSender().sendMessage(
|
owner.getActionSender().sendMessage(
|
||||||
"Nothing interesting happens.");
|
"Nothing interesting happens.");
|
||||||
return;
|
return;
|
||||||
}
|
}//case 177
|
||||||
owner.getActionSender().sendMessage(
|
owner.getActionSender().sendMessage(
|
||||||
"You try to destroy the web");
|
"You try to destroy the web");
|
||||||
owner.setBusy(true);
|
owner.setBusy(true);
|
||||||
@ -642,27 +643,225 @@ public class InvUseOnObject implements PacketHandler {
|
|||||||
break;
|
break;
|
||||||
case 50:
|
case 50:
|
||||||
case 177: // Anvil
|
case 177: // Anvil
|
||||||
int minSmithingLevel = Formulae
|
int minSmithingLevel = Formulae.minSmithingLevel(item.getID());
|
||||||
.minSmithingLevel(item.getID());
|
if(minSmithingLevel < 0) {
|
||||||
if (minSmithingLevel < 0) {
|
owner.getActionSender().sendMessage("Nothing interesting happens.");
|
||||||
owner.getActionSender().sendMessage(
|
return;
|
||||||
"Nothing interesting happens.");
|
}
|
||||||
return;
|
if(owner.getInventory().countId(168) < 1) {
|
||||||
}
|
owner.getActionSender().sendMessage("You need a hammer to work the metal with.");
|
||||||
if (owner.getInventory().countId(168) < 1) {
|
return;
|
||||||
owner.getActionSender()
|
}
|
||||||
.sendMessage(
|
if(owner.getCurStat(13) < minSmithingLevel) {
|
||||||
"You need a hammer to work the metal with.");
|
owner.getActionSender().sendMessage("You need a smithing level of " + minSmithingLevel + " to use this type of bar");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (owner.getCurStat(13) < minSmithingLevel) {
|
options = new String[]{"Make Weapon", "Make Armour", "Make Missile Heads", "Cancel"};
|
||||||
owner.getActionSender().sendMessage(
|
owner.setMenuHandler(new MenuHandler(options) {
|
||||||
"You need a smithing level of "
|
public void handleReply(int option, String reply) {
|
||||||
+ minSmithingLevel
|
if(owner.isBusy()) {
|
||||||
+ " to use this type of bar");
|
return;
|
||||||
return;
|
}
|
||||||
}
|
String[] options;
|
||||||
break;
|
switch(option) {
|
||||||
|
case 0:
|
||||||
|
owner.getActionSender().sendMessage("Choose a type of weapon to make");
|
||||||
|
options = new String[]{"Dagger", "Throwing Knife", "Sword", "Axe", "Mace"};
|
||||||
|
owner.setMenuHandler(new MenuHandler(options) {
|
||||||
|
public void handleReply(int option, String reply) {
|
||||||
|
if(owner.isBusy()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String[] options;
|
||||||
|
switch(option) {
|
||||||
|
case 0:
|
||||||
|
handleSmithing(item.getID(), 0);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
handleSmithing(item.getID(), 1);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
owner.getActionSender().sendMessage("What sort of sword do you want to make?");
|
||||||
|
options = new String[]{"Short Sword", "Long Sword (2 bars)", "Scimitar (2 bars)", "2-handed Sword (3 bars)"};
|
||||||
|
owner.setMenuHandler(new MenuHandler(options) {
|
||||||
|
public void handleReply(int option, String reply) {
|
||||||
|
if(owner.isBusy()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
switch(option) {
|
||||||
|
case 0:
|
||||||
|
handleSmithing(item.getID(), 2);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
handleSmithing(item.getID(), 3);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
handleSmithing(item.getID(), 4);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
handleSmithing(item.getID(), 5);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
owner.getActionSender().sendMenu(options);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
owner.getActionSender().sendMessage("What sort of axe do you want to make?");
|
||||||
|
options = new String[]{"Hatchet", "Pickaxe", "Battle Axe (3 bars)"};
|
||||||
|
owner.setMenuHandler(new MenuHandler(options) {
|
||||||
|
public void handleReply(int option, String reply) {
|
||||||
|
if(owner.isBusy()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
switch(option) {
|
||||||
|
case 0:
|
||||||
|
handleSmithing(item.getID(), 6);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
handleSmithing(item.getID(), 7);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
handleSmithing(item.getID(), 8);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
owner.getActionSender().sendMenu(options);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
handleSmithing(item.getID(), 9);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
owner.getActionSender().sendMenu(options);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
owner.getActionSender().sendMessage("Choose a type of armour to make");
|
||||||
|
options = new String[]{"Helmet", "Shield", "Armour"};
|
||||||
|
owner.setMenuHandler(new MenuHandler(options) {
|
||||||
|
public void handleReply(int option, String reply) {
|
||||||
|
if(owner.isBusy()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
switch(option) {
|
||||||
|
case 0:
|
||||||
|
owner.getActionSender().sendMessage("What sort of helmet do you want to make?");
|
||||||
|
options = new String[]{"Medium Helmet", "Large Helmet (2 bars)"};
|
||||||
|
owner.setMenuHandler(new MenuHandler(options) {
|
||||||
|
public void handleReply(int option, String reply) {
|
||||||
|
if(owner.isBusy()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
switch(option) {
|
||||||
|
case 0:
|
||||||
|
handleSmithing(item.getID(), 10);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
handleSmithing(item.getID(), 11);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
owner.getActionSender().sendMenu(options);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
owner.getActionSender().sendMessage("What sort of shield do you want to make?");
|
||||||
|
options = new String[]{"Square Shield (2 bars)", "Kite Shield (3 bars)"};
|
||||||
|
owner.setMenuHandler(new MenuHandler(options) {
|
||||||
|
public void handleReply(int option, String reply) {
|
||||||
|
if(owner.isBusy()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
switch(option) {
|
||||||
|
case 0:
|
||||||
|
handleSmithing(item.getID(), 12);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
handleSmithing(item.getID(), 13);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
owner.getActionSender().sendMenu(options);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
owner.getActionSender().sendMessage("What sort of armour do you want to make?");
|
||||||
|
options = new String[]{"Chain Mail Body (3 bars)", "Plate Mail Body (5 bars)", "Plate Mail Legs (3 bars)", "Plated Skirt (3 bars)"};
|
||||||
|
owner.setMenuHandler(new MenuHandler(options) {
|
||||||
|
public void handleReply(int option, String reply) {
|
||||||
|
if(owner.isBusy()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
switch(option) {
|
||||||
|
case 0:
|
||||||
|
handleSmithing(item.getID(), 14);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
handleSmithing(item.getID(), 15);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
handleSmithing(item.getID(), 16);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
handleSmithing(item.getID(), 17);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
owner.getActionSender().sendMenu(options);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
owner.getActionSender().sendMenu(options);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
options = new String[]{"Make 10 Arrow Heads", "Make 50 Arrow Heads (5 bars)", "Forge Dart Tips", "Cancel"};
|
||||||
|
owner.setMenuHandler(new MenuHandler(options) {
|
||||||
|
public void handleReply(int option, String reply) {
|
||||||
|
if(owner.isBusy()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
switch(option) {
|
||||||
|
case 0:
|
||||||
|
handleSmithing(item.getID(), 18);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
handleSmithing(item.getID(), 19);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
handleSmithing(item.getID(), 20);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
owner.getActionSender().sendMenu(options);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
owner.getActionSender().sendMenu(options);
|
||||||
|
break;
|
||||||
case 121: // Spinning Wheel
|
case 121: // Spinning Wheel
|
||||||
switch (item.getID()) {
|
switch (item.getID()) {
|
||||||
case 145: // Wool
|
case 145: // Wool
|
||||||
@ -1246,48 +1445,44 @@ public class InvUseOnObject implements PacketHandler {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* private void handleSmithing(int barID, int toMake) {
|
private void handleSmithing(int barID, int toMake) {
|
||||||
*
|
ItemSmithingDef def = EntityHandler.getSmithingDef((Formulae.getBarType(barID) * 21) + toMake);
|
||||||
* ItemSmithingDef def = EntityHandler
|
if(def == null) {
|
||||||
* .getSmithingDef((Formulae.getBarType(barID) * 21) +
|
owner.getActionSender().sendMessage("Nothing interesting happens.");
|
||||||
* toMake); if (def == null) {
|
return;
|
||||||
* owner.getActionSender().sendMessage(
|
}
|
||||||
* "Nothing interesting happens."); return; } if
|
if(owner.getCurStat(13) < def.getRequiredLevel()) {
|
||||||
* (owner.getCurStat(13) < def.getRequiredLevel()) {
|
owner.getActionSender().sendMessage("You need at smithing level of " + def.getRequiredLevel() + " to make this");
|
||||||
* owner.getActionSender().sendMessage(
|
return;
|
||||||
* "You need a smithing level of " + def.getRequiredLevel()
|
}
|
||||||
* + " to make this"); return; } if
|
if(owner.getInventory().countId(barID) < def.getRequiredBars()) {
|
||||||
* (owner.getInventory().countId(barID) < def
|
owner.getActionSender().sendMessage("You don't have enough bars to make this.");
|
||||||
* .getRequiredBars()) {
|
return;
|
||||||
* owner.getActionSender().sendMessage(
|
}
|
||||||
* "You don't have enough bars to make this."); return; } if
|
owner.getActionSender().sendSound("anvil");
|
||||||
* (EntityHandler.getItemDef(def.getItemID()) .isMembers()
|
for(int x = 0;x < def.getRequiredBars();x++) {
|
||||||
* && !World.isMembers()) { owner.getActionSender()
|
owner.getInventory().remove(new InvItem(barID, 1));
|
||||||
* .sendMessage(
|
}
|
||||||
* "This feature is only avaliable on a members server");
|
Bubble bubble = new Bubble(owner, item.getID());
|
||||||
* return; } owner.getActionSender().sendSound("anvil"); for
|
for(Player p : owner.getViewArea().getPlayersInView()) {
|
||||||
* (int x = 0; x < def.getRequiredBars(); x++) {
|
p.informOfBubble(bubble);
|
||||||
* owner.getInventory().remove(new InvItem(barID, 1)); }
|
}
|
||||||
* Bubble bubble = new Bubble(owner, item.getID()); for
|
if(EntityHandler.getItemDef(def.getItemID()).isStackable()) {
|
||||||
* (Player p : owner.getViewArea().getPlayersInView()) {
|
owner.getActionSender().sendMessage("You hammer the metal into some " + EntityHandler.getItemDef(def.getItemID()).getName());
|
||||||
* p.informOfBubble(bubble); } if
|
owner.getInventory().add(new InvItem(def.getItemID(), def.getAmount()));
|
||||||
* (EntityHandler.getItemDef(def.getItemID())
|
}
|
||||||
* .isStackable()) { owner.getActionSender().sendMessage(
|
else {
|
||||||
* "You hammer the metal into some " +
|
owner.getActionSender().sendMessage("You hammer the metal into a " + EntityHandler.getItemDef(def.getItemID()).getName());
|
||||||
* EntityHandler.getItemDef( def.getItemID()).getName());
|
for(int x = 0;x < def.getAmount();x++) {
|
||||||
* owner.getInventory().add( new InvItem(def.getItemID(),
|
owner.getInventory().add(new InvItem(def.getItemID(), 1));
|
||||||
* def .getAmount())); } else {
|
}
|
||||||
* owner.getActionSender().sendMessage(
|
}
|
||||||
* "You hammer the metal into a " +
|
owner.incExp(13, Formulae.getSmithingExp(barID, def.getRequiredBars()), true, true);
|
||||||
* EntityHandler.getItemDef( def.getItemID()).getName());
|
owner.getActionSender().sendStat(13);
|
||||||
* for (int x = 0; x < def.getAmount(); x++) {
|
owner.getActionSender().sendInventory();
|
||||||
* owner.getInventory().add( new InvItem(def.getItemID(),
|
}
|
||||||
* 1)); } } owner.incExp( 13, Formulae.getSmithingExp(barID,
|
|
||||||
* def.getRequiredBars()), true);
|
|
||||||
* owner.getActionSender().sendStat(13);
|
|
||||||
* owner.getActionSender().sendInventory(); }
|
|
||||||
*/
|
|
||||||
|
|
||||||
private boolean itemId(int[] ids) {
|
private boolean itemId(int[] ids) {
|
||||||
return DataConversions.inArray(ids, item.getID());
|
return DataConversions.inArray(ids, item.getID());
|
||||||
|
Loading…
Reference in New Issue
Block a user