Abdullah97
عدد الرسائل : 2672 العمر : 27 التقييم : 16
&لمعاينه معلومات الاعب& اسم اللاعب: Abdullah97 Combat Level: (138/138) أوسمة التميز في المنتدى: لا يوجد
| موضوع: [Delta] WoodCutting [EventManager] 2011-08-02, 09:06 | |
| بسم الله الرحمن الرحيم السلام عليكم و رحمت الله و بركاته هذه النظام استخدمه لسيرفري و حبيت اعطيكم اياه ابداوا بحط هذه الاكواد بملف اسمه Woodcutting.java - الكود:
-
/** ** Woodcutting base for Delta. ** * @author RuneSpace(mining base) , edited by Pkers World Version 1.1 **/
public class Woodcutting { private client c = null; public double expRate; public boolean isWoodcutting; public int treeId; public int tree2Id; public int logId; public int emoteId; public int expAmount; public long wcDelay; public long lastSuccess; /** ** axe ID's Simple stuff **/ public int[] axeIds = { 1349, 1351, 1353, 1361, 1355, 1357, 1359, 6739 };
public Woodcutting(client client) { this.c = client; this.isWoodcutting = false; this.logId = -1; this.tree2Id = -1; this.emoteId = 0x284; this.expRate = 1.0; this.wcDelay = -1; }
/** ** Identifies the Client Class **/
public client cclass() { return c; }
/** ** Sets axe Level Requirements **/ public int geaxeReq() { switch (getaxeId()) { case 1349: case 1351: return 1; case 1353: case 1361: return 6; case 1355: return 21; case 1357: return 31; case 1359: return 41; case 6739: return 61; default: // Anything Else. return 1; } }
public int getaxeId() { for (int i = 0; i < axeIds.length; i ) { if (cclass().playerEquipment[cclass().playerWeapon] == axeIds[i] || cclass().playerHasItem(axeIds[i])) { return axeIds[i]; } } return -1; }
/** ** Messages sent to player If does not have axe, Not high enough level etc **/
public void sM(final int msgIndex) { switch (msgIndex) { case 0: cclass().sM("You need an Axe to cut this tree."); cclass().sM( "You do not have an Axe which you have the Woodcutting level to use."); break; case 1: cclass().sM( "You've just advanced a Woodcutting level! You have reached level " getWoodcuttingLevel() "."); break; case 2: cclass().sM("You start cutting the tree."); break; case 3: break; case 4: cclass().sM("Your inventory is too full to hold any more logs."); break; default: cclass().sM("Woodcutting - exception in method: sM(int)"); break; } }
public int getWoodcuttingLevel() { return cclass().playerLevel[cclass().playerWoodcutting]; }
/** ** Resets the woodcutting methods used when invents full etc **/ public void reset() { this.isWoodcutting = false; this.tree2Id = -1; this.emoteId = 0x284; this.wcDelay = -1; }
public void startWC(int tree2Id) { this.tree2Id = tree2Id; if (getReq() > getWoodcuttingLevel()) { cclass().sM( "You need a Woodcutting level of " getReq() " to cut this tree."); return; } if (getaxeId() == -1 || (geaxeReq() > getWoodcuttingLevel())) { sM(0); return; } if (cclass().freeSlots() == 0) { sM(4); return; } if (!wieldAxe()) { int axeId = getaxeId(); cclass().deleteItem(axeId, 1); cclass().addItem(cclass().playerEquipment[cclass().playerWeapon], 1); cclass().playerEquipment[cclass().playerWeapon] = axeId; cclass().playerEquipmentN[cclass().playerWeapon] = 1; cclass().setEquipment( cclass().playerEquipment[cclass().playerWeapon], cclass().playerEquipmentN[cclass().playerWeapon], cclass().playerWeapon); } cclass().pEmote = this.emoteId; this.isWoodcutting = true; this.emoteId = 0x284; this.wcDelay = System.currentTimeMillis(); sM(2); }
public long getTreeDelay() { switch (tree2Id) { case 1276: case 1277: case 1278: case 1279: case 1280: case 1330: case 1332: case 3033: case 3034: case 3035: case 3036: case 3879: case 3881: case 3882: case 3883: case 1315: case 1316: case 1318: case 1319: case 1282: case 1283: case 1284: case 1285: case 1286: case 1287: case 1289: case 1290: case 1291: case 1365: case 1383: case 1384: case 5902: case 5903: case 5904: case 2023: return 2300; case 1281: case 3037: return 2800; case 1308: case 5551: case 5552: case 5553: case 1292: return 3000; case 1307: case 4674: case 2289: case 4060: return 3250; case 1309: return 6500; case 1306: return 7500; default: return 2300; } }
public int gettree2Id() { switch (tree2Id) { case 1276: case 1277: case 1278: case 1279: case 1280: case 1330: case 1332: case 3033: case 3034: case 3035: case 3036: case 3879: case 3881: case 3882: case 3883: case 1315: case 1316: case 1318: case 1319: case 1282: case 1283: case 1284: case 1285: case 1286: case 1287: case 1289: case 1290: case 1291: case 1365: case 1383: case 1384: case 5902: case 5903: case 5904: return 1511; case 2023: return 2862; case 1281: case 3037: return 1521; case 1308: case 5551: case 5552: case 5553: return 1519; case 1292: return 771; case 1307: case 4674: return 1517; case 2289: case 4060: return 3239; case 1309: return 1515; case 1306: return 1513; default: // Other Trees cclass().sM("You cannot cut this tree , contact an Admin."); } return 0; }
public int getlogId() { switch (tree2Id) { case 1276: case 1277: case 1278: case 1279: case 1280: case 1330: case 1332: case 3033: case 3034: case 3035: case 3036: case 3879: case 3881: case 3882: case 3883: case 1315: case 1316: case 1318: case 1319: case 1282: case 1283: case 1284: case 1285: case 1286: case 1287: case 1289: case 1290: case 1291: case 1365: case 1383: case 1384: case 5902: case 5903: case 5904: return 1511; case 2023: return 2862; case 1281: case 3037: return 1521; case 1308: case 5551: case 5552: case 5553: return 1519; case 1292: return 771; case 1307: case 4674: return 1517; case 2289: case 4060: return 3239; case 1309: return 1515; case 1306: return 1513; default: // Other Trees cclass().sM("You cannot cut this tree , contact an Admin."); } return 0; }
public double getExp() { switch (tree2Id) { case 1276: case 1277: case 1278: case 1279: case 1280: case 1330: case 1332: case 3033: case 3034: case 3035: case 3036: case 3879: case 3881: case 3882: case 3883: case 1315: case 1316: case 1318: case 1319: case 1282: case 1283: case 1284: case 1285: case 1286: case 1287: case 1289: case 1290: case 1291: case 1365: case 1383: case 1384: case 5902: case 5903: case 5904: return 2500; case 2023: return 2500; case 1281: case 3037: return 2700; case 1308: case 5551: case 5552: case 5553: return 4050; case 1292: return 100; case 1307: case 4674: return 5000; case 2289: case 4060: return 830; case 1309: return 7150; case 1306: return 12000; default: return 1; } }
public int getReq() { switch (tree2Id) { case 1276: case 1277: case 1278: case 1279: case 1280: case 1330: case 1332: case 3033: case 3034: case 3035: case 3036: case 3879: case 3881: case 3882: case 3883: case 1315: case 1316: case 1318: case 1319: case 1282: case 1283: case 1284: case 1285: case 1286: case 1287: case 1289: case 1290: case 1291: case 1365: case 1383: case 1384: case 5902: case 5903: case 5904: return 1; case 2023: return 1; case 1281: case 3037: return 15; case 1308: case 5551: case 5552: case 5553: return 30; case 1292: return 36; case 1307: case 4674: return 45; case 2289: case 4060: return 45; case 1309: return 60; case 1306: return 75; default: return 1; } }
public boolean clickOnTree(int objectId) { switch (objectId) { case 1276: case 1277: case 1278: case 1279: case 1280: case 1330: case 1332: case 3033: case 3034: case 3035: case 3036: case 3879: case 3881: case 3882: case 3883: case 1315: case 1316: case 1318: case 1319: case 1282: case 1283: case 1284: case 1285: case 1286: case 1287: case 1289: case 1290: case 1291: case 1365: case 1383: case 1384: case 5902: case 5903: case 5904: case 2023: case 1281: case 3037: case 1308: case 5551: case 5552: case 5553: case 1292: case 1307: case 4674: case 2289: case 4060: case 1309: case 1306: return true; default: return false; } }
public boolean wieldAxe() { switch (cclass().playerEquipment[cclass().playerWeapon]) { case 1349: case 1353: case 1351: case 1361: case 1355: case 1357: case 1359: case 6739: return true; default: return false; } }
public void WCProcess() { if (getaxeId() == -1 || (geaxeReq() > getWoodcuttingLevel())) return; if (((System.currentTimeMillis() - wcDelay) >= getTreeDelay()) && (isWoodcutting)) { int currentLevel = getWoodcuttingLevel(); cclass().addItem(getlogId(), 1); cclass().sM( "You get some " cclass().getItemName(getlogId()).toLowerCase() "."); cclass().addSkillXP((int) Math.floor(getExp() * expRate), cclass().playerWoodcutting); if (currentLevel < getWoodcuttingLevel()) sM(1); cclass().pEmote = this.emoteId; cclass().savegame(true); this.wcDelay = System.currentTimeMillis(); if (cclass().freeSlots() == 0) { sM(4); reset(); cclass().resetAnimation(); return; } } } } و الان افتحوا client.java و ضيفوا هذه الكود - الكود:
-
private Woodcutting Woodcutting = new Woodcutting(this); public Woodcutting WC() { return Woodcutting; } [code] الان تحت [code] public boolean CheckObjectSkill(int objectID) {[/code] [code] و بهذاك الكود تحت [code] default: GoFalse = true; break; }[/code] ضيفوا [code] if (WC().clickOnTree(objectID)) { EventManager.getSingleton().addEvent( new Event() { public void execute(EventContainer c) { WC().WCProcess(); if (!WC().isWoodcutting) { c.stop(); } } }, 600); // WC().startWC(objectID); }[/code] تحت الكود [code] public void logout() {[/code] ضيفوا [code]if (WC().isWoodcutting){ WC().reset(); }[/code] و نفس الشيء تحت [code] case 98:[/code] و [code] case 87:[/code] و الان انتهينا جربوا و اكتبوا اي خطا |
|
ΩĐe2ThΩ O.A
عدد الرسائل : 5587 العمر : 28 التقييم : 69
&لمعاينه معلومات الاعب& اسم اللاعب: X-De2Th-X Combat Level: (105/138) أوسمة التميز في المنتدى: المدير العام
| موضوع: رد: [Delta] WoodCutting [EventManager] 2011-08-02, 15:26 | |
| ابداع وكالعاده موضوع متعوب عليه ^^ تسخه سيرفركdelta غريبه ما ميزتها ^^ |
|
Abdullah97
عدد الرسائل : 2672 العمر : 27 التقييم : 16
&لمعاينه معلومات الاعب& اسم اللاعب: Abdullah97 Combat Level: (138/138) أوسمة التميز في المنتدى: لا يوجد
| موضوع: رد: [Delta] WoodCutting [EventManager] 2011-08-02, 22:35 | |
| - ΩĐe2ThΩ كتب:
- ابداع
وكالعاده موضوع متعوب عليه ^^ تسخه سيرفركdelta غريبه ما ميزتها ^^ هههههههه اخي اه سيرفري delta بس اصلا الديلتا مو كويس بس انا عدلته كتيييييير انا عملت السكيلز كلها من جديد و ضايلي بس crafting runecrafting farming و يكون سيرفري عنده اكتر من 99% السكيلز كلها شغاله من دون process() و بعدين اعمل كل minigames من اول جديد |
|