mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-03 00:31:51 +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,31 @@
|
||||
package plugin.click.obj
|
||||
|
||||
import com.rs2.event.EventContext
|
||||
import com.rs2.event.EventSubscriber
|
||||
import com.rs2.event.SubscribesTo
|
||||
import com.rs2.event.impl.ObjectFirstClickEvent
|
||||
import com.rs2.game.content.skills.core.Mining
|
||||
import com.rs2.game.players.Player
|
||||
|
||||
@SubscribesTo(ObjectFirstClickEvent::class)
|
||||
class ObjectFirstClick : EventSubscriber<ObjectFirstClickEvent> {
|
||||
|
||||
override fun subscribe(context: EventContext, player: Player, event: ObjectFirstClickEvent) {
|
||||
|
||||
if (player.playerRights >= 3) {
|
||||
player.packetSender.sendMessage("[click= object], [type= first], [id= ${player.objectId}], [location= x:${player.objectX} y:${player.objectY} ]")
|
||||
}
|
||||
|
||||
// if its a rock we can mine, mine it
|
||||
if (Mining.rockExists(event.gameObject)) {
|
||||
player.mining.startMining(player, event.gameObject, player.objectX, player.objectY, player.clickObjectType)
|
||||
return
|
||||
}
|
||||
|
||||
when (event.gameObject) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package plugin.click.obj
|
||||
|
||||
import com.rs2.event.EventContext
|
||||
import com.rs2.event.EventSubscriber
|
||||
import com.rs2.event.SubscribesTo
|
||||
import com.rs2.event.impl.ObjectFourthClickEvent
|
||||
import com.rs2.game.content.skills.farming.Farming
|
||||
import com.rs2.game.players.Player
|
||||
import com.rs2.world.clip.Region
|
||||
|
||||
@SubscribesTo(ObjectFourthClickEvent::class)
|
||||
class ObjectFourthClick : EventSubscriber<ObjectFourthClickEvent> {
|
||||
|
||||
override fun subscribe(context: EventContext, player: Player, event: ObjectFourthClickEvent) {
|
||||
|
||||
if (player.playerRights >= 3) {
|
||||
player.packetSender.sendMessage("[click= object], [type= fourth], [id= ${player.objectId}], [location= x:${player.objectX} y:${player.objectY} ], [PLUGIN]");
|
||||
}
|
||||
|
||||
if (!Region.objectExists(player.objectId, player.objectX, player.objectY, player.heightLevel)) {
|
||||
return
|
||||
}
|
||||
|
||||
Farming.guide(player, player.objectX, player.objectY)
|
||||
|
||||
when (event.gameObject) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package plugin.click.obj
|
||||
|
||||
import com.rs2.event.EventContext
|
||||
import com.rs2.event.EventSubscriber
|
||||
import com.rs2.event.SubscribesTo
|
||||
import com.rs2.event.impl.ObjectSecondClickEvent
|
||||
import com.rs2.game.content.skills.thieving.Stalls
|
||||
import com.rs2.game.players.Player
|
||||
|
||||
@SubscribesTo(ObjectSecondClickEvent::class)
|
||||
class ObjectSecondClick : EventSubscriber<ObjectSecondClickEvent> {
|
||||
|
||||
override fun subscribe(context: EventContext, player: Player, event: ObjectSecondClickEvent) {
|
||||
|
||||
if (player.playerRights >= 3) {
|
||||
player.packetSender.sendMessage("[click= object], [type= second], [id= ${player.objectId}], [location= x:${player.objectX} y:${player.objectY} ]");
|
||||
}
|
||||
|
||||
if (Stalls.isObject(event.gameObject)) {
|
||||
Stalls.attemptStall(player, event.gameObject, player.objectX, player.objectY)
|
||||
return
|
||||
}
|
||||
|
||||
when (event.gameObject) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package plugin.click.obj
|
||||
|
||||
import com.rs2.event.EventContext
|
||||
import com.rs2.event.EventSubscriber
|
||||
import com.rs2.event.SubscribesTo
|
||||
import com.rs2.event.impl.ObjectThirdClickEvent
|
||||
import com.rs2.game.content.skills.thieving.Stalls
|
||||
import com.rs2.game.players.Player
|
||||
|
||||
@SubscribesTo(ObjectThirdClickEvent::class)
|
||||
class ObjectThirdClick : EventSubscriber<ObjectThirdClickEvent> {
|
||||
|
||||
override fun subscribe(context: EventContext, player: Player, event: ObjectThirdClickEvent) {
|
||||
|
||||
if (player.playerRights >= 3) {
|
||||
player.packetSender.sendMessage("[click= object], [type= third], [id= ${player.objectId}], [location= x:${player.objectX} y:${player.objectY} ], [PLUGIN]");
|
||||
}
|
||||
|
||||
if (Stalls.isObject(event.gameObject)) {
|
||||
Stalls.attemptStall(player, event.gameObject, player.objectX, player.objectY)
|
||||
return
|
||||
}
|
||||
|
||||
when (event.gameObject) {
|
||||
10177 -> player.playerAssistant.movePlayer(1798, 4407, 3);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
[
|
||||
{
|
||||
"name": "Object First Click",
|
||||
"description": "The plugin for handling the first option of an object.",
|
||||
"group": "click",
|
||||
"base": "plugin.click.obj.ObjectFirstClick",
|
||||
"authors": [
|
||||
"Vult-R"
|
||||
],
|
||||
"version": 1.0
|
||||
},
|
||||
{
|
||||
"name": "Object Second Click",
|
||||
"description": "The plugin for handling the second option of an object.",
|
||||
"group": "click",
|
||||
"base": "plugin.click.obj.ObjectSecondClick",
|
||||
"authors": [
|
||||
"Vult-R"
|
||||
],
|
||||
"version": 1.0
|
||||
},
|
||||
{
|
||||
"name": "Object Third Click",
|
||||
"description": "The plugin for handling the third option of an object.",
|
||||
"group": "click",
|
||||
"base": "plugin.click.obj.ObjectThirdClick",
|
||||
"authors": [
|
||||
"Vult-R"
|
||||
],
|
||||
"version": 1.0
|
||||
},
|
||||
{
|
||||
"name": "Object Fourth Click",
|
||||
"description": "The plugin for handling the fourth option of an object.",
|
||||
"group": "click",
|
||||
"base": "plugin.click.obj.ObjectFourthClick",
|
||||
"authors": [
|
||||
"Vult-R"
|
||||
],
|
||||
"version": 1.0
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user