first declare these in Player.java
Code:
public int firePotTimer;
public boolean firePot;
public int FirePotion = 0;
save and close Player.java
now open client.java
search for boolean process()
and below it add (sorry if the sM's got misspellings, i'm not that good at english)
Code:
if(firePotTimer >= 1){
firePotTimer -= 1;
}
if(firePotTimer == 30){
sM("Your anti fire protection have almost run out");
firePotTimer -= 1;
}
if(firePotTimer == 0){
firePot = false;
sM("Your anti fire protection ran out");
}
now save and close client.java
open potions.java
and add this above case 2440:
Code:
case 2452:
c.firePot = true;
c.firePotTimer = 720;
c.deleteItem(2452, slot, 1);
c.addItem(2454, 1);
c.sM("You drink some of your antifire potion.");
c.sM("You have 3 doses of potion left.");
return;
case 2454:
c.firePot = true;
c.firePotTimer = 720;
c.deleteItem(2454, slot, 1);
c.addItem(2456, 1);
c.sM("You drink some of your antifire potion.");
c.sM("You have 2 doses of potion left.");
return;
case 2456:
c.firePot = true;
c.firePotTimer = 720;
c.deleteItem(2456, slot, 1);
c.addItem(2458, 1);
c.sM("You drink some of your antifire potion.");
c.sM("You have 1 dose of potion left.");
return;
case 2458:
c.firePot = true;
c.firePotTimer = 720;
c.deleteItem(2458, slot, 1);
c.addItem(229, 1);
c.sM("You drink some of your antifire potion.");
c.sM("You have finished your potion.");
return;
save and close potions.java
open NPCHandler.java and replace green dragon's fire breath code with mine
Code:
} else if(npcs[NPCID].npcType == 941 && misc.random(3)==1 || npcs[NPCID].npcType == 55 && misc.random(3)==1 || npcs[NPCID].npcType == 53 && misc.random(3)==1 || npcs[NPCID].npcType == 54 && misc.random(3)==1){
if(plr.playerEquipment[plr.playerShield] == 1540 && plr.firePot == true || plr.playerEquipment[plr.playerShield] == 2621 && plr.firePot == true) {
npcs[NPCID].animNumber = 81;
plr.lowGFX(579, 0);
hitDiff = 0;
plr.sM("You are completely protected from the dragon's fire!");
} else if(plr.playerEquipment[plr.playerShield] == 1540 && plr.ProtMage || plr.playerEquipment[plr.playerShield] == 2621 && plr.ProtMage || plr.firePot == true && plr.ProtMage) {
npcs[NPCID].animNumber = 81;
plr.lowGFX(579, 0);
hitDiff = misc.random(7);
plr.sM("You are protected from the dragon's fire!");
} else if(plr.playerEquipment[plr.playerShield] == 1540 || plr.playerEquipment[plr.playerShield] == 2621 || plr.firePot == true) {
npcs[NPCID].animNumber = 81;
plr.lowGFX(579, 0);
hitDiff = 3 + misc.random(7);
plr.sM("You are protected from the dragon's fire!");
} else if(plr.ProtMage) {
npcs[NPCID].animNumber = 81;
plr.lowGFX(579, 0);
hitDiff = 10 + misc.random(20);
plr.sM("You manage to resist some of the dragon's fire!");
} else if(plr.playerEquipment[plr.playerShield] != 1540 && plr.playerEquipment[plr.playerShield] != 2621 && plr.firePot == false) {
npcs[NPCID].animNumber = 81;
plr.lowGFX(579, 0);
hitDiff = 20 + misc.random(30);
plr.sM("You are burnt by the fire!");}