}
boolean flagispro = false;
ListIterator<InvItem> iterator22 = owner
.getInventory().getItems().listIterator();
while (iterator22.hasNext()) {
InvItem cape = (InvItem) iterator22.next();
if (cape.id == 1000 && cape.wielded) {
flagispro = flagispro || true;
}
// else {flag = false;}
}
if (flagispro) {
if (!owner.isCharged()) {
owner.getActionSender().sendMessage(
"@red@You are not charged!");
}
if (!checkAndRemoveRunes(owner, spell)) {
return;
}
if (affectedMob instanceof Player
&& !owner.isDueling()) {
Player affectedPlayer = (Player) affectedMob;
owner.setSkulledOn(affectedPlayer);
}
int damag = Formulae.calcSpellHit(20,
owner.getMagicPoints());
if (affectedMob instanceof Player) {
Player affectedPlayer = (Player) affectedMob;
affectedPlayer
.getActionSender()
.sendMessage(
owner.getUsername()
+ " is shooting at you!");
}
Projectile projectil = new Projectile(owner,
affectedMob, 1);
// godSpellObject(affectedMob, 33);
affectedMob.setLastDamage(damag);
int newhp = affectedMob.getHits() - damag;
affectedMob.setHits(newhp);
ArrayList<Player> playersToInfor = new ArrayList<Player>();
playersToInfor.addAll(owner.getViewArea()
.getPlayersInView());
playersToInfor.addAll(affectedMob.getViewArea()
.getPlayersInView());
for (Player p : playersToInfor) {
p.informOfProjectile(projectil);
p.informOfModifiedHits(affectedMob);
}
if (affectedMob instanceof Player) {
Player affectedPlayer = (Player) affectedMob;
affectedPlayer.getActionSender()
.sendStat(3);
}
if (newhp <= 0) {
affectedMob.killedBy(owner,
owner.isDueling());
}
owner.getActionSender().sendInventory();
owner.getActionSender().sendStat(6);
finalizeSpell(owner, spell);
break;
} else {
owner.getActionSender()
.sendMessage(
"You need to be wearing the Iban Staff to cast this spell!");
return;
}
case 33:
if (owner.getLocation().inWilderness()) {
owner.getActionSender().sendMessage(
"Can not use this spell in wilderness");
return;
}
if (affectedMob instanceof Npc) {
if (((Npc) affectedMob).getID() == 477) {
player.getActionSender()
.sendMessage(
"The dragon seems immune to this spell");
return;
}
}
boolean flag = false;
ListIterator<InvItem> iterator = owner
.getInventory().getItems().listIterator();
while (iterator.hasNext()) {
InvItem cape = iterator.next();
if (cape.id == 1217 && cape.wielded) {
flag = true;
}
// else {flag = false;}
}
if (flag) {
if (!owner.isCharged()) {
owner.getActionSender().sendMessage(
"@red@You are not charged!");
}
if (!checkAndRemoveRunes(owner, spell)) {
return;
}
if (affectedMob instanceof Player
&& !owner.isDueling()) {
Player affectedPlayer = (Player) affectedMob;
owner.setSkulledOn(affectedPlayer);
}
int damag = Formulae.calcGodSpells(owner,
affectedMob);
// int damag = Formulae.calcSpellHit(max,
// owner.getMagicPoints());
if (affectedMob instanceof Player) {
Player affectedPlayer = (Player) affectedMob;
affectedPlayer
.getActionSender()
.sendMessage(
owner.getUsername()
+ " is shooting at you!");
}
Projectile projectil = new Projectile(owner,
affectedMob, 1);
godSpellObject(affectedMob, 33);
affectedMob.setLastDamage(damag);
int newhp = affectedMob.getHits() - damag;
affectedMob.setHits(newhp);
ArrayList<Player> playersToInfor = new ArrayList<Player>();
playersToInfor.addAll(owner.getViewArea()
.getPlayersInView());
playersToInfor.addAll(affectedMob.getViewArea()
.getPlayersInView());
for (Player p : playersToInfor) {
p.informOfProjectile(projectil);
p.informOfModifiedHits(affectedMob);
}
if (affectedMob instanceof Player) {
Player affectedPlayer = (Player) affectedMob;
affectedPlayer.getActionSender()
.sendStat(3);
}
if (newhp <= 0) {
affectedMob.killedBy(owner,
owner.isDueling());
}
owner.getActionSender().sendInventory();
owner.getActionSender().sendStat(6);
finalizeSpell(owner, spell);
break;
} else {
owner.getActionSender()
.sendMessage(
"You need to be wearing the Staff of Guthix to cast this spell!");
return;
}
case 34:
if (affectedMob instanceof Npc) {
if (((Npc) affectedMob).getID() == 477) {
player.getActionSender()
.sendMessage(
"The dragon seems immune to this spell");
return;
}
}
if (owner.getLocation().inWilderness()) {
owner.getActionSender().sendMessage(
"Can not use this spell in wilderness");
return;
}
boolean bool = false;
ListIterator<InvItem> iterat = owner.getInventory()
.getItems().listIterator();
while (iterat.hasNext()) {
InvItem cape = iterat.next();
if (cape.id == 1218 && cape.wielded) {
bool = bool || true;
}
// else {flag = false;}
}
if (bool) {
if (!owner.isCharged()) {
owner.getActionSender().sendMessage(
"@red@You are not charged!");
}
if (!checkAndRemoveRunes(owner, spell)) {
return;
}
if (affectedMob instanceof Player
&& !owner.isDueling()) {
Player affectedPlayer = (Player) affectedMob;
owner.setSkulledOn(affectedPlayer);
}
// int damag = Rand(0, 25);
int damag = Formulae.calcGodSpells(owner,
affectedMob);
if (affectedMob instanceof Player) {
Player affectedPlayer = (Player) affectedMob;
affectedPlayer
.getActionSender()
.sendMessage(
owner.getUsername()
+ " is shooting at you!");
}
Projectile projectil = new Projectile(owner,
affectedMob, 1);
godSpellObject(affectedMob, 34);
affectedMob.setLastDamage(damag);
int newhp = affectedMob.getHits() - damag;
affectedMob.setHits(newhp);
ArrayList<Player> playersToInfor = new ArrayList<Player>();
playersToInfor.addAll(owner.getViewArea()
.getPlayersInView());
playersToInfor.addAll(affectedMob.getViewArea()
.getPlayersInView());
for (Player p : playersToInfor) {
p.informOfProjectile(projectil);
p.informOfModifiedHits(affectedMob);
}
if (affectedMob instanceof Player) {
Player affectedPlayer = (Player) affectedMob;
affectedPlayer.getActionSender()
.sendStat(3);
}
if (newhp <= 0) {
affectedMob.killedBy(owner,
owner.isDueling());
}
owner.getActionSender().sendInventory();
owner.getActionSender().sendStat(6);
finalizeSpell(owner, spell);
break;
} else {
owner.getActionSender()
.sendMessage(
"You need to be wearing the Staff of Saradomin to cast this spell!");
return;
}
case 35:
if (affectedMob instanceof Npc) {
if (((Npc) affectedMob).getID() == 477) {
player.getActionSender()
.sendMessage(
"The dragon seems immune to this spell");
return;
}
}
if (owner.getLocation().inWilderness()) {
owner.getActionSender().sendMessage(
"Can not use this spell in wilderness");
return;
}
boolean flag2 = false;
ListIterator<InvItem> iterato = owner
.getInventory().getItems().listIterator();
while (iterato.hasNext()) {
InvItem cape = iterato.next();
if (cape.id == 1216 && cape.wielded) {
flag2 = flag2 || true;
}
// else {flag = false;}
}