Skip to content
Snippets Groups Projects
Commit a1e9b04e authored by Zoey76's avatar Zoey76
Browse files

BETA: Actual Datapack part for [L6609].

Reported by: St3eT
parent 0cce4ed6
No related branches found
No related tags found
No related merge requests found
......@@ -6,16 +6,16 @@
<tr><td align=center>Select 5 buffs from below.</td></tr>
<tr><td height=10></td></tr>
<tr><td><center><br>
<a action="bypass -h npc_%objectId%_OlyBuff 4357">Haste Lv2</a><br>
<a action="bypass -h npc_%objectId%_OlyBuff 4342">Wind Walk Lv2</a><br>
<a action="bypass -h npc_%objectId%_OlyBuff 4356">Empower Lv3</a><br>
<a action="bypass -h npc_%objectId%_OlyBuff 4355">Acumen Lv3</a><br>
<a action="bypass -h npc_%objectId%_OlyBuff 4351">Concentration Lv6</a><br>
<a action="bypass -h npc_%objectId%_OlyBuff 4345">Might Lv3</a><br>
<a action="bypass -h npc_%objectId%_OlyBuff 4358">Guidance Lv3</a><br>
<a action="bypass -h npc_%objectId%_OlyBuff 4359">Focus Lv3</a><br>
<a action="bypass -h npc_%objectId%_OlyBuff 4360">Death Whisper Lv3</a><br>
<a action="bypass -h npc_%objectId%_OlyBuff 4352">Berserker Spirit Lv2</a>
<a action="bypass -h npc_%objectId%_OlyBuff 0">Haste Lv2</a><br>
<a action="bypass -h npc_%objectId%_OlyBuff 1">Wind Walk Lv2</a><br>
<a action="bypass -h npc_%objectId%_OlyBuff 2">Empower Lv3</a><br>
<a action="bypass -h npc_%objectId%_OlyBuff 3">Acumen Lv3</a><br>
<a action="bypass -h npc_%objectId%_OlyBuff 4">Concentration Lv6</a><br>
<a action="bypass -h npc_%objectId%_OlyBuff 5">Might Lv3</a><br>
<a action="bypass -h npc_%objectId%_OlyBuff 6">Guidance Lv3</a><br>
<a action="bypass -h npc_%objectId%_OlyBuff 7">Focus Lv3</a><br>
<a action="bypass -h npc_%objectId%_OlyBuff 8">Death Whisper Lv3</a><br>
<a action="bypass -h npc_%objectId%_OlyBuff 9">Berserker Spirit Lv2</a>
</center></td></tr>
<tr><td height=24></td></tr>
</table>
......
......@@ -43,6 +43,7 @@ import com.l2jserver.gameserver.network.serverpackets.InventoryUpdate;
import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse;
import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
import com.l2jserver.gameserver.util.Util;
/**
* @author DS
......@@ -61,6 +62,20 @@ public class OlympiadManagerLink implements IBypassHandler
private static final String MORE_THAN = "More than " + String.valueOf(Config.ALT_OLY_REG_DISPLAY);
private static final int GATE_PASS = Config.ALT_OLY_COMP_RITEM;
private static final int[] BUFFS =
{
4357, // Haste Lv2
4342, // Wind Walk Lv2
4356, // Empower Lv3
4355, // Acumen Lv3
4351, // Concentration Lv6
4345, // Might Lv3
4358, // Guidance Lv3
4359, // Focus Lv3
4360, // Death Whisper Lv3
4352, // Berserker Spirit Lv2
};
@Override
public final boolean useBypass(String command, L2PcInstance activeChar, L2Character target)
{
......@@ -227,7 +242,8 @@ public class OlympiadManagerLink implements IBypassHandler
}
else if (command.toLowerCase().startsWith("olybuff"))
{
if (activeChar.getOlympiadBuffCount() <= 0)
int buffCount = activeChar.getOlympiadBuffCount();
if (buffCount <= 0)
{
return false;
}
......@@ -235,29 +251,28 @@ public class OlympiadManagerLink implements IBypassHandler
final NpcHtmlMessage html = new NpcHtmlMessage(target.getObjectId());
String[] params = command.split(" ");
if (params[1] == null)
if (!Util.isDigit(params[1]))
{
_log.warning("Olympiad Buffer Warning: npcId = " + target.getId() + " has no buffGroup set in the bypass for the buff selected.");
_log.warning("Olympiad Buffer Warning: npcId = " + target.getId() + " has invalid buffGroup set in the bypass for the buff selected: " + params[1]);
return false;
}
int buffGroup = Integer.parseInt(params[1]);
NpcBufferData npcBuffGroupInfo = NpcBufferTable.getInstance().getSkillInfo(target.getId(), buffGroup);
final NpcBufferData npcBuffGroupInfo = NpcBufferTable.getInstance().getSkillInfo(target.getId(), BUFFS[Integer.parseInt(params[1])]);
if (npcBuffGroupInfo == null)
{
_log.warning("Olympiad Buffer Warning: npcId = " + target.getId() + " Location: " + target.getX() + ", " + target.getY() + ", " + target.getZ() + " Player: " + activeChar.getName() + " has tried to use skill group (" + buffGroup + ") not assigned to the NPC Buffer!");
_log.warning("Olympiad Buffer Warning: npcId = " + target.getId() + " Location: " + target.getX() + ", " + target.getY() + ", " + target.getZ() + " Player: " + activeChar.getName() + " has tried to use skill group (" + params[1] + ") not assigned to the NPC Buffer!");
return false;
}
Skill skill = npcBuffGroupInfo.getSkill().getSkill();
target.setTarget(activeChar);
if (activeChar.getOlympiadBuffCount() > 0)
if (buffCount > 0)
{
final Skill skill = npcBuffGroupInfo.getSkill().getSkill();
if (skill != null)
{
activeChar.setOlympiadBuffCount(activeChar.getOlympiadBuffCount() - 1);
target.setTarget(activeChar);
activeChar.setOlympiadBuffCount(--buffCount);
target.broadcastPacket(new MagicSkillUse(target, activeChar, skill.getId(), skill.getLevel(), 0, 0));
skill.applyEffects(activeChar, activeChar);
final L2Summon summon = activeChar.getSummon();
......@@ -269,9 +284,9 @@ public class OlympiadManagerLink implements IBypassHandler
}
}
if (activeChar.getOlympiadBuffCount() > 0)
if (buffCount > 0)
{
html.setFile(activeChar.getHtmlPrefix(), activeChar.getOlympiadBuffCount() == 5 ? Olympiad.OLYMPIAD_HTML_PATH + "olympiad_buffs.htm" : Olympiad.OLYMPIAD_HTML_PATH + "olympiad_5buffs.htm");
html.setFile(activeChar.getHtmlPrefix(), buffCount == Config.ALT_OLY_MAX_BUFFS ? Olympiad.OLYMPIAD_HTML_PATH + "olympiad_buffs.htm" : Olympiad.OLYMPIAD_HTML_PATH + "olympiad_5buffs.htm");
html.replace("%objectId%", String.valueOf(target.getObjectId()));
activeChar.sendPacket(html);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment