Secret Experience

Secret Experience (https://secretexperience.net/)
-   [L2J] Dúvidas (https://secretexperience.net/l2j-duvidas/)
-   -   [Interlude] Erro de String Java (https://secretexperience.net/l2j-duvidas/11233-erro-de-string-java.html)

vicfelipe 05-08-2009 01:00 PM

Erro de String Java
 
Eu estou adicionando o Fortress Siege aqui. E ao adicionar uma linha em L2PcInstance.java deu um erro, aliás foi o único erro. Esta a linha:

Citação:

public boolean isInFunEvent()
Explicação do Erro no Eclipse:

Código:

Syntax error on token "boolean", @ expected[/QUOTE]

Estou adicionando isto em L2PcInstance:
[QUOTE]Index: E:/Lineage working folder/Interlude workspace/trunk2/L2_GameServer_It/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- E:/Lineage working folder/Interlude workspace/trunk2/L2_GameServer_It/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java        (revision 1426)
+++ E:/Lineage working folder/Interlude workspace/trunk2/L2_GameServer_It/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java        (working copy)
@@ -129,6 +129,7 @@
 import net.sf.l2j.gameserver.model.entity.Duel;
 import net.sf.l2j.gameserver.model.entity.L2Event;
 import net.sf.l2j.gameserver.model.entity.Siege;
+import net.sf.l2j.gameserver.model.entity.events.FortressSiege;
 import net.sf.l2j.gameserver.model.entity.TvTEvent;
 import net.sf.l2j.gameserver.model.quest.Quest;
 import net.sf.l2j.gameserver.model.quest.QuestState;
@@ -416,6 +417,14 @@
        private int _obsZ;
        private boolean _observerMode = false;
 
+        /** FOS Engine parameters */
+        public String        _teamNameFOS;
+        public int                _originalNameColorFOS,
+                                        _countFOSKills,
+                                    _originalKarmaFOS;
+        public boolean        _inEventFOS = false,
+                                          _FOSRulerSkills = false;
+
        /** Stored from last ValidatePosition **/
        private Point3D _lastClientPosition = new Point3D(0, 0, 0);
        private Point3D _lastServerPosition = new Point3D(0, 0, 0);
@@ -526,6 +535,7 @@
        //Death Penalty Buff Level
        private int _deathPenaltyBuffLevel = 0;
 
+        private boolean _fakeHero = false;
        //GM related variables
        private boolean _isGm;
        private int _accessLevel;
@@ -2390,6 +2400,8 @@
                {
                        sendMessage("A dark force beyond your mortal understanding makes your knees to shake when you try to stand up ...");
                }
+        else if (FortressSiege._sitForced && _inEventFOS)
+            sendMessage("The Admin/GM handle if you sit or stand in this match!");
                else if (_waitTypeSitting && !isInStoreMode() && !isAlikeDead())
                {
                        if (_relax)
@@ -3387,7 +3399,14 @@
                        player.sendPacket(new ActionFailed());
                        return;
                }
-
+        if ((FortressSiege._started && !Config.FortressSiege_ALLOW_INTERFERENCE))
+        {
+            if ((_inEventFOS && !player._inEventFOS) || (!_inEventFOS && player._inEventFOS))
+            {
+                player.sendPacket(new ActionFailed());
+                return;
+            }
+        }
                // Check if the L2PcInstance is confused
                if (player.isOutOfControl())
                {
@@ -3418,7 +3437,7 @@
                        else
                        {
                                // Check if this L2PcInstance is autoAttackable
-                                if (isAutoAttackable(player))
+                                if (isAutoAttackable(player) || (player._inEventFOS && FortressSiege._started))
                                {
                                        // Player with lvl < 21 can't attack a cursed weapon holder
                                        // And a cursed weapon holder  can't attack players with lvl < 21
@@ -3456,6 +3475,11 @@
                }
        }
 
+    public boolean isInFunEvent()
+    {
+            return(atEvent || (FortressSiege._started && _inEventFOS));
+    }
+
        /**
          * Returns true if cp update should be done, false if not
          * @return boolean
@@ -4179,6 +4203,38 @@
                if (killer != null)
                {
                        L2PcInstance pk = null;
+            if ((killer instanceof L2PcInstance &&((L2PcInstance)killer)._inEventFOS) && _inEventFOS)
+            {
+                if (FortressSiege._teleport || FortressSiege._started)
+                {
+                    if (!(((L2PcInstance)killer)._teamNameFOS.equals(_teamNameFOS)))
+                        ((L2PcInstance)killer)._countFOSKills++;
+                    else{
+                        ((L2PcInstance)killer).sendMessage("Team Kills do not count as kills. They will only harm you in this event");
+                        ((L2PcInstance)killer)._countFOSKills--;
+                    }
+                    sendMessage("You will be revived and teleported to team spot in 10 seconds!");
+                    ThreadPoolManager.getInstance().scheduleGeneral(new Runnable(){
+                        public void run(){
+                            teleToLocation(FortressSiege._teamsX.get(FortressSiege._teams.indexOf(_teamNameFOS)), FortressSiege._teamsY.get(FortressSiege._teams.indexOf(_teamNameFOS)), FortressSiege._teamsZ.get(FortressSiege._teams.indexOf(_teamNameFOS)), false);
+                            doRevive();
+                            updateFOSTitleFlag();
+                        }
+                    }, 10000);
+                }
+            }
+            else if (_inEventFOS){
+                if (FortressSiege._teleport || FortressSiege._started){
+                    sendMessage("You will be revived and teleported to team spot in 10 seconds!");
+                    ThreadPoolManager.getInstance().scheduleGeneral(new Runnable(){
+                        public void run(){
+                                teleToLocation(FortressSiege._teamsX.get(FortressSiege._teams.indexOf(_teamNameFOS)), FortressSiege._teamsY.get(FortressSiege._teams.indexOf(_teamNameFOS)), FortressSiege._teamsZ.get(FortressSiege._teams.indexOf(_teamNameFOS)), false);                           
+                            doRevive();
+                            updateFOSTitleFlag();
+                        }
+                    }, 10000);
+                }
+            }
                        if (killer instanceof L2PcInstance)
                                pk = (L2PcInstance) killer;
 
@@ -4268,7 +4324,7 @@
 
        private void onDieDropItem(L2Character killer)
        {
-                if (atEvent || killer == null)
+                if (atEvent || (FortressSiege._started && _inEventFOS) || killer == null)
            return;
 
                if (getKarma()<=0
@@ -4384,6 +4440,7 @@
        {
                if (target == null) return;
                if (!(target instanceof L2PlayableInstance)) return;
+                if (_inEventFOS) return;
 
                L2PcInstance targetPlayer = null;
                if (target instanceof L2PcInstance)
@@ -4458,6 +4515,9 @@
      */
    public void increasePvpKills()
    {
+        if ((FortressSiege._started && _inEventFOS))
+            return;
+
        // Add karma to attacker and increase its PK counter
        setPvpKills(getPvpKills() + 1);
 
@@ -4472,7 +4532,9 @@
      */
    public void increasePkKillsAndKarma(int targLVL)
    {
-        int baseKarma          = Config.KARMA_MIN_KARMA;
+        if ((FortressSiege._started && _inEventFOS))
+            return;
+            int baseKarma          = Config.KARMA_MIN_KARMA;
        int newKarma            = baseKarma;
        int karmaLimit          = Config.KARMA_MAX_KARMA;
 
@@ -4543,6 +4605,7 @@
        public void updatePvPStatus()
        {
                if (isInsideZone(ZONE_PVP)) return;
+                if ((FortressSiege._started && _inEventFOS)) return;
                setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_NORMAL_TIME);
 
                if (getPvpFlag() == 0)
@@ -4560,7 +4623,8 @@
 
        if (player_target == null)
            return;
-
+        if ((_inEventFOS && FortressSiege._started && player_target._inEventFOS)) 
+            return;
        if ((isInDuel() && player_target.getDuelId() == getDuelId())) return;
        if ((!isInsideZone(ZONE_PVP) || !player_target.isInsideZone(ZONE_PVP)) && player_target.getKarma() == 0)
        {
@@ -4618,7 +4682,7 @@
 
                // Calculate the Experience loss
                long lostExp = 0;
-                if (!atEvent)
+                if (!atEvent && !_inEventFOS)
                        if (lvl < Experience.MAX_LEVEL)
                                lostExp = Math.round((getStat().getExpForLevel(lvl+1) - getStat().getExpForLevel(lvl)) * percentLost /100);
                        else
@@ -7216,7 +7280,7 @@
                        }
 
                        // Check if a Forced ATTACK is in progress on non-attackable target
-                        if (!target.isAutoAttackable(this) && !forceUse &&
+                        if (!target.isAutoAttackable(this) && !forceUse && !(_inEventFOS && FortressSiege._started) &&
                                        sklTargetType != SkillTargetType.TARGET_AURA &&
                                        sklTargetType != SkillTargetType.TARGET_CLAN &&
                                        sklTargetType != SkillTargetType.TARGET_ALLY &&
@@ -7331,25 +7395,33 @@
                        case TARGET_SELF:
                                break;
                        default:
-                                if (!checkPvpSkill(target, skill) && (getAccessLevel() < Config.GM_PEACEATTACK))
+                if (!checkPvpSkill(target, skill) && (getAccessLevel() < Config.GM_PEACEATTACK))
                {
-                                        // Send a System Message to the L2PcInstance
-                                        sendPacket(new SystemMessage(SystemMessageId.TARGET_IS_INCORRECT));
+                            // Send a System Message to the L2PcInstance
+                            sendPacket(new SystemMessage(SystemMessageId.TARGET_IS_INCORRECT));
+       
+                            // Send a Server->Client packet ActionFailed to the L2PcInstance
+                            sendPacket(new ActionFailed());
+                            return;
+                }
+        }
+        if (sklTargetType == SkillTargetType.TARGET_HOLY &&
+                (!FortressSiege.checkIfOkToCastSealOfRule(this) && !TakeCastle.checkIfOkToCastSealOfRule(this, false)))
+        {
+            sendPacket(new ActionFailed());
+            abortCast();
+            return;
+        }
+        if (sklTargetType == SkillTargetType.TARGET_HOLY && FortressSiege.checkIfOkToCastSealOfRule(this))
+                FortressSiege.Announcements(getName()+" from team "+FortressSiege._teams.get(0)+" has begun engraving the Artifact.");
 
-                                        // Send a Server->Client packet ActionFailed to the L2PcInstance
-                                        sendPacket(new ActionFailed());
-                                        return;
-                                }
-                }
-
-        if (sklTargetType == SkillTargetType.TARGET_HOLY &&
-                        !TakeCastle.checkIfOkToCastSealOfRule(this, false))
+        if (sklType == SkillType.SIEGEFLAG &&
+                        !SiegeFlag.checkIfOkToPlaceFlag(this, false))
        {
            sendPacket(new ActionFailed());
            abortCast();
            return;
        }
-
        if (sklType == SkillType.SIEGEFLAG &&
                        !SiegeFlag.checkIfOkToPlaceFlag(this, false))
        {
@@ -7403,6 +7475,9 @@
          */
        public boolean checkPvpSkill(L2Object target, L2Skill skill)
        {
+        if ((_inEventFOS && FortressSiege._started))
+            return true;
+
                // check for PC->PC Pvp status
                if (
                                target != null &&                                                                  // target not null and
@@ -8110,6 +8185,10 @@
                return _blockList;
        }
 
+        public void setFakeHero(boolean hero){
+                _fakeHero = hero;
+    }
+
        public void setHero(boolean hero)
        {
                if (hero && _baseClass == _activeClass)
@@ -8141,6 +8220,12 @@
                return _OlympiadStart;
        }
 
+
+    public boolean isFakeHero()
+    {
+        return _fakeHero;
+    }
+
    public boolean isHero()
    {
        return _hero;
@@ -8672,6 +8757,18 @@
        return true;
    }
 
+    public boolean checkFOS(){
+            return FortressSiege.checkIfOkToCastSealOfRule(this);
+    }
+
+    public Map<Integer,L2Skill> returnSkills(){
+            return _skills;
+    }
+
+    public void updateFOSTitleFlag(){
+            FortressSiege.setTitleSiegeFlags(this);
+    }
+
        public void stopWarnUserTakeBreak()
        {
                if (_taskWarnUserTakeBreak != null)
@@ -8887,6 +8984,12 @@
                        if (!DimensionalRiftManager.getInstance().checkIfInPeaceZone(getX(), getY(), getZ()))
                                getParty().getDimensionalRift().memberRessurected(this);
                }
+        if((_inEventFOS && FortressSiege._started && Config.FortressSiege_REVIVE_RECOVERY))
+        {
+            getStatus().setCurrentHp(getMaxHp());
+            getStatus().setCurrentMp(getMaxMp());
+            getStatus().setCurrentCp(getMaxCp());
+        }

Alguem saberia como corrigir este erro?

Obrigado.

KaL 05-08-2009 01:38 PM

Tente sobrescrever o método com erro.
Coloque @Override na linha superior e veja se o erro sai, e depois teste se o evento funciona normalmente, caso não funcione ou o erro persista, compile com o erro e mostre qual é a mensagem de erro na compilação.

vicfelipe 05-08-2009 02:22 PM

Fiz o que você disse, mas o erro persistiu e ao compilar mostrou este erro:
Citação:

[javac] C:\projetos\Equal-GameServer\java\com\equal\gameserver\model\actor\i nstance\L2PcInstance.java:3681: illegal start of expression
[javac] public boolean isInFunEvent()
[javac] ^
[javac] C:\projetos\Equal-GameServer\java\com\equal\gameserver\model\actor\i nstance\L2PcInstance.java:3681: ';' expected
[javac] public boolean isInFunEvent()
[javac] ^
[javac] 2 errors



Horários baseados na GMT -3. Agora são 04:37 AM.

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