Author Topic: [Galkons/Renamed]100% Ancient Curses Tutorial  (Read 2137 times)

Offline Tampon Abuse

  • Dragon Member
  • *
  • Posts: 193
  • Rep 1
  • All vote for Rune-Kingdom!
  • Location: Oklahoma, Oklahoma City
    • View Profile
[Galkons/Renamed]100% Ancient Curses Tutorial
« on: April 02, 2011, 10:34:27 pm »
Purpose: Adding 100% Ancient Curses Interface
Difficulty: 2/10
Edited Stuff: RSInterface.java & Client.java
Tested On:Galkon's Refactored Client

First we will start with Client.java

Add this in there somewhere
Code: [Select]
public void drawHoverBox(int xPos, int yPos, String text) {
String[] results = text.split("\n");
int height = (results.length * 16) + 6;
int width;
width = smallText.getTextWidth(results[0]) + 6;
for(int i = 1; i < results.length; i++)
if(width <= smallText.getTextWidth(results[i]) + 6)
width = smallText.getTextWidth(results[i]) + 6;
DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
DrawingArea.fillPixels(xPos, width, height, 0, yPos);
yPos += 14;
for(int i = 0; i < results.length; i++) {
smallText.method389(false, xPos + 3, 0, results[i], yPos);
yPos += 16;
}
}


Then underneath
Code: [Select]
if (class9_1.type == 8 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
anInt1315 = class9_1.id;
}

Add this
Code: [Select]
if (class9_1.type == 9 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
anInt1315 = class9_1.id;
}

Then below "else if (class9_1.type == 7)"

add this

if (class9_1.type == 9) {
               drawHoverBox(k2, l2, class9_1.popupString);
            }


Now we are done with Client.java onto RSInterface.java

Add these methods with your other ones
Code: [Select]
public static void addPrayer(int i, int configId, int configFrame, int requiredValues, int prayerSpriteID, String PrayerName, int Hover) {
RSInterface Interface = addTabInterface(i);
Interface.id = i;
Interface.parentID = 22500;
Interface.type = 5;
Interface.atActionType = 4;
Interface.contentType = 0;
Interface.aByte254 = 0;
Interface.mOverInterToTrigger = Hover;
Interface.sprite1 = imageLoader(0, "Curses/GLOW");
Interface.sprite2 = imageLoader(1, "Curses/GLOW");
Interface.width = 34;
Interface.height = 34;
Interface.anIntArray245 = new int[1];
Interface.anIntArray212 = new int[1];
Interface.anIntArray245[0] = 1;
Interface.anIntArray212[0] = configId;
Interface.valueIndexArray = new int[1][3];
Interface.valueIndexArray[0][0] = 5;
Interface.valueIndexArray[0][1] = configFrame;
Interface.valueIndexArray[0][2] = 0;
Interface.tooltip = "Activate@or1@ " + PrayerName;
Interface = addTabInterface(i + 1);
Interface.id = i + 1;
Interface.parentID = 22500;
Interface.type = 5;
Interface.atActionType = 0;
Interface.contentType  = 0;
Interface.aByte254 = 0;
Interface.sprite1 = imageLoader(prayerSpriteID, "Curses/PRAYON");
Interface.sprite2 = imageLoader(prayerSpriteID, "Curses/PRAYOFF");
Interface.width = 34;
Interface.height = 34;
Interface.anIntArray245 = new int[1];
Interface.anIntArray212 = new int[1];
Interface.anIntArray245[0] = 2;
Interface.anIntArray212[0] = requiredValues + 1;
Interface.valueIndexArray = new int[1][3];
Interface.valueIndexArray[0][0] = 2;
Interface.valueIndexArray[0][1] = 5;
Interface.valueIndexArray[0][2] = 0;
}
public static void addText(int i, String s,int k, boolean l, boolean m, int a,TextDrawingArea[] TDA, int j, int dsc) {
RSInterface rsinterface = addTabInterface(i);
rsinterface.parentID = i;
rsinterface.id = i;
rsinterface.type = 4;
rsinterface.atActionType = 1;
rsinterface.width = 174;
rsinterface.height = 11;
rsinterface.contentType = 0;
rsinterface.aByte254 = 0;
rsinterface.mOverInterToTrigger = a;
rsinterface.centerText = l;
rsinterface.textShadow = m;
rsinterface.textDrawingAreas = TDA[j];
rsinterface.message = s;
rsinterface.aString228 = "";
rsinterface.anInt219 = 0;
rsinterface.textColor = k;
rsinterface.anInt216 = dsc;
rsinterface.tooltip = s;
}
public static void setBounds(int ID, int X, int Y, int frame, RSInterface RSinterface){
RSinterface.children[frame] = ID;
RSinterface.childX[frame] = X;
RSinterface.childY[frame] = Y;
}

public static void setChildren(int total,RSInterface i){
i.children = new int[total];
i.childX = new int[total];
i.childY = new int[total];
}
public static void addTooltipBox(int id, String text) {
RSInterface rsi = addTabInterface(id);
rsi.id = id;
rsi.parentID = id;
rsi.type = 9;
rsi.popupString = text;
}

public static void addTooltip(int id, String text, int H, int W) {
RSInterface rsi = addTabInterface(id);
rsi.id = id;
rsi.type = 0;
rsi.isMouseoverTriggered = true;
rsi.mOverInterToTrigger = -1;
addTooltipBox(id + 1, text);
rsi.totalChildren(1);
rsi.child(0, id + 1, 0, 0);
rsi.height = H;
rsi.width = W;
}

Then add the interface code itself
Code: [Select]
public static void Curses(TextDrawingArea[] TDA) {
RSInterface Interface = addTabInterface(22500);
int index = 0;
setChildren(62, Interface);
addText(22501, "99/99", 0xFF981F, false, false, -1, TDA, 1);
/*Top Row*/
addPrayer(22503, 0, 83, 49, 7, "Protect Item", 22542);
setBounds(22503, 2, 5, index, Interface);index++;//Glow
setBounds(22504, 8, 8, index, Interface);index++;//Icon
addPrayer(22505, 0, 84, 49, 4, "Sap Warrior", 22544);
setBounds(22505, 40, 5, index, Interface);index++;//Glow
setBounds(22506, 47, 12, index, Interface);index++;//Icon
addPrayer(22507, 0, 85, 51, 5, "Sap Ranger", 22546);
setBounds(22507, 76, 5, index, Interface);index++;//Glow
setBounds(22508, 82, 11, index, Interface);index++;//Icon
addPrayer(22509, 0, 101, 53, 3, "Sap Mage", 22548);
setBounds(22509, 113, 5, index, Interface);index++;//Glow
setBounds(22510, 116, 8, index, Interface);index++;//Icon
addPrayer(22511, 0, 102, 55, 2, "Sap Spirit", 22550);
setBounds(22511, 150, 5, index, Interface);index++;//Glow
setBounds(22512, 155, 10, index, Interface);index++;//Icon
/*2nd Row*/
addPrayer(22513, 0, 86, 58, 18, "Berserker", 22552);
setBounds(22513, 2, 45, index, Interface);index++;//Glow
setBounds(22514, 9, 48, index, Interface);index++;//Icon
addPrayer(22515, 0, 87, 61, 15, "Deflect Summoning", 22554);
setBounds(22515, 39, 45, index, Interface);index++;//Glow
setBounds(22516, 42, 47, index, Interface);index++;//Icon
addPrayer(22517, 0, 88, 64, 17, "Deflect Magic", 22556);
setBounds(22517, 76, 45, index, Interface);index++;//Glow
setBounds(22518, 79, 48, index, Interface);index++;//Icon
addPrayer(22519, 0, 89, 67, 16, "Deflect Missiles", 22558);
setBounds(22519, 113, 45, index, Interface);index++;//Glow
setBounds(22520, 116, 48, index, Interface);index++;//Icon
addPrayer(22521, 0, 90, 70, 6, "Deflect Melee", 22560);
setBounds(22521, 151, 45, index, Interface);index++;//Glow
setBounds(22522, 154, 48, index, Interface);index++;//Icon
/*3rd Row*/
addPrayer(22523, 0, 91, 73, 9, "Leech Attack", 22562);
setBounds(22523, 2, 82, index, Interface);index++;//Glow
setBounds(22524, 6, 86, index, Interface);index++;//Icon
addPrayer(22525, 0, 103, 75, 10, "Leech Ranged", 22564);
setBounds(22525, 40, 82, index, Interface);index++;//Glow
setBounds(22526, 42, 86, index, Interface);index++;//Icon
addPrayer(22527, 0, 104, 77, 11, "Leech Magic", 22566);
setBounds(22527, 77, 82, index, Interface);index++;//Glow
setBounds(22528, 79, 86, index, Interface);index++;//Icon
addPrayer(22529, 0, 92, 79, 12, "Leech Defence", 22568);
setBounds(22529, 114, 83, index, Interface);index++;//Glow
setBounds(22530, 119, 87, index, Interface);index++;//Icon
addPrayer(22531, 0, 93, 81, 13, "Leech Strength", 22570);
setBounds(22531, 153, 83, index, Interface);index++;//Glow
setBounds(22532, 156, 86, index, Interface);index++;//Icon
/*Bottom Row*/
addPrayer(22533, 0, 94, 83, 14, "Leech Energy", 22572);
setBounds(22533, 2, 120, index, Interface);index++;//Glow
setBounds(22534, 7, 125, index, Interface);index++;//Icon
addPrayer(22535, 0, 95, 85, 19, "Leech Special Attack", 22574);
setBounds(22535, 40, 120, index, Interface);index++;//Glow
setBounds(22536, 45, 124, index, Interface);index++;//Icon
addPrayer(22537, 0, 96, 88, 1, "Wrath", 22576);
setBounds(22537, 78, 120, index, Interface);index++;//Glow
setBounds(22538, 86, 124, index, Interface);index++;//Icon
addPrayer(22539, 0, 97, 91, 8, "Soul Split", 22578);
setBounds(22539, 114, 120, index, Interface);index++;//Glow
setBounds(22540, 120, 125, index, Interface);index++;//Icon
addPrayer(22541, 0, 105, 94, 0, "Turmoil", 22580);
setBounds(22541, 151, 120, index, Interface);index++;//Glow
setBounds(22542, 153, 127, index, Interface);index++;//Icon
/*Prayer Icon/Text*/
addSprite(22502, 0, "Curses/ICON");
setBounds(22501, 85, 241, index, Interface);index++;//Text
setBounds(22502, 65, 241, index, Interface);index++;//Icon
/*Tooltips/Hover Boxes*/
addTooltip(22542, "Level 50\nProtect Item\nKeep 1 extra item if you die", 100, 150);
addTooltip(22544, "Level 50\nSap Warrior\nDrains 10% of enemy Attack,\nStrength and Defence,\nincreasing to 20% over time", 100, 150);
addTooltip(22546, "Level 52\nSap Ranger\nDrains 10% of enemy Ranged\nand Defence, increasing to 20%\nover time", 100, 175);
addTooltip(22548, "Level 54\nSap Mage\nDrains 10% of enemy Magic\nand Defence, increasing to 20%\nover time", 100, 175);
addTooltip(22550, "Level 56\nSap Spirit\nDrains enenmy special attack\nenergy", 100, 175);
addTooltip(22552, "Level 59\nBerserker\nBoosted stats last 15% longer", 100, 175);
addTooltip(22554, "Level 62\nDeflect Summoning\nReduces damage dealt from\nSummoning scrolls, prevents the\nuse of a familiar's special\nattack, and can deflect some of\ndamage back to the attacker", 125, 175);
addTooltip(22556, "Level 65\nDeflect Magic\nProtects against magical attacks\nand can deflect some of the\ndamage back to the attacker", 100, 175);
addTooltip(22558, "Level 68\nDeflect Missiles\nProtects against ranged attacks\nand can deflect some of the\ndamage back to the attacker", 100, 175);
addTooltip(22560, "Level 71\nDeflect Melee\nProtects against melee attacks\nand can deflect some of the\ndamage back to the attacker", 100, 175);
addTooltip(22562, "Level 74\nLeech Attack\nBoosts Attack by 5%, increasing\nto 10% over time, while draining\nenemy Attack by 10%,\nincreasing to 25% over time", 100, 175);
addTooltip(22564, "Level 76\nLeech Ranged\nBoosts Ranged by 5%, increasing\nto 10% over time,\nwhile draining enemy Ranged by\n10%, increasing to 25% over\ntime", 113, 175);
addTooltip(22566, "Level 78\nLeech Magic\nBoosts Magic by 5%, increasing\nto 10% over time, while draining\nenemy Magic by 10%, increasing\nto 25% over time", 100, 175);
addTooltip(22568, "Level 80\nLeech Defence\nBoosts Defence by 5%, increasing\nto 10% over time,\nwhile draining enemy Defence by\n10%, increasing to 25% over\ntime", 113, 180);
addTooltip(22570, "Level 82\nLeech Strength\nBoosts Strength by 5%, increasing\nto 10% over time,\nwhile draining enemy Strength by\n10%, increasing to 25% over\ntime", 113, 180);
addTooltip(22572, "Level 84\nLeech Energy\nDrains enemy run energy, while\nincreasing your own", 113, 180);
addTooltip(22574, "Level 86\nLeech Special Attack\nDrains enemy special attack\nenergy, while increasing your\nown", 113, 180);
addTooltip(22576, "Level 89\nWrath\nInflicts damage to nearby\ntargets if you die", 113, 180);
addTooltip(22578, "Level 92\nSoul Split\n1/4 of damage dealt is\nalso removed from\nopponent's Prayer and added to\nyour Hitpoints", 113, 180);
addTooltip(22580, "Level 95\nTurmoil\nIncreases Attack and Defence\nby 15%, plus 15% of enemy's\nlevel, and Strength by 23% plus\n10% of enemy's level", 113, 180);
setBounds(22542, 10, 40, index, Interface);index++;
setBounds(22544, 20, 40, index, Interface);index++;
setBounds(22546, 20, 40, index, Interface);index++;
setBounds(22548, 20, 40, index, Interface);index++;
setBounds(22550, 20, 40, index, Interface);index++;
setBounds(22552, 10, 80, index, Interface);index++;
setBounds(22554, 10, 80, index, Interface);index++;
setBounds(22556, 10, 80, index, Interface);index++;
setBounds(22558, 10, 80, index, Interface);index++;
setBounds(22560, 10, 80, index, Interface);index++;
setBounds(22562, 10, 120, index, Interface);index++;
setBounds(22564, 10, 120, index, Interface);index++;
setBounds(22566, 10, 120, index, Interface);index++;
setBounds(22568, 5, 120, index, Interface);index++;
setBounds(22570, 5, 120, index, Interface);index++;
setBounds(22572, 10, 160, index, Interface);index++;
setBounds(22574, 10, 160, index, Interface);index++;
setBounds(22576, 10, 160, index, Interface);index++;
setBounds(22578, 10, 160, index, Interface);index++;
setBounds(22580, 10, 160, index, Interface);index++;
}

Add the unpacker
Code: [Select]
Curses(textDrawingAreas);
Then add these Sprites to your Sprite folder in the Folder "Curses"

Tell me if i missed a method

This is my very first interface so let me know how you think i did
Enjoy Ancient Curses

CREDITS
K4rn4ge - For taking time on making the interface 100%
Stewie- For the methods i used from him
Palidino- Sprite Dump
Galkon- His tooltip thread (helped me bunches)
Me- Making a tutorial on how exactly to do it, with fixed methods, and tutorialization :smiley:


-Tampon Abuse|Brandon


Everyone Vote For RUNE-KINGDOM at http://www.mmorpgtop200.com/in.php?site=6792

Share on Bluesky Share on Facebook


Offline ping pong

  • Bronze Member
  • *
  • Posts: 8
  • Rep 0
    • View Profile
Re: [Galkons/Renamed]100% Ancient Curses Tutorial
« Reply #1 on: April 07, 2011, 07:44:12 pm »
I believe there's a client section for this? But OT: pretty good bro. Ill most likely be using.

Offline RawK

  • Bronze Member
  • *
  • Posts: 14
  • Rep 0
    • View Profile
Re: [Galkons/Renamed]100% Ancient Curses Tutorial
« Reply #2 on: April 09, 2011, 01:37:13 am »
Im pretty sure this was just released on r-s  :hurr:


Unless i say it is my work it isnt <3

Offline Vesta

  • Bronze Member
  • *
  • Posts: 3
  • Rep 0
    • View Profile
Re: [Galkons/Renamed]100% Ancient Curses Tutorial
« Reply #3 on: April 09, 2011, 03:18:25 am »
Im pretty sure this was just released on r-s  :hurr:

Saw this on mopar.