Unhardcoded Flip Block skills.
This commit is contained in:
@@ -88,6 +88,7 @@ public class EffectMasterHandler
|
||||
Fear.class,
|
||||
Fishing.class,
|
||||
Flag.class,
|
||||
FlipBlock.class,
|
||||
FocusEnergy.class,
|
||||
FocusMaxEnergy.class,
|
||||
FocusSouls.class,
|
||||
|
79
L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/handlers/effecthandlers/FlipBlock.java
vendored
Normal file
79
L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/handlers/effecthandlers/FlipBlock.java
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* 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 org.l2jmobius.gameserver.instancemanager.HandysBlockCheckerManager;
|
||||
import org.l2jmobius.gameserver.model.ArenaParticipantsHolder;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.Block;
|
||||
import org.l2jmobius.gameserver.model.conditions.Condition;
|
||||
import org.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import org.l2jmobius.gameserver.model.skill.BuffInfo;
|
||||
|
||||
/**
|
||||
* Flip Block effect implementation.
|
||||
* @author Mobius
|
||||
*/
|
||||
public class FlipBlock extends AbstractEffect
|
||||
{
|
||||
public FlipBlock(Condition attachCond, Condition applyCond, StatSet set, StatSet params)
|
||||
{
|
||||
super(attachCond, applyCond, set, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInstant()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
final Creature effector = info.getEffector();
|
||||
final Creature effected = info.getEffected();
|
||||
final Block block = effected instanceof Block ? (Block) effected : null;
|
||||
final Player player = effector.isPlayer() ? (Player) 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -753,25 +753,31 @@
|
||||
</skill>
|
||||
<skill id="5852" levels="1" name="Flip Block">
|
||||
<!-- Flips blocks. -->
|
||||
<set name="icon" val="icon.skill_transform_s_attack" />
|
||||
<set name="castRange" val="40" />
|
||||
<set name="effectRange" val="400" />
|
||||
<set name="hitTime" val="1000" />
|
||||
<set name="icon" val="icon.skill_transform_s_attack" />
|
||||
<set name="magicLevel" val="80" />
|
||||
<set name="operateType" val="A1" />
|
||||
<set name="reuseDelay" val="2000" />
|
||||
<set name="targetType" val="ONE" />
|
||||
<for>
|
||||
<effect name="FlipBlock" />
|
||||
</for>
|
||||
</skill>
|
||||
<skill id="5853" levels="1" name="Flip Block">
|
||||
<!-- Flips blocks. -->
|
||||
<set name="icon" val="icon.skill_transform_s_attack" />
|
||||
<set name="castRange" val="40" />
|
||||
<set name="effectRange" val="400" />
|
||||
<set name="hitTime" val="1000" />
|
||||
<set name="icon" val="icon.skill_transform_s_attack" />
|
||||
<set name="magicLevel" val="80" />
|
||||
<set name="operateType" val="A1" />
|
||||
<set name="reuseDelay" val="2000" />
|
||||
<set name="targetType" val="ONE" />
|
||||
<for>
|
||||
<effect name="FlipBlock" />
|
||||
</for>
|
||||
</skill>
|
||||
<skill id="5854" levels="1" name="Decrease Speed">
|
||||
<!-- Speed is decreased. -->
|
||||
|
@@ -38,15 +38,12 @@ import org.l2jmobius.gameserver.enums.SkillFinishType;
|
||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import org.l2jmobius.gameserver.handler.ITargetTypeHandler;
|
||||
import org.l2jmobius.gameserver.handler.TargetHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.HandysBlockCheckerManager;
|
||||
import org.l2jmobius.gameserver.model.ArenaParticipantsHolder;
|
||||
import org.l2jmobius.gameserver.model.ExtractableProductItem;
|
||||
import org.l2jmobius.gameserver.model.ExtractableSkill;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.Block;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.Cubic;
|
||||
import org.l2jmobius.gameserver.model.conditions.Condition;
|
||||
import org.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
@@ -1386,51 +1383,13 @@ public class Skill implements IIdentifiable
|
||||
* @param targets the targets
|
||||
*/
|
||||
private void activateSkill(Creature caster, Cubic cubic, WorldObject... targets)
|
||||
{
|
||||
switch (_id)
|
||||
{
|
||||
// TODO: replace with AI
|
||||
case 5852:
|
||||
case 5853:
|
||||
{
|
||||
final Block block = targets[0] instanceof Block ? (Block) targets[0] : null;
|
||||
final Player player = caster.isPlayer() ? (Player) 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 (WorldObject obj : targets)
|
||||
{
|
||||
final Creature target = (Creature) obj;
|
||||
if (Formulas.calcBuffDebuffReflection(target, this))
|
||||
{
|
||||
// if skill is reflected instant effects should be casted on target
|
||||
// and continuous effects on caster
|
||||
// If skill is reflected instant effects should be casted on target and continuous effects on caster.
|
||||
applyEffects(target, caster, false, 0);
|
||||
|
||||
final BuffInfo info = new BuffInfo(caster, target, this);
|
||||
@@ -1445,9 +1404,6 @@ public class Skill implements IIdentifiable
|
||||
applyEffects(caster, target);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Self Effect
|
||||
if (hasEffects(EffectScope.SELF))
|
||||
|
@@ -88,6 +88,7 @@ public class EffectMasterHandler
|
||||
Fear.class,
|
||||
Fishing.class,
|
||||
Flag.class,
|
||||
FlipBlock.class,
|
||||
FocusEnergy.class,
|
||||
FocusMaxEnergy.class,
|
||||
FocusSouls.class,
|
||||
|
79
L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/FlipBlock.java
vendored
Normal file
79
L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/FlipBlock.java
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* 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 org.l2jmobius.gameserver.instancemanager.HandysBlockCheckerManager;
|
||||
import org.l2jmobius.gameserver.model.ArenaParticipantsHolder;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.Block;
|
||||
import org.l2jmobius.gameserver.model.conditions.Condition;
|
||||
import org.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import org.l2jmobius.gameserver.model.skill.BuffInfo;
|
||||
|
||||
/**
|
||||
* Flip Block effect implementation.
|
||||
* @author Mobius
|
||||
*/
|
||||
public class FlipBlock extends AbstractEffect
|
||||
{
|
||||
public FlipBlock(Condition attachCond, Condition applyCond, StatSet set, StatSet params)
|
||||
{
|
||||
super(attachCond, applyCond, set, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInstant()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
final Creature effector = info.getEffector();
|
||||
final Creature effected = info.getEffected();
|
||||
final Block block = effected instanceof Block ? (Block) effected : null;
|
||||
final Player player = effector.isPlayer() ? (Player) 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -753,25 +753,31 @@
|
||||
</skill>
|
||||
<skill id="5852" levels="1" name="Flip Block">
|
||||
<!-- Flips blocks. -->
|
||||
<set name="icon" val="icon.skill_transform_s_attack" />
|
||||
<set name="castRange" val="40" />
|
||||
<set name="effectRange" val="400" />
|
||||
<set name="hitTime" val="1000" />
|
||||
<set name="icon" val="icon.skill_transform_s_attack" />
|
||||
<set name="magicLevel" val="80" />
|
||||
<set name="operateType" val="A1" />
|
||||
<set name="reuseDelay" val="2000" />
|
||||
<set name="targetType" val="ONE" />
|
||||
<for>
|
||||
<effect name="FlipBlock" />
|
||||
</for>
|
||||
</skill>
|
||||
<skill id="5853" levels="1" name="Flip Block">
|
||||
<!-- Flips blocks. -->
|
||||
<set name="icon" val="icon.skill_transform_s_attack" />
|
||||
<set name="castRange" val="40" />
|
||||
<set name="effectRange" val="400" />
|
||||
<set name="hitTime" val="1000" />
|
||||
<set name="icon" val="icon.skill_transform_s_attack" />
|
||||
<set name="magicLevel" val="80" />
|
||||
<set name="operateType" val="A1" />
|
||||
<set name="reuseDelay" val="2000" />
|
||||
<set name="targetType" val="ONE" />
|
||||
<for>
|
||||
<effect name="FlipBlock" />
|
||||
</for>
|
||||
</skill>
|
||||
<skill id="5854" levels="1" name="Decrease Speed">
|
||||
<!-- Speed is decreased. -->
|
||||
|
@@ -553,6 +553,7 @@
|
||||
<xs:enumeration value="Fear" />
|
||||
<xs:enumeration value="Fishing" />
|
||||
<xs:enumeration value="Flag" />
|
||||
<xs:enumeration value="FlipBlock" />
|
||||
<xs:enumeration value="FocusEnergy" />
|
||||
<xs:enumeration value="FocusMaxEnergy" />
|
||||
<xs:enumeration value="FocusSouls" />
|
||||
|
@@ -38,15 +38,12 @@ import org.l2jmobius.gameserver.enums.SkillFinishType;
|
||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import org.l2jmobius.gameserver.handler.ITargetTypeHandler;
|
||||
import org.l2jmobius.gameserver.handler.TargetHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.HandysBlockCheckerManager;
|
||||
import org.l2jmobius.gameserver.model.ArenaParticipantsHolder;
|
||||
import org.l2jmobius.gameserver.model.ExtractableProductItem;
|
||||
import org.l2jmobius.gameserver.model.ExtractableSkill;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.Block;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.Cubic;
|
||||
import org.l2jmobius.gameserver.model.conditions.Condition;
|
||||
import org.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
@@ -1406,51 +1403,13 @@ public class Skill implements IIdentifiable
|
||||
* @param targets the targets
|
||||
*/
|
||||
private void activateSkill(Creature caster, Cubic cubic, WorldObject... targets)
|
||||
{
|
||||
switch (_id)
|
||||
{
|
||||
// TODO: replace with AI
|
||||
case 5852:
|
||||
case 5853:
|
||||
{
|
||||
final Block block = targets[0] instanceof Block ? (Block) targets[0] : null;
|
||||
final Player player = caster.isPlayer() ? (Player) 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 (WorldObject obj : targets)
|
||||
{
|
||||
final Creature target = (Creature) obj;
|
||||
if (Formulas.calcBuffDebuffReflection(target, this))
|
||||
{
|
||||
// if skill is reflected instant effects should be casted on target
|
||||
// and continuous effects on caster
|
||||
// If skill is reflected instant effects should be casted on target and continuous effects on caster.
|
||||
applyEffects(target, caster, false, 0);
|
||||
|
||||
final BuffInfo info = new BuffInfo(caster, target, this);
|
||||
@@ -1465,9 +1424,6 @@ public class Skill implements IIdentifiable
|
||||
applyEffects(caster, target);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Self Effect
|
||||
if (hasEffects(EffectScope.SELF))
|
||||
|
Reference in New Issue
Block a user