what..?
|
Base: Project Insanity.
Problem: I need my method support the code bellow.
Errors(Compiling Errors): No errors.
Other Information/Media(Pictures, etc): I need my method to support my code bellow becuase it doesn't do that at the moment. At the moment it does support cases.
My method which needs to support the code bellow:
Code which needs to be supported in the method:Code:public static void ItemonObject(Client c, int objectID, int objectX, int objectY, int itemId) { if (!c.getItems().playerHasItem(itemId, 1)) return; switch(objectID) { case ####: break; default: if(c.playerRights == 3) Misc.println("Player At Object id: "+objectID+" with Item id: "+itemId); break; } }
Code:if (c.objectId == 12102 || c.objectId == 12269 || c.objectId == 8712 || c.objectId == 9085 || c.objectId == 9086 || c.objectId == 9087 || c.objectId == 2728 || c.objectId == 2729 || c.objectId == 2730 || c.objectId == 2731 || c.objectId == 2859 || c.objectId == 3039 || c.objectId == 5275 || c.objectId == 114 || c.objectId == 8750) { if((itemId == 2132 || itemId == 2134 || itemId == 2136 || itemId == 2138 || itemId == 317 || itemId == 383 || itemId == 321 || itemId == 2307|| itemId == 327 || itemId == 345 || itemId == 335 || itemId == 349 || itemId == 331 || itemId == 359 || itemId == 377 || itemId == 389 || itemId == 371 || itemId == 7944)){ if(c.goodDistance(c.usedOnobjectX, c.usedOnobjectY, c.getX(), c.getY(), 1)) { c.CookFishName = Server.getItemManager().getItemDefinition(itemId).getName(); c.CookingEmote = 883; c.getPA().openCookDialogue(itemId); } } } if (c.objectId == 2732 || c.objectId == 3038 || c.objectId == 3769 || c.objectId == 3775 || c.objectId == 4265 || c.objectId == 4266 || c.objectId == 5499 || c.objectId == 5249 || c.objectId == 5631 || c.objectId == 5632 || c.objectId == 5981) { if((itemId == 383 || itemId == 2132 || itemId == 2134 || itemId == 2136 || itemId == 2138 || itemId == 317 || itemId == 321 || itemId == 2307|| itemId == 327 || itemId == 345 || itemId == 335|| itemId == 349 || itemId == 331 || itemId == 359 || itemId == 377 || itemId == 389 || itemId == 371 || itemId == 7944)){ if(c.goodDistance(c.usedOnobjectX, c.usedOnobjectY, c.getX(), c.getY(), 1)) { c.CookFishName = Server.getItemManager().getItemDefinition(itemId).getName(); c.CookingEmote = 897; c.getPA().openCookDialogue(itemId); } } }
Think he means he wants it in cases...
Rubbish way to do it though...Code:case 12102: case 12269: case 8712: case 9085: case 9086: case 9087: case 2728: case 2729: case 2730: case 2731: case 2859: case 3039: case 5275: case 114: case 8750: if ((itemId == 2132 || itemId == 2134 || itemId == 2136 || itemId == 2138 || itemId == 317 || itemId == 383 || itemId == 321 || itemId == 2307 || itemId == 327 || itemId == 345 || itemId == 335 || itemId == 349 || itemId == 331 || itemId == 359 || itemId == 377 || itemId == 389 || itemId == 371 || itemId == 7944)) { if (c.goodDistance(c.usedOnobjectX, c.usedOnobjectY, c.getX(), c.getY(), 1)) { // c.CookFishName = // Server.getItemManager().getItemDefinition(itemId).getName(); // c.CookingEmote = 883; // c.getPA().openCookDialogue(itemId); } } break;
Only didCode:private static final int[] COOKING_OBJECT_IDS = { 12102, 12269, 8712, 9085, 9086, 9087, 2728, 2729, 2730, 2731, 2859, 3039, 275, 114, 8750 }; private static final int[] COOKING_ITEM_IDS = { 2132, 2134, 2136, 2138, 217, 283, 231, 2307, 327, 345, 335, 349, 331, 359, 377, 389, 371, 7944 }; public static void ItemonObject(Client c, int objectID, int objectX, int objectY, int itemId) { if (!c.getItems().playerHasItem(itemId, 1)) return; for (int a : COOKING_OBJECT_IDS) { if (objectID == a) { for (int b : COOKING_ITEM_IDS) { if (itemId == b) { if (c.goodDistance(c.usedOnobjectX, c.usedOnobjectY, c.getX(), c.getY(), 1)) { c.CookFishName = Server.getItemManager().getItemDefinition(itemId).getName(); c.CookingEmote = 883; c.getPA().openCookDialogue(itemId); } break; } } break; } } switch (objectID) { default: if (c.playerRights == 3) Misc.println("Player At Object id: " + objectID + " with Item id: " + itemId); break; } }
Not the last last one, you can do that one yourself.Code:if (c.objectId == 12102 || c.objectId == 12269 || c.objectId == 8712 || c.objectId == 9085 || c.objectId == 9086 || c.objectId == 9087 || c.objectId == 2728 || c.objectId == 2729 || c.objectId == 2730 || c.objectId == 2731 || c.objectId == 2859 || c.objectId == 3039 || c.objectId == 5275 || c.objectId == 114 || c.objectId == 8750) { if((itemId == 2132 || itemId == 2134 || itemId == 2136 || itemId == 2138 || itemId == 317 || itemId == 383 || itemId == 321 || itemId == 2307|| itemId == 327 || itemId == 345 || itemId == 335 || itemId == 349 || itemId == 331 || itemId == 359 || itemId == 377 || itemId == 389 || itemId == 371 || itemId == 7944)){ if(c.goodDistance(c.usedOnobjectX, c.usedOnobjectY, c.getX(), c.getY(), 1)) { c.CookFishName = Server.getItemManager().getItemDefinition(itemId).getName(); c.CookingEmote = 883; c.getPA().openCookDialogue(itemId); } } }
Code:for (int a : COOKING_OBJECT_IDS) { if (objectID == a) { c.sendMessage("IM CLICKING A COOKING OBJECT!"); for (int b : COOKING_ITEM_IDS) { if (itemId == b) { c.sendMessage("IM CLICKING A COOKING ITEM AND OBJECT"); if (c.goodDistance(c.usedOnobjectX, c.usedOnobjectY, c.getX(), c.getY(), 1)) { c.sendMessage("IM DOING WHAT EVER THE FUCK I SHOULD BE DOING WITH THIS COOKING STUFF!"); c.CookFishName = Server.getItemManager().getItemDefinition(itemId).getName(); c.CookingEmote = 883; c.getPA().openCookDialogue(itemId); } break; } } break; } }
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |