mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-04 16:49:04 +00:00
Plugins System (#510)
* Started Ripping Plugin System From Astraeus
*Currently only ClickingButtons Support
*Also Started Using The Logout Button Plugin From Astraeus
* NpcFirstClickEvent setup for plugins
also made Man & Women chat work through this
* Server: Add Google Collect Lib
* Server: NpcSecondClickEvent setup for plugins
also handle pickpocketing npc clicking through plugin
* Server: NpcThirdClickEvent setup for plugins
* Server: Remove conflicting action for Secondclicking npc id 3
* Server: ItemFirstClickEvent setup for plugins
Also Handle Yo-Yo First Click Through This
* Server: ItemOnItemEvent setup for plugins
Also Handle Black Candle Lighting With Tinderbox Through this
* Server: ItemOnNpcEvent setup for plugins
* Server: ItemOnObjectEvent setup for plugins
Also Handle Fillable Items Through This
* Server: ItemSecondClickEvent & ItemThirdClickEvent setup for plugins
Also Handle Yo-Yo Actions Through This
* Server: ObjectFirstClickEvent setup for plugins
Also Handle FirstClick Mining Actions Through This
* Server: ObjectSecondClickEvent setup for plugins
Also Handle Stall Thieving Actions Through This
* Server: ObjectThirdClickEvent setup for plugins
* Server: ObjectFourthClickEvent setup for plugins
Also Handle Fourth Click Farming Object Actions Through This
* Server: MagicOnItemEvent setup for plugins
Also Handle SuperHeat Through This
* More mage training arena (#509)
* Fixup points display
* Only allow players to deposit up to 12k at one time
* Apple damage and play animation
* Update order or prices
* Update Telekinetic.java
(cherry picked from commit ab3b1e9731)
Co-authored-by: RedSparr0w <RedSparr0w@users.noreply.github.com>
Co-authored-by: Danial <admin@redsparr0w.com>
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package plugin.click.npc
|
||||
|
||||
import com.rs2.GameConstants
|
||||
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.npcs.Npc
|
||||
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) {
|
||||
|
||||
1,2,3,4,5,6 -> if (Misc.random(10) <= 5) {
|
||||
player.dialogueHandler.sendDialogues(3869, player.npcType)
|
||||
} else {
|
||||
player.dialogueHandler.sendDialogues(3872, player.npcType)
|
||||
}
|
||||
|
||||
//else ->
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
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,24 @@
|
||||
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) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
[
|
||||
{
|
||||
"name": "Npc First Click",
|
||||
"description": "The plugin for handling the first option of an npc.",
|
||||
"group": "click",
|
||||
"base": "plugin.click.npc.NpcFirstClick",
|
||||
"authors": [
|
||||
"Vult-R"
|
||||
],
|
||||
"version": 1.0
|
||||
},
|
||||
{
|
||||
"name": "Npc Second Click",
|
||||
"description": "The plugin for handling the second option of an npc.",
|
||||
"group": "click",
|
||||
"base": "plugin.click.npc.NpcSecondClick",
|
||||
"authors": [
|
||||
"Vult-R"
|
||||
],
|
||||
"version": 1.0
|
||||
},
|
||||
{
|
||||
"name": "Npc Third Click",
|
||||
"description": "The plugin for handling the third option of an npc.",
|
||||
"group": "click",
|
||||
"base": "plugin.click.npc.NpcThirdClick",
|
||||
"authors": [
|
||||
"Vult-R"
|
||||
],
|
||||
"version": 1.0
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user