mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-05 00:31:57 +00:00
Kotlin -> Java (#586)
* Convert All Plugins To Java * Convert Rest Of Kt To Java & Remove Kt From Maven
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
package plugin.click.npc;
|
||||
|
||||
import com.rs2.event.EventContext;
|
||||
import com.rs2.event.EventSubscriber;
|
||||
import com.rs2.event.SubscribesTo;
|
||||
import com.rs2.event.impl.NpcFirstClickEvent;
|
||||
import com.rs2.game.players.Player;
|
||||
import com.rs2.util.Misc;
|
||||
|
||||
import static com.rs2.game.content.StaticNpcList.*;
|
||||
|
||||
@SubscribesTo(NpcFirstClickEvent.class)
|
||||
public final class NpcFirstClick implements EventSubscriber<NpcFirstClickEvent> {
|
||||
|
||||
@Override
|
||||
public void subscribe(EventContext context, Player player, NpcFirstClickEvent event) {
|
||||
if (player.playerRights == 3) {
|
||||
player.getPacketSender().sendMessage("[click= npc], [type = first], [id= " + event.getNpc() + "], [Type= " + event.getNpc() + "]");
|
||||
}
|
||||
|
||||
switch (event.getNpc()) {
|
||||
|
||||
case MAN:
|
||||
case MAN_2:
|
||||
case MAN_3:
|
||||
case WOMAN:
|
||||
case WOMAN_5:
|
||||
case WOMAN_6:
|
||||
if (Misc.random(10) <= 5) {
|
||||
player.getDialogueHandler().sendDialogues(3869, player.npcType);
|
||||
} else {
|
||||
player.getDialogueHandler().sendDialogues(3872, player.npcType);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
package plugin.click.npc
|
||||
|
||||
import com.rs2.event.EventContext
|
||||
import com.rs2.event.EventSubscriber
|
||||
import com.rs2.event.SubscribesTo
|
||||
import com.rs2.event.impl.NpcFirstClickEvent
|
||||
import com.rs2.game.content.StaticNpcList.*
|
||||
import com.rs2.game.players.Player
|
||||
import com.rs2.util.Misc
|
||||
|
||||
|
||||
@SubscribesTo(NpcFirstClickEvent::class)
|
||||
class NpcFirstClick : EventSubscriber<NpcFirstClickEvent> {
|
||||
|
||||
override fun subscribe(context: EventContext, player: Player, event: NpcFirstClickEvent) {
|
||||
|
||||
if (player.playerRights >= 3) {
|
||||
player.packetSender.sendMessage("[click= npc], [type = first], [id= ${event.npc}], [Type= ${event.npc}]");
|
||||
}
|
||||
|
||||
when(event.npc) {
|
||||
|
||||
MAN,MAN_2,MAN_3,WOMAN,WOMAN_5,WOMAN_6 -> if (Misc.random(10) <= 5) {
|
||||
player.dialogueHandler.sendDialogues(3869, player.npcType)
|
||||
} else {
|
||||
player.dialogueHandler.sendDialogues(3872, player.npcType)
|
||||
}
|
||||
|
||||
//else ->
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package plugin.click.npc;
|
||||
|
||||
import com.rs2.event.EventContext;
|
||||
import com.rs2.event.EventSubscriber;
|
||||
import com.rs2.event.SubscribesTo;
|
||||
import com.rs2.event.impl.NpcSecondClickEvent;
|
||||
import com.rs2.game.content.skills.thieving.Pickpocket;
|
||||
import com.rs2.game.players.Player;
|
||||
|
||||
@SubscribesTo(NpcSecondClickEvent.class)
|
||||
public final class NpcSecondClick implements EventSubscriber<NpcSecondClickEvent> {
|
||||
|
||||
@Override
|
||||
public void subscribe(EventContext context, Player player, NpcSecondClickEvent event) {
|
||||
if (player.playerRights == 3) {
|
||||
player.getPacketSender().sendMessage("[click= npc], [type = second], [id= " + event.getNpc() + "], [Type= " + event.getNpc() + "]");
|
||||
}
|
||||
|
||||
if (Pickpocket.isNPC(player, player.npcType)) {
|
||||
Pickpocket.attemptPickpocket(player, player.npcType);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package plugin.click.npc
|
||||
|
||||
import com.rs2.event.EventContext
|
||||
import com.rs2.event.EventSubscriber
|
||||
import com.rs2.event.SubscribesTo
|
||||
import com.rs2.event.impl.NpcSecondClickEvent
|
||||
import com.rs2.game.content.skills.thieving.Pickpocket
|
||||
import com.rs2.game.players.Player
|
||||
|
||||
@SubscribesTo(NpcSecondClickEvent::class)
|
||||
class NpcSecondClick : EventSubscriber<NpcSecondClickEvent> {
|
||||
|
||||
override fun subscribe(context: EventContext, player: Player, event: NpcSecondClickEvent) {
|
||||
|
||||
if (player.playerRights >= 3) {
|
||||
player.packetSender.sendMessage("[click= npc], [type = second], [id= ${event.npc}], [Type= ${event.npc}]");
|
||||
}
|
||||
|
||||
if (Pickpocket.isNPC(player, player.npcType)) {
|
||||
Pickpocket.attemptPickpocket(player, player.npcType)
|
||||
return
|
||||
}
|
||||
|
||||
when(event.npc) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package plugin.click.npc;
|
||||
|
||||
import com.rs2.event.EventContext;
|
||||
import com.rs2.event.EventSubscriber;
|
||||
import com.rs2.event.SubscribesTo;
|
||||
import com.rs2.event.impl.NpcThirdClickEvent;
|
||||
import com.rs2.game.players.Player;
|
||||
|
||||
@SubscribesTo(NpcThirdClickEvent.class)
|
||||
public final class NpcThirdClick implements EventSubscriber<NpcThirdClickEvent> {
|
||||
|
||||
@Override
|
||||
public void subscribe(EventContext context, Player player, NpcThirdClickEvent event) {
|
||||
if (player.playerRights == 3) {
|
||||
player.getPacketSender().sendMessage("[click= npc], [type = third], [id= " + event.getNpc() + "], [Type= " + event.getNpc() + "]");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package plugin.click.npc
|
||||
|
||||
import com.rs2.event.EventContext
|
||||
import com.rs2.event.EventSubscriber
|
||||
import com.rs2.event.SubscribesTo
|
||||
import com.rs2.event.impl.NpcThirdClickEvent
|
||||
import com.rs2.game.players.Player
|
||||
|
||||
@SubscribesTo(NpcThirdClickEvent::class)
|
||||
class NpcThirdClick : EventSubscriber<NpcThirdClickEvent> {
|
||||
|
||||
override fun subscribe(context: EventContext, player: Player, event: NpcThirdClickEvent) {
|
||||
|
||||
if (player.playerRights >= 3) {
|
||||
player.packetSender.sendMessage("[click= npc], [type = third], [id= ${event.npc}], [Type= ${event.npc}]");
|
||||
}
|
||||
|
||||
when(event.npc) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user