Sweep Нужна помощь

Статус
В этой теме нельзя размещать новые ответы.

Bzda

Пляшущий с бубном
Пользователь
Сообщения
33
Розыгрыши
0
Решения
1
Репутация
0
Реакции
1
Баллы
245
Хроники
  1. Chaotic Throne: High Five
Исходники
Присутствуют
Сборка
l2jserver
Суть такова как сделать сбор спойла с мобов не юзая скил заспойлить!
Прожимаю по мертвому мобу скил Sweep стал срабатывать но вместо того что б собрать спойл выдает Цель не оценена. Не удалось ничего присвоить.
Скрипт
JavaScript:
package com.l2jserver.gameserver.model.conditions;

import com.l2jserver.Config;
import com.l2jserver.gameserver.model.L2Object;
import com.l2jserver.gameserver.model.actor.L2Attackable;
import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.skills.Skill;
import com.l2jserver.gameserver.network.SystemMessageId;

import gameserver.model.items.Item;

/**
 * Checks Sweeper conditions:
 * <ul>
 * <li>Minimum checks, player not null, skill not null.</li>
 * <li>Checks if the target isn't null, is dead and spoiled.</li>
 * <li>Checks if the sweeper player is the target spoiler, or is in the spoiler party.</li>
 * <li>Checks if the corpse is too old.</li>
 * <li>Checks inventory limit and weight max load won't be exceed after sweep.</li>
 * </ul>
 * If two or more conditions aren't meet at the same time, one message per condition will be shown.
 * @author Zoey76
 */
public class ConditionPlayerCanSweep extends Condition
{
    private final boolean _val;
  
    public ConditionPlayerCanSweep(boolean val)
    {
        _val = val;
    }
  
    @Override
    public boolean testImpl(L2Character effector, L2Character effected, Skill skill, Item item)
    {
        boolean canSweep = true; <---<<<< тут было false
        if (effector.getActingPlayer() != null)
        {
            final L2PcInstance sweeper = effector.getActingPlayer();
            if (skill != null)
            {
                final L2Object[] targets = skill.getTargetList(sweeper);
                if (targets != null)
                {
                    L2Attackable target;
                    for (L2Object objTarget : targets)
                    {
                        if (objTarget instanceof L2Attackable)
                        {
                            target = (L2Attackable) objTarget;
                            if (target.isDead())
                            {
                                if (target.isSpoiled())
                                {
                                    canSweep = target.checkSpoilOwner(sweeper, false);
                                    canSweep &= !target.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true);
                                    canSweep &= sweeper.getInventory().checkInventorySlotsAndWeight(target.getSpoilLootItems(), true, true);
                                }
                                else
                                {
                                    sweeper.sendPacket(SystemMessageId.SWEEPER_FAILED_TARGET_NOT_SPOILED);
                                }
                            }
                        }
                    }
                }
            }
        }
        return (_val == canSweep);
    }
}
 
sweeper.java
C#:
package handlers.effecthandlers;

import java.util.Collection;

import com.l2jserver.gameserver.model.StatsSet;
import com.l2jserver.gameserver.model.actor.L2Attackable;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.conditions.Condition;
import com.l2jserver.gameserver.model.effects.AbstractEffect;
import com.l2jserver.gameserver.model.holders.ItemHolder;
import com.l2jserver.gameserver.model.skills.BuffInfo;

/**
 * Sweeper effect implementation.
 * @author Zoey76
 */
public final class Sweeper extends AbstractEffect
{
    public Sweeper(Condition attachCond, Condition applyCond, StatsSet set, StatsSet params)
    {
        super(attachCond, applyCond, set, params);
    }
    
    @Override
    public boolean isInstant()
    {
        return true;
    }
    
    @Override
    public void onStart(BuffInfo info)
    {
        if ((info.getEffector() == null) || (info.getEffected() == null) || !info.getEffector().isPlayer() || !info.getEffected().isAttackable())
        {
            return;
        }
        
        final L2PcInstance player = info.getEffector().getActingPlayer();
        final L2Attackable monster = (L2Attackable) info.getEffected();
        if (!monster.checkSpoilOwner(player, true))
        {
            return;
        }
        
        if (!player.getInventory().checkInventorySlotsAndWeight(monster.getSpoilLootItems(), false, false))
        {
            return;
        }
        
        final Collection<ItemHolder> items = monster.takeSweep();
        if (items != null)
        {
            for (ItemHolder item : items)
            {
                if (player.isInParty())
                {
                    player.getParty().distributeItem(player, item, true, monster);
                }
                else
                {
                    player.addItem("Sweeper", item, info.getEffected(), true);
                }
            }
        }
    }
}
 
Изменить это
Код:
                            if (target.isDead())
                            {
                                if (target.isSpoiled())
                                {
                                    canSweep = target.checkSpoilOwner(sweeper, false);
                                    canSweep &= !target.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true);
                                    canSweep &= sweeper.getInventory().checkInventorySlotsAndWeight(target.getSpoilLootItems(), true, true);
                                }
                                else
                                {
                                    sweeper.sendPacket(SystemMessageId.SWEEPER_FAILED_TARGET_NOT_SPOILED);
                                }
                            }
На это
Код:
                            if (target.isDead())
                            {
                               canSweep &= sweeper.getInventory().checkInventorySlotsAndWeight(target.getSpoilLootItems(), true, true)
                            }

Но там скорее всего еще где-то есть проверки
 
В ютубе есть уроки по джаве, вам максимум пару недель нужно, чтобы дойти до изучения функций. Постарайтесь сами, это же не птс где нужно знать аж 3 языка, асм, c++, и язык умения реверснуть корейское гомно в более менее понятный код.
 
Нет это не работает.
 
Можно тему закрыть, сделано!
 
Решение
Статус
В этой теме нельзя размещать новые ответы.
Назад
Сверху Снизу