Handy's Block Checker Event related improvements.
This commit is contained in:
@@ -130,6 +130,7 @@ public final class EffectMasterHandler
|
|||||||
EffectHandler.getInstance().registerHandler("Fear", Fear::new);
|
EffectHandler.getInstance().registerHandler("Fear", Fear::new);
|
||||||
EffectHandler.getInstance().registerHandler("Feed", Feed::new);
|
EffectHandler.getInstance().registerHandler("Feed", Feed::new);
|
||||||
EffectHandler.getInstance().registerHandler("Flag", Flag::new);
|
EffectHandler.getInstance().registerHandler("Flag", Flag::new);
|
||||||
|
EffectHandler.getInstance().registerHandler("FlipBlock", FlipBlock::new);
|
||||||
EffectHandler.getInstance().registerHandler("FlyMove", FlyMove::new);
|
EffectHandler.getInstance().registerHandler("FlyMove", FlyMove::new);
|
||||||
EffectHandler.getInstance().registerHandler("FocusEnergy", FocusEnergy::new);
|
EffectHandler.getInstance().registerHandler("FocusEnergy", FocusEnergy::new);
|
||||||
EffectHandler.getInstance().registerHandler("FocusMomentum", FocusMomentum::new);
|
EffectHandler.getInstance().registerHandler("FocusMomentum", FocusMomentum::new);
|
||||||
|
76
L2J_Mobius_Underground/dist/game/data/scripts/handlers/effecthandlers/FlipBlock.java
vendored
Normal file
76
L2J_Mobius_Underground/dist/game/data/scripts/handlers/effecthandlers/FlipBlock.java
vendored
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
/*
|
||||||
|
* 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.instancemanager.HandysBlockCheckerManager;
|
||||||
|
import com.l2jmobius.gameserver.model.ArenaParticipantsHolder;
|
||||||
|
import com.l2jmobius.gameserver.model.StatsSet;
|
||||||
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
|
import com.l2jmobius.gameserver.model.actor.instance.L2BlockInstance;
|
||||||
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
|
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||||
|
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||||
|
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Flip Block effect implementation.
|
||||||
|
* @author Mobius
|
||||||
|
*/
|
||||||
|
public final class FlipBlock extends AbstractEffect
|
||||||
|
{
|
||||||
|
public FlipBlock(StatsSet params)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isInstant()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void instant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
|
||||||
|
{
|
||||||
|
final L2BlockInstance block = effected instanceof L2BlockInstance ? (L2BlockInstance) effected : null;
|
||||||
|
final L2PcInstance player = effector.isPlayer() ? (L2PcInstance) effector : null;
|
||||||
|
if ((block == null) || (player == null))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final int arena = player.getBlockCheckerArena();
|
||||||
|
if (arena != -1)
|
||||||
|
{
|
||||||
|
final ArenaParticipantsHolder holder = HandysBlockCheckerManager.getInstance().getHolder(arena);
|
||||||
|
if (holder == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final int team = holder.getPlayerTeam(player);
|
||||||
|
final int color = block.getColorEffect();
|
||||||
|
if ((team == 0) && (color == 0x00))
|
||||||
|
{
|
||||||
|
block.changeColor(player, holder, team);
|
||||||
|
}
|
||||||
|
else if ((team == 1) && (color == 0x53))
|
||||||
|
{
|
||||||
|
block.changeColor(player, holder, team);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -1252,6 +1252,7 @@
|
|||||||
<skill id="5852" toLevel="1" name="Flip Block">
|
<skill id="5852" toLevel="1" name="Flip Block">
|
||||||
<!-- CT2.5 retail confirmed -->
|
<!-- CT2.5 retail confirmed -->
|
||||||
<castRange>40</castRange>
|
<castRange>40</castRange>
|
||||||
|
<effectPoint>-1</effectPoint>
|
||||||
<effectRange>400</effectRange>
|
<effectRange>400</effectRange>
|
||||||
<hitTime>1000</hitTime>
|
<hitTime>1000</hitTime>
|
||||||
<icon>icon.skill_transform_s_attack</icon>
|
<icon>icon.skill_transform_s_attack</icon>
|
||||||
@@ -1260,12 +1261,16 @@
|
|||||||
<reuseDelay>2000</reuseDelay>
|
<reuseDelay>2000</reuseDelay>
|
||||||
<rideState>NONE</rideState>
|
<rideState>NONE</rideState>
|
||||||
<magicCriticalRate>-5</magicCriticalRate>
|
<magicCriticalRate>-5</magicCriticalRate>
|
||||||
<targetType>OTHERS</targetType>
|
<targetType>ENEMY</targetType>
|
||||||
<affectScope>SINGLE</affectScope>
|
<affectScope>SINGLE</affectScope>
|
||||||
|
<effects>
|
||||||
|
<effect name="FlipBlock" />
|
||||||
|
</effects>
|
||||||
</skill>
|
</skill>
|
||||||
<skill id="5853" toLevel="1" name="Flip Block">
|
<skill id="5853" toLevel="1" name="Flip Block">
|
||||||
<!-- CT2.5 retail confirmed -->
|
<!-- CT2.5 retail confirmed -->
|
||||||
<castRange>40</castRange>
|
<castRange>40</castRange>
|
||||||
|
<effectPoint>-1</effectPoint>
|
||||||
<effectRange>400</effectRange>
|
<effectRange>400</effectRange>
|
||||||
<hitTime>1000</hitTime>
|
<hitTime>1000</hitTime>
|
||||||
<icon>icon.skill_transform_s_attack</icon>
|
<icon>icon.skill_transform_s_attack</icon>
|
||||||
@@ -1274,8 +1279,11 @@
|
|||||||
<reuseDelay>2000</reuseDelay>
|
<reuseDelay>2000</reuseDelay>
|
||||||
<rideState>NONE</rideState>
|
<rideState>NONE</rideState>
|
||||||
<magicCriticalRate>-5</magicCriticalRate>
|
<magicCriticalRate>-5</magicCriticalRate>
|
||||||
<targetType>OTHERS</targetType>
|
<targetType>ENEMY</targetType>
|
||||||
<affectScope>SINGLE</affectScope>
|
<affectScope>SINGLE</affectScope>
|
||||||
|
<effects>
|
||||||
|
<effect name="FlipBlock" />
|
||||||
|
</effects>
|
||||||
</skill>
|
</skill>
|
||||||
<skill id="5854" toLevel="1" name="Decrease Speed">
|
<skill id="5854" toLevel="1" name="Decrease Speed">
|
||||||
<abnormalLvl>3</abnormalLvl>
|
<abnormalLvl>3</abnormalLvl>
|
||||||
|
@@ -44,6 +44,7 @@ public enum InstanceType
|
|||||||
L2GuardInstance(L2Attackable),
|
L2GuardInstance(L2Attackable),
|
||||||
L2QuestGuardInstance(L2GuardInstance),
|
L2QuestGuardInstance(L2GuardInstance),
|
||||||
L2MonsterInstance(L2Attackable),
|
L2MonsterInstance(L2Attackable),
|
||||||
|
L2BlockInstance(L2Attackable),
|
||||||
L2ChestInstance(L2MonsterInstance),
|
L2ChestInstance(L2MonsterInstance),
|
||||||
L2ControllableMobInstance(L2MonsterInstance),
|
L2ControllableMobInstance(L2MonsterInstance),
|
||||||
L2FeedableBeastInstance(L2MonsterInstance),
|
L2FeedableBeastInstance(L2MonsterInstance),
|
||||||
|
@@ -45,7 +45,7 @@ public enum NpcInfoType implements IUpdateTypeComponent
|
|||||||
ENCHANT(0x10, 4),
|
ENCHANT(0x10, 4),
|
||||||
FLYING(0x11, 4),
|
FLYING(0x11, 4),
|
||||||
CLONE(0x12, 4),
|
CLONE(0x12, 4),
|
||||||
UNKNOWN8(0x13, 4),
|
COLOR_EFFECT(0x13, 4),
|
||||||
DISPLAY_EFFECT(0x16, 4),
|
DISPLAY_EFFECT(0x16, 4),
|
||||||
TRANSFORMATION(0x17, 4),
|
TRANSFORMATION(0x17, 4),
|
||||||
|
|
||||||
|
@@ -42,13 +42,10 @@ import com.l2jmobius.gameserver.handler.AffectScopeHandler;
|
|||||||
import com.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
import com.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
||||||
import com.l2jmobius.gameserver.handler.ITargetTypeHandler;
|
import com.l2jmobius.gameserver.handler.ITargetTypeHandler;
|
||||||
import com.l2jmobius.gameserver.handler.TargetHandler;
|
import com.l2jmobius.gameserver.handler.TargetHandler;
|
||||||
import com.l2jmobius.gameserver.instancemanager.HandysBlockCheckerManager;
|
|
||||||
import com.l2jmobius.gameserver.model.ArenaParticipantsHolder;
|
|
||||||
import com.l2jmobius.gameserver.model.L2Object;
|
import com.l2jmobius.gameserver.model.L2Object;
|
||||||
import com.l2jmobius.gameserver.model.PcCondOverride;
|
import com.l2jmobius.gameserver.model.PcCondOverride;
|
||||||
import com.l2jmobius.gameserver.model.StatsSet;
|
import com.l2jmobius.gameserver.model.StatsSet;
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2BlockInstance;
|
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
import com.l2jmobius.gameserver.model.cubic.CubicInstance;
|
import com.l2jmobius.gameserver.model.cubic.CubicInstance;
|
||||||
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||||
@@ -1403,43 +1400,6 @@ public final class Skill implements IIdentifiable
|
|||||||
* @param targets the targets
|
* @param targets the targets
|
||||||
*/
|
*/
|
||||||
public final void activateSkill(L2Character caster, CubicInstance cubic, L2ItemInstance item, L2Object... targets)
|
public final void activateSkill(L2Character caster, CubicInstance cubic, L2ItemInstance item, L2Object... targets)
|
||||||
{
|
|
||||||
// TODO: replace with AI
|
|
||||||
switch (getId())
|
|
||||||
{
|
|
||||||
case 5852:
|
|
||||||
case 5853:
|
|
||||||
{
|
|
||||||
final L2BlockInstance block = targets[0] instanceof L2BlockInstance ? (L2BlockInstance) targets[0] : null;
|
|
||||||
final L2PcInstance player = caster.isPlayer() ? (L2PcInstance) caster : null;
|
|
||||||
if ((block == null) || (player == null))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
final int arena = player.getBlockCheckerArena();
|
|
||||||
if (arena != -1)
|
|
||||||
{
|
|
||||||
final ArenaParticipantsHolder holder = HandysBlockCheckerManager.getInstance().getHolder(arena);
|
|
||||||
if (holder == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
final int team = holder.getPlayerTeam(player);
|
|
||||||
final int color = block.getColorEffect();
|
|
||||||
if ((team == 0) && (color == 0x00))
|
|
||||||
{
|
|
||||||
block.changeColor(player, holder, team);
|
|
||||||
}
|
|
||||||
else if ((team == 1) && (color == 0x53))
|
|
||||||
{
|
|
||||||
block.changeColor(player, holder, team);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
{
|
{
|
||||||
for (L2Object targetObject : targets)
|
for (L2Object targetObject : targets)
|
||||||
{
|
{
|
||||||
@@ -1468,9 +1428,6 @@ public final class Skill implements IIdentifiable
|
|||||||
applyEffects(caster, target, item);
|
applyEffects(caster, target, item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Self Effect
|
// Self Effect
|
||||||
if (hasEffects(EffectScope.SELF))
|
if (hasEffects(EffectScope.SELF))
|
||||||
|
@@ -158,7 +158,7 @@ public class ExPetInfo extends AbstractMaskPacket<NpcInfoType>
|
|||||||
addComponentType(NpcInfoType.CLAN);
|
addComponentType(NpcInfoType.CLAN);
|
||||||
}
|
}
|
||||||
|
|
||||||
addComponentType(NpcInfoType.UNKNOWN8);
|
addComponentType(NpcInfoType.COLOR_EFFECT);
|
||||||
|
|
||||||
// TODO: Confirm me
|
// TODO: Confirm me
|
||||||
if (summon.isInCombat())
|
if (summon.isInCombat())
|
||||||
@@ -312,7 +312,7 @@ public class ExPetInfo extends AbstractMaskPacket<NpcInfoType>
|
|||||||
{
|
{
|
||||||
packet.writeD(0x00); // Player ObjectId with Decoy
|
packet.writeD(0x00); // Player ObjectId with Decoy
|
||||||
}
|
}
|
||||||
if (containsMask(NpcInfoType.UNKNOWN8))
|
if (containsMask(NpcInfoType.COLOR_EFFECT))
|
||||||
{
|
{
|
||||||
// No visual effect
|
// No visual effect
|
||||||
packet.writeD(0x00); // Unknown
|
packet.writeD(0x00); // Unknown
|
||||||
|
@@ -184,7 +184,7 @@ public class NpcInfo extends AbstractMaskPacket<NpcInfoType>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
addComponentType(NpcInfoType.UNKNOWN8);
|
addComponentType(NpcInfoType.COLOR_EFFECT);
|
||||||
|
|
||||||
if (npc.getPvpFlag() > 0)
|
if (npc.getPvpFlag() > 0)
|
||||||
{
|
{
|
||||||
@@ -345,10 +345,9 @@ public class NpcInfo extends AbstractMaskPacket<NpcInfoType>
|
|||||||
{
|
{
|
||||||
packet.writeD(_npc.getCloneObjId()); // Player ObjectId with Decoy
|
packet.writeD(_npc.getCloneObjId()); // Player ObjectId with Decoy
|
||||||
}
|
}
|
||||||
if (containsMask(NpcInfoType.UNKNOWN8))
|
if (containsMask(NpcInfoType.COLOR_EFFECT))
|
||||||
{
|
{
|
||||||
// No visual effect
|
packet.writeD(_npc.getColorEffect()); // Color effect
|
||||||
packet.writeD(0x00); // Unknown
|
|
||||||
}
|
}
|
||||||
if (containsMask(NpcInfoType.DISPLAY_EFFECT))
|
if (containsMask(NpcInfoType.DISPLAY_EFFECT))
|
||||||
{
|
{
|
||||||
|
@@ -158,7 +158,7 @@ public class SummonInfo extends AbstractMaskPacket<NpcInfoType>
|
|||||||
addComponentType(NpcInfoType.CLAN);
|
addComponentType(NpcInfoType.CLAN);
|
||||||
}
|
}
|
||||||
|
|
||||||
addComponentType(NpcInfoType.UNKNOWN8);
|
addComponentType(NpcInfoType.COLOR_EFFECT);
|
||||||
|
|
||||||
// TODO: Confirm me
|
// TODO: Confirm me
|
||||||
if (summon.isInCombat())
|
if (summon.isInCombat())
|
||||||
@@ -312,7 +312,7 @@ public class SummonInfo extends AbstractMaskPacket<NpcInfoType>
|
|||||||
{
|
{
|
||||||
packet.writeD(0x00); // Player ObjectId with Decoy
|
packet.writeD(0x00); // Player ObjectId with Decoy
|
||||||
}
|
}
|
||||||
if (containsMask(NpcInfoType.UNKNOWN8))
|
if (containsMask(NpcInfoType.COLOR_EFFECT))
|
||||||
{
|
{
|
||||||
// No visual effect
|
// No visual effect
|
||||||
packet.writeD(0x00); // Unknown
|
packet.writeD(0x00); // Unknown
|
||||||
|
Reference in New Issue
Block a user