package services;
import l2p.gameserver.model.Player;
import l2p.gameserver.model.instances.NpcInstance;
import l2p.gameserver.scripts.Functions;
public class Example extends Functions {
private static final int reqID = 57;
private static final int reqCOUNT = 1;
private static final int rewID = 4037;
private static final int rewCOUNT = 1;
public void exchange() {
Player player = getSelf();
NpcInstance npc = getNpc();
if (player == null || npc == null || npc.getNpcId() != 11111(ид_твоего_нпц)) {
return;
}
if (!NpcInstance.canBypassCheck(player, npc)) {
return;
}
if (getItemCount(player, reqID) >= reqCOUNT) {
removeItem(player, reqID, reqCOUNT);
addItem(player, rewID, rewCOUNT);
}
}
}
bypass:
[scripts_services.Example:exchange|ОБМЕН]<br>