Updated Olympiad buffer.

Adapted from: L2jUnity free files.
This commit is contained in:
MobiusDev 2017-12-01 05:04:39 +00:00
parent 825f9d8036
commit ca45dfa9f7
24 changed files with 300 additions and 356 deletions

View File

@ -1,22 +0,0 @@
<html><head><body scroll="no">
<table border=0 cellpadding=0 cellspacing=0 width=292 height=358 background="L2UI_CH3.refinewnd_back_Pattern">
<tr><td height=34></td></tr>
<tr><td align=center>Please choose buff skills from below.<br>
(Harmony buffs are not stackable.)</td></tr>
<tr><td height=10></td></tr>
<tr><td><center></center><br>
<center>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14738">Horn Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14739">Drum Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14740">Pipe Organ Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14741">Guitar Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14742">Harp Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14743">Lute Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14744">Knight's Harmony Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14745">Warrior's Harmony Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14746">Wizard's Harmony Lv1</Button>
</center>
</td></tr>
<tr><td height=34></td></tr>
</table>
</body></html>

View File

@ -1,23 +0,0 @@
<html><body scroll="no">
<table border=0 cellpadding=0 cellspacing=0 width=292 height=358 background="L2UI_CH3.refinewnd_back_Pattern">
<tr><td height=34></td></tr>
<tr><td align=center>I wish all participants luck and success.</td></tr>
<tr><td height=10></td></tr>
<tr><td align=center>Please choose 5 buffs from the following.</td></tr>
<tr><td height=10></td></tr>
<tr><td><center></center><br>
<center>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14738">Horn Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14739">Drum Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14740">Pipe Organ Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14741">Guitar Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14742">Harp Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14743">Lute Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14744">Knight's Harmony Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14745">Warrior's Harmony Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14746">Wizard's Harmony Lv1</Button>
</center>
</td></tr>
<tr><td height=34></td></tr>
</table>
</body></html>

View File

@ -1,10 +0,0 @@
<html><body scroll="no">
<table border=0 cellpadding=0 cellspacing=0 width=292 height=358 background="L2UI_CH3.refinewnd_back_Pattern">
<tr><td height=34></td></tr>
<tr><td align=center>All buffs have been provided.</td></tr>
<tr><td height=10></td></tr>
<tr><td align=center>May you achieve victory.</td></tr>
<tr><td height=34></td></tr>
<tr><td height=200></td></tr>
</table>
</body></html>

View File

@ -16,11 +16,11 @@
*/
package ai.others.OlyBuffer;
import com.l2jmobius.commons.util.CommonUtil;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.holders.SkillHolder;
import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.model.skills.SkillCaster;
import ai.AbstractNpcAI;
@ -33,17 +33,17 @@ public final class OlyBuffer extends AbstractNpcAI
// NPC
private static final int OLYMPIAD_BUFFER = 36402;
// Skills
private static final int[] ALLOWED_BUFFS =
private static final SkillHolder KNIGHT = new SkillHolder(14744, 1); // Olympiad - Knight's Harmony
private static final SkillHolder WARRIOR = new SkillHolder(14745, 1); // Olympiad - Warrior's Harmony
private static final SkillHolder WIZARD = new SkillHolder(14746, 1); // Olympiad - Wizard's Harmony
private static final SkillHolder[] BUFFS =
{
14738, // Olympiad - Horn Melody
14739, // Olympiad - Drum Melody
14740, // Olympiad - Pipe Organ Melody
14741, // Olympiad - Guitar Melody
14742, // Olympiad - Harp Melody
14743, // Olympiad - Lute Melody
14744, // Olympiad - Knight's Harmony
14745, // Olympiad - Warrior's Harmony
14746, // Olympiad - Wizard's Harmony
new SkillHolder(14738, 1), // Olympiad - Horn Melody
new SkillHolder(14739, 1), // Olympiad - Drum Melody
new SkillHolder(14740, 1), // Olympiad - Pipe Organ Melody
new SkillHolder(14741, 1), // Olympiad - Guitar Melody
new SkillHolder(14742, 1), // Olympiad - Harp Melody
new SkillHolder(14743, 1), // Olympiad - Lute Melody
};
private OlyBuffer()
@ -57,9 +57,10 @@ public final class OlyBuffer extends AbstractNpcAI
public String onFirstTalk(L2Npc npc, L2PcInstance player)
{
String htmltext = null;
if (npc.getScriptValue() < 5)
if (npc.isScriptValue(0))
{
htmltext = "OlyBuffer-index.html";
htmltext = "olympiad_master001.htm";
}
return htmltext;
}
@ -68,33 +69,42 @@ public final class OlyBuffer extends AbstractNpcAI
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
String htmltext = null;
if (event.startsWith("giveBuff;") && (npc.getScriptValue() < 5))
switch (event)
{
final int buffId = Integer.parseInt(event.replace("giveBuff;", ""));
if (CommonUtil.contains(ALLOWED_BUFFS, buffId))
case "guardian":
{
final Skill buff = SkillData.getInstance().getSkill(buffId, 1);
if (buff != null)
{
npc.setScriptValue(npc.getScriptValue() + 1);
addSkillCastDesire(npc, player, buff, 23);
htmltext = "OlyBuffer-afterBuff.html";
}
if (npc.getScriptValue() >= 5)
{
htmltext = "OlyBuffer-noMore.html";
startQuestTimer("DELETE_ME", 5000, npc, null);
}
htmltext = applyBuffs(npc, player, KNIGHT.getSkill());
break;
}
case "berserker":
{
htmltext = applyBuffs(npc, player, WARRIOR.getSkill());
break;
}
case "magician":
{
htmltext = applyBuffs(npc, player, WIZARD.getSkill());
break;
}
}
else if (event.equals("DELETE_ME") && (npc != null))
{
npc.deleteMe();
}
npc.setScriptValue(1);
htmltext = "olympiad_master003.htm";
getTimers().addTimer("DELETE_ME", 5000, evnt -> npc.deleteMe());
return htmltext;
}
private String applyBuffs(L2Npc npc, L2PcInstance player, Skill skill)
{
for (SkillHolder holder : BUFFS)
{
SkillCaster.triggerCast(npc, player, holder.getSkill());
}
SkillCaster.triggerCast(npc, player, skill);
return null;
}
public static void main(String[] args)
{
new OlyBuffer();

View File

@ -0,0 +1,21 @@
<html><body scroll="no">
<table border=0 cellpadding=0 cellspacing=0 width=292 height=358 background="L2UI_CH3.refinewnd_back_Pattern">
<tr><td height=34></td></tr>
<tr><td align=center>I wish luck to all participants.</td></tr>
<tr><td height=10></td></tr>
<tr><td align=center>Select one of the following Supplemental Magic Sets.</td></tr>
<tr><td height=10></td></tr>
<tr><td>
<br>
<tr>
<td align=center>
<center>
<button action="bypass -h Quest OlyBuffer guardian">Guardian Set</button>
<Button action="bypass -h Quest OlyBuffer berserker">Berserker Set</Button>
<Button action="bypass -h Quest OlyBuffer magician">Magician Set</Button>
</center>
</td>
</tr>
<tr><td height=34></td></tr>
</table>
</body></html>

View File

@ -0,0 +1,10 @@
<html><body scroll="no">
<table border=0 cellpadding=0 cellspacing=0 width=292 height=358 background="L2UI_CH3.refinewnd_back_Pattern">
<tr><td height=34></td></tr>
<tr><td align=center>We gave you the selected Supplemental Magic Set.</td></tr>
<tr><td height=10></td></tr>
<tr><td align=center>I wish luck to all warriors.</td></tr>
<tr><td height=34></td></tr>
<tr><td height=200></td></tr>
</table>
</body></html>

View File

@ -1,22 +0,0 @@
<html><head><body scroll="no">
<table border=0 cellpadding=0 cellspacing=0 width=292 height=358 background="L2UI_CH3.refinewnd_back_Pattern">
<tr><td height=34></td></tr>
<tr><td align=center>Please choose buff skills from below.<br>
(Harmony buffs are not stackable.)</td></tr>
<tr><td height=10></td></tr>
<tr><td><center></center><br>
<center>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14738">Horn Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14739">Drum Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14740">Pipe Organ Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14741">Guitar Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14742">Harp Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14743">Lute Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14744">Knight's Harmony Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14745">Warrior's Harmony Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14746">Wizard's Harmony Lv1</Button>
</center>
</td></tr>
<tr><td height=34></td></tr>
</table>
</body></html>

View File

@ -1,23 +0,0 @@
<html><body scroll="no">
<table border=0 cellpadding=0 cellspacing=0 width=292 height=358 background="L2UI_CH3.refinewnd_back_Pattern">
<tr><td height=34></td></tr>
<tr><td align=center>I wish all participants luck and success.</td></tr>
<tr><td height=10></td></tr>
<tr><td align=center>Please choose 5 buffs from the following.</td></tr>
<tr><td height=10></td></tr>
<tr><td><center></center><br>
<center>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14738">Horn Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14739">Drum Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14740">Pipe Organ Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14741">Guitar Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14742">Harp Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14743">Lute Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14744">Knight's Harmony Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14745">Warrior's Harmony Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14746">Wizard's Harmony Lv1</Button>
</center>
</td></tr>
<tr><td height=34></td></tr>
</table>
</body></html>

View File

@ -1,10 +0,0 @@
<html><body scroll="no">
<table border=0 cellpadding=0 cellspacing=0 width=292 height=358 background="L2UI_CH3.refinewnd_back_Pattern">
<tr><td height=34></td></tr>
<tr><td align=center>All buffs have been provided.</td></tr>
<tr><td height=10></td></tr>
<tr><td align=center>May you achieve victory.</td></tr>
<tr><td height=34></td></tr>
<tr><td height=200></td></tr>
</table>
</body></html>

View File

@ -16,11 +16,11 @@
*/
package ai.others.OlyBuffer;
import com.l2jmobius.commons.util.CommonUtil;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.holders.SkillHolder;
import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.model.skills.SkillCaster;
import ai.AbstractNpcAI;
@ -33,17 +33,17 @@ public final class OlyBuffer extends AbstractNpcAI
// NPC
private static final int OLYMPIAD_BUFFER = 36402;
// Skills
private static final int[] ALLOWED_BUFFS =
private static final SkillHolder KNIGHT = new SkillHolder(14744, 1); // Olympiad - Knight's Harmony
private static final SkillHolder WARRIOR = new SkillHolder(14745, 1); // Olympiad - Warrior's Harmony
private static final SkillHolder WIZARD = new SkillHolder(14746, 1); // Olympiad - Wizard's Harmony
private static final SkillHolder[] BUFFS =
{
14738, // Olympiad - Horn Melody
14739, // Olympiad - Drum Melody
14740, // Olympiad - Pipe Organ Melody
14741, // Olympiad - Guitar Melody
14742, // Olympiad - Harp Melody
14743, // Olympiad - Lute Melody
14744, // Olympiad - Knight's Harmony
14745, // Olympiad - Warrior's Harmony
14746, // Olympiad - Wizard's Harmony
new SkillHolder(14738, 1), // Olympiad - Horn Melody
new SkillHolder(14739, 1), // Olympiad - Drum Melody
new SkillHolder(14740, 1), // Olympiad - Pipe Organ Melody
new SkillHolder(14741, 1), // Olympiad - Guitar Melody
new SkillHolder(14742, 1), // Olympiad - Harp Melody
new SkillHolder(14743, 1), // Olympiad - Lute Melody
};
private OlyBuffer()
@ -57,9 +57,10 @@ public final class OlyBuffer extends AbstractNpcAI
public String onFirstTalk(L2Npc npc, L2PcInstance player)
{
String htmltext = null;
if (npc.getScriptValue() < 5)
if (npc.isScriptValue(0))
{
htmltext = "OlyBuffer-index.html";
htmltext = "olympiad_master001.htm";
}
return htmltext;
}
@ -68,33 +69,42 @@ public final class OlyBuffer extends AbstractNpcAI
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
String htmltext = null;
if (event.startsWith("giveBuff;") && (npc.getScriptValue() < 5))
switch (event)
{
final int buffId = Integer.parseInt(event.replace("giveBuff;", ""));
if (CommonUtil.contains(ALLOWED_BUFFS, buffId))
case "guardian":
{
final Skill buff = SkillData.getInstance().getSkill(buffId, 1);
if (buff != null)
{
npc.setScriptValue(npc.getScriptValue() + 1);
addSkillCastDesire(npc, player, buff, 23);
htmltext = "OlyBuffer-afterBuff.html";
}
if (npc.getScriptValue() >= 5)
{
htmltext = "OlyBuffer-noMore.html";
startQuestTimer("DELETE_ME", 5000, npc, null);
}
htmltext = applyBuffs(npc, player, KNIGHT.getSkill());
break;
}
case "berserker":
{
htmltext = applyBuffs(npc, player, WARRIOR.getSkill());
break;
}
case "magician":
{
htmltext = applyBuffs(npc, player, WIZARD.getSkill());
break;
}
}
else if (event.equals("DELETE_ME") && (npc != null))
{
npc.deleteMe();
}
npc.setScriptValue(1);
htmltext = "olympiad_master003.htm";
getTimers().addTimer("DELETE_ME", 5000, evnt -> npc.deleteMe());
return htmltext;
}
private String applyBuffs(L2Npc npc, L2PcInstance player, Skill skill)
{
for (SkillHolder holder : BUFFS)
{
SkillCaster.triggerCast(npc, player, holder.getSkill());
}
SkillCaster.triggerCast(npc, player, skill);
return null;
}
public static void main(String[] args)
{
new OlyBuffer();

View File

@ -0,0 +1,21 @@
<html><body scroll="no">
<table border=0 cellpadding=0 cellspacing=0 width=292 height=358 background="L2UI_CH3.refinewnd_back_Pattern">
<tr><td height=34></td></tr>
<tr><td align=center>I wish luck to all participants.</td></tr>
<tr><td height=10></td></tr>
<tr><td align=center>Select one of the following Supplemental Magic Sets.</td></tr>
<tr><td height=10></td></tr>
<tr><td>
<br>
<tr>
<td align=center>
<center>
<button action="bypass -h Quest OlyBuffer guardian">Guardian Set</button>
<Button action="bypass -h Quest OlyBuffer berserker">Berserker Set</Button>
<Button action="bypass -h Quest OlyBuffer magician">Magician Set</Button>
</center>
</td>
</tr>
<tr><td height=34></td></tr>
</table>
</body></html>

View File

@ -0,0 +1,10 @@
<html><body scroll="no">
<table border=0 cellpadding=0 cellspacing=0 width=292 height=358 background="L2UI_CH3.refinewnd_back_Pattern">
<tr><td height=34></td></tr>
<tr><td align=center>We gave you the selected Supplemental Magic Set.</td></tr>
<tr><td height=10></td></tr>
<tr><td align=center>I wish luck to all warriors.</td></tr>
<tr><td height=34></td></tr>
<tr><td height=200></td></tr>
</table>
</body></html>

View File

@ -1,22 +0,0 @@
<html><head><body scroll="no">
<table border=0 cellpadding=0 cellspacing=0 width=292 height=358 background="L2UI_CH3.refinewnd_back_Pattern">
<tr><td height=34></td></tr>
<tr><td align=center>Please choose buff skills from below.<br>
(Harmony buffs are not stackable.)</td></tr>
<tr><td height=10></td></tr>
<tr><td><center></center><br>
<center>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14738">Horn Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14739">Drum Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14740">Pipe Organ Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14741">Guitar Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14742">Harp Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14743">Lute Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14744">Knight's Harmony Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14745">Warrior's Harmony Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14746">Wizard's Harmony Lv1</Button>
</center>
</td></tr>
<tr><td height=34></td></tr>
</table>
</body></html>

View File

@ -1,23 +0,0 @@
<html><body scroll="no">
<table border=0 cellpadding=0 cellspacing=0 width=292 height=358 background="L2UI_CH3.refinewnd_back_Pattern">
<tr><td height=34></td></tr>
<tr><td align=center>I wish all participants luck and success.</td></tr>
<tr><td height=10></td></tr>
<tr><td align=center>Please choose 5 buffs from the following.</td></tr>
<tr><td height=10></td></tr>
<tr><td><center></center><br>
<center>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14738">Horn Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14739">Drum Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14740">Pipe Organ Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14741">Guitar Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14742">Harp Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14743">Lute Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14744">Knight's Harmony Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14745">Warrior's Harmony Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14746">Wizard's Harmony Lv1</Button>
</center>
</td></tr>
<tr><td height=34></td></tr>
</table>
</body></html>

View File

@ -1,10 +0,0 @@
<html><body scroll="no">
<table border=0 cellpadding=0 cellspacing=0 width=292 height=358 background="L2UI_CH3.refinewnd_back_Pattern">
<tr><td height=34></td></tr>
<tr><td align=center>All buffs have been provided.</td></tr>
<tr><td height=10></td></tr>
<tr><td align=center>May you achieve victory.</td></tr>
<tr><td height=34></td></tr>
<tr><td height=200></td></tr>
</table>
</body></html>

View File

@ -16,11 +16,11 @@
*/
package ai.others.OlyBuffer;
import com.l2jmobius.commons.util.CommonUtil;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.holders.SkillHolder;
import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.model.skills.SkillCaster;
import ai.AbstractNpcAI;
@ -33,17 +33,17 @@ public final class OlyBuffer extends AbstractNpcAI
// NPC
private static final int OLYMPIAD_BUFFER = 36402;
// Skills
private static final int[] ALLOWED_BUFFS =
private static final SkillHolder KNIGHT = new SkillHolder(14744, 1); // Olympiad - Knight's Harmony
private static final SkillHolder WARRIOR = new SkillHolder(14745, 1); // Olympiad - Warrior's Harmony
private static final SkillHolder WIZARD = new SkillHolder(14746, 1); // Olympiad - Wizard's Harmony
private static final SkillHolder[] BUFFS =
{
14738, // Olympiad - Horn Melody
14739, // Olympiad - Drum Melody
14740, // Olympiad - Pipe Organ Melody
14741, // Olympiad - Guitar Melody
14742, // Olympiad - Harp Melody
14743, // Olympiad - Lute Melody
14744, // Olympiad - Knight's Harmony
14745, // Olympiad - Warrior's Harmony
14746, // Olympiad - Wizard's Harmony
new SkillHolder(14738, 1), // Olympiad - Horn Melody
new SkillHolder(14739, 1), // Olympiad - Drum Melody
new SkillHolder(14740, 1), // Olympiad - Pipe Organ Melody
new SkillHolder(14741, 1), // Olympiad - Guitar Melody
new SkillHolder(14742, 1), // Olympiad - Harp Melody
new SkillHolder(14743, 1), // Olympiad - Lute Melody
};
private OlyBuffer()
@ -57,9 +57,10 @@ public final class OlyBuffer extends AbstractNpcAI
public String onFirstTalk(L2Npc npc, L2PcInstance player)
{
String htmltext = null;
if (npc.getScriptValue() < 5)
if (npc.isScriptValue(0))
{
htmltext = "OlyBuffer-index.html";
htmltext = "olympiad_master001.htm";
}
return htmltext;
}
@ -68,33 +69,42 @@ public final class OlyBuffer extends AbstractNpcAI
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
String htmltext = null;
if (event.startsWith("giveBuff;") && (npc.getScriptValue() < 5))
switch (event)
{
final int buffId = Integer.parseInt(event.replace("giveBuff;", ""));
if (CommonUtil.contains(ALLOWED_BUFFS, buffId))
case "guardian":
{
final Skill buff = SkillData.getInstance().getSkill(buffId, 1);
if (buff != null)
{
npc.setScriptValue(npc.getScriptValue() + 1);
addSkillCastDesire(npc, player, buff, 23);
htmltext = "OlyBuffer-afterBuff.html";
}
if (npc.getScriptValue() >= 5)
{
htmltext = "OlyBuffer-noMore.html";
startQuestTimer("DELETE_ME", 5000, npc, null);
}
htmltext = applyBuffs(npc, player, KNIGHT.getSkill());
break;
}
case "berserker":
{
htmltext = applyBuffs(npc, player, WARRIOR.getSkill());
break;
}
case "magician":
{
htmltext = applyBuffs(npc, player, WIZARD.getSkill());
break;
}
}
else if (event.equals("DELETE_ME") && (npc != null))
{
npc.deleteMe();
}
npc.setScriptValue(1);
htmltext = "olympiad_master003.htm";
getTimers().addTimer("DELETE_ME", 5000, evnt -> npc.deleteMe());
return htmltext;
}
private String applyBuffs(L2Npc npc, L2PcInstance player, Skill skill)
{
for (SkillHolder holder : BUFFS)
{
SkillCaster.triggerCast(npc, player, holder.getSkill());
}
SkillCaster.triggerCast(npc, player, skill);
return null;
}
public static void main(String[] args)
{
new OlyBuffer();

View File

@ -0,0 +1,21 @@
<html><body scroll="no">
<table border=0 cellpadding=0 cellspacing=0 width=292 height=358 background="L2UI_CH3.refinewnd_back_Pattern">
<tr><td height=34></td></tr>
<tr><td align=center>I wish luck to all participants.</td></tr>
<tr><td height=10></td></tr>
<tr><td align=center>Select one of the following Supplemental Magic Sets.</td></tr>
<tr><td height=10></td></tr>
<tr><td>
<br>
<tr>
<td align=center>
<center>
<button action="bypass -h Quest OlyBuffer guardian">Guardian Set</button>
<Button action="bypass -h Quest OlyBuffer berserker">Berserker Set</Button>
<Button action="bypass -h Quest OlyBuffer magician">Magician Set</Button>
</center>
</td>
</tr>
<tr><td height=34></td></tr>
</table>
</body></html>

View File

@ -0,0 +1,10 @@
<html><body scroll="no">
<table border=0 cellpadding=0 cellspacing=0 width=292 height=358 background="L2UI_CH3.refinewnd_back_Pattern">
<tr><td height=34></td></tr>
<tr><td align=center>We gave you the selected Supplemental Magic Set.</td></tr>
<tr><td height=10></td></tr>
<tr><td align=center>I wish luck to all warriors.</td></tr>
<tr><td height=34></td></tr>
<tr><td height=200></td></tr>
</table>
</body></html>

View File

@ -1,22 +0,0 @@
<html><head><body scroll="no">
<table border=0 cellpadding=0 cellspacing=0 width=292 height=358 background="L2UI_CH3.refinewnd_back_Pattern">
<tr><td height=34></td></tr>
<tr><td align=center>Please choose buff skills from below.<br>
(Harmony buffs are not stackable.)</td></tr>
<tr><td height=10></td></tr>
<tr><td><center></center><br>
<center>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14738">Horn Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14739">Drum Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14740">Pipe Organ Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14741">Guitar Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14742">Harp Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14743">Lute Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14744">Knight's Harmony Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14745">Warrior's Harmony Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14746">Wizard's Harmony Lv1</Button>
</center>
</td></tr>
<tr><td height=34></td></tr>
</table>
</body></html>

View File

@ -1,23 +0,0 @@
<html><body scroll="no">
<table border=0 cellpadding=0 cellspacing=0 width=292 height=358 background="L2UI_CH3.refinewnd_back_Pattern">
<tr><td height=34></td></tr>
<tr><td align=center>I wish all participants luck and success.</td></tr>
<tr><td height=10></td></tr>
<tr><td align=center>Please choose 5 buffs from the following.</td></tr>
<tr><td height=10></td></tr>
<tr><td><center></center><br>
<center>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14738">Horn Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14739">Drum Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14740">Pipe Organ Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14741">Guitar Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14742">Harp Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14743">Lute Melody Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14744">Knight's Harmony Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14745">Warrior's Harmony Lv1</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest OlyBuffer giveBuff;14746">Wizard's Harmony Lv1</Button>
</center>
</td></tr>
<tr><td height=34></td></tr>
</table>
</body></html>

View File

@ -1,10 +0,0 @@
<html><body scroll="no">
<table border=0 cellpadding=0 cellspacing=0 width=292 height=358 background="L2UI_CH3.refinewnd_back_Pattern">
<tr><td height=34></td></tr>
<tr><td align=center>All buffs have been provided.</td></tr>
<tr><td height=10></td></tr>
<tr><td align=center>May you achieve victory.</td></tr>
<tr><td height=34></td></tr>
<tr><td height=200></td></tr>
</table>
</body></html>

View File

@ -16,11 +16,11 @@
*/
package ai.others.OlyBuffer;
import com.l2jmobius.commons.util.CommonUtil;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.holders.SkillHolder;
import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.model.skills.SkillCaster;
import ai.AbstractNpcAI;
@ -33,17 +33,17 @@ public final class OlyBuffer extends AbstractNpcAI
// NPC
private static final int OLYMPIAD_BUFFER = 36402;
// Skills
private static final int[] ALLOWED_BUFFS =
private static final SkillHolder KNIGHT = new SkillHolder(14744, 1); // Olympiad - Knight's Harmony
private static final SkillHolder WARRIOR = new SkillHolder(14745, 1); // Olympiad - Warrior's Harmony
private static final SkillHolder WIZARD = new SkillHolder(14746, 1); // Olympiad - Wizard's Harmony
private static final SkillHolder[] BUFFS =
{
14738, // Olympiad - Horn Melody
14739, // Olympiad - Drum Melody
14740, // Olympiad - Pipe Organ Melody
14741, // Olympiad - Guitar Melody
14742, // Olympiad - Harp Melody
14743, // Olympiad - Lute Melody
14744, // Olympiad - Knight's Harmony
14745, // Olympiad - Warrior's Harmony
14746, // Olympiad - Wizard's Harmony
new SkillHolder(14738, 1), // Olympiad - Horn Melody
new SkillHolder(14739, 1), // Olympiad - Drum Melody
new SkillHolder(14740, 1), // Olympiad - Pipe Organ Melody
new SkillHolder(14741, 1), // Olympiad - Guitar Melody
new SkillHolder(14742, 1), // Olympiad - Harp Melody
new SkillHolder(14743, 1), // Olympiad - Lute Melody
};
private OlyBuffer()
@ -57,9 +57,10 @@ public final class OlyBuffer extends AbstractNpcAI
public String onFirstTalk(L2Npc npc, L2PcInstance player)
{
String htmltext = null;
if (npc.getScriptValue() < 5)
if (npc.isScriptValue(0))
{
htmltext = "OlyBuffer-index.html";
htmltext = "olympiad_master001.htm";
}
return htmltext;
}
@ -68,33 +69,42 @@ public final class OlyBuffer extends AbstractNpcAI
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
String htmltext = null;
if (event.startsWith("giveBuff;") && (npc.getScriptValue() < 5))
switch (event)
{
final int buffId = Integer.parseInt(event.replace("giveBuff;", ""));
if (CommonUtil.contains(ALLOWED_BUFFS, buffId))
case "guardian":
{
final Skill buff = SkillData.getInstance().getSkill(buffId, 1);
if (buff != null)
{
npc.setScriptValue(npc.getScriptValue() + 1);
addSkillCastDesire(npc, player, buff, 23);
htmltext = "OlyBuffer-afterBuff.html";
}
if (npc.getScriptValue() >= 5)
{
htmltext = "OlyBuffer-noMore.html";
startQuestTimer("DELETE_ME", 5000, npc, null);
}
htmltext = applyBuffs(npc, player, KNIGHT.getSkill());
break;
}
case "berserker":
{
htmltext = applyBuffs(npc, player, WARRIOR.getSkill());
break;
}
case "magician":
{
htmltext = applyBuffs(npc, player, WIZARD.getSkill());
break;
}
}
else if (event.equals("DELETE_ME") && (npc != null))
{
npc.deleteMe();
}
npc.setScriptValue(1);
htmltext = "olympiad_master003.htm";
getTimers().addTimer("DELETE_ME", 5000, evnt -> npc.deleteMe());
return htmltext;
}
private String applyBuffs(L2Npc npc, L2PcInstance player, Skill skill)
{
for (SkillHolder holder : BUFFS)
{
SkillCaster.triggerCast(npc, player, holder.getSkill());
}
SkillCaster.triggerCast(npc, player, skill);
return null;
}
public static void main(String[] args)
{
new OlyBuffer();

View File

@ -0,0 +1,21 @@
<html><body scroll="no">
<table border=0 cellpadding=0 cellspacing=0 width=292 height=358 background="L2UI_CH3.refinewnd_back_Pattern">
<tr><td height=34></td></tr>
<tr><td align=center>I wish luck to all participants.</td></tr>
<tr><td height=10></td></tr>
<tr><td align=center>Select one of the following Supplemental Magic Sets.</td></tr>
<tr><td height=10></td></tr>
<tr><td>
<br>
<tr>
<td align=center>
<center>
<button action="bypass -h Quest OlyBuffer guardian">Guardian Set</button>
<Button action="bypass -h Quest OlyBuffer berserker">Berserker Set</Button>
<Button action="bypass -h Quest OlyBuffer magician">Magician Set</Button>
</center>
</td>
</tr>
<tr><td height=34></td></tr>
</table>
</body></html>

View File

@ -0,0 +1,10 @@
<html><body scroll="no">
<table border=0 cellpadding=0 cellspacing=0 width=292 height=358 background="L2UI_CH3.refinewnd_back_Pattern">
<tr><td height=34></td></tr>
<tr><td align=center>We gave you the selected Supplemental Magic Set.</td></tr>
<tr><td height=10></td></tr>
<tr><td align=center>I wish luck to all warriors.</td></tr>
<tr><td height=34></td></tr>
<tr><td height=200></td></tr>
</table>
</body></html>