Sync with L2jServer HighFive Apr 1st 2015.

This commit is contained in:
MobiusDev
2015-04-02 04:12:06 +00:00
parent 8300183361
commit 1abccfcae0
26 changed files with 283 additions and 248 deletions

View File

@ -1,6 +1,6 @@
<html><body>Mouth of Ekimus:<br> <html><body>Mouth of Ekimus:<br>
The echoes of the screams of the dying spread to the other side of the gap.<br> The echoes of the screams of the dying spread to the other side of the gap.<br>
The name Hall of Suffering seems to suit this place where new souls are made.<br> The name Hall of Suffering seems to suit this place where new souls are made.<br>
(The Hall of Erosion is an instant zone exclusively for party use.)<br> (The Hall of Suffering is an instant zone exclusively for party use.)<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest SeedOfInfinity">Enter the Hall of Erosion.</Button> <Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest HallOfSuffering">Enter the Hall of Erosion.</Button>
</body></html> </body></html>

View File

@ -23,7 +23,6 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.l2jserver.gameserver.enums.QuestSound;
import com.l2jserver.gameserver.model.actor.L2Npc; import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.quest.Quest; import com.l2jserver.gameserver.model.quest.Quest;
@ -115,8 +114,10 @@ public final class Q00662_AGameOfCards extends Quest
{ {
if (player.getLevel() >= MIN_LEVEL) if (player.getLevel() >= MIN_LEVEL)
{ {
st.setState(State.STARTED); if (st.isCreated())
st.playSound(QuestSound.ITEMSOUND_QUEST_ACCEPT); {
st.startQuest();
}
htmltext = event; htmltext = event;
} }
break; break;
@ -239,9 +240,8 @@ public final class Q00662_AGameOfCards extends Quest
{ {
i5 = i5 - 14; i5 = i5 - 14;
} }
st.set("v1", (i4 * 1000000) + (i3 * 10000) + (i2 * 100) + i1);
st.setCond((i4 * 1000000) + (i3 * 10000) + (i2 * 100) + i1); st.set("ExMemoState", i5);
st.set("ex", i5);
st.takeItems(RED_GEM, REQUIRED_CHIP_COUNT); st.takeItems(RED_GEM, REQUIRED_CHIP_COUNT);
htmltext = event; htmltext = event;
} }
@ -253,8 +253,8 @@ public final class Q00662_AGameOfCards extends Quest
case "turncard4": case "turncard4":
case "turncard5": case "turncard5":
{ {
final int cond = st.getCond(); final int cond = st.getInt("v1");
int i1 = st.getInt("ex"); int i1 = st.getInt("ExMemoState");
int i5 = i1 % 100; int i5 = i1 % 100;
int i9 = i1 / 100; int i9 = i1 / 100;
i1 = cond % 100; i1 = cond % 100;
@ -271,7 +271,7 @@ public final class Q00662_AGameOfCards extends Quest
} }
if ((i9 % 32) < 31) if ((i9 % 32) < 31)
{ {
st.set("ex", (i9 * 100) + i5); st.set("ExMemoState", (i9 * 100) + i5);
} }
break; break;
} }
@ -283,7 +283,7 @@ public final class Q00662_AGameOfCards extends Quest
} }
if ((i9 % 32) < 31) if ((i9 % 32) < 31)
{ {
st.set("ex", (i9 * 100) + i5); st.set("ExMemoState", (i9 * 100) + i5);
} }
break; break;
} }
@ -295,7 +295,7 @@ public final class Q00662_AGameOfCards extends Quest
} }
if ((i9 % 32) < 31) if ((i9 % 32) < 31)
{ {
st.set("ex", (i9 * 100) + i5); st.set("ExMemoState", (i9 * 100) + i5);
} }
break; break;
} }
@ -307,7 +307,7 @@ public final class Q00662_AGameOfCards extends Quest
} }
if ((i9 % 32) < 31) if ((i9 % 32) < 31)
{ {
st.set("ex", (i9 * 100) + i5); st.set("ExMemoState", (i9 * 100) + i5);
} }
break; break;
} }
@ -319,7 +319,7 @@ public final class Q00662_AGameOfCards extends Quest
} }
if ((i9 % 32) < 31) if ((i9 % 32) < 31)
{ {
st.set("ex", (i9 * 100) + i5); st.set("ExMemoState", (i9 * 100) + i5);
} }
break; break;
} }
@ -491,55 +491,55 @@ public final class Q00662_AGameOfCards extends Quest
if (i6 == 40) if (i6 == 40)
{ {
st.giveItems(ZIGGOS_GEMSTONE, 43); rewardItems(player, ZIGGOS_GEMSTONE, 43);
st.giveItems(959, 3); rewardItems(player, 959, 3);
st.giveItems(729, 1); rewardItems(player, 729, 1);
st.set("ex", 0); st.set("ExMemoState", 0);
st.setCond(0); st.set("v1", 0);
htmltext = getHtm(player.getHtmlPrefix(), "30845-13.html"); htmltext = getHtm(player.getHtmlPrefix(), "30845-13.html");
} }
else if (i6 == 30) else if (i6 == 30)
{ {
st.giveItems(959, 2); rewardItems(player, 959, 2);
st.giveItems(951, 2); rewardItems(player, 951, 2);
st.set("ex", 0); st.set("ExMemoState", 0);
st.setCond(0); st.set("v1", 0);
htmltext = getHtm(player.getHtmlPrefix(), "30845-14.html"); htmltext = getHtm(player.getHtmlPrefix(), "30845-14.html");
} }
else if ((i6 == 21) || (i6 == 12)) else if ((i6 == 21) || (i6 == 12))
{ {
st.giveItems(729, 1); rewardItems(player, 729, 1);
st.giveItems(947, 2); rewardItems(player, 947, 2);
st.giveItems(955, 1); rewardItems(player, 955, 1);
st.set("ex", 0); st.set("ExMemoState", 0);
st.setCond(0); st.set("v1", 0);
htmltext = getHtm(player.getHtmlPrefix(), "30845-15.html"); htmltext = getHtm(player.getHtmlPrefix(), "30845-15.html");
} }
else if (i6 == 20) else if (i6 == 20)
{ {
st.giveItems(951, 2); rewardItems(player, 951, 2);
st.set("ex", 0); st.set("ExMemoState", 0);
st.setCond(0); st.set("v1", 0);
htmltext = getHtm(player.getHtmlPrefix(), "30845-16.html"); htmltext = getHtm(player.getHtmlPrefix(), "30845-16.html");
} }
else if (i6 == 11) else if (i6 == 11)
{ {
st.giveItems(951, 1); rewardItems(player, 951, 1);
st.set("ex", 0); st.set("ExMemoState", 0);
st.setCond(0); st.set("v1", 0);
htmltext = getHtm(player.getHtmlPrefix(), "30845-17.html"); htmltext = getHtm(player.getHtmlPrefix(), "30845-17.html");
} }
else if (i6 == 10) else if (i6 == 10)
{ {
st.giveItems(956, 2); rewardItems(player, 956, 2);
st.set("ex", 0); st.set("ExMemoState", 0);
st.setCond(0); st.set("v1", 0);
htmltext = getHtm(player.getHtmlPrefix(), "30845-18.html"); htmltext = getHtm(player.getHtmlPrefix(), "30845-18.html");
} }
else if (i6 == 0) else if (i6 == 0)
{ {
st.set("ex", 0); st.set("ExMemoState", 0);
st.setCond(0); st.set("v1", 0);
htmltext = getHtm(player.getHtmlPrefix(), "30845-19.html"); htmltext = getHtm(player.getHtmlPrefix(), "30845-19.html");
} }
} }
@ -627,14 +627,14 @@ public final class Q00662_AGameOfCards extends Quest
} }
case State.STARTED: case State.STARTED:
{ {
if (st.isCond(0)) if (st.isCond(1))
{ {
htmltext = "30845-04.html"; htmltext = st.getQuestItemsCount(RED_GEM) < REQUIRED_CHIP_COUNT ? "30845-04.html" : "30845-05.html";
} }
else if (st.getInt("ex") != 0) else if (st.getInt("ExMemoState") != 0)
{ {
int i0 = st.getCond(); int i0 = st.getInt("v1");
int i1 = st.getInt("ex"); int i1 = st.getInt("ExMemoState");
int i5 = i1 % 100; int i5 = i1 % 100;
int i9 = i1 / 100; int i9 = i1 / 100;
i1 = i0 % 100; i1 = i0 % 100;
@ -733,8 +733,7 @@ public final class Q00662_AGameOfCards extends Quest
final QuestState st = getQuestState(player, false); final QuestState st = getQuestState(player, false);
if (st != null) if (st != null)
{ {
st.giveItems(RED_GEM, 1); giveItemRandomly(st.getPlayer(), npc, RED_GEM, 1, 0, MONSTERS.get(npc.getId()), true);
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
} }
} }
} }

View File

@ -3354,6 +3354,8 @@
<item id="9574" min="1" max="1" chance="0.5292" /> <!-- Mid-Grade Life Stone - Level 80 --> <item id="9574" min="1" max="1" chance="0.5292" /> <!-- Mid-Grade Life Stone - Level 80 -->
<item id="9575" min="1" max="1" chance="0.0529" /> <!-- High-Grade Life Stone - Level 80 --> <item id="9575" min="1" max="1" chance="0.0529" /> <!-- High-Grade Life Stone - Level 80 -->
<item id="960" min="1" max="1" chance="0.1218" /> <!-- Scroll: Enchant Armor (S-Grade) --> <item id="960" min="1" max="1" chance="0.1218" /> <!-- Scroll: Enchant Armor (S-Grade) -->
<item id="6622" min="1" max="1" chance="0.5000" /> <!--Giant's Codex-->
<item id="10550" min="1" max="1" chance="0.1000" /> <!--Forgotten Scroll - Protection of Elemental-->
</group> </group>
<group chance="42.0"> <group chance="42.0">
<item id="8600" min="1" max="1" chance="55" /> <!-- Herb of Life --> <item id="8600" min="1" max="1" chance="55" /> <!-- Herb of Life -->
@ -3565,6 +3567,8 @@
<item id="10484" min="1" max="1" chance="0.5144" /> <!-- Mid-Grade Life Stone - Level 82 --> <item id="10484" min="1" max="1" chance="0.5144" /> <!-- Mid-Grade Life Stone - Level 82 -->
<item id="10485" min="1" max="1" chance="0.0514" /> <!-- High-Grade Life Stone - Level 82 --> <item id="10485" min="1" max="1" chance="0.0514" /> <!-- High-Grade Life Stone - Level 82 -->
<item id="15779" min="1" max="1" chance="0.1173" /> <!-- Recipe - Sealed Moirai Leather Breastplate (60%) --> <item id="15779" min="1" max="1" chance="0.1173" /> <!-- Recipe - Sealed Moirai Leather Breastplate (60%) -->
<item id="6622" min="1" max="1" chance="0.5000" /> <!--Giant's Codex-->
<item id="10549" min="1" max="1" chance="1.0000" /> <!--Forgotten Scroll - Protection of Rune-->
</group> </group>
<group chance="42.0"> <group chance="42.0">
<item id="8600" min="1" max="1" chance="55" /> <!-- Herb of Life --> <item id="8600" min="1" max="1" chance="55" /> <!-- Herb of Life -->
@ -4091,6 +4095,8 @@
<item id="9574" min="1" max="1" chance="0.5292" /> <!-- Mid-Grade Life Stone - Level 80 --> <item id="9574" min="1" max="1" chance="0.5292" /> <!-- Mid-Grade Life Stone - Level 80 -->
<item id="9575" min="1" max="1" chance="0.0529" /> <!-- High-Grade Life Stone - Level 80 --> <item id="9575" min="1" max="1" chance="0.0529" /> <!-- High-Grade Life Stone - Level 80 -->
<item id="960" min="1" max="1" chance="0.1218" /> <!-- Scroll: Enchant Armor (S-Grade) --> <item id="960" min="1" max="1" chance="0.1218" /> <!-- Scroll: Enchant Armor (S-Grade) -->
<item id="6622" min="1" max="1" chance="0.5000" /> <!--Giant's Codex-->
<item id="10550" min="1" max="1" chance="0.1000" /> <!--Forgotten Scroll - Protection of Elemental-->
</group> </group>
<group chance="42.0"> <group chance="42.0">
<item id="8600" min="1" max="1" chance="55" /> <!-- Herb of Life --> <item id="8600" min="1" max="1" chance="55" /> <!-- Herb of Life -->
@ -4303,6 +4309,8 @@
<item id="10484" min="1" max="1" chance="0.5146" /> <!-- Mid-Grade Life Stone - Level 82 --> <item id="10484" min="1" max="1" chance="0.5146" /> <!-- Mid-Grade Life Stone - Level 82 -->
<item id="10485" min="1" max="1" chance="0.0515" /> <!-- High-Grade Life Stone - Level 82 --> <item id="10485" min="1" max="1" chance="0.0515" /> <!-- High-Grade Life Stone - Level 82 -->
<item id="15778" min="1" max="1" chance="0.0879" /> <!-- Recipe - Sealed Moirai Breastplate (60%) --> <item id="15778" min="1" max="1" chance="0.0879" /> <!-- Recipe - Sealed Moirai Breastplate (60%) -->
<item id="6622" min="1" max="1" chance="0.5000" /> <!--Giant's Codex-->
<item id="10549" min="1" max="1" chance="1.0000" /> <!--Forgotten Scroll - Protection of Rune-->
</group> </group>
<group chance="42.0"> <group chance="42.0">
<item id="8600" min="1" max="1" chance="55" /> <!-- Herb of Life --> <item id="8600" min="1" max="1" chance="55" /> <!-- Herb of Life -->
@ -4835,6 +4843,8 @@
<item id="15787" min="1" max="1" chance="0.3548" /> <!-- Recipe - Sealed Moirai Boots (60%) --> <item id="15787" min="1" max="1" chance="0.3548" /> <!-- Recipe - Sealed Moirai Boots (60%) -->
<item id="15788" min="1" max="1" chance="0.3548" /> <!-- Recipe - Sealed Moirai Leather Boots (60%) --> <item id="15788" min="1" max="1" chance="0.3548" /> <!-- Recipe - Sealed Moirai Leather Boots (60%) -->
<item id="15789" min="1" max="1" chance="0.3549" /> <!-- Recipe - Sealed Moirai Shoes (60%) --> <item id="15789" min="1" max="1" chance="0.3549" /> <!-- Recipe - Sealed Moirai Shoes (60%) -->
<item id="6622" min="1" max="1" chance="0.1000" /> <!--Giant's Codex-->
<item id="10552" min="1" max="1" chance="0.0500" /> <!--Forgotten Scroll - Fighter's Will-->
</group> </group>
<group chance="42.0"> <group chance="42.0">
<item id="8600" min="1" max="1" chance="55" /> <!-- Herb of Life --> <item id="8600" min="1" max="1" chance="55" /> <!-- Herb of Life -->
@ -5047,6 +5057,8 @@
<item id="10484" min="1" max="1" chance="0.5144" /> <!-- Mid-Grade Life Stone - Level 82 --> <item id="10484" min="1" max="1" chance="0.5144" /> <!-- Mid-Grade Life Stone - Level 82 -->
<item id="10485" min="1" max="1" chance="0.0514" /> <!-- High-Grade Life Stone - Level 82 --> <item id="10485" min="1" max="1" chance="0.0514" /> <!-- High-Grade Life Stone - Level 82 -->
<item id="15780" min="1" max="1" chance="0.1173" /> <!-- Recipe - Sealed Moirai Tunic (60%) --> <item id="15780" min="1" max="1" chance="0.1173" /> <!-- Recipe - Sealed Moirai Tunic (60%) -->
<item id="6622" min="1" max="1" chance="0.0500" /> <!--Giant's Codex-->
<item id="10552" min="1" max="1" chance="1.1160" /> <!--Forgotten Scroll - Fighter's Will-->
</group> </group>
<group chance="42.0"> <group chance="42.0">
<item id="8600" min="1" max="1" chance="55" /> <!-- Herb of Life --> <item id="8600" min="1" max="1" chance="55" /> <!-- Herb of Life -->
@ -5566,6 +5578,8 @@
<item id="15787" min="1" max="1" chance="0.3548" /> <!-- Recipe - Sealed Moirai Boots (60%) --> <item id="15787" min="1" max="1" chance="0.3548" /> <!-- Recipe - Sealed Moirai Boots (60%) -->
<item id="15788" min="1" max="1" chance="0.3548" /> <!-- Recipe - Sealed Moirai Leather Boots (60%) --> <item id="15788" min="1" max="1" chance="0.3548" /> <!-- Recipe - Sealed Moirai Leather Boots (60%) -->
<item id="15789" min="1" max="1" chance="0.3549" /> <!-- Recipe - Sealed Moirai Shoes (60%) --> <item id="15789" min="1" max="1" chance="0.3549" /> <!-- Recipe - Sealed Moirai Shoes (60%) -->
<item id="6622" min="1" max="1" chance="0.1000" /> <!--Giant's Codex-->
<item id="10552" min="1" max="1" chance="0.5000" /> <!--Forgotten Scroll - Fighter's Will-->
</group> </group>
<group chance="42.0"> <group chance="42.0">
<item id="8600" min="1" max="1" chance="55" /> <!-- Herb of Life --> <item id="8600" min="1" max="1" chance="55" /> <!-- Herb of Life -->
@ -5777,6 +5791,8 @@
<item id="10484" min="1" max="1" chance="0.5149" /> <!-- Mid-Grade Life Stone - Level 82 --> <item id="10484" min="1" max="1" chance="0.5149" /> <!-- Mid-Grade Life Stone - Level 82 -->
<item id="10485" min="1" max="1" chance="0.0515" /> <!-- High-Grade Life Stone - Level 82 --> <item id="10485" min="1" max="1" chance="0.0515" /> <!-- High-Grade Life Stone - Level 82 -->
<item id="10374" min="1" max="1" chance="0.0191" /> <!-- Recipe - Icarus Disperser (60%) --> <item id="10374" min="1" max="1" chance="0.0191" /> <!-- Recipe - Icarus Disperser (60%) -->
<item id="6622" min="1" max="1" chance="0.0500" /> <!--Giant's Codex-->
<item id="10552" min="1" max="1" chance="1.1410" /> <!--Forgotten Scroll - Fighter's Will-->
</group> </group>
<group chance="42.0"> <group chance="42.0">
<item id="8600" min="1" max="1" chance="55" /> <!-- Herb of Life --> <item id="8600" min="1" max="1" chance="55" /> <!-- Herb of Life -->

View File

@ -2384,6 +2384,7 @@
<set name="icon" val="icon.skill0997" /> <set name="icon" val="icon.skill0997" />
<set name="magicLvl" val="#magicLvl" /> <set name="magicLvl" val="#magicLvl" />
<set name="mpConsume" val="#mpConsume" /> <set name="mpConsume" val="#mpConsume" />
<set name="nextActionAttack" val="true" />
<set name="operateType" val="ACTIVE_CONTINUOUS" /> <set name="operateType" val="ACTIVE_CONTINUOUS" />
<set name="overHit" val="true" /> <set name="overHit" val="true" />
<set name="power" val="#power" /> <set name="power" val="#power" />

View File

@ -630,7 +630,7 @@
</skill> </skill>
<skill id="22272" levels="1" name="Beginner Adventurer's Treasure Sack"> <skill id="22272" levels="1" name="Beginner Adventurer's Treasure Sack">
<!-- High Five Skill --> <!-- High Five Skill -->
<table name="#extractableItems">312,1,4.76;167,1,4.76;220,1,4.76;178,1,4.76;221,1,4.76;123,1,4.76;156,1,4.76;291,1,4.76;166,1,4.76;274,1,4.76;21731,1,4.76;318,1,4.76;21738,1,4.76;21732,1,4.76;294,1,4.76;88,1,4.76;90,1,4.76;21735,1,4.76;172,1,4.76;279,1,4.76;169,1,4.8</table> <table name="#extractableItems">71,1,3.76;72,1,3.76;73,1,3.76;74,1,3.76;75,1,3.76;76,1,3.76;77,1,3.76;84,1,3.76;88,1,4.76;89,1,3.76;90,1,4.76;93,1,4.76;94,1,3.76;95,1,3.76;96,1,3.76;123,1,4.76;129,1,4.76;131,1,3.76;132,1,3.76;133,1,3.76;134,1,3.76;135,1,3.76;145,1,3.76;156,1,4.76;158,1,4.76;160,1,3.76;161,1,3.76;162,1,3.76;166,1,4.76;167,1,4.76;169,1,4.76;172,1,4.76;173,1,3.76;174,1,3.76;178,1,4.76;191,1,3.76;192,1,3.76;193,1,3.76;194,1,3.76;195,1,3.76;196,1,3.76;197,1,3.76;198,1,3.76;199,1,3.76;200,1,3.76;201,1,3.76;202,1,3.76;203,1,3.76;204,1,3.76;205,1,3.76;206,1,3.76;220,1,4.76;221,1,4.76;224,1,4.76;226,1,3.76;227,1,3.76;228,1,3.76;230,1,3.76;231,1,3.76;232,1,3.76;233,1,3.76;242,1,3.76;258,1,4.76;261,1,4.76;263,1,3.76;265,1,3.76;266,1,3.76;274,1,4.76;279,1,4.76;281,1,3.76;282,1,3.76;283,1,3.76;285,1,3.76;286,1,3.76;291,1,4.76;294,1,4.76;298,1,3.76;299,1,3.76;301,1,3.76;302,1,3.76;303,1,3.76;312,1,4.76;318,1,4.76;324,1,3.76;325,1,3.76;326,1,3.76;327,1,3.76;328,1,3.76;329,1,3.76;330,1,3.76;331,1,3.76;332,1,3.76;333,1,3.76;334,1,3.76;2502,1,3.76;2503,1,3.76;4233,1,3.76;5286,1,3.76;7882,1,3.76;7887,1,3.76;7888,1,3.76;7891,1,3.76;7897,1,3.76;7898,1,3.76;9228,1,3.76;9232,1,3.76;9236,1,3.76;9240,1,3.76;9244,1,3.76;9248,1,3.76;9252,1,3.76;9256,1,3.76;9260,1,3.76;9264,1,3.76;9268,1,3.76;9272,1,3.76;9276,1,3.76;9280,1,3.76;9284,1,3.76;9288,1,3.76;9292,1,3.76;9296,1,3.76;9300,1,3.76</table>
<set name="blockedInOlympiad" val="true" /> <set name="blockedInOlympiad" val="true" />
<set name="capsuled_items_skill" val="#extractableItems" /> <set name="capsuled_items_skill" val="#extractableItems" />
<set name="isMagic" val="2" /> <!-- Static Skill --> <set name="isMagic" val="2" /> <!-- Static Skill -->
@ -649,7 +649,7 @@
</skill> </skill>
<skill id="22273" levels="1" name="Experienced Adventurer's Treasure Sack"> <skill id="22273" levels="1" name="Experienced Adventurer's Treasure Sack">
<!-- High Five Skill --> <!-- High Five Skill -->
<table name="#extractableItems">160,1,4.16;298,1,4.16;72,1,4.16;193,1,4.16;192,1,4.16;281,1,4.16;7887,1,4.16;226,1,4.16;191,1,4.16;71,1,4.16;263,1,4.16;78,1,2.5;300,1,2.5;284,1,2.5;142,1,2.5;267,1,2.5;229,1,2.5;148,1,2.5;243,1,2.5;7892,1,2.5;91,1,1.36;80,1,1.36;235,1,1.36;269,1,1.36;288,1,1.36;7884,1,1.36;2504,1,1.36;150,1,1.36;7889,1,1.36;6364,1,0.45;6365,1,0.45;6366,1,0.45;6367,1,0.45;6368,1,0.45;6369,1,0.45;6370,1,0.45;6371,1,0.45;6372,1,0.45;7575,1,0.45</table> <table name="#extractableItems">78,1,4.16;79,1,4.16;80,1,2.5;81,1,2.5;82,1,0.45;85,1,2.5;91,1,4.16;92,1,4.16;97,1,4.16;98,1,2.5;142,1,4.16;146,1,4.16;147,1,2.5;148,1,4.16;149,1,2.5;150,1,2.5;151,1,2.5;164,1,2.5;171,1,4.16;175,1,4.16;207,1,4.16;208,1,4.16;209,1,4.16;210,1,4.16;211,1,4.16;212,1,2.5;213,1,2.5;229,1,4.16;234,1,4.16;235,1,2.5;236,1,2.5;243,1,4.16;264,1,4.16;267,1,4.16;268,1,4.16;269,1,2.5;270,1,2.5;284,1,4.16;287,1,4.16;288,1,2.5;289,1,2.5;300,1,4.16;304,1,2.5;305,1,2.5;335,1,4.16;336,1,4.16;337,1,4.16;338,1,4.16;339,1,4.16;340,1,4.16;341,1,2.5;342,1,2.5;343,1,2.5;344,1,2.5;345,1,2.5;346,1,0.45;2500,1,2.5;2504,1,2.5;6364,1,0.45;6365,1,0.45;6366,1,0.45;6367,1,0.45;6368,1,0.45;6369,1,0.45;6370,1,0.45;6371,1,0.45;6372,1,0.45;6579,1,0.45;7575,1,0.45;7883,1,4.16;7884,1,2.5;7889,1,4.16;7892,1,4.16;7893,1,4.16;7894,1,2.5;7895,1,2.5;7899,1,2.5;7900,1,4.16;7901,1,4.16;7902,1,2.5;8678,1,2.5;8682,1,2.5;8683,1,2.5;8684,1,2.5;8685,1,2.5;8686,1,2.5;8688,1,2.5;9304,1,4.16;9308,1,4.16;9312,1,4.16;9316,1,4.16;9320,1,4.16;9324,1,4.16;9328,1,2.5;9332,1,2.5;9336,1,2.5;9340,1,2.5;9344,1,2.5;9348,1,2.5;9352,1,2.5;9356,1,2.5;9360,1,2.5;9364,1,0.45;9368,1,0.45;9372,1,0.45</table>
<set name="blockedInOlympiad" val="true" /> <set name="blockedInOlympiad" val="true" />
<set name="capsuled_items_skill" val="#extractableItems" /> <set name="capsuled_items_skill" val="#extractableItems" />
<set name="isMagic" val="2" /> <!-- Static Skill --> <set name="isMagic" val="2" /> <!-- Static Skill -->

View File

@ -155,7 +155,7 @@ import com.l2jserver.status.Status;
import com.l2jserver.util.DeadLockDetector; import com.l2jserver.util.DeadLockDetector;
import com.l2jserver.util.IPv4Filter; import com.l2jserver.util.IPv4Filter;
public class GameServer public final class GameServer
{ {
private static final Logger _log = Logger.getLogger(GameServer.class.getName()); private static final Logger _log = Logger.getLogger(GameServer.class.getName());

View File

@ -200,7 +200,7 @@ public class GeoData
return z; return z;
} }
int nextLowerZ = getNextLowerZ(geoX, geoY, z + 100); int nextLowerZ = getNextLowerZ(geoX, geoY, z + 20);
return Math.abs(nextLowerZ - z) <= SPAWN_Z_DELTA_LIMIT ? nextLowerZ : z; return Math.abs(nextLowerZ - z) <= SPAWN_Z_DELTA_LIMIT ? nextLowerZ : z;
} }

View File

@ -91,15 +91,18 @@ public class HtmCache
private void parseDir(File dir) private void parseDir(File dir)
{ {
final File[] files = dir.listFiles(); final File[] files = dir.listFiles();
for (File file : files) if (files != null)
{ {
if (!file.isDirectory()) for (File file : files)
{ {
loadFile(file); if (!file.isDirectory())
} {
else loadFile(file);
{ }
parseDir(file); else
{
parseDir(file);
}
} }
} }
} }

View File

@ -106,14 +106,21 @@ public class PostBBSManager extends BaseBBSManager
private void showEditPost(Topic topic, Forum forum, L2PcInstance activeChar, int idp) private void showEditPost(Topic topic, Forum forum, L2PcInstance activeChar, int idp)
{ {
Post p = getGPosttByTopic(topic); if (topic == null)
if ((forum == null) || (topic == null) || (p == null))
{ {
CommunityBoardHandler.separateAndSend("<html><body><br><br><center>Error, this forum, topic or post does not exit !</center><br><br></body></html>", activeChar); CommunityBoardHandler.separateAndSend("<html><body><br><br><center>Error: This topic does not exist!</center></body></html>", activeChar);
} }
else else
{ {
showHtmlEditPost(topic, activeChar, forum, p); final Post p = getGPosttByTopic(topic);
if ((forum == null) || (p == null))
{
CommunityBoardHandler.separateAndSend("<html><body><br><br><center>Error: This forum or post does not exist!</center></body></html>", activeChar);
}
else
{
showHtmlEditPost(topic, activeChar, forum, p);
}
} }
} }
@ -121,7 +128,7 @@ public class PostBBSManager extends BaseBBSManager
{ {
if ((forum == null) || (topic == null)) if ((forum == null) || (topic == null))
{ {
CommunityBoardHandler.separateAndSend("<html><body><br><br><center>Error, this forum is not implemented yet</center><br><br></body></html>", activeChar); CommunityBoardHandler.separateAndSend("<html><body><br><br><center>Error: This forum is not implemented yet!</center></body></html>", activeChar);
} }
else if (forum.getType() == Forum.MEMO) else if (forum.getType() == Forum.MEMO)
{ {
@ -129,7 +136,7 @@ public class PostBBSManager extends BaseBBSManager
} }
else else
{ {
CommunityBoardHandler.separateAndSend("<html><body><br><br><center>the forum: " + forum.getName() + " is not implemented yet</center><br><br></body></html>", activeChar); CommunityBoardHandler.separateAndSend("<html><body><br><br><center>The forum: " + forum.getName() + " is not implemented yet!</center></body></html>", activeChar);
} }
} }
@ -142,7 +149,6 @@ public class PostBBSManager extends BaseBBSManager
private void showMemoPost(Topic topic, L2PcInstance activeChar, Forum forum) private void showMemoPost(Topic topic, L2PcInstance activeChar, Forum forum)
{ {
//
Post p = getGPosttByTopic(topic); Post p = getGPosttByTopic(topic);
Locale locale = Locale.getDefault(); Locale locale = Locale.getDefault();
DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.FULL, locale); DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.FULL, locale);

View File

@ -18,11 +18,17 @@
*/ */
package com.l2jserver.gameserver.data.sql.impl; package com.l2jserver.gameserver.data.sql.impl;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
import com.l2jserver.gameserver.model.actor.L2Summon;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.actor.instance.L2PetInstance;
import com.l2jserver.gameserver.model.actor.instance.L2ServitorInstance;
import com.l2jserver.gameserver.model.skills.Skill; import com.l2jserver.gameserver.model.skills.Skill;
/** /**
@ -37,12 +43,7 @@ public class SummonEffectsTable
// ---> key: servitorSkillId, value: Effects list // ---> key: servitorSkillId, value: Effects list
private final Map<Integer, Map<Integer, Map<Integer, List<SummonEffect>>>> _servitorEffects = new HashMap<>(); private final Map<Integer, Map<Integer, Map<Integer, List<SummonEffect>>>> _servitorEffects = new HashMap<>();
public Map<Integer, Map<Integer, Map<Integer, List<SummonEffect>>>> getServitorEffectsOwner() private Map<Integer, List<SummonEffect>> getServitorEffects(L2PcInstance owner)
{
return _servitorEffects;
}
public Map<Integer, List<SummonEffect>> getServitorEffects(L2PcInstance owner)
{ {
final Map<Integer, Map<Integer, List<SummonEffect>>> servitorMap = _servitorEffects.get(owner.getObjectId()); final Map<Integer, Map<Integer, List<SummonEffect>>> servitorMap = _servitorEffects.get(owner.getObjectId());
if (servitorMap == null) if (servitorMap == null)
@ -52,15 +53,107 @@ public class SummonEffectsTable
return servitorMap.get(owner.getClassIndex()); return servitorMap.get(owner.getClassIndex());
} }
private List<SummonEffect> getServitorEffects(L2PcInstance owner, int referenceSkill)
{
return containsOwner(owner) ? getServitorEffects(owner).get(referenceSkill) : null;
}
private boolean containsOwner(L2PcInstance owner)
{
return _servitorEffects.getOrDefault(owner.getObjectId(), Collections.emptyMap()).containsKey(owner.getClassIndex());
}
private void removeEffects(List<SummonEffect> effects, int skillId)
{
if ((effects != null) && !effects.isEmpty())
{
for (SummonEffect effect : effects)
{
final Skill skill = effect.getSkill();
if ((skill != null) && (skill.getId() == skillId))
{
effects.remove(effect);
}
}
}
}
private void applyEffects(L2Summon summon, List<SummonEffect> summonEffects)
{
if (summonEffects == null)
{
return;
}
for (SummonEffect se : summonEffects)
{
if (se != null)
{
se.getSkill().applyEffects(summon, summon, false, se.getEffectCurTime());
}
}
}
public boolean containsSkill(L2PcInstance owner, int referenceSkill)
{
return containsOwner(owner) && getServitorEffects(owner).containsKey(referenceSkill);
}
public void clearServitorEffects(L2PcInstance owner, int referenceSkill)
{
if (containsOwner(owner))
{
getServitorEffects(owner).getOrDefault(referenceSkill, Collections.emptyList()).clear();
}
}
public void addServitorEffect(L2PcInstance owner, int referenceSkill, Skill skill, int effectCurTime)
{
_servitorEffects.putIfAbsent(owner.getObjectId(), new HashMap<Integer, Map<Integer, List<SummonEffect>>>());
_servitorEffects.get(owner.getObjectId()).putIfAbsent(owner.getClassIndex(), new HashMap<Integer, List<SummonEffect>>());
getServitorEffects(owner).putIfAbsent(referenceSkill, new CopyOnWriteArrayList<SummonEffect>());
getServitorEffects(owner).get(referenceSkill).add(new SummonEffect(skill, effectCurTime));
}
public void removeServitorEffects(L2PcInstance owner, int referenceSkill, int skillId)
{
removeEffects(getServitorEffects(owner, referenceSkill), skillId);
}
public void applyServitorEffects(L2ServitorInstance l2ServitorInstance, L2PcInstance owner, int referenceSkill)
{
applyEffects(l2ServitorInstance, getServitorEffects(owner, referenceSkill));
}
/** Pets **/ /** Pets **/
private final Map<Integer, List<SummonEffect>> _petEffects = new HashMap<>(); // key: petItemObjectId, value: Effects list private final Map<Integer, List<SummonEffect>> _petEffects = new HashMap<>(); // key: petItemObjectId, value: Effects list
public Map<Integer, List<SummonEffect>> getPetEffects() public void addPetEffect(int controlObjectId, Skill skill, int effectCurTime)
{ {
return _petEffects; _petEffects.putIfAbsent(controlObjectId, new ArrayList<>()).add(new SummonEffect(skill, effectCurTime));
} }
public class SummonEffect public boolean containsPetId(int controlObjectId)
{
return _petEffects.containsKey(controlObjectId);
}
public void applyPetEffects(L2PetInstance l2PetInstance, int controlObjectId)
{
applyEffects(l2PetInstance, _petEffects.get(controlObjectId));
}
public void clearPetEffects(int controlObjectId)
{
_petEffects.getOrDefault(controlObjectId, Collections.emptyList()).clear();
}
public void removePetEffects(int controlObjectId, int skillId)
{
removeEffects(_petEffects.get(controlObjectId), skillId);
}
private class SummonEffect
{ {
Skill _skill; Skill _skill;
int _effectCurTime; int _effectCurTime;

View File

@ -69,10 +69,14 @@ public class DocumentEngine
_log.warning("Dir " + dir.getAbsolutePath() + " not exists"); _log.warning("Dir " + dir.getAbsolutePath() + " not exists");
return; return;
} }
File[] files = dir.listFiles(new XMLFilter());
for (File f : files) final File[] files = dir.listFiles(new XMLFilter());
if (files != null)
{ {
hash.add(f); for (File f : files)
{
hash.add(f);
}
} }
} }

View File

@ -110,7 +110,7 @@ public final class DuelManager
public void removeDuel(Duel duel) public void removeDuel(Duel duel)
{ {
_duels.remove(duel); _duels.remove(duel.getId());
} }
public void doSurrender(L2PcInstance player) public void doSurrender(L2PcInstance player)

View File

@ -26,7 +26,9 @@ import java.util.ArrayList;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Queue;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ScheduledFuture; import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@ -552,11 +554,6 @@ public class AutoSpawnHandler
for (L2Npc npcInst : spawnInst.getNPCInstanceList()) for (L2Npc npcInst : spawnInst.getNPCInstanceList())
{ {
if (npcInst == null)
{
continue;
}
npcInst.deleteMe(); npcInst.deleteMe();
SpawnTable.getInstance().deleteSpawn(npcInst.getSpawn(), false); SpawnTable.getInstance().deleteSpawn(npcInst.getSpawn(), false);
spawnInst.removeNpcInstance(npcInst); spawnInst.removeNpcInstance(npcInst);
@ -592,7 +589,7 @@ public class AutoSpawnHandler
protected int _lastLocIndex = -1; protected int _lastLocIndex = -1;
private final List<L2Npc> _npcList = new CopyOnWriteArrayList<>(); private final Queue<L2Npc> _npcList = new ConcurrentLinkedQueue<>();
private final List<Location> _locList = new CopyOnWriteArrayList<>(); private final List<Location> _locList = new CopyOnWriteArrayList<>();
@ -665,16 +662,9 @@ public class AutoSpawnHandler
return _locList.toArray(new Location[_locList.size()]); return _locList.toArray(new Location[_locList.size()]);
} }
public L2Npc[] getNPCInstanceList() public Queue<L2Npc> getNPCInstanceList()
{ {
L2Npc[] ret; return _npcList;
synchronized (_npcList)
{
ret = new L2Npc[_npcList.size()];
_npcList.toArray(ret);
}
return ret;
} }
public List<L2Spawn> getSpawns() public List<L2Spawn> getSpawns()

View File

@ -21,8 +21,6 @@ package com.l2jserver.gameserver.model.actor.instance;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.concurrent.Future; import java.util.concurrent.Future;
@ -35,7 +33,6 @@ import com.l2jserver.gameserver.ThreadPoolManager;
import com.l2jserver.gameserver.ai.CtrlIntention; import com.l2jserver.gameserver.ai.CtrlIntention;
import com.l2jserver.gameserver.data.sql.impl.CharSummonTable; import com.l2jserver.gameserver.data.sql.impl.CharSummonTable;
import com.l2jserver.gameserver.data.sql.impl.SummonEffectsTable; import com.l2jserver.gameserver.data.sql.impl.SummonEffectsTable;
import com.l2jserver.gameserver.data.sql.impl.SummonEffectsTable.SummonEffect;
import com.l2jserver.gameserver.data.xml.impl.PetDataTable; import com.l2jserver.gameserver.data.xml.impl.PetDataTable;
import com.l2jserver.gameserver.datatables.ItemTable; import com.l2jserver.gameserver.datatables.ItemTable;
import com.l2jserver.gameserver.datatables.SkillData; import com.l2jserver.gameserver.datatables.SkillData;
@ -928,17 +925,7 @@ public class L2PetInstance extends L2Summon
public final void stopSkillEffects(boolean removed, int skillId) public final void stopSkillEffects(boolean removed, int skillId)
{ {
super.stopSkillEffects(removed, skillId); super.stopSkillEffects(removed, skillId);
List<SummonEffect> effects = SummonEffectsTable.getInstance().getPetEffects().get(getControlObjectId()); SummonEffectsTable.getInstance().removePetEffects(getControlObjectId(), skillId);
if ((effects != null) && !effects.isEmpty())
{
for (SummonEffect effect : effects)
{
if (effect.getSkill().getId() == skillId)
{
SummonEffectsTable.getInstance().getPetEffects().get(getControlObjectId()).remove(effect);
}
}
}
} }
@Override @Override
@ -1013,7 +1000,7 @@ public class L2PetInstance extends L2Summon
} }
// Clear list for overwrite // Clear list for overwrite
SummonEffectsTable.getInstance().getPetEffects().getOrDefault(getControlObjectId(), Collections.emptyList()).clear(); SummonEffectsTable.getInstance().clearPetEffects(getControlObjectId());
try (Connection con = L2DatabaseFactory.getInstance().getConnection(); try (Connection con = L2DatabaseFactory.getInstance().getConnection();
PreparedStatement ps1 = con.prepareStatement(DELETE_SKILL_SAVE); PreparedStatement ps1 = con.prepareStatement(DELETE_SKILL_SAVE);
@ -1069,8 +1056,7 @@ public class L2PetInstance extends L2Summon
ps2.setInt(5, ++buff_index); ps2.setInt(5, ++buff_index);
ps2.execute(); ps2.execute();
SummonEffectsTable.getInstance().getPetEffects().putIfAbsent(getControlObjectId(), new ArrayList<>()); SummonEffectsTable.getInstance().addPetEffect(getControlObjectId(), skill, info.getTime());
SummonEffectsTable.getInstance().getPetEffects().get(getControlObjectId()).add(SummonEffectsTable.getInstance().new SummonEffect(skill, info.getTime()));
} }
} }
} }
@ -1087,7 +1073,7 @@ public class L2PetInstance extends L2Summon
PreparedStatement ps1 = con.prepareStatement(RESTORE_SKILL_SAVE); PreparedStatement ps1 = con.prepareStatement(RESTORE_SKILL_SAVE);
PreparedStatement ps2 = con.prepareStatement(DELETE_SKILL_SAVE)) PreparedStatement ps2 = con.prepareStatement(DELETE_SKILL_SAVE))
{ {
if (!SummonEffectsTable.getInstance().getPetEffects().containsKey(getControlObjectId())) if (!SummonEffectsTable.getInstance().containsPetId(getControlObjectId()))
{ {
ps1.setInt(1, getControlObjectId()); ps1.setInt(1, getControlObjectId());
try (ResultSet rset = ps1.executeQuery()) try (ResultSet rset = ps1.executeQuery())
@ -1104,12 +1090,7 @@ public class L2PetInstance extends L2Summon
if (skill.hasEffects(EffectScope.GENERAL)) if (skill.hasEffects(EffectScope.GENERAL))
{ {
if (!SummonEffectsTable.getInstance().getPetEffects().containsKey(getControlObjectId())) SummonEffectsTable.getInstance().addPetEffect(getControlObjectId(), skill, effectCurTime);
{
SummonEffectsTable.getInstance().getPetEffects().put(getControlObjectId(), new ArrayList<>());
}
SummonEffectsTable.getInstance().getPetEffects().get(getControlObjectId()).add(SummonEffectsTable.getInstance().new SummonEffect(skill, effectCurTime));
} }
} }
} }
@ -1124,18 +1105,7 @@ public class L2PetInstance extends L2Summon
} }
finally finally
{ {
if (SummonEffectsTable.getInstance().getPetEffects().get(getControlObjectId()) == null) SummonEffectsTable.getInstance().applyPetEffects(this, getControlObjectId());
{
return;
}
for (SummonEffect se : SummonEffectsTable.getInstance().getPetEffects().get(getControlObjectId()))
{
if (se != null)
{
se.getSkill().applyEffects(this, this, false, se.getEffectCurTime());
}
}
} }
} }

View File

@ -21,12 +21,8 @@ package com.l2jserver.gameserver.model.actor.instance;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.Future; import java.util.concurrent.Future;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
@ -36,7 +32,6 @@ import com.l2jserver.L2DatabaseFactory;
import com.l2jserver.gameserver.ThreadPoolManager; import com.l2jserver.gameserver.ThreadPoolManager;
import com.l2jserver.gameserver.data.sql.impl.CharSummonTable; import com.l2jserver.gameserver.data.sql.impl.CharSummonTable;
import com.l2jserver.gameserver.data.sql.impl.SummonEffectsTable; import com.l2jserver.gameserver.data.sql.impl.SummonEffectsTable;
import com.l2jserver.gameserver.data.sql.impl.SummonEffectsTable.SummonEffect;
import com.l2jserver.gameserver.datatables.SkillData; import com.l2jserver.gameserver.datatables.SkillData;
import com.l2jserver.gameserver.enums.InstanceType; import com.l2jserver.gameserver.enums.InstanceType;
import com.l2jserver.gameserver.model.L2Object; import com.l2jserver.gameserver.model.L2Object;
@ -231,22 +226,7 @@ public class L2ServitorInstance extends L2Summon implements Runnable
public final void stopSkillEffects(boolean removed, int skillId) public final void stopSkillEffects(boolean removed, int skillId)
{ {
super.stopSkillEffects(removed, skillId); super.stopSkillEffects(removed, skillId);
final Map<Integer, List<SummonEffect>> servitorEffects = SummonEffectsTable.getInstance().getServitorEffects(getOwner()); SummonEffectsTable.getInstance().removeServitorEffects(getOwner(), getReferenceSkill(), skillId);
if (servitorEffects != null)
{
final List<SummonEffect> effects = servitorEffects.get(getReferenceSkill());
if ((effects != null) && !effects.isEmpty())
{
for (SummonEffect effect : effects)
{
final Skill skill = effect.getSkill();
if ((skill != null) && (skill.getId() == skillId))
{
effects.remove(effect);
}
}
}
}
} }
@Override @Override
@ -277,10 +257,7 @@ public class L2ServitorInstance extends L2Summon implements Runnable
} }
// Clear list for overwrite // Clear list for overwrite
if (SummonEffectsTable.getInstance().getServitorEffectsOwner().getOrDefault(getOwner().getObjectId(), Collections.emptyMap()).containsKey(getOwner().getClassIndex())) SummonEffectsTable.getInstance().clearServitorEffects(getOwner(), getReferenceSkill());
{
SummonEffectsTable.getInstance().getServitorEffects(getOwner()).getOrDefault(getReferenceSkill(), Collections.emptyList()).clear();
}
try (Connection con = L2DatabaseFactory.getInstance().getConnection(); try (Connection con = L2DatabaseFactory.getInstance().getConnection();
PreparedStatement statement = con.prepareStatement(DELETE_SKILL_SAVE)) PreparedStatement statement = con.prepareStatement(DELETE_SKILL_SAVE))
@ -341,21 +318,7 @@ public class L2ServitorInstance extends L2Summon implements Runnable
ps2.setInt(7, ++buff_index); ps2.setInt(7, ++buff_index);
ps2.execute(); ps2.execute();
// XXX: Rework me! SummonEffectsTable.getInstance().addServitorEffect(getOwner(), getReferenceSkill(), skill, info.getTime());
if (!SummonEffectsTable.getInstance().getServitorEffectsOwner().containsKey(getOwner().getObjectId()))
{
SummonEffectsTable.getInstance().getServitorEffectsOwner().put(getOwner().getObjectId(), new HashMap<Integer, Map<Integer, List<SummonEffect>>>());
}
if (!SummonEffectsTable.getInstance().getServitorEffectsOwner().get(getOwner().getObjectId()).containsKey(getOwner().getClassIndex()))
{
SummonEffectsTable.getInstance().getServitorEffectsOwner().get(getOwner().getObjectId()).put(getOwner().getClassIndex(), new HashMap<Integer, List<SummonEffect>>());
}
if (!SummonEffectsTable.getInstance().getServitorEffects(getOwner()).containsKey(getReferenceSkill()))
{
SummonEffectsTable.getInstance().getServitorEffects(getOwner()).put(getReferenceSkill(), new CopyOnWriteArrayList<SummonEffect>());
}
SummonEffectsTable.getInstance().getServitorEffects(getOwner()).get(getReferenceSkill()).add(SummonEffectsTable.getInstance().new SummonEffect(skill, info.getTime()));
} }
} }
} }
@ -376,7 +339,7 @@ public class L2ServitorInstance extends L2Summon implements Runnable
try (Connection con = L2DatabaseFactory.getInstance().getConnection()) try (Connection con = L2DatabaseFactory.getInstance().getConnection())
{ {
if (!SummonEffectsTable.getInstance().getServitorEffectsOwner().containsKey(getOwner().getObjectId()) || !SummonEffectsTable.getInstance().getServitorEffectsOwner().get(getOwner().getObjectId()).containsKey(getOwner().getClassIndex()) || !SummonEffectsTable.getInstance().getServitorEffects(getOwner()).containsKey(getReferenceSkill())) if (!SummonEffectsTable.getInstance().containsSkill(getOwner(), getReferenceSkill()))
{ {
try (PreparedStatement statement = con.prepareStatement(RESTORE_SKILL_SAVE)) try (PreparedStatement statement = con.prepareStatement(RESTORE_SKILL_SAVE))
{ {
@ -395,23 +358,9 @@ public class L2ServitorInstance extends L2Summon implements Runnable
continue; continue;
} }
// XXX: Rework me!
if (skill.hasEffects(EffectScope.GENERAL)) if (skill.hasEffects(EffectScope.GENERAL))
{ {
if (!SummonEffectsTable.getInstance().getServitorEffectsOwner().containsKey(getOwner().getObjectId())) SummonEffectsTable.getInstance().addServitorEffect(getOwner(), getReferenceSkill(), skill, effectCurTime);
{
SummonEffectsTable.getInstance().getServitorEffectsOwner().put(getOwner().getObjectId(), new HashMap<Integer, Map<Integer, List<SummonEffect>>>());
}
if (!SummonEffectsTable.getInstance().getServitorEffectsOwner().get(getOwner().getObjectId()).containsKey(getOwner().getClassIndex()))
{
SummonEffectsTable.getInstance().getServitorEffectsOwner().get(getOwner().getObjectId()).put(getOwner().getClassIndex(), new HashMap<Integer, List<SummonEffect>>());
}
if (!SummonEffectsTable.getInstance().getServitorEffects(getOwner()).containsKey(getReferenceSkill()))
{
SummonEffectsTable.getInstance().getServitorEffects(getOwner()).put(getReferenceSkill(), new CopyOnWriteArrayList<SummonEffect>());
}
SummonEffectsTable.getInstance().getServitorEffects(getOwner()).get(getReferenceSkill()).add(SummonEffectsTable.getInstance().new SummonEffect(skill, effectCurTime));
} }
} }
} }
@ -432,18 +381,7 @@ public class L2ServitorInstance extends L2Summon implements Runnable
} }
finally finally
{ {
if (!SummonEffectsTable.getInstance().getServitorEffectsOwner().containsKey(getOwner().getObjectId()) || !SummonEffectsTable.getInstance().getServitorEffectsOwner().get(getOwner().getObjectId()).containsKey(getOwner().getClassIndex()) || !SummonEffectsTable.getInstance().getServitorEffects(getOwner()).containsKey(getReferenceSkill())) SummonEffectsTable.getInstance().applyServitorEffects(this, getOwner(), getReferenceSkill());
{
return;
}
for (SummonEffect se : SummonEffectsTable.getInstance().getServitorEffects(getOwner()).get(getReferenceSkill()))
{
if (se != null)
{
se.getSkill().applyEffects(this, this, false, se.getEffectCurTime());
}
}
} }
} }

View File

@ -160,13 +160,13 @@ public final class EventDispatcher
*/ */
private <T extends AbstractEventReturn> T notifyEventToMultipleContainers(IBaseEvent event, ListenersContainer[] containers, Class<T> callbackClass) private <T extends AbstractEventReturn> T notifyEventToMultipleContainers(IBaseEvent event, ListenersContainer[] containers, Class<T> callbackClass)
{ {
if (event == null)
{
throw new NullPointerException("Event cannot be null!");
}
try try
{ {
if (event == null)
{
throw new NullPointerException("Event cannot be null!");
}
T callback = null; T callback = null;
if (containers != null) if (containers != null)
{ {

View File

@ -92,7 +92,7 @@ public final class RequestDuelStart extends L2GameClientPacket
if (_partyDuel == 1) if (_partyDuel == 1)
{ {
// Player must be in a party & the party leader // Player must be in a party & the party leader
if (!activeChar.isInParty() || !(activeChar.isInParty() && activeChar.getParty().isLeader(activeChar))) if (!activeChar.isInParty() || !activeChar.getParty().isLeader(activeChar))
{ {
activeChar.sendMessage("You have to be the leader of a party in order to request a party duel."); activeChar.sendMessage("You have to be the leader of a party in order to request a party duel.");
return; return;

View File

@ -67,7 +67,7 @@ public class RequestSetCastleSiegeTime extends L2GameClientPacket
_log.log(Level.WARNING, getType() + ": activeChar: " + activeChar + " castle: " + castle + " castleId: " + _castleId + " is trying to change siege date but is not clan leader!"); _log.log(Level.WARNING, getType() + ": activeChar: " + activeChar + " castle: " + castle + " castleId: " + _castleId + " is trying to change siege date but is not clan leader!");
return; return;
} }
else if (!castle.getIsTimeRegistrationOver() && !castle.getIsTimeRegistrationOver()) else if (!castle.getIsTimeRegistrationOver())
{ {
if (isSiegeTimeValid(castle.getSiegeDate().getTimeInMillis(), _time)) if (isSiegeTimeValid(castle.getSiegeDate().getTimeInMillis(), _time))
{ {

View File

@ -19,9 +19,8 @@
package com.l2jserver.gameserver.pathfinding.cellnodes; package com.l2jserver.gameserver.pathfinding.cellnodes;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.LinkedList; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.ListIterator;
import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CopyOnWriteArrayList;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
@ -186,8 +185,6 @@ public class CellPathFinding extends PathFinding
_postFilterPlayableUses++; _postFilterPlayableUses++;
} }
int currentX, currentY, currentZ;
ListIterator<AbstractNodeLoc> middlePoint, endPoint;
boolean remove; boolean remove;
int pass = 0; int pass = 0;
do do
@ -196,19 +193,18 @@ public class CellPathFinding extends PathFinding
_postFilterPasses++; _postFilterPasses++;
remove = false; remove = false;
middlePoint = path.listIterator(); final Iterator<AbstractNodeLoc> endPoint = path.iterator();
endPoint = path.listIterator(1); int currentX = x;
currentX = x; int currentY = y;
currentY = y; int currentZ = z;
currentZ = z;
while (endPoint.hasNext()) for (int i = 0; i < path.size(); i++)
{ {
AbstractNodeLoc locMiddle = path.get(i);
AbstractNodeLoc locEnd = endPoint.next(); AbstractNodeLoc locEnd = endPoint.next();
AbstractNodeLoc locMiddle = middlePoint.next();
if (GeoData.getInstance().canMove(currentX, currentY, currentZ, locEnd.getX(), locEnd.getY(), locEnd.getZ(), instanceId)) if (GeoData.getInstance().canMove(currentX, currentY, currentZ, locEnd.getX(), locEnd.getY(), locEnd.getZ(), instanceId))
{ {
middlePoint.remove(); path.remove(i);
remove = true; remove = true;
if (debug) if (debug)
{ {
@ -228,11 +224,7 @@ public class CellPathFinding extends PathFinding
if (debug) if (debug)
{ {
middlePoint = path.listIterator(); path.forEach(n -> dropDebugItem(65, 1, n));
while (middlePoint.hasNext())
{
dropDebugItem(65, 1, middlePoint.next());
}
} }
_findSuccess++; _findSuccess++;
@ -242,7 +234,7 @@ public class CellPathFinding extends PathFinding
private List<AbstractNodeLoc> constructPath(AbstractNode node) private List<AbstractNodeLoc> constructPath(AbstractNode node)
{ {
final LinkedList<AbstractNodeLoc> path = new LinkedList<>(); final List<AbstractNodeLoc> path = new CopyOnWriteArrayList<>();
int previousDirectionX = Integer.MIN_VALUE; int previousDirectionX = Integer.MIN_VALUE;
int previousDirectionY = Integer.MIN_VALUE; int previousDirectionY = Integer.MIN_VALUE;
int directionX, directionY; int directionX, directionY;
@ -276,7 +268,7 @@ public class CellPathFinding extends PathFinding
previousDirectionX = directionX; previousDirectionX = directionX;
previousDirectionY = directionY; previousDirectionY = directionY;
path.addFirst(node.getLoc()); path.add(0, node.getLoc());
node.setLoc(null); node.setLoc(null);
} }
@ -349,7 +341,7 @@ public class CellPathFinding extends PathFinding
{ {
final int mapSize; final int mapSize;
final int count; final int count;
ArrayList<CellNodeBuffer> bufs; List<CellNodeBuffer> bufs;
int uses = 0; int uses = 0;
int playableUses = 0; int playableUses = 0;
int overflows = 0; int overflows = 0;

View File

@ -48,15 +48,18 @@ public class FaenorScriptEngine extends ScriptEngine
{ {
final File packDirectory = new File(Config.DATAPACK_ROOT, PACKAGE_DIRECTORY); final File packDirectory = new File(Config.DATAPACK_ROOT, PACKAGE_DIRECTORY);
final File[] files = packDirectory.listFiles(new XMLFilter()); final File[] files = packDirectory.listFiles(new XMLFilter());
for (File file : files) if (files != null)
{ {
try (InputStream in = new FileInputStream(file)) for (File file : files)
{ {
parseScript(new ScriptDocument(file.getName(), in), null); try (InputStream in = new FileInputStream(file))
} {
catch (IOException e) parseScript(new ScriptDocument(file.getName(), in), null);
{ }
_log.log(Level.WARNING, e.getMessage(), e); catch (IOException e)
{
_log.log(Level.WARNING, e.getMessage(), e);
}
} }
} }
} }

View File

@ -195,7 +195,13 @@ public final class L2ScriptEngineManager
{ {
if (dir.isDirectory()) if (dir.isDirectory())
{ {
for (File file : dir.listFiles()) final File[] files = dir.listFiles();
if (files == null)
{
return;
}
for (File file : files)
{ {
if (file.isDirectory() && recurseDown && (maxDepth > currentDepth)) if (file.isDirectory() && recurseDown && (maxDepth > currentDepth))
{ {

View File

@ -327,21 +327,21 @@ public class LoginController
_bannedIps.putIfAbsent(address, System.currentTimeMillis() + duration); _bannedIps.putIfAbsent(address, System.currentTimeMillis() + duration);
} }
public boolean isBannedAddress(InetAddress address) public boolean isBannedAddress(InetAddress address) throws UnknownHostException
{ {
String[] parts = address.getHostAddress().split("\\."); String[] parts = address.getHostAddress().split("\\.");
Long bi = _bannedIps.get(address); Long bi = _bannedIps.get(address);
if (bi == null) if (bi == null)
{ {
bi = _bannedIps.get(parts[0] + "." + parts[1] + "." + parts[2] + ".0"); bi = _bannedIps.get(InetAddress.getByName(parts[0] + "." + parts[1] + "." + parts[2] + ".0"));
} }
if (bi == null) if (bi == null)
{ {
bi = _bannedIps.get(parts[0] + "." + parts[1] + ".0.0"); bi = _bannedIps.get(InetAddress.getByName(parts[0] + "." + parts[1] + ".0.0"));
} }
if (bi == null) if (bi == null)
{ {
bi = _bannedIps.get(parts[0] + ".0.0.0"); bi = _bannedIps.get(InetAddress.getByName(parts[0] + ".0.0.0"));
} }
if (bi != null) if (bi != null)
{ {
@ -368,7 +368,7 @@ public class LoginController
*/ */
public boolean removeBanForAddress(InetAddress address) public boolean removeBanForAddress(InetAddress address)
{ {
return _bannedIps.remove(address.getHostAddress()) != null; return _bannedIps.remove(address) != null;
} }
/** /**

View File

@ -18,10 +18,12 @@
*/ */
package com.l2jserver.loginserver; package com.l2jserver.loginserver;
import java.net.UnknownHostException;
import java.nio.channels.SocketChannel; import java.nio.channels.SocketChannel;
import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;
import commons.mmocore.IAcceptFilter; import commons.mmocore.IAcceptFilter;
import commons.mmocore.IClientFactory; import commons.mmocore.IClientFactory;
@ -38,6 +40,7 @@ import com.l2jserver.util.IPv4Filter;
*/ */
public class SelectorHelper implements IMMOExecutor<L2LoginClient>, IClientFactory<L2LoginClient>, IAcceptFilter public class SelectorHelper implements IMMOExecutor<L2LoginClient>, IClientFactory<L2LoginClient>, IAcceptFilter
{ {
private static final Logger LOG = Logger.getLogger(LoginController.class.getName());
private final ThreadPoolExecutor _generalPacketsThreadPool; private final ThreadPoolExecutor _generalPacketsThreadPool;
private final IPv4Filter _ipv4filter; private final IPv4Filter _ipv4filter;
@ -64,6 +67,14 @@ public class SelectorHelper implements IMMOExecutor<L2LoginClient>, IClientFacto
@Override @Override
public boolean accept(SocketChannel sc) public boolean accept(SocketChannel sc)
{ {
return _ipv4filter.accept(sc) && !LoginController.getInstance().isBannedAddress(sc.socket().getInetAddress()); try
{
return _ipv4filter.accept(sc) && !LoginController.getInstance().isBannedAddress(sc.socket().getInetAddress());
}
catch (UnknownHostException e)
{
LOG.severe(SelectorHelper.class.getSimpleName() + ": Invalid address: " + sc.socket().getInetAddress() + "; " + e.getMessage());
}
return false;
} }
} }

View File

@ -34,7 +34,7 @@ import com.l2jserver.Config;
import com.l2jserver.gameserver.handler.ITelnetHandler; import com.l2jserver.gameserver.handler.ITelnetHandler;
import com.l2jserver.gameserver.handler.TelnetHandler; import com.l2jserver.gameserver.handler.TelnetHandler;
public class GameStatusThread extends Thread public final class GameStatusThread extends Thread
{ {
private static final Logger _log = Logger.getLogger(GameStatusThread.class.getName()); private static final Logger _log = Logger.getLogger(GameStatusThread.class.getName());

View File

@ -37,7 +37,7 @@ import com.l2jserver.loginserver.GameServerTable.GameServerInfo;
import com.l2jserver.loginserver.L2LoginServer; import com.l2jserver.loginserver.L2LoginServer;
import com.l2jserver.loginserver.LoginController; import com.l2jserver.loginserver.LoginController;
public class LoginStatusThread extends Thread public final class LoginStatusThread extends Thread
{ {
private static final Logger _log = Logger.getLogger(LoginStatusThread.class.getName()); private static final Logger _log = Logger.getLogger(LoginStatusThread.class.getName());

View File

@ -144,16 +144,19 @@ public interface IXmlReader
return false; return false;
} }
final File[] listOfFiles = dir.listFiles(); final File[] files = dir.listFiles();
for (File f : listOfFiles) if (files != null)
{ {
if (recursive && f.isDirectory()) for (File f : files)
{ {
parseDirectory(f, recursive); if (recursive && f.isDirectory())
} {
else if (getCurrentFileFilter().accept(f)) parseDirectory(f, recursive);
{ }
parseFile(f); else if (getCurrentFileFilter().accept(f))
{
parseFile(f);
}
} }
} }
return true; return true;