Skip to content

Instantly share code, notes, and snippets.

@Sdwz
Created April 22, 2014 09:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sdwz/11172179 to your computer and use it in GitHub Desktop.
Save Sdwz/11172179 to your computer and use it in GitHub Desktop.
Correction for golem buffs skillz
Index: dp/dist/game/data/stats/skills/00800-00899.xml
===================================================================
--- dp/dist/game/data/stats/skills/00800-00899.xml (révision 521)
+++ dp/dist/game/data/stats/skills/00800-00899.xml (copie de travail)
@@ -452,7 +452,7 @@
<set name="reuseDelay" val="2000" />
<set name="targetType" val="SERVITOR" />
<cond msgId="144">
- <target npcRace="CONSTRUCT" />
+ <target summonRace="CONSTRUCT" />
</cond>
<for>
<effect name="HealPercent">
@@ -482,7 +482,7 @@
<set name="reuseDelay" val="2000" />
<set name="targetType" val="SERVITOR" />
<cond msgId="144">
- <target npcRace="CONSTRUCT" />
+ <target summonRace="CONSTRUCT" />
</cond>
<for>
<effect name="Buff">
@@ -513,7 +513,7 @@
<set name="reuseDelay" val="2000" />
<set name="targetType" val="SERVITOR" />
<cond msgId="144">
- <target npcRace="CONSTRUCT" />
+ <target summonRace="CONSTRUCT" />
</cond>
<for>
<effect name="Buff">
Index: server/java/com/l2jserver/gameserver/engines/DocumentBase.java
===================================================================
--- server/java/com/l2jserver/gameserver/engines/DocumentBase.java (révision 521)
+++ server/java/com/l2jserver/gameserver/engines/DocumentBase.java (copie de travail)
@@ -119,6 +119,7 @@
import com.l2jserver.gameserver.model.conditions.ConditionTargetNpcType;
import com.l2jserver.gameserver.model.conditions.ConditionTargetPlayable;
import com.l2jserver.gameserver.model.conditions.ConditionTargetRace;
+import com.l2jserver.gameserver.model.conditions.ConditionTargetSummonRace;
import com.l2jserver.gameserver.model.conditions.ConditionTargetUsesWeaponKind;
import com.l2jserver.gameserver.model.conditions.ConditionTargetWeight;
import com.l2jserver.gameserver.model.conditions.ConditionUsingItemType;
@@ -1067,6 +1068,18 @@
cond = joinAnd(cond, new ConditionTargetNpcRace(array));
break;
}
+ case "summonrace":
+ {
+ // used for summon race
+ final String[] values = a.getNodeValue().split(",");
+ final Set<NpcRace> array = new HashSet<>(values.length);
+ for (String value : values)
+ {
+ array.add(NpcRace.valueOf(getValue(value, null)));
+ }
+ cond = joinAnd(cond, new ConditionTargetSummonRace(array));
+ break;
+ }
case "races":
{
// used for pc race
Index: server/java/com/l2jserver/gameserver/model/conditions/ConditionTargetSummonRace.java
===================================================================
--- server/java/com/l2jserver/gameserver/model/conditions/ConditionTargetSummonRace.java (révision 0)
+++ server/java/com/l2jserver/gameserver/model/conditions/ConditionTargetSummonRace.java (copie de travail)
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2004-2014 L2J Server
+ *
+ * This file is part of L2J Server.
+ *
+ * L2J Server 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.
+ *
+ * L2J Server 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 com.l2jserver.gameserver.model.conditions;
+
+import java.util.Set;
+
+import com.l2jserver.gameserver.enums.NpcRace;
+import com.l2jserver.gameserver.model.actor.L2Summon;
+import com.l2jserver.gameserver.model.stats.Env;
+
+/**
+ * Condition that checks target Summon race.
+ * @author Sdw
+ */
+public class ConditionTargetSummonRace extends Condition
+{
+ private final Set<NpcRace> _races;
+
+ /**
+ * Instantiates a new condition target Summon race
+ * @param races the races
+ */
+ public ConditionTargetSummonRace(Set<NpcRace> races)
+ {
+ _races = races;
+ }
+
+ @Override
+ public boolean testImpl(Env env)
+ {
+ final L2Summon summon = env.getTarget() instanceof L2Summon ? (L2Summon) env.getTarget() : null;
+ return (summon != null) && _races.contains(summon.getTemplate().getRace());
+ }
+}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment