Показать сообщение отдельно
Непрочитано 20.02.2010, 18:30   #82
Герой

Автор темы (Топик Стартер) Re: La2Phoenix rev. 17352M (шара.)

Цитата:
Сообщение от invalid Посмотреть сообщение
Выложи просто так) я спасибками каждый твой пост затыкаю) больше просто нет ничё((((
Хорошо я выложу, но сразу говорю, я просто переписал под феникс энчантер с панели гудшадов.

PHP код:
package services.PVPCommunityBoard;

import javolution.util.FastList;
import l2p.extensions.scripts.Functions;
import l2p.extensions.scripts.ScriptFile;
import l2p.gameserver.model.items.Inventory;
import l2p.gameserver.model.L2Object;
import l2p.gameserver.model.L2Player;
import l2p.gameserver.model.L2Skill;
import l2p.gameserver.model.items.L2ItemInstance;
import l2p.gameserver.tables.SkillTable;
import l2p.gameserver.templates.L2Item;
import l2p.gameserver.model.base.PlayerAccess;
import l2p.gameserver.model.items.PcInventory;
import l2p.gameserver.serverpackets.*;
import l2p.util.Log;

public class 
EnchCB extends Functions implements ScriptFile
{
    
    private static final 
int MONEY_ID 4356// ID вещи за которую точим шмот и преобретаем статусы
    
private static final int ENCHANT_WEAPON_NUMBER_LIST[] = {
        
10152025
    
}; // Уровни заточки оружия
    
private static final int ENCHANT_WEAPON_COAL_LIST[] = {
        
15304570
    
}; // Цена заточки оружия
    
private static final int ENCHANT_ARMOR_NUMBER_LIST[] = {
        
10152025
    
}; // Уровни заточки брони
    
private static final int ENCHANT_ARMOR_COAL_LIST[] = {
        
15304570
    
}; // Цена заточки брони
    
private static final int ENCHANT_JEWEL_NUMBER_LIST[] = {
        
10152025
    
}; // Уровни заточки Бижы
    
private static final int ENCHANT_JEWEL_COAL_LIST[] = {
        
304570100
    
}; // Цена заточки Бижы

    
private static int hmsg;
    private static 
boolean _active false;

    public 
void onLoad()
    {
        
System.out.println("Loaded Service: CommunityBoard Enchant [state: OK]");
    }

    public 
void onReload()
    {
        
System.out.println("Reloaded Service: CommunityBoard Enchant [state: OK]");
    }

    public 
void onShutdown()
    {}

    public 
void startEvent()
    {

    }

    public 
void stopEvent()
    {

    }

    public 
void enchantWeapon(final String[] var)
    {
        final 
L2Player player = (L2PlayergetSelf();
        if(
player == null)
        {
            return;
        }
        

        final 
int EnchVal ENCHANT_WEAPON_NUMBER_LIST[Integer.valueOf(var[0])];
        final 
int CoinCount ENCHANT_WEAPON_COAL_LIST[Integer.valueOf(var[0])];

        if(!
checkCondition(playerCoinCount))
            return;

        
L2ItemInstance WeaponInSlot null;

        
L2ItemInstance weaponType player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);

        if(
weaponType != null && weaponType.getEquipSlot() == Inventory.PAPERDOLL_RHAND)
            
WeaponInSlot weaponType;
        else
        {
            
weaponType player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LRHAND);
            if(
weaponType != null && weaponType.getEquipSlot() == Inventory.PAPERDOLL_LRHAND)
                
WeaponInSlot weaponType;
        }

        if(
WeaponInSlot != null)
        {
            
removeItem(playerMONEY_IDCoinCount);

            
player.getInventory().unEquipItemInSlot(WeaponInSlot.getEquipSlot());
            
WeaponInSlot.setEnchantLevel(EnchVal);
            
player.getInventory().equipItem(WeaponInSlottrue);

            
player.sendPacket(new InventoryUpdate().addModifiedItem(WeaponInSlot));
            
player.broadcastUserInfo(true);

                
player.sendMessage("Your weapon has been enchanted to " EnchVal ".");

            
Log.add(player "Has by weapon enchant for" WeaponInSlot "weapon""wmzSeller");
        }

    }

    public 
void enchantArmor(final String[] var)
    {
        final 
L2Player player = (L2PlayergetSelf();
        if(
player == null)
        {
            return;
        }
        
        final 
int EnchVal ENCHANT_ARMOR_NUMBER_LIST[Integer.valueOf(var[0])];
        final 
int CoinCount ENCHANT_ARMOR_COAL_LIST[Integer.valueOf(var[0])];

        if( !
checkCondition(playerCoinCount))
            return;

        
int SetArm 0;
        for(final 
L2Skill setSkill player.getAllSkills())
        {
            if(
setSkill.getName().equalsIgnoreCase("Equipped with Shield"))
            {}
            if( !(
setSkill.getName().endsWith("Set") && setSkill.getId() >= 700))
                continue;
            else
                
SetArm setSkill.getId();
        }

        
L2ItemInstance armorInChestSlot null;
        final 
L2ItemInstance armor player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_CHEST);

        if(
SetArm == 0)
        {
            if(
armor.getItem().getName().contains("Dynasty"))
                
SetArm 1;
        }
        if(
SetArm == 0)
        {
                
player.sendMessage("You must equip full set for enchant");
            
player.sendActionFailed();
            return;
        }

        if(
armor != null && armor.getEquipSlot() == Inventory.PAPERDOLL_CHEST)
            
armorInChestSlot armor;

        
removeItem(playerMONEY_IDCoinCount);

        for(final 
L2ItemInstance item player.getInventory().getItems())
        {
            if(
item.isEquipped() && item.getItem().getType2() == L2Item.TYPE2_SHIELD_ARMOR)
            {
                
player.getInventory().unEquipItemInSlot(item.getEquipSlot());
                
item.setEnchantLevel(EnchVal);

                
player.sendMessage("Your armor has been enachant to " EnchVal ". Thx");
                
player.getInventory().equipItem(itemtrue);
                
player.sendPacket(new InventoryUpdate().addModifiedItem(item));
            }
        }
        
player.broadcastUserInfo(true);


        
Log.add(player "Has by armor enchant for" armorInChestSlot "and equiped full armor set for this""wmzSeller");
    }

    public 
void enchantJewel(final String[] var)
    {
        final 
L2Player player = (L2PlayergetSelf();
        if(
player == null)
        {
            return;
        }
        
        final 
int EnchVal ENCHANT_JEWEL_NUMBER_LIST[Integer.valueOf(var[0])];
        final 
int CoinCount ENCHANT_JEWEL_COAL_LIST[Integer.valueOf(var[0])];

        if( !
checkCondition(playerCoinCount))
            return;
        final 
FastList<L2ItemInstanceequiped = new FastList<L2ItemInstance>();

        for(final 
L2ItemInstance item player.getInventory().getItems())
            if(
item.isEquipped() && item.getItem().getType2() == L2Item.TYPE2_ACCESSORY)
            {
                
equiped.add(item);
            }

        final 
int eqiptotal equiped.size();

        if(
eqiptotal 5)
        {
                
player.sendMessage("You must equip full set for enchant");
            return;
        }
        else
        {
            
removeItem(playerMONEY_IDCoinCount);
            for(final 
L2ItemInstance jewel equiped)
            {
                
player.getInventory().unEquipItemInSlot(jewel.getEquipSlot());
                
jewel.setEnchantLevel(EnchVal);
                
Log.add(player "Has by jewel enchant for" jewel"wmzSeller");
                
player.getInventory().equipItem(jeweltrue);
                
player.sendPacket(new InventoryUpdate().addModifiedItem(jewel));
            }
            
equiped.clear();
        }
        
player.broadcastUserInfo(true);

        
// сообщение
            
player.sendMessage("Your jewels has been enachant to  " EnchVal ". Thx");
    }

    public static 
boolean checkCondition(final L2Player player, final int CoinCount)
    {
        
synchronized(player)
        {
            if(
player == null)
                return 
false;

            final 
L2ItemInstance Coin player.getInventory().getItemByItemId(MONEY_ID);

            if(
Coin == null)
                
player.sendMessage("You have not enough Golds");

            if(
CoinCount != && player.getInventory().getItemByItemId(MONEY_ID).getCount() < CoinCount)
            {
                
player.sendMessage("You have not enough Golds");
                
player.sendActionFailed();
                return 
false;
            }

            return 
true;
        }
    }


Goodday вне форума Ответить с цитированием
Сказали спасибо: