Jump to content
  • 0

Question

Posted

I'm trying to adapt clanfull mode for fandc H5

 

Mode original:

 

 

package net.sf.l2j.gameserver.handler.admincommandhandlers;

import net.sf.l2j.gameserver.datatables.SkillTable;
import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
import net.sf.l2j.gameserver.model.L2Object;
import net.sf.l2j.gameserver.model.L2Skill;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.network.serverpackets.ExShowScreenMessage;

/**
 * @author Bluur
 *
 */
public class AdminClanFull implements IAdminCommandHandler
{
    private static final String[] commands = {"admin_clanfull"};

    private static final int reputation = 30000000;
    private static final byte level = 8;
    
    //id skills
    private static final int[] clanSkills =
    {
        370,
        371,
        372,
        373,
        374,
        375,
        376,
        377,
        378,
        379,
        380,
        381,
        382,
        383,
        384,
        385,
        386,
        387,
        388,
        389,
        390,
        391
    };
    
    @Override
    public boolean useAdminCommand(String command, L2PcInstance activeChar)
    {
        L2Object target = activeChar.getTarget();
        L2PcInstance player = null;
        
        if (target != null && target instanceof L2PcInstance)
            player = (L2PcInstance) target;
        else
            return false;
            
        if (player.isClanLeader())
        {
             player.getClan().changeLevel(level);    
             player.getClan().addReputationScore(reputation);
           
             for (int s : clanSkills)
             {
                 L2Skill clanSkill = SkillTable.getInstance().getInfo(s, SkillTable.getInstance().getMaxLevel(s));
                 player.getClan().addNewSkill(clanSkill);
             }
         
             player.getClan().updateClanInDB();
             player.sendSkillList();
             player.sendPacket(new ExShowScreenMessage("Seu Clan esta Full! Obrigado!", 8000));        
             activeChar.sendMessage("[Clan Full]: Foi adicionado com sucesso!");
        }
        else
            activeChar.sendMessage("O target precisa ser Lider de clan.");
          
        return true;
    }

    @Override
    public String[] getAdminCommandList()
    {
        return commands;
    }
}

 

-------------------

 

my adaptation

 

public class AdminClanFull implements IAdminCommandHandler
{
    private static enum Commands
    {
        admin_clanfull
    }

    private static final int reputation = 10000;
    private static final byte level = 11;
    
    //id skills
    private static final int[] clanSkills =
    {
        370,
        371,
        372,
        373,
        374,
        375,
        376,
        377,
        378,
        379,
        380,
        381,
        382,
        383,
        384,
        385,
        386,
        387,
        388,
        389,
        390,
        391
    };
    
    @SuppressWarnings("rawtypes")
    @Override
    public boolean useAdminCommand(Enum comm, String[] wordList, String fullString, Player activeChar)
    {
        GameObject target = activeChar.getTarget();
        Player player = activeChar;
        
        if (target != null && target instanceof Player)
            player = (Player) target;
        else
            return false;
            
        if (player.isClanLeader())
        {
             player.getClan().setLevel(level);
         
             player.getClan().updateClanInDB();
             activeChar.sendPacket(new SkillList(activeChar));
             player.sendMessage("Server Reports: Dear reader, you now have full Clan, Congratulations.");            
             activeChar.sendMessage("[Clan Full]: It was successfully added!");
        }
        else
            activeChar.sendMessage("The target needs to be clan leader.");
          
        return true;
    }

    @Override
    public Enum[] getAdminCommandEnum()
    {
        return Commands.values();
    }
}

 

 

I'm in trouble this part

 

 

player.getClan().addReputationScore(reputation);
           
             for (int s : clanSkills)
             {
                 L2Skill clanSkill = SkillTable.getInstance().getInfo(s, SkillTable.getInstance().getMaxLevel(s));
                 player.getClan().addNewSkill(clanSkill);
             }

 

 

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...