Secret Experience

Secret Experience (https://secretexperience.net/)
-   [Lineage] Java Mods (https://secretexperience.net/lineage-java-mods/)
-   -   [L2JServer] Mirage skill fix (https://secretexperience.net/lineage-java-mods/32603-mirage-skill-fix.html)

allanalcantara 16-08-2011 12:26 PM

Mirage skill fix
 
1 Anexo(s)
ajudando aew quando poder. ^^'


Código:

Index: java/net/sf/l2j/gameserver/model/L2Skill.java
===================================================================
--- java/net/sf/l2j/gameserver/model/L2Skill.java (revision 95)
+++ java/net/sf/l2j/gameserver/model/L2Skill.java (revision 108)
@@ -24,4 +24,6 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
+
+import eXtr3me.gameserver.model.L2Skill.SkillOpType;
 
 import javolution.text.TextBuilder;
@@ -85,5 +87,5 @@
 
    public static enum SkillOpType {
-        OP_PASSIVE, OP_ACTIVE, OP_TOGGLE
+        OP_PASSIVE, OP_ACTIVE, OP_TOGGLE, OP_CHANCE
    }
 
@@ -474,4 +476,12 @@
    protected EffectTemplate[] _effectTemplatesSelf;
 
+        private int _triggeredId;
+
+        private int _triggeredLevel;
+
+        private boolean _bestow;
+
+        private boolean _bestowed;
+
    protected L2Skill(StatsSet set)
    {
@@ -2182,3 +2192,34 @@
        return "" + _name + "[id=" + _id + ",lvl=" + _level + "]";
    }
+
+    public int getTriggeredId()
+    {
+        return _triggeredId;
+    }
+
+    public int getTriggeredLevel()
+    {
+        return _triggeredLevel;
+    }
+
+    public boolean bestowTriggered()
+    {
+            return _bestow;
+    }
+   
+    public boolean bestowed()
+    {
+            return _bestowed;
+    }
+   
+    public boolean triggerAnotherSkill()
+    {
+            return _triggeredId > 1;
+    }
+
+    public final boolean isChance()
+    {
+        return _operateType == SkillOpType.OP_CHANCE;
+    }
+
 }
Index: java/net/sf/l2j/gameserver/model/L2Character.java
===================================================================
--- java/net/sf/l2j/gameserver/model/L2Character.java (revision 84)
+++ java/net/sf/l2j/gameserver/model/L2Character.java (revision 108)
@@ -29,4 +29,6 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
+
+import com.extr3me.gameserver.model.L2Skill;
 
 import eXtr3me.gameserver.model.L2Effect;
@@ -6016,4 +6018,6 @@
        private long _pvpFlagLasts;
 
+        private Object _chanceSkills;
+
        public void setPvpFlagLasts(long time)
        {
@@ -6252,3 +6256,25 @@
        public void setForceBuff(ForceBuff fb)
        {}
+       
+        public L2Skill removeSkill(int skillId) {
+                // Remove the skill from the L2Character _skills
+                L2Skill oldSkill = _skills.remove(skillId);
+                // Remove all its Func objects from the L2Character calculator set
+                if (oldSkill != null) {
+                        // Stop casting if this skill is used right now
+                        if (getLastSkillCast() != null && isCastingNow()) {
+                                if (oldSkill.getId() == getLastSkillCast().getId())
+                                        abortCast();
+                        }
+
+                        if (oldSkill.isChance() && _chanceSkills != null) {
+                                removeSkill(oldSkill.getId());
+                        }
+                        removeStatsOwner(oldSkill);
+                }
+                return oldSkill;
+
+
+        }
+
 }
Index: java/net/sf/l2j/gameserver/skills/effects/EffectBestowSkill.java
===================================================================
--- java/net/sf/l2j/gameserver/skills/effects/EffectBestowSkill.java (revision 108)
+++ java/net/sf/l2j/gameserver/skills/effects/EffectBestowSkill.java (revision 108)
@@ -0,0 +1,77 @@
+/*
+ * 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 com.extr3me.gameserver.skills.effects;
+
+import com.extr3me.gameserver.datatables.SkillTable;
+import com.extr3me.gameserver.model.L2Effect;
+import com.extr3me.gameserver.model.L2Skill;
+import com.extr3me.gameserver.skills.Env;
+
+/**
+ * @author Equal
+ */
+final class EffectBestowSkill extends L2Effect
+{
+        public EffectBestowSkill(Env env, EffectTemplate template)
+        {
+                super(env, template);
+        }
+       
+        /**
+        *
+        * @see eXtr3me.gameserver.model.L2Effect#getEffectType()
+        */
+        @Override
+        public EffectType getEffectType()
+        {
+                return EffectType.BUFF;
+        }
+       
+        /**
+        *
+        * @see eXtr3me.gameserver.model.L2Effect#onStart()
+        */
+        @Override
+        public void onStart()
+        {
+                L2Skill tempSkill = SkillTable.getInstance().getInfo(getSkill().getTriggeredId(), getSkill().getTriggeredLevel());
+                if (tempSkill != null)
+                {
+                        getEffected().addSkill(tempSkill);
+                        return;
+                }
+                return;
+        }
+       
+        /**
+        *
+        * @see eXtr3me.gameserver.model.L2Effect#onExit()
+        */
+        @Override
+        public void onExit()
+        {
+                getEffected().removeSkill(getSkill().getTriggeredId());
+        }
+       
+        /**
+        *
+        * @see eXtr3me.gameserver.model.L2Effect#onActionTime()
+        */
+        @Override
+        public boolean onActionTime()
+        {
+                return false;
+        }
+}


xdavison 02-01-2012 03:41 AM

U que ele fais exatamente no skill?

OliverSykes 02-01-2012 02:38 PM

Mano a mirage é skill do dagger quando tu usa os caras te hitam e perdem o target ai apenas ta corrigindo ela porque nas muitas revs existentes ela esta com erro


Horários baseados na GMT -3. Agora são 06:50 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0