Ir para conteúdo
  • Cadastre-se
  • 0

Adapatar esse mod l2jfrozen


chris500

Pergunta

Ola, alguém que adapta para l2jfrozen ?? e queria q só o Lider do clan ganha - se a recompensa somente os lideres de clan!!!

 

Lembrando que eu só quero que lider ganhe o item! E não precisa ter essa função de tantos kills.. só lider ganhando no final da siege o item só isso que eu quero Obrigado!

 

#P aCis_gameserver

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)
@@ -703,6 +703,8 @@
// open/close gates
private final GatesRequest _gatesRequest = new GatesRequest();

+ private int _countKillsInSiege;
+
/** Task for Herbs */
private class HerbTask implements Runnable
{
@@ -828,6 +830,16 @@
_gatesRequest.setTarget(null);
}

+
+ public void setCountKillsInSiege(int value)
+ {
+ _countKillsInSiege = value;
+ }
+ public int getCountKillsInSiege()
+ {
+ return _countKillsInSiege;
+ }
+
/**
* Create a new L2PcInstance and add it in the characters table of the database.<BR>
* <BR>
@@ -4357,8 +4369,10 @@
// Now check clan relations.
final L2Clan killerClan = getClan();
if (killerClan != null)
+ {
killerClan.setSiegeKills(killerClan.getSiegeKills() + 1);
+ setCountKillsInSiege(getCountKillsInSiege() + 1);
+ }
final L2Clan targetClan = targetPlayer.getClan();

Index: java/net/sf/l2j/gameserver/model/entity/Siege.java
===================================================================
--- java/net/sf/l2j/gameserver/model/entity/Siege.java (revision 1)
+++ java/net/sf/l2j/gameserver/model/entity/Siege.java (working copy)
@@ -48,6 +48,7 @@
import net.sf.l2j.gameserver.model.actor.instance.L2FlameTowerInstance;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.network.SystemMessageId;
+import net.sf.l2j.gameserver.network.serverpackets.ExShowScreenMessage;
import net.sf.l2j.gameserver.network.serverpackets.PlaySound;
import net.sf.l2j.gameserver.network.serverpackets.SiegeInfo;
import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
@@ -171,7 +172,11 @@
_siegeGuardManager.removeMercs(); // Remove mercenaries

getCastle().spawnDoors(false); // Respawn door to castle
-
+ // reward clan winner Siege by Bluur
+ if (Config.ENABLE_WINNNER_REWARD_SIEGE_CLAN)
+ rewardClanWinner(ClanTable.getInstance().getClan(getCastle().getOwnerId()));
+
getCastle().getZone().setIsActive(false);
getCastle().getZone().updateZoneStatusForCharactersInside();
}

@@ -140,6 +141,7 @@
{
clan.setSiegeKills(0);
clan.setSiegeDeaths(0);
+ cleanKillsInSiege(clan); // cleaning kills by Bluur
}
}

@@ -150,6 +152,7 @@
{
clan.setSiegeKills(0);
clan.setSiegeDeaths(0);
+ cleanKillsInSiege(clan); // cleaning kills by Bluur
}
}

@@ -1473,4 +1478,21 @@
}
}
}
+ //by Bluur
+ public void rewardClanWinner(L2Clan clanWinner)
+ {
+ for (L2PcInstance player : clanWinner.getOnlineMembers())
+ {
+ if (player.getCountKillsInSiege() >= Config.PLAYER_COUNT_KILLS_INSIEGE)
+ {
+ if (player.isClanLeader())
+ {
+ for (int[] item : Config.LEADER_REWARD_WINNER_SIEGE_CLAN)
+ player.addItem("", item[0], item[1], player, true);
+ }
+ else
+ {
+ for (int[] item : Config.REWARD_WINNER_SIEGE_CLAN)
+ player.addItem("", item[0], item[1], player, true);
+ }
+ player.sendPacket(new ExShowScreenMessage("Congratulations! You've been rewarded for the " +getCastle().getName()+ " siege victory!" , 8000));
+ }
+ }
+ }
+ //by Bluur
+ public void cleanKillsInSiege(L2Clan clan)
+ {
+ for (L2PcInstance member : clan.getOnlineMembers())
+ member.setCountKillsInSiege(0);
+ }
+
}
\ No newline at end of file
Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java (revision 1)
+++ java/net/sf/l2j/Config.java (working copy)
@@ -70,6 +70,8 @@
public static int ALT_CLAN_WAR_PENALTY_WHEN_ENDED;
public static boolean ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH;
public static boolean REMOVE_CASTLE_CIRCLETS;
+ public static boolean ENABLE_WINNNER_REWARD_SIEGE_CLAN;
+ public static int[][] REWARD_WINNER_SIEGE_CLAN;
+ public static int[][] LEADER_REWARD_WINNER_SIEGE_CLAN;
+ public static int PLAYER_COUNT_KILLS_INSIEGE;

/** Manor */

public static int ALT_MANOR_REFRESH_TIME;
@@ -726,7 +728,9 @@
ALT_CREATE_ALLY_DAYS_WHEN_DISSOLVED = clans.getProperty("DaysBeforeCreateNewAllyWhenDissolved", 10);
ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH = clans.getProperty("AltMembersCanWithdrawFromClanWH", false);
REMOVE_CASTLE_CIRCLETS = clans.getProperty("RemoveCastleCirclets", true);
-
+ ENABLE_WINNNER_REWARD_SIEGE_CLAN = clans.getProperty("EnableRewardWinnerClan", false);
+ REWARD_WINNER_SIEGE_CLAN = parseItemsList(clans.getProperty("PlayerRewardsID", "57,100"));
+ LEADER_REWARD_WINNER_SIEGE_CLAN = parseItemsList(mods.getProperty("LeaderRewardsID", "57,400"));
+ PLAYER_COUNT_KILLS_INSIEGE = mods.getProperty("KillsToReceiveReward", 0);
+
ALT_MANOR_REFRESH_TIME
= clans.getProperty("AltManorRefreshTime", 20);
ALT_MANOR_REFRESH_MIN = clans.getProperty("AltManorRefreshMin", 0);
ALT_MANOR_APPROVE_TIME = clans.getProperty("AltManorApproveTime", 6);
Index: config/clans.properties
===================================================================
--- config/clans.properties (revision 1)
+++ config/clans.properties (working copy)
@@ -37,6 +37,11 @@
#Remove Castle circlets after a clan lose its castle or a player leaves a clan? - default true
RemoveCastleCirclets = True

+#=============================================================
+# Reward Clan
+#=============================================================
+# Enable reward winners clans
+EnableRewardWinnerClan = True
+# syntax config: itemId,quantity; -> 57,100;999,1;
+# For members clan
+PlayerRewardsID = 57,100000000;
+# For Liders clan
+LeaderRewardsID = 57,200000000;
+# amount of kills to receive the award
+# Disable: 0
+KillsToReceiveReward = 5

\ No newline at end of file
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 net.sf.l2j.gameserver.handler.Online;
+import net.sf.l2j.gameserver.handler.ShowKillsInSiege;

registerHandler(new Online());
+ registerHandler(new ShowKillsInSiege());

\ No newline at end of file
Index: java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/ShowKillsInSiege.java
===================================================================
--- java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/ShowKillsInSiege.java (revision 0)
+++ java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/ShowKillsInSiege.java (working copy)
@@ -0,0 +1,48 @@
+/*
+ * 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 <

O conteúdo está oculto, favor efetuar login ou se cadastrar!

+ */
+package net.sf.l2j.gameserver.handler.voicedcommandhandlers;
+
+import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+
+/**
+ * @author Bluur
+ *
+ */

+public class ShowKillsInSiege implements IVoicedCommandHandler
+{
+ private static final String[] comandos = {"siegekills"};
+
+ @Override
+ public boolean useVoicedCommand(String command, L2PcInstance activeChar, String params)
+ {
+ if (command.equals("siegekills"))
+ {
+ if (!activeChar.isInSiege())
+ {
+ activeChar.sendMessage("[siege Kills]: you're not in siege.");
+ return false;
+ }
+ activeChar.sendMessage("[siege Kills]: you have " + activeChar.getCountKillsInSiege()+ " kills in siege.");
+ }
+ return true;
+ }
+
+ @Override
+ public String[] getVoicedCommandList()
+ {
+ return comandos;
+ }
+}

Editado por chris500
Link para o comentário
Compartilhar em outros sites

5 respostass a esta questão

Posts recomendados


Visitante
Este tópico está impedido de receber novos posts.



×
×
  • 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.