I messaged you a way on your discord. Hope that it helps
|
Code:public class vindybossCombat extends CombatScript { private int location = Utils.random(3); @Override public Object[] getKeys() { return new Object[] { 22459, 22460 }; } private void slice(NPC npc, Entity target) { if (npc.getId() == 22459) { npc.setNextAnimation(new Animation(28253)); Hit hit = getMeleeHit( npc, getMaxHit(npc, Utils.random(1500, 3000), NPCCombatDefinitions.MELEE, target)); delayHit(npc, 0, target, hit); } } private void hurricane(NPC npc, Entity target) { npc.setNextAnimation(new Animation(28256)); npc.setNextGraphics(new Graphics(6111)); for (Entity t : npc.getPossibleTargets()) { Hit hit = getMeleeHit( npc, getMaxHit(npc, Utils.random(2000, 3000), NPCCombatDefinitions.MELEE, t)); delayHit(npc, 0, t, hit); } } private void fly(NPC npc) { if (npc.getId() == 22460) { npc.setNextAnimation(new Animation(28275)); npc.setNextGraphics(new Graphics(6118)); npc.setCantInteract(true); WorldTasksManager.schedule(new WorldTask() { @Override public void run() { land(npc); npc.setCantInteract(false); stop(); } }, 2, 1); } } private void land(NPC npc) { if (npc.getId() == 22460) { npc.setNextAnimation(new Animation(28276)); npc.setNextGraphics(new Graphics(6118)); } } private void stab(NPC npc, Entity target) { npc.setNextAnimation(new Animation(28273)); Hit hit = getMeleeHit( npc, getMaxHit(npc, Utils.random(2000, 3500), NPCCombatDefinitions.MELEE, target)); delayHit(npc, 0, target, hit); } private void dragonBreath(NPC npc, Entity target) { npc.setNextAnimation(new Animation(28277)); WorldTasksManager.schedule(new WorldTask() { @Override public void run() { for (int i = 0; i < 20; i++) { if (location == 0 || location == 1) { World.sendGraphics( target, new Graphics(6112), new WorldTile(target.getX() + i, target .getY() + i, 1)); World.sendGraphics( target, new Graphics(6112), new WorldTile(target.getX() - i, target .getY() - i, 1)); } else if (location == 2 || location == 3) { World.sendGraphics( target, new Graphics(6112), new WorldTile(target.getX() + i, target .getY() - i, 1)); World.sendGraphics( target, new Graphics(6112), new WorldTile(target.getX() - i, target .getY() + i, 1)); } stop(); } } }, 1, 1); } private void rangedAttack(NPC npc, Entity target) { npc.setNextAnimation(new Animation(28271)); } private void startDragonFire(NPC npc, Entity target) { npc.setNextAnimation(new Animation(28259)); World.sendGraphics(target, new Graphics(6114), new WorldTile(target.getX() + 1, target.getY() + 1, 1)); WorldTasksManager.schedule(new WorldTask() { int fire = Utils.random(1); @Override public void run() { for (int i = 0; i < 20; i++) { if (fire == 1) { World.sendGraphics( target, new Graphics(6112), new WorldTile(target.getX() + i, target .getY() + i, 1)); World.sendGraphics( target, new Graphics(6112), new WorldTile(target.getX() - i, target .getY() - i, 1)); target.getY(); target.getX(); } if (fire == 0 || fire == 2) { World.sendGraphics( target, new Graphics(6112), new WorldTile(target.getX() + i, target .getY() - i, 1)); World.sendGraphics( target, new Graphics(6112), new WorldTile(target.getX() - i, target .getY() + i, 1)); } stop(); } } }, 0, 1); } public void checkCoords(NPC npc, Entity target) { for (int i = 0; i < 20; i++) { if ((target.getX() == target.getY() - i || target.getX() == target.getX() + i) && (target.getY() == target.getY() - i || target.getX() == target.getX() + i)) { target.applyHit(new Hit(target, Utils.random(5, 10), HitLook.MAGIC_DAMAGE)); } } } @Override public int attack(NPC npc, Entity target) { if (npc.getId() == 22459) { switch (Utils.getRandom(6)) { case 0: slice(npc, target); break; case 1: slice(npc, target); break; case 2: hurricane(npc, target); break; case 4: slice(npc, target); break; case 5: slice(npc, target); break; case 6: startDragonFire(npc, target); break; } return npc.getAttackSpeed(); } else if (npc.getId() == 22460) { switch (Utils.getRandom(5)) { case 0: stab(npc, target); break; case 2: rangedAttack(npc, target); break; case 3: stab(npc, target); break; case 4: fly(npc); break; case 5: dragonBreath(npc, target); break; } return npc.getAttackSpeed() - 1; } return npc.getAttackSpeed(); } }
i am trying to damage the player when the player is in the fire and when he moves out of fire no more damages but i cant work it out lol
I messaged you a way on your discord. Hope that it helps
[code] public class vindybossCombat extends CombatScript {
private int location = Utils.random(3);
@Override
public Object[] getKeys() {
return new Object[] { 22459, 22460 };
}
private void slice(NPC npc, Entity target) {
if (npc.getId() == 22459) {
npc.setNextAnimation(new Animation(28253));
Hit hit = getMeleeHit(
npc,
getMaxHit(npc, Utils.random(1500, 3000),
NPCCombatDefinitions.MELEE, target));
delayHit(npc, 0, target, hit);
}
}
private void hurricane(NPC npc, Entity target) {
npc.setNextAnimation(new Animation(28256));
npc.setNextGraphics(new Graphics(6111));
for (Entity t : npc.getPossibleTargets()) {
Hit hit = getMeleeHit(
npc,
getMaxHit(npc, Utils.random(2000, 3000),
NPCCombatDefinitions.MELEE, t));
delayHit(npc, 0, t, hit);
}
}
private void fly(NPC npc) {
if (npc.getId() == 22460) {
npc.setNextAnimation(new Animation(28275));
npc.setNextGraphics(new Graphics(6118));
npc.setCantInteract(true);
WorldTasksManager.schedule(new WorldTask() {
@Override
public void run() {
land(npc);
npc.setCantInteract(false);
stop();
}
}, 2, 1);
}
}
private void land(NPC npc) {
if (npc.getId() == 22460) {
npc.setNextAnimation(new Animation(28276));
npc.setNextGraphics(new Graphics(6118));
}
}
private void stab(NPC npc, Entity target) {
npc.setNextAnimation(new Animation(28273));
Hit hit = getMeleeHit(
npc,
getMaxHit(npc, Utils.random(2000, 3500),
NPCCombatDefinitions.MELEE, target));
delayHit(npc, 0, target, hit);
}
private void dragonBreath(NPC npc, Entity target) {
npc.setNextAnimation(new Animation(28277));
WorldTasksManager.schedule(new WorldTask() {
@Override
public void run() {
for (int i = 0; i < 20; i++) {
if (location == 0 || location == 1) {
World.sendGraphics(
target,
new Graphics(6112),
new WorldTile(target.getX() + i, target
.getY() + i, 1));
World.sendGraphics(
target,
new Graphics(6112),
new WorldTile(target.getX() - i, target
.getY() - i, 1));
} else if (location == 2 || location == 3) {
World.sendGraphics(
target,
new Graphics(6112),
new WorldTile(target.getX() + i, target
.getY() - i, 1));
World.sendGraphics(
target,
new Graphics(6112),
new WorldTile(target.getX() - i, target
.getY() + i, 1));
}
stop();
}
}
}, 1, 1);
}
private void rangedAttack(NPC npc, Entity target) {
npc.setNextAnimation(new Animation(28271));
}
private void startDragonFire(NPC npc, Entity target) {
npc.setNextAnimation(new Animation(28259));
World.sendGraphics(target, new Graphics(6114),
new WorldTile(target.getX() + 1, target.getY() + 1, 1));
WorldTasksManager.schedule(new WorldTask() {
int fire = Utils.random(1);
@Override
public void run() {
for (int i = 0; i < 20; i++) {
if (fire == 1) {
World.sendGraphics(
target,
new Graphics(6112),
new WorldTile(target.getX() + i, target
.getY() + i, 1));
World.sendGraphics(
target,
new Graphics(6112),
new WorldTile(target.getX() - i, target
.getY() - i, 1));
target.getY();
target.getX();
}
if (fire == 0 || fire == 2) {
World.sendGraphics(
target,
new Graphics(6112),
new WorldTile(target.getX() + i, target
.getY() - i, 1));
World.sendGraphics(
target,
new Graphics(6112),
new WorldTile(target.getX() - i, target
.getY() + i, 1));
}
stop();
}
}
}, 0, 1);
}
public void checkCoords(NPC npc, Entity target) {
for (int i = 0; i < 20; i++) {
if ((target.getX() == target.getY()
- i || target.getX() == target.getX()
+ i)
&& (target.getY() == target.getY()
- i || target.getX() == target.getX()
+ i)) {
target.applyHit(new Hit(target,
Utils.random(5, 10),
HitLook.MAGIC_DAMAGE));
}
}
}
@Override
public int attack(NPC npc, Entity target) {
if (npc.getId() == 22459) {
switch (Utils.getRandom(6)) {
case 0:
slice(npc, target);
break;
case 1:
slice(npc, target);
break;
case 2:
hurricane(npc, target);
break;
case 4:
slice(npc, target);
break;
case 5:
slice(npc, target);
break;
case 6:
startDragonFire(npc, target);
break;
}
return npc.getAttackSpeed();
} else if (npc.getId() == 22460) {
switch (Utils.getRandom(5)) {
case 0:
stab(npc, target);
break;
case 2:
rangedAttack(npc, target);
break;
case 3:
stab(npc, target);
break;
case 4:
fly(npc);
break;
case 5:
dragonBreath(npc, target);
break;
}
return npc.getAttackSpeed() - 1;
}
return npc.getAttackSpeed();
}
} [ /code]
Use [code] [ /code] tags .
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |