Author Topic: How to add autocast [for mage]  (Read 58 times)

love claws

  • Full
  • ***
  • Posts: 113
  • I'm here to help!
    • View Profile
How to add autocast [for mage]
« on: January 16, 2011, 08:28:31 am »
Classes Modified: Client.java

Sources: Any Source, Make sure you DONT have autocast


MAKING FULLY WORK AUTOCAST

Code: [Select]
int[] staffs = {1381, 1383, 1385, 1387, 4675};
        int casterX = absX;
        int casterY = absY;
if (GoodDistance(EnemyX, EnemyY, absX, absY, 15)) {
        for(int a = 0; a < staffs.length; a++){
                if(playerEquipment[playerWeapon] == staffs[a] && AutoCast_SpellIndex >= 0){
                        if(System.currentTimeMillis() - lastAttack < coolDown[coolDownGroup[AutoCast_SpellIndex]]){
                                return false;
                        }
                        if (runeGroup[AutoCast_SpellIndex] == 0) {
                                if (!playerHasItemAmount(RequiredRune1[AutoCast_SpellIndex], RequiredAmount1[AutoCast_SpellIndex]) || !playerHasItemAmount(RequiredRune2[AutoCast_SpellIndex], RequiredAmount2[AutoCast_SpellIndex])) {       
                                        sendMessage("You do not have the required runes for this spell!");
                                        ResetAttack();
                                        return false;
                                }       
                        }       
                        if (runeGroup[AutoCast_SpellIndex] == 1) {
                                if (!playerHasItemAmount(RequiredRune1[AutoCast_SpellIndex], RequiredAmount1[AutoCast_SpellIndex]) || !playerHasItemAmount(RequiredRune2[AutoCast_SpellIndex], RequiredAmount2[AutoCast_SpellIndex]) || !playerHasItemAmount(RequiredRune3[AutoCast_SpellIndex], RequiredAmount3[AutoCast_SpellIndex])) {       
                                        sendMessage("You do not have the required runes for this spell!");
                                        ResetAttack();
                                        return false;
                                }       
                        }       
                        if (runeGroup[AutoCast_SpellIndex] == 2) {
                                if (!playerHasItemAmount(RequiredRune1[AutoCast_SpellIndex], RequiredAmount1[AutoCast_SpellIndex]) || !playerHasItemAmount(RequiredRune2[AutoCast_SpellIndex], RequiredAmount2[AutoCast_SpellIndex]) || !playerHasItemAmount(RequiredRune3[AutoCast_SpellIndex], RequiredAmount3[AutoCast_SpellIndex]) || !playerHasItemAmount(RequiredRune4[AutoCast_SpellIndex], RequiredAmount4[AutoCast_SpellIndex])) {       
                                        sendMessage("You do not have the required runes for this spell!");
                                        ResetAttack();
                                        return false;
                                }       
                        }       
                        if(playerLevel[6] < RequiredLevel[AutoCast_SpellIndex]){
                                sendMessage("You need a magic level of " + RequiredLevel[AutoCast_SpellIndex]);
                                ResetAttack();
                                return false;
                        }                       
                        lastAttack = System.currentTimeMillis();
                        hitDiff = misc.random(MageHit[AutoCast_SpellIndex]);
                        if(MagicType[AutoCast_SpellIndex] == 0) {//Projectile
                                setAnimation(animG[animationGroup[AutoCast_SpellIndex]]);
                                gfx100(MageStartingGFX[AutoCast_SpellIndex]);
                                MagicProjectile(absY, absX, offsetY, offsetX, 50, 80, MageMovingGFX[AutoCast_SpellIndex], 43, 31, attacknpc+1, 45);
                                StillMagicGFX(MageEndingGFX[AutoCast_SpellIndex], EnemyY, EnemyX, 90);
                        }
                        if(MagicType[AutoCast_SpellIndex] == 1) {//No Projectile
                                setAnimation(animG[animationGroup[AutoCast_SpellIndex]]);
                                gfx100(MageStartingGFX[AutoCast_SpellIndex]);
                                StillMagicGFX(MageEndingGFX[AutoCast_SpellIndex], EnemyY, EnemyX, 90);
                        }                       
                        if(MagicType[AutoCast_SpellIndex] == 2) {//Ending Only
                                setAnimation(animG[animationGroup[AutoCast_SpellIndex]]);
                                StillMagicGFX(MageEndingGFX[AutoCast_SpellIndex], EnemyY, EnemyX, 90);
                        }               
                        if (runeGroup[AutoCast_SpellIndex] == 0) {
                                deleteItem(RequiredRune1[AutoCast_SpellIndex], getItemSlot(RequiredRune1[AutoCast_SpellIndex]), RequiredAmount1[AutoCast_SpellIndex]);
                                deleteItem(RequiredRune2[AutoCast_SpellIndex], getItemSlot(RequiredRune2[AutoCast_SpellIndex]), RequiredAmount2[AutoCast_SpellIndex]);                       
                        }       
                        if (runeGroup[AutoCast_SpellIndex] == 1) {
                                deleteItem(RequiredRune1[AutoCast_SpellIndex], getItemSlot(RequiredRune1[AutoCast_SpellIndex]), RequiredAmount1[AutoCast_SpellIndex]);
                                deleteItem(RequiredRune2[AutoCast_SpellIndex], getItemSlot(RequiredRune2[AutoCast_SpellIndex]), RequiredAmount2[AutoCast_SpellIndex]);
                                deleteItem(RequiredRune3[AutoCast_SpellIndex], getItemSlot(RequiredRune3[AutoCast_SpellIndex]), RequiredAmount3[AutoCast_SpellIndex]);                       
                        }       
                        if (runeGroup[AutoCast_SpellIndex] == 2) {
                                deleteItem(RequiredRune1[AutoCast_SpellIndex], getItemSlot(RequiredRune1[AutoCast_SpellIndex]), RequiredAmount1[AutoCast_SpellIndex]);
                                deleteItem(RequiredRune2[AutoCast_SpellIndex], getItemSlot(RequiredRune2[AutoCast_SpellIndex]), RequiredAmount2[AutoCast_SpellIndex]);
                                deleteItem(RequiredRune3[AutoCast_SpellIndex], getItemSlot(RequiredRune3[AutoCast_SpellIndex]), RequiredAmount3[AutoCast_SpellIndex]);
                                deleteItem(RequiredRune4[AutoCast_SpellIndex], getItemSlot(RequiredRune4[AutoCast_SpellIndex]), RequiredAmount4[AutoCast_SpellIndex]);                       
                        }
                        TurnPlayerTo(EnemyX, EnemyY);
                        addSkillXP(100 * hitDiff, playerMagic);
                        addSkillXP(50 * hitDiff, playerHitpoints);
                        teleportToX = absX;
                        teleportToY = absY;
                        appearanceUpdateRequired = true; // Updates
                        updateRequired = true;
                        hitUpdateRequired = true;
                        return true;
                }
        }       
}

Declare These

Code: [Select]
public int AutoCast_SpellIndex = -1;
        public int[] coolDownGroup = {
        0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 0, 1
        };
        public long[] coolDown = {
        4000, 6000
        };
        public int[] animationGroup = {
        0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 0, 0,
        1, 1, 1, 1, 2, 2, 2, 2,
        1, 1, 1, 1, 2, 2, 2, 2
        };
        public int[] animG = {
        711, 1978, 1979
        };
        public int[] runeGroup = {//0 = 2
        0, 1, 1, 1, 0, 1, 1, 1,//1 = 3
        0, 1, 1, 1, 0, 1, 1, 1,//2 = 4
        2, 2, 1, 1, 2, 2, 1, 1,
        2, 2, 0, 1, 2, 2, 1, 1
        };
        public int[] MageHit = {
        3, 5, 7, 8, 9, 10, 11, 12,
        13, 14, 15, 16, 17, 18, 19, 20,
        13, 14, 15, 16, 19, 20, 21, 22,
        23, 24, 25, 26, 27, 28, 29, 30
        };
        public int[] MageAB = {
        7038, 7039, 7040, 7041, 7042, 7043, 7044, 7045, //Modern
        7046, 7047, 7048, 7049, 7050, 7051, 7052, 7053, //Modern
        51133, 51185, 51091, 24018, 51159, 51211, 51111, 51069, //Ancient
        51146, 51198, 51102, 51058, 51172, 51224, 51122, 51080 //Ancient
        };
        public int[] MagicType = {
        0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 1, 1, 1, 1,
        1, 1, 1, 1, 2, 2, 2, 2
        };
        public int[] RequiredLevel = {
        1, 5, 9, 13, 17, 23, 29, 35,
        41, 47, 53, 59, 62, 65, 70, 75,
        50, 52, 56, 58, 62, 64, 68, 70,
        74, 76, 80, 82, 86, 88, 92, 94
        };
        public int[] RequiredRune1 = {
        556, 556, 556, 556, 556, 556, 556, 556,
        556, 556, 556, 556, 556, 556, 556, 556,
        562, 562, 562, 562, 562, 562, 562, 562,
        560, 560, 560, 560, 560, 560, 565, 560
        };
        public int[] RequiredAmount1 = {
        1, 1, 1, 2, 2, 2, 2, 3,
        3, 3, 3, 4, 5, 5, 5, 5,
        2, 2, 2, 2, 4, 4, 4, 4,
        2, 2, 2, 2, 4, 4, 4, 4
        };
        public int[] RequiredRune2 = {
        558, 558, 558, 558, 562, 562, 562, 562,
        560, 560, 560, 560, 565, 565, 565, 565,
        560, 560, 560, 560, 560, 560, 560, 560,
        565, 565, 565, 565, 565, 565, 560, 565
        };
        public int[] RequiredAmount2 = {
        1, 1, 1, 1, 1, 1, 1, 1,
        1, 1, 1, 1, 1, 1, 1, 1,
        2, 2, 2, 2, 2, 2, 2, 2,
        2, 2, 4, 2, 2, 2, 4, 2
        };
        public int[] RequiredRune3 = {
        -1, 555, 557, 554, -1, 555, 557, 554,
        -1, 555, 557, 554, -1, 555, 557, 554,
        554, 556, 565, 555, 556, 556, 565, 560,
        554, 556, -1, 555, 556, 556, 566, 555
        };
        public int[] RequiredAmount3 = {
        0, 1, 2, 3, 0, 2, 3, 4,
        0, 3, 4, 5, 0, 7, 7, 7,
        1, 1, 1, 2, 2, 2, 2, 4,
        2, 2, 0, 3, 4, 4, 1, 6
        };
        public int[] RequiredRune4 = {
        -1, -1, -1, -1, -1, -1, -1, -1,
        -1, -1, -1, -1, -1, -1, -1, -1,
        556, 566, -1, -1, 554, 566, -1, -1,
        556, 566, -1, -1, 554, 566, -1, -1
        };
        public int[] RequiredAmount4 = {
        0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 0, 0,
        1, 1, 0, 0, 2, 2, 0, 0,
        2, 2, 0, 0, 4, 3, 0, 0
        };
        public int[] MageStartingGFX = {
        90, 93, 96, 99, 117, 120, 123, 126,
        132, 135, 138, 129, 158, 161, 164, 155,
        -1,-1, -1, -1, -1, -1, -1, -1,
        -1, -1, -1, 366, -1, -1, -1, -1
        };
        public int[] MageMovingGFX = {
        91, 94, 97, 100, 118, 121, 124, 127,
        133, 136, 139, 130, 159, 162, 165, 156,
        384, 378, 372, 360, 386, 380, 374, 362,
        386, 380, 374, -1, -1, -1, -1, -1
        };
        public int[] MageEndingGFX = {
        92, 95, 98, 101, 119, 122, 125, 128,
        134, 137, 140, 131, 160, 163, 166, 157,
        385, 379, 373, 361, 387, 381, 376, 363,
        387, 381, 375, 367, 390, 383, 377, 369
        };

Ctrl + F, Search this


Code: [Select]
case 7038://Wind Strike



Replace the above with this


Code: [Select]
case 7038://Wind Strike
                        case 7039://Water Strike
                        case 7040://Earth Strike
                        case 7041://Fire Strike
                        case 7042://Wind Bolt
                        case 7043://Water Bolt
                        case 7044://Earth Bolt
                        case 7045://Fire Bolt
                        case 7046://Wind Blast
                        case 7047://Water Blast
                        case 7048://Earth Blast
                        case 7049://Fire Blast
                        case 7050://Wain Wave
                        case 7051://Water Wave
                        case 7052://Earth Wave
                        case 7053://Fire Wave
                        case 51133:
                        case 51185:
                        case 51091:
                        case 24018:
                        case 51159:
                        case 51211:
                        case 51111:
                        case 51069:
                        case 51146:
                        case 51198:
                        case 51102:
                        case 51058:
                        case 51172:
                        case 51224:
                        case 51122:
                        case 51080:                       
                        for(int index = 0; index < MageAB.length; index++)
                        {
                                if(actionButtonId == MageAB[index])
                                {
                                        AutoCast_SpellIndex = index;
                                        sendFrame246(329, 200, playerEquipment[playerWeapon]);
                                        sendMessage("Autocasting Activated");
                                        setSidebarInterface(0, 328);
                                }
                        }
                        break;
« Last Edit: January 16, 2011, 08:33:25 am by love claws »
[IMG]http://h1.flashvortex.com/display.php?id=2_1295372213_64613_442_0_728_90_9_1_109[img]

Share on Bluesky Share on Facebook


pker wessel

  • Beginner
  • *
  • Posts: 37
  • I like helping!
  • Location: Netherland
    • View Profile
Re: How to add autocast [for mage]
« Reply #1 on: January 18, 2011, 03:35:24 pm »
post @ suggestions;)
I like helping players!

love claws

  • Full
  • ***
  • Posts: 113
  • I'm here to help!
    • View Profile
Re: How to add autocast [for mage]
« Reply #2 on: January 18, 2011, 03:45:43 pm »
Cant move again
[IMG]http://h1.flashvortex.com/display.php?id=2_1295372213_64613_442_0_728_90_9_1_109[img]

Pizza

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: How to add autocast [for mage]
« Reply #3 on: January 22, 2011, 09:01:06 am »
Okay cool. :)

яσηaℓ∂

  • Junior
  • **
  • Posts: 66
  • MAGIC
  • Location: Bristol
    • View Profile
    • http://www.encryptedx.tk/
Re: How to add autocast [for mage]
« Reply #4 on: January 22, 2011, 05:32:00 pm »
nice where did you get the codes from a website
DO YOU BELIEVE IN MAGIC?