Difficulty: 3/10
Purpose: To add the skull gfx and skull to magic tab.
Files edited: Client Side: class23.java, Class30_Sub2_Sub1_Sub1.java Server Side: Client.java
Procedure:
[size=16pt]Client Side![/size]
Here is the first part. You need this to make the client read the gfx as gfx number WHATEVERYOUWANTHERE.
Open up class23.java.
For the first part you want to replace your whole method264 with this one.
What this does is it makes the client read the model as gfx number which ever one you chose.
Code:
case WHATEVERGFXNUMBERYOUWANT: /* gfx ID veng */
originalDataID = 342; // you can change this , this id makes it spin ;)
gfx.anInt405 = 1828; /* Model ID 16828*/
break;
Obviously change the WHATEVERGFXNUMBERYOUWANT to whatever gfx number you want.
Code:
public static void method264(int i, Class44 class44)
{
Class30_Sub2_Sub2 class30_sub2_sub2 = new Class30_Sub2_Sub2(class44.method571("spotanim.dat", null), 891);
if(i != 0)
{
aBoolean401 = !aBoolean401;
}
int newSpotAnimCount = 1;
/* Yarnova: Raise this by one every time you add a new GFX */
anInt402 = class30_sub2_sub2.method410() + newSpotAnimCount;
if(aClass23Array403 == null)
{
aClass23Array403 = new Class23[anInt402];
}
for(int j = 0; j < anInt402; j++)
{
if(aClass23Array403[j] == null)
{
aClass23Array403[j] = new Class23();
}
aClass23Array403[j].anInt404 = j;
int originalDataID = -1;
Class23 gfx = aClass23Array403[j];
switch(j)
{
case 642: /* Item ID -Yarnova */
originalDataID = 6;
gfx.anInt405 = 3102; /* Model ID -Yarnova */
break;
case WHATEVERGFXNUMBERYOUWANT: /* gfx ID veng */
originalDataID = 342; // you can change this , this id makes it spin ;)
gfx.anInt405 = 1828; /* Model ID 16828*/
break;
default:
originalDataID = -1;
break;
}
if(originalDataID != -1)
{
gfx.anInt406 = aClass23Array403[originalDataID].anInt406;
if(Class20.aClass20Array351 != null)
{
gfx.aClass20_407 = Class20.aClass20Array351[gfx.anInt406];
}
gfx.anInt410 = aClass23Array403[originalDataID].anInt410;
gfx.anInt411 = aClass23Array403[originalDataID].anInt411;
gfx.anInt412 = aClass23Array403[originalDataID].anInt412;
gfx.anInt413 = aClass23Array403[originalDataID].anInt413;
gfx.anInt414 = aClass23Array403[originalDataID].anInt414;
gfx.anIntArray408 = aClass23Array403[originalDataID].anIntArray408;
gfx.anIntArray409 = aClass23Array403[originalDataID].anIntArray409;
} else
{
gfx.method265(true, class30_sub2_sub2);
}
}
}
Now save and exit.
Now you want to add this model to your client's model folder. This will be the model that the method you just added to class23.java, therefore adding the vengeance animation on top of you head.
Model: http://www.megaupload.com/?d=0R8GMHI9
http://**********/LL27M9
Now that you have done that save and compile.
Now load up your client, log in and type "add models". It should tell you how to add models if not please tell me. This will make it so the client now recognizes your model you added for vengeance skull. After you finish that exit your client.
For the second step you will be making the skull show up in the magic book as last ancient teleport.
So what you want to do is save this pictures as vengeance.png in your sprites folder.
Picture: http://img220.imageshack.us/img220/299/vengonip2.png
Now open Class30_Sub2_Sub1_Sub1.java and search for
Code:
if (s.startsWith("back"))
Now under that whole thing down to the next "else if" then just above the else if add this.
Code:
else if (s.equalsIgnoreCase("MAGICOFF2") && i == 29)
{
try
{
Image image = Toolkit.getDefaultToolkit().getImage("./sprites/vengeance.png");
anInt1440 = 33;
anInt1441 = 37;
anIntArray1439 = new int[anInt1440 * anInt1441];
PixelGrabber pixelgrabber = new PixelGrabber(image, 0, 0, anInt1440, anInt1441, anIntArray1439, 0, anInt1440);
pixelgrabber.grabPixels();
}
catch (Exception exception)
{
System.out.println(((Object) (exception)));
}
}
Now that you have that I will tell you what it does. That tells the client if you don't have the runes (or do) to light that spell it shows that picture on the place where the other picture would have been. Therefore showing the skull you can just click.
Now just save, compile, and run your client voila! There is client side vengeance. I will be writing more tut's to make vengeance on the server-side also but for now here you go!
credits: 50% ME
50% Milk and Java for the previous one which helped me code mine.
[size=16pt]Server Side! (for dodian)[/size]
First thing you want to do is declare these variables
Code:
private boolean Vengeance = false;
private boolean CanVen = false;
private double VengeanceTimer = 0;
private double VenTimer = 0;
You want to do is declare the gfx method I will use for my Version of Vengeance.
Here it is. This makes the gfx happen wherever you are standing.
Code:
public void gfxMoney(int gfx) {
mask100var1 = gfx;
mask100var2 = 6553600;
mask100update = true;
updateRequired = true;
}
Now you want to declare the method I made that casts Vengeance.
Code:
public void CastVengeance() {
if (playerLevel[6] >= 96 && CanVen) {
if (Vengeance) {
sendMessage("You already have Vengeance casted!");
}
if (VenTimer > 0) {
sendMessage("You can only cast Vengeance every 30 seconds!");
} else if (!Vengeance) {
gfxMoney(WHATEVERGFXNUMBERYOUCHOSEUPATTHETOP);
addSkillXP(350, 6);
Vengeance = true;
setAnimation(1914);
animationReset = System.currentTimeMillis() + 1000;
NewHP = (playerLevel[playerHitpoints] - (hitDiff / 4));
plrText = "Taste Vengeance!";
plrTextUpdateRequired = true;
VengeanceTimer = 60;
VenTimer = 60;
} else if (playerLevel[6] < 96) {
sendMessage(
"You need a magic level of 96 to cast Vengeance!");
}
}
}
You want to replace the WHATEVERGFXNUMBERYOUCHOSEUPTHERE with the gfx number you chose to assign it to.
Here i'll explain how to modify it.
You can mess with this to give you a certain amount of exp in mage. All you would have to do is change the 350.
Code:
addSkillXP(350, 6);
This part tells the client how much it is going to hit on the opposing monster. Mess with the 4 to change the damage.
Code:
NewHP = (playerLevel[playerHitpoints] - (hitDiff / 4));
You can change the levels required to cast your vengeance by changing the
Code:
else if (playerLevel[6] < 96)
You must change both of them!
Ok, now to move on. First you want to search
This is the old spell that was there. You now want to replace down to the break;
With this.
Code:
case 51039:
CastVengeance();
break;
This makes the spell cast the method you just declared. Yippie!
Now that you have all that we need to make the method run properly.
So now you want to add this under your boolean process.
Code:
if (VenTimer == 0) {
CanVen = true;
} else if (VenTimer > 0) {
VenTimer--;
}
if (Vengeance) {
if (VengeanceTimer == 0) {
Vengeance = false;
sendMessage("Your Vengeance spell wears off!");
} else if (VengeanceTimer > 60) {
VengeanceTimer = 60;
} else if (VengeanceTimer > 0) {
VengeanceTimer--;
}
}
if (!Vengeance) {
VengeanceTimer = 0;
}
This is what makes you have to wait before casting Vengeance again. You can modify these times if you would like but i suggest you leave them.
Now for the final step the text that goes along with the spell!
First search this
Code:
sendQuest("Legends Guild Teleport", 13071);
Now under the
Code:
sendQuest("@gre@0/0", 13078);
Add this.
Code:
sendQuest("Vengeance", 13097);
sendQuest("Reboundidng Damage For Sure!", 13098);
sendQuest("@gre@0/0", 13101);
sendQuest("@gre@0/0", 13102);
Now you have your very own working Vengeance for your dodian server!
Credits: 30% ME
70% 'Rich for RichScape v2
[size=16pt]Server Side! (for regular servers)[/size]
First thing you want to do is declare these variables.
Code:
public int Vengeance = -10;
public int hitTimer = 0;
public int hitCount = 0;
What this does is make them existing, so you don't get errors, and when you log in, your ints are automatically set to this.
These are required for the spell to work properly.
2). Add these in your public boolean process
Code:
if (Vengeance > -10)
Vengeance -= 1;
if (hitTimer > 0)
hitTimer -=1;
What this does is make it so that if your int is above the default, it will decrease it. You will notice that most ints are set to 0, and Vengeance is -10. The reason is because later, we will make it send a message when Vengeance reaches 0, and if it stays at 0, you will get 2 messages a second.
Declare this method.
Code:
public void Vengeance()
{
if(Vengeance >= 1) // the brackets on this if statement are unnecessary because only one thing is being done
sendMessage("You must wait one minute before activating vengeance again.");
if(PlayerHandler.players[AttackingOn] != null)
{
if(Vengeance <= 0 && hitTimer <= 0 && playerLevel[6] >= 96)
{
Vengeance = 120;
hitTimer = 10;
hitCount = 0;
stillgfx(WHATEVERGFXNUBERFROMTHETOP, absY, absX);
startAnimation(1979);
txt4 = "Taste Vengeance!";
string4UpdateRequired = true;
sendMessage("You activate Vengeance!.");
}
}
if(playerLevel[6] <= 95)
sendMessage("You need to be at least 96 magic to activate Vengeance.");
if(PlayerHandler.players[AttackingOn] == null)
sendMessage("You must be in combat to activate Vengeance.");
}
Add this in your case 185
Code:
case 51039:
Vengeance();
break;
This is the Vengenace spell itself, except the hitting the other player.
You should replace the WHATEVERGFXNUBERFROMTHETOP with the gfx number you chose at the top.
Code:
if(Vengeance <= 0 && hitTimer <= 0 && playerLevel[6] >= 96 && PlayerHandler.players[AttackingOn] != null) {
is saying that the spell won't work unless the player doesn't already have vengeance active, you are 96 mage or higher, and that you are in combat with another player.
Code:
Vengeance = 120;
hitTimer = 10;
hitCount = 0;
stillgfx(WHATEVERGFXNUBERFROMTHETOP, absY, absX);
startAnimation(1979);
txt4 = "Taste Vengeance!";
string4UpdateRequired = true;
sendMessage("You activate Vengeance!.");
Is setting your ints to the correct timers, so you can't mass click the Vengeance spell or anything. It also does the GFX, emote, sends a message and makes you say "Taste Vengeance!"
4). Go back up to your public boolean process and add this:
Code:
if (Vengeance >= 1 && hitTimer <= 0 && hitCount <= 5) {
PlayerHandler.players[AttackingOn].hitDiff = misc.random(20);
PlayerHandler.players[AttackingOn].updateRequired = true;
PlayerHandler.players[AttackingOn].hitUpdateRequired = true;
hitTimer = 10;
hitCount += 1;
}
This is the part that makes it actually hit the player. Every time this is activated (every 5 seconds for the first 30 seconds) this code will tell the server to hit the player, and set the proper ints. To change how high it hits, mess around with the
Code:
PlayerHandler.players[AttackingOn].hitDiff = misc.random(20);
part.
Credits go to: Milk and Java, Rich', xx qwertyuiop xx, and me
Hope you enjoy using your very own vengeance,
MrMoney