Noticias:

Debes de estar registrado para poder ver el contenido indicado. Registrate o Conectate

Menú Principal

Item Recomendacion

Iniciado por Swarlog, Ago 19, 2022, 01:29 AM

Tema anterior - Siguiente tema

Swarlog

Code para un item que te da ''full rec'' independientemente de la cantidad que hayas configurado como rec maximo.

Index: head-src/com/l2jfrozen/gameserver/handler/itemhandlers/RecommendItem.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/handler/itemhandlers/RecommendItem.java (revision 1004)
+++ head-src/com/l2jfrozen/gameserver/handler/itemhandlers/RecommendItem.java (working copy)
@@ -0,0 +0,0 @@

/*
 * 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.l2jfrozen.gameserver.handler.itemhandlers;

import com.l2jfrozen.Config;
import com.l2jfrozen.gameserver.handler.IItemHandler;
import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.model.actor.instance.L2PlayableInstance;

/**
 * @author CAI
 *
 */
public class RecommendItem implements IItemHandler
{

    private static final int ITEM_IDS[] = {
        17777
    };

    public int[] getItemIds()
    {
        return ITEM_IDS;
    }

    public void useItem(L2PlayableInstance playable, L2ItemInstance item)
    {
        if(!(playable instanceof L2PcInstance))
            return;
        L2PcInstance activeChar = (L2PcInstance)playable;
        {
        playable.destroyItem("Consume", item.getObjectId(), 1, null, false);
        /**el player tendra el maximo de rec posible, configurado en ''Config.ALT_RECOMMENDATIONS_NUMBER''*/
        activeChar.setRecomHave(Config.ALT_RECOMMENDATIONS_NUMBER);
        activeChar.sendMessage("Congratulations! now you have the maximun recommendation posible!.");
           activeChar.broadcastUserInfo();
        }
       
    }
   
}
/ No new line at the end of the code

Creditos: CAI