package com.rs.game.npc.combat.impl;
import java.util.ArrayList;
import com.rs.game.Animation;
import com.rs.game.Entity;
import com.rs.game.ForceTalk;
import com.rs.game.Graphics;
import com.rs.game.Hit;
import com.rs.game.Hit.HitLook;
import com.rs.game.World;
import com.rs.game.npc.NPC;
import com.rs.game.npc.combat.CombatScript;
import com.rs.game.npc.combat.NPCCombatDefinitions;
import com.rs.game.player.Player;
import com.rs.utils.Utils;
public class RangerCombat extends CombatScript {
private Entity target;
public RangerCombat(Entity target) {
this.target = target;
}
@Override
public Object[] getKeys() {
return new Object[] { 15176 };
}
@Override
public int attack(final NPC npc, final Entity target) {
final NPCCombatDefinitions defs = npc.getCombatDefinitions();
if (Utils.getRandom(4) == 0) {
switch (Utils.getRandom(6)) {
case 0:
npc.setNextForceTalk(new ForceTalk("You shall fall this day!"));
break;
case 1:
npc.setNextForceTalk(new ForceTalk("May my arrows pierce your heart!"));
break;
case 2:
npc.setNextForceTalk(new ForceTalk("Fight on!"));
break;
}
}
if (Utils.getRandom(3) == 0) {
npc.setNextAnimation(new Animation(829)); //eating 2 rocktails at a time xd
npc.heal(350);
}
if (Utils.getRandom(2) == 0) { // Range - Special Attack
npc.setNextAnimation(new Animation(426)); //i know this is a dds special attack and he isn't wearing it...
npc.setNextGraphics(new Graphics(1099, 0, 150)); //don't make it hit higher then 300, could end very very badly
World.sendProjectile(player, target, 1099, 41, 16, 31, 35, 16, 0);
World.sendProjectile(player, target, 1099, 41, 16, 25, 35, 21, 0);
npc.playSound(2537, 1);
for (Entity t : npc.getPossibleTargets()) {
delayHit(
npc,
1,
target,
getMeleeHit(
npc,
getRandomMaxHit(npc, 345,
NPCCombatDefinitions.RANGE, target)),
getMeleeHit(
npc,
getRandomMaxHit(npc, 345,
NPCCombatDefinitions.RANGE, target)));
}
} else { // Melee - Whip Attack
npc.setNextAnimation(new Animation(defs.getAttackEmote()));
delayHit(
npc,
0,
target,
getRangeHit(
npc,
getRandomMaxHit(npc, defs.getMaxHit(),
NPCCombatDefinitions.RANGE, target)));
}
return defs.getAttackDelay();
}
}
Java でこのコードをコンパイルしようとすると、次のエラーが発生します。
src\com\rs\game\npc\combat\impl\RangerCombat.java:54: error: cannot find symbol
World.sendProjectile(***player***, target, 1099, 41, 16, 35, 16, 0);
symbol: variable player
location: Class RangerCombat
これについての助けをいただければ幸いです。前もって感謝します