Jump to content
Sign in to follow this  
BleaK

Как дебажить скрипты?

Recommended Posts

Здравствуйте.

Подскажите пожалуйста.
Есть к примеру скрипты в скомпилированной java сборке:
 

package ai;

import net.sf.l2j.gameserver.model.L2Party;
import net.sf.l2j.gameserver.model.actor.instance.L2NpcInstance;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.model.quest.jython.QuestJython;
import net.sf.l2j.gameserver.Announcements;
import net.sf.l2j.util.Rnd;

@SuppressWarnings("all")
public class HeroRaid extends QuestJython
{
    private final static int HeroRaid = 40002;
    private final static int chance_hero = 100;
	private final static int hero_hour = 8;
	private final static int hero_to_all_party = 1;	
	
	public HeroRaid(int questId, String name, String descr)
	{
		super(questId, name, descr, 1);
		this.addKillId(HeroRaid);
	}

	@Override
	public String onKill(L2NpcInstance npc, L2PcInstance killer, boolean isPet) 
	{ 	
		int SWITCH = 0;
		Announcements annons = new Announcements();
		L2Party party = killer.getParty();
		if (Rnd.get(100) < chance_hero)
			{
				if(hero_to_all_party == 0)
					if(!killer.isHero())
					{
							annons.announceToAll("месадж '"+killer.getName()+"'");
                    }
            }
    	return null;                                
    }
}

Подскажите как правильно вывести информацию что в масиве party? Пробовал через annons но там требования стринг...хз как конвертировать масив в стринг ну и возможно есть проще спрособ вывода чем в чате в игре)

Еще если кто то сможет подсказать как получить весь список обьектов из killer буду очень благодарен.

Если будут идеи пишите прямо в скайп: xarturx71

или сюда в тему.

Спасибо всем большое за внимание)

Share this post


Link to post
Share on other sites
2 часа назад, BleaK сказал:

Здравствуйте.

Подскажите пожалуйста.
Есть к примеру скрипты в скомпилированной java сборке:
 


package ai;

import net.sf.l2j.gameserver.model.L2Party;
import net.sf.l2j.gameserver.model.actor.instance.L2NpcInstance;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.model.quest.jython.QuestJython;
import net.sf.l2j.gameserver.Announcements;
import net.sf.l2j.util.Rnd;

@SuppressWarnings("all")
public class HeroRaid extends QuestJython
{
    private final static int HeroRaid = 40002;
    private final static int chance_hero = 100;
	private final static int hero_hour = 8;
	private final static int hero_to_all_party = 1;	
	
	public HeroRaid(int questId, String name, String descr)
	{
		super(questId, name, descr, 1);
		this.addKillId(HeroRaid);
	}

	@Override
	public String onKill(L2NpcInstance npc, L2PcInstance killer, boolean isPet) 
	{ 	
		int SWITCH = 0;
		Announcements annons = new Announcements();
		L2Party party = killer.getParty();
		if (Rnd.get(100) < chance_hero)
			{
				if(hero_to_all_party == 0)
					if(!killer.isHero())
					{
							annons.announceToAll("месадж '"+killer.getName()+"'");
                    }
            }
    	return null;                                
    }
}

Подскажите как правильно вывести информацию что в масиве party? Пробовал через annons но там требования стринг...хз как конвертировать масив в стринг ну и возможно есть проще спрособ вывода чем в чате в игре)

Еще если кто то сможет подсказать как получить весь список обьектов из killer буду очень благодарен.

Если будут идеи пишите прямо в скайп: xarturx71

или сюда в тему.

Спасибо всем большое за внимание)

party.getPartyMembers().forEach( i -> _log.info(i.getName() + ": to be party member"));
  • Like 1

Share this post


Link to post
Share on other sites
В 26.11.2020 в 12:26, Edgar сказал:

party.getPartyMembers().forEach( i -> _log.info(i.getName() + ": to be party member"));

Спасибо в целом задумку понял) не знал что через forEach можно

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...