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,28 @@
|
||||
package plugin.click.item
|
||||
|
||||
import com.rs2.event.EventContext
|
||||
import com.rs2.event.EventSubscriber
|
||||
import com.rs2.event.SubscribesTo
|
||||
import com.rs2.event.impl.ItemFirstClickEvent
|
||||
import com.rs2.game.players.Player
|
||||
|
||||
|
||||
@SubscribesTo(ItemFirstClickEvent::class)
|
||||
class ItemFirstClick : EventSubscriber<ItemFirstClickEvent> {
|
||||
|
||||
override fun subscribe(context: EventContext, player: Player, event: ItemFirstClickEvent) {
|
||||
|
||||
if (player.playerRights >= 3) {
|
||||
player.packetSender.sendMessage("[ItemClick#1] - Item: ${event.item}")
|
||||
}
|
||||
|
||||
when(event.item) {
|
||||
|
||||
4079 -> player.startAnimation(1457) // yo-yo
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package plugin.click.item
|
||||
|
||||
import com.rs2.event.EventContext
|
||||
import com.rs2.event.EventSubscriber
|
||||
import com.rs2.event.SubscribesTo
|
||||
import com.rs2.event.impl.ItemOnItemEvent
|
||||
import com.rs2.game.players.Player
|
||||
|
||||
@SubscribesTo(ItemOnItemEvent::class)
|
||||
class ItemOnItem : EventSubscriber<ItemOnItemEvent> {
|
||||
|
||||
override fun subscribe(context: EventContext, player: Player, event: ItemOnItemEvent) {
|
||||
|
||||
if (player.playerRights >= 3) {
|
||||
player.packetSender.sendMessage("[ItemOnItem] - used: ${event.used} with: ${event.usedWith}")
|
||||
}
|
||||
|
||||
if (event.used == 38 && event.usedWith == 590) {
|
||||
player.itemAssistant.addItem(32, 1)
|
||||
player.itemAssistant.deleteItem(38, 1)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package plugin.click.item
|
||||
|
||||
import com.rs2.event.EventContext
|
||||
import com.rs2.event.EventSubscriber
|
||||
import com.rs2.event.SubscribesTo
|
||||
import com.rs2.event.impl.ItemOnNpcEvent
|
||||
import com.rs2.game.npcs.NpcHandler
|
||||
import com.rs2.game.players.Player
|
||||
|
||||
@SubscribesTo(ItemOnNpcEvent::class)
|
||||
class ItemOnNpc : EventSubscriber<ItemOnNpcEvent> {
|
||||
|
||||
override fun subscribe(context: EventContext, player: Player, event: ItemOnNpcEvent) {
|
||||
|
||||
if (player.playerRights >= 3) {
|
||||
player.packetSender.sendMessage("[ItemOnNpc] - itemId: ${event.item} npcId: ${event.npc}")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package plugin.click.item
|
||||
|
||||
import com.rs2.event.EventContext
|
||||
import com.rs2.event.EventSubscriber
|
||||
import com.rs2.event.SubscribesTo
|
||||
import com.rs2.event.impl.ItemOnObjectEvent
|
||||
import com.rs2.game.items.impl.Fillables
|
||||
import com.rs2.game.players.Player
|
||||
|
||||
|
||||
@SubscribesTo(ItemOnObjectEvent::class)
|
||||
class ItemOnObject : EventSubscriber<ItemOnObjectEvent> {
|
||||
|
||||
override fun subscribe(context: EventContext, player: Player, event: ItemOnObjectEvent) {
|
||||
if (player.playerRights >= 3) {
|
||||
player.packetSender.sendMessage("[ItemOnObject] - itemId: ${event.item} objectId: ${event.gameObject} Location: x: ${player.objectX}, x: ${player.objectY}")
|
||||
}
|
||||
|
||||
if (Fillables.canFill(event.item, event.gameObject) && player.itemAssistant.playerHasItem(event.item)) {
|
||||
//val amount = player.itemAssistant.getItemAmount(event.item)
|
||||
player.itemAssistant.deleteItem(event.item, 1)
|
||||
player.itemAssistant.addItem(Fillables.counterpart(event.item), 1)
|
||||
player.packetSender.sendMessage(Fillables.fillMessage(event.item, event.gameObject))
|
||||
player.startAnimation(832)
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package plugin.click.item
|
||||
|
||||
import com.rs2.event.EventContext
|
||||
import com.rs2.event.EventSubscriber
|
||||
import com.rs2.event.SubscribesTo
|
||||
import com.rs2.event.impl.ItemSecondClickEvent
|
||||
import com.rs2.game.players.Player
|
||||
|
||||
@SubscribesTo(ItemSecondClickEvent::class)
|
||||
class ItemSecondClick : EventSubscriber<ItemSecondClickEvent> {
|
||||
|
||||
override fun subscribe(context: EventContext, player: Player, event: ItemSecondClickEvent) {
|
||||
|
||||
if (player.playerRights >= 3) {
|
||||
player.packetSender.sendMessage("[ItemClick#2] - ItemId: ${event.id}")
|
||||
}
|
||||
|
||||
when(event.id) {
|
||||
|
||||
4079 -> player.startAnimation(1459) //yo-yo
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package plugin.click.item
|
||||
|
||||
import com.rs2.event.EventContext
|
||||
import com.rs2.event.EventSubscriber
|
||||
import com.rs2.event.SubscribesTo
|
||||
import com.rs2.event.impl.ItemThirdClickEvent
|
||||
import com.rs2.game.players.Player
|
||||
|
||||
@SubscribesTo(ItemThirdClickEvent::class)
|
||||
class ItemThirdClick : EventSubscriber<ItemThirdClickEvent> {
|
||||
|
||||
override fun subscribe(context: EventContext, player: Player, event: ItemThirdClickEvent) {
|
||||
|
||||
if (player.playerRights >= 3) {
|
||||
player.packetSender.sendMessage("[ItemClick#3] - ItemId: ${event.id}")
|
||||
}
|
||||
|
||||
when(event.id) {
|
||||
|
||||
4079 -> player.startAnimation(1460) //yo-yo
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
[
|
||||
{
|
||||
"name": "Item First Click",
|
||||
"description": "The plugin for handling the first option of an item.",
|
||||
"group": "click",
|
||||
"base": "plugin.click.item.ItemFirstClick",
|
||||
"authors": [
|
||||
"Vult-R"
|
||||
],
|
||||
"version": 1.0
|
||||
},
|
||||
{
|
||||
"name": "Item Second Click",
|
||||
"description": "The plugin for handling the second option of an item.",
|
||||
"group": "click",
|
||||
"base": "plugin.click.item.ItemSecondClick",
|
||||
"authors": [
|
||||
"Vult-R"
|
||||
],
|
||||
"version": 1.0
|
||||
},
|
||||
{
|
||||
"name": "Item Third Click",
|
||||
"description": "The plugin for handling the third option of an item.",
|
||||
"group": "click",
|
||||
"base": "plugin.click.item.ItemThirdClick",
|
||||
"authors": [
|
||||
"Vult-R"
|
||||
],
|
||||
"version": 1.0
|
||||
},
|
||||
{
|
||||
"name": "Item On Item",
|
||||
"description": "The plugin for handling using an item on another item.",
|
||||
"group": "item",
|
||||
"base": "plugin.click.item.ItemOnItem",
|
||||
"authors": [
|
||||
"Vult-R"
|
||||
],
|
||||
"version": 1.0
|
||||
},
|
||||
{
|
||||
"name": "Item On Npc",
|
||||
"description": "The plugin for handling using an item on an npc.",
|
||||
"group": "item",
|
||||
"base": "plugin.click.item.ItemOnNpc",
|
||||
"authors": [
|
||||
"Vult-R"
|
||||
],
|
||||
"version": 1.0
|
||||
},
|
||||
{
|
||||
"name": "Item On Object",
|
||||
"description": "The plugin for handling using an item on a game object.",
|
||||
"group": "item",
|
||||
"base": "plugin.click.item.ItemOnObject",
|
||||
"authors": [
|
||||
"Vult-R"
|
||||
],
|
||||
"version": 1.0
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user