GiveClanReputation effect handler.

This commit is contained in:
MobiusDev 2017-08-01 22:25:29 +00:00
parent e66e52f76c
commit f14ebfeec6
7 changed files with 205 additions and 1 deletions

View File

@ -138,6 +138,7 @@ public final class EffectMasterHandler
EffectHandler.getInstance().registerHandler("GetAgro", GetAgro::new);
EffectHandler.getInstance().registerHandler("GetDamageLimit", GetDamageLimit::new);
EffectHandler.getInstance().registerHandler("GetMomentum", GetMomentum::new);
EffectHandler.getInstance().registerHandler("GiveClanReputation", GiveClanReputation::new);
EffectHandler.getInstance().registerHandler("GiveRecommendation", GiveRecommendation::new);
EffectHandler.getInstance().registerHandler("GiveSp", GiveSp::new);
EffectHandler.getInstance().registerHandler("GiveXp", GiveXp::new);

View File

@ -0,0 +1,67 @@
/*
* 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 handlers.effecthandlers;
import com.l2jmobius.gameserver.model.L2ClanMember;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
/**
* Give Clan reputation effect implementation.
* @author Mobius
*/
public final class GiveClanReputation extends AbstractEffect
{
private final int _reputation;
public GiveClanReputation(StatsSet params)
{
_reputation = params.getInt("reputation", 0);
}
@Override
public boolean isInstant()
{
return true;
}
@Override
public void instant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
{
if (!effector.isPlayer() || !effected.isPlayer() || effected.isAlikeDead() || (effector.getActingPlayer().getClan() == null))
{
return;
}
effector.getActingPlayer().getClan().addReputationScore(_reputation, true);
for (L2ClanMember member : effector.getActingPlayer().getClan().getMembers())
{
if (member.isOnline())
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOUR_CLAN_HAS_ADDED_S1_POINT_S_TO_ITS_CLAN_REPUTATION);
sm.addInt(_reputation);
member.getPlayerInstance().sendPacket(sm);
}
}
}
}

View File

@ -30,7 +30,6 @@ What is done
-Admin menu teleport and shop cleanups
Custom work
-Start NPC dialogs until Newbie Helper
-Newbie Helper NPC location info
-Newbie Helper buff support until 40 level
@ -45,3 +44,4 @@ TODO list
-Blacksmith NPC updates
-Floran Agricultural Area clan halls
-Test Castle Sieges and Merc stats
-Whisper of Dreams quests

View File

@ -138,6 +138,7 @@ public final class EffectMasterHandler
EffectHandler.getInstance().registerHandler("GetAgro", GetAgro::new);
EffectHandler.getInstance().registerHandler("GetDamageLimit", GetDamageLimit::new);
EffectHandler.getInstance().registerHandler("GetMomentum", GetMomentum::new);
EffectHandler.getInstance().registerHandler("GiveClanReputation", GiveClanReputation::new);
EffectHandler.getInstance().registerHandler("GiveRecommendation", GiveRecommendation::new);
EffectHandler.getInstance().registerHandler("GiveSp", GiveSp::new);
EffectHandler.getInstance().registerHandler("GiveXp", GiveXp::new);

View File

@ -0,0 +1,67 @@
/*
* 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 handlers.effecthandlers;
import com.l2jmobius.gameserver.model.L2ClanMember;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
/**
* Give Clan reputation effect implementation.
* @author Mobius
*/
public final class GiveClanReputation extends AbstractEffect
{
private final int _reputation;
public GiveClanReputation(StatsSet params)
{
_reputation = params.getInt("reputation", 0);
}
@Override
public boolean isInstant()
{
return true;
}
@Override
public void instant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
{
if (!effector.isPlayer() || !effected.isPlayer() || effected.isAlikeDead() || (effector.getActingPlayer().getClan() == null))
{
return;
}
effector.getActingPlayer().getClan().addReputationScore(_reputation, true);
for (L2ClanMember member : effector.getActingPlayer().getClan().getMembers())
{
if (member.isOnline())
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOUR_CLAN_HAS_ADDED_S1_POINT_S_TO_ITS_CLAN_REPUTATION);
sm.addInt(_reputation);
member.getPlayerInstance().sendPacket(sm);
}
}
}
}

View File

@ -138,6 +138,7 @@ public final class EffectMasterHandler
EffectHandler.getInstance().registerHandler("GetAgro", GetAgro::new);
EffectHandler.getInstance().registerHandler("GetDamageLimit", GetDamageLimit::new);
EffectHandler.getInstance().registerHandler("GetMomentum", GetMomentum::new);
EffectHandler.getInstance().registerHandler("GiveClanReputation", GiveClanReputation::new);
EffectHandler.getInstance().registerHandler("GiveRecommendation", GiveRecommendation::new);
EffectHandler.getInstance().registerHandler("GiveSp", GiveSp::new);
EffectHandler.getInstance().registerHandler("GiveXp", GiveXp::new);

View File

@ -0,0 +1,67 @@
/*
* 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 handlers.effecthandlers;
import com.l2jmobius.gameserver.model.L2ClanMember;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
/**
* Give Clan reputation effect implementation.
* @author Mobius
*/
public final class GiveClanReputation extends AbstractEffect
{
private final int _reputation;
public GiveClanReputation(StatsSet params)
{
_reputation = params.getInt("reputation", 0);
}
@Override
public boolean isInstant()
{
return true;
}
@Override
public void instant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
{
if (!effector.isPlayer() || !effected.isPlayer() || effected.isAlikeDead() || (effector.getActingPlayer().getClan() == null))
{
return;
}
effector.getActingPlayer().getClan().addReputationScore(_reputation, true);
for (L2ClanMember member : effector.getActingPlayer().getClan().getMembers())
{
if (member.isOnline())
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOUR_CLAN_HAS_ADDED_S1_POINT_S_TO_ITS_CLAN_REPUTATION);
sm.addInt(_reputation);
member.getPlayerInstance().sendPacket(sm);
}
}
}
}