Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/html/npc/unique.html
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/html/npc/unique.html (date 1601235046883)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/html/npc/unique.html (date 1601235046883)
- @@ -0,0 +1,17 @@
- +<html><title>%buffer.name%</title><body>
- +
- +<a action="%buffer.bypass_prefix%">Home</a> > Unique > <font color=LEVEL>%unique.name%</font> (%unique.num_buffs%/%buffer.unique_max_buffs%, %unique.num_songs_dances%/%buffer.unique_max_songs_dances%)<br>
- +
- +<center>
- + <table width=270 cellspacing=0 cellpadding=0>
- + [FOREACH(buff IN unique.buffs DO
- + <tr>
- + <td width=32 height=32><img width=32 height=32 src="%buff.skill_icon%"></td>
- + <td><button width=238 height=32 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="%buff.skill_name%" action="%buffer.bypass_prefix% unique remove %unique.name% %buff.ident%"></td>
- + </tr>
- + <tr><td height=10></td><td></td></tr>
- + )ENDEACH]
- + </table>
- +</center>
- +
- +</body></html>
- \ No newline at end of file
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/html/npc/main.html
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/html/npc/main.html (date 1601235046879)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/html/npc/main.html (date 1601235046879)
- @@ -0,0 +1,67 @@
- +<html><title>%buffer.name%</title><body><center>
- +
- +<table width=270 cellspacing=0 cellpadding=0>
- + <tr>
- + <td><center><button width=130 height=23 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="Heal Me" action="%buffer.bypass_prefix% target player heal"></center></td>
- + <td><center><button width=130 height=23 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="Heal Summon" action="%buffer.bypass_prefix% target summon heal"></center></td>
- + </tr>
- +</table>
- +
- +<table width=270 cellspacing=0 cellpadding=0>
- + <tr>
- + <td><center><button width=130 height=23 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="Cancel Me" action="%buffer.bypass_prefix% target player cancel"></center></td>
- + <td><center><button width=130 height=23 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="Cancel Summon" action="%buffer.bypass_prefix% target summon cancel"></center></td>
- + </tr>
- +</table><br>
- +
- +<font name=hs12 line=UNDERLINE color=LEVEL>Presets</font><br1>
- +<table width=270 cellspacing=0 cellpadding=0>
- + <tr>
- + <td><center><button width=130 height=23 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="Fighter" action="%buffer.bypass_prefix% target player preset BC_FIGHTER"></center></td>
- + <td><center><button width=130 height=23 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="Mage" action="%buffer.bypass_prefix% target player preset BC_MAGE"></center></td>
- + </tr>
- +</table><br>
- +
- +<font name=hs12 line=UNDERLINE color=LEVEL>Categories</font><br1>
- +<table width=270 cellspacing=0 cellpadding=0>
- + <tr>
- + <td><center><button width=130 height=23 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="Buffs" action="%buffer.bypass_prefix% html category BC_BUFFS"></center></td>
- + <td><center><button width=130 height=23 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="Songs" action="%buffer.bypass_prefix% html category BC_SONGS"></center></td>
- + </tr>
- + <tr>
- + <td><center><button width=130 height=23 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="Dances" action="%buffer.bypass_prefix% html category BC_DANCES"></center></td>
- + <td><center><button width=130 height=23 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="Chants" action="%buffer.bypass_prefix% html category BC_CHANTS"></center></td>
- + </tr>
- + <tr>
- + <td><center><button width=130 height=23 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="Dwarven" action="%buffer.bypass_prefix% html category BC_DWARVEN"></center></td>
- + <td><center><button width=130 height=23 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="Resist" action="%buffer.bypass_prefix% html category BC_RESIST"></center></td>
- + </tr>
- + <tr>
- + <td><center><button width=130 height=23 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="Special" action="%buffer.bypass_prefix% html category BC_SPECIAL"></center></td>
- + <td><center><button width=130 height=23 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="Overlord" action="%buffer.bypass_prefix% html category BC_OVERLORD"></center></td>
- + </tr>
- +</table><br>
- +
- +<font name=hs12 line=UNDERLINE color=LEVEL>Unique</font><br1>
- +<table width=270 cellspacing=0 cellpadding=0>
- + <tr>
- + <td><center><combobox width=85 var="unique_selection" list="[FOREACH(unique IN uniques DO %unique.name%;)ENDEACH]"></center></td>
- + <td><center><button width=85 height=23 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="Buff Me" action="%buffer.bypass_prefix% target player unique $unique_selection"></center></td>
- + <td><center><button width=85 height=23 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="Buff Summon" action="%buffer.bypass_prefix% target summon unique $unique_selection"></center></td>
- + </tr>
- + <tr>
- + <td></td>
- + <td><center><button width=85 height=23 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="Inspect" action="%buffer.bypass_prefix% html unique $unique_selection"></center></td>
- + <td><center><button width=85 height=23 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="Delete" action="%buffer.bypass_prefix% unique delete $unique_selection"></center></td>
- + </tr>
- + <tr>
- + <td height=15></td><td></td><td></td>
- + </tr>
- + <tr>
- + <td><center><edit width=85 var="unique_new"></center></td>
- + <td><center><button width=85 height=23 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="Create Empty" action="%buffer.bypass_prefix% unique create $unique_new"></center></td>
- + <td><center><button width=85 height=23 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="From Buffs" action="%buffer.bypass_prefix% unique create_from_effects $unique_new"></center></td>
- + </tr>
- +</table>
- +
- +</center></body></html>
- \ No newline at end of file
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/html/npc/category.html
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/html/npc/category.html (date 1601235046874)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/html/npc/category.html (date 1601235046874)
- @@ -0,0 +1,42 @@
- +<html><title>%buffer.name%</title><body>
- +
- +<a action="%buffer.bypass_prefix%">Home</a> > Category > <font color=LEVEL>%category.name%</font><br><center>
- +
- +[EXISTS(!active_unique,
- + <table width=270 cellspacing=0 cellpadding=0>
- + <tr>
- + <td><center><combobox width=130 var="unique_selection" list="[FOREACH(unique IN uniques DO %unique.name%;)ENDEACH]"></center></td>
- + <td><center><button width=130 height=23 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="Select" action="%buffer.bypass_prefix% unique select $unique_selection"></center></td>
- + </tr>
- + </table><br>
- +)ENDEXISTS]
- +[EXISTS(active_unique,
- + <table width=270 cellspacing=0 cellpadding=0>
- + <tr>
- + <td width=135><center><font color=LEVEL>%active_unique.name%</font> (%active_unique.num_buffs%/%buffer.unique_max_buffs%, %active_unique.num_songs_dances%/%buffer.unique_max_songs_dances%)</font></center></td>
- + <td><center><button width=130 height=23 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="Deselect" action="%buffer.bypass_prefix% unique deselect"></center></center></td>
- + </tr>
- + </table><br>
- +)ENDEXISTS]
- +
- +<table width=270 cellspacing=0 cellpadding=0>
- + [FOREACH(buff IN category.buffs DO
- + [EXISTS(active_unique,
- + [IFCHILDS(active_unique.buffs, skill_id != buff.skill_id THEN
- + <tr>
- + <td width=32 height=32><img width=32 height=32 src="%buff.skill_icon%"></td>
- + <td><button width=238 height=32 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="%buff.skill_name%" action="%buffer.bypass_prefix% unique add %active_unique.name% %category.ident% %buff.ident%"></td>
- + </tr>
- + <tr><td height=10></td><td></td></tr>
- + )ENDIFCHILDS]
- + )ENDEXISTS]
- + [EXISTS(!active_unique,
- + <tr>
- + <td width=32 height=32><img width=32 height=32 src="%buff.skill_icon%"></td>
- + <td><button width=238 height=32 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="%buff.skill_name%" action="%buffer.bypass_prefix% target player buff %category.ident% %buff.ident%"></td>
- + </tr>
- + <tr><td height=10></td><td></td></tr>
- + )ENDEXISTS]
- + )ENDEACH]
- +</table>
- +</center></body></html>
- \ No newline at end of file
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/html/community/main.html
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/html/community/main.html (date 1601235046870)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/html/community/main.html (date 1601235046870)
- @@ -0,0 +1,20 @@
- +<html><title>%buffer.name% - Buffer</title><body><center>
- +
- +[INC(data/scripts/Buffer/data/html/community/inc/header.html)ENDINC]
- +
- +<table width=570>
- + <tr>
- + <td><center>
- + <table width=200 cellpadding=0 cellspacing=0>
- + <tr><td><center><font line="UNDERLINE" name="hs12" color=LEVEL>Categories</font></center></td></tr>
- + <tr><td height=15></td></tr>
- + [FOREACH(category IN buffer.categories DO
- + <tr><td><center><button width=195 height=23 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="%category.name%" action="%buffer.bypass_prefix% html category %category.ident%"></center></td></tr>
- + )ENDEACH]
- + </table>
- + </center></td>
- + [INC(data/scripts/Buffer/data/html/community/inc/active_unique_table.html)ENDINC]
- + </tr>
- +</table>
- +
- +</center></body></html>
- \ No newline at end of file
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/html/community/category.html
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/html/community/category.html (date 1601235046866)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/html/community/category.html (date 1601235046866)
- @@ -0,0 +1,27 @@
- +<html><title>%buffer.name% - Buffer</title><body><center>
- +
- +[INC(data/scripts/Buffer/data/html/community/inc/header.html)ENDINC]
- +
- +<table width=570>
- + <tr>
- + <td><center>
- + <table width=200 cellspacing=0 cellpadding=0>
- + <tr><td width=32 height=32><button width=32 height=23 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="<<" action="%buffer.bypass_prefix% html main"></td><td width=200><center><font line="UNDERLINE" name="hs12" color=LEVEL>%category.name%</font></center></td></tr>
- + [FOREACH(buff IN category.buffs DO
- + [EXISTS(active_unique,
- + [IFCHILDS(active_unique.buffs, skill_id != buff.skill_id THEN
- + <tr><td height=35><img src="%buff.skill_icon%" width=32 height=32></td><td><center><button width=162 height=32 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="%buff.skill_name%" action="%buffer.bypass_prefix% unique add %active_unique.name% %category.ident% %buff.ident%"></center></td></tr>
- + )ENDIFCHILDS]
- + )ENDEXISTS]
- + [EXISTS(!active_unique,
- + <tr><td height=35><img src="%buff.skill_icon%" width=32 height=32></td><td><center><button width=162 height=32 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="%buff.skill_name%" action="%buffer.bypass_prefix% target player buff %category.ident% %buff.ident%"></center></td></tr>
- + )ENDEXISTS]
- + )ENDEACH]
- + <tr><td height=32></td><td></td></tr>
- + </table>
- + </center></td>
- + [INC(data/scripts/Buffer/data/html/community/inc/active_unique_table.html)ENDINC]
- + </tr>
- +</table>
- +
- +</center></body></html>
- \ No newline at end of file
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/html/community/inc/header.html
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/html/community/inc/header.html (date 1601235046861)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/html/community/inc/header.html (date 1601235046861)
- @@ -0,0 +1,36 @@
- +<table width=650 cellpadding=0 cellspacing=0>
- + <tr>
- + <td><combobox width=160 var="header_unique_selection" list="[FOREACH(unique IN uniques DO %unique.name%;)ENDEACH]" [EXISTS(active_unique, sel="%active_unique.name%")ENDEXISTS]></td>
- + <td><center><button width=100 height=23 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="Buff Me" action="%buffer.bypass_prefix% target player unique $header_unique_selection"></center></td>
- + <td><center><button width=100 height=23 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="Buff Summon" action="%buffer.bypass_prefix% target summon unique $header_unique_selection"></center></td>
- + <td width=30></td>
- + <td><center><button width=115 height=23 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="Heal Me" action="%buffer.bypass_prefix% target player heal"></center></td>
- + <td><center><button width=115 height=23 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="Heal Summon" action="%buffer.bypass_prefix% target summon heal"></center></td>
- + </tr>
- + <tr>
- + <td></td>
- + <td><center><button width=100 height=23 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="Select" action="%buffer.bypass_prefix% unique select $header_unique_selection"></center></td>
- + <td><center><button width=100 height=23 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="Delete" action="%buffer.bypass_prefix% unique delete $header_unique_selection"></center></td>
- + <td></td>
- + <td><center><button width=115 height=23 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="Cancel Me" action="%buffer.bypass_prefix% target player cancel"></center></td>
- + <td><center><button width=115 height=23 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="Cancel Summon" action="%buffer.bypass_prefix% target summon cancel"></center></td>
- + </tr>
- + <tr>
- + <td height=15></td><td></td><td></td><td></td><td></td><td></td>
- + </tr>
- + <tr>
- + <td><edit width=160 var="unique_new"></td>
- + <td><center><button width=100 height=23 fore="L2UI_CT1.Button_DF" back="L2UI_CT1.Button_DF_Down" value="Create Empty" action="%buffer.bypass_prefix% unique create $unique_new"></center></td>
- + <td><center><button width=100 height=23 fore="L2UI_CT1.Button_DF" back="L2UI_CT1.Button_DF_Down" value="From Buffs" action="%buffer.bypass_prefix% unique create_from_effects $unique_new"></center></td>
- + <td></td>
- + <td></td>
- + <td></td>
- + </tr>
- +</table><br><br>
- +<font line="UNDERLINE" name="hs12" color=LEVEL>Presets</font><br1>
- +<table width=400 cellspacing=0 cellpadding=0>
- + <tr>
- + <td><center><button width=195 height=23 fore="L2UI_CT1.Button_DF" back="L2UI_CT1.Button_DF_Down" value="Fighter" action="%buffer.bypass_prefix% target player preset BC_FIGHTER"></center></td>
- + <td><center><button width=195 height=23 fore="L2UI_CT1.Button_DF" back="L2UI_CT1.Button_DF_Down" value="Mage" action="%buffer.bypass_prefix% target player preset BC_MAGE"></center></td>
- + </tr>
- +</table><br>
- \ No newline at end of file
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/html/community/inc/active_unique_table.html
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/html/community/inc/active_unique_table.html (date 1601235046856)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/html/community/inc/active_unique_table.html (date 1601235046856)
- @@ -0,0 +1,10 @@
- +[EXISTS(active_unique,
- +<td><center>
- + <table width=200 cellspacing=0 cellpadding=0>
- + <tr><td width=168><center><font line="UNDERLINE" name="hs12" color=LEVEL>%active_unique.name% (%active_unique.num_buffs%/%buffer.unique_max_buffs%, %active_unique.num_songs_dances%/%buffer.unique_max_songs_dances%)</font></center></td><td height=32><button width=32 height=23 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="Des." action="%buffer.bypass_prefix% unique deselect"></td></tr>
- + [FOREACH(buff IN active_unique.buffs DO
- + <tr><td><center><button width=163 height=32 fore=L2UI_CT1.Button_DF back=L2UI_CT1.Button_DF_Down value="%buff.skill_name%" action="%buffer.bypass_prefix% unique remove %active_unique.name% %buff.ident%"></center></td><td height=35><img src="%buff.skill_icon%" width=32 height=32></td></tr>
- + )ENDEACH]
- + </table>
- +</center></td>
- +)ENDEXISTS]
- Index: L2J_Mobius_Classic_Interlude/dist/game/config/Custom/Buffer.ini
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/config/Custom/Buffer.ini (date 1601235046848)
- +++ L2J_Mobius_Classic_Interlude/dist/game/config/Custom/Buffer.ini (date 1601235046848)
- @@ -0,0 +1,7 @@
- +#=============================================================
- +# Buffer
- +#=============================================================
- +# Also check custom/Buffer/data/xml/buffs.xml
- +
- +# Custom buff duration in minutes
- +BufferOverrideBuffDuration = 120
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/stats/npcs/custom/Buffer.xml
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/stats/npcs/custom/Buffer.xml (date 1601235047052)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/stats/npcs/custom/Buffer.xml (date 1601235047052)
- @@ -0,0 +1,21 @@
- +<?xml version="1.0" encoding="UTF-8"?>
- +<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../xsd/npcs.xsd">
- + <npc id="1000006" displayId="9000" type="SchemeBuffer" name="Buffer" usingServerSideName="true" title="" usingServerSideTitle="true">
- + <race>HUMAN</race>
- + <sex>FEMALE</sex>
- + <stats>
- + <vitals hp="2444.46819" hpRegen="7.5" mp="1345.8" mpRegen="2.7" />
- + <attack physical="688.86373" magical="470.40463" random="30" critical="4" accuracy="95" attackSpeed="253" type="SWORD" range="40" distance="80" width="120" />
- + <defence physical="295.91597" magical="216.53847" />
- + <speed>
- + <walk ground="50" />
- + <run ground="120" />
- + </speed>
- + </stats>
- + <status attackable="false" />
- + <collision>
- + <radius normal="11" />
- + <height normal="22.25" />
- + </collision>
- + </npc>
- +</list>
- \ No newline at end of file
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/UniqueBufflist.java
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/UniqueBufflist.java (date 1601235047047)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/UniqueBufflist.java (date 1601235047047)
- @@ -0,0 +1,96 @@
- +/*
- + * This file is part of YANModPack: https://github.com/HorridoJoho/YANModPack
- + * Copyright (C) 2015 Christian Buck
- + *
- + * 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 custom.Buffer;
- +
- +import java.util.LinkedList;
- +
- +import org.l2jmobius.gameserver.model.skills.SkillBuffType;
- +
- +import custom.Buffer.util.htmltmpls.HTMLTemplatePlaceholder;
- +
- +/**
- + * This class is here so we can actually get the name of this list and make placeholder adjustments easily while keeping outside code cleaner
- + * @author HorridoJoho
- + */
- +public class UniqueBufflist extends LinkedList<BufferData.Buff>
- +{
- + private static final long serialVersionUID = -2586607798277226501L;
- +
- + public final int ulistId;
- + public final String ulistName;
- + public int numBuffs;
- + public int numSongsDances;
- + public HTMLTemplatePlaceholder placeholder;
- +
- + UniqueBufflist(int ulistId, String ulistName)
- + {
- + this.ulistId = ulistId;
- + this.ulistName = ulistName;
- + this.numBuffs = 0;
- + this.numSongsDances = 0;
- + this.placeholder = new HTMLTemplatePlaceholder("unique", null).addChild("buffs", null).addChild("name", ulistName).addChild("num_buffs", "0").addChild("num_songs_dances", "0");
- + }
- +
- + @Override
- + public boolean add(BufferData.Buff e)
- + {
- + if (super.add(e))
- + {
- + if (e.getType() == SkillBuffType.BUFF)
- + {
- + ++this.numBuffs;
- + this.placeholder.getChild("num_buffs").setValue(String.valueOf(Integer.parseInt(this.placeholder.getChild("num_buffs").getValue()) + 1));
- + }
- + else
- + {
- + ++this.numSongsDances;
- + this.placeholder.getChild("num_songs_dances").setValue(String.valueOf(Integer.parseInt(this.placeholder.getChild("num_songs_dances").getValue()) + 1));
- + }
- + this.placeholder.getChild("buffs").addAliasChild(e.ident, e.placeholder);
- + return true;
- + }
- +
- + return false;
- + }
- +
- + @Override
- + public boolean remove(Object o)
- + {
- + if (super.remove(o))
- + {
- + switch (((BufferData.Buff) o).getType())
- + {
- + case BUFF:
- + --numBuffs;
- + break;
- + case DANCE:
- + --numSongsDances;
- + break;
- + }
- +
- + this.placeholder = new HTMLTemplatePlaceholder("unique", null).addChild("buffs", null).addChild("name", this.ulistName).addChild("num_buffs", String.valueOf(numBuffs)).addChild("num_songs_dances", String.valueOf(numSongsDances));
- + for (BufferData.Buff buff : this)
- + {
- + this.placeholder.getChild("buffs").addAliasChild(buff.ident, buff.placeholder);
- + }
- + return true;
- + }
- +
- + return false;
- + }
- +}
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/BufferVoicedCommandHandler.java
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/BufferVoicedCommandHandler.java (date 1601235047043)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/BufferVoicedCommandHandler.java (date 1601235047043)
- @@ -0,0 +1,61 @@
- +/*
- + * This file is part of YANModPack: https://github.com/HorridoJoho/YANModPack
- + * Copyright (C) 2015 Christian Buck
- + *
- + * 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 custom.Buffer;
- +
- +import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
- +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
- +
- +/**
- + * @author HorridoJoho
- + */
- +public final class BufferVoicedCommandHandler implements IVoicedCommandHandler
- +{
- + private static final class SingletonHolder
- + {
- + protected static final BufferVoicedCommandHandler INSTANCE = new BufferVoicedCommandHandler();
- + }
- +
- + public static final String VOICED_COMMAND = "buffer";
- + private static final String[] _VOICED_COMMAND_LIST =
- + {
- + VOICED_COMMAND
- + };
- +
- + static BufferVoicedCommandHandler getInstance()
- + {
- + return SingletonHolder.INSTANCE;
- + }
- +
- + BufferVoicedCommandHandler()
- + {
- + }
- +
- + @Override
- + public boolean useVoicedCommand(String command, PlayerInstance activeChar, String params)
- + {
- + Buffer.getInstance().executeCommand(activeChar, null, params);
- + return true;
- + }
- +
- + @Override
- + public String[] getVoicedCommandList()
- + {
- + return _VOICED_COMMAND_LIST;
- + }
- +
- +}
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/BufferNpcBypassHandler.java
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/BufferNpcBypassHandler.java (date 1601235047039)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/BufferNpcBypassHandler.java (date 1601235047039)
- @@ -0,0 +1,77 @@
- +/*
- + * This file is part of YANModPack: https://github.com/HorridoJoho/YANModPack
- + * Copyright (C) 2015 Christian Buck
- + *
- + * 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 custom.Buffer;
- +
- +import org.l2jmobius.gameserver.handler.IBypassHandler;
- +import org.l2jmobius.gameserver.model.WorldObject;
- +import org.l2jmobius.gameserver.enums.InstanceType;
- +import org.l2jmobius.gameserver.model.actor.Creature;
- +import org.l2jmobius.gameserver.model.actor.Npc;
- +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
- +
- +/**
- + * @author HorridoJoho
- + */
- +public class BufferNpcBypassHandler implements IBypassHandler
- +{
- + private static final class SingletonHolder
- + {
- + protected static final BufferNpcBypassHandler INSTANCE = new BufferNpcBypassHandler();
- + }
- +
- + public static final String BYPASS = "BufferNpc";
- + private static final String[] _BYPASS_LIST = new String[]
- + {
- + BYPASS
- + };
- +
- + static BufferNpcBypassHandler getInstance()
- + {
- + return SingletonHolder.INSTANCE;
- + }
- +
- + BufferNpcBypassHandler()
- + {
- + }
- +
- + @Override
- + public boolean useBypass(String command, PlayerInstance activeChar, Creature target)
- + {
- + // If html bypass validation fails
- + // Other values assumed as a validation pass for now
- + if (activeChar.validateHtmlAction(command) == -1)
- + {
- + return false;
- + }
- +
- + WorldObject playerTarget = activeChar.getTarget();
- + if ((playerTarget == null) || !playerTarget.isInstanceTypes(InstanceType.Npc))
- + {
- + return false;
- + }
- +
- + Buffer.getInstance().executeCommand(activeChar, (Npc) playerTarget, command.substring(BYPASS.length()).trim());
- + return true;
- + }
- +
- + @Override
- + public String[] getBypassList()
- + {
- + return _BYPASS_LIST;
- + }
- +}
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/BufferItemHandler.java
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/BufferItemHandler.java (date 1601235047035)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/BufferItemHandler.java (date 1601235047035)
- @@ -0,0 +1,56 @@
- +/*
- + * This file is part of YANModPack: https://github.com/HorridoJoho/YANModPack
- + * Copyright (C) 2015 Christian Buck
- + *
- + * 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 custom.Buffer;
- +
- +import org.l2jmobius.gameserver.handler.IItemHandler;
- +import org.l2jmobius.gameserver.enums.InstanceType;
- +import org.l2jmobius.gameserver.model.actor.Playable;
- +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
- +import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
- +
- +/**
- + * @author HorridoJoho
- + */
- +public final class BufferItemHandler implements IItemHandler
- +{
- + private static final class SingletonHolder
- + {
- + protected static final BufferItemHandler INSTANCE = new BufferItemHandler();
- + }
- +
- + static BufferItemHandler getInstance()
- + {
- + return SingletonHolder.INSTANCE;
- + }
- +
- + BufferItemHandler()
- + {
- + }
- +
- + @Override
- + public boolean useItem(Playable playable, ItemInstance item, boolean forceUse)
- + {
- + if (!playable.isInstanceTypes(InstanceType.PlayerInstance))
- + {
- + return false;
- + }
- +
- + Buffer.getInstance().executeCommand((PlayerInstance) playable, null, null);
- + return true;
- + }
- +}
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/BufferData.java
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/BufferData.java (date 1601235047030)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/BufferData.java (date 1601235047030)
- @@ -0,0 +1,777 @@
- +/*
- + * This file is part of YANModPack: https://github.com/HorridoJoho/YANModPack
- + * Copyright (C) 2015 Christian Buck
- + *
- + * 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 custom.Buffer;
- +
- +import java.nio.file.Path;
- +import java.nio.file.Paths;
- +import java.sql.Connection;
- +import java.sql.PreparedStatement;
- +import java.sql.ResultSet;
- +import java.sql.SQLException;
- +import java.sql.Statement;
- +import java.util.Collections;
- +import java.util.HashMap;
- +import java.util.LinkedHashMap;
- +import java.util.List;
- +import java.util.Map;
- +import java.util.Map.Entry;
- +import java.util.concurrent.ConcurrentHashMap;
- +import java.util.logging.Level;
- +import java.util.logging.Logger;
- +
- +import org.w3c.dom.Element;
- +import org.w3c.dom.Node;
- +
- +import custom.Buffer.util.ItemRequirement;
- +import custom.Buffer.util.XMLUtils;
- +import custom.Buffer.util.htmltmpls.HTMLTemplatePlaceholder;
- +
- +import org.l2jmobius.Config;
- +import org.l2jmobius.commons.database.DatabaseFactory;
- +import org.l2jmobius.gameserver.data.xml.impl.NpcData;
- +import org.l2jmobius.gameserver.data.xml.impl.SkillData;
- +import org.l2jmobius.gameserver.datatables.ItemTable;
- +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
- +import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
- +import org.l2jmobius.gameserver.model.items.Item;
- +import org.l2jmobius.gameserver.model.skills.Skill;
- +import org.l2jmobius.gameserver.model.skills.SkillBuffType;
- +
- +/**
- + * @author HorridoJoho
- + */
- +final class BufferData
- +{
- + public static enum HtmlType
- + {
- + NPC,
- + COMMUNITY
- + }
- +
- + public final class Buff
- + {
- + protected final String ident;
- + protected final Skill skill;
- + protected final SkillBuffType type;
- + protected final Map<String, ItemRequirement> items;
- + /** HTMLTemplatePlaceholder */
- + protected final HTMLTemplatePlaceholder placeholder;
- +
- + protected Buff(String ident, Skill skill, SkillBuffType type, Element elem)
- + {
- + this.ident = ident;
- + this.skill = skill;
- + this.type = type;
- + this.items = _parseItems(elem);
- +
- + this.placeholder = new HTMLTemplatePlaceholder("buff", null);
- + this.placeholder.addChild("ident", ident).addChild("skill_id", String.valueOf(skill.getId())).addChild("skill_name", skill.getName()).addChild("skill_icon", _getClientSkillIconSource(skill.getId())).addChild("type", type.toString());
- + if (!this.items.isEmpty())
- + {
- + HTMLTemplatePlaceholder itemsPlaceholder = this.placeholder.addChild("items", null).getChild("items");
- + for (Entry<String, ItemRequirement> item : this.items.entrySet())
- + {
- + itemsPlaceholder.addAliasChild(String.valueOf(itemsPlaceholder.getChildsSize()), item.getValue().placeholder);
- + }
- + }
- + }
- +
- + private Map<String, ItemRequirement> _parseItems(Element elem)
- + {
- + Map<String, ItemRequirement> items = new LinkedHashMap<>();
- + Node curNode = elem.getFirstChild();
- + while (curNode != null)
- + {
- + switch (curNode.getNodeType())
- + {
- + case Node.ELEMENT_NODE:
- + Element curElem = (Element) curNode;
- + String ident = curElem.getAttribute("ident");
- + ItemRequirement req = _itemRequirements.get(ident);
- + if (req == null)
- + {
- + _LOGGER.warning("Buffer - buffs.xml: Item requirement with ident " + ident + " does not exists!");
- + }
- + else
- + {
- + items.put(ident, req);
- + }
- + break;
- + }
- +
- + curNode = curNode.getNextSibling();
- + }
- + return Collections.unmodifiableMap(items);
- + }
- +
- + private String _getClientSkillIconSource(int skillId)
- + {
- + String format = "";
- + if (skillId < 100)
- + {
- + format = "00" + skillId;
- + }
- + else if ((skillId > 99) && (skillId < 1000))
- + {
- + format = "0" + skillId;
- + }
- + else if (skillId == 1517)
- + {
- + format = "1499";
- + }
- + else if (skillId == 1518)
- + {
- + format = "1502";
- + }
- + else
- + {
- + if ((skillId > 4698) && (skillId < 4701))
- + {
- + format = "1331";
- + }
- + else if ((skillId > 4701) && (skillId < 4704))
- + {
- + format = "1332";
- + }
- + else
- + {
- + format = Integer.toString(skillId);
- + }
- + }
- +
- + return "icon.skill" + format;
- + }
- +
- + public SkillBuffType getType()
- + {
- + return type;
- + }
- + }
- +
- + public final class BuffCategory
- + {
- + protected final String ident;
- + protected final Map<String, Buff> buffs;
- + /** HTMLTemplatePlaceholder */
- + protected final HTMLTemplatePlaceholder placeholder;
- +
- + protected BuffCategory(String ident, String name, Element elem)
- + {
- + this.ident = ident;
- + this.buffs = _parseBuffs(elem);
- +
- + this.placeholder = new HTMLTemplatePlaceholder("category", null);
- + this.placeholder.addChild("ident", ident).addChild("name", name);
- + if (!this.buffs.isEmpty())
- + {
- + HTMLTemplatePlaceholder buffsPlaceholder = this.placeholder.addChild("buffs", null).getChild("buffs");
- + for (Entry<String, Buff> buff : this.buffs.entrySet())
- + {
- + buffsPlaceholder.addAliasChild(String.valueOf(buffsPlaceholder.getChildsSize()), buff.getValue().placeholder);
- + }
- + }
- + }
- +
- + private Map<String, Buff> _parseBuffs(Element elem)
- + {
- + Map<String, Buff> buffs = new LinkedHashMap<>();
- + Node curNode = elem.getFirstChild();
- + while (curNode != null)
- + {
- + switch (curNode.getNodeType())
- + {
- + case Node.ELEMENT_NODE:
- + Element curElem = (Element) curNode;
- + String ident = curElem.getAttribute("ident");
- + Buff buff = _buffs.get(ident);
- + if (buff == null)
- + {
- + _LOGGER.warning("Buffer - buff_categories.xml: Buff with ident " + ident + " does not exists!");
- + }
- + else
- + {
- + buffs.put(ident, buff);
- + }
- + break;
- + }
- +
- + curNode = curNode.getNextSibling();
- + }
- + return Collections.unmodifiableMap(buffs);
- + }
- +
- + public Buff getBuff(String buffIdent)
- + {
- + return buffs.get(buffIdent);
- + }
- + }
- +
- + public abstract class Buffer
- + {
- + /** Can heal a player */
- + protected final boolean canHeal;
- + /** Can cancel a player */
- + protected final boolean canCancel;
- + /** buff categories */
- + protected final Map<String, BuffCategory> buffCats;
- + /** preset bufflists */
- + protected final Map<String, BuffCategory> presetBufflists;
- + /** HTMLTemplatePlaceholder */
- + protected final HTMLTemplatePlaceholder placeholder;
- +
- + protected Buffer(String xmlFile, String bypassPrefix, String bufferName, Element elem)
- + {
- + this.canHeal = Boolean.parseBoolean(elem.getAttribute("can_heal"));
- + this.canCancel = Boolean.parseBoolean(elem.getAttribute("can_cancel"));
- + this.buffCats = _parseBuffCats(xmlFile, elem, false);
- + this.presetBufflists = _parseBuffCats(xmlFile, elem, true);
- +
- + this.placeholder = new HTMLTemplatePlaceholder("buffer", null);
- + this.placeholder.addChild("bypass_prefix", "bypass -h " + bypassPrefix).addChild("name", bufferName).addChild("max_unique_lists", String.valueOf(_maxUniqueLists)).addChild("unique_max_buffs", String.valueOf(_uniqueMaxBuffs)).addChild("unique_max_songs_dances", String.valueOf(_uniqueMaxSongsDances));
- + if (this.canHeal)
- + {
- + this.placeholder.addChild("can_heal", null);
- + }
- + if (this.canCancel)
- + {
- + this.placeholder.addChild("can_cancel", null);
- + }
- + if (!this.buffCats.isEmpty())
- + {
- + HTMLTemplatePlaceholder buffCatsPlaceholder = this.placeholder.addChild("categories", null).getChild("categories");
- + for (Entry<String, BuffCategory> buffCat : this.buffCats.entrySet())
- + {
- + buffCatsPlaceholder.addAliasChild(String.valueOf(buffCatsPlaceholder.getChildsSize()), buffCat.getValue().placeholder);
- + }
- + }
- + if (!this.presetBufflists.isEmpty())
- + {
- + HTMLTemplatePlaceholder presetBufflistsPlaceholder = this.placeholder.addChild("presets", null).getChild("presets");
- + for (Entry<String, BuffCategory> presetBufflist : this.presetBufflists.entrySet())
- + {
- + presetBufflistsPlaceholder.addAliasChild(String.valueOf(presetBufflistsPlaceholder.getChildsSize()), presetBufflist.getValue().placeholder);
- + }
- + }
- + }
- +
- + private Map<String, BuffCategory> _parseBuffCats(String xmlFile, Element elem, boolean preset)
- + {
- + Map<String, BuffCategory> buffCats = new LinkedHashMap<>();
- + Node curNode = elem.getFirstChild();
- + while (curNode != null)
- + {
- + switch (curNode.getNodeType())
- + {
- + case Node.ELEMENT_NODE:
- + Element curElem = (Element) curNode;
- + String ident = curElem.getAttribute("ident");
- + boolean isPreset = Boolean.parseBoolean(curElem.getAttribute("is_preset"));
- + if (preset != isPreset)
- + {
- + break;
- + }
- + BuffCategory buffCat = _buffCats.get(ident);
- + if (buffCat == null)
- + {
- + _LOGGER.warning("Buffer - " + xmlFile + ": Buff category with ident " + ident + " does not exists!");
- + }
- + else
- + {
- + buffCats.put(ident, buffCat);
- + }
- + break;
- + }
- +
- + curNode = curNode.getNextSibling();
- + }
- + return Collections.unmodifiableMap(buffCats);
- + }
- +
- + public BuffCategory getBuffCat(String buffCatIdent)
- + {
- + return buffCats.get(buffCatIdent);
- + }
- +
- + public BuffCategory getPresetBufflist(String presetBufflistIdent)
- + {
- + return presetBufflists.get(presetBufflistIdent);
- + }
- +
- + public Map<String, BuffCategory> getBuffCats()
- + {
- + return buffCats;
- + }
- + }
- +
- + public final class BufferNpc extends Buffer
- + {
- + /** npc id */
- + protected final NpcTemplate npc;
- +
- + protected BufferNpc(NpcTemplate npc, Element elem)
- + {
- + super("buffer_npcs.xml", BufferNpcBypassHandler.BYPASS, npc.getName(), elem);
- + this.npc = npc;
- + }
- + }
- +
- + public final class VoicedBuffer extends Buffer
- + {
- + public final boolean enabled;
- + public final int requiredItem;
- +
- + protected VoicedBuffer(Element elem)
- + {
- + super("voiced_buffer.xml", "voice ." + BufferVoicedCommandHandler.VOICED_COMMAND, "Voiced Command Buffer", elem);
- + this.enabled = Boolean.parseBoolean(elem.getAttribute("enabled"));
- + if (elem.hasAttribute("required_item"))
- + {
- + this.requiredItem = Integer.parseInt(elem.getAttribute("required_item"));
- + }
- + else
- + {
- + this.requiredItem = 0;
- + }
- + }
- + }
- +
- + protected static final Logger _LOGGER = Logger.getLogger(BufferData.class.getName());
- + private static BufferData _INSTANCE = null;
- +
- + public synchronized static void initInstance() throws Exception
- + {
- + _INSTANCE = new BufferData();
- + }
- +
- + public synchronized static BufferData getInstance()
- + {
- + return _INSTANCE;
- + }
- +
- + private final HtmlType _htmlType;
- + private final long _healCooldown;
- + protected final int _maxUniqueLists;
- + protected final int _uniqueMaxBuffs;
- + protected final int _uniqueMaxSongsDances;
- + protected final Map<String, ItemRequirement> _itemRequirements = new HashMap<>();
- + protected final Map<String, Buff> _buffs = new HashMap<>();
- + protected final Map<String, BuffCategory> _buffCats = new HashMap<>();
- + private final Map<Integer, BufferNpc> _bufferNpcs = new HashMap<>();
- + private final VoicedBuffer _voicedBuffer;
- + protected final ConcurrentHashMap<Integer, Map<Integer, UniqueBufflist>> _uniqueBufflists = new ConcurrentHashMap<>();
- +
- + private BufferData() throws Exception
- + {
- + Path xmlPath = Paths.get(Config.DATAPACK_ROOT.getAbsolutePath(), "data", "scripts", custom.Buffer.Buffer.SCRIPT_SUBFOLDER.toString(), "data", "xml");
- + Path xsdPath = Paths.get(xmlPath.toString(), "xsd");
- +
- + Element elem = XMLUtils.CreateDocument(xmlPath.resolve("buffer.xml"), xsdPath.resolve("buffer.xsd")).getDocumentElement();
- + _htmlType = HtmlType.valueOf(elem.getAttribute("dialog_type"));
- + _healCooldown = Integer.parseInt(elem.getAttribute("heal_cooldown")) * 1000;
- + _maxUniqueLists = Integer.parseInt(elem.getAttribute("max_unique_lists"));
- + _uniqueMaxBuffs = Integer.parseInt(elem.getAttribute("unique_max_buffs"));
- + _uniqueMaxSongsDances = Integer.parseInt(elem.getAttribute("unique_max_songs_dances"));
- +
- + elem = XMLUtils.CreateDocument(xmlPath.resolve("item_requirements.xml"), xsdPath.resolve("item_requirements.xsd")).getDocumentElement();
- + _parseItemRequirements(elem);
- +
- + elem = XMLUtils.CreateDocument(xmlPath.resolve("buffs.xml"), xsdPath.resolve("buffs.xsd")).getDocumentElement();
- + _parseBuffs(elem);
- +
- + elem = XMLUtils.CreateDocument(xmlPath.resolve("buff_categories.xml"), xsdPath.resolve("buff_categories.xsd")).getDocumentElement();
- + _parseBuffCats(elem, _buffCats);
- +
- + elem = XMLUtils.CreateDocument(xmlPath.resolve("buffer_npcs.xml"), xsdPath.resolve("buffer_npcs.xsd")).getDocumentElement();
- + _parseBufferNpcs(elem);
- +
- + elem = XMLUtils.CreateDocument(xmlPath.resolve("voiced_buffer.xml"), xsdPath.resolve("voiced_buffer.xsd")).getDocumentElement();
- + _voicedBuffer = new VoicedBuffer(elem);
- +
- + _loadUniqueBufflists();
- + }
- +
- + private void _parseItemRequirements(Element elem)
- + {
- + Node curNode = elem.getFirstChild();
- + while (curNode != null)
- + {
- + switch (curNode.getNodeType())
- + {
- + case Node.ELEMENT_NODE:
- + Element curElem = (Element) curNode;
- + String ident = curElem.getAttribute("ident");
- + int itemId = Integer.parseInt(curElem.getAttribute("id"));
- + long itemAmount = Long.parseLong(curElem.getAttribute("amount"));
- + Item item = ItemTable.getInstance().getTemplate(itemId);
- + if (item == null)
- + {
- + _LOGGER.warning("Buffer - item_requirements.xml: Item with id " + itemId + " does not exists!");
- + }
- + else
- + {
- + _itemRequirements.put(ident, new ItemRequirement(item, itemAmount));
- + }
- + break;
- + }
- +
- + curNode = curNode.getNextSibling();
- + }
- + }
- +
- + private void _parseBuffs(Element elem)
- + {
- + Node curNode = elem.getFirstChild();
- + while (curNode != null)
- + {
- + switch (curNode.getNodeType())
- + {
- + case Node.ELEMENT_NODE:
- + Element curElem = (Element) curNode;
- + String ident = curElem.getAttribute("ident");
- + int skillId = Integer.parseInt(curElem.getAttribute("skill_id"));
- + int skillLevel = Integer.parseInt(curElem.getAttribute("skill_level"));
- + Skill skill = SkillData.getInstance().getSkill(skillId, skillLevel);
- + SkillBuffType buffType = SkillBuffType.valueOf(curElem.getAttribute("type"));
- + if (skill == null)
- + {
- + _LOGGER.warning("Buffer - buffs.xml: Skill with id " + skillId + " and level " + skillLevel + " does not exists!");
- + }
- + else
- + {
- + _buffs.put(ident, new Buff(ident, skill, buffType, curElem));
- + }
- + break;
- + }
- +
- + curNode = curNode.getNextSibling();
- + }
- + }
- +
- + private void _parseBuffCats(Element elem, Map<String, BuffCategory> buffCats)
- + {
- + Node curNode = elem.getFirstChild();
- + while (curNode != null)
- + {
- + switch (curNode.getNodeType())
- + {
- + case Node.ELEMENT_NODE:
- + Element curElem = (Element) curNode;
- + String ident = curElem.getAttribute("ident");
- + buffCats.put(ident, new BuffCategory(ident, curElem.getAttribute("name"), curElem));
- + break;
- + }
- +
- + curNode = curNode.getNextSibling();
- + }
- + }
- +
- + private void _parseBufferNpcs(Element elem)
- + {
- + Node curNode = elem.getFirstChild();
- + while (curNode != null)
- + {
- + switch (curNode.getNodeType())
- + {
- + case Node.ELEMENT_NODE:
- + Element curElem = (Element) curNode;
- + int npcId = Integer.parseInt(curElem.getAttribute("id"));
- + NpcTemplate npc = NpcData.getInstance().getTemplate(npcId);
- + if (npc == null)
- + {
- + _LOGGER.warning("Buffer - buffer_npcs.xml: Npc with id " + npcId + " does not exists!");
- + }
- + else
- + {
- + _bufferNpcs.put(npc.getId(), new BufferNpc(npc, curElem));
- + }
- + break;
- + }
- +
- + curNode = curNode.getNextSibling();
- + }
- + }
- +
- + private void _loadUniqueBufflists() throws Exception
- + {
- + try (Connection con = DatabaseFactory.getConnection();)
- + {
- + try (Statement stmt = con.createStatement();
- + ResultSet rset = stmt.executeQuery("SELECT id,character_id,list_name FROM buffer_user_lists ORDER BY character_id ASC");)
- + {
- + while (rset.next())
- + {
- + int charId = rset.getInt("character_id");
- + int ulistId = rset.getInt("id");
- + String ulistName = rset.getString("list_name");
- +
- + Map<Integer, UniqueBufflist> ulists = _getPlayersULists(charId);
- + ulists.put(ulistId, new UniqueBufflist(ulistId, ulistName));
- + }
- + }
- +
- + for (Entry<Integer, Map<Integer, UniqueBufflist>> ulists : _uniqueBufflists.entrySet())
- + {
- + for (Entry<Integer, UniqueBufflist> ulist : ulists.getValue().entrySet())
- + {
- + try (PreparedStatement stmt = con.prepareStatement("SELECT buff_id FROM buffer_user_list_buffs WHERE user_buff_list_id=?");)
- + {
- + stmt.setInt(1, ulist.getKey());
- + try (ResultSet rs = stmt.executeQuery();)
- + {
- + while (rs.next())
- + {
- + String buffIdent = rs.getString("buff_id");
- + Buff buff = getBuff(buffIdent);
- + if (buff == null)
- + {
- + _LOGGER.warning("Buffer - Data: Buff with ident does not exists!");
- + }
- + else
- + {
- + ulist.getValue().add(buff);
- + }
- + }
- + }
- + }
- + }
- + }
- + }
- + catch (SQLException sqle)
- + {
- + throw new SQLException(sqle);
- + }
- + }
- +
- + private Map<Integer, UniqueBufflist> _getPlayersULists(int playerObjectId)
- + {
- + Map<Integer, UniqueBufflist> ulists = _uniqueBufflists.get(playerObjectId);
- + if (ulists == null)
- + {
- + ulists = new LinkedHashMap<>();
- + _uniqueBufflists.put(playerObjectId, ulists);
- + }
- +
- + return ulists;
- + }
- +
- + private UniqueBufflist _getPlayersUList(int playerObjectId, String ulistName)
- + {
- + Map<Integer, UniqueBufflist> ulists = _getPlayersULists(playerObjectId);
- + for (Entry<Integer, UniqueBufflist> entry : ulists.entrySet())
- + {
- + if (entry.getValue().ulistName.equals(ulistName))
- + {
- + return entry.getValue();
- + }
- + }
- + return null;
- + }
- +
- + public boolean createUniqueBufflist(int playerObjectId, String ulistName)
- + {
- + // prevent duplicate entry
- + if (_getPlayersUList(playerObjectId, ulistName) != null)
- + {
- + return false;
- + }
- +
- + try (Connection con = DatabaseFactory.getConnection();
- + PreparedStatement stmt = con.prepareStatement("INSERT INTO buffer_user_lists (character_id,list_name) VALUES(?,?)", Statement.RETURN_GENERATED_KEYS);)
- + {
- + stmt.setInt(1, playerObjectId);
- + stmt.setString(2, ulistName);
- + stmt.executeUpdate();
- + ResultSet rs = stmt.getGeneratedKeys();
- + rs.next();
- + int newId = rs.getInt(1);
- + _getPlayersULists(playerObjectId).put(newId, new UniqueBufflist(newId, ulistName));
- + return true;
- + }
- + catch (SQLException sqle)
- + {
- + _LOGGER.log(Level.WARNING, "Failed to insert unique bufflist!", sqle);
- + return false;
- + }
- + }
- +
- + public void deleteUniqueBufflist(int playerObjectId, String ulistName)
- + {
- + UniqueBufflist ulist = _getPlayersUList(playerObjectId, ulistName);
- + if (ulist == null)
- + {
- + return;
- + }
- +
- + try (Connection con = DatabaseFactory.getConnection();
- + PreparedStatement stmt = con.prepareStatement("DELETE FROM buffer_user_lists WHERE character_id=? AND id=?");)
- + {
- + stmt.setInt(1, playerObjectId);
- + stmt.setInt(2, ulist.ulistId);
- + stmt.executeUpdate();
- + _getPlayersULists(playerObjectId).remove(ulist.ulistId);
- + }
- + catch (SQLException sqle)
- + {
- + _LOGGER.log(Level.WARNING, "Failed to delete unique bufflist!", sqle);
- + }
- + }
- +
- + public boolean addToUniqueBufflist(int playerObjectId, String ulistName, Buff buff)
- + {
- + UniqueBufflist ulist = _getPlayersUList(playerObjectId, ulistName);
- + // prevent duplicate entry with ulist.contains(buff)
- + if ((ulist == null) || ulist.contains(buff) || ((buff.getType() == SkillBuffType.BUFF) && (ulist.numBuffs >= _uniqueMaxBuffs)) || ((buff.getType() == SkillBuffType.DANCE) && (ulist.numSongsDances >= _uniqueMaxSongsDances)))
- + {
- + return false;
- + }
- +
- + try (Connection con = DatabaseFactory.getConnection();
- + PreparedStatement stmt = con.prepareStatement("INSERT INTO buffer_user_list_buffs VALUES(?,?)");)
- + {
- + stmt.setInt(1, ulist.ulistId);
- + stmt.setString(2, buff.ident);
- + stmt.executeUpdate();
- + ulist.add(buff);
- + }
- + catch (SQLException sqle)
- + {
- + _LOGGER.log(Level.WARNING, "Failed to insert buff into unique bufflist!", sqle);
- + return false;
- + }
- +
- + return true;
- + }
- +
- + public void removeFromUniqueBufflist(int playerObjectId, String ulistName, Buff buff)
- + {
- + UniqueBufflist ulist = _getPlayersUList(playerObjectId, ulistName);
- + if ((ulist == null) || !ulist.contains(buff))
- + {
- + return;
- + }
- +
- + try (Connection con = DatabaseFactory.getConnection();
- + PreparedStatement stmt = con.prepareStatement("DELETE FROM buffer_user_list_buffs WHERE user_buff_list_id=? AND buff_id=?");)
- + {
- + stmt.setInt(1, ulist.ulistId);
- + stmt.setString(2, buff.ident);
- + stmt.executeUpdate();
- + ulist.remove(buff);
- + }
- + catch (SQLException sqle)
- + {
- + _LOGGER.log(Level.WARNING, "Failed to remove buff from unique bufflist!", sqle);
- + }
- + }
- +
- + public HtmlType getHtmlType()
- + {
- + return _htmlType;
- + }
- +
- + public long getHealCooldown()
- + {
- + return _healCooldown;
- + }
- +
- + public int getMaxUniqueLists()
- + {
- + return _maxUniqueLists;
- + }
- +
- + public int getUniqueMaxBuffs()
- + {
- + return _uniqueMaxBuffs;
- + }
- +
- + public int getUniqueMaxSongsBuffs()
- + {
- + return _uniqueMaxSongsDances;
- + }
- +
- + public Buff getBuff(String buffIdent)
- + {
- + return _buffs.get(buffIdent);
- + }
- +
- + public BuffCategory getBuffCat(String buffCatIdent)
- + {
- + return _buffCats.get(buffCatIdent);
- + }
- +
- + public Map<Integer, BufferNpc> getBufferNpcs()
- + {
- + return _bufferNpcs;
- + }
- +
- + public BufferNpc getBufferNpc(int npcId)
- + {
- + return _bufferNpcs.get(npcId);
- + }
- +
- + public VoicedBuffer getVoicedBuffer()
- + {
- + return _voicedBuffer;
- + }
- +
- + public boolean canHaveMoreBufflists(PlayerInstance player)
- + {
- + return _getPlayersULists(player.getObjectId()).size() < _maxUniqueLists;
- + }
- +
- + public boolean hasUniqueBufflist(int playerObjectId, String ulistName)
- + {
- + return _getPlayersUList(playerObjectId, ulistName) != null;
- + }
- +
- + public List<Buff> getUniqueBufflist(int playerObjectId, String ulistName)
- + {
- + UniqueBufflist ulist = _getPlayersUList(playerObjectId, ulistName);
- + if (ulist == null)
- + {
- + return null;
- + }
- + return Collections.unmodifiableList(ulist);
- + }
- +
- + public HTMLTemplatePlaceholder getPlayersUListPlaceholder(int playerObjectId, String ulistName)
- + {
- + UniqueBufflist ulist = _getPlayersUList(playerObjectId, ulistName);
- + if (ulist == null)
- + {
- + return null;
- + }
- + return ulist.placeholder;
- + }
- +
- + public HTMLTemplatePlaceholder getPlayersUListsPlaceholder(int playerObjectId)
- + {
- + Map<Integer, UniqueBufflist> ulists = _getPlayersULists(playerObjectId);
- + if (ulists.isEmpty())
- + {
- + return null;
- + }
- +
- + HTMLTemplatePlaceholder placeholder = new HTMLTemplatePlaceholder("uniques", null);
- + for (Entry<Integer, UniqueBufflist> entry : ulists.entrySet())
- + {
- + placeholder.addAliasChild(String.valueOf(placeholder.getChildsSize()), entry.getValue().placeholder);
- + }
- + return placeholder;
- + }
- +}
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/Buffer.java
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/Buffer.java (date 1601235047025)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/Buffer.java (date 1601235047025)
- @@ -0,0 +1,874 @@
- +/*
- + * This file is part of YANModPack: https://github.com/HorridoJoho/YANModPack
- + * Copyright (C) 2015 Christian Buck
- + *
- + * 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 custom.Buffer;
- +
- +import java.nio.file.Path;
- +import java.nio.file.Paths;
- +import java.util.Collection;
- +import java.util.HashMap;
- +import java.util.List;
- +import java.util.Locale;
- +import java.util.Map;
- +import java.util.Map.Entry;
- +import java.util.concurrent.ConcurrentHashMap;
- +import java.util.logging.Level;
- +import java.util.logging.Logger;
- +
- +import ai.AbstractNpcAI;
- +import custom.Buffer.util.ItemRequirement;
- +import custom.Buffer.util.htmltmpls.HTMLTemplateParser;
- +import custom.Buffer.util.htmltmpls.HTMLTemplatePlaceholder;
- +import custom.Buffer.util.htmltmpls.funcs.ChildsCountFunc;
- +import custom.Buffer.util.htmltmpls.funcs.ExistsFunc;
- +import custom.Buffer.util.htmltmpls.funcs.ForeachFunc;
- +import custom.Buffer.util.htmltmpls.funcs.IfChildsFunc;
- +import custom.Buffer.util.htmltmpls.funcs.IfFunc;
- +import custom.Buffer.util.htmltmpls.funcs.IncludeFunc;
- +
- +import org.l2jmobius.Config;
- +import org.l2jmobius.gameserver.enums.HtmlActionScope;
- +import org.l2jmobius.gameserver.handler.BypassHandler;
- +import org.l2jmobius.gameserver.handler.ItemHandler;
- +import org.l2jmobius.gameserver.handler.VoicedCommandHandler;
- +import org.l2jmobius.gameserver.model.actor.Creature;
- +import org.l2jmobius.gameserver.model.actor.Npc;
- +import org.l2jmobius.gameserver.model.actor.Playable;
- +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
- +import org.l2jmobius.gameserver.model.skills.BuffInfo;
- +import org.l2jmobius.gameserver.model.zone.ZoneId;
- +import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
- +import org.l2jmobius.gameserver.network.serverpackets.ShowBoard;
- +import org.l2jmobius.gameserver.taskmanager.AttackStanceTaskManager;
- +
- +/**
- + * @author HorridoJoho
- + */
- +public final class Buffer extends AbstractNpcAI
- +{
- + private static final class SingletonHolder
- + {
- + protected static final Buffer INSTANCE = new Buffer();
- + }
- +
- + private static final int MINUTE_IN_SECONDS = 60;
- +
- + private static final Logger _LOGGER = Logger.getLogger(Buffer.class.getName());
- + public static final Path SCRIPTS_SUBFOLDER = Paths.get("custom");
- + public static final Path SCRIPT_TOP_FOLDER = Paths.get("Buffer");
- + public static final Path SCRIPT_SUBFOLDER = Paths.get(SCRIPTS_SUBFOLDER.toString(), SCRIPT_TOP_FOLDER.toString());
- +
- + static Buffer getInstance()
- + {
- + return SingletonHolder.INSTANCE;
- + }
- +
- + public static void main(String[] args)
- + {
- + try
- + {
- + BufferData.initInstance();
- + }
- + catch (Exception ex)
- + {
- + _LOGGER.log(Level.WARNING, "Buffer - Data: Exception while loading npc buffer data, not registering mod!", ex);
- + return;
- + }
- +
- + Buffer instance = getInstance();
- +
- + for (Entry<Integer, BufferData.BufferNpc> npc : BufferData.getInstance().getBufferNpcs().entrySet())
- + {
- + instance.addFirstTalkId(npc.getKey());
- + instance.addStartNpc(npc.getKey());
- + instance.addTalkId(npc.getKey());
- + }
- + }
- +
- + private static final ConcurrentHashMap<Integer, Long> _LAST_PLAYABLES_HEAL_TIME = new ConcurrentHashMap<>();
- + private static final ConcurrentHashMap<Integer, String> _LAST_PLAYER_HTMLS = new ConcurrentHashMap<>();
- + private static final ConcurrentHashMap<Integer, String> _ACTIVE_PLAYER_BUFFLISTS = new ConcurrentHashMap<>();
- +
- + Buffer()
- + {
- +// super(-1, SCRIPT_TOP_FOLDER.toString(), SCRIPTS_SUBFOLDER.toString());
- + super();
- +
- + BypassHandler.getInstance().registerHandler(BufferNpcBypassHandler.getInstance());
- +
- + if (BufferData.getInstance().getVoicedBuffer().enabled)
- + {
- + VoicedCommandHandler.getInstance().registerHandler(BufferVoicedCommandHandler.getInstance());
- + ItemHandler.getInstance().registerHandler(BufferItemHandler.getInstance());
- + }
- + }
- +
- + // ////////////////////////////////////
- + // AI METHOD OVERRIDES
- + // ////////////////////////////////////
- + @Override
- + public String onFirstTalk(Npc npc, PlayerInstance player)
- + {
- + executeCommand(player, npc, null);
- + return null;
- + }
- +
- + // ///////////////////////////////////
- + // UTILITY METHODS
- + // ///////////////////////////////////
- + private BufferData.Buffer determineBuffer(Npc npc, PlayerInstance player)
- + {
- + if (npc == null)
- + {
- + BufferData.VoicedBuffer buffer = BufferData.getInstance().getVoicedBuffer();
- + if (!buffer.enabled || ((buffer.requiredItem > 0) && (player.getInventory().getItemByItemId(buffer.requiredItem) == null)))
- + {
- + return null;
- + }
- + return buffer;
- + }
- + return BufferData.getInstance().getBufferNpc(npc.getId());
- + }
- +
- + private String generateAdvancedHtml(PlayerInstance player, String path, Map<String, HTMLTemplatePlaceholder> placeholders, BufferData.HtmlType dialogType)
- + {
- + return HTMLTemplateParser.fromCache(
- + Path.of(
- + "/data/scripts/" + SCRIPT_SUBFOLDER + "/data/html/" + dialogType.toString().toLowerCase(Locale.ENGLISH) + "/" + path
- + ).toString(),
- + player,
- + placeholders,
- + IncludeFunc.INSTANCE,
- + IfFunc.INSTANCE,
- + ForeachFunc.INSTANCE,
- + ExistsFunc.INSTANCE,
- + IfChildsFunc.INSTANCE,
- + ChildsCountFunc.INSTANCE
- + );
- + }
- +
- + /**
- + * Copy from {@link NpcHtmlMessage}
- + * @param activeChar the player
- + * @param html the html to check
- + */
- + private void buildBypassCache(PlayerInstance activeChar, String html)
- + {
- + if (activeChar == null)
- + {
- + return;
- + }
- +
- + activeChar.clearHtmlActions(HtmlActionScope.NPC_HTML);
- + int len = html.length();
- + for (int i = 0; i < len; i++)
- + {
- + int start = html.indexOf("\"bypass ", i);
- + int finish = html.indexOf("\"", start + 1);
- + if ((start < 0) || (finish < 0))
- + {
- + break;
- + }
- +
- + if (html.substring(start + 8, start + 10).equals("-h"))
- + {
- + start += 11;
- + }
- + else
- + {
- + start += 8;
- + }
- +
- + i = finish;
- + int finish2 = html.indexOf("$", start);
- + if ((finish2 < finish) && (finish2 > 0))
- + {
- + activeChar.addHtmlAction(HtmlActionScope.NPC_HTML, html.substring(start, finish2).trim());
- + }
- + else
- + {
- + activeChar.addHtmlAction(HtmlActionScope.NPC_HTML, html.substring(start, finish).trim());
- + }
- + }
- + }
- +
- + /**
- + * Copy from {@link org.l2jmobius.gameserver.communitybbs.Manager.BaseBBSManager}. Modified to allow larger community board htmls.
- + * @param player the player to send to
- + * @param html the html text
- + */
- + private void sendBBSHtml(PlayerInstance player, String html)
- + {
- + buildBypassCache(player, html);
- +
- + if (html.length() < 16250)
- + {
- + player.sendPacket(new ShowBoard(html, "101"));
- + player.sendPacket(new ShowBoard(null, "102"));
- + player.sendPacket(new ShowBoard(null, "103"));
- + }
- + else if (html.length() < (16250 * 2))
- + {
- + player.sendPacket(new ShowBoard(html.substring(0, 16250), "101"));
- + player.sendPacket(new ShowBoard(html.substring(16250), "102"));
- + player.sendPacket(new ShowBoard(null, "103"));
- + }
- + else if (html.length() < (16250 * 3))
- + {
- + player.sendPacket(new ShowBoard(html.substring(0, 16250), "101"));
- + player.sendPacket(new ShowBoard(html.substring(16250, 16250 * 2), "102"));
- + player.sendPacket(new ShowBoard(html.substring(16250 * 2), "103"));
- + }
- + else
- + {
- + player.sendPacket(new ShowBoard("<html><body><br><center>Error: HTML was too long!</center></body></html>", "101"));
- + player.sendPacket(new ShowBoard(null, "102"));
- + player.sendPacket(new ShowBoard(null, "103"));
- + }
- + }
- +
- + private void fillItemAmountMap(Map<Integer, Long> items, BufferData.Buff buff)
- + {
- + for (Entry<String, ItemRequirement> item : buff.items.entrySet())
- + {
- + Long amount = items.get(item.getValue().item.getId());
- + if (amount == null)
- + {
- + amount = 0L;
- + }
- + items.put(item.getValue().item.getId(), amount + item.getValue().amount);
- + }
- + }
- +
- + private void castBuff(Playable playable, BufferData.Buff buff)
- + {
- + buff.skill.applyEffects(playable, playable, true, Config.BUFFER_CUSTOM_BUFF_DURATION * MINUTE_IN_SECONDS);
- + }
- +
- + // //////////////////////////////////
- + // HTML COMMANDS
- + // //////////////////////////////////
- + private void showAdvancedHtml(PlayerInstance player, BufferData.Buffer buffer, Npc npc, String htmlPath, Map<String, HTMLTemplatePlaceholder> placeholders)
- + {
- + placeholders.put(buffer.placeholder.getName(), buffer.placeholder);
- +
- + HTMLTemplatePlaceholder ulistsPlaceholder = BufferData.getInstance().getPlayersUListsPlaceholder(player.getObjectId());
- + if (ulistsPlaceholder != null)
- + {
- + placeholders.put(ulistsPlaceholder.getName(), ulistsPlaceholder);
- + }
- +
- + String activeUniqueName = _ACTIVE_PLAYER_BUFFLISTS.get(player.getObjectId());
- + if (activeUniqueName != null)
- + {
- + HTMLTemplatePlaceholder ulistPlaceholder = BufferData.getInstance().getPlayersUListPlaceholder(player.getObjectId(), activeUniqueName);
- + if (ulistPlaceholder != null)
- + {
- + placeholders.put("active_unique", ulistPlaceholder);
- + }
- + }
- +
- + BufferData.HtmlType dialogType = BufferData.getInstance().getHtmlType();
- +
- + String html = generateAdvancedHtml(player, htmlPath, placeholders, dialogType);
- + switch (dialogType)
- + {
- + case NPC:
- + player.sendPacket(new NpcHtmlMessage(npc == null ? 0 : npc.getObjectId(), html));
- + break;
- + case COMMUNITY:
- + sendBBSHtml(player, html);
- + break;
- + }
- + }
- +
- + private void htmlShowMain(PlayerInstance player, BufferData.Buffer buffer, Npc npc)
- + {
- + showAdvancedHtml(player, buffer, npc, "main.html", new HashMap<String, HTMLTemplatePlaceholder>());
- + }
- +
- + private void htmlShowCategory(PlayerInstance player, BufferData.Buffer buffer, Npc npc, String categoryIdent)
- + {
- + BufferData.BuffCategory buffCat = buffer.getBuffCat(categoryIdent);
- + if (buffCat == null)
- + {
- + return;
- + }
- +
- + HashMap<String, HTMLTemplatePlaceholder> placeholders = new HashMap<>();
- +
- + placeholders.put("category", buffCat.placeholder);
- +
- + showAdvancedHtml(player, buffer, npc, "category.html", placeholders);
- + }
- +
- + private void htmlShowBuff(PlayerInstance player, BufferData.Buffer buffer, Npc npc, String categoryIdent, String buffIdent)
- + {
- + BufferData.BuffCategory buffCat = buffer.getBuffCat(categoryIdent);
- + if (buffCat == null)
- + {
- + return;
- + }
- + BufferData.Buff buff = buffCat.getBuff(buffIdent);
- + if (buff == null)
- + {
- + return;
- + }
- +
- + HashMap<String, HTMLTemplatePlaceholder> placeholders = new HashMap<>();
- +
- + placeholders.put("category", buffCat.placeholder);
- + placeholders.put("buff", buff.placeholder);
- +
- + showAdvancedHtml(player, buffer, npc, "buff.html", placeholders);
- + }
- +
- + private void htmlShowPreset(PlayerInstance player, BufferData.Buffer buffer, Npc npc, String presetBufflistIdent)
- + {
- + BufferData.BuffCategory presetBufflist = buffer.getPresetBufflist(presetBufflistIdent);
- + if (presetBufflist == null)
- + {
- + return;
- + }
- +
- + HashMap<String, HTMLTemplatePlaceholder> placeholders = new HashMap<>();
- +
- + placeholders.put("preset", presetBufflist.placeholder);
- +
- + showAdvancedHtml(player, buffer, npc, "preset.html", placeholders);
- + }
- +
- + private void htmlShowUnique(PlayerInstance player, BufferData.Buffer buffer, Npc npc, String uniqueName)
- + {
- + HTMLTemplatePlaceholder uniquePlaceholder = BufferData.getInstance().getPlayersUListPlaceholder(player.getObjectId(), uniqueName);
- + if (uniquePlaceholder == null)
- + {
- + // redirect to main html if uniqueName is not valid, will most likely happen when the player deletes a unique bufflist he is currently viewing
- + executeHtmlCommand(player, buffer, npc, "main");
- + return;
- + }
- +
- + HashMap<String, HTMLTemplatePlaceholder> placeholders = new HashMap<>();
- +
- + placeholders.put(uniquePlaceholder.getName(), uniquePlaceholder);
- +
- + showAdvancedHtml(player, buffer, npc, "unique.html", placeholders);
- + }
- +
- + private void executeHtmlCommand(PlayerInstance player, BufferData.Buffer buffer, Npc npc, String command)
- + {
- + _LAST_PLAYER_HTMLS.put(player.getObjectId(), command);
- +
- + if ("main".equals(command))
- + {
- + htmlShowMain(player, buffer, npc);
- + }
- + else if (command.startsWith("category "))
- + {
- + htmlShowCategory(player, buffer, npc, command.substring(9));
- + }
- + else if (command.startsWith("preset "))
- + {
- + htmlShowPreset(player, buffer, npc, command.substring(7));
- + }
- + else if (command.startsWith("buff "))
- + {
- + String[] argsSplit = command.substring(5).split(" ", 2);
- + if (argsSplit.length != 2)
- + {
- + return;
- + }
- + htmlShowBuff(player, buffer, npc, argsSplit[0], argsSplit[1]);
- + }
- + else if (command.startsWith("unique "))
- + {
- + htmlShowUnique(player, buffer, npc, command.substring(7));
- + }
- + else
- + {
- + // all other malformed bypasses
- + htmlShowMain(player, buffer, npc);
- + }
- + }
- +
- + //
- + // ////////////////////////////////
- +
- + // /////////////////////////////////////////////
- + // TARGET COMMANDS
- + // /////////////////////////////////////////////
- + private void targetBuffBuff(PlayerInstance player, Playable target, BufferData.Buffer buffer, String categoryIdent, String buffIdent)
- + {
- + BufferData.BuffCategory bCat = buffer.getBuffCat(categoryIdent);
- + if (bCat == null)
- + {
- + return;
- + }
- + BufferData.Buff buff = bCat.getBuff(buffIdent);
- + if (buff == null)
- + {
- + return;
- + }
- +
- + if (!buff.items.isEmpty())
- + {
- + HashMap<Integer, Long> items = new HashMap<>();
- + fillItemAmountMap(items, buff);
- +
- + for (Entry<Integer, Long> item : items.entrySet())
- + {
- + if (player.getInventory().getInventoryItemCount(item.getKey(), 0, true) < item.getValue())
- + {
- + player.sendMessage("Not enough items!");
- + return;
- + }
- + }
- +
- + for (Entry<Integer, Long> item : items.entrySet())
- + {
- + player.destroyItemByItemId("Buffer", item.getKey(), item.getValue(), player, true);
- + }
- + }
- +
- + castBuff(target, buff);
- + }
- +
- + private void targetBuffUnique(PlayerInstance player, Playable target, BufferData.Buffer buffer, String uniqueName)
- + {
- + List<BufferData.Buff> buffs = BufferData.getInstance().getUniqueBufflist(player.getObjectId(), uniqueName);
- +
- + if (buffs != null)
- + {
- + HashMap<Integer, Long> items = null;
- + for (BufferData.Buff buff : buffs)
- + {
- + if (!buff.items.isEmpty())
- + {
- + if (items == null)
- + {
- + items = new HashMap<>();
- + }
- + fillItemAmountMap(items, buff);
- + }
- + }
- +
- + if (items != null)
- + {
- + for (Entry<Integer, Long> item : items.entrySet())
- + {
- + if (player.getInventory().getInventoryItemCount(item.getKey(), 0, true) < item.getValue())
- + {
- + player.sendMessage("Not enough items!");
- + return;
- + }
- + }
- +
- + for (Entry<Integer, Long> item : items.entrySet())
- + {
- + player.destroyItemByItemId("Buffer", item.getKey(), item.getValue(), player, true);
- + }
- + }
- +
- + for (BufferData.Buff buff : buffs)
- + {
- + castBuff(target, buff);
- + }
- + }
- + }
- +
- + private void targetBuffPreset(PlayerInstance player, Playable target, BufferData.Buffer buffer, String presetBufflistIdent)
- + {
- + BufferData.BuffCategory presetBufflist = buffer.getPresetBufflist(presetBufflistIdent);
- + if (presetBufflist == null)
- + {
- + return;
- + }
- +
- + Collection<BufferData.Buff> buffs = presetBufflist.buffs.values();
- +
- + if (buffs != null)
- + {
- + HashMap<Integer, Long> items = null;
- + for (BufferData.Buff buff : buffs)
- + {
- + if (!buff.items.isEmpty())
- + {
- + if (items == null)
- + {
- + items = new HashMap<>();
- + }
- + fillItemAmountMap(items, buff);
- + }
- + }
- +
- + if (items != null)
- + {
- + for (Entry<Integer, Long> item : items.entrySet())
- + {
- + if (player.getInventory().getInventoryItemCount(item.getKey(), 0, true) < item.getValue())
- + {
- + player.sendMessage("Not enough items!");
- + return;
- + }
- + }
- +
- + for (Entry<Integer, Long> item : items.entrySet())
- + {
- + player.destroyItemByItemId("Buffer", item.getKey(), item.getValue(), player, true);
- + }
- + }
- +
- + for (BufferData.Buff buff : buffs)
- + {
- + castBuff(target, buff);
- + }
- + }
- + }
- +
- + private void targetHeal(PlayerInstance player, Playable target, BufferData.Buffer buffer)
- + {
- + if (!buffer.canHeal)
- + {
- + return;
- + }
- +
- + // prevent heal spamming, process cooldown on heal target
- + Long lastPlayableHealTime = _LAST_PLAYABLES_HEAL_TIME.get(target.getObjectId());
- + if (lastPlayableHealTime != null)
- + {
- + Long elapsedTime = System.currentTimeMillis() - lastPlayableHealTime;
- + Long healCooldown = BufferData.getInstance().getHealCooldown();
- + if (elapsedTime < healCooldown)
- + {
- + Long remainingTime = healCooldown - elapsedTime;
- + if (target == player)
- + {
- + player.sendMessage("You can heal yourself again in " + (remainingTime / 1000) + " seconds.");
- + }
- + else
- + {
- + player.sendMessage("You can heal your pet again in " + (remainingTime / 1000) + " seconds.");
- + }
- + return;
- + }
- + }
- +
- + _LAST_PLAYABLES_HEAL_TIME.put(target.getObjectId(), System.currentTimeMillis());
- +
- + if (player == target)
- + {
- + player.setCurrentCp(player.getMaxCp());
- + }
- + target.setCurrentHp(target.getMaxHp());
- + target.setCurrentMp(target.getMaxMp());
- + target.broadcastStatusUpdate();
- + }
- +
- + private void targetCancel(PlayerInstance player, Playable target, BufferData.Buffer buffer)
- + {
- + if (!buffer.canCancel)
- + {
- + return;
- + }
- + target.stopAllEffectsExceptThoseThatLastThroughDeath();
- + }
- +
- + private void executeTargetCommand(PlayerInstance player, BufferData.Buffer buffer, String command)
- + {
- + // /////////////////////////////////
- + // first determine the target
- + Playable target;
- + if (command.startsWith("player "))
- + {
- + target = player;
- + command = command.substring(7);
- + }
- + else if (command.startsWith("summon "))
- + {
- + target = player.getPet();
- + if (target == null)
- + {
- + return;
- + }
- + command = command.substring(7);
- + }
- + else
- + {
- + return;
- + }
- +
- + // //////////////////////////////////////////
- + // run the choosen action on the target
- + if (command.startsWith("buff "))
- + {
- + String[] argsSplit = command.substring(5).split(" ", 2);
- + if (argsSplit.length != 2)
- + {
- + return;
- + }
- + targetBuffBuff(player, target, buffer, argsSplit[0], argsSplit[1]);
- + }
- + else if (command.startsWith("unique "))
- + {
- + targetBuffUnique(player, target, buffer, command.substring(7));
- + }
- + else if (command.startsWith("preset "))
- + {
- + targetBuffPreset(player, target, buffer, command.substring(7));
- + }
- + else if ("heal".equals(command))
- + {
- + targetHeal(player, target, buffer);
- + }
- + else if ("cancel".equals(command))
- + {
- + targetCancel(player, target, buffer);
- + }
- + }
- +
- + //
- + // ////////////////////////////////
- +
- + // ////////////////////////////////
- + // UNIQUE COMMANDS
- + // ////////////////////////////////
- + private boolean uniqueCreate(PlayerInstance player, String uniqueName)
- + {
- + if (!BufferData.getInstance().canHaveMoreBufflists(player))
- + {
- + player.sendMessage("Maximum number of unique bufflists reached!");
- + return false;
- + }
- +
- + // only allow alpha numeric names because we use this name on the htmls
- + if (!uniqueName.matches("[A-Za-z0-9]+"))
- + {
- + return false;
- + }
- +
- + return BufferData.getInstance().createUniqueBufflist(player.getObjectId(), uniqueName);
- + }
- +
- + private void uniqueDelete(PlayerInstance player, String uniqueName)
- + {
- + BufferData.getInstance().deleteUniqueBufflist(player.getObjectId(), uniqueName);
- + // also remove from active bufflist when it's the deleted
- + String activeUniqueName = _ACTIVE_PLAYER_BUFFLISTS.get(player.getObjectId());
- + if ((activeUniqueName != null) && activeUniqueName.equals(uniqueName))
- + {
- + _ACTIVE_PLAYER_BUFFLISTS.remove(player.getObjectId());
- + }
- + }
- +
- + private void uniqueAdd(PlayerInstance player, BufferData.Buffer buffer, String uniqueName, String categoryIdent, String buffIdent)
- + {
- + BufferData.BuffCategory bCat = buffer.getBuffCat(categoryIdent);
- + if (bCat == null)
- + {
- + return;
- + }
- + BufferData.Buff buff = bCat.getBuff(buffIdent);
- + if (buff == null)
- + {
- + return;
- + }
- +
- + BufferData.getInstance().addToUniqueBufflist(player.getObjectId(), uniqueName, buff);
- + }
- +
- + private void uniqueRemove(PlayerInstance player, String uniqueName, String buffIdent)
- + {
- + BufferData.Buff buff = BufferData.getInstance().getBuff(buffIdent);
- + if (buff == null)
- + {
- + return;
- + }
- +
- + BufferData.getInstance().removeFromUniqueBufflist(player.getObjectId(), uniqueName, buff);
- + }
- +
- + private void uniqueSelect(PlayerInstance player, String uniqueName)
- + {
- + if (BufferData.getInstance().hasUniqueBufflist(player.getObjectId(), uniqueName))
- + {
- + _ACTIVE_PLAYER_BUFFLISTS.put(player.getObjectId(), uniqueName);
- + }
- + }
- +
- + private void uniqueDeselect(PlayerInstance player)
- + {
- + _ACTIVE_PLAYER_BUFFLISTS.remove(player.getObjectId());
- + }
- +
- + private void executeUniqueCommand(PlayerInstance player, BufferData.Buffer buffer, String command)
- + {
- + if (command.startsWith("create "))
- + {
- + uniqueCreate(player, command.substring(7));
- + }
- + else if (command.startsWith("create_from_effects "))
- + {
- + String uniqueName = command.substring(20);
- + if (!uniqueCreate(player, uniqueName))
- + {
- + return;
- + }
- +
- + final Collection<BuffInfo> buffs = player.getEffectList().getEffects();
- + for (final BuffInfo effect : buffs)
- + {
- + for (Entry<String, BufferData.BuffCategory> buffCatEntry : buffer.buffCats.entrySet())
- + {
- + boolean added = false;
- +
- + for (Entry<String, BufferData.Buff> buffEntry : buffCatEntry.getValue().buffs.entrySet())
- + {
- + final BufferData.Buff buff = buffEntry.getValue();
- +
- + if (buff.skill.getId() == effect.getSkill().getId())
- + {
- + uniqueAdd(player, buffer, uniqueName, buffCatEntry.getKey(), buff.ident);
- + added = true;
- + break;
- + }
- + }
- +
- + if (added)
- + {
- + break;
- + }
- + }
- + }
- + }
- + else if (command.startsWith("delete "))
- + {
- + uniqueDelete(player, command.substring(7));
- + }
- + else if (command.startsWith("add "))
- + {
- + String[] argsSplit = command.substring(4).split(" ", 3);
- + if (argsSplit.length != 3)
- + {
- + return;
- + }
- + uniqueAdd(player, buffer, argsSplit[0], argsSplit[1], argsSplit[2]);
- + }
- + else if (command.startsWith("remove "))
- + {
- + String[] argsSplit = command.substring(7).split(" ", 2);
- + if (argsSplit.length != 2)
- + {
- + return;
- + }
- + uniqueRemove(player, argsSplit[0], argsSplit[1]);
- + }
- + else if (command.startsWith("select "))
- + {
- + uniqueSelect(player, command.substring(7));
- + }
- + else if (command.startsWith("deselect"))
- + {
- + uniqueDeselect(player);
- + }
- + }
- +
- + //
- + // ////////////////////////////////
- +
- + private static boolean isInsideAnyZoneOf(Creature character, ZoneId first, ZoneId... more)
- + {
- + if (character.isInsideZone(first))
- + {
- + return true;
- + }
- +
- + if (more != null)
- + {
- + for (ZoneId zone : more)
- + {
- + if (character.isInsideZone(zone))
- + {
- + return true;
- + }
- + }
- + }
- +
- + return false;
- + }
- +
- + void executeCommand(PlayerInstance player, Npc npc, String command)
- + {
- + if (isInsideAnyZoneOf(player, ZoneId.PVP, ZoneId.SIEGE, ZoneId.WATER, ZoneId.JAIL, ZoneId.DANGER_AREA))
- + {
- + player.sendMessage("The buffer cannot be used here.");
- + return;
- + }
- + else if (player.isOnEvent() || (player.getBlockCheckerArena() != -1) || player.isInOlympiadMode())
- + {
- + player.sendMessage("The buffer cannot be used in events.");
- + return;
- + }
- +
- + else if (player.isInDuel() || (player.getPvpFlag() == 1))
- + {
- + player.sendMessage("The buffer cannot be used in duells or pvp.");
- + return;
- + }
- +
- + else if (AttackStanceTaskManager.getInstance().hasAttackStanceTask(player))
- + {
- + player.sendMessage("The buffer cannot be used while in combat.");
- + return;
- + }
- +
- + BufferData.Buffer buffer = determineBuffer(npc, player);
- + if (buffer == null)
- + {
- + // not an authorized npc or npc is null and voiced buffer is disabled
- + return;
- + }
- +
- + if ((command == null) || command.isEmpty())
- + {
- + command = "html main";
- + }
- +
- + if (command.startsWith("html "))
- + {
- + executeHtmlCommand(player, buffer, npc, command.substring(5));
- + }
- + else
- + {
- + if (command.startsWith("target "))
- + {
- + executeTargetCommand(player, buffer, command.substring(7));
- + }
- + else if (command.startsWith("unique "))
- + {
- + executeUniqueCommand(player, buffer, command.substring(7));
- + }
- +
- + // display last html again
- + // since somebody could use the chat as a command line(eg.: .buffer target player heal), we check if the player has opened a html before
- + String lastHtmlCommand = _LAST_PLAYER_HTMLS.get(player.getObjectId());
- + if (lastHtmlCommand != null)
- + {
- + executeHtmlCommand(player, buffer, npc, _LAST_PLAYER_HTMLS.get(player.getObjectId()));
- + }
- + }
- + }
- +}
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/XMLUtils.java
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/XMLUtils.java (date 1601235047018)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/XMLUtils.java (date 1601235047018)
- @@ -0,0 +1,45 @@
- +/*
- + * This file is part of YANModPack: https://github.com/HorridoJoho/YANModPack
- + * Copyright (C) 2015 Christian Buck
- + *
- + * 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 custom.Buffer.util;
- +
- +import java.io.IOException;
- +import java.nio.file.Path;
- +
- +import javax.xml.parsers.DocumentBuilderFactory;
- +import javax.xml.parsers.ParserConfigurationException;
- +
- +import org.w3c.dom.Document;
- +import org.xml.sax.SAXException;
- +
- +/**
- + * @author HorridoJoho
- + */
- +public class XMLUtils
- +{
- + public static Document CreateDocument(Path xml, Path xsd) throws SAXException, IOException, ParserConfigurationException
- + {
- + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- + factory.setValidating(true);
- + factory.setNamespaceAware(true);
- + factory.setIgnoringComments(true);
- + factory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
- + if (xsd != null)
- + factory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaSource", xsd.toString());
- + return factory.newDocumentBuilder().parse(xml.toString());
- + }
- +}
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/ItemRequirement.java
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/ItemRequirement.java (date 1601235047012)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/ItemRequirement.java (date 1601235047012)
- @@ -0,0 +1,43 @@
- +/*
- + * This file is part of YANModPack: https://github.com/HorridoJoho/YANModPack
- + * Copyright (C) 2015 Christian Buck
- + *
- + * 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 custom.Buffer.util;
- +
- +import custom.Buffer.util.htmltmpls.HTMLTemplatePlaceholder;
- +
- +import org.l2jmobius.gameserver.model.items.Item;
- +
- +/**
- + * @author HorridoJoho
- + */
- +public final class ItemRequirement
- +{
- + /** Item id */
- + public final Item item;
- + /** Item amount */
- + public final long amount;
- + /** HTMLTemplatePlaceholder */
- + public final HTMLTemplatePlaceholder placeholder;
- +
- + public ItemRequirement(final Item item, final long amount)
- + {
- + this.item = item;
- + this.amount = amount;
- + this.placeholder = new HTMLTemplatePlaceholder("item_requirement", null);
- + this.placeholder.addChild("id", String.valueOf(item.getId())).addChild("icon", item.getIcon()).addChild("name", item.getName()).addChild("amount", String.valueOf(amount));
- + }
- +}
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/htmltmpls/HTMLTemplateUtils.java
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/htmltmpls/HTMLTemplateUtils.java (date 1601235047008)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/htmltmpls/HTMLTemplateUtils.java (date 1601235047008)
- @@ -0,0 +1,151 @@
- +/*
- + * This file is part of YANModPack: https://github.com/HorridoJoho/YANModPack
- + * Copyright (C) 2015 Christian Buck
- + *
- + * 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 custom.Buffer.util.htmltmpls;
- +
- +import java.util.Map;
- +import java.util.regex.Pattern;
- +
- +/**
- + * @author HorridoJoho
- + */
- +public final class HTMLTemplateUtils
- +{
- + public static int findSequenceEnd(StringBuilder string, int startOffset, HTMLTemplateFunc func)
- + {
- + int dept = 0;
- + String seqStart = func.getSequenceStart();
- + String seqEnd = func.getSequenceEnd();
- + String escapedSeqStart = "\\" + seqStart;
- + String escapedSeqEnd = "\\" + seqEnd;
- +
- + while (true)
- + {
- + int endSeqOffset = string.indexOf(seqEnd, startOffset);
- + if (endSeqOffset == -1)
- + {
- + return -1; // there is no sequence end to find
- + }
- +
- + int escapedSeqStartOffset = string.indexOf(escapedSeqStart, startOffset);
- + int escapedSeqEndOffset = string.indexOf(escapedSeqEnd, startOffset);
- + int startSeqOffset = string.indexOf(seqStart, startOffset);
- +
- + if (((endSeqOffset < startSeqOffset) || (startSeqOffset == -1)) && ((endSeqOffset < escapedSeqStartOffset) || (escapedSeqStartOffset == -1)) && ((endSeqOffset < escapedSeqEndOffset) || (escapedSeqEndOffset == -1)))
- + {
- + if (dept == 0)
- + {
- + return endSeqOffset + seqEnd.length();
- + }
- +
- + --dept;
- + startOffset = endSeqOffset + seqEnd.length();
- + }
- + else if ((startSeqOffset != -1) && (startSeqOffset < endSeqOffset) && ((startSeqOffset < escapedSeqStartOffset) || (escapedSeqStartOffset == -1)) && ((startSeqOffset < escapedSeqEndOffset) || (escapedSeqEndOffset == -1)))
- + {
- + startOffset = startSeqOffset + seqStart.length();
- + ++dept;
- + }
- + else if ((escapedSeqStartOffset != -1) && ((escapedSeqStartOffset < escapedSeqEndOffset) || (escapedSeqEndOffset == -1)))
- + {
- + startOffset += escapedSeqStartOffset + escapedSeqStart.length();
- + }
- + else if ((escapedSeqEndOffset != -1) && ((escapedSeqEndOffset < escapedSeqStartOffset) || (escapedSeqStartOffset != -1)))
- + {
- + startOffset += escapedSeqEndOffset + escapedSeqEnd.length();
- + }
- + }
- + }
- +
- + /**
- + * Searches the placeholder specified by placeholderString inside the placeholders map
- + * @param placeholderString placeholder to search for
- + * @param placeholders map with the placeholders available
- + * @return the placeholder if found, null otherwise
- + */
- + public static HTMLTemplatePlaceholder getPlaceholder(String placeholderString, Map<String, HTMLTemplatePlaceholder> placeholders)
- + {
- + if (placeholders == null)
- + {
- + return null;
- + }
- +
- + String[] placeholderParts = placeholderString.split(Pattern.quote("."));
- + HTMLTemplatePlaceholder placeholder = null;
- + for (String placeholderPart : placeholderParts)
- + {
- + if (placeholder == null)
- + {
- + placeholder = placeholders.get(placeholderPart);
- + if (placeholder == null)
- + {
- + break;
- + }
- + }
- + else
- + {
- + placeholder = placeholder.getChild(placeholderPart);
- + if (placeholder == null)
- + {
- + break;
- + }
- + }
- + }
- + return placeholder;
- + }
- +
- + /**
- + * Get the value of the placeholder specified by placeholderString
- + * @param placeholderString the placeholder to get the value from
- + * @param placeholders placeholder map to search in
- + * @return the value of the found placeholder
- + * @throws Exception the placeholder was not found or the value is null
- + */
- + public static String getPlaceholderValue(String placeholderString, Map<String, HTMLTemplatePlaceholder> placeholders) throws Exception
- + {
- + HTMLTemplatePlaceholder placeholder = getPlaceholder(placeholderString, placeholders);
- + if (placeholder == null)
- + {
- + throw new Exception();
- + }
- +
- + String value = placeholder.getValue();
- + if (value == null)
- + {
- + throw new Exception();
- + }
- +
- + return value;
- + }
- +
- + /**
- + * Get the childs of the placeholder specified by placeholderString in an unmodifyable map
- + * @param placeholderString the placeholder to get the childs from
- + * @param placeholders placeholder map to search in
- + * @return the childs in an unmodifyable map of the found placeholder
- + * @throws Exception the placeholder was not found
- + */
- + public static Map<String, HTMLTemplatePlaceholder> getPlaceholderChilds(String placeholderString, Map<String, HTMLTemplatePlaceholder> placeholders) throws Exception
- + {
- + HTMLTemplatePlaceholder placeholder = getPlaceholder(placeholderString, placeholders);
- + if (placeholder == null)
- + {
- + throw new Exception();
- + }
- + return placeholder.getChilds();
- + }
- +}
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/htmltmpls/HTMLTemplatePlaceholder.java
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/htmltmpls/HTMLTemplatePlaceholder.java (date 1601235047004)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/htmltmpls/HTMLTemplatePlaceholder.java (date 1601235047004)
- @@ -0,0 +1,139 @@
- +/*
- + * This file is part of YANModPack: https://github.com/HorridoJoho/YANModPack
- + * Copyright (C) 2015 Christian Buck
- + *
- + * 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 custom.Buffer.util.htmltmpls;
- +
- +import java.util.Collections;
- +import java.util.LinkedHashMap;
- +import java.util.Map;
- +
- +/**
- + * This is the class for the buildin value placeholders.<br>
- + * It has a name, a value and can contain child placeholders.<br>
- + * To reference the value of a placeholder in a template document<br>
- + * you use <b>%placeholder_name%</b>. To reference the value of a child<br>
- + * placeholder you use <b>%placeholder_name.child_placeholder_name%.</b>
- + * @author HorridoJoho
- + */
- +public final class HTMLTemplatePlaceholder
- +{
- + /** the name of this placeholder */
- + private final String _name;
- + /** the value of this placeholder */
- + private volatile String _value;
- + /** the child placeholders of this placeholder */
- + private final Map<String, HTMLTemplatePlaceholder> _childs;
- +
- + /**
- + * Public constructor to create a new placeholder
- + * @param name the name of the new placeholder
- + * @param value the value of the new placeholder
- + */
- + public HTMLTemplatePlaceholder(String name, String value)
- + {
- + this(name, value, new LinkedHashMap<String, HTMLTemplatePlaceholder>());
- + }
- +
- + /**
- + * Private constructor to create alias placeholders of other placeholders
- + * @param name the name of the alias placeholder
- + * @param value the value of the alias placeholder
- + * @param childs the childs of the alias placeholder
- + */
- + private HTMLTemplatePlaceholder(String name, String value, Map<String, HTMLTemplatePlaceholder> childs)
- + {
- + _name = name;
- + _value = value;
- + _childs = childs;
- + }
- +
- + /**
- + * Creates an alias for this placeholder.<br>
- + * An alias placeholder will hold the reference to the childs map from the original placeholder. This means, adding a new child to the alias will also add the child to the original placeholder and vice versa.
- + * @param name name of the alias placeholder
- + * @return the newly created alias placeholder
- + */
- + public HTMLTemplatePlaceholder createAlias(String name)
- + {
- + return new HTMLTemplatePlaceholder(name, _value, _childs);
- + }
- +
- + /**
- + * Adds a child placeholder to this placeholder.
- + * @param name the name of the new child placeholder
- + * @param value the value of the new child placeholder
- + * @return this placeholder
- + */
- + public HTMLTemplatePlaceholder addChild(String name, String value)
- + {
- + _childs.put(name, new HTMLTemplatePlaceholder(name, value));
- + return this;
- + }
- +
- + public HTMLTemplatePlaceholder addAliasChild(String aliasName, HTMLTemplatePlaceholder placeholder)
- + {
- + _childs.put(aliasName, placeholder.createAlias(aliasName));
- + return this;
- + }
- +
- + public void setValue(String value)
- + {
- + _value = value;
- + }
- +
- + /**
- + * @return the name of this placeholder
- + */
- + public String getName()
- + {
- + return _name;
- + }
- +
- + /**
- + * @return the value of this placeholder
- + */
- + public String getValue()
- + {
- + return _value;
- + }
- +
- + /**
- + * Method to get a child placeholder of this placeholder by name
- + * @param name the name of the child placeholder to find
- + * @return the child placeholder
- + */
- + public HTMLTemplatePlaceholder getChild(String name)
- + {
- + return HTMLTemplateUtils.getPlaceholder(name, _childs);
- + }
- +
- + /**
- + * @return the child placeholder map of this placeholder as unmodifyable map
- + */
- + public Map<String, HTMLTemplatePlaceholder> getChilds()
- + {
- + return Collections.unmodifiableMap(_childs);
- + }
- +
- + /**
- + * @return the count of child placeholders in this placeholder
- + */
- + public int getChildsSize()
- + {
- + return _childs.size();
- + }
- +}
- \ No newline at end of file
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/htmltmpls/HTMLTemplateParser.java
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/htmltmpls/HTMLTemplateParser.java (date 1601235046998)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/htmltmpls/HTMLTemplateParser.java (date 1601235046998)
- @@ -0,0 +1,187 @@
- +/*
- + * This file is part of YANModPack: https://github.com/HorridoJoho/YANModPack
- + * Copyright (C) 2015 Christian Buck
- + *
- + * 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 custom.Buffer.util.htmltmpls;
- +
- +import java.util.Collections;
- +import java.util.HashMap;
- +import java.util.Map;
- +import java.util.Map.Entry;
- +import java.util.regex.Matcher;
- +import java.util.regex.Pattern;
- +
- +import org.l2jmobius.gameserver.cache.HtmCache;
- +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
- +
- +/**
- + * @author HorridoJoho
- + */
- +public final class HTMLTemplateParser
- +{
- + /** pattern to find placeholder references */
- + private static final Pattern _PLACEHOLDER_PATTERN = Pattern.compile("%[a-zA-Z_][a-zA-Z0-9_]*(\\.[a-zA-Z_][a-zA-Z0-9_]*)*%");
- +
- + public static String fromCache(String path, Map<String, HTMLTemplatePlaceholder> placeholders, HTMLTemplateFunc... funcs)
- + {
- + return fromCache(path, null, placeholders, funcs);
- + }
- +
- + public static String fromCache(String path, PlayerInstance player, Map<String, HTMLTemplatePlaceholder> placeholders, HTMLTemplateFunc... funcs)
- + {
- + String string = HtmCache.getInstance().getHtm(player, path);
- + if (string == null)
- + return null;
- + StringBuilder builder = new StringBuilder(string);
- + fromStringBuilder(builder, player, placeholders, funcs);
- + return builder.toString();
- + }
- +
- + /**
- + * Method to process a template. The string is directly modifyed and will contain the results of the template processing.
- + * @param string the template content
- + * @param player the player the template is processed for
- + * @param placeholders a map of placeholders(map has to be modifyable)
- + * @param funcs the functions to use while processing the template
- + */
- + public static void fromStringBuilder(StringBuilder string, PlayerInstance player, Map<String, HTMLTemplatePlaceholder> placeholders, HTMLTemplateFunc... funcs)
- + {
- + // System.out.println("fromStringBuilder(" + string + ") {");
- + if (string == null)
- + return;
- +
- + int indexOfOffset = 0;
- +
- + while (indexOfOffset < string.length() - 1)
- + {
- + // System.out.println("-------------------------------------------");
- + // System.out.println("indexOfOffset=" + indexOfOffset);
- + // find the first position of a placeholder or a custom func
- + Matcher placeholderMatcher = _PLACEHOLDER_PATTERN.matcher(string);
- + int nextFuncStartOffset = -1;
- + int nextFuncEndOffset = -1;
- + if (placeholderMatcher.find(indexOfOffset))
- + {
- + nextFuncStartOffset = placeholderMatcher.start();
- + nextFuncEndOffset = placeholderMatcher.end();
- + }
- +
- + HTMLTemplateFunc nextFunc = null;
- + for (HTMLTemplateFunc func : funcs)
- + {
- + int funcOffset = string.indexOf(func.getSequenceStart(), indexOfOffset);
- + if (funcOffset > -1 && (nextFuncStartOffset == -1 || funcOffset < nextFuncStartOffset))
- + {
- + nextFuncStartOffset = funcOffset;
- + nextFuncEndOffset = HTMLTemplateUtils.findSequenceEnd(string, nextFuncStartOffset + func.getSequenceStart().length(), func);
- + nextFunc = func;
- + }
- + }
- +
- + // System.out.println("nextFuncStartOffset=" + nextFuncStartOffset + "\nnextFuncEndOffset=" + nextFuncEndOffset + "\nfunc?" + (nextFunc != null));
- +
- + if (nextFuncStartOffset == -1)
- + {
- + break;
- + }
- + else if (nextFunc == null)
- + {
- + String placeholderString = placeholderMatcher.group().substring(1, placeholderMatcher.group().length() - 1);
- + // System.out.println("Placeholder: " + placeholderString);
- + HTMLTemplatePlaceholder placeholder = HTMLTemplateUtils.getPlaceholder(placeholderString, placeholders);
- +
- + if (placeholder != null)
- + {
- + // System.out.println("Value: " + placeholder.getValue());
- + string.replace(nextFuncStartOffset, nextFuncEndOffset, placeholder.getValue());
- + // 2 !!! placeholder replacement can contain more placeholders and func sequences start so we set the index to search to the start of the placeholder
- + indexOfOffset = nextFuncStartOffset;
- + }
- + else
- + // skip placeholder?
- + {
- + // if placeholder can not be found, just remove it from the string
- + // 1 <<< string.delete(nextFuncStartOffset, nextFuncEndOffset);
- +
- + // 2 !!! l2j compatible mode, we don't want to manually add things like %objectId% placeholders all the time
- + indexOfOffset += placeholderMatcher.end() - placeholderMatcher.start();
- + }
- +
- + // placeholder replacement can contain more placeholders and func sequences start so we set the index to search to the start of the placeholder
- + // 1 <<< indexOfOffset = nextFuncStartOffset;
- + }
- + else
- + {
- + if (nextFuncEndOffset == -1)
- + {
- + // this is to ignore the starting sequnces which have no ending sequence
- + ++indexOfOffset;
- + }
- + else
- + {
- + // System.out.println("Func: " + nextFunc.getClass().getName());
- +
- + StringBuilder content = new StringBuilder(string.subSequence(nextFuncStartOffset + nextFunc.getSequenceStart().length(), nextFuncEndOffset - nextFunc.getSequenceEnd().length()));
- +
- + // the func needs preprocessing?
- + if (nextFunc.requiresPreprocessing())
- + {
- + fromStringBuilder(content, player, placeholders, funcs);
- + }
- +
- + Map<String, HTMLTemplatePlaceholder> tmpPlaceholders = nextFunc.handle(content, player, placeholders == null ? null : Collections.unmodifiableMap(placeholders), funcs);
- +
- + // add new entries and replace entries(temp)
- + if (tmpPlaceholders != null)
- + {
- + for (HTMLTemplatePlaceholder newPlaceholder : tmpPlaceholders.values())
- + {
- + if (placeholders == null)
- + {
- + placeholders = new HashMap<>();
- + }
- + tmpPlaceholders.put(newPlaceholder.getName(), placeholders.put(newPlaceholder.getName(), newPlaceholder));
- + }
- + }
- +
- + fromStringBuilder(content, player, placeholders, funcs);
- + string.replace(nextFuncStartOffset, nextFuncEndOffset, content.toString());
- +
- + // remove entries which were new and restore old entries
- + if (tmpPlaceholders != null && placeholders != null)
- + {
- + for (Entry<String, HTMLTemplatePlaceholder> oldPlaceholder : tmpPlaceholders.entrySet())
- + {
- + if (oldPlaceholder.getValue() == null)
- + {
- + placeholders.remove(oldPlaceholder.getKey());
- + }
- + else
- + {
- + placeholders.put(oldPlaceholder.getKey(), oldPlaceholder.getValue());
- + }
- + }
- + }
- +
- + // set the current offset to the next func sequence start found, replaced content can contain more placeholders and funcs
- + indexOfOffset = nextFuncStartOffset;
- + }
- + }
- + }
- +
- + // System.out.println("}");
- + }
- +}
- \ No newline at end of file
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/htmltmpls/HTMLTemplateFunc.java
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/htmltmpls/HTMLTemplateFunc.java (date 1601235046992)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/htmltmpls/HTMLTemplateFunc.java (date 1601235046992)
- @@ -0,0 +1,91 @@
- +/*
- + * This file is part of YANModPack: https://github.com/HorridoJoho/YANModPack
- + * Copyright (C) 2015 Christian Buck
- + *
- + * 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 custom.Buffer.util.htmltmpls;
- +
- +import java.util.Map;
- +
- +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
- +
- +/**
- + * This class represents a template function.<br>
- + * It has a sequence start and end.<br>
- + * ----- Example -----<br>
- + * -- startSequence = "INC"<br>
- + * -- endSequence = "ENDINC"<br>
- + * We have a template file template.tmpl: [INC(template2.tmpl)ENDINC]<br>
- + * Now when the handlers {@link #handle(StringBuilder, PlayerInstance, Map, HTMLTemplateFunc[])} method is called, contents will contain "template2.tmpl"<br>
- + * @author HorridoJoho
- + */
- +public abstract class HTMLTemplateFunc
- +{
- + /** how the function sequence starts */
- + private final String _sequenceStart;
- + /** how the function sequence ends */
- + private final String _sequenceEnd;
- + /** flag to determine if the template function needs processing of it's contents before contents are passed to the {@link #handle(StringBuilder, PlayerInstance, Map, HTMLTemplateFunc[])} method */
- + private final boolean _requiresPreprocessing;
- +
- + /**
- + * Protected constructor for template function implementations. In a template document
- + * @param sequenceStart how the template function sequence starts (in a template document you use [sequenceStart(
- + * @param sequenceEnd how the template function sequence starts (in a template document you use )sequenceEnd]
- + * @param requiresPreprocessing flag to determine if the template function needs processing of it's contents before contents are passed to the {@link #handle(StringBuilder, PlayerInstance, Map, HTMLTemplateFunc[])}
- + */
- + protected HTMLTemplateFunc(String sequenceStart, String sequenceEnd, boolean requiresPreprocessing)
- + {
- + _sequenceStart = "[" + sequenceStart + "(";
- + _sequenceEnd = ")" + sequenceEnd + "]";
- + _requiresPreprocessing = requiresPreprocessing;
- + }
- +
- + /**
- + * @return the sequence this function starts with in a template document
- + */
- + public final String getSequenceStart()
- + {
- + return _sequenceStart;
- + }
- +
- + /**
- + * @return the sequence this function ends with in a template document
- + */
- + public final String getSequenceEnd()
- + {
- + return _sequenceEnd;
- + }
- +
- + /**
- + * @return true when the handler needs the contents preprocessed by the template engine before it is passed to the {@link #handle(StringBuilder, PlayerInstance, Map, HTMLTemplateFunc[])} metod, false otherwise
- + */
- + public final boolean requiresPreprocessing()
- + {
- + return _requiresPreprocessing;
- + }
- +
- + /**
- + * Called by template parser to give the function the possibility to<br>
- + * create new placeholders and modify the contents of the function<br>
- + * in the template document.
- + * @param content the content which can be modified by the handler
- + * @param player the player the template is processed for
- + * @param placeholders the currently avilable placeholders as unmodifyable map
- + * @param funcs supported functions the template is parsed with
- + * @return placeholder to add to the currently available placeholders, added before the content is processed after this call, and removed again after content processing
- + */
- + public abstract Map<String, HTMLTemplatePlaceholder> handle(StringBuilder content, PlayerInstance player, Map<String, HTMLTemplatePlaceholder> placeholders, HTMLTemplateFunc[] funcs);
- +}
- \ No newline at end of file
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/htmltmpls/funcs/IncludeFunc.java
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/htmltmpls/funcs/IncludeFunc.java (date 1601235046987)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/htmltmpls/funcs/IncludeFunc.java (date 1601235046987)
- @@ -0,0 +1,54 @@
- +/*
- + * This file is part of YANModPack: https://github.com/HorridoJoho/YANModPack
- + * Copyright (C) 2015 Christian Buck
- + *
- + * 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 custom.Buffer.util.htmltmpls.funcs;
- +
- +import java.util.HashMap;
- +import java.util.Map;
- +
- +import custom.Buffer.util.htmltmpls.HTMLTemplateFunc;
- +import custom.Buffer.util.htmltmpls.HTMLTemplatePlaceholder;
- +
- +import org.l2jmobius.gameserver.cache.HtmCache;
- +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
- +
- +/**
- + * @author HorridoJoho
- + */
- +public final class IncludeFunc extends HTMLTemplateFunc
- +{
- + public static final IncludeFunc INSTANCE = new IncludeFunc();
- +
- + private IncludeFunc()
- + {
- + super("INC", "ENDINC", true);
- + }
- +
- + @Override
- + public HashMap<String, HTMLTemplatePlaceholder> handle(StringBuilder content, PlayerInstance player, Map<String, HTMLTemplatePlaceholder> placeholders, HTMLTemplateFunc[] funcs)
- + {
- + String fileContent = HtmCache.getInstance().getHtm(player, content.toString());
- + if (fileContent != null)
- + {
- + content.ensureCapacity(fileContent.length());
- + content.setLength(0);
- + content.append(fileContent);
- + }
- +
- + return null;
- + }
- +}
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/htmltmpls/funcs/IfFunc.java
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/htmltmpls/funcs/IfFunc.java (date 1601235046983)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/htmltmpls/funcs/IfFunc.java (date 1601235046983)
- @@ -0,0 +1,147 @@
- +/*
- + * This file is part of YANModPack: https://github.com/HorridoJoho/YANModPack
- + * Copyright (C) 2015 Christian Buck
- + *
- + * 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 custom.Buffer.util.htmltmpls.funcs;
- +
- +import java.util.HashMap;
- +import java.util.Map;
- +import java.util.regex.Matcher;
- +import java.util.regex.Pattern;
- +
- +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
- +
- +import custom.Buffer.util.htmltmpls.HTMLTemplateFunc;
- +import custom.Buffer.util.htmltmpls.HTMLTemplatePlaceholder;
- +import custom.Buffer.util.htmltmpls.HTMLTemplateUtils;
- +
- +/**
- + * This class implements the following function syntax:<br>
- + * [IF(placeholder_name == "text in string" THEN text when the condition matches)ENDIF]<br>
- + * [IF(placeholder_name == another_placeholder_name THEN text when the condition matches)ENDIF]<br>
- + * [IF(int_placeholder_name > another_int_placeholder_name THEN text when the condition matches)ENDIF]<br>
- + * <br>
- + * First is always a placeholder name.<br>
- + * <br>
- + * Second comes one of the following operators:<br>
- + * <, >, <=, >=, !=, ==, STARTS_WITH or ENDS_WITH, where <, >, <= and >= are only to be used with placeholders/strings<br>
- + * which have a numeric value.<br>
- + * <br>
- + * Third comes either a placeholder name or a string("text in string").<br>
- + * <br>
- + * After the "THEN" word comes the text to place in the content when the condition is met.
- + * @author HorridoJoho
- + */
- +public final class IfFunc extends HTMLTemplateFunc
- +{
- + public static final IfFunc INSTANCE = new IfFunc();
- +
- + private static final Pattern _LVALUE_PATTERN = Pattern.compile("\\s*[a-zA-Z_][a-zA-Z0-9_]*(\\.[a-zA-Z_][a-zA-Z0-9_]*)*");
- + private static final Pattern _OP_PATTERN = Pattern.compile("\\s*(<|>|<=|>=|==|!=|\\sENDS_WITH\\s|\\sSTARTS_WITH\\s)\\s*");
- + private static final Pattern _RVALUE_PATTERN = Pattern.compile("([a-zA-Z_][a-zA-Z0-9_]*(\\.[a-zA-Z_][a-zA-Z0-9_]*)*|\"(\\\\.|\\\\\\s|\\s|[^\\\\\"])*\")");
- + private static final Pattern _THEN_PATTERN = Pattern.compile("\\s*\\sTHEN\\s");
- +
- + private static Matcher _getMatcher(Pattern pattern, StringBuilder content, int findIndex) throws Exception
- + {
- + Matcher m = pattern.matcher(content);
- + if (!m.find(findIndex) || m.start() > findIndex)
- + throw new Exception();
- +
- + return m;
- + }
- +
- + private IfFunc()
- + {
- + super("IF", "ENDIF", false);
- + }
- +
- + @Override
- + public HashMap<String, HTMLTemplatePlaceholder> handle(StringBuilder content, PlayerInstance player, Map<String, HTMLTemplatePlaceholder> placeholders, HTMLTemplateFunc[] funcs)
- + {
- + try
- + {
- + Matcher matcher = _getMatcher(_LVALUE_PATTERN, content, 0);
- + String lValue = HTMLTemplateUtils.getPlaceholderValue(matcher.group().trim(), placeholders);
- + int findIndex = matcher.end();
- +
- + matcher = _getMatcher(_OP_PATTERN, content, findIndex);
- + String op = matcher.group().trim();
- + findIndex = matcher.end();
- +
- + matcher = _getMatcher(_RVALUE_PATTERN, content, findIndex);
- + String rValue = matcher.group();
- + if (rValue.charAt(0) == '"')
- + {
- + rValue = rValue.substring(1, rValue.length() - 1);
- + }
- + else
- + {
- + rValue = HTMLTemplateUtils.getPlaceholderValue(rValue, placeholders);
- + }
- + findIndex = matcher.end();
- +
- + matcher = _getMatcher(_THEN_PATTERN, content, findIndex);
- + findIndex = matcher.end();
- +
- + boolean ok = false;
- + switch (op)
- + {
- + case "<":
- + ok = Integer.parseInt(lValue) < Integer.parseInt(rValue);
- + break;
- + case ">":
- + ok = Integer.parseInt(lValue) > Integer.parseInt(rValue);
- + break;
- + case "<=":
- + ok = Integer.parseInt(lValue) <= Integer.parseInt(rValue);
- + break;
- + case ">=":
- + ok = Integer.parseInt(lValue) >= Integer.parseInt(rValue);
- + break;
- + case "==":
- + ok = lValue.equals(rValue);
- + break;
- + case "!=":
- + ok = !lValue.equals(rValue);
- + break;
- + case "ENDS_WITH":
- + ok = lValue.endsWith(rValue);
- + break;
- + case "STARTS_WITH":
- + ok = lValue.startsWith(rValue);
- + break;
- + }
- +
- + if (ok)
- + {
- + // this ensures only the replacement content is left
- + content.delete(0, findIndex);
- + }
- + else
- + {
- + // condition is not met, no content to show
- + content.setLength(0);
- + return null;
- + }
- + }
- + catch (Exception e)
- + {
- + content.setLength(0);
- + }
- +
- + return null;
- + }
- +}
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/htmltmpls/funcs/IfChildsFunc.java
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/htmltmpls/funcs/IfChildsFunc.java (date 1601235046979)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/htmltmpls/funcs/IfChildsFunc.java (date 1601235046979)
- @@ -0,0 +1,155 @@
- +/*
- + * This file is part of YANModPack: https://github.com/HorridoJoho/YANModPack
- + * Copyright (C) 2015 Christian Buck
- + *
- + * 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 custom.Buffer.util.htmltmpls.funcs;
- +
- +import java.util.HashMap;
- +import java.util.Map;
- +import java.util.Map.Entry;
- +import java.util.regex.Matcher;
- +import java.util.regex.Pattern;
- +
- +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
- +
- +import custom.Buffer.util.htmltmpls.HTMLTemplateFunc;
- +import custom.Buffer.util.htmltmpls.HTMLTemplatePlaceholder;
- +import custom.Buffer.util.htmltmpls.HTMLTemplateUtils;
- +
- +/**
- + * @author HorridoJoho
- + */
- +public final class IfChildsFunc extends HTMLTemplateFunc
- +{
- + public static final IfChildsFunc INSTANCE = new IfChildsFunc();
- +
- + private static final Pattern _CHILDS_OF_PLACEHOLDER_PATTERN = Pattern.compile("\\s*[a-zA-Z_][a-zA-Z0-9_]*(\\.[a-zA-Z_][a-zA-Z0-9_]*)*\\s*,");
- + private static final Pattern _CHILD_PLACEHOLDER_PATTERN = Pattern.compile("\\s*[a-zA-Z_][a-zA-Z0-9_]*(\\.[a-zA-Z_][a-zA-Z0-9_]*)*");
- + private static final Pattern _OP_PATTERN = Pattern.compile("\\s*(<|>|<=|>=|==|!=|\\sENDS_WITH\\s|\\sSTARTS_WITH\\s)\\s*");
- + private static final Pattern _RVALUE_PATTERN = Pattern.compile("([a-zA-Z_][a-zA-Z0-9_]*(\\.[a-zA-Z_][a-zA-Z0-9_]*)*|\"(\\\\.|\\\\\\s|\\s|[^\\\\\"])*\")");
- + private static final Pattern _THEN_PATTERN = Pattern.compile("\\s*\\sTHEN\\s");
- +
- + private static Matcher _getMatcher(Pattern pattern, StringBuilder content, int findIndex) throws Exception
- + {
- + Matcher m = pattern.matcher(content);
- + if (!m.find(findIndex) || m.start() > findIndex)
- + throw new Exception();
- +
- + return m;
- + }
- +
- + private IfChildsFunc()
- + {
- + super("IFCHILDS", "ENDIFCHILDS", false);
- + }
- +
- + @Override
- + public HashMap<String, HTMLTemplatePlaceholder> handle(StringBuilder content, PlayerInstance player, Map<String, HTMLTemplatePlaceholder> placeholders, HTMLTemplateFunc[] funcs)
- + {
- + try
- + {
- + Matcher matcher = _getMatcher(_CHILDS_OF_PLACEHOLDER_PATTERN, content, 0);
- + String childsPlaceholderString = matcher.group().substring(0, matcher.group().length() - 1);
- + HTMLTemplatePlaceholder childsPlaceholder = HTMLTemplateUtils.getPlaceholder(childsPlaceholderString, placeholders);
- + if (childsPlaceholder == null)
- + {
- + content.setLength(0);
- + return null;
- + }
- +
- + matcher = _getMatcher(_CHILD_PLACEHOLDER_PATTERN, content, matcher.end());
- + String childPlaceholderString = matcher.group().trim();
- + int findIndex = matcher.end();
- +
- + matcher = _getMatcher(_OP_PATTERN, content, findIndex);
- + String op = matcher.group().trim();
- + findIndex = matcher.end();
- +
- + matcher = _getMatcher(_RVALUE_PATTERN, content, findIndex);
- + String rValue = matcher.group();
- + if (rValue.charAt(0) == '"')
- + {
- + rValue = rValue.substring(1, rValue.length() - 1);
- + }
- + else
- + {
- + rValue = HTMLTemplateUtils.getPlaceholderValue(rValue, placeholders);
- + }
- + findIndex = matcher.end();
- +
- + matcher = _getMatcher(_THEN_PATTERN, content, findIndex);
- + findIndex = matcher.end();
- +
- + for (Entry<String, HTMLTemplatePlaceholder> entry : childsPlaceholder.getChilds().entrySet())
- + {
- + HTMLTemplatePlaceholder childPlaceholder = entry.getValue().getChild(childPlaceholderString);
- + if (childPlaceholder == null)
- + continue;
- +
- + try
- + {
- + boolean ok = false;
- + switch (op)
- + {
- + case "<":
- + ok = Integer.parseInt(childPlaceholder.getValue()) < Integer.parseInt(rValue);
- + break;
- + case ">":
- + ok = Integer.parseInt(childPlaceholder.getValue()) > Integer.parseInt(rValue);
- + break;
- + case "<=":
- + ok = Integer.parseInt(childPlaceholder.getValue()) <= Integer.parseInt(rValue);
- + break;
- + case ">=":
- + ok = Integer.parseInt(childPlaceholder.getValue()) >= Integer.parseInt(rValue);
- + break;
- + case "==":
- + ok = childPlaceholder.getValue().equals(rValue);
- + break;
- + case "!=":
- + ok = !childPlaceholder.getValue().equals(rValue);
- + break;
- + case "ENDS_WITH":
- + ok = childPlaceholder.getValue().endsWith(rValue);
- + break;
- + case "STARTS_WITH":
- + ok = childPlaceholder.getValue().startsWith(rValue);
- + break;
- + }
- +
- + if (!ok)
- + {
- + // condition is not met, no content to show
- + content.setLength(0);
- + return null;
- + }
- + }
- + catch (Exception e)
- + {
- + // on an exception the types are incompatible with the operator, this function ignores such cases
- + }
- + }
- +
- + content.delete(0, findIndex);
- + }
- + catch (Exception e)
- + {
- + content.setLength(0);
- + }
- +
- + return null;
- + }
- +}
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/htmltmpls/funcs/ForeachFunc.java
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/htmltmpls/funcs/ForeachFunc.java (date 1601235046974)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/htmltmpls/funcs/ForeachFunc.java (date 1601235046974)
- @@ -0,0 +1,107 @@
- +/*
- + * This file is part of YANModPack: https://github.com/HorridoJoho/YANModPack
- + * Copyright (C) 2015 Christian Buck
- + *
- + * 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 custom.Buffer.util.htmltmpls.funcs;
- +
- +import java.util.HashMap;
- +import java.util.Map;
- +import java.util.Map.Entry;
- +import java.util.regex.Matcher;
- +import java.util.regex.Pattern;
- +
- +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
- +
- +import custom.Buffer.util.htmltmpls.HTMLTemplateFunc;
- +import custom.Buffer.util.htmltmpls.HTMLTemplateParser;
- +import custom.Buffer.util.htmltmpls.HTMLTemplatePlaceholder;
- +import custom.Buffer.util.htmltmpls.HTMLTemplateUtils;
- +
- +/**
- + * This class implements the following function syntax:<br>
- + * [FOREACH(alias_placeholder_name IN placeholder_name DO text per iteration)ENDEACH]<br>
- + * <br>
- + * This construct is able to iterate over the childs of the "placeholder_name" placeholder.<br>
- + * For each child in this placeholder, the text after "DO" is placed in the content.<br>
- + * The current child is placed as an alias toplevel placeholder. This means, in this example<br>
- + * you can use %alias_placeholder_name% inside the foreach block.
- + * @author HorridoJoho
- + */
- +public final class ForeachFunc extends HTMLTemplateFunc
- +{
- + public static final ForeachFunc INSTANCE = new ForeachFunc();
- +
- + private static final Pattern _FIRST_PLACEHOLDER_PATTERN = Pattern.compile("\\s*[a-zA-Z_][a-zA-Z0-9_]*(\\.[a-zA-Z_][a-zA-Z0-9_]*)*");
- + private static final Pattern _IN_PATTERN = Pattern.compile("\\s*\\sIN\\s");
- + private static final Pattern _SECOND_PLACEHOLDER_PATTERN = Pattern.compile("\\s*[a-zA-Z_][a-zA-Z0-9_]*(\\.[a-zA-Z_][a-zA-Z0-9_]*)*");
- + private static final Pattern _DO_PATTERN = Pattern.compile("\\s*\\sDO\\s");
- +
- + private static Matcher _getMatcher(Pattern pattern, StringBuilder content, int findIndex) throws Exception
- + {
- + Matcher m = pattern.matcher(content);
- + if (!m.find(findIndex) || m.start() > findIndex)
- + throw new Exception();
- +
- + return m;
- + }
- +
- + private ForeachFunc()
- + {
- + super("FOREACH", "ENDEACH", false);
- + }
- +
- + @Override
- + public HashMap<String, HTMLTemplatePlaceholder> handle(StringBuilder content, PlayerInstance player, Map<String, HTMLTemplatePlaceholder> placeholders, HTMLTemplateFunc[] funcs)
- + {
- + try
- + {
- + Matcher matcher = _getMatcher(_FIRST_PLACEHOLDER_PATTERN, content, 0);
- + String aliasPlaceholderName = matcher.group().trim();
- + int findIndex = matcher.end();
- +
- + matcher = _getMatcher(_IN_PATTERN, content, findIndex);
- + findIndex = matcher.end();
- +
- + matcher = _getMatcher(_SECOND_PLACEHOLDER_PATTERN, content, findIndex);
- + Map<String, HTMLTemplatePlaceholder> childPlaceholders = HTMLTemplateUtils.getPlaceholderChilds(matcher.group().trim(), placeholders);
- + findIndex = matcher.end();
- +
- + matcher = _getMatcher(_DO_PATTERN, content, findIndex);
- + findIndex = matcher.end();
- +
- + content.delete(0, findIndex);
- + HashMap<String, HTMLTemplatePlaceholder> newPlaceholders = new HashMap<>();
- + newPlaceholders.putAll(placeholders);
- + StringBuilder orgContent = new StringBuilder(content);
- + StringBuilder modContent = new StringBuilder(content.length());
- + content.setLength(0);
- + // we don't need to save an overwritten placeholder, we create our own map
- + for (Entry<String, HTMLTemplatePlaceholder> childPlaceholder : childPlaceholders.entrySet())
- + {
- + modContent.setLength(0);
- + modContent.append(orgContent);
- + newPlaceholders.put(aliasPlaceholderName, childPlaceholder.getValue().createAlias(aliasPlaceholderName));
- + HTMLTemplateParser.fromStringBuilder(modContent, player, newPlaceholders, funcs);
- + content.append(modContent);
- + }
- + }
- + catch (Exception e)
- + {
- + content.setLength(0);
- + }
- + return null;
- + }
- +}
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/htmltmpls/funcs/ExistsFunc.java
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/htmltmpls/funcs/ExistsFunc.java (date 1601235046968)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/htmltmpls/funcs/ExistsFunc.java (date 1601235046968)
- @@ -0,0 +1,94 @@
- +/*
- + * This file is part of YANModPack: https://github.com/HorridoJoho/YANModPack
- + * Copyright (C) 2015 Christian Buck
- + *
- + * 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 custom.Buffer.util.htmltmpls.funcs;
- +
- +import java.util.Map;
- +import java.util.regex.Matcher;
- +import java.util.regex.Pattern;
- +
- +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
- +
- +import custom.Buffer.util.htmltmpls.HTMLTemplateFunc;
- +import custom.Buffer.util.htmltmpls.HTMLTemplatePlaceholder;
- +import custom.Buffer.util.htmltmpls.HTMLTemplateUtils;
- +
- +/**
- + * @author HorridoJoho
- + */
- +public final class ExistsFunc extends HTMLTemplateFunc
- +{
- + public static final ExistsFunc INSTANCE = new ExistsFunc();
- +
- + private static final Pattern _NEGATE_PATTERN = Pattern.compile("\\s*!\\s*");
- + private static final Pattern _PLACEHOLDER_PATTERN = Pattern.compile("[a-zA-Z_][a-zA-Z0-9_]*(\\.[a-zA-Z_][a-zA-Z0-9_]*)*\\s*,");
- +
- + private ExistsFunc()
- + {
- + super("EXISTS", "ENDEXISTS", false);
- + }
- +
- + private static Matcher _getMatcher(Pattern pattern, StringBuilder content, int findIndex) throws Exception
- + {
- + Matcher m = pattern.matcher(content);
- + if (!m.find(findIndex) || m.start() > findIndex)
- + throw new Exception();
- +
- + return m;
- + }
- +
- + @Override
- + public Map<String, HTMLTemplatePlaceholder> handle(StringBuilder content, PlayerInstance player, Map<String, HTMLTemplatePlaceholder> placeholders, HTMLTemplateFunc[] funcs)
- + {
- + try
- + {
- + boolean negate = false;
- + Matcher m = null;
- +
- + try
- + {
- + m = _getMatcher(_NEGATE_PATTERN, content, 0);
- + negate = true;
- + }
- + catch (Exception e)
- + {
- + // ignore this exception, negate is optional
- + }
- +
- + if (m != null)
- + m = _getMatcher(_PLACEHOLDER_PATTERN, content, m.end());
- + else
- + m = _getMatcher(_PLACEHOLDER_PATTERN, content, 0);
- +
- + HTMLTemplatePlaceholder placeholder = HTMLTemplateUtils.getPlaceholder(m.group().substring(0, m.group().length() - 1).trim(), placeholders);
- + if ((placeholder == null && !negate) || (placeholder != null && negate))
- + {
- + content.setLength(0);
- + return null;
- + }
- +
- + content.delete(0, m.end());
- + }
- + catch (Exception e)
- + {
- + content.setLength(0);
- + }
- +
- + return null;
- + }
- +
- +}
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/htmltmpls/funcs/ChildsCountFunc.java
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/htmltmpls/funcs/ChildsCountFunc.java (date 1601235046963)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/util/htmltmpls/funcs/ChildsCountFunc.java (date 1601235046963)
- @@ -0,0 +1,52 @@
- +/*
- + * This file is part of YANModPack: https://github.com/HorridoJoho/YANModPack
- + * Copyright (C) 2015 Christian Buck
- + *
- + * 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 custom.Buffer.util.htmltmpls.funcs;
- +
- +import java.util.Map;
- +
- +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
- +
- +import custom.Buffer.util.htmltmpls.HTMLTemplateFunc;
- +import custom.Buffer.util.htmltmpls.HTMLTemplatePlaceholder;
- +import custom.Buffer.util.htmltmpls.HTMLTemplateUtils;
- +
- +/**
- + * @author HorridoJoho
- + */
- +public final class ChildsCountFunc extends HTMLTemplateFunc
- +{
- + public static final ChildsCountFunc INSTANCE = new ChildsCountFunc();
- +
- + protected ChildsCountFunc()
- + {
- + super("CHILDSCOUNT", "ENDCHILDSCOUNT", false);
- + }
- +
- + @Override
- + public Map<String, HTMLTemplatePlaceholder> handle(StringBuilder content, PlayerInstance player, Map<String, HTMLTemplatePlaceholder> placeholders, HTMLTemplateFunc[] funcs)
- + {
- + HTMLTemplatePlaceholder placeholder = HTMLTemplateUtils.getPlaceholder(content.toString(), placeholders);
- + content.setLength(0);
- + if (placeholder != null)
- + {
- + content.append(String.valueOf(placeholder.getChildsSize()));
- + }
- + return null;
- + }
- +
- +}
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/sql/buffer_data.sql
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/sql/buffer_data.sql (date 1601235046958)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/sql/buffer_data.sql (date 1601235046958)
- @@ -0,0 +1,15 @@
- +CREATE TABLE `buffer_user_list_buffs` (
- + `user_buff_list_id` int(10) unsigned NOT NULL,
- + `buff_id` varchar(255) NOT NULL,
- + PRIMARY KEY (`user_buff_list_id`,`buff_id`),
- + CONSTRAINT `buffer_user_list_buffs_ibfk_1` FOREIGN KEY (`user_buff_list_id`) REFERENCES `buffer_user_lists` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
- +) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- +
- +CREATE TABLE `buffer_user_lists` (
- + `id` int(10) unsigned PRIMARY KEY AUTO_INCREMENT NOT NULL ,
- + `character_id` int(10) unsigned NOT NULL,
- + `list_name` varchar(255) NOT NULL,
- + UNIQUE KEY `character_id` (`character_id`,`list_name`),
- + CONSTRAINT `buffer_user_lists_ibfk_1` FOREIGN KEY (`character_id`) REFERENCES `characters` (`charId`) ON DELETE CASCADE ON UPDATE CASCADE
- +) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- +
- Index: L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java (revision 9230173172baed1192322bacd625ea32cc78f981)
- +++ L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java (date 1601235348455)
- @@ -142,10 +142,11 @@
- private static final String CUSTOM_SCREEN_WELCOME_MESSAGE_CONFIG_FILE = "./config/Custom/ScreenWelcomeMessage.ini";
- private static final String CUSTOM_SELL_BUFFS_CONFIG_FILE = "./config/Custom/SellBuffs.ini";
- private static final String CUSTOM_SERVER_TIME_CONFIG_FILE = "./config/Custom/ServerTime.ini";
- - private static final String CUSTOM_SCHEME_BUFFER_CONFIG_FILE = "./config/Custom/ShemeBuffer.ini";
- + private static final String CUSTOM_SCHEME_BUFFER_CONFIG_FILE = "./config/Custom/SchemeBuffer.ini";
- private static final String CUSTOM_STARTING_LOCATION_CONFIG_FILE = "./config/Custom/StartingLocation.ini";
- private static final String CUSTOM_VOTE_REWARD_CONFIG_FILE = "./config/Custom/VoteReward.ini";
- private static final String CUSTOM_WALKER_BOT_PROTECTION_CONFIG_FILE = "./config/Custom/WalkerBotProtection.ini";
- + private static final String CUSTOM_BUFFER_CONFIG_FILE = "./config/Custom/Buffer.ini";
- // --------------------------------------------------
- // Variable Definitions
- @@ -1267,6 +1268,8 @@
- public static Map<Integer, Integer> L2TOP_REWARD = new HashMap<>();
- public static int L2TOP_DUALBOXES_ALLOWED;
- public static boolean ALLOW_L2TOP_GAME_SERVER_REPORT;
- +
- + public static int BUFFER_CUSTOM_BUFF_DURATION;
- /**
- * This class initializes all global variables for configuration.<br>
- @@ -3413,6 +3416,9 @@
- // Load WalkerBotProtection config file (if exists)
- final PropertiesParser WalkerBotProtection = new PropertiesParser(CUSTOM_WALKER_BOT_PROTECTION_CONFIG_FILE);
- L2WALKER_PROTECTION = WalkerBotProtection.getBoolean("L2WalkerProtection", false);
- +
- + final PropertiesParser BufferProperties = new PropertiesParser(CUSTOM_BUFFER_CONFIG_FILE);
- + BUFFER_CUSTOM_BUFF_DURATION = BufferProperties.getInt("BufferOverrideBuffDuration", 0);
- }
- else if (SERVER_MODE == ServerMode.LOGIN)
- {
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/voiced_buffer.xml
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/voiced_buffer.xml (date 1601235046951)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/voiced_buffer.xml (date 1601235046951)
- @@ -0,0 +1,20 @@
- +<?xml version="1.0" encoding="utf-8"?>
- +<!-- ATTRIBUTES
- + enabled - true|false
- + required_item - id of the item required in the players inventory to use the voiced buffer
- + can_heal - true|false - enable/disable heal for voiced buffer
- + can_cancel - true|false - enable/disable cancel for voiced buffer
- + -->
- +<voiced_buffer xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/voiced_buffer.xsd" enabled="true" required_item="0" can_heal="true" can_cancel="true">
- + <buff_cat ident="BC_FIGHTER" is_preset="true"/>
- + <buff_cat ident="BC_MAGE" is_preset="true"/>
- +
- + <buff_cat ident="BC_BUFFS" is_preset="false"/>
- + <buff_cat ident="BC_SONGS" is_preset="false"/>
- + <buff_cat ident="BC_DANCES" is_preset="false"/>
- + <buff_cat ident="BC_CHANTS" is_preset="false"/>
- + <buff_cat ident="BC_DWARVEN" is_preset="false"/>
- + <buff_cat ident="BC_RESIST" is_preset="false"/>
- + <buff_cat ident="BC_SPECIAL" is_preset="false"/>
- + <buff_cat ident="BC_OVERLORD" is_preset="false"/>
- +</voiced_buffer>
- \ No newline at end of file
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/item_requirements.xml
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/item_requirements.xml (date 1601235046945)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/item_requirements.xml (date 1601235046945)
- @@ -0,0 +1,8 @@
- +<?xml version="1.0" encoding="utf-8"?>
- +<item_requirements xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/item_requirements.xsd">
- + <item ident="ADENA_1" id="57" amount="1"/>
- + <item ident="ADENA_10" id="57" amount="10"/>
- + <item ident="ADENA_100" id="57" amount="100"/>
- + <item ident="ADENA_1000" id="57" amount="1000"/>
- + <item ident="ADENA_10000" id="57" amount="10000"/>
- +</item_requirements>
- \ No newline at end of file
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/buffs.xml
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/buffs.xml (date 1601235046934)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/buffs.xml (date 1601235046934)
- @@ -0,0 +1,390 @@
- +<?xml version="1.0" encoding="utf-8"?>
- +<buffs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="./xsd/buffs.xsd">
- + <!-- Buffs -->
- + <buff ident="BUFF_0" skill_id="1036" skill_level="2" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="BUFF_1" skill_id="1040" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="BUFF_2" skill_id="1043" skill_level="1" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="BUFF_3" skill_id="1044" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="BUFF_4" skill_id="1045" skill_level="6" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="BUFF_5" skill_id="1047" skill_level="4" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="BUFF_6" skill_id="1048" skill_level="6" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="BUFF_7" skill_id="1059" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="BUFF_8" skill_id="1068" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="BUFF_9" skill_id="1077" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="BUFF_10" skill_id="1085" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="BUFF_11" skill_id="1086" skill_level="2" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="BUFF_12" skill_id="1087" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="BUFF_13" skill_id="1204" skill_level="2" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="BUFF_14" skill_id="1242" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="BUFF_15" skill_id="1243" skill_level="6" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="BUFF_16" skill_id="1257" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="BUFF_17" skill_id="1268" skill_level="4" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="BUFF_18" skill_id="1303" skill_level="2" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="BUFF_19" skill_id="1304" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="BUFF_20" skill_id="1307" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="BUFF_21" skill_id="1311" skill_level="6" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="BUFF_22" skill_id="1397" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="BUFF_23" skill_id="1460" skill_level="1" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="BUFF_24" skill_id="1232" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="BUFF_25" skill_id="1238" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="BUFF_26" skill_id="1086" skill_level="2" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- +
- + <!-- Songs -->
- + <buff ident="SONG_0" skill_id="264" skill_level="1" type="DANCE">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SONG_1" skill_id="265" skill_level="1" type="DANCE">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SONG_2" skill_id="266" skill_level="1" type="DANCE">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SONG_3" skill_id="267" skill_level="1" type="DANCE">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SONG_4" skill_id="268" skill_level="1" type="DANCE">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SONG_5" skill_id="269" skill_level="1" type="DANCE">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SONG_6" skill_id="270" skill_level="1" type="DANCE">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SONG_7" skill_id="304" skill_level="1" type="DANCE">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SONG_8" skill_id="305" skill_level="1" type="DANCE">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SONG_9" skill_id="306" skill_level="1" type="DANCE">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SONG_10" skill_id="308" skill_level="1" type="DANCE">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SONG_11" skill_id="349" skill_level="1" type="DANCE">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SONG_12" skill_id="363" skill_level="1" type="DANCE">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SONG_13" skill_id="364" skill_level="1" type="DANCE">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SONG_14" skill_id="529" skill_level="1" type="DANCE">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SONG_15" skill_id="764" skill_level="1" type="DANCE">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SONG_16" skill_id="914" skill_level="1" type="DANCE">
- + <item ident="ADENA_100"/>
- + </buff>
- +
- + <!-- Dances -->
- + <buff ident="DANCE_0" skill_id="271" skill_level="1" type="DANCE">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="DANCE_1" skill_id="272" skill_level="1" type="DANCE">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="DANCE_2" skill_id="273" skill_level="1" type="DANCE">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="DANCE_3" skill_id="274" skill_level="1" type="DANCE">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="DANCE_4" skill_id="275" skill_level="1" type="DANCE">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="DANCE_5" skill_id="276" skill_level="1" type="DANCE">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="DANCE_6" skill_id="277" skill_level="1" type="DANCE">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="DANCE_7" skill_id="307" skill_level="1" type="DANCE">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="DANCE_8" skill_id="309" skill_level="1" type="DANCE">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="DANCE_9" skill_id="310" skill_level="1" type="DANCE">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="DANCE_10" skill_id="311" skill_level="1" type="DANCE">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="DANCE_11" skill_id="365" skill_level="1" type="DANCE">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="DANCE_12" skill_id="366" skill_level="1" type="DANCE">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="DANCE_13" skill_id="530" skill_level="1" type="DANCE">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="DANCE_14" skill_id="765" skill_level="1" type="DANCE">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="DANCE_15" skill_id="915" skill_level="1" type="DANCE">
- + <item ident="ADENA_100"/>
- + </buff>
- +
- + <!-- Chants -->
- + <buff ident="CHANT_0" skill_id="1002" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="CHANT_1" skill_id="1006" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="CHANT_2" skill_id="1007" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="CHANT_3" skill_id="1009" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="CHANT_4" skill_id="1251" skill_level="2" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="CHANT_5" skill_id="1252" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="CHANT_6" skill_id="1253" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="CHANT_7" skill_id="1284" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="CHANT_8" skill_id="1308" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="CHANT_9" skill_id="1309" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="CHANT_10" skill_id="1310" skill_level="4" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="CHANT_11" skill_id="1362" skill_level="1" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- +
- + <!-- Dwarven -->
- + <buff ident="DWARVEN_0" skill_id="825" skill_level="1" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="DWARVEN_1" skill_id="826" skill_level="1" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="DWARVEN_2" skill_id="827" skill_level="1" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="DWARVEN_3" skill_id="828" skill_level="1" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="DWARVEN_4" skill_id="829" skill_level="1" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="DWARVEN_5" skill_id="830" skill_level="1" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- +
- + <!-- Resist -->
- + <buff ident="RESIST_0" skill_id="1461" skill_level="1" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="RESIST_1" skill_id="1032" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="RESIST_2" skill_id="1033" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="RESIST_3" skill_id="1035" skill_level="4" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="RESIST_4" skill_id="1078" skill_level="6" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="RESIST_5" skill_id="1182" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="RESIST_6" skill_id="1189" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="RESIST_7" skill_id="1191" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="RESIST_8" skill_id="1259" skill_level="4" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="RESIST_9" skill_id="1352" skill_level="1" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="RESIST_10" skill_id="1353" skill_level="1" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="RESIST_11" skill_id="1354" skill_level="1" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="RESIST_12" skill_id="1392" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="RESIST_13" skill_id="1393" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- +
- + <!-- Special -->
- + <buff ident="SPECIAL_0" skill_id="1323" skill_level="1" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SPECIAL_1" skill_id="1388" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SPECIAL_2" skill_id="1389" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SPECIAL_3" skill_id="1499" skill_level="1" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SPECIAL_4" skill_id="1500" skill_level="1" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SPECIAL_5" skill_id="1501" skill_level="1" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SPECIAL_6" skill_id="1502" skill_level="1" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SPECIAL_7" skill_id="1503" skill_level="1" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SPECIAL_8" skill_id="1504" skill_level="1" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SPECIAL_9" skill_id="1519" skill_level="1" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SPECIAL_10" skill_id="1062" skill_level="2" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SPECIAL_11" skill_id="1355" skill_level="1" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SPECIAL_12" skill_id="1356" skill_level="1" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SPECIAL_13" skill_id="1357" skill_level="1" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SPECIAL_14" skill_id="1363" skill_level="1" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SPECIAL_15" skill_id="1413" skill_level="1" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SPECIAL_16" skill_id="1457" skill_level="1" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SPECIAL_17" skill_id="1261" skill_level="2" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SPECIAL_18" skill_id="1415" skill_level="1" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SPECIAL_19" skill_id="1416" skill_level="8" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SPECIAL_20" skill_id="1542" skill_level="1" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="SPECIAL_21" skill_id="1414" skill_level="1" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- +
- + <!-- Overlord -->
- + <buff ident="OVERLORD_0" skill_id="1003" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="OVERLORD_1" skill_id="1004" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="OVERLORD_2" skill_id="1005" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="OVERLORD_3" skill_id="1008" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="OVERLORD_4" skill_id="1249" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="OVERLORD_5" skill_id="1250" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="OVERLORD_6" skill_id="1260" skill_level="3" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="OVERLORD_7" skill_id="1282" skill_level="2" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="OVERLORD_8" skill_id="1364" skill_level="1" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- + <buff ident="OVERLORD_9" skill_id="1365" skill_level="1" type="BUFF">
- + <item ident="ADENA_100"/>
- + </buff>
- +</buffs>
- \ No newline at end of file
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/buffer_npcs.xml
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/buffer_npcs.xml (date 1601235046928)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/buffer_npcs.xml (date 1601235046928)
- @@ -0,0 +1,16 @@
- +<?xml version="1.0" encoding="utf-8"?>
- +<buffer_npcs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/buffer_npcs.xsd">
- + <buffer_npc id="1000006" can_heal="true" can_cancel="true">
- + <buff_cat ident="BC_FIGHTER" is_preset="true"/>
- + <buff_cat ident="BC_MAGE" is_preset="true"/>
- +
- + <buff_cat ident="BC_BUFFS" is_preset="false"/>
- + <buff_cat ident="BC_SONGS" is_preset="false"/>
- + <buff_cat ident="BC_DANCES" is_preset="false"/>
- + <buff_cat ident="BC_CHANTS" is_preset="false"/>
- + <buff_cat ident="BC_DWARVEN" is_preset="false"/>
- + <buff_cat ident="BC_RESIST" is_preset="false"/>
- + <buff_cat ident="BC_SPECIAL" is_preset="false"/>
- + <buff_cat ident="BC_OVERLORD" is_preset="false"/>
- + </buffer_npc>
- +</buffer_npcs>
- \ No newline at end of file
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/buffer.xml
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/buffer.xml (date 1601235046924)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/buffer.xml (date 1601235046924)
- @@ -0,0 +1,7 @@
- +<?xml version="1.0" encoding="utf-8"?>
- +<!-- dialog_type: NPC, COMMUNITY -->
- +<!-- heal_cooldown: minimum seconds between heal usage -->
- +<!-- max_unique_list: number of maximum unique bufflists per player -->
- +<!-- unique_max_buffs: maximum number of BUFFS on a players unique bufflist -->
- +<!-- unique_max_songs_dances: maximum number of SONGS_DANCES on a players unique bufflist -->
- +<buffer xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/buffer.xsd" dialog_type="NPC" heal_cooldown="60" max_unique_lists="5" unique_max_buffs="24" unique_max_songs_dances="12"/>
- \ No newline at end of file
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/buff_categories.xml
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/buff_categories.xml (date 1601235046916)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/buff_categories.xml (date 1601235046916)
- @@ -0,0 +1,219 @@
- +<?xml version="1.0" encoding="utf-8"?>
- +<buff_cats xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/buff_categories.xsd">
- + <buff_cat ident="BC_FIGHTER" name="Fighter">
- + <buff ident="BUFF_17"/>
- + <buff ident="SPECIAL_1"/>
- + <buff ident="SPECIAL_3"/>
- + <buff ident="SPECIAL_4"/>
- + <buff ident="SPECIAL_5"/>
- + <buff ident="SPECIAL_6"/>
- + <buff ident="SPECIAL_8"/>
- + <buff ident="SPECIAL_9"/>
- + <buff ident="SPECIAL_14"/>
- + <buff ident="SPECIAL_17"/>
- + <buff ident="SPECIAL_18"/>
- + <buff ident="SPECIAL_19"/>
- + <buff ident="SPECIAL_20"/>
- + <buff ident="RESIST_0"/>
- + <buff ident="RESIST_3"/>
- + <buff ident="RESIST_8"/>
- + <buff ident="RESIST_9"/>
- + <buff ident="RESIST_10"/>
- + <buff ident="RESIST_12"/>
- + <buff ident="RESIST_13"/>
- + <buff ident="DANCE_0"/>
- + <buff ident="DANCE_1"/>
- + <buff ident="DANCE_3"/>
- + <buff ident="DANCE_4"/>
- + <buff ident="DANCE_15"/>
- + <buff ident="SONG_0"/>
- + <buff ident="SONG_2"/>
- + <buff ident="SONG_3"/>
- + <buff ident="SONG_4"/>
- + <buff ident="SONG_5"/>
- + <buff ident="SONG_7"/>
- + <buff ident="SONG_11"/>
- + </buff_cat>
- +
- + <buff_cat ident="BC_MAGE" name="Mage">
- + <buff ident="BUFF_17"/>
- + <buff ident="SPECIAL_2"/>
- + <buff ident="SPECIAL_3"/>
- + <buff ident="SPECIAL_4"/>
- + <buff ident="SPECIAL_5"/>
- + <buff ident="SPECIAL_8"/>
- + <buff ident="SPECIAL_15"/>
- + <buff ident="SPECIAL_17"/>
- + <buff ident="SPECIAL_18"/>
- + <buff ident="SPECIAL_19"/>
- + <buff ident="SPECIAL_20"/>
- + <buff ident="RESIST_0"/>
- + <buff ident="RESIST_3"/>
- + <buff ident="RESIST_4"/>
- + <buff ident="RESIST_8"/>
- + <buff ident="RESIST_9"/>
- + <buff ident="RESIST_10"/>
- + <buff ident="RESIST_12"/>
- + <buff ident="RESIST_13"/>
- + <buff ident="DANCE_2"/>
- + <buff ident="DANCE_5"/>
- + <buff ident="DANCE_11"/>
- + <buff ident="DANCE_15"/>
- + <buff ident="SONG_0"/>
- + <buff ident="SONG_1"/>
- + <buff ident="SONG_2"/>
- + <buff ident="SONG_3"/>
- + <buff ident="SONG_4"/>
- + <buff ident="SONG_7"/>
- + <buff ident="SONG_8"/>
- + <buff ident="SONG_11"/>
- + </buff_cat>
- +
- + <buff_cat ident="BC_BUFFS" name="Buffs">
- + <buff ident="BUFF_0"/>
- + <buff ident="BUFF_1"/>
- + <buff ident="BUFF_2"/>
- + <buff ident="BUFF_3"/>
- + <buff ident="BUFF_4"/>
- + <buff ident="BUFF_5"/>
- + <buff ident="BUFF_6"/>
- + <buff ident="BUFF_7"/>
- + <buff ident="BUFF_8"/>
- + <buff ident="BUFF_9"/>
- + <buff ident="BUFF_10"/>
- + <buff ident="BUFF_11"/>
- + <buff ident="BUFF_12"/>
- + <buff ident="BUFF_13"/>
- + <buff ident="BUFF_14"/>
- + <buff ident="BUFF_15"/>
- + <buff ident="BUFF_16"/>
- + <buff ident="BUFF_17"/>
- + <buff ident="BUFF_18"/>
- + <buff ident="BUFF_19"/>
- + <buff ident="BUFF_20"/>
- + <buff ident="BUFF_21"/>
- + <buff ident="BUFF_22"/>
- + <buff ident="BUFF_23"/>
- + <buff ident="BUFF_24"/>
- + <buff ident="BUFF_25"/>
- + <buff ident="BUFF_26"/>
- + </buff_cat>
- +
- + <buff_cat ident="BC_SONGS" name="Songs">
- + <buff ident="SONG_0"/>
- + <buff ident="SONG_1"/>
- + <buff ident="SONG_2"/>
- + <buff ident="SONG_3"/>
- + <buff ident="SONG_4"/>
- + <buff ident="SONG_5"/>
- + <buff ident="SONG_6"/>
- + <buff ident="SONG_7"/>
- + <buff ident="SONG_8"/>
- + <buff ident="SONG_9"/>
- + <buff ident="SONG_10"/>
- + <buff ident="SONG_11"/>
- + <buff ident="SONG_12"/>
- + <buff ident="SONG_13"/>
- + <buff ident="SONG_14"/>
- + <buff ident="SONG_15"/>
- + <buff ident="SONG_16"/>
- + </buff_cat>
- +
- + <buff_cat ident="BC_DANCES" name="Dances">
- + <buff ident="DANCE_0"/>
- + <buff ident="DANCE_1"/>
- + <buff ident="DANCE_2"/>
- + <buff ident="DANCE_3"/>
- + <buff ident="DANCE_4"/>
- + <buff ident="DANCE_5"/>
- + <buff ident="DANCE_6"/>
- + <buff ident="DANCE_7"/>
- + <buff ident="DANCE_8"/>
- + <buff ident="DANCE_9"/>
- + <buff ident="DANCE_10"/>
- + <buff ident="DANCE_11"/>
- + <buff ident="DANCE_12"/>
- + <buff ident="DANCE_13"/>
- + <buff ident="DANCE_14"/>
- + <buff ident="DANCE_15"/>
- + </buff_cat>
- +
- + <buff_cat ident="BC_CHANTS" name="Chants">
- + <buff ident="CHANT_0"/>
- + <buff ident="CHANT_1"/>
- + <buff ident="CHANT_2"/>
- + <buff ident="CHANT_3"/>
- + <buff ident="CHANT_4"/>
- + <buff ident="CHANT_5"/>
- + <buff ident="CHANT_6"/>
- + <buff ident="CHANT_7"/>
- + <buff ident="CHANT_8"/>
- + <buff ident="CHANT_9"/>
- + <buff ident="CHANT_10"/>
- + <buff ident="CHANT_11"/>
- + </buff_cat>
- +
- + <buff_cat ident="BC_DWARVEN" name="Dwarven">
- + <buff ident="DWARVEN_0"/>
- + <buff ident="DWARVEN_1"/>
- + <buff ident="DWARVEN_2"/>
- + <buff ident="DWARVEN_3"/>
- + <buff ident="DWARVEN_4"/>
- + <buff ident="DWARVEN_5"/>
- + </buff_cat>
- +
- + <buff_cat ident="BC_RESIST" name="Resist">
- + <buff ident="RESIST_0"/>
- + <buff ident="RESIST_1"/>
- + <buff ident="RESIST_2"/>
- + <buff ident="RESIST_3"/>
- + <buff ident="RESIST_4"/>
- + <buff ident="RESIST_5"/>
- + <buff ident="RESIST_6"/>
- + <buff ident="RESIST_7"/>
- + <buff ident="RESIST_8"/>
- + <buff ident="RESIST_9"/>
- + <buff ident="RESIST_10"/>
- + <buff ident="RESIST_11"/>
- + <buff ident="RESIST_12"/>
- + <buff ident="RESIST_13"/>
- + </buff_cat>
- +
- + <buff_cat ident="BC_SPECIAL" name="Special">
- + <buff ident="SPECIAL_0"/>
- + <buff ident="SPECIAL_1"/>
- + <buff ident="SPECIAL_2"/>
- + <buff ident="SPECIAL_3"/>
- + <buff ident="SPECIAL_4"/>
- + <buff ident="SPECIAL_5"/>
- + <buff ident="SPECIAL_6"/>
- + <buff ident="SPECIAL_7"/>
- + <buff ident="SPECIAL_8"/>
- + <buff ident="SPECIAL_9"/>
- + <buff ident="SPECIAL_10"/>
- + <buff ident="SPECIAL_11"/>
- + <buff ident="SPECIAL_12"/>
- + <buff ident="SPECIAL_13"/>
- + <buff ident="SPECIAL_14"/>
- + <buff ident="SPECIAL_15"/>
- + <buff ident="SPECIAL_16"/>
- + <buff ident="SPECIAL_17"/>
- + <buff ident="SPECIAL_18"/>
- + <buff ident="SPECIAL_19"/>
- + <buff ident="SPECIAL_20"/>
- + <buff ident="SPECIAL_21"/>
- + </buff_cat>
- +
- + <buff_cat ident="BC_OVERLORD" name="Overlord">
- + <buff ident="OVERLORD_0"/>
- + <buff ident="OVERLORD_1"/>
- + <buff ident="OVERLORD_2"/>
- + <buff ident="OVERLORD_3"/>
- + <buff ident="OVERLORD_4"/>
- + <buff ident="OVERLORD_5"/>
- + <buff ident="OVERLORD_6"/>
- + <buff ident="OVERLORD_7"/>
- + <buff ident="OVERLORD_8"/>
- + <buff ident="OVERLORD_9"/>
- + </buff_cat>
- +</buff_cats>
- \ No newline at end of file
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/xsd/voiced_buffer.xsd
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/xsd/voiced_buffer.xsd (date 1601235046912)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/xsd/voiced_buffer.xsd (date 1601235046912)
- @@ -0,0 +1,19 @@
- +<?xml version="1.0" encoding="UTF-8"?>
- +<schema xmlns="http://www.w3.org/2001/XMLSchema">
- + <element name="voiced_buffer">
- + <complexType>
- + <sequence maxOccurs="1" minOccurs="1">
- + <element name="buff_cat" maxOccurs="unbounded" minOccurs="0">
- + <complexType>
- + <attribute name="ident" type="NCName" use="required"/>
- + <attribute name="is_preset" type="boolean" use="required"/>
- + </complexType>
- + </element>
- + </sequence>
- + <attribute name="enabled" type="boolean" use="required"/>
- + <attribute name="required_item" type="integer" use="optional"/>
- + <attribute name="can_heal" type="boolean" use="required"/>
- + <attribute name="can_cancel" type="boolean" use="required"/>
- + </complexType>
- + </element>
- +</schema>
- \ No newline at end of file
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/xsd/item_requirements.xsd
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/xsd/item_requirements.xsd (date 1601235046907)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/xsd/item_requirements.xsd (date 1601235046907)
- @@ -0,0 +1,16 @@
- +<?xml version="1.0" encoding="UTF-8"?>
- +<schema xmlns="http://www.w3.org/2001/XMLSchema">
- + <element name="item_requirements">
- + <complexType>
- + <sequence maxOccurs="1" minOccurs="1">
- + <element name="item" maxOccurs="unbounded" minOccurs="0">
- + <complexType>
- + <attribute name="ident" type="ID" use="required"/>
- + <attribute name="id" type="positiveInteger" use="required"/>
- + <attribute name="amount" type="positiveInteger" use="required"/>
- + </complexType>
- + </element>
- + </sequence>
- + </complexType>
- + </element>
- +</schema>
- \ No newline at end of file
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/xsd/buffs.xsd
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/xsd/buffs.xsd (date 1601235046903)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/xsd/buffs.xsd (date 1601235046903)
- @@ -0,0 +1,31 @@
- +<?xml version="1.0" encoding="UTF-8"?>
- +<schema xmlns="http://www.w3.org/2001/XMLSchema">
- + <element name="buffs">
- + <complexType>
- + <sequence maxOccurs="1" minOccurs="1">
- + <element name="buff" maxOccurs="unbounded" minOccurs="0">
- + <complexType>
- + <sequence maxOccurs="1" minOccurs="1">
- + <element name="item" maxOccurs="unbounded" minOccurs="0">
- + <complexType>
- + <attribute name="ident" type="NCName" use="required"/>
- + </complexType>
- + </element>
- + </sequence>
- + <attribute name="ident" type="ID" use="required"/>
- + <attribute name="skill_id" type="positiveInteger" use="required"/>
- + <attribute name="skill_level" type="positiveInteger" use="required"/>
- + <attribute name="type" use="required">
- + <simpleType>
- + <restriction base="string">
- + <enumeration value="BUFF"/>
- + <enumeration value="DANCE"/>
- + </restriction>
- + </simpleType>
- + </attribute>
- + </complexType>
- + </element>
- + </sequence>
- + </complexType>
- + </element>
- +</schema>
- \ No newline at end of file
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/xsd/buffer_npcs.xsd
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/xsd/buffer_npcs.xsd (date 1601235046895)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/xsd/buffer_npcs.xsd (date 1601235046895)
- @@ -0,0 +1,24 @@
- +<?xml version="1.0" encoding="UTF-8"?>
- +<schema xmlns="http://www.w3.org/2001/XMLSchema">
- + <element name="buffer_npcs">
- + <complexType>
- + <sequence maxOccurs="1" minOccurs="1">
- + <element name="buffer_npc" maxOccurs="unbounded" minOccurs="0">
- + <complexType>
- + <sequence maxOccurs="1" minOccurs="1">
- + <element name="buff_cat" maxOccurs="unbounded" minOccurs="0">
- + <complexType>
- + <attribute name="ident" type="NCName" use="required"/>
- + <attribute name="is_preset" type="boolean" use="required"/>
- + </complexType>
- + </element>
- + </sequence>
- + <attribute name="id" type="positiveInteger" use="required"/>
- + <attribute name="can_heal" type="boolean" use="required"/>
- + <attribute name="can_cancel" type="boolean" use="required"/>
- + </complexType>
- + </element>
- + </sequence>
- + </complexType>
- + </element>
- +</schema>
- \ No newline at end of file
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/xsd/buffer.xsd
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/xsd/buffer.xsd (date 1601235046891)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/xsd/buffer.xsd (date 1601235046891)
- @@ -0,0 +1,20 @@
- +<?xml version="1.0" encoding="UTF-8"?>
- +<schema xmlns="http://www.w3.org/2001/XMLSchema">
- + <element name="buffer">
- + <complexType>
- + <attribute name="dialog_type" use="required">
- + <simpleType>
- + <restriction base="string">
- + <enumeration value="NPC"/>
- + <enumeration value="TUTORIAL"/>
- + <enumeration value="COMMUNITY"/>
- + </restriction>
- + </simpleType>
- + </attribute>
- + <attribute name="heal_cooldown" type="positiveInteger" use="required"/>
- + <attribute name="max_unique_lists" type="positiveInteger" use="required"/>
- + <attribute name="unique_max_buffs" type="positiveInteger" use="required"/>
- + <attribute name="unique_max_songs_dances" type="positiveInteger" use="required"/>
- + </complexType>
- + </element>
- +</schema>
- \ No newline at end of file
- Index: L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/xsd/buff_categories.xsd
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/xsd/buff_categories.xsd (date 1601235046887)
- +++ L2J_Mobius_Classic_Interlude/dist/game/data/scripts/custom/Buffer/data/xml/xsd/buff_categories.xsd (date 1601235046887)
- @@ -0,0 +1,22 @@
- +<?xml version="1.0" encoding="UTF-8"?>
- +<schema xmlns="http://www.w3.org/2001/XMLSchema">
- + <element name="buff_cats">
- + <complexType>
- + <sequence maxOccurs="1" minOccurs="1">
- + <element name="buff_cat" maxOccurs="unbounded" minOccurs="0">
- + <complexType>
- + <sequence maxOccurs="1" minOccurs="1">
- + <element name="buff" maxOccurs="unbounded" minOccurs="0">
- + <complexType>
- + <attribute name="ident" type="NCName" use="required"/>
- + </complexType>
- + </element>
- + </sequence>
- + <attribute name="ident" type="ID" use="required"/>
- + <attribute name="name" type="string" use="required"/>
- + </complexType>
- + </element>
- + </sequence>
- + </complexType>
- + </element>
- +</schema>
- \ No newline at end of file
- diff --git L2J_Mobius_Classic_Interlude/dist/game/config/Custom/ShemeBuffer.ini L2J_Mobius_Classic_Interlude/dist/game/config/Custom/SchemeBuffer.ini
- rename from L2J_Mobius_Classic_Interlude/dist/game/config/Custom/ShemeBuffer.ini
- rename to L2J_Mobius_Classic_Interlude/dist/game/config/Custom/SchemeBuffer.ini
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement