@Override public void startSkill(Character attacker, float targetX, float targetY, float targetZ) { super.startSkill(attacker, targetX, targetY, targetZ); impactX = attacker.getX(); impactY = attacker.getY(); impactZ = attacker.getZ(); if (target.isPlayer()) attacker.broadcastPacket(StartFastShot.getInstance(attacker, target, this, castId)); else attacker.broadcastPacket( StartFastShot.getInstance( attacker, this, castId, target.getX(), target.getY(), target.getZ())); }
@Override public void startSkill(Character attacker, float targetX, float targetY, float targetZ) { super.startSkill(attacker, targetX, targetY, targetZ); impactX = attacker.getX(); impactY = attacker.getY(); impactZ = attacker.getZ(); attacker.broadcastPacket( StartFastShot.getInstance( attacker, this, castId, target.getX(), target.getY(), target.getZ() + (target.getGeomHeight() * 0.5F))); }
@Override public void useSkill(Character character, float targetX, float targetY, float targetZ) { if (target != null) { if (target.isPlayer()) NpcFastShot.startShot(character, this, target); else FastShot.startShot(character, this, target.getX(), target.getY(), target.getZ()); } target = null; }
@Override public void useSkill(Character character, float targetX, float targetY, float targetZ) { if (target != null) FastShot.startShot( character, this, target.getX(), target.getY(), target.getZ() + (target.getGeomHeight() * 0.5F)); target = null; }
@Override protected void writeImpl() { writeOpcode(); writeInt(actor.getObjectId()); writeInt(actor.getSubId()); writeFloat(actor.getX()); writeFloat(actor.getY()); writeFloat(actor.getZ()); writeShort(actor.getHeading()); writeInt(actor.getModelId()); writeInt(actor.getOwerturnId()); writeInt(0); writeInt(0); }
/** * Спавн в мир ловушку. * * @param owner владелец. * @param skill скил ловушки. * @param lifeTime время жизни. * @param radius радиус активации. */ public void spawnMe(Character owner, Skill skill, int range, int lifeTime, int radius) { this.owner = owner; this.skill = skill; this.radius = radius; spawnMe( Coords.calcX(owner.getX(), range, owner.getHeading()), Coords.calcY(owner.getY(), range, owner.getHeading()), owner.getZ(), 0); LocalObjects local = LocalObjects.get(); Array<Character> chars = World.getAround(Character.class, local.getNextCharList(), this, radius); ExecutorManager executor = ExecutorManager.getInstance(); if (chars.isEmpty()) this.lifeTask = executor.scheduleGeneral(this, lifeTime * 1000); else { Character[] array = chars.array(); for (int i = 0, length = chars.size(); i < length; i++) { Character target = array[i]; if (owner.checkTarget(target)) { executor.scheduleGeneral(this, 100); return; } } this.lifeTask = executor.scheduleGeneral(this, lifeTime * 1000); } }