Purpose: My version of GodWars.
Difficulty: 4/10 if you know what to do, 2000/10 if you new to rs servers.
Assumed Knowledge: C&P, knowledge to add in right places,
Server Base: Zamorak-Server, i think most.
Classes Modified: Client.java, NpcHandler.java, Item2.java, AutoSpawn.cfg
Procedure
Step 1: First lets start by placing npc's to the autospawn ok? then open you autospawn.cfg and add this:
Code:
//godwars npc//
spawn = 913 3029 9547 0 2858 3727 2856 3725 2 Battle mage saradomin
spawn = 913 3028 9544 0 2858 3727 2856 3725 2 Battle mage saradomin
spawn = 912 3033 9544 0 2834 3715 2832 3713 2 Battle mage zamorak
spawn = 912 3032 9547 0 2834 3715 2832 3713 2 Battle mage zamorak
spawn = 145 3030 9546 0 0 0 0 0 2 ice warrior
spawn = 1012 2874 3693 0 0 0 0 0 2 Bugs
spawn = 912 2836 3708 0 0 0 0 0 2 Battle mage zamorak
spawn = 912 2836 3710 0 2837 3711 2835 3709 2 Battle mage zamorak
spawn = 912 2834 3710 0 0 0 0 0 2 Battle mage zamorak
spawn = 912 2833 3714 0 2834 3715 2832 3713 2 Battle mage zamorak
spawn = 912 2835 3715 0 2836 3716 2834 3714 2 Battle mage zamorak
spawn = 912 2833 3716 0 0 0 0 0 2 Battle mage zamorak
spawn = 913 2857 3730 0 0 0 0 0 2 Battle mage saradomin
spawn = 913 2858 3729 0 2859 3730 2857 3728 2 Battle mage saradomin
spawn = 913 2859 3728 0 2860 3729 2858 3727 2 Battle mage saradomin
spawn = 913 2858 3727 0 2859 3728 2857 3726 2 Battle mage saradomin
spawn = 913 2857 3726 0 2858 3727 2856 3725 2 Battle mage saradomin
spawn = 795 3052 9582 0 3053 9583 3051 9581 2 ice queen
spawn = 795 3049 9579 0 3050 9580 3048 9578 2 ice queen
spawn = 795 3052 9577 0 3053 9578 3051 9576 2 ice queen
spawn = 795 3050 9575 0 3051 9576 3049 9574 2 ice queen
spawn = 795 3055 9573 0 0 0 0 0 2 ice queen
spawn = 795 3058 9570 0 3059 9571 3057 9589 2 ice queen
spawn = 795 3055 9568 0 3056 9569 3054 9567 2 ice queen
spawn = 795 3056 9564 0 3057 9565 3055 9563 2 ice queen
spawn = 795 3055 9562 0 3056 9563 3054 9561 2 ice queen
spawn = 795 3062 9573 0 3063 9574 3061 9572 2 ice queen
//-----------//
Fine, you added it right, since my starting place at yannile i made the main npc's that teleporting you stand in yannille, so just change their coords if you want, so lets go next!
Step 2: Open up your Client.java and search for:
Code:
case 155: //first Click npc
and add there:
Code:
else if (NPCID == 200) //Lord daquarius
{
skillX = server.npcHandler.npcs[NPCSlot].absX;
skillY = server.npcHandler.npcs[NPCSlot].absY;
NpcWanneTalk = 200;
}
Step 3:
Now search for (all wannetalk's are there) and add this
Code:
case 200: //Lord daquarius
sendFrame171(1, 2465);
sendFrame171(0, 2468);
sendFrame126("Would you like to go to God Wars?", 2460);
sendFrame126("Yes! i belive in myself!", 2461);
sendFrame126("No, i might die there.", 2462);
sendFrame164(2459);
NpcDialogueSend = true;
break;
Step 4:
Search for case 9157 is the first chose option case, and add there this:
Code:
if (NpcDialogue == 200) {
teleX = 2874;
teleY = 3689;
sendMessage("You are teleported to God Wars minigame.");
newheightLevel = 0;
NpcDialogue = 0;
NpcDialogueSend = false;
}
Step 5:
Search for:
case 9158 is option 2 on dialogue.
Now add there:
Code:
if (NpcDialogue == 200) {
NpcDialogue = 0;
NpcDialogueSend = false;
RemoveAllWindows();
}
Now search for:
Code:
case 155: //first Click npc
the case for first click ( the first thing that you see when you right click on npc.)
and add this somewhere:
Code:
else if(NPCID == 1012) { // Bugs
sendFrame200(4901, 591);
sendFrame126(GetNpcName(1012), 4902);
sendFrame126("Go and kill Battle Mages to get red key, after you", 4903);
sendFrame126("get red key go and open gate, then kill another battle", 4904);
sendFrame126("mages untill they drop rope, after you will get rope", 4905);
sendFrame126("go down and find and kill Ice warrior, he drop GodSword!", 4906);
sendFrame75(1012, 4901);
sendFrame164(4900);
NpcDialogueSend = true;
}
Step 6:
Now search for
This is Objects that do something, and add this:
Code:
if (objectID == 6440) {
if(playerHasItemAmount(954, 1) == true) {
teleportToX = 3049;
teleportToY = 9589;
deleteItem(954, GetItemSlot(954), 1);
updateRequired = true;
appearanceUpdateRequired = true;
sendMessage("You just climbed down, seems like there is no way back.");
} else {
sendMessage("You need a rope to climb down!");
}
}
if (objectID == (5043) || objectID == (5044)) {
if(playerHasItemAmount(1543, 1) == true) {
teleportToX = 2839;
teleportToY = 3738;
deleteItem(1543, GetItemSlot(1543), 1);
updateRequired = true;
appearanceUpdateRequired = true;
} else {
sendMessage("You need a red key!");
}
}
if (objectID == 10596) {
teleportToX = 3056;
teleportToY = 9555;
updateRequired = true;
appearanceUpdateRequired = true;
}
if (objectID == 10595) {
teleportToX = 3056;
teleportToY = 9562;
updateRequired = true;
appearanceUpdateRequired = true;
}
Well you done with Client.java, save it and close.
Step 7:
[i]
Now open up NpcHandler.java and search for:
and after last } add this:
Code:
{//battle mage zamorak
for (Player p : server.playerHandler.players)
{
client person = (client)p;
if(p != null && person != null)
{
if(p != null && person != null)
{
if (person.distanceToPoint(npcs[i].absX, npcs[i].absY) <= 10 && person.heightLevel == npcs[i].heightLevel)
if (npcs[i].npcType == 912 || npcs[i].npcType == 912)
{
npcs[i].StartKilling = person.playerId;
npcs[i].RandomWalk = false;
npcs[i].IsUnderAttack = true;
} else if (person.distanceToPoint(npcs[i].absX, npcs[i].absY) >= 10 || person.heightLevel != npcs[i].heightLevel)
if (npcs[i].npcType == 912)
{
npcs[i].RandomWalk = true;
}
}
}
}
}
{//battle mage saradomin
for (Player p : server.playerHandler.players)
{
client person = (client)p;
if(p != null && person != null)
{
if(p != null && person != null)
{
if (person.distanceToPoint(npcs[i].absX, npcs[i].absY) <= 10 && person.heightLevel == npcs[i].heightLevel)
if (npcs[i].npcType == 913 || npcs[i].npcType == 913)
{
npcs[i].StartKilling = person.playerId;
npcs[i].RandomWalk = false;
npcs[i].IsUnderAttack = true;
}
}
}
}
}
{//ice queen
for (Player p : server.playerHandler.players)
{
client person = (client)p;
if(p != null && person != null)
{
if(p != null && person != null)
{
if (person.distanceToPoint(npcs[i].absX, npcs[i].absY) <= 17 && person.heightLevel == npcs[i].heightLevel)
if (npcs[i].npcType == 795 || npcs[i].npcType == 795)
{
npcs[i].StartKilling = person.playerId;
npcs[i].RandomWalk = false;
npcs[i].IsUnderAttack = true;
}
}
}
}
}
Maybe you ask what this do? well this what it makes godwars verry hard, since they will automatecly attack you, but to make them hit hight and use mage read next!
now search for:
Code:
AttackPlayerMage(i);
you must see something like this:
Code:
if(npcs[i].npcType == 277 || npcs[i].npcType == 158 || npcs[i].npcType == 509 || npcs[i].npcType == 2745 || npcs[i].npcType == 912 || npcs[i].npcType == 1125 || npcs[i].npcType == 913 || npcs[i].npcType == 2025 || npcs[i].npcType == 2028 || npcs[i].npcType == 145 || npcs[i].npcType == 688 || npcs[i].npcType == 795 || npcs[i].npcType == 691) {
AttackPlayerMage(i);
}
So make sure you added Battle Mage's and ice queen and ice warrior ID's to the list,
ids:
Code:
npcs[i].npcType == 912 || npcs[i].npcType == 913 || npcs[i].npcType == 145 || npcs.npcType == 795
now search for:
Code:
public boolean AttackPlayerMage(int NPCID) {
you must have something like this:
Code:
public boolean AttackPlayerMage(int NPCID) {
int Player = npcs[NPCID].StartKilling;
client p = (client) server.playerHandler.players[Player];
if (server.playerHandler.players[Player] != null) {
p.inCombat();
if (server.playerHandler.players[Player] == null) {
npcs[NPCID].ResetAttackPlayer();
return false;
} else if (server.playerHandler.players[Player].DirectionCount < 2) {
return false;
}
int MageEmote = 711;
int EnemyX = server.playerHandler.players[Player].absX;
int EnemyY = server.playerHandler.players[Player].absY;
int EnemyHP = server.playerHandler.players[Player].playerLevel[server.playerHandler.players[Player].playerHitpoints];
int EnemyMaxHP = getLevelForXP(server.playerHandler.players[Player].playerXP[server.playerHandler.players[Player].playerHitpoints]);
npcs[NPCID].TurnNPCTo(EnemyX,EnemyY);
npcs[NPCID].FocusUpdateRequired = true;
int casterX = npcs[NPCID].absX;
int casterY = npcs[NPCID].absY;
int offsetY = (casterX - EnemyX) * -1;
int offsetX = (casterY - EnemyY) * -1;
int MagehitDiff = 0;
boolean RingOfLife = false;
if (server.playerHandler.players[Player].playerEquipment[server.playerHandler.players[Player].playerRing] == 2570) {
RingOfLife = true;
}
int hitDiff = 0;
if (npcs[NPCID].actionTimer == 0) {
if (RingOfLife == true && EnemyHP <= (int)((double)((double)EnemyMaxHP / 10.0) + 0.5)) {
server.playerHandler.players[Player].SafeMyLife = true;
} else {
if(p.distanceToPoint(casterX, casterY) >= 10) {
npcs[NPCID].ResetAttackPlayer();
}
if (server.playerHandler.players[Player].IsDead == true) {
npcs[NPCID].ResetAttackPlayer();
} else {
if(npcs[NPCID].npcType == 277) { //Fire Warrior
hitDiff = misc.random(20);
p.stillgfx(78, p.absY, p.absX);
MageEmote = 811; //godly spell
}
just add these:
Code:
if(npcs[NPCID].npcType == 912) { //battle mage zamorak
p.stillgfx(78, p.absY, p.absX);
hitDiff = misc.random(40);
MageEmote = 1979;
}
if(npcs[NPCID].npcType == 145) { //ice warrior
p.stillgfx(365, p.absY, p.absX);
hitDiff = misc.random(40);
MageEmote = 1979;
}
if(npcs[NPCID].npcType == 913) { //battle mage saradomin
{
p.stillgfx(76, p.absY, p.absX);
hitDiff = misc.random(30);
MageEmote = 1979;
}
if(npcs[NPCID].npcType == 795) { //Ice Queen
GraphicsHandler.createProjectile(366, npcs[NPCID].absY, npcs[NPCID].absX, offsetY, offsetX, 50, 90, 362, 0, 0, EnemyIndexP + 1, 363, EnemyY, EnemyX, 0);
hitDiff = misc.random(30);
MageEmote = 1978; //Ancient Emote (not barrage)
}
if you have problem with GraphicHandler.CreateProjectile, just comment that line.
save npchand
Step 8:
[i]
Well, now everything is done except the drops! now time to add monster's drop!
search for
Code:
public void MonsterDropItem(int NPCID)
you must see something like this:
Code:
public void MonsterDropItem(int NPCID)
{
{
if (IsDropping == false) {
IsDropping = true;
int Play = GetNpcKiller(NPCID);
int Maxi = server.itemHandler.DropItemCount;
for (int i = 0; i <= Maxi; i++) {
if (server.itemHandler.DroppedItemsID > 0) {
} else {
int NPCID2 = NPCID+34;
System.out.println("Npc id =" +NPCID);
if(npcs[NPCID] != null && server.playerHandler.players[Play] != null) {
if(npcs[NPCID].npcType == 73)//Zombie(Tzaar)
{
ItemHandler.addItem(Item2.randomZombie(), npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller(NPCID), false);
ItemHandler.addItem(526, npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller(NPCID), false); //bone
}
if(npcs[NPCID].npcType == 941) //Green Dragon
{
ItemHandler.addItem(Item2.randomGreenDragon(), npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller(NPCID), false);
ItemHandler.addItem(536, npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller(NPCID), false); //Dragon Bone
}
if(npcs[NPCID].npcType == 55) //Blue Dragon
{
ItemHandler.addItem(Item2.randomBlueDragon(), npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller(NPCID), false);
ItemHandler.addItem(536, npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller(NPCID), false); //Dragon Bone
}
if(npcs[NPCID].npcType == 53) //Red Dragon
{
ItemHandler.addItem(Item2.randomRedDragon(), npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller(NPCID), false);
ItemHandler.addItem(536, npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller(NPCID), false); //Dragon Bone
}
if(npcs[NPCID].npcType == 54) //Black Dragon
{
ItemHandler.addItem(Item2.randomBlackDragon(), npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller(NPCID), false);
ItemHandler.addItem(536, npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller(NPCID), false); //Dragon Bone
}
if(npcs[NPCID].npcType == 50) //KBD
{
ItemHandler.addItem(Item2.randomKBD(), npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller(NPCID), false);
ItemHandler.addItem(536, npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller(NPCID), false); //Dragon Bone
}
Just add
Code:
if(npcs[NPCID].npcType == 145)//Icewar
{
ItemHandler.addItem(Item2.randomIcewar(), npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller(NPCID), false);
}
if(npcs[NPCID].npcType == 912)//battlemage zamorak
{
ItemHandler.addItem(Item2.randomBm1(), npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller(NPCID), false);
}
if(npcs[NPCID].npcType == 913)//battlemage saradomin
{
ItemHandler.addItem(Item2.randomBm2(), npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller(NPCID), false);
}
if(npcs[NPCID].npcType == 795)
{
ItemHandler.addItem(Item2.randomIceQueen(), npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller(NPCID), false);
}
Now save and close NpcHandler.java.
Now open Item2.java and add these with others
Code:
public static int Icewar[] = {15334,15333,15335,15336}; //ice warrior drop god sword, change those ID's to your godsword ID's
public static int randomIcewar()
{
return Icewar[(int)(Math.random()*Icewar.length)];
}
public static int Bm1[] = {1543};//zammy battle mages drop red key
public static int randomBm1()
{
return Bm1[(int)(Math.random()*Bm1.length)];
}
public static int Bm2[] = {954,954}; // sara battlemages drop rope
public static int randomBm2()
{
return Bm2[(int)(Math.random()*Bm2.length)];
}
public static int IceQueen[] = {4151,4151};//add the items id you want ice queen to drop!
public static int randomIceQueen()
{
return IceQueen[(int)(Math.random()*IceQueen.length)];
}
Now save item2.java and close, copile and RUN THE SERVER! W00T! i hope you will not get errors :) good luck!!









Make sure you have been changed my God sword ID's to YOUR godsword ids, because im using my own client with different id's.
Credits: Me (zamora-server on rune-server)