Ir para conteúdo
  • Cadastre-se

Kayrus

Membro
  • Total de itens

    39
  • Registro em

  • Última visita

Sobre Kayrus

Últimos Visitantes

2846 visualizações

Kayrus's Achievements

Aprendiz de Novato

Aprendiz de Novato (1/14)

1

Reputação

  1. Comentei o que voce pediu pra mim fazer la, mais nao funcionou.. esse assunto deixa pra la mano!. vou deixa no original. agora mano! apareceu um problema no meu projeto que ta me deixando maluco,. Em party, não ta dando XP nem SP, idepentente da diferença lvl. so distribui os Drops ! Ja verifiquei na Config Rates. other. na party de distribuição de party. mais nada soluciona. creio que algum Mod que adcionei no meu projeto tenha Bugado ou desativado upar em party. esse erro ta no core, se vc poder me ajudar eu dou uma gratificação.!
  2. Ola Pessoal, vim aqui postar esse evento que encontrei em outro site não sei se tem aqui pois nao encontrei, e um evento de corrida de Strider, mais Gostaria que alguém adapitar-se ele para L2jFrozen, eu ate tentei varias vezes adapitar, mais não conseguir.! Ficarei muito grato.! Video do Evento Abaixo [Hidden Content] ### Eclipse Workspace Patch 1.0 Index: java/net/sf/l2j/gameserver/handler/AdminCommandHandler.java =================================================================== --- java/net/sf/l2j/gameserver/handler/AdminCommandHandler.java (revision 1) +++ java/net/sf/l2j/gameserver/handler/AdminCommandHandler.java (working copy) @@ -62,6 +62,7 @@ import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminSiege; import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminSkill; import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminSpawn; +import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminStriderRace; import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminTarget; import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminTeleport; import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminUnblockIp; @@ -127,6 +128,8 @@ registerAdminCommandHandler(new AdminTeleport()); registerAdminCommandHandler(new AdminUnblockIp()); registerAdminCommandHandler(new AdminZone()); + //custom + registerAdminCommandHandler(new AdminStriderRace()); } public void registerAdminCommandHandler(IAdminCommandHandler handler) Index: java/net/sf/l2j/gameserver/custom/striderrace/StriderRace.java =================================================================== --- java/net/sf/l2j/gameserver/custom/striderrace/StriderRace.java (revision 0) +++ java/net/sf/l2j/gameserver/custom/striderrace/StriderRace.java (working copy) @@ -0,0 +1,236 @@ +/* + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see <[Hidden Content];. + */ +package net.sf.l2j.gameserver.custom.striderrace; + +import java.util.ArrayList; +import java.util.List; + +import net.sf.l2j.Config; +import net.sf.l2j.gameserver.datatables.MapRegionTable; +import net.sf.l2j.gameserver.datatables.NpcTable; +import net.sf.l2j.gameserver.datatables.SpawnTable; +import net.sf.l2j.gameserver.model.L2Spawn; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; +import net.sf.l2j.gameserver.model.actor.template.NpcTemplate; +import net.sf.l2j.gameserver.skills.AbnormalEffect; +import net.sf.l2j.gameserver.util.Broadcast; + +/** + * @author Bluur + * @version 1.1 + */ +public class StriderRace +{ + private static StriderRace INSTANCE; + private StriderRaceState srState = StriderRaceState.DESACTIVED; + private List<L2PcInstance> players = new ArrayList<>(); + + private StriderRace(){} + + public void startEvent() + { + srState = StriderRaceState.REGISTER; + announceEvent("The event started! Commands .joinsr or .leavesr"); + announceEvent("Registration time: 5 minutes!"); + sleep(60); + announceEvent("[4] minutes to the end of the record!"); + sleep(60); + announceEvent("[3] minutes to the end of the record!"); + sleep(60); + announceEvent("[2] minutes to the end of the record!"); + sleep(60); + announceEvent("[1] minutes to the end of the record!"); + sleep(60); + if (!minPlayers()) + { + abortEvent(); + return; + } + srState = StriderRaceState.WAIT; + announceEvent("closed registration! Total number of registered players: "+ players.size()); + announceEvent("The players will be teleported in 10 seconds!"); + sleep(10); + teleportPlayers(); + mountPlayer(true); + paralizedPlayer(true); + announceEvent("The event will start in 15 seconds!"); + sleep(15); + srState = StriderRaceState.ATIVED; + announceEvent("The race is on! Go Go Go!"); + spawnNpc(); + paralizedPlayer(false); + sleep(300); // duração do evento em segundos + if (srState == StriderRaceState.ATIVED) + finishEvent(); + } + + private void paralizedPlayer(boolean value) + { + if (value) + { + for (L2PcInstance player : players) + { + player.setIsParalyzed(true); + player.startAbnormalEffect(AbnormalEffect.HOLD_2); + } + } + else + { + for (L2PcInstance player : players) + { + player.setIsParalyzed(false); + player.stopAbnormalEffect(AbnormalEffect.HOLD_2); + } + } + } + + private void mountPlayer(boolean value) + { + if (value) + { + for (L2PcInstance player : players) + { + if (player != null) + { + player.getRadar().addMarker(Config.EVENT_SR_LOC_ARRIVAL_X, Config.EVENT_SR_LOC_ARRIVAL_Y, Config.EVENT_SR_LOC_ARRIVAL_Z); + player.mount(12526, 0, false); + } + } + } + else + { + for (L2PcInstance player : players) + { + if (player != null) + { + player.getRadar().removeMarker(Config.EVENT_SR_LOC_ARRIVAL_X, Config.EVENT_SR_LOC_ARRIVAL_Y, Config.EVENT_SR_LOC_ARRIVAL_Z); + player.dismount(); + } + } + } + } + + private void abortEvent() + { + srState = StriderRaceState.DESACTIVED; + announceEvent("The event was terminated for lack of participants!"); + players.clear(); + } + + public void finishEvent() + { + srState = StriderRaceState.DESACTIVED; + announceEvent("The event duration time is up! Thank all..."); + teleportPlayersToTown(); + mountPlayer(false); + players.clear(); + } + + private static void announceEvent(String sendMessage) + { + Broadcast.announceToOnlinePlayers("[Strider Race]: " + sendMessage, true); + } + + private void teleportPlayers() + { + for (L2PcInstance player : players) + player.teleToLocation(Config.EVENT_SR_LOC_PLAYER_X, Config.EVENT_SR_LOC_PLAYER_Y, Config.EVENT_SR_LOC_PLAYER_Z, 60); + } + + private void teleportPlayersToTown() + { + for (L2PcInstance player : players) + player.teleToLocation(MapRegionTable.TeleportWhereType.Town); + } + + private boolean minPlayers() + { + if (players.size() < Config.EVENT_SR_MINIMUM_PLAYERS) + return false; + + return true; + } + + public boolean maxPlayers() + { + if (players.size() >= Config.EVENT_SR_MAXIMUM_PLAYERS) + return false; + + return true; + } + + public boolean containsPlayer(L2PcInstance player) + { + return players.contains(player); + } + + public void registerPlayer(L2PcInstance player) + { + players.add(player); + } + + public void removePlayer(L2PcInstance player) + { + players.remove(player); + } + + private static void spawnNpc() + { + NpcTemplate tp = NpcTable.getInstance().getTemplate(Config.EVENT_SR_LOC_ID_NPC); + try + { + L2Spawn spawn = null; + + spawn = new L2Spawn(tp); + spawn.setLocx(Config.EVENT_SR_LOC_ARRIVAL_X); + spawn.setLocy(Config.EVENT_SR_LOC_ARRIVAL_Y); + spawn.setLocz(Config.EVENT_SR_LOC_ARRIVAL_Z); + spawn.setHeading(0); + + SpawnTable.getInstance().addNewSpawn(spawn, false); + spawn.init(); + spawn.stopRespawn(); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + + public StriderRaceState getStriderRaceState() + { + return srState; + } + + private static void sleep(int value) + { + try + { + Thread.sleep(1000 * value); + } + catch (InterruptedException e) + { + e.printStackTrace(); + } + } + + public static StriderRace getInstance() + { + if (INSTANCE == null) + INSTANCE = new StriderRace(); + + return INSTANCE; + } +} Index: java/net/sf/l2j/gameserver/network/clientpackets/Logout.java =================================================================== --- java/net/sf/l2j/gameserver/network/clientpackets/Logout.java (revision 1) +++ java/net/sf/l2j/gameserver/network/clientpackets/Logout.java (working copy) @@ -15,6 +15,8 @@ package net.sf.l2j.gameserver.network.clientpackets; import net.sf.l2j.Config; +import net.sf.l2j.gameserver.custom.striderrace.StriderRace; +import net.sf.l2j.gameserver.custom.striderrace.StriderRaceState; import net.sf.l2j.gameserver.instancemanager.SevenSignsFestival; import net.sf.l2j.gameserver.model.L2Party; import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; @@ -44,6 +46,16 @@ return; } + if (StriderRace.getInstance().getStriderRaceState() == StriderRaceState.ATIVED) + { + if (StriderRace.getInstance().containsPlayer(player)) + { + player.sendMessage("[Strider Race]: You can't logout in strider race!"); + player.sendPacket(ActionFailed.STATIC_PACKET); + return; + } + } + if (player.isLocked()) { if (Config.DEBUG) Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java =================================================================== --- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 1) +++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy) @@ -50,6 +50,8 @@ import net.sf.l2j.gameserver.ai.NextAction.NextActionCallback; import net.sf.l2j.gameserver.communitybbs.BB.Forum; import net.sf.l2j.gameserver.communitybbs.Manager.ForumsBBSManager; +import net.sf.l2j.gameserver.custom.striderrace.StriderRace; +import net.sf.l2j.gameserver.custom.striderrace.StriderRaceState; import net.sf.l2j.gameserver.datatables.AccessLevels; import net.sf.l2j.gameserver.datatables.CharNameTable; import net.sf.l2j.gameserver.datatables.CharTemplateTable; @@ -5012,6 +5014,16 @@ { sendPacket(new SetupGauge(3, 0, 0)); int petId = _mountNpcId; + + if (StriderRace.getInstance().getStriderRaceState() == StriderRaceState.ATIVED) + { + if (petId == 12526 && StriderRace.getInstance().containsPlayer(this)) + { + sendMessage("[Strider Race]: You can't unmount in strider race!"); + return false; + } + } + if (setMount(0, 0, 0)) { stopFeed(); Index: java/net/sf/l2j/gameserver/model/actor/stat/PcStat.java =================================================================== --- java/net/sf/l2j/gameserver/model/actor/stat/PcStat.java (revision 1) +++ java/net/sf/l2j/gameserver/model/actor/stat/PcStat.java (working copy) @@ -15,6 +15,8 @@ package net.sf.l2j.gameserver.model.actor.stat; import net.sf.l2j.Config; +import net.sf.l2j.gameserver.custom.striderrace.StriderRace; +import net.sf.l2j.gameserver.custom.striderrace.StriderRaceState; import net.sf.l2j.gameserver.datatables.NpcTable; import net.sf.l2j.gameserver.datatables.PetDataTable; import net.sf.l2j.gameserver.model.actor.L2Character; @@ -334,6 +336,9 @@ if (penalty > 0) val *= Math.pow(0.84, penalty); + if (StriderRace.getInstance().getStriderRaceState() == StriderRaceState.ATIVED && StriderRace.getInstance().containsPlayer(getActiveChar())) + val *= Config.EVENT_SR_SPEED; + return val; } Index: java/net/sf/l2j/Config.java =================================================================== --- java/net/sf/l2j/Config.java (revision 1) +++ java/net/sf/l2j/Config.java (working copy) @@ -226,6 +226,20 @@ public static int ALT_FISH_CHAMPIONSHIP_REWARD_4; public static int ALT_FISH_CHAMPIONSHIP_REWARD_5; + /** Strider Race */ + public static int EVENT_SR_MINIMUM_PLAYERS; + public static int EVENT_SR_MAXIMUM_PLAYERS; + public static int[][] EVENT_SR_REWARD_TOP1; + public static int[][] EVENT_SR_REWARD_TOP2; + public static int[][] EVENT_SR_REWARD_TOP3; + public static double EVENT_SR_SPEED; + public static int EVENT_SR_REWARD_COUNT; + public static int EVENT_SR_LOC_ARRIVAL_X; + public static int EVENT_SR_LOC_ARRIVAL_Y; + public static int EVENT_SR_LOC_ARRIVAL_Z; + public static int EVENT_SR_LOC_PLAYER_X; + public static int EVENT_SR_LOC_PLAYER_Y; + public static int EVENT_SR_LOC_PLAYER_Z; + public static int EVENT_SR_LOC_ID_NPC; + // -------------------------------------------------- // HexID // -------------------------------------------------- @@ -879,6 +893,18 @@ ALT_FISH_CHAMPIONSHIP_REWARD_4 = events.getProperty("AltFishChampionshipReward4", 200000); ALT_FISH_CHAMPIONSHIP_REWARD_5 = events.getProperty("AltFishChampionshipReward5", 100000); + EVENT_SR_LOC_ID_NPC = events.getProperty("EventSRnpcID", 10); + EVENT_SR_MINIMUM_PLAYERS = events.getProperty("EventSRminimumPlayers", 2); + EVENT_SR_MAXIMUM_PLAYERS = events.getProperty("EventSRmaximumPlayers", 2); + EVENT_SR_REWARD_TOP1 = parseItemsList(events.getProperty("EventSRrewardsTop1", "57,300")); + EVENT_SR_REWARD_TOP2 = parseItemsList(events.getProperty("EventSRrewardsTop2", "57,200")); + EVENT_SR_REWARD_TOP3 = parseItemsList(events.getProperty("EventSRrewardsTop3", "57,100")); + EVENT_SR_SPEED = events.getProperty("EventSRspeedBoost", 1.0); + EVENT_SR_LOC_PLAYER_X = events.getProperty("EventSRlocPlayerX", 0); + EVENT_SR_LOC_PLAYER_Y = events.getProperty("EventSRlocPlayerY", 0); + EVENT_SR_LOC_PLAYER_Z = events.getProperty("EventSRlocPlayerZ", 0); + EVENT_SR_LOC_ARRIVAL_X = events.getProperty("EventSRlocArrivalX", 0); + EVENT_SR_LOC_ARRIVAL_Y = events.getProperty("EventSRlocArrivalY", 0); + EVENT_SR_LOC_ARRIVAL_Z = events.getProperty("EventSRlocArrivalZ", 0); Index: java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminStriderRace.java =================================================================== --- java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminStriderRace.java (revision 0) +++ java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminStriderRace.java (working copy) @@ -0,0 +1,60 @@ +/* + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see <[Hidden Content];. + */ +package net.sf.l2j.gameserver.handler.admincommandhandlers; + +import net.sf.l2j.gameserver.ThreadPoolManager; +import net.sf.l2j.gameserver.custom.striderrace.StriderRace; +import net.sf.l2j.gameserver.custom.striderrace.StriderRaceState; +import net.sf.l2j.gameserver.handler.IAdminCommandHandler; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; + +/** + * @author Bluur + * + */ +public class AdminStriderRace implements IAdminCommandHandler +{ + private static final String[] ADMIN_COMMANDS = {"admin_startsr"}; + + @Override + public boolean useAdminCommand(String command, L2PcInstance activeChar) + { + if (StriderRace.getInstance().getStriderRaceState() == StriderRaceState.DESACTIVED) + initEvent(); + else + activeChar.sendMessage("[Strider Race]: The event this already in progress!"); + + return true; + } + + private static void initEvent() + { + ThreadPoolManager.getInstance().scheduleGeneral(new Runnable() + { + @Override + public void run() + { + StriderRace.getInstance().startEvent(); + } + + }, 1); + } + + @Override + public String[] getAdminCommandList() + { + return ADMIN_COMMANDS; + } +} Index: java/net/sf/l2j/gameserver/custom/striderrace/StriderRaceState.java =================================================================== --- java/net/sf/l2j/gameserver/custom/striderrace/StriderRaceState.java (revision 0) +++ java/net/sf/l2j/gameserver/custom/striderrace/StriderRaceState.java (working copy) @@ -0,0 +1,27 @@ +/* + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see <[Hidden Content];. + */ +package net.sf.l2j.gameserver.custom.striderrace; + +/** + * @author Bluur + * + */ +public enum StriderRaceState +{ + DESACTIVED, + REGISTER, + WAIT, + ATIVED; +} Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestRestart.java =================================================================== --- java/net/sf/l2j/gameserver/network/clientpackets/RequestRestart.java (revision 1) +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestRestart.java (working copy) @@ -15,6 +15,8 @@ package net.sf.l2j.gameserver.network.clientpackets; import net.sf.l2j.Config; +import net.sf.l2j.gameserver.custom.striderrace.StriderRace; +import net.sf.l2j.gameserver.custom.striderrace.StriderRaceState; import net.sf.l2j.gameserver.instancemanager.SevenSignsFestival; import net.sf.l2j.gameserver.model.L2Party; import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; @@ -47,6 +49,16 @@ return; } + if (StriderRace.getInstance().getStriderRaceState() == StriderRaceState.ATIVED) + { + if (StriderRace.getInstance().containsPlayer(player)) + { + player.sendMessage("[Strider Race]: You can't restart in strider race!"); + sendPacket(RestartResponse.valueOf(false)); + return; + } + } + if (player.isLocked()) { sendPacket(RestartResponse.valueOf(false)); Index: java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/RegStriderRace.java =================================================================== --- java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/RegStriderRace.java (revision 0) +++ java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/RegStriderRace.java (working copy) @@ -0,0 +1,83 @@ +/* + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see <[Hidden Content];. + */ +package net.sf.l2j.gameserver.handler.voicedcommandhandlers; + +import net.sf.l2j.gameserver.custom.striderrace.StriderRace; +import net.sf.l2j.gameserver.custom.striderrace.StriderRaceState; +import net.sf.l2j.gameserver.handler.IVoicedCommandHandler; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; + +/** + * @author Bluur + */ +public class RegStriderRace implements IVoicedCommandHandler +{ + private static final String[] voiced_commands = + { + "joinsr", + "leavesr" + }; + + @Override + public boolean useVoicedCommand(String command, L2PcInstance activeChar, String params) + { + if (command.equals("joinsr")) + { + if (register(activeChar)) + { + StriderRace.getInstance().registerPlayer(activeChar); + activeChar.sendMessage("[Strider Race]: You have been successfully registered!"); + } + } + else if (command.equals("leavesr")) + { + remove(activeChar); + } + return true; + } + + private static boolean register(L2PcInstance p) + { + if (!StriderRace.getInstance().maxPlayers()) + { + p.sendMessage("[Strider Race]: Limit of players was reached."); + return false; + } + else if (StriderRace.getInstance().getStriderRaceState() != StriderRaceState.REGISTER || p.getKarma() > 0 || p.isInCombat() || p.isInOlympiadMode() || p.inObserverMode() || StriderRace.getInstance().containsPlayer(p)) + { + p.sendMessage("[Strider Race]: conditions for registration are inappropriate !!!"); + return false; + } + + return true; + } + + private static boolean remove(L2PcInstance p) + { + if (StriderRace.getInstance().getStriderRaceState() == StriderRaceState.REGISTER && StriderRace.getInstance().containsPlayer(p)) + { + StriderRace.getInstance().removePlayer(p); + p.sendMessage("[Strider Race]: you have been successfully removed!"); + } + + return true; + } + + @Override + public String[] getVoicedCommandList() + { + return voiced_commands; + } +} Index: java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java =================================================================== --- java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java (revision 0) +++ java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java (working copy) import java.util.Map; +import net.sf.l2j.gameserver.handler.voicedcommandhandlers.RegStriderRace; protected VoicedCommandHandler() { + registerVoicedCommandHandler(new RegStriderRace()); \ No newline at end of file Index: java/net/sf/l2j/gameserver/model/actor/instance/L2StriderRaceEventInstance.java =================================================================== --- java/net/sf/l2j/gameserver/model/actor/instance/L2StriderRaceEventInstance.java (revision 0) +++ java/net/sf/l2j/gameserver/model/actor/instance/L2StriderRaceEventInstance.java (working copy) @@ -0,0 +1,102 @@ +/* + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see <[Hidden Content];. + */ +package net.sf.l2j.gameserver.model.actor.instance; + +import net.sf.l2j.Config; +import net.sf.l2j.gameserver.ai.CtrlIntention; +import net.sf.l2j.gameserver.datatables.MapRegionTable; +import net.sf.l2j.gameserver.datatables.SpawnTable; +import net.sf.l2j.gameserver.model.L2Object; +import net.sf.l2j.gameserver.model.L2Spawn; +import net.sf.l2j.gameserver.model.actor.L2Npc; +import net.sf.l2j.gameserver.model.actor.template.NpcTemplate; +import net.sf.l2j.gameserver.model.striderrace.StriderRace; +import net.sf.l2j.gameserver.model.striderrace.StriderRaceState; +import net.sf.l2j.gameserver.util.Broadcast; + +public class L2StriderRaceEventInstance extends L2NpcInstance +{ + public L2StriderRaceEventInstance(int objectId, NpcTemplate template) + { + super(objectId, template); + } + + private static int rankPlayer = 0; + + @Override + public void onAction(L2PcInstance player) + { + if (player.getTarget() != this) + player.setTarget(this); + else + { + if (!canInteract(player)) + player.getAI().setIntention(CtrlIntention.INTERACT, this); + else + { + if (StriderRace.getInstance().getStriderRaceState() == StriderRaceState.ATIVED && StriderRace.getInstance().containsPlayer(player)) + { + if (rankPlayer < 2) + { + rankPlayer++; + Broadcast.announceToOnlinePlayers("[Strider Race]: [" + rankPlayer + "] to arrive was -> " + player.getName(), true); + rewardPlayer(player); + StriderRace.getInstance().removePlayer(player); + player.teleToLocation(MapRegionTable.TeleportWhereType.Town); + player.dismount(); + return; + } + rankPlayer += 1; + Broadcast.announceToOnlinePlayers("[Strider Race]: [3] to arrive was -> " + player.getName(), true); + rewardPlayer(player); + StriderRace.getInstance().finishEvent(); + rankPlayer = 0; + + L2Object obj = player.getTarget(); + if (obj != null && obj instanceof L2Npc) + { + L2Npc target = (L2Npc) obj; + target.deleteMe(); + + L2Spawn spawn = target.getSpawn(); + if (spawn != null) + { + spawn.stopRespawn(); + SpawnTable.getInstance().deleteSpawn(spawn, true); + } + } + } + } + } + } + + private static void rewardPlayer(L2PcInstance player) + { + switch (rankPlayer) + { + case 1: + for (int[] item : Config.EVENT_SR_REWARD_TOP1) + player.addItem("", item[0], item[1], player, true); + break; + case 2: + for (int[] item : Config.EVENT_SR_REWARD_TOP2) + player.addItem("", item[0], item[1], player, true); + break; + default: + for (int[] item : Config.EVENT_SR_REWARD_TOP3) + player.addItem("", item[0], item[1], player, true); + } + } +} Index: config/events.properties =================================================================== --- config/events.properties (revision 1) +++ config/events.properties (working copy) gameserver/data/xml/admin_commands_rights.xml + <aCar name="admin_startsr" accessLevel="1" /> gameserver/data/xml/npcs <npc id="9106" idTemplate="35062" name="Strider Race Event" title="[ARRIVAL HERE]"> <set name="level" val="75"/> <set name="radius" val="10"/> <set name="height" val="80"/> <set name="rHand" val="0"/> <set name="lHand" val="0"/> <set name="type" val="L2StriderRaceEvent"/> <set name="exp" val="0"/> <set name="sp" val="10"/> <set name="hp" val="2676.65854"/> <set name="mp" val="1507.8"/> <set name="hpRegen" val="8.5"/> <set name="mpRegen" val="3"/> <set name="pAtk" val="794.70901"/> <set name="pDef" val="319.24623"/> <set name="mAtk" val="542.68324"/> <set name="mDef" val="233.61053"/> <set name="crit" val="4"/> <set name="atkSpd" val="253"/> <set name="str" val="40"/> <set name="int" val="21"/> <set name="dex" val="30"/> <set name="wit" val="20"/> <set name="con" val="43"/> <set name="men" val="20"/> <set name="corpseTime" val="7"/> <set name="walkSpd" val="50"/> <set name="runSpd" val="120"/> <set name="dropHerbGroup" val="0"/> <set name="attackRange" val="40"/> <ai type="default" ssCount="0" ssRate="0" spsCount="0" spsRate="0" aggro="0" clan="door_clan;dion_siege_clan" clanRange="600" canMove="false" seedable="false"/> <skills> <skill id="4045" level="1"/> <skill id="4416" level="19"/> </skills> </npc> Broadcast.ann Broadcast.announceToOnlinePlayers("[Strider Race]: The event ends with the winner -> " +player.getName(), true); Broadcast.announceToOnlinePlayers("[Strider Race]: " + sendMessage, true);
  3. o mano! nao sei como fazer isso! voce poderia fazer as alterações, e mandar aqui? ela completa, que eu testo
  4. e no Game mesmo! eu ja tinha conseguido, mais vim agradecer pela força! pros que tiverem o mesmo problema.! no geme mesmo! em Option. na Aba Game, marque a opção Show-Region. e pronto! :O
  5. E o seguinte: estou montando meu projeto server. e vou usar como peça fundamental, o pet STRIDER como montaria para todos os player.! mais, quando o player monta no STRIDER a arma sai da mão e vai pro inventory. como no original! gostaria de modificar para que as armas não saia da mão! pra quando o player desça do Pet, ele já se encontrem com a sua arma na mão.! agradeço muito a ajuda de quem poder ajudar! LOCAL ---- com.l2jfrozen.gameserver.handler.usercommandhandlers.Mount.java --- /* * L2jFrozen Project - www.l2jfrozen.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. * * [Hidden Content] */ package com.l2jfrozen.gameserver.handler.usercommandhandlers; import com.l2jfrozen.gameserver.datatables.SkillTable; import com.l2jfrozen.gameserver.geo.GeoData; import com.l2jfrozen.gameserver.handler.IUserCommandHandler; import com.l2jfrozen.gameserver.model.Inventory; import com.l2jfrozen.gameserver.model.L2Summon; import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; import com.l2jfrozen.gameserver.network.SystemMessageId; import com.l2jfrozen.gameserver.network.serverpackets.Ride; import com.l2jfrozen.gameserver.network.serverpackets.SystemMessage; import com.l2jfrozen.gameserver.util.Broadcast; /** * Support for /mount command. * @author Tempy */ public class Mount implements IUserCommandHandler { private static final int[] COMMAND_IDS = { 61 }; /* * (non-Javadoc) * @see com.l2jfrozen.gameserver.handler.IUserCommandHandler#useUserCommand(int, com.l2jfrozen.gameserver.model.L2PcInstance) */ @Override public synchronized boolean useUserCommand(final int id, final L2PcInstance activeChar) { if (id != COMMAND_IDS[0]) return false; L2Summon pet = activeChar.getPet(); if (pet != null && pet.isMountable() && !activeChar.isMounted()) { if (activeChar.isDead()) { // A strider cannot be ridden when player is dead. SystemMessage msg = new SystemMessage(SystemMessageId.STRIDER_CANT_BE_RIDDEN_WHILE_DEAD); activeChar.sendPacket(msg); msg = null; } else if (pet.isDead()) { // A dead strider cannot be ridden. SystemMessage msg = new SystemMessage(SystemMessageId.DEAD_STRIDER_CANT_BE_RIDDEN); activeChar.sendPacket(msg); msg = null; } else if (pet.isInCombat()) { // A strider in battle cannot be ridden. SystemMessage msg = new SystemMessage(SystemMessageId.STRIDER_IN_BATLLE_CANT_BE_RIDDEN); activeChar.sendPacket(msg); msg = null; } else if (activeChar.isInCombat()) { // A pet cannot be ridden while player is in battle. SystemMessage msg = new SystemMessage(SystemMessageId.STRIDER_CANT_BE_RIDDEN_WHILE_IN_BATTLE); activeChar.sendPacket(msg); msg = null; } else if (!activeChar.isInsideRadius(pet, 60, true, false)) { activeChar.sendMessage("Too far away from strider to mount."); return false; } else if (!GeoData.getInstance().canSeeTarget(activeChar, pet)) { final SystemMessage msg = new SystemMessage(SystemMessageId.CANT_SEE_TARGET); activeChar.sendPacket(msg); return false; } else if (activeChar.isSitting() || activeChar.isMoving()) { // A strider can be ridden only when player is standing. SystemMessage msg = new SystemMessage(SystemMessageId.STRIDER_CAN_BE_RIDDEN_ONLY_WHILE_STANDING); activeChar.sendPacket(msg); msg = null; } else if (!pet.isDead() && !activeChar.isMounted()) { if (!activeChar.disarmWeapons()) return false; Ride mount = new Ride(activeChar.getObjectId(), Ride.ACTION_MOUNT, pet.getTemplate().npcId); Broadcast.toSelfAndKnownPlayersInRadius(activeChar, mount, 810000/* 900 */); activeChar.setMountType(mount.getMountType()); activeChar.setMountObjectID(pet.getControlItemId()); pet.unSummon(activeChar); mount = null; if (activeChar.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND) != null || activeChar.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LRHAND) != null) { if (activeChar.setMountType(0)) { if (activeChar.isFlying()) { activeChar.removeSkill(SkillTable.getInstance().getInfo(4289, 1)); } Ride dismount = new Ride(activeChar.getObjectId(), Ride.ACTION_DISMOUNT, 0); Broadcast.toSelfAndKnownPlayers(activeChar, dismount); activeChar.setMountObjectID(0); dismount = null; } } } } else if (activeChar.isRentedPet()) { activeChar.stopRentPet(); } else if (activeChar.isMounted()) { // Dismount if (activeChar.setMountType(0)) { if (activeChar.isFlying()) { activeChar.removeSkill(SkillTable.getInstance().getInfo(4289, 1)); } Ride dismount = new Ride(activeChar.getObjectId(), Ride.ACTION_DISMOUNT, 0); Broadcast.toSelfAndKnownPlayers(activeChar, dismount); activeChar.setMountObjectID(0); dismount = null; } } pet = null; return true; } /* * (non-Javadoc) * @see com.l2jfrozen.gameserver.handler.IUserCommandHandler#getUserCommandList() */ @Override public int[] getUserCommandList() { return COMMAND_IDS; } }
  6. O fera sumiu, resolvir consertar eu mesmo. testado 100% tai Kคrim
  7. Erro no npcgpr.dat (Interlude Version 43) Fix the Code there for us ◄√i®uS► Fix the Code there for us Virus
  8. Gostaria de saber se isso uma tem ativação nas Config, ou é erro do Java. pois o Anuncio do local território, que aparece bem no meio da Tela quando teleportamos ou andamos por locais, no meu projeto não ta mais funcionando,! tou usando Rev L2jFrozen 1132. alguém pode me ajudar nisso? eu Agradeço..!
  9. Kayrus

    VIP Item

    Creditos: Zeus No meu funcionou perfeitamente!
  10. Testei todos e nenhum funcionou corretamente, faltando arquivos. Dif. java. etc. Fechem o Topico da mulher morcego pra que niguem mais perca mais tempo.. Feliz 2017
  11. Qual o comando que faz pra abrir essas janelas?
  12. Adcionei o mod com sucesso. ta aparecendo pra Vota e funcionando o voto.mais tenho algumas duvidas! como faço pra se escrever nos eventos? qual Type criar o Npc 50001,? Type L2EventManage ja tentei Onde por as HTML dos npc 9101-9110 ?
  13. nada shevinho! eu ja tinha feito esse teste em por "ArenaZone" mais nao funcionou.. ta dificil..:*
  14. PESSOAL PRECISO DESSA AJUDA AKI! ALGUEM ME AJUDAR A RESOLVER ISSO?? PLIZ
  15. Kayrus

    Pc Baing Points

    Alguem sabe o Verdadeiro ID PC Bang do Freya?? ou tem que add ?? como fazer?
×
×
  • Criar Novo...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.