Raise clan level from new clan panel.
This commit is contained in:
parent
5cea506310
commit
686d068dc4
@ -199,21 +199,6 @@ CreateKnightUnitCost = 10000
|
|||||||
# Reputation score reduced by reinforcing Knight Unit (if clan level is 9 or more).
|
# Reputation score reduced by reinforcing Knight Unit (if clan level is 9 or more).
|
||||||
ReinforceKnightUnitCost = 5000
|
ReinforceKnightUnitCost = 5000
|
||||||
|
|
||||||
# Reputation score reduced by increasing clan level.
|
|
||||||
ClanLevel6Cost = 5000
|
|
||||||
ClanLevel7Cost = 10000
|
|
||||||
ClanLevel8Cost = 20000
|
|
||||||
ClanLevel9Cost = 40000
|
|
||||||
ClanLevel10Cost = 40000
|
|
||||||
ClanLevel11Cost = 75000
|
|
||||||
|
|
||||||
# Number of clan members needed to increase clan level.
|
|
||||||
ClanLevel6Requirement = 30
|
|
||||||
ClanLevel7Requirement = 50
|
|
||||||
ClanLevel8Requirement = 80
|
|
||||||
ClanLevel9Requirement = 120
|
|
||||||
ClanLevel10Requirement = 140
|
|
||||||
ClanLevel11Requirement = 170
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Other
|
# Other
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
<html><body>What would you like to do?<br>
|
<html><body>What would you like to do?<br>
|
||||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Clan 9000-02.htm">"I want to create a new clan."</Button>
|
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Clan 9000-02.htm">"I want to create a new clan."</Button>
|
||||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Clan 9000-03.htm">"Can I raise my clan level?"</Button>
|
|
||||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Clan 9000-04.htm">"I want to disband my clan."</Button>
|
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Clan 9000-04.htm">"I want to disband my clan."</Button>
|
||||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Clan 9000-05.htm">"I'd like to restore my clan."</Button>
|
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Clan 9000-05.htm">"I'd like to restore my clan."</Button>
|
||||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_learn_clan_skills">"Can you teach me some clan skills?"</Button>
|
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_learn_clan_skills">"Can you teach me some clan skills?"</Button>
|
||||||
|
@ -379,18 +379,6 @@ public final class Config
|
|||||||
public static int REPUTATION_SCORE_PER_KILL;
|
public static int REPUTATION_SCORE_PER_KILL;
|
||||||
public static int JOIN_ACADEMY_MIN_REP_SCORE;
|
public static int JOIN_ACADEMY_MIN_REP_SCORE;
|
||||||
public static int JOIN_ACADEMY_MAX_REP_SCORE;
|
public static int JOIN_ACADEMY_MAX_REP_SCORE;
|
||||||
public static int CLAN_LEVEL_6_COST;
|
|
||||||
public static int CLAN_LEVEL_7_COST;
|
|
||||||
public static int CLAN_LEVEL_8_COST;
|
|
||||||
public static int CLAN_LEVEL_9_COST;
|
|
||||||
public static int CLAN_LEVEL_10_COST;
|
|
||||||
public static int CLAN_LEVEL_11_COST;
|
|
||||||
public static int CLAN_LEVEL_6_REQUIREMENT;
|
|
||||||
public static int CLAN_LEVEL_7_REQUIREMENT;
|
|
||||||
public static int CLAN_LEVEL_8_REQUIREMENT;
|
|
||||||
public static int CLAN_LEVEL_9_REQUIREMENT;
|
|
||||||
public static int CLAN_LEVEL_10_REQUIREMENT;
|
|
||||||
public static int CLAN_LEVEL_11_REQUIREMENT;
|
|
||||||
public static boolean ALLOW_WYVERN_ALWAYS;
|
public static boolean ALLOW_WYVERN_ALWAYS;
|
||||||
public static boolean ALLOW_WYVERN_DURING_SIEGE;
|
public static boolean ALLOW_WYVERN_DURING_SIEGE;
|
||||||
public static boolean ALLOW_MOUNTS_DURING_SIEGE;
|
public static boolean ALLOW_MOUNTS_DURING_SIEGE;
|
||||||
@ -1389,18 +1377,6 @@ public final class Config
|
|||||||
REPUTATION_SCORE_PER_KILL = Feature.getInt("ReputationScorePerKill", 1);
|
REPUTATION_SCORE_PER_KILL = Feature.getInt("ReputationScorePerKill", 1);
|
||||||
JOIN_ACADEMY_MIN_REP_SCORE = Feature.getInt("CompleteAcademyMinPoints", 190);
|
JOIN_ACADEMY_MIN_REP_SCORE = Feature.getInt("CompleteAcademyMinPoints", 190);
|
||||||
JOIN_ACADEMY_MAX_REP_SCORE = Feature.getInt("CompleteAcademyMaxPoints", 650);
|
JOIN_ACADEMY_MAX_REP_SCORE = Feature.getInt("CompleteAcademyMaxPoints", 650);
|
||||||
CLAN_LEVEL_6_COST = Feature.getInt("ClanLevel6Cost", 5000);
|
|
||||||
CLAN_LEVEL_7_COST = Feature.getInt("ClanLevel7Cost", 10000);
|
|
||||||
CLAN_LEVEL_8_COST = Feature.getInt("ClanLevel8Cost", 20000);
|
|
||||||
CLAN_LEVEL_9_COST = Feature.getInt("ClanLevel9Cost", 40000);
|
|
||||||
CLAN_LEVEL_10_COST = Feature.getInt("ClanLevel10Cost", 40000);
|
|
||||||
CLAN_LEVEL_11_COST = Feature.getInt("ClanLevel11Cost", 75000);
|
|
||||||
CLAN_LEVEL_6_REQUIREMENT = Feature.getInt("ClanLevel6Requirement", 30);
|
|
||||||
CLAN_LEVEL_7_REQUIREMENT = Feature.getInt("ClanLevel7Requirement", 50);
|
|
||||||
CLAN_LEVEL_8_REQUIREMENT = Feature.getInt("ClanLevel8Requirement", 80);
|
|
||||||
CLAN_LEVEL_9_REQUIREMENT = Feature.getInt("ClanLevel9Requirement", 120);
|
|
||||||
CLAN_LEVEL_10_REQUIREMENT = Feature.getInt("ClanLevel10Requirement", 140);
|
|
||||||
CLAN_LEVEL_11_REQUIREMENT = Feature.getInt("ClanLevel11Requirement", 170);
|
|
||||||
ALLOW_WYVERN_ALWAYS = Feature.getBoolean("AllowRideWyvernAlways", false);
|
ALLOW_WYVERN_ALWAYS = Feature.getBoolean("AllowRideWyvernAlways", false);
|
||||||
ALLOW_WYVERN_DURING_SIEGE = Feature.getBoolean("AllowRideWyvernDuringSiege", true);
|
ALLOW_WYVERN_DURING_SIEGE = Feature.getBoolean("AllowRideWyvernDuringSiege", true);
|
||||||
ALLOW_MOUNTS_DURING_SIEGE = Feature.getBoolean("AllowRideMountsDuringSiege", false);
|
ALLOW_MOUNTS_DURING_SIEGE = Feature.getBoolean("AllowRideMountsDuringSiege", false);
|
||||||
|
@ -0,0 +1,49 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* 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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package com.l2jmobius.gameserver.data.xml.impl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Mobius
|
||||||
|
*/
|
||||||
|
public class ClanLevelTable
|
||||||
|
{
|
||||||
|
// TODO: Move to XML.
|
||||||
|
private final static int[] CLAN_LEVEL_REQUIREMENTS =
|
||||||
|
{
|
||||||
|
35000,
|
||||||
|
80000, // Level 2 requirement.
|
||||||
|
140000,
|
||||||
|
315000,
|
||||||
|
560000,
|
||||||
|
965000,
|
||||||
|
2690000,
|
||||||
|
4050000,
|
||||||
|
5930000,
|
||||||
|
7560000,
|
||||||
|
11830000,
|
||||||
|
19110000,
|
||||||
|
27300000,
|
||||||
|
36400000,
|
||||||
|
46410000,
|
||||||
|
0 // Max level (15).
|
||||||
|
};
|
||||||
|
|
||||||
|
public static int getLevelRequirement(int clanLevel)
|
||||||
|
{
|
||||||
|
return CLAN_LEVEL_REQUIREMENTS[clanLevel];
|
||||||
|
}
|
||||||
|
}
|
@ -40,10 +40,10 @@ import com.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
|
|||||||
import com.l2jmobius.gameserver.data.sql.impl.CharNameTable;
|
import com.l2jmobius.gameserver.data.sql.impl.CharNameTable;
|
||||||
import com.l2jmobius.gameserver.data.sql.impl.ClanTable;
|
import com.l2jmobius.gameserver.data.sql.impl.ClanTable;
|
||||||
import com.l2jmobius.gameserver.data.sql.impl.CrestTable;
|
import com.l2jmobius.gameserver.data.sql.impl.CrestTable;
|
||||||
|
import com.l2jmobius.gameserver.data.xml.impl.ClanLevelTable;
|
||||||
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
|
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
|
||||||
import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData;
|
import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData;
|
||||||
import com.l2jmobius.gameserver.enums.ClanRewardType;
|
import com.l2jmobius.gameserver.enums.ClanRewardType;
|
||||||
import com.l2jmobius.gameserver.enums.UserInfoType;
|
|
||||||
import com.l2jmobius.gameserver.instancemanager.CastleManager;
|
import com.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||||
import com.l2jmobius.gameserver.instancemanager.FortManager;
|
import com.l2jmobius.gameserver.instancemanager.FortManager;
|
||||||
import com.l2jmobius.gameserver.instancemanager.SiegeManager;
|
import com.l2jmobius.gameserver.instancemanager.SiegeManager;
|
||||||
@ -77,6 +77,7 @@ import com.l2jmobius.gameserver.network.serverpackets.PledgeSkillList.SubPledgeS
|
|||||||
import com.l2jmobius.gameserver.network.serverpackets.PledgeSkillListAdd;
|
import com.l2jmobius.gameserver.network.serverpackets.PledgeSkillListAdd;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.UserInfo;
|
import com.l2jmobius.gameserver.network.serverpackets.UserInfo;
|
||||||
|
import com.l2jmobius.gameserver.network.serverpackets.pledgeV2.ExPledgeShowInfoUpdate;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.pledgebonus.ExPledgeBonusMarkReset;
|
import com.l2jmobius.gameserver.network.serverpackets.pledgebonus.ExPledgeBonusMarkReset;
|
||||||
import com.l2jmobius.gameserver.util.EnumIntBitmask;
|
import com.l2jmobius.gameserver.util.EnumIntBitmask;
|
||||||
import com.l2jmobius.gameserver.util.Util;
|
import com.l2jmobius.gameserver.util.Util;
|
||||||
@ -2498,220 +2499,31 @@ public class L2Clan implements IIdentifiable, INamable
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean increaseClanLevel = false;
|
boolean increasedLevel = false;
|
||||||
|
if (_level < 15)
|
||||||
switch (_level)
|
|
||||||
{
|
{
|
||||||
case 0:
|
final int requiredReputation = ClanLevelTable.getLevelRequirement(_level);
|
||||||
|
if (requiredReputation <= _reputationScore)
|
||||||
{
|
{
|
||||||
// Upgrade to 1
|
setReputationScore(_reputationScore - requiredReputation, true);
|
||||||
if ((player.getSp() >= 20000) && (player.getAdena() >= 650000))
|
final SystemMessage cr = SystemMessage.getSystemMessage(SystemMessageId.S1_POINT_S_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION);
|
||||||
{
|
cr.addInt(requiredReputation);
|
||||||
if (player.reduceAdena("ClanLvl", 650000, player.getTarget(), true))
|
player.sendPacket(cr);
|
||||||
{
|
|
||||||
player.setSp(player.getSp() - 20000);
|
changeLevel(_level + 1);
|
||||||
final SystemMessage sp = SystemMessage.getSystemMessage(SystemMessageId.YOUR_SP_HAS_DECREASED_BY_S1);
|
player.sendPacket(new ExPledgeShowInfoUpdate(player));
|
||||||
sp.addInt(20000);
|
increasedLevel = true;
|
||||||
player.sendPacket(sp);
|
|
||||||
increaseClanLevel = true;
|
// Notify to scripts
|
||||||
}
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerClanLvlUp(player, this));
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 1:
|
|
||||||
{
|
|
||||||
// Upgrade to 2
|
|
||||||
if ((player.getSp() >= 100000) && (player.getAdena() >= 2500000))
|
|
||||||
{
|
|
||||||
if (player.reduceAdena("ClanLvl", 2500000, player.getTarget(), true))
|
|
||||||
{
|
|
||||||
player.setSp(player.getSp() - 100000);
|
|
||||||
final SystemMessage sp = SystemMessage.getSystemMessage(SystemMessageId.YOUR_SP_HAS_DECREASED_BY_S1);
|
|
||||||
sp.addInt(100000);
|
|
||||||
player.sendPacket(sp);
|
|
||||||
increaseClanLevel = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 2:
|
|
||||||
{
|
|
||||||
// Upgrade to 3
|
|
||||||
if ((player.getSp() >= 350000) && (player.getInventory().getItemByItemId(1419) != null))
|
|
||||||
{
|
|
||||||
// TODO unhardcode these item IDs
|
|
||||||
// itemId 1419 == Blood Mark
|
|
||||||
if (player.destroyItemByItemId("ClanLvl", 1419, 1, player.getTarget(), false))
|
|
||||||
{
|
|
||||||
player.setSp(player.getSp() - 350000);
|
|
||||||
final SystemMessage sp = SystemMessage.getSystemMessage(SystemMessageId.YOUR_SP_HAS_DECREASED_BY_S1);
|
|
||||||
sp.addInt(350000);
|
|
||||||
player.sendPacket(sp);
|
|
||||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_DISAPPEARED);
|
|
||||||
sm.addItemName(1419);
|
|
||||||
player.sendPacket(sm);
|
|
||||||
increaseClanLevel = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 3:
|
|
||||||
{
|
|
||||||
// Upgrade to 4
|
|
||||||
if ((player.getSp() >= 1000000) && (player.getInventory().getItemByItemId(3874) != null))
|
|
||||||
{
|
|
||||||
// itemId 3874 == Alliance Manifesto
|
|
||||||
if (player.destroyItemByItemId("ClanLvl", 3874, 1, player.getTarget(), false))
|
|
||||||
{
|
|
||||||
player.setSp(player.getSp() - 1000000);
|
|
||||||
final SystemMessage sp = SystemMessage.getSystemMessage(SystemMessageId.YOUR_SP_HAS_DECREASED_BY_S1);
|
|
||||||
sp.addInt(1000000);
|
|
||||||
player.sendPacket(sp);
|
|
||||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_DISAPPEARED);
|
|
||||||
sm.addItemName(3874);
|
|
||||||
player.sendPacket(sm);
|
|
||||||
increaseClanLevel = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 4:
|
|
||||||
{
|
|
||||||
// Upgrade to 5
|
|
||||||
if ((player.getSp() >= 2500000) && (player.getInventory().getItemByItemId(3870) != null))
|
|
||||||
{
|
|
||||||
// itemId 3870 == Seal of Aspiration
|
|
||||||
if (player.destroyItemByItemId("ClanLvl", 3870, 1, player.getTarget(), false))
|
|
||||||
{
|
|
||||||
player.setSp(player.getSp() - 2500000);
|
|
||||||
final SystemMessage sp = SystemMessage.getSystemMessage(SystemMessageId.YOUR_SP_HAS_DECREASED_BY_S1);
|
|
||||||
sp.addInt(2500000);
|
|
||||||
player.sendPacket(sp);
|
|
||||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_DISAPPEARED);
|
|
||||||
sm.addItemName(3870);
|
|
||||||
player.sendPacket(sm);
|
|
||||||
increaseClanLevel = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 5:
|
|
||||||
{
|
|
||||||
// Upgrade to 6
|
|
||||||
if ((_reputationScore >= Config.CLAN_LEVEL_6_COST) && (_members.size() >= Config.CLAN_LEVEL_6_REQUIREMENT))
|
|
||||||
{
|
|
||||||
setReputationScore(_reputationScore - Config.CLAN_LEVEL_6_COST, true);
|
|
||||||
final SystemMessage cr = SystemMessage.getSystemMessage(SystemMessageId.S1_POINT_S_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION);
|
|
||||||
cr.addInt(Config.CLAN_LEVEL_6_COST);
|
|
||||||
player.sendPacket(cr);
|
|
||||||
increaseClanLevel = true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 6:
|
|
||||||
{
|
|
||||||
// Upgrade to 7
|
|
||||||
if ((_reputationScore >= Config.CLAN_LEVEL_7_COST) && (_members.size() >= Config.CLAN_LEVEL_7_REQUIREMENT))
|
|
||||||
{
|
|
||||||
setReputationScore(_reputationScore - Config.CLAN_LEVEL_7_COST, true);
|
|
||||||
final SystemMessage cr = SystemMessage.getSystemMessage(SystemMessageId.S1_POINT_S_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION);
|
|
||||||
cr.addInt(Config.CLAN_LEVEL_7_COST);
|
|
||||||
player.sendPacket(cr);
|
|
||||||
increaseClanLevel = true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 7:
|
|
||||||
{
|
|
||||||
// Upgrade to 8
|
|
||||||
if ((_reputationScore >= Config.CLAN_LEVEL_8_COST) && (_members.size() >= Config.CLAN_LEVEL_8_REQUIREMENT))
|
|
||||||
{
|
|
||||||
setReputationScore(_reputationScore - Config.CLAN_LEVEL_8_COST, true);
|
|
||||||
final SystemMessage cr = SystemMessage.getSystemMessage(SystemMessageId.S1_POINT_S_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION);
|
|
||||||
cr.addInt(Config.CLAN_LEVEL_8_COST);
|
|
||||||
player.sendPacket(cr);
|
|
||||||
increaseClanLevel = true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 8:
|
|
||||||
{
|
|
||||||
// Upgrade to 9
|
|
||||||
if ((_reputationScore >= Config.CLAN_LEVEL_9_COST) && (player.getInventory().getItemByItemId(9910) != null) && (_members.size() >= Config.CLAN_LEVEL_9_REQUIREMENT))
|
|
||||||
{
|
|
||||||
// itemId 9910 == Blood Oath
|
|
||||||
if (player.destroyItemByItemId("ClanLvl", 9910, 150, player.getTarget(), false))
|
|
||||||
{
|
|
||||||
setReputationScore(_reputationScore - Config.CLAN_LEVEL_9_COST, true);
|
|
||||||
final SystemMessage cr = SystemMessage.getSystemMessage(SystemMessageId.S1_POINT_S_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION);
|
|
||||||
cr.addInt(Config.CLAN_LEVEL_9_COST);
|
|
||||||
player.sendPacket(cr);
|
|
||||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S2_S1_S_DISAPPEARED);
|
|
||||||
sm.addItemName(9910);
|
|
||||||
sm.addLong(150);
|
|
||||||
player.sendPacket(sm);
|
|
||||||
increaseClanLevel = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 9:
|
|
||||||
{
|
|
||||||
// Upgrade to 10
|
|
||||||
if ((_reputationScore >= Config.CLAN_LEVEL_10_COST) && (player.getInventory().getItemByItemId(9911) != null) && (_members.size() >= Config.CLAN_LEVEL_10_REQUIREMENT))
|
|
||||||
{
|
|
||||||
// itemId 9911 == Blood Alliance
|
|
||||||
if (player.destroyItemByItemId("ClanLvl", 9911, 5, player.getTarget(), false))
|
|
||||||
{
|
|
||||||
setReputationScore(_reputationScore - Config.CLAN_LEVEL_10_COST, true);
|
|
||||||
final SystemMessage cr = SystemMessage.getSystemMessage(SystemMessageId.S1_POINT_S_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION);
|
|
||||||
cr.addInt(Config.CLAN_LEVEL_10_COST);
|
|
||||||
player.sendPacket(cr);
|
|
||||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S2_S1_S_DISAPPEARED);
|
|
||||||
sm.addItemName(9911);
|
|
||||||
sm.addLong(5);
|
|
||||||
player.sendPacket(sm);
|
|
||||||
increaseClanLevel = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 10:
|
|
||||||
{
|
|
||||||
// Upgrade to 11
|
|
||||||
if ((_reputationScore >= Config.CLAN_LEVEL_11_COST) && (_members.size() >= Config.CLAN_LEVEL_11_REQUIREMENT))
|
|
||||||
{
|
|
||||||
setReputationScore(_reputationScore - Config.CLAN_LEVEL_11_COST, true);
|
|
||||||
final SystemMessage cr = SystemMessage.getSystemMessage(SystemMessageId.S1_POINT_S_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION);
|
|
||||||
cr.addInt(Config.CLAN_LEVEL_11_COST);
|
|
||||||
player.sendPacket(cr);
|
|
||||||
increaseClanLevel = true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!increasedLevel)
|
||||||
if (!increaseClanLevel)
|
|
||||||
{
|
{
|
||||||
player.sendPacket(SystemMessageId.THE_CONDITIONS_NECESSARY_TO_INCREASE_THE_CLAN_S_LEVEL_HAVE_NOT_BEEN_MET);
|
player.sendPacket(SystemMessageId.THE_CONDITIONS_NECESSARY_TO_INCREASE_THE_CLAN_S_LEVEL_HAVE_NOT_BEEN_MET);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// the player should know that he has less sp now :p
|
|
||||||
final UserInfo ui = new UserInfo(player, false);
|
|
||||||
ui.addComponentType(UserInfoType.CURRENT_HPMPCP_EXP_SP);
|
|
||||||
player.sendPacket(ui);
|
|
||||||
|
|
||||||
player.sendItemList();
|
|
||||||
|
|
||||||
changeLevel(_level + 1);
|
|
||||||
|
|
||||||
// Notify to scripts
|
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerClanLvlUp(player, this));
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,8 +81,10 @@ import com.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMentorLis
|
|||||||
import com.l2jmobius.gameserver.network.clientpackets.monsterbook.RequestMonsterBookClose;
|
import com.l2jmobius.gameserver.network.clientpackets.monsterbook.RequestMonsterBookClose;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.monsterbook.RequestMonsterBookOpen;
|
import com.l2jmobius.gameserver.network.clientpackets.monsterbook.RequestMonsterBookOpen;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.monsterbook.RequestMonsterBookReward;
|
import com.l2jmobius.gameserver.network.clientpackets.monsterbook.RequestMonsterBookReward;
|
||||||
|
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeAnnounce;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeItemBuy;
|
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeItemBuy;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeItemList;
|
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeItemList;
|
||||||
|
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeLevelUp;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeMasteryInfo;
|
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeMasteryInfo;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeMasteryReset;
|
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeMasteryReset;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeSkillInfo;
|
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeSkillInfo;
|
||||||
@ -422,7 +424,7 @@ public enum ExIncomingPackets implements IIncomingPackets<L2GameClient>
|
|||||||
EX_PLEDGE_CONTRIBUTION_RANK(0x13E, null, ConnectionState.IN_GAME),
|
EX_PLEDGE_CONTRIBUTION_RANK(0x13E, null, ConnectionState.IN_GAME),
|
||||||
EX_PLEDGE_CONTRIBUTION_INFO(0x13F, null, ConnectionState.IN_GAME),
|
EX_PLEDGE_CONTRIBUTION_INFO(0x13F, null, ConnectionState.IN_GAME),
|
||||||
EX_PLEDGE_CONTRIBUTION_REWARD(0x140, null, ConnectionState.IN_GAME),
|
EX_PLEDGE_CONTRIBUTION_REWARD(0x140, null, ConnectionState.IN_GAME),
|
||||||
EX_PLEDGE_LEVEL_UP(0x141, null, ConnectionState.IN_GAME),
|
EX_PLEDGE_LEVEL_UP(0x141, RequestExPledgeLevelUp::new, ConnectionState.IN_GAME),
|
||||||
EX_PLEDGE_MISSION_INFO(0x142, null, ConnectionState.IN_GAME),
|
EX_PLEDGE_MISSION_INFO(0x142, null, ConnectionState.IN_GAME),
|
||||||
EX_PLEDGE_MISSION_REWARD(0x143, null, ConnectionState.IN_GAME),
|
EX_PLEDGE_MISSION_REWARD(0x143, null, ConnectionState.IN_GAME),
|
||||||
EX_PLEDGE_MASTERY_INFO(0x144, RequestExPledgeMasteryInfo::new, ConnectionState.IN_GAME),
|
EX_PLEDGE_MASTERY_INFO(0x144, RequestExPledgeMasteryInfo::new, ConnectionState.IN_GAME),
|
||||||
@ -432,7 +434,7 @@ public enum ExIncomingPackets implements IIncomingPackets<L2GameClient>
|
|||||||
EX_PLEDGE_SKILL_ACTIVATE(0x148, null, ConnectionState.IN_GAME),
|
EX_PLEDGE_SKILL_ACTIVATE(0x148, null, ConnectionState.IN_GAME),
|
||||||
EX_PLEDGE_ITEM_LIST(0x149, RequestExPledgeItemList::new, ConnectionState.IN_GAME),
|
EX_PLEDGE_ITEM_LIST(0x149, RequestExPledgeItemList::new, ConnectionState.IN_GAME),
|
||||||
EX_PLEDGE_ITEM_ACTIVATE(0x14A, null, ConnectionState.IN_GAME),
|
EX_PLEDGE_ITEM_ACTIVATE(0x14A, null, ConnectionState.IN_GAME),
|
||||||
EX_PLEDGE_ANNOUNCE(0x14B, null, ConnectionState.IN_GAME),
|
EX_PLEDGE_ANNOUNCE(0x14B, RequestExPledgeAnnounce::new, ConnectionState.IN_GAME),
|
||||||
EX_PLEDGE_ANNOUNCE_SET(0x14C, null, ConnectionState.IN_GAME),
|
EX_PLEDGE_ANNOUNCE_SET(0x14C, null, ConnectionState.IN_GAME),
|
||||||
EX_CREATE_PLEDGE(0x14D, null, ConnectionState.IN_GAME),
|
EX_CREATE_PLEDGE(0x14D, null, ConnectionState.IN_GAME),
|
||||||
EX_PLEDGE_ITEM_INFO(0x14E, null, ConnectionState.IN_GAME),
|
EX_PLEDGE_ITEM_INFO(0x14E, null, ConnectionState.IN_GAME),
|
||||||
|
@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* 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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package com.l2jmobius.gameserver.network.clientpackets.pledgeV2;
|
||||||
|
|
||||||
|
import com.l2jmobius.commons.network.PacketReader;
|
||||||
|
import com.l2jmobius.gameserver.model.L2Clan;
|
||||||
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
|
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||||
|
import com.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
|
||||||
|
import com.l2jmobius.gameserver.network.serverpackets.pledgeV2.ExPledgeShowInfoUpdate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Mobius
|
||||||
|
*/
|
||||||
|
public class RequestExPledgeAnnounce implements IClientIncomingPacket
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public boolean read(L2GameClient client, PacketReader packet)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run(L2GameClient client)
|
||||||
|
{
|
||||||
|
final L2PcInstance activeChar = client.getActiveChar();
|
||||||
|
if (activeChar == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
final L2Clan clan = activeChar.getClan();
|
||||||
|
if (clan == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
client.sendPacket(new ExPledgeShowInfoUpdate(activeChar));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,52 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* 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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package com.l2jmobius.gameserver.network.clientpackets.pledgeV2;
|
||||||
|
|
||||||
|
import com.l2jmobius.commons.network.PacketReader;
|
||||||
|
import com.l2jmobius.gameserver.model.L2Clan;
|
||||||
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
|
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||||
|
import com.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Mobius
|
||||||
|
*/
|
||||||
|
public class RequestExPledgeLevelUp implements IClientIncomingPacket
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public boolean read(L2GameClient client, PacketReader packet)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run(L2GameClient client)
|
||||||
|
{
|
||||||
|
final L2PcInstance activeChar = client.getActiveChar();
|
||||||
|
if (activeChar == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
final L2Clan clan = activeChar.getClan();
|
||||||
|
if (clan == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
clan.levelUpClan(activeChar);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,54 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* 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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package com.l2jmobius.gameserver.network.serverpackets.pledgeV2;
|
||||||
|
|
||||||
|
import com.l2jmobius.commons.network.PacketWriter;
|
||||||
|
import com.l2jmobius.gameserver.data.xml.impl.ClanLevelTable;
|
||||||
|
import com.l2jmobius.gameserver.model.L2Clan;
|
||||||
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
|
import com.l2jmobius.gameserver.network.OutgoingPackets;
|
||||||
|
import com.l2jmobius.gameserver.network.serverpackets.AbstractItemPacket;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Mobius
|
||||||
|
*/
|
||||||
|
public class ExPledgeShowInfoUpdate extends AbstractItemPacket
|
||||||
|
{
|
||||||
|
final L2PcInstance _player;
|
||||||
|
|
||||||
|
public ExPledgeShowInfoUpdate(L2PcInstance player)
|
||||||
|
{
|
||||||
|
_player = player;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean write(PacketWriter packet)
|
||||||
|
{
|
||||||
|
final L2Clan clan = _player.getClan();
|
||||||
|
if (clan == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
OutgoingPackets.EX_PLEDGE_SHOW_INFO_UPDATE.writeId(packet);
|
||||||
|
packet.writeD(clan.getId()); // Pledge ID
|
||||||
|
packet.writeD(ClanLevelTable.getLevelRequirement(clan.getLevel())); // Next level cost
|
||||||
|
packet.writeD(0); // Max pledge members
|
||||||
|
packet.writeD(0); // Max elite members
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
@ -199,21 +199,6 @@ CreateKnightUnitCost = 10000
|
|||||||
# Reputation score reduced by reinforcing Knight Unit (if clan level is 9 or more).
|
# Reputation score reduced by reinforcing Knight Unit (if clan level is 9 or more).
|
||||||
ReinforceKnightUnitCost = 5000
|
ReinforceKnightUnitCost = 5000
|
||||||
|
|
||||||
# Reputation score reduced by increasing clan level.
|
|
||||||
ClanLevel6Cost = 5000
|
|
||||||
ClanLevel7Cost = 10000
|
|
||||||
ClanLevel8Cost = 20000
|
|
||||||
ClanLevel9Cost = 40000
|
|
||||||
ClanLevel10Cost = 40000
|
|
||||||
ClanLevel11Cost = 75000
|
|
||||||
|
|
||||||
# Number of clan members needed to increase clan level.
|
|
||||||
ClanLevel6Requirement = 30
|
|
||||||
ClanLevel7Requirement = 50
|
|
||||||
ClanLevel8Requirement = 80
|
|
||||||
ClanLevel9Requirement = 120
|
|
||||||
ClanLevel10Requirement = 140
|
|
||||||
ClanLevel11Requirement = 170
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Other
|
# Other
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
<html><body>What would you like to do?<br>
|
<html><body>What would you like to do?<br>
|
||||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Clan 9000-02.htm">"I want to create a new clan."</Button>
|
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Clan 9000-02.htm">"I want to create a new clan."</Button>
|
||||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Clan 9000-03.htm">"Can I raise my clan level?"</Button>
|
|
||||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Clan 9000-04.htm">"I want to disband my clan."</Button>
|
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Clan 9000-04.htm">"I want to disband my clan."</Button>
|
||||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Clan 9000-05.htm">"I'd like to restore my clan."</Button>
|
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Clan 9000-05.htm">"I'd like to restore my clan."</Button>
|
||||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_learn_clan_skills">"Can you teach me some clan skills?"</Button>
|
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_learn_clan_skills">"Can you teach me some clan skills?"</Button>
|
||||||
|
@ -379,18 +379,6 @@ public final class Config
|
|||||||
public static int REPUTATION_SCORE_PER_KILL;
|
public static int REPUTATION_SCORE_PER_KILL;
|
||||||
public static int JOIN_ACADEMY_MIN_REP_SCORE;
|
public static int JOIN_ACADEMY_MIN_REP_SCORE;
|
||||||
public static int JOIN_ACADEMY_MAX_REP_SCORE;
|
public static int JOIN_ACADEMY_MAX_REP_SCORE;
|
||||||
public static int CLAN_LEVEL_6_COST;
|
|
||||||
public static int CLAN_LEVEL_7_COST;
|
|
||||||
public static int CLAN_LEVEL_8_COST;
|
|
||||||
public static int CLAN_LEVEL_9_COST;
|
|
||||||
public static int CLAN_LEVEL_10_COST;
|
|
||||||
public static int CLAN_LEVEL_11_COST;
|
|
||||||
public static int CLAN_LEVEL_6_REQUIREMENT;
|
|
||||||
public static int CLAN_LEVEL_7_REQUIREMENT;
|
|
||||||
public static int CLAN_LEVEL_8_REQUIREMENT;
|
|
||||||
public static int CLAN_LEVEL_9_REQUIREMENT;
|
|
||||||
public static int CLAN_LEVEL_10_REQUIREMENT;
|
|
||||||
public static int CLAN_LEVEL_11_REQUIREMENT;
|
|
||||||
public static boolean ALLOW_WYVERN_ALWAYS;
|
public static boolean ALLOW_WYVERN_ALWAYS;
|
||||||
public static boolean ALLOW_WYVERN_DURING_SIEGE;
|
public static boolean ALLOW_WYVERN_DURING_SIEGE;
|
||||||
public static boolean ALLOW_MOUNTS_DURING_SIEGE;
|
public static boolean ALLOW_MOUNTS_DURING_SIEGE;
|
||||||
@ -1389,18 +1377,6 @@ public final class Config
|
|||||||
REPUTATION_SCORE_PER_KILL = Feature.getInt("ReputationScorePerKill", 1);
|
REPUTATION_SCORE_PER_KILL = Feature.getInt("ReputationScorePerKill", 1);
|
||||||
JOIN_ACADEMY_MIN_REP_SCORE = Feature.getInt("CompleteAcademyMinPoints", 190);
|
JOIN_ACADEMY_MIN_REP_SCORE = Feature.getInt("CompleteAcademyMinPoints", 190);
|
||||||
JOIN_ACADEMY_MAX_REP_SCORE = Feature.getInt("CompleteAcademyMaxPoints", 650);
|
JOIN_ACADEMY_MAX_REP_SCORE = Feature.getInt("CompleteAcademyMaxPoints", 650);
|
||||||
CLAN_LEVEL_6_COST = Feature.getInt("ClanLevel6Cost", 5000);
|
|
||||||
CLAN_LEVEL_7_COST = Feature.getInt("ClanLevel7Cost", 10000);
|
|
||||||
CLAN_LEVEL_8_COST = Feature.getInt("ClanLevel8Cost", 20000);
|
|
||||||
CLAN_LEVEL_9_COST = Feature.getInt("ClanLevel9Cost", 40000);
|
|
||||||
CLAN_LEVEL_10_COST = Feature.getInt("ClanLevel10Cost", 40000);
|
|
||||||
CLAN_LEVEL_11_COST = Feature.getInt("ClanLevel11Cost", 75000);
|
|
||||||
CLAN_LEVEL_6_REQUIREMENT = Feature.getInt("ClanLevel6Requirement", 30);
|
|
||||||
CLAN_LEVEL_7_REQUIREMENT = Feature.getInt("ClanLevel7Requirement", 50);
|
|
||||||
CLAN_LEVEL_8_REQUIREMENT = Feature.getInt("ClanLevel8Requirement", 80);
|
|
||||||
CLAN_LEVEL_9_REQUIREMENT = Feature.getInt("ClanLevel9Requirement", 120);
|
|
||||||
CLAN_LEVEL_10_REQUIREMENT = Feature.getInt("ClanLevel10Requirement", 140);
|
|
||||||
CLAN_LEVEL_11_REQUIREMENT = Feature.getInt("ClanLevel11Requirement", 170);
|
|
||||||
ALLOW_WYVERN_ALWAYS = Feature.getBoolean("AllowRideWyvernAlways", false);
|
ALLOW_WYVERN_ALWAYS = Feature.getBoolean("AllowRideWyvernAlways", false);
|
||||||
ALLOW_WYVERN_DURING_SIEGE = Feature.getBoolean("AllowRideWyvernDuringSiege", true);
|
ALLOW_WYVERN_DURING_SIEGE = Feature.getBoolean("AllowRideWyvernDuringSiege", true);
|
||||||
ALLOW_MOUNTS_DURING_SIEGE = Feature.getBoolean("AllowRideMountsDuringSiege", false);
|
ALLOW_MOUNTS_DURING_SIEGE = Feature.getBoolean("AllowRideMountsDuringSiege", false);
|
||||||
|
@ -0,0 +1,49 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* 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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package com.l2jmobius.gameserver.data.xml.impl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Mobius
|
||||||
|
*/
|
||||||
|
public class ClanLevelTable
|
||||||
|
{
|
||||||
|
// TODO: Move to XML.
|
||||||
|
private final static int[] CLAN_LEVEL_REQUIREMENTS =
|
||||||
|
{
|
||||||
|
35000,
|
||||||
|
80000, // Level 2 requirement.
|
||||||
|
140000,
|
||||||
|
315000,
|
||||||
|
560000,
|
||||||
|
965000,
|
||||||
|
2690000,
|
||||||
|
4050000,
|
||||||
|
5930000,
|
||||||
|
7560000,
|
||||||
|
11830000,
|
||||||
|
19110000,
|
||||||
|
27300000,
|
||||||
|
36400000,
|
||||||
|
46410000,
|
||||||
|
0 // Max level (15).
|
||||||
|
};
|
||||||
|
|
||||||
|
public static int getLevelRequirement(int clanLevel)
|
||||||
|
{
|
||||||
|
return CLAN_LEVEL_REQUIREMENTS[clanLevel];
|
||||||
|
}
|
||||||
|
}
|
@ -40,10 +40,10 @@ import com.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
|
|||||||
import com.l2jmobius.gameserver.data.sql.impl.CharNameTable;
|
import com.l2jmobius.gameserver.data.sql.impl.CharNameTable;
|
||||||
import com.l2jmobius.gameserver.data.sql.impl.ClanTable;
|
import com.l2jmobius.gameserver.data.sql.impl.ClanTable;
|
||||||
import com.l2jmobius.gameserver.data.sql.impl.CrestTable;
|
import com.l2jmobius.gameserver.data.sql.impl.CrestTable;
|
||||||
|
import com.l2jmobius.gameserver.data.xml.impl.ClanLevelTable;
|
||||||
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
|
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
|
||||||
import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData;
|
import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData;
|
||||||
import com.l2jmobius.gameserver.enums.ClanRewardType;
|
import com.l2jmobius.gameserver.enums.ClanRewardType;
|
||||||
import com.l2jmobius.gameserver.enums.UserInfoType;
|
|
||||||
import com.l2jmobius.gameserver.instancemanager.CastleManager;
|
import com.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||||
import com.l2jmobius.gameserver.instancemanager.FortManager;
|
import com.l2jmobius.gameserver.instancemanager.FortManager;
|
||||||
import com.l2jmobius.gameserver.instancemanager.SiegeManager;
|
import com.l2jmobius.gameserver.instancemanager.SiegeManager;
|
||||||
@ -77,6 +77,7 @@ import com.l2jmobius.gameserver.network.serverpackets.PledgeSkillList.SubPledgeS
|
|||||||
import com.l2jmobius.gameserver.network.serverpackets.PledgeSkillListAdd;
|
import com.l2jmobius.gameserver.network.serverpackets.PledgeSkillListAdd;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.UserInfo;
|
import com.l2jmobius.gameserver.network.serverpackets.UserInfo;
|
||||||
|
import com.l2jmobius.gameserver.network.serverpackets.pledgeV2.ExPledgeShowInfoUpdate;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.pledgebonus.ExPledgeBonusMarkReset;
|
import com.l2jmobius.gameserver.network.serverpackets.pledgebonus.ExPledgeBonusMarkReset;
|
||||||
import com.l2jmobius.gameserver.util.EnumIntBitmask;
|
import com.l2jmobius.gameserver.util.EnumIntBitmask;
|
||||||
import com.l2jmobius.gameserver.util.Util;
|
import com.l2jmobius.gameserver.util.Util;
|
||||||
@ -2498,220 +2499,31 @@ public class L2Clan implements IIdentifiable, INamable
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean increaseClanLevel = false;
|
boolean increasedLevel = false;
|
||||||
|
if (_level < 15)
|
||||||
switch (_level)
|
|
||||||
{
|
{
|
||||||
case 0:
|
final int requiredReputation = ClanLevelTable.getLevelRequirement(_level);
|
||||||
|
if (requiredReputation <= _reputationScore)
|
||||||
{
|
{
|
||||||
// Upgrade to 1
|
setReputationScore(_reputationScore - requiredReputation, true);
|
||||||
if ((player.getSp() >= 20000) && (player.getAdena() >= 650000))
|
final SystemMessage cr = SystemMessage.getSystemMessage(SystemMessageId.S1_POINT_S_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION);
|
||||||
{
|
cr.addInt(requiredReputation);
|
||||||
if (player.reduceAdena("ClanLvl", 650000, player.getTarget(), true))
|
player.sendPacket(cr);
|
||||||
{
|
|
||||||
player.setSp(player.getSp() - 20000);
|
changeLevel(_level + 1);
|
||||||
final SystemMessage sp = SystemMessage.getSystemMessage(SystemMessageId.YOUR_SP_HAS_DECREASED_BY_S1);
|
player.sendPacket(new ExPledgeShowInfoUpdate(player));
|
||||||
sp.addInt(20000);
|
increasedLevel = true;
|
||||||
player.sendPacket(sp);
|
|
||||||
increaseClanLevel = true;
|
// Notify to scripts
|
||||||
}
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerClanLvlUp(player, this));
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 1:
|
|
||||||
{
|
|
||||||
// Upgrade to 2
|
|
||||||
if ((player.getSp() >= 100000) && (player.getAdena() >= 2500000))
|
|
||||||
{
|
|
||||||
if (player.reduceAdena("ClanLvl", 2500000, player.getTarget(), true))
|
|
||||||
{
|
|
||||||
player.setSp(player.getSp() - 100000);
|
|
||||||
final SystemMessage sp = SystemMessage.getSystemMessage(SystemMessageId.YOUR_SP_HAS_DECREASED_BY_S1);
|
|
||||||
sp.addInt(100000);
|
|
||||||
player.sendPacket(sp);
|
|
||||||
increaseClanLevel = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 2:
|
|
||||||
{
|
|
||||||
// Upgrade to 3
|
|
||||||
if ((player.getSp() >= 350000) && (player.getInventory().getItemByItemId(1419) != null))
|
|
||||||
{
|
|
||||||
// TODO unhardcode these item IDs
|
|
||||||
// itemId 1419 == Blood Mark
|
|
||||||
if (player.destroyItemByItemId("ClanLvl", 1419, 1, player.getTarget(), false))
|
|
||||||
{
|
|
||||||
player.setSp(player.getSp() - 350000);
|
|
||||||
final SystemMessage sp = SystemMessage.getSystemMessage(SystemMessageId.YOUR_SP_HAS_DECREASED_BY_S1);
|
|
||||||
sp.addInt(350000);
|
|
||||||
player.sendPacket(sp);
|
|
||||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_DISAPPEARED);
|
|
||||||
sm.addItemName(1419);
|
|
||||||
player.sendPacket(sm);
|
|
||||||
increaseClanLevel = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 3:
|
|
||||||
{
|
|
||||||
// Upgrade to 4
|
|
||||||
if ((player.getSp() >= 1000000) && (player.getInventory().getItemByItemId(3874) != null))
|
|
||||||
{
|
|
||||||
// itemId 3874 == Alliance Manifesto
|
|
||||||
if (player.destroyItemByItemId("ClanLvl", 3874, 1, player.getTarget(), false))
|
|
||||||
{
|
|
||||||
player.setSp(player.getSp() - 1000000);
|
|
||||||
final SystemMessage sp = SystemMessage.getSystemMessage(SystemMessageId.YOUR_SP_HAS_DECREASED_BY_S1);
|
|
||||||
sp.addInt(1000000);
|
|
||||||
player.sendPacket(sp);
|
|
||||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_DISAPPEARED);
|
|
||||||
sm.addItemName(3874);
|
|
||||||
player.sendPacket(sm);
|
|
||||||
increaseClanLevel = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 4:
|
|
||||||
{
|
|
||||||
// Upgrade to 5
|
|
||||||
if ((player.getSp() >= 2500000) && (player.getInventory().getItemByItemId(3870) != null))
|
|
||||||
{
|
|
||||||
// itemId 3870 == Seal of Aspiration
|
|
||||||
if (player.destroyItemByItemId("ClanLvl", 3870, 1, player.getTarget(), false))
|
|
||||||
{
|
|
||||||
player.setSp(player.getSp() - 2500000);
|
|
||||||
final SystemMessage sp = SystemMessage.getSystemMessage(SystemMessageId.YOUR_SP_HAS_DECREASED_BY_S1);
|
|
||||||
sp.addInt(2500000);
|
|
||||||
player.sendPacket(sp);
|
|
||||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_DISAPPEARED);
|
|
||||||
sm.addItemName(3870);
|
|
||||||
player.sendPacket(sm);
|
|
||||||
increaseClanLevel = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 5:
|
|
||||||
{
|
|
||||||
// Upgrade to 6
|
|
||||||
if ((_reputationScore >= Config.CLAN_LEVEL_6_COST) && (_members.size() >= Config.CLAN_LEVEL_6_REQUIREMENT))
|
|
||||||
{
|
|
||||||
setReputationScore(_reputationScore - Config.CLAN_LEVEL_6_COST, true);
|
|
||||||
final SystemMessage cr = SystemMessage.getSystemMessage(SystemMessageId.S1_POINT_S_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION);
|
|
||||||
cr.addInt(Config.CLAN_LEVEL_6_COST);
|
|
||||||
player.sendPacket(cr);
|
|
||||||
increaseClanLevel = true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 6:
|
|
||||||
{
|
|
||||||
// Upgrade to 7
|
|
||||||
if ((_reputationScore >= Config.CLAN_LEVEL_7_COST) && (_members.size() >= Config.CLAN_LEVEL_7_REQUIREMENT))
|
|
||||||
{
|
|
||||||
setReputationScore(_reputationScore - Config.CLAN_LEVEL_7_COST, true);
|
|
||||||
final SystemMessage cr = SystemMessage.getSystemMessage(SystemMessageId.S1_POINT_S_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION);
|
|
||||||
cr.addInt(Config.CLAN_LEVEL_7_COST);
|
|
||||||
player.sendPacket(cr);
|
|
||||||
increaseClanLevel = true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 7:
|
|
||||||
{
|
|
||||||
// Upgrade to 8
|
|
||||||
if ((_reputationScore >= Config.CLAN_LEVEL_8_COST) && (_members.size() >= Config.CLAN_LEVEL_8_REQUIREMENT))
|
|
||||||
{
|
|
||||||
setReputationScore(_reputationScore - Config.CLAN_LEVEL_8_COST, true);
|
|
||||||
final SystemMessage cr = SystemMessage.getSystemMessage(SystemMessageId.S1_POINT_S_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION);
|
|
||||||
cr.addInt(Config.CLAN_LEVEL_8_COST);
|
|
||||||
player.sendPacket(cr);
|
|
||||||
increaseClanLevel = true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 8:
|
|
||||||
{
|
|
||||||
// Upgrade to 9
|
|
||||||
if ((_reputationScore >= Config.CLAN_LEVEL_9_COST) && (player.getInventory().getItemByItemId(9910) != null) && (_members.size() >= Config.CLAN_LEVEL_9_REQUIREMENT))
|
|
||||||
{
|
|
||||||
// itemId 9910 == Blood Oath
|
|
||||||
if (player.destroyItemByItemId("ClanLvl", 9910, 150, player.getTarget(), false))
|
|
||||||
{
|
|
||||||
setReputationScore(_reputationScore - Config.CLAN_LEVEL_9_COST, true);
|
|
||||||
final SystemMessage cr = SystemMessage.getSystemMessage(SystemMessageId.S1_POINT_S_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION);
|
|
||||||
cr.addInt(Config.CLAN_LEVEL_9_COST);
|
|
||||||
player.sendPacket(cr);
|
|
||||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S2_S1_S_DISAPPEARED);
|
|
||||||
sm.addItemName(9910);
|
|
||||||
sm.addLong(150);
|
|
||||||
player.sendPacket(sm);
|
|
||||||
increaseClanLevel = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 9:
|
|
||||||
{
|
|
||||||
// Upgrade to 10
|
|
||||||
if ((_reputationScore >= Config.CLAN_LEVEL_10_COST) && (player.getInventory().getItemByItemId(9911) != null) && (_members.size() >= Config.CLAN_LEVEL_10_REQUIREMENT))
|
|
||||||
{
|
|
||||||
// itemId 9911 == Blood Alliance
|
|
||||||
if (player.destroyItemByItemId("ClanLvl", 9911, 5, player.getTarget(), false))
|
|
||||||
{
|
|
||||||
setReputationScore(_reputationScore - Config.CLAN_LEVEL_10_COST, true);
|
|
||||||
final SystemMessage cr = SystemMessage.getSystemMessage(SystemMessageId.S1_POINT_S_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION);
|
|
||||||
cr.addInt(Config.CLAN_LEVEL_10_COST);
|
|
||||||
player.sendPacket(cr);
|
|
||||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S2_S1_S_DISAPPEARED);
|
|
||||||
sm.addItemName(9911);
|
|
||||||
sm.addLong(5);
|
|
||||||
player.sendPacket(sm);
|
|
||||||
increaseClanLevel = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 10:
|
|
||||||
{
|
|
||||||
// Upgrade to 11
|
|
||||||
if ((_reputationScore >= Config.CLAN_LEVEL_11_COST) && (_members.size() >= Config.CLAN_LEVEL_11_REQUIREMENT))
|
|
||||||
{
|
|
||||||
setReputationScore(_reputationScore - Config.CLAN_LEVEL_11_COST, true);
|
|
||||||
final SystemMessage cr = SystemMessage.getSystemMessage(SystemMessageId.S1_POINT_S_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION);
|
|
||||||
cr.addInt(Config.CLAN_LEVEL_11_COST);
|
|
||||||
player.sendPacket(cr);
|
|
||||||
increaseClanLevel = true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!increasedLevel)
|
||||||
if (!increaseClanLevel)
|
|
||||||
{
|
{
|
||||||
player.sendPacket(SystemMessageId.THE_CONDITIONS_NECESSARY_TO_INCREASE_THE_CLAN_S_LEVEL_HAVE_NOT_BEEN_MET);
|
player.sendPacket(SystemMessageId.THE_CONDITIONS_NECESSARY_TO_INCREASE_THE_CLAN_S_LEVEL_HAVE_NOT_BEEN_MET);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// the player should know that he has less sp now :p
|
|
||||||
final UserInfo ui = new UserInfo(player, false);
|
|
||||||
ui.addComponentType(UserInfoType.CURRENT_HPMPCP_EXP_SP);
|
|
||||||
player.sendPacket(ui);
|
|
||||||
|
|
||||||
player.sendItemList();
|
|
||||||
|
|
||||||
changeLevel(_level + 1);
|
|
||||||
|
|
||||||
// Notify to scripts
|
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerClanLvlUp(player, this));
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,8 +81,10 @@ import com.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMentorLis
|
|||||||
import com.l2jmobius.gameserver.network.clientpackets.monsterbook.RequestMonsterBookClose;
|
import com.l2jmobius.gameserver.network.clientpackets.monsterbook.RequestMonsterBookClose;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.monsterbook.RequestMonsterBookOpen;
|
import com.l2jmobius.gameserver.network.clientpackets.monsterbook.RequestMonsterBookOpen;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.monsterbook.RequestMonsterBookReward;
|
import com.l2jmobius.gameserver.network.clientpackets.monsterbook.RequestMonsterBookReward;
|
||||||
|
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeAnnounce;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeItemBuy;
|
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeItemBuy;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeItemList;
|
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeItemList;
|
||||||
|
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeLevelUp;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeMasteryInfo;
|
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeMasteryInfo;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeMasteryReset;
|
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeMasteryReset;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeSkillInfo;
|
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeSkillInfo;
|
||||||
@ -422,7 +424,7 @@ public enum ExIncomingPackets implements IIncomingPackets<L2GameClient>
|
|||||||
EX_PLEDGE_CONTRIBUTION_RANK(0x13E, null, ConnectionState.IN_GAME),
|
EX_PLEDGE_CONTRIBUTION_RANK(0x13E, null, ConnectionState.IN_GAME),
|
||||||
EX_PLEDGE_CONTRIBUTION_INFO(0x13F, null, ConnectionState.IN_GAME),
|
EX_PLEDGE_CONTRIBUTION_INFO(0x13F, null, ConnectionState.IN_GAME),
|
||||||
EX_PLEDGE_CONTRIBUTION_REWARD(0x140, null, ConnectionState.IN_GAME),
|
EX_PLEDGE_CONTRIBUTION_REWARD(0x140, null, ConnectionState.IN_GAME),
|
||||||
EX_PLEDGE_LEVEL_UP(0x141, null, ConnectionState.IN_GAME),
|
EX_PLEDGE_LEVEL_UP(0x141, RequestExPledgeLevelUp::new, ConnectionState.IN_GAME),
|
||||||
EX_PLEDGE_MISSION_INFO(0x142, null, ConnectionState.IN_GAME),
|
EX_PLEDGE_MISSION_INFO(0x142, null, ConnectionState.IN_GAME),
|
||||||
EX_PLEDGE_MISSION_REWARD(0x143, null, ConnectionState.IN_GAME),
|
EX_PLEDGE_MISSION_REWARD(0x143, null, ConnectionState.IN_GAME),
|
||||||
EX_PLEDGE_MASTERY_INFO(0x144, RequestExPledgeMasteryInfo::new, ConnectionState.IN_GAME),
|
EX_PLEDGE_MASTERY_INFO(0x144, RequestExPledgeMasteryInfo::new, ConnectionState.IN_GAME),
|
||||||
@ -432,7 +434,7 @@ public enum ExIncomingPackets implements IIncomingPackets<L2GameClient>
|
|||||||
EX_PLEDGE_SKILL_ACTIVATE(0x148, null, ConnectionState.IN_GAME),
|
EX_PLEDGE_SKILL_ACTIVATE(0x148, null, ConnectionState.IN_GAME),
|
||||||
EX_PLEDGE_ITEM_LIST(0x149, RequestExPledgeItemList::new, ConnectionState.IN_GAME),
|
EX_PLEDGE_ITEM_LIST(0x149, RequestExPledgeItemList::new, ConnectionState.IN_GAME),
|
||||||
EX_PLEDGE_ITEM_ACTIVATE(0x14A, null, ConnectionState.IN_GAME),
|
EX_PLEDGE_ITEM_ACTIVATE(0x14A, null, ConnectionState.IN_GAME),
|
||||||
EX_PLEDGE_ANNOUNCE(0x14B, null, ConnectionState.IN_GAME),
|
EX_PLEDGE_ANNOUNCE(0x14B, RequestExPledgeAnnounce::new, ConnectionState.IN_GAME),
|
||||||
EX_PLEDGE_ANNOUNCE_SET(0x14C, null, ConnectionState.IN_GAME),
|
EX_PLEDGE_ANNOUNCE_SET(0x14C, null, ConnectionState.IN_GAME),
|
||||||
EX_CREATE_PLEDGE(0x14D, null, ConnectionState.IN_GAME),
|
EX_CREATE_PLEDGE(0x14D, null, ConnectionState.IN_GAME),
|
||||||
EX_PLEDGE_ITEM_INFO(0x14E, null, ConnectionState.IN_GAME),
|
EX_PLEDGE_ITEM_INFO(0x14E, null, ConnectionState.IN_GAME),
|
||||||
|
@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* 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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package com.l2jmobius.gameserver.network.clientpackets.pledgeV2;
|
||||||
|
|
||||||
|
import com.l2jmobius.commons.network.PacketReader;
|
||||||
|
import com.l2jmobius.gameserver.model.L2Clan;
|
||||||
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
|
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||||
|
import com.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
|
||||||
|
import com.l2jmobius.gameserver.network.serverpackets.pledgeV2.ExPledgeShowInfoUpdate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Mobius
|
||||||
|
*/
|
||||||
|
public class RequestExPledgeAnnounce implements IClientIncomingPacket
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public boolean read(L2GameClient client, PacketReader packet)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run(L2GameClient client)
|
||||||
|
{
|
||||||
|
final L2PcInstance activeChar = client.getActiveChar();
|
||||||
|
if (activeChar == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
final L2Clan clan = activeChar.getClan();
|
||||||
|
if (clan == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
client.sendPacket(new ExPledgeShowInfoUpdate(activeChar));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,52 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* 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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package com.l2jmobius.gameserver.network.clientpackets.pledgeV2;
|
||||||
|
|
||||||
|
import com.l2jmobius.commons.network.PacketReader;
|
||||||
|
import com.l2jmobius.gameserver.model.L2Clan;
|
||||||
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
|
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||||
|
import com.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Mobius
|
||||||
|
*/
|
||||||
|
public class RequestExPledgeLevelUp implements IClientIncomingPacket
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public boolean read(L2GameClient client, PacketReader packet)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run(L2GameClient client)
|
||||||
|
{
|
||||||
|
final L2PcInstance activeChar = client.getActiveChar();
|
||||||
|
if (activeChar == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
final L2Clan clan = activeChar.getClan();
|
||||||
|
if (clan == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
clan.levelUpClan(activeChar);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,54 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* 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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package com.l2jmobius.gameserver.network.serverpackets.pledgeV2;
|
||||||
|
|
||||||
|
import com.l2jmobius.commons.network.PacketWriter;
|
||||||
|
import com.l2jmobius.gameserver.data.xml.impl.ClanLevelTable;
|
||||||
|
import com.l2jmobius.gameserver.model.L2Clan;
|
||||||
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
|
import com.l2jmobius.gameserver.network.OutgoingPackets;
|
||||||
|
import com.l2jmobius.gameserver.network.serverpackets.AbstractItemPacket;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Mobius
|
||||||
|
*/
|
||||||
|
public class ExPledgeShowInfoUpdate extends AbstractItemPacket
|
||||||
|
{
|
||||||
|
final L2PcInstance _player;
|
||||||
|
|
||||||
|
public ExPledgeShowInfoUpdate(L2PcInstance player)
|
||||||
|
{
|
||||||
|
_player = player;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean write(PacketWriter packet)
|
||||||
|
{
|
||||||
|
final L2Clan clan = _player.getClan();
|
||||||
|
if (clan == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
OutgoingPackets.EX_PLEDGE_SHOW_INFO_UPDATE.writeId(packet);
|
||||||
|
packet.writeD(clan.getId()); // Pledge ID
|
||||||
|
packet.writeD(ClanLevelTable.getLevelRequirement(clan.getLevel())); // Next level cost
|
||||||
|
packet.writeD(0); // Max pledge members
|
||||||
|
packet.writeD(0); // Max elite members
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
@ -199,21 +199,6 @@ CreateKnightUnitCost = 10000
|
|||||||
# Reputation score reduced by reinforcing Knight Unit (if clan level is 9 or more).
|
# Reputation score reduced by reinforcing Knight Unit (if clan level is 9 or more).
|
||||||
ReinforceKnightUnitCost = 5000
|
ReinforceKnightUnitCost = 5000
|
||||||
|
|
||||||
# Reputation score reduced by increasing clan level.
|
|
||||||
ClanLevel6Cost = 5000
|
|
||||||
ClanLevel7Cost = 10000
|
|
||||||
ClanLevel8Cost = 20000
|
|
||||||
ClanLevel9Cost = 40000
|
|
||||||
ClanLevel10Cost = 40000
|
|
||||||
ClanLevel11Cost = 75000
|
|
||||||
|
|
||||||
# Number of clan members needed to increase clan level.
|
|
||||||
ClanLevel6Requirement = 30
|
|
||||||
ClanLevel7Requirement = 50
|
|
||||||
ClanLevel8Requirement = 80
|
|
||||||
ClanLevel9Requirement = 120
|
|
||||||
ClanLevel10Requirement = 140
|
|
||||||
ClanLevel11Requirement = 170
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Other
|
# Other
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
<html><body>What would you like to do?<br>
|
<html><body>What would you like to do?<br>
|
||||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Clan 9000-02.htm">"I want to create a new clan."</Button>
|
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Clan 9000-02.htm">"I want to create a new clan."</Button>
|
||||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Clan 9000-03.htm">"Can I raise my clan level?"</Button>
|
|
||||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Clan 9000-04.htm">"I want to disband my clan."</Button>
|
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Clan 9000-04.htm">"I want to disband my clan."</Button>
|
||||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Clan 9000-05.htm">"I'd like to restore my clan."</Button>
|
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Clan 9000-05.htm">"I'd like to restore my clan."</Button>
|
||||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_learn_clan_skills">"Can you teach me some clan skills?"</Button>
|
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_learn_clan_skills">"Can you teach me some clan skills?"</Button>
|
||||||
|
@ -379,18 +379,6 @@ public final class Config
|
|||||||
public static int REPUTATION_SCORE_PER_KILL;
|
public static int REPUTATION_SCORE_PER_KILL;
|
||||||
public static int JOIN_ACADEMY_MIN_REP_SCORE;
|
public static int JOIN_ACADEMY_MIN_REP_SCORE;
|
||||||
public static int JOIN_ACADEMY_MAX_REP_SCORE;
|
public static int JOIN_ACADEMY_MAX_REP_SCORE;
|
||||||
public static int CLAN_LEVEL_6_COST;
|
|
||||||
public static int CLAN_LEVEL_7_COST;
|
|
||||||
public static int CLAN_LEVEL_8_COST;
|
|
||||||
public static int CLAN_LEVEL_9_COST;
|
|
||||||
public static int CLAN_LEVEL_10_COST;
|
|
||||||
public static int CLAN_LEVEL_11_COST;
|
|
||||||
public static int CLAN_LEVEL_6_REQUIREMENT;
|
|
||||||
public static int CLAN_LEVEL_7_REQUIREMENT;
|
|
||||||
public static int CLAN_LEVEL_8_REQUIREMENT;
|
|
||||||
public static int CLAN_LEVEL_9_REQUIREMENT;
|
|
||||||
public static int CLAN_LEVEL_10_REQUIREMENT;
|
|
||||||
public static int CLAN_LEVEL_11_REQUIREMENT;
|
|
||||||
public static boolean ALLOW_WYVERN_ALWAYS;
|
public static boolean ALLOW_WYVERN_ALWAYS;
|
||||||
public static boolean ALLOW_WYVERN_DURING_SIEGE;
|
public static boolean ALLOW_WYVERN_DURING_SIEGE;
|
||||||
public static boolean ALLOW_MOUNTS_DURING_SIEGE;
|
public static boolean ALLOW_MOUNTS_DURING_SIEGE;
|
||||||
@ -1395,18 +1383,6 @@ public final class Config
|
|||||||
REPUTATION_SCORE_PER_KILL = Feature.getInt("ReputationScorePerKill", 1);
|
REPUTATION_SCORE_PER_KILL = Feature.getInt("ReputationScorePerKill", 1);
|
||||||
JOIN_ACADEMY_MIN_REP_SCORE = Feature.getInt("CompleteAcademyMinPoints", 190);
|
JOIN_ACADEMY_MIN_REP_SCORE = Feature.getInt("CompleteAcademyMinPoints", 190);
|
||||||
JOIN_ACADEMY_MAX_REP_SCORE = Feature.getInt("CompleteAcademyMaxPoints", 650);
|
JOIN_ACADEMY_MAX_REP_SCORE = Feature.getInt("CompleteAcademyMaxPoints", 650);
|
||||||
CLAN_LEVEL_6_COST = Feature.getInt("ClanLevel6Cost", 5000);
|
|
||||||
CLAN_LEVEL_7_COST = Feature.getInt("ClanLevel7Cost", 10000);
|
|
||||||
CLAN_LEVEL_8_COST = Feature.getInt("ClanLevel8Cost", 20000);
|
|
||||||
CLAN_LEVEL_9_COST = Feature.getInt("ClanLevel9Cost", 40000);
|
|
||||||
CLAN_LEVEL_10_COST = Feature.getInt("ClanLevel10Cost", 40000);
|
|
||||||
CLAN_LEVEL_11_COST = Feature.getInt("ClanLevel11Cost", 75000);
|
|
||||||
CLAN_LEVEL_6_REQUIREMENT = Feature.getInt("ClanLevel6Requirement", 30);
|
|
||||||
CLAN_LEVEL_7_REQUIREMENT = Feature.getInt("ClanLevel7Requirement", 50);
|
|
||||||
CLAN_LEVEL_8_REQUIREMENT = Feature.getInt("ClanLevel8Requirement", 80);
|
|
||||||
CLAN_LEVEL_9_REQUIREMENT = Feature.getInt("ClanLevel9Requirement", 120);
|
|
||||||
CLAN_LEVEL_10_REQUIREMENT = Feature.getInt("ClanLevel10Requirement", 140);
|
|
||||||
CLAN_LEVEL_11_REQUIREMENT = Feature.getInt("ClanLevel11Requirement", 170);
|
|
||||||
ALLOW_WYVERN_ALWAYS = Feature.getBoolean("AllowRideWyvernAlways", false);
|
ALLOW_WYVERN_ALWAYS = Feature.getBoolean("AllowRideWyvernAlways", false);
|
||||||
ALLOW_WYVERN_DURING_SIEGE = Feature.getBoolean("AllowRideWyvernDuringSiege", true);
|
ALLOW_WYVERN_DURING_SIEGE = Feature.getBoolean("AllowRideWyvernDuringSiege", true);
|
||||||
ALLOW_MOUNTS_DURING_SIEGE = Feature.getBoolean("AllowRideMountsDuringSiege", false);
|
ALLOW_MOUNTS_DURING_SIEGE = Feature.getBoolean("AllowRideMountsDuringSiege", false);
|
||||||
|
@ -0,0 +1,49 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* 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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package com.l2jmobius.gameserver.data.xml.impl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Mobius
|
||||||
|
*/
|
||||||
|
public class ClanLevelTable
|
||||||
|
{
|
||||||
|
// TODO: Move to XML.
|
||||||
|
private final static int[] CLAN_LEVEL_REQUIREMENTS =
|
||||||
|
{
|
||||||
|
35000,
|
||||||
|
80000, // Level 2 requirement.
|
||||||
|
140000,
|
||||||
|
315000,
|
||||||
|
560000,
|
||||||
|
965000,
|
||||||
|
2690000,
|
||||||
|
4050000,
|
||||||
|
5930000,
|
||||||
|
7560000,
|
||||||
|
11830000,
|
||||||
|
19110000,
|
||||||
|
27300000,
|
||||||
|
36400000,
|
||||||
|
46410000,
|
||||||
|
0 // Max level (15).
|
||||||
|
};
|
||||||
|
|
||||||
|
public static int getLevelRequirement(int clanLevel)
|
||||||
|
{
|
||||||
|
return CLAN_LEVEL_REQUIREMENTS[clanLevel];
|
||||||
|
}
|
||||||
|
}
|
@ -40,10 +40,10 @@ import com.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
|
|||||||
import com.l2jmobius.gameserver.data.sql.impl.CharNameTable;
|
import com.l2jmobius.gameserver.data.sql.impl.CharNameTable;
|
||||||
import com.l2jmobius.gameserver.data.sql.impl.ClanTable;
|
import com.l2jmobius.gameserver.data.sql.impl.ClanTable;
|
||||||
import com.l2jmobius.gameserver.data.sql.impl.CrestTable;
|
import com.l2jmobius.gameserver.data.sql.impl.CrestTable;
|
||||||
|
import com.l2jmobius.gameserver.data.xml.impl.ClanLevelTable;
|
||||||
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
|
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
|
||||||
import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData;
|
import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData;
|
||||||
import com.l2jmobius.gameserver.enums.ClanRewardType;
|
import com.l2jmobius.gameserver.enums.ClanRewardType;
|
||||||
import com.l2jmobius.gameserver.enums.UserInfoType;
|
|
||||||
import com.l2jmobius.gameserver.instancemanager.CastleManager;
|
import com.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||||
import com.l2jmobius.gameserver.instancemanager.FortManager;
|
import com.l2jmobius.gameserver.instancemanager.FortManager;
|
||||||
import com.l2jmobius.gameserver.instancemanager.SiegeManager;
|
import com.l2jmobius.gameserver.instancemanager.SiegeManager;
|
||||||
@ -77,6 +77,7 @@ import com.l2jmobius.gameserver.network.serverpackets.PledgeSkillList.SubPledgeS
|
|||||||
import com.l2jmobius.gameserver.network.serverpackets.PledgeSkillListAdd;
|
import com.l2jmobius.gameserver.network.serverpackets.PledgeSkillListAdd;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.UserInfo;
|
import com.l2jmobius.gameserver.network.serverpackets.UserInfo;
|
||||||
|
import com.l2jmobius.gameserver.network.serverpackets.pledgeV2.ExPledgeShowInfoUpdate;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.pledgebonus.ExPledgeBonusMarkReset;
|
import com.l2jmobius.gameserver.network.serverpackets.pledgebonus.ExPledgeBonusMarkReset;
|
||||||
import com.l2jmobius.gameserver.util.EnumIntBitmask;
|
import com.l2jmobius.gameserver.util.EnumIntBitmask;
|
||||||
import com.l2jmobius.gameserver.util.Util;
|
import com.l2jmobius.gameserver.util.Util;
|
||||||
@ -2498,220 +2499,31 @@ public class L2Clan implements IIdentifiable, INamable
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean increaseClanLevel = false;
|
boolean increasedLevel = false;
|
||||||
|
if (_level < 15)
|
||||||
switch (_level)
|
|
||||||
{
|
{
|
||||||
case 0:
|
final int requiredReputation = ClanLevelTable.getLevelRequirement(_level);
|
||||||
|
if (requiredReputation <= _reputationScore)
|
||||||
{
|
{
|
||||||
// Upgrade to 1
|
setReputationScore(_reputationScore - requiredReputation, true);
|
||||||
if ((player.getSp() >= 20000) && (player.getAdena() >= 650000))
|
final SystemMessage cr = SystemMessage.getSystemMessage(SystemMessageId.S1_POINT_S_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION);
|
||||||
{
|
cr.addInt(requiredReputation);
|
||||||
if (player.reduceAdena("ClanLvl", 650000, player.getTarget(), true))
|
player.sendPacket(cr);
|
||||||
{
|
|
||||||
player.setSp(player.getSp() - 20000);
|
changeLevel(_level + 1);
|
||||||
final SystemMessage sp = SystemMessage.getSystemMessage(SystemMessageId.YOUR_SP_HAS_DECREASED_BY_S1);
|
player.sendPacket(new ExPledgeShowInfoUpdate(player));
|
||||||
sp.addInt(20000);
|
increasedLevel = true;
|
||||||
player.sendPacket(sp);
|
|
||||||
increaseClanLevel = true;
|
// Notify to scripts
|
||||||
}
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerClanLvlUp(player, this));
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 1:
|
|
||||||
{
|
|
||||||
// Upgrade to 2
|
|
||||||
if ((player.getSp() >= 100000) && (player.getAdena() >= 2500000))
|
|
||||||
{
|
|
||||||
if (player.reduceAdena("ClanLvl", 2500000, player.getTarget(), true))
|
|
||||||
{
|
|
||||||
player.setSp(player.getSp() - 100000);
|
|
||||||
final SystemMessage sp = SystemMessage.getSystemMessage(SystemMessageId.YOUR_SP_HAS_DECREASED_BY_S1);
|
|
||||||
sp.addInt(100000);
|
|
||||||
player.sendPacket(sp);
|
|
||||||
increaseClanLevel = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 2:
|
|
||||||
{
|
|
||||||
// Upgrade to 3
|
|
||||||
if ((player.getSp() >= 350000) && (player.getInventory().getItemByItemId(1419) != null))
|
|
||||||
{
|
|
||||||
// TODO unhardcode these item IDs
|
|
||||||
// itemId 1419 == Blood Mark
|
|
||||||
if (player.destroyItemByItemId("ClanLvl", 1419, 1, player.getTarget(), false))
|
|
||||||
{
|
|
||||||
player.setSp(player.getSp() - 350000);
|
|
||||||
final SystemMessage sp = SystemMessage.getSystemMessage(SystemMessageId.YOUR_SP_HAS_DECREASED_BY_S1);
|
|
||||||
sp.addInt(350000);
|
|
||||||
player.sendPacket(sp);
|
|
||||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_DISAPPEARED);
|
|
||||||
sm.addItemName(1419);
|
|
||||||
player.sendPacket(sm);
|
|
||||||
increaseClanLevel = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 3:
|
|
||||||
{
|
|
||||||
// Upgrade to 4
|
|
||||||
if ((player.getSp() >= 1000000) && (player.getInventory().getItemByItemId(3874) != null))
|
|
||||||
{
|
|
||||||
// itemId 3874 == Alliance Manifesto
|
|
||||||
if (player.destroyItemByItemId("ClanLvl", 3874, 1, player.getTarget(), false))
|
|
||||||
{
|
|
||||||
player.setSp(player.getSp() - 1000000);
|
|
||||||
final SystemMessage sp = SystemMessage.getSystemMessage(SystemMessageId.YOUR_SP_HAS_DECREASED_BY_S1);
|
|
||||||
sp.addInt(1000000);
|
|
||||||
player.sendPacket(sp);
|
|
||||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_DISAPPEARED);
|
|
||||||
sm.addItemName(3874);
|
|
||||||
player.sendPacket(sm);
|
|
||||||
increaseClanLevel = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 4:
|
|
||||||
{
|
|
||||||
// Upgrade to 5
|
|
||||||
if ((player.getSp() >= 2500000) && (player.getInventory().getItemByItemId(3870) != null))
|
|
||||||
{
|
|
||||||
// itemId 3870 == Seal of Aspiration
|
|
||||||
if (player.destroyItemByItemId("ClanLvl", 3870, 1, player.getTarget(), false))
|
|
||||||
{
|
|
||||||
player.setSp(player.getSp() - 2500000);
|
|
||||||
final SystemMessage sp = SystemMessage.getSystemMessage(SystemMessageId.YOUR_SP_HAS_DECREASED_BY_S1);
|
|
||||||
sp.addInt(2500000);
|
|
||||||
player.sendPacket(sp);
|
|
||||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_DISAPPEARED);
|
|
||||||
sm.addItemName(3870);
|
|
||||||
player.sendPacket(sm);
|
|
||||||
increaseClanLevel = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 5:
|
|
||||||
{
|
|
||||||
// Upgrade to 6
|
|
||||||
if ((_reputationScore >= Config.CLAN_LEVEL_6_COST) && (_members.size() >= Config.CLAN_LEVEL_6_REQUIREMENT))
|
|
||||||
{
|
|
||||||
setReputationScore(_reputationScore - Config.CLAN_LEVEL_6_COST, true);
|
|
||||||
final SystemMessage cr = SystemMessage.getSystemMessage(SystemMessageId.S1_POINT_S_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION);
|
|
||||||
cr.addInt(Config.CLAN_LEVEL_6_COST);
|
|
||||||
player.sendPacket(cr);
|
|
||||||
increaseClanLevel = true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 6:
|
|
||||||
{
|
|
||||||
// Upgrade to 7
|
|
||||||
if ((_reputationScore >= Config.CLAN_LEVEL_7_COST) && (_members.size() >= Config.CLAN_LEVEL_7_REQUIREMENT))
|
|
||||||
{
|
|
||||||
setReputationScore(_reputationScore - Config.CLAN_LEVEL_7_COST, true);
|
|
||||||
final SystemMessage cr = SystemMessage.getSystemMessage(SystemMessageId.S1_POINT_S_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION);
|
|
||||||
cr.addInt(Config.CLAN_LEVEL_7_COST);
|
|
||||||
player.sendPacket(cr);
|
|
||||||
increaseClanLevel = true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 7:
|
|
||||||
{
|
|
||||||
// Upgrade to 8
|
|
||||||
if ((_reputationScore >= Config.CLAN_LEVEL_8_COST) && (_members.size() >= Config.CLAN_LEVEL_8_REQUIREMENT))
|
|
||||||
{
|
|
||||||
setReputationScore(_reputationScore - Config.CLAN_LEVEL_8_COST, true);
|
|
||||||
final SystemMessage cr = SystemMessage.getSystemMessage(SystemMessageId.S1_POINT_S_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION);
|
|
||||||
cr.addInt(Config.CLAN_LEVEL_8_COST);
|
|
||||||
player.sendPacket(cr);
|
|
||||||
increaseClanLevel = true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 8:
|
|
||||||
{
|
|
||||||
// Upgrade to 9
|
|
||||||
if ((_reputationScore >= Config.CLAN_LEVEL_9_COST) && (player.getInventory().getItemByItemId(9910) != null) && (_members.size() >= Config.CLAN_LEVEL_9_REQUIREMENT))
|
|
||||||
{
|
|
||||||
// itemId 9910 == Blood Oath
|
|
||||||
if (player.destroyItemByItemId("ClanLvl", 9910, 150, player.getTarget(), false))
|
|
||||||
{
|
|
||||||
setReputationScore(_reputationScore - Config.CLAN_LEVEL_9_COST, true);
|
|
||||||
final SystemMessage cr = SystemMessage.getSystemMessage(SystemMessageId.S1_POINT_S_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION);
|
|
||||||
cr.addInt(Config.CLAN_LEVEL_9_COST);
|
|
||||||
player.sendPacket(cr);
|
|
||||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S2_S1_S_DISAPPEARED);
|
|
||||||
sm.addItemName(9910);
|
|
||||||
sm.addLong(150);
|
|
||||||
player.sendPacket(sm);
|
|
||||||
increaseClanLevel = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 9:
|
|
||||||
{
|
|
||||||
// Upgrade to 10
|
|
||||||
if ((_reputationScore >= Config.CLAN_LEVEL_10_COST) && (player.getInventory().getItemByItemId(9911) != null) && (_members.size() >= Config.CLAN_LEVEL_10_REQUIREMENT))
|
|
||||||
{
|
|
||||||
// itemId 9911 == Blood Alliance
|
|
||||||
if (player.destroyItemByItemId("ClanLvl", 9911, 5, player.getTarget(), false))
|
|
||||||
{
|
|
||||||
setReputationScore(_reputationScore - Config.CLAN_LEVEL_10_COST, true);
|
|
||||||
final SystemMessage cr = SystemMessage.getSystemMessage(SystemMessageId.S1_POINT_S_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION);
|
|
||||||
cr.addInt(Config.CLAN_LEVEL_10_COST);
|
|
||||||
player.sendPacket(cr);
|
|
||||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S2_S1_S_DISAPPEARED);
|
|
||||||
sm.addItemName(9911);
|
|
||||||
sm.addLong(5);
|
|
||||||
player.sendPacket(sm);
|
|
||||||
increaseClanLevel = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 10:
|
|
||||||
{
|
|
||||||
// Upgrade to 11
|
|
||||||
if ((_reputationScore >= Config.CLAN_LEVEL_11_COST) && (_members.size() >= Config.CLAN_LEVEL_11_REQUIREMENT))
|
|
||||||
{
|
|
||||||
setReputationScore(_reputationScore - Config.CLAN_LEVEL_11_COST, true);
|
|
||||||
final SystemMessage cr = SystemMessage.getSystemMessage(SystemMessageId.S1_POINT_S_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION);
|
|
||||||
cr.addInt(Config.CLAN_LEVEL_11_COST);
|
|
||||||
player.sendPacket(cr);
|
|
||||||
increaseClanLevel = true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!increasedLevel)
|
||||||
if (!increaseClanLevel)
|
|
||||||
{
|
{
|
||||||
player.sendPacket(SystemMessageId.THE_CONDITIONS_NECESSARY_TO_INCREASE_THE_CLAN_S_LEVEL_HAVE_NOT_BEEN_MET);
|
player.sendPacket(SystemMessageId.THE_CONDITIONS_NECESSARY_TO_INCREASE_THE_CLAN_S_LEVEL_HAVE_NOT_BEEN_MET);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// the player should know that he has less sp now :p
|
|
||||||
final UserInfo ui = new UserInfo(player, false);
|
|
||||||
ui.addComponentType(UserInfoType.CURRENT_HPMPCP_EXP_SP);
|
|
||||||
player.sendPacket(ui);
|
|
||||||
|
|
||||||
player.sendItemList();
|
|
||||||
|
|
||||||
changeLevel(_level + 1);
|
|
||||||
|
|
||||||
// Notify to scripts
|
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerClanLvlUp(player, this));
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,8 +81,10 @@ import com.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMentorLis
|
|||||||
import com.l2jmobius.gameserver.network.clientpackets.monsterbook.RequestMonsterBookClose;
|
import com.l2jmobius.gameserver.network.clientpackets.monsterbook.RequestMonsterBookClose;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.monsterbook.RequestMonsterBookOpen;
|
import com.l2jmobius.gameserver.network.clientpackets.monsterbook.RequestMonsterBookOpen;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.monsterbook.RequestMonsterBookReward;
|
import com.l2jmobius.gameserver.network.clientpackets.monsterbook.RequestMonsterBookReward;
|
||||||
|
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeAnnounce;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeItemBuy;
|
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeItemBuy;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeItemList;
|
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeItemList;
|
||||||
|
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeLevelUp;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeMasteryInfo;
|
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeMasteryInfo;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeMasteryReset;
|
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeMasteryReset;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeSkillInfo;
|
import com.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeSkillInfo;
|
||||||
@ -422,7 +424,7 @@ public enum ExIncomingPackets implements IIncomingPackets<L2GameClient>
|
|||||||
EX_PLEDGE_CONTRIBUTION_RANK(0x13E, null, ConnectionState.IN_GAME),
|
EX_PLEDGE_CONTRIBUTION_RANK(0x13E, null, ConnectionState.IN_GAME),
|
||||||
EX_PLEDGE_CONTRIBUTION_INFO(0x13F, null, ConnectionState.IN_GAME),
|
EX_PLEDGE_CONTRIBUTION_INFO(0x13F, null, ConnectionState.IN_GAME),
|
||||||
EX_PLEDGE_CONTRIBUTION_REWARD(0x140, null, ConnectionState.IN_GAME),
|
EX_PLEDGE_CONTRIBUTION_REWARD(0x140, null, ConnectionState.IN_GAME),
|
||||||
EX_PLEDGE_LEVEL_UP(0x141, null, ConnectionState.IN_GAME),
|
EX_PLEDGE_LEVEL_UP(0x141, RequestExPledgeLevelUp::new, ConnectionState.IN_GAME),
|
||||||
EX_PLEDGE_MISSION_INFO(0x142, null, ConnectionState.IN_GAME),
|
EX_PLEDGE_MISSION_INFO(0x142, null, ConnectionState.IN_GAME),
|
||||||
EX_PLEDGE_MISSION_REWARD(0x143, null, ConnectionState.IN_GAME),
|
EX_PLEDGE_MISSION_REWARD(0x143, null, ConnectionState.IN_GAME),
|
||||||
EX_PLEDGE_MASTERY_INFO(0x144, RequestExPledgeMasteryInfo::new, ConnectionState.IN_GAME),
|
EX_PLEDGE_MASTERY_INFO(0x144, RequestExPledgeMasteryInfo::new, ConnectionState.IN_GAME),
|
||||||
@ -432,7 +434,7 @@ public enum ExIncomingPackets implements IIncomingPackets<L2GameClient>
|
|||||||
EX_PLEDGE_SKILL_ACTIVATE(0x148, null, ConnectionState.IN_GAME),
|
EX_PLEDGE_SKILL_ACTIVATE(0x148, null, ConnectionState.IN_GAME),
|
||||||
EX_PLEDGE_ITEM_LIST(0x149, RequestExPledgeItemList::new, ConnectionState.IN_GAME),
|
EX_PLEDGE_ITEM_LIST(0x149, RequestExPledgeItemList::new, ConnectionState.IN_GAME),
|
||||||
EX_PLEDGE_ITEM_ACTIVATE(0x14A, null, ConnectionState.IN_GAME),
|
EX_PLEDGE_ITEM_ACTIVATE(0x14A, null, ConnectionState.IN_GAME),
|
||||||
EX_PLEDGE_ANNOUNCE(0x14B, null, ConnectionState.IN_GAME),
|
EX_PLEDGE_ANNOUNCE(0x14B, RequestExPledgeAnnounce::new, ConnectionState.IN_GAME),
|
||||||
EX_PLEDGE_ANNOUNCE_SET(0x14C, null, ConnectionState.IN_GAME),
|
EX_PLEDGE_ANNOUNCE_SET(0x14C, null, ConnectionState.IN_GAME),
|
||||||
EX_CREATE_PLEDGE(0x14D, null, ConnectionState.IN_GAME),
|
EX_CREATE_PLEDGE(0x14D, null, ConnectionState.IN_GAME),
|
||||||
EX_PLEDGE_ITEM_INFO(0x14E, null, ConnectionState.IN_GAME),
|
EX_PLEDGE_ITEM_INFO(0x14E, null, ConnectionState.IN_GAME),
|
||||||
|
@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* 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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package com.l2jmobius.gameserver.network.clientpackets.pledgeV2;
|
||||||
|
|
||||||
|
import com.l2jmobius.commons.network.PacketReader;
|
||||||
|
import com.l2jmobius.gameserver.model.L2Clan;
|
||||||
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
|
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||||
|
import com.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
|
||||||
|
import com.l2jmobius.gameserver.network.serverpackets.pledgeV2.ExPledgeShowInfoUpdate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Mobius
|
||||||
|
*/
|
||||||
|
public class RequestExPledgeAnnounce implements IClientIncomingPacket
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public boolean read(L2GameClient client, PacketReader packet)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run(L2GameClient client)
|
||||||
|
{
|
||||||
|
final L2PcInstance activeChar = client.getActiveChar();
|
||||||
|
if (activeChar == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
final L2Clan clan = activeChar.getClan();
|
||||||
|
if (clan == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
client.sendPacket(new ExPledgeShowInfoUpdate(activeChar));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,52 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* 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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package com.l2jmobius.gameserver.network.clientpackets.pledgeV2;
|
||||||
|
|
||||||
|
import com.l2jmobius.commons.network.PacketReader;
|
||||||
|
import com.l2jmobius.gameserver.model.L2Clan;
|
||||||
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
|
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||||
|
import com.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Mobius
|
||||||
|
*/
|
||||||
|
public class RequestExPledgeLevelUp implements IClientIncomingPacket
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public boolean read(L2GameClient client, PacketReader packet)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run(L2GameClient client)
|
||||||
|
{
|
||||||
|
final L2PcInstance activeChar = client.getActiveChar();
|
||||||
|
if (activeChar == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
final L2Clan clan = activeChar.getClan();
|
||||||
|
if (clan == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
clan.levelUpClan(activeChar);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,54 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* 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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package com.l2jmobius.gameserver.network.serverpackets.pledgeV2;
|
||||||
|
|
||||||
|
import com.l2jmobius.commons.network.PacketWriter;
|
||||||
|
import com.l2jmobius.gameserver.data.xml.impl.ClanLevelTable;
|
||||||
|
import com.l2jmobius.gameserver.model.L2Clan;
|
||||||
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
|
import com.l2jmobius.gameserver.network.OutgoingPackets;
|
||||||
|
import com.l2jmobius.gameserver.network.serverpackets.AbstractItemPacket;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Mobius
|
||||||
|
*/
|
||||||
|
public class ExPledgeShowInfoUpdate extends AbstractItemPacket
|
||||||
|
{
|
||||||
|
final L2PcInstance _player;
|
||||||
|
|
||||||
|
public ExPledgeShowInfoUpdate(L2PcInstance player)
|
||||||
|
{
|
||||||
|
_player = player;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean write(PacketWriter packet)
|
||||||
|
{
|
||||||
|
final L2Clan clan = _player.getClan();
|
||||||
|
if (clan == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
OutgoingPackets.EX_PLEDGE_SHOW_INFO_UPDATE.writeId(packet);
|
||||||
|
packet.writeD(clan.getId()); // Pledge ID
|
||||||
|
packet.writeD(ClanLevelTable.getLevelRequirement(clan.getLevel())); // Next level cost
|
||||||
|
packet.writeD(0); // Max pledge members
|
||||||
|
packet.writeD(0); // Max elite members
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user