Тема: Сын ДЭФО?
Показать сообщение отдельно
Непрочитано 15.10.2012, 18:35   #89
Аватар для Ashe
Олдфаг

По умолчанию Re: Сын ДЭФО?

Цитата:
Сообщение от MrShyr Посмотреть сообщение
По физиономии На яве они веселее, так как тупее
 
public class Gremlins extends L2AttackableAIScript
{
	private static final int NPC_ID = 18342;
 
	public Gremlins(int questId, String name, String descr)
	{
		super(questId, name, descr);
		this.registerMobs(NPC_ID, QuestEventType.ON_ATTACK, QuestEventType.ON_KILL);
	}
 
	@Override
	public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isPet)
	{
		if (npc.hasSpoken())
			return super.onAttack(npc, attacker, damage, isPet);
 
		int npcId = npc.getNpcId();
		String message = "";
 
		if (npcId == NPC_ID)
		{
				message = "Это ПэТэЭс, мамой клянусь!";
		}
 
		npc.broadcastNpcSay(message);
		npc.setHasSpoken(true);
 
		return super.onAttack(npc, attacker, damage, isPet);
	}
 
	@Override
	public String onKill(L2Npc npc, L2PcInstance player, boolean isPet)
	{
		int npcId = npc.getNpcId();
		String message = "";
 
		if (npcId == NPC_ID)
		{
				message = "За что!?!!";
		}
 
		npc.broadcastNpcSay(message);
		npc.setHasSpoken(false);
 
		return super.onKill(npc, player, isPet);
	}
 
	public static void main(String[] args)
	{
		new Gremlins(-1, "Gremlins", "ai");
	}
}
Code: Java
Так нормуль будет, как думаете?
__________________
Fortuna - non penis, in manus non recipe.
Ashe вне форума Ответить с цитированием
Сказали спасибо: