رون سكيب العرب
لتتمكن من الإستمتاع بكافة ما يوفره لك هذا المنتدى , يجب عليك أن تسجل الدخول الى حسابك في المنتدى. إن لم يكن لديك حساب بعد, نتشرف بدعوتك لإنشائه.

رون سكيب العرب
لتتمكن من الإستمتاع بكافة ما يوفره لك هذا المنتدى , يجب عليك أن تسجل الدخول الى حسابك في المنتدى. إن لم يكن لديك حساب بعد, نتشرف بدعوتك لإنشائه.

رون سكيب العرب
هل تريد التفاعل مع هذه المساهمة؟ كل ما عليك هو إنشاء حساب جديد ببضع خطوات أو تسجيل الدخول للمتابعة.


بسم الله الرحمن الرحيم
 
الرئيسيةمجله المنتدىأحدث الصورالتسجيلالعب الآن رون سكيب بأمان 100%البحث السريع والجديد داخل المنتدىعن اللعبةدخول



شاطر | 
 

 [Delta] WoodCutting [EventManager]

استعرض الموضوع التالي استعرض الموضوع السابق اذهب الى الأسفل 
كاتب الموضوعرسالة
Abdullah97

[Delta] WoodCutting [EventManager]  510
Abdullah97

عدد الرسائل : 2672
العمر : 26
التقييم : 16

&لمعاينه معلومات الاعب&
اسم اللاعب: Abdullah97
Combat Level:
[Delta] WoodCutting [EventManager]  Left_bar_bleue138/138[Delta] WoodCutting [EventManager]  Empty_bar_bleue  (138/138)
أوسمة التميز في المنتدى: لا يوجد
[Delta] WoodCutting [EventManager]  Vide
مُساهمةموضوع: [Delta] WoodCutting [EventManager]    [Delta] WoodCutting [EventManager]  Empty2011-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
O.A
ΩĐe2ThΩ

عدد الرسائل : 5587
العمر : 27
التقييم : 69

&لمعاينه معلومات الاعب&
اسم اللاعب: X-De2Th-X
Combat Level:
[Delta] WoodCutting [EventManager]  Left_bar_bleue105/138[Delta] WoodCutting [EventManager]  Empty_bar_bleue  (105/138)
أوسمة التميز في المنتدى: المدير العام المدير العام
[Delta] WoodCutting [EventManager]  Vide
مُساهمةموضوع: رد: [Delta] WoodCutting [EventManager]    [Delta] WoodCutting [EventManager]  Empty2011-08-02, 15:26

ابداع
وكالعاده موضوع متعوب عليه
^^
تسخه سيرفركdelta
غريبه ما ميزتها ^^
الرجوع الى أعلى الصفحة اذهب الى الأسفل
http://i hate the inter net -.-
Abdullah97

[Delta] WoodCutting [EventManager]  510
Abdullah97

عدد الرسائل : 2672
العمر : 26
التقييم : 16

&لمعاينه معلومات الاعب&
اسم اللاعب: Abdullah97
Combat Level:
[Delta] WoodCutting [EventManager]  Left_bar_bleue138/138[Delta] WoodCutting [EventManager]  Empty_bar_bleue  (138/138)
أوسمة التميز في المنتدى: لا يوجد
[Delta] WoodCutting [EventManager]  Vide
مُساهمةموضوع: رد: [Delta] WoodCutting [EventManager]    [Delta] WoodCutting [EventManager]  Empty2011-08-02, 22:35

ΩĐe2ThΩ كتب:
ابداع
وكالعاده موضوع متعوب عليه
^^
تسخه سيرفركdelta
غريبه ما ميزتها ^^

هههههههه اخي

اه سيرفري delta

بس اصلا الديلتا مو كويس

بس انا عدلته كتيييييير

انا عملت السكيلز كلها من جديد و ضايلي

بس

crafting
runecrafting
farming

و يكون سيرفري عنده اكتر من 99% السكيلز كلها شغاله

من دون

process()

و بعدين اعمل كل minigames من اول جديد
الرجوع الى أعلى الصفحة اذهب الى الأسفل
 

[Delta] WoodCutting [EventManager]

استعرض الموضوع التالي استعرض الموضوع السابق الرجوع الى أعلى الصفحة 
صفحة 1 من اصل 1

صلاحيات هذا المنتدى:لاتستطيع الرد على المواضيع في هذا المنتدى
رون سكيب العرب  :: قسم شروح الدخول للسيرفرات والتعامل معها-
المواضيع الأخيرة
» كيف تعمل سيرفير و client 508 بدون تعب وبدون port
[Delta] WoodCutting [EventManager]  Empty2011-12-11, 02:55 من طرف hamada8

» مساااعدتكم بلييز
[Delta] WoodCutting [EventManager]  Empty2011-09-24, 23:06 من طرف alqahtani

» مشكلة مع الmauls أرجوا المساعدة بسرعة
[Delta] WoodCutting [EventManager]  Empty2011-09-23, 23:54 من طرف Solid Snake

» كيف تضيف محل جديد 317
[Delta] WoodCutting [EventManager]  Empty2011-08-28, 02:59 من طرف ΩAmmarΩ

» [Delta] WoodCutting [EventManager]
[Delta] WoodCutting [EventManager]  Empty2011-08-02, 22:35 من طرف Abdullah97

» لكل من يريد أن يعمل سيرفر معي
[Delta] WoodCutting [EventManager]  Empty2011-07-29, 01:29 من طرف X DEATH X

» الشرح الخامس : كيفية ربط السلانيت بالسيرفر
[Delta] WoodCutting [EventManager]  Empty2011-07-28, 23:17 من طرف X DEATH X

» الشرح الأول : الأدوات والملفات الهامة لصنع البرايفيت سيرفر
[Delta] WoodCutting [EventManager]  Empty2011-07-28, 16:46 من طرف X DEATH X

» جمالية رمضان الكريم في منتدانا
[Delta] WoodCutting [EventManager]  Empty2011-07-28, 15:15 من طرف ΩAmmarΩ

» [النسخة الخيالية] - صور لما قبل الإفتتاح.
[Delta] WoodCutting [EventManager]  Empty2011-07-27, 20:31 من طرف زائر