Autor Tema: [RESUELTO] Creando Zona Craft /Sell /Buy - Problema  (Leído 103 veces)

0 Usuarios y 1 Visitante están viendo este tema.

Desconectado DeadEnd

  • Moderador L2j
  • *
  • Topic Author
  • Mensajes: 735
  • ar
  • Agradecimientos: 44
  • https://www.l2fairplay.net
    • Fair Play
  • Cronica: : Interlude
  • Revision: Custom
  • S.O: Windows Server 2012
  • Serverpack : L2jForzen
[RESUELTO] Creando Zona Craft /Sell /Buy - Problema
« en: Noviembre 02, 2018, 09:28:23 pm »
gracias
Este post tiene 0 agradecimientos
  • Añade a tus favoritos
  • Buenas gente estoy creando unas zonas para limitar donde se abren privates store y no entiendo por que sucede lo siguiente :


    Código: [Seleccionar]
    /* L2jFrozen Project - www.l2jfrozen.com 
     *
     * 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 2, 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, write to the Free Software
     * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
     * 02111-1307, USA.
     *
     * http://www.gnu.org/copyleft/gpl.html
     */
    package com.l2jfrozen.gameserver.model.zone.type;

    import com.l2jfrozen.gameserver.model.L2Character;
    import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
    import com.l2jfrozen.gameserver.model.zone.L2ZoneType;

    /**
     * Zone where store is not allowed.
     * @author StarCOM
     */
    public class L2SellZone extends L2ZoneType
    {
    public L2SellZone(final int id)
    {
    super(id);
    }

    @Override
    protected void onEnter(final L2Character character)
    {
    character.setInsideZone(L2Character.ZONE_PEACE, true);
    character.setInsideZone(L2Character.SELL_ZONE, true);

    character.setInsideZone(L2Character.BUY_ZONE, false);
    character.setInsideZone(L2Character.CRAFT_ZONE, false);

    if (character.isInsideZone(L2Character.CRAFT_ZONE))
    LOGGER.info("in craftzone while sell" + character);
    if (character.isInsideZone(L2Character.SELL_ZONE))
    LOGGER.info("in sellzone while sell" + character);
    if (character.isInsideZone(L2Character.BUY_ZONE))
    LOGGER.info("in buyzone while sell" + character);

            if (character instanceof L2PcInstance)
            {
            L2PcInstance activeChar = ((L2PcInstance) character);
            activeChar.sendMessage("You entered into a Private Store Sell Zone.");
            }
    }

    @Override
    protected void onExit(final L2Character character)
    {
    character.setInsideZone(L2Character.ZONE_PEACE, true);
    character.setInsideZone(L2Character.SELL_ZONE, false);
    character.setInsideZone(L2Character.BUY_ZONE, false);
    character.setInsideZone(L2Character.CRAFT_ZONE, false);

    if (!character.isInsideZone(L2Character.CRAFT_ZONE))
    LOGGER.info("out craftzone while sell" + character);
    if (!character.isInsideZone(L2Character.SELL_ZONE))
    LOGGER.info("out sellzone while sell" + character);
    if (!character.isInsideZone(L2Character.BUY_ZONE))
    LOGGER.info("out buyzone while sell" + character);

    if (character instanceof L2PcInstance)
    {
                L2PcInstance activeChar = ((L2PcInstance) character);
                activeChar.sendMessage("You just left a Private Store Sell Zone.");
    }
    }

    @Override
    public void onDieInside(final L2Character character)
    {
    }

    @Override
    public void onReviveInside(final L2Character character)
    {
    }
    }

    con ese codigo, cuando un personaje entra a la zona, en pantalla me imprime que entra a las 3 zonas, aunque yo le ponga false como lo ven, pero aqui  en buyzone y craftzone no lo hace me anda bien, me explican cual es la diferencia que no logro verla o que deberia hacer para que no pase?


    Código: [Seleccionar]
    /* L2jFrozen Project - www.l2jfrozen.com 
     *
     * 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 2, 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, write to the Free Software
     * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
     * 02111-1307, USA.
     *
     * http://www.gnu.org/copyleft/gpl.html
     */
    package com.l2jfrozen.gameserver.model.zone.type;

    import com.l2jfrozen.gameserver.model.L2Character;
    import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
    import com.l2jfrozen.gameserver.model.zone.L2ZoneType;

    /**
     * Zone where store is not allowed.
     * @author StarCOM
     */
    public class L2BuyZone extends L2ZoneType
    {
    public L2BuyZone(final int id)
    {
    super(id);
    }

    @Override
    protected void onEnter(final L2Character character)
    {
    character.setInsideZone(L2Character.ZONE_PEACE, true);
    character.setInsideZone(L2Character.BUY_ZONE, true);

    character.setInsideZone(L2Character.CRAFT_ZONE, false);
    character.setInsideZone(L2Character.SELL_ZONE, false);

    if (character.isInsideZone(L2Character.CRAFT_ZONE))
    LOGGER.info("in craftzone while buy" + character);
    if (character.isInsideZone(L2Character.SELL_ZONE))
    LOGGER.info("in sellzone while buy" + character);
    if (character.isInsideZone(L2Character.BUY_ZONE))
    LOGGER.info("in buyzone while buy" + character);

    if (character instanceof L2PcInstance)
    {
                L2PcInstance activeChar = ((L2PcInstance) character);
                activeChar.sendMessage("You entered into a Private Store Buy Zone.");
    }
    }

    @Override
    protected void onExit(final L2Character character)
    {
    character.setInsideZone(L2Character.ZONE_PEACE, true);
    character.setInsideZone(L2Character.BUY_ZONE, false);
    character.setInsideZone(L2Character.CRAFT_ZONE, false);
    character.setInsideZone(L2Character.SELL_ZONE, false);

    if (!character.isInsideZone(L2Character.CRAFT_ZONE))
    LOGGER.info("out craftzone while buy" + character);
    if (!character.isInsideZone(L2Character.SELL_ZONE))
    LOGGER.info("out sellzone while buy" + character);
    if (!character.isInsideZone(L2Character.BUY_ZONE))
    LOGGER.info("out buyzone while buy" + character);

    if (character instanceof L2PcInstance)
    {
                L2PcInstance activeChar = ((L2PcInstance) character);
                activeChar.sendMessage("You just left a Private Store Buy Zone.");
    }
    }

    @Override
    public void onDieInside(final L2Character character)
    {
    }

    @Override
    public void onReviveInside(final L2Character character)
    {
    }
    }


    Código: [Seleccionar]
    /* L2jFrozen Project - www.l2jfrozen.com 
     *
     * 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 2, 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, write to the Free Software
     * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
     * 02111-1307, USA.
     *
     * http://www.gnu.org/copyleft/gpl.html
     */
    package com.l2jfrozen.gameserver.model.zone.type;

    import com.l2jfrozen.gameserver.model.L2Character;
    import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
    import com.l2jfrozen.gameserver.model.zone.L2ZoneType;

    /**
     * Zone where store is not allowed.
     * @author StarCOM
     */
    public class L2CraftZone extends L2ZoneType
    {
    public L2CraftZone(final int id)
    {
    super(id);
    }

    @Override
    protected void onEnter(final L2Character character)
    {
    character.setInsideZone(L2Character.ZONE_PEACE, true);
    character.setInsideZone(L2Character.CRAFT_ZONE, true);

    character.setInsideZone(L2Character.SELL_ZONE, false);
    character.setInsideZone(L2Character.BUY_ZONE, false);

    if (character.isInsideZone(L2Character.CRAFT_ZONE))
    LOGGER.info("in craftzone while craft" + character);
    if (character.isInsideZone(L2Character.SELL_ZONE))
    LOGGER.info("in sellzone while craft" + character);
    if (character.isInsideZone(L2Character.BUY_ZONE))
    LOGGER.info("in buyzone while craft" + character);

    if (character instanceof L2PcInstance)
    {
                L2PcInstance activeChar = ((L2PcInstance) character);
                activeChar.sendMessage("You entered into a Private Store Manufacture Zone.");
            }
    }

    @Override
    protected void onExit(final L2Character character)
    {
    character.setInsideZone(L2Character.ZONE_PEACE, true);
    character.setInsideZone(L2Character.CRAFT_ZONE, false);
    character.setInsideZone(L2Character.BUY_ZONE, false);
    character.setInsideZone(L2Character.SELL_ZONE, false);

    if (!character.isInsideZone(L2Character.CRAFT_ZONE))
    LOGGER.info("out craftzone while craft" + character);
    if (!character.isInsideZone(L2Character.SELL_ZONE))
    LOGGER.info("out sellzone while craft" + character);
    if (!character.isInsideZone(L2Character.BUY_ZONE))
    LOGGER.info("out buyzone while craft" + character);

    if (character instanceof L2PcInstance)
    {
                L2PcInstance activeChar = ((L2PcInstance) character);
                activeChar.sendMessage("You just left a Private Store Manufacture Zone.");
    }
    }

    @Override
    public void onDieInside(final L2Character character)
    {
    }

    @Override
    public void onReviveInside(final L2Character character)
    {
    }
    }

    Desde ya muchas gracias
    « Última modificación: Noviembre 03, 2018, 09:46:35 am por DeadEnd »

    Desconectado DeadEnd

    • Moderador L2j
    • *
    • Topic Author
    • Mensajes: 735
    • ar
    • Agradecimientos: 44
    • https://www.l2fairplay.net
      • Fair Play
    • Cronica: : Interlude
    • Revision: Custom
    • S.O: Windows Server 2012
    • Serverpack : L2jForzen
    A kerb1 le gusta este post.

    Re:Creando Zona Craft /Sell /Buy - Problema
    « Respuesta #1 en: Noviembre 03, 2018, 09:46:10 am »
    gracias
    Este post tiene 1 agradecimientos
  • Añade a tus favoritos
    Resuelto:

    L2Character.java

    las zonas en frozen deben ser por numeros binarios

       public static final int SELL_ZONE = 131072;
       public static final int BUY_ZONE = 262144;
       public static final int CRAFT_ZONE = 524288;

    Agradecimientos enormes a @Fissban