PDA

View Full Version : [508] - Magic Swapping {With Altars}



Sceptylos
September 6th, 2010, 22:48
I know this isn't 100% right...Just know I usually start my codings off of nothing so don't troll me cause you can do better, I'm just doing this to help newbies.

Things to know.
What are you making? A magic changing System for your 508 Server.
Difficulty 1/10 - I think 1/10 is too much.
What to do? Copy and Paste, Search, Fixing Errors [If Needed]
What files are being modified? ObjectOption1.java, Commands.java, Player.java
Base used Bulby
Credits 100% me

Okay, First off we need the altars to switch your magic spell books so this should take a sec, open up ObjectOption1.java and paste this


//Magic changing
case 6552:
p.frames.setTab(p, 79, 388); // Ancient tab
break;

case 410:
p.frames.setTab(p, 79, 430); // Magic tab (lunar)
break;

case 409:
p.frames.setTab(p, 79, 192); // Modern spells;
break;

Now that that's done, Save/Close it and open Player.java - This part is optional if you want to spawn the altars for the players now paste this


frames.createGlobalObject(409, 0, 3003, 3383, -1, 10); //Normal Altar
frames.createGlobalObject(410, 0, 2996, 3383, 0, 10); //Lunar Altar
frames.createGlobalObject(6552, 0, 2999, 3378, 0, 10); //Ancient Altar

That just places the Altars in the Center of Falador park, Now that you've done that the players might be too damn lazy to get 38 Magic and teleport to Falador to access this *sight* so open Commands.java and add this


if(cmd[0].equals("magics")) {
{
p.frames.removeShownInterface(p);
p.teleportTo(3000, 3383, 0, 0, 0, 8939, 8941, 1576, 0, 1577, 0);
}

Now you're done, Here's how it works.

Only the registered members can see the link. (Only the registered members can see the link.)

shiru
September 7th, 2010, 00:32
Nice tut, by any chance do u know how to add the altars on a 525?

Emily
September 7th, 2010, 14:23
This is extremely easy, but i guess its nice for the people that don't understand adding objects, and interface switches.

Sceptylos
September 7th, 2010, 17:22
Nice tut, by any chance do u know how to add the altars on a 525?

I only code 317 - 508's starting 562, I heard 525 is PVP servers and I don't like those so skipped it, Soz.

Derranged
September 8th, 2010, 12:01
This is very simple but there are still to many beginners around.. Maybe you could added interfaces asking if they wish to continue.

Emtec
September 8th, 2010, 16:31
I already have it, but its good like they all say above me. :)

Tricky
December 30th, 2010, 18:49
Thanks For This Gj :D

Emtec
January 1st, 2011, 16:16
making it like this is alot better i think


case 6552: //Ancients altar
p.requestAnim(6299, 0);
p.requestGFX(1062, 0);
if (p.spellbook == 0) {
p.frames.setTab(p, 79, 193); //Ancients
p.spellbook = 1;
p.frames.sendMessage(p, "You feel a strange wisdom fill your mind...");
} else if (p.spellbook == 1) {
p.frames.setTab(p, 79, 192); //Modern
p.spellbook = 0;
p.frames.sendMessage(p, "You feel a strange wisdom empty your mind...");
} else {
p.frames.sendMessage(p, "You must be on Modern or Ancient magicks to switch your spellbook at this altar.");
}
break;

arcen
June 11th, 2011, 01:49
Where do we put the frames | frames.createGlobalObject(409, 0, 3003, 3383, -1, 10); //Normal Altar
frames.createGlobalObject(410, 0, 2996, 3383, 0, 10); //Lunar Altar
frames.createGlobalObject(6552, 0, 2999, 3378, 0, 10); //Ancient Altar| Where in player.java do we put it? i just puted it after like a thing and i got errors.

Tricky
June 11th, 2011, 09:12
Easy - Helpfull - Should Help People Out Nice Job!.