mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-03 08:39: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:
@@ -2,6 +2,7 @@ package com.rs2.net.packets.impl;
|
||||
|
||||
import com.rs2.GameConstants;
|
||||
import com.rs2.GameEngine;
|
||||
import com.rs2.event.impl.ItemFirstClickEvent;
|
||||
import com.rs2.game.content.consumables.Beverages;
|
||||
import com.rs2.game.content.consumables.Kebabs;
|
||||
import com.rs2.game.content.consumables.Beverages.beverageData;
|
||||
@@ -37,6 +38,7 @@ public class ClickItem implements PacketType {
|
||||
if(!player.getItemAssistant().playerHasItem(itemId, 1)) {
|
||||
return;
|
||||
}
|
||||
player.post(new ItemFirstClickEvent(itemId));
|
||||
GodBooks.sendPreachOptions(player, itemId);
|
||||
if (itemId == 6) {
|
||||
player.getCannon().placeCannon();
|
||||
|
||||
@@ -3,6 +3,9 @@ package com.rs2.net.packets.impl;
|
||||
import com.rs2.event.CycleEvent;
|
||||
import com.rs2.event.CycleEventContainer;
|
||||
import com.rs2.event.CycleEventHandler;
|
||||
import com.rs2.event.impl.NpcFirstClickEvent;
|
||||
import com.rs2.event.impl.NpcSecondClickEvent;
|
||||
import com.rs2.event.impl.NpcThirdClickEvent;
|
||||
import com.rs2.game.content.combat.CombatConstants;
|
||||
import com.rs2.game.content.combat.magic.MagicData;
|
||||
import com.rs2.game.content.combat.range.RangeData;
|
||||
@@ -229,6 +232,7 @@ public class ClickNPC implements PacketType {
|
||||
case FIRST_CLICK:
|
||||
player.npcClickIndex = player.inStream.readSignedWordBigEndian();
|
||||
player.npcType = NpcHandler.npcs[player.npcClickIndex].npcType;
|
||||
|
||||
if (player.goodDistance(NpcHandler.npcs[player.npcClickIndex].getX(),
|
||||
NpcHandler.npcs[player.npcClickIndex].getY(), player.getX(),
|
||||
player.getY(), 2)) {
|
||||
@@ -236,6 +240,7 @@ public class ClickNPC implements PacketType {
|
||||
NpcHandler.npcs[player.npcClickIndex].getY());
|
||||
NpcHandler.npcs[player.npcClickIndex].facePlayer(player.playerId);
|
||||
player.getNpcs().firstClickNpc(player.npcType);
|
||||
player.post(new NpcFirstClickEvent(player.npcType));
|
||||
} else {
|
||||
player.clickNpcType = 1;
|
||||
CycleEventHandler.getSingleton().addEvent(player, new CycleEvent() {
|
||||
@@ -252,6 +257,7 @@ public class ClickNPC implements PacketType {
|
||||
NpcHandler.npcs[player.npcClickIndex]
|
||||
.facePlayer(player.playerId);
|
||||
player.getNpcs().firstClickNpc(player.npcType);
|
||||
player.post(new NpcFirstClickEvent(player.npcType));
|
||||
container.stop();
|
||||
}
|
||||
}
|
||||
@@ -277,6 +283,7 @@ public class ClickNPC implements PacketType {
|
||||
NpcHandler.npcs[player.npcClickIndex].getY());
|
||||
NpcHandler.npcs[player.npcClickIndex].facePlayer(player.playerId);
|
||||
player.getNpcs().secondClickNpc(player.npcType);
|
||||
player.post(new NpcSecondClickEvent(player.npcType));
|
||||
} else {
|
||||
player.clickNpcType = 2;
|
||||
CycleEventHandler.getSingleton().addEvent(player, new CycleEvent() {
|
||||
@@ -293,6 +300,7 @@ public class ClickNPC implements PacketType {
|
||||
NpcHandler.npcs[player.npcClickIndex]
|
||||
.facePlayer(player.playerId);
|
||||
player.getNpcs().secondClickNpc(player.npcType);
|
||||
player.post(new NpcSecondClickEvent(player.npcType));
|
||||
container.stop();
|
||||
}
|
||||
}
|
||||
@@ -319,6 +327,7 @@ public class ClickNPC implements PacketType {
|
||||
NpcHandler.npcs[player.npcClickIndex].getY());
|
||||
NpcHandler.npcs[player.npcClickIndex].facePlayer(player.playerId);
|
||||
player.getNpcs().thirdClickNpc(player.npcType);
|
||||
player.post(new NpcThirdClickEvent(player.npcType));
|
||||
} else {
|
||||
player.clickNpcType = 3;
|
||||
CycleEventHandler.getSingleton().addEvent(player, new CycleEvent() {
|
||||
@@ -335,6 +344,7 @@ public class ClickNPC implements PacketType {
|
||||
NpcHandler.npcs[player.npcClickIndex]
|
||||
.facePlayer(player.playerId);
|
||||
player.getNpcs().thirdClickNpc(player.npcType);
|
||||
player.post(new NpcThirdClickEvent(player.npcType));
|
||||
container.stop();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,10 @@ import com.rs2.GameEngine;
|
||||
import com.rs2.event.CycleEvent;
|
||||
import com.rs2.event.CycleEventContainer;
|
||||
import com.rs2.event.CycleEventHandler;
|
||||
import com.rs2.event.impl.ObjectFirstClickEvent;
|
||||
import com.rs2.event.impl.ObjectFourthClickEvent;
|
||||
import com.rs2.event.impl.ObjectSecondClickEvent;
|
||||
import com.rs2.event.impl.ObjectThirdClickEvent;
|
||||
import com.rs2.game.content.minigames.castlewars.CastleWarObjects;
|
||||
import com.rs2.game.content.minigames.castlewars.CastleWars;
|
||||
import com.rs2.game.content.skills.woodcutting.Woodcutting;
|
||||
@@ -410,6 +414,7 @@ public class ClickObject implements PacketType {
|
||||
break;
|
||||
}
|
||||
player.getObjects().firstClickObject(player.objectId, player.objectX, player.objectY);
|
||||
player.post(new ObjectFirstClickEvent(player.objectId));
|
||||
break;
|
||||
|
||||
case 2:
|
||||
@@ -417,6 +422,7 @@ public class ClickObject implements PacketType {
|
||||
player.getPacketSender().sendMessage("ObjectId: " + player.objectId + " ObjectX: " + player.objectX + " ObjectY: " + player.objectY + " Objectclick = 2, Xoff: " + (player.getX() - player.objectX) + " Yoff: " + (player.getY() - player.objectY));
|
||||
}
|
||||
player.getObjects().secondClickObject(player.objectId, player.objectX, player.objectY);
|
||||
player.post(new ObjectSecondClickEvent(player.objectId));
|
||||
break;
|
||||
|
||||
case 3: // 'F'
|
||||
@@ -425,6 +431,7 @@ public class ClickObject implements PacketType {
|
||||
}
|
||||
|
||||
player.getObjects().thirdClickObject(player.objectId, player.objectX, player.objectY);
|
||||
player.post(new ObjectThirdClickEvent(player.objectId));
|
||||
break;
|
||||
|
||||
|
||||
@@ -434,6 +441,7 @@ public class ClickObject implements PacketType {
|
||||
}
|
||||
|
||||
player.getObjects().fourthClickObject(player.objectId, player.objectX, player.objectY);
|
||||
player.post(new ObjectFourthClickEvent(player.objectId));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.rs2.net.packets.impl;
|
||||
|
||||
import com.rs2.event.impl.ButtonActionEvent;
|
||||
import com.rs2.GameConstants;
|
||||
import com.rs2.game.content.combat.CombatConstants;
|
||||
import com.rs2.game.content.combat.Specials;
|
||||
@@ -81,6 +82,8 @@ public class ClickingButtons implements PacketType {
|
||||
if (player.isAutoButton(actionButtonId)) {
|
||||
player.assignAutocast(actionButtonId);
|
||||
}
|
||||
player.post(new ButtonActionEvent(actionButtonId));
|
||||
|
||||
switch (actionButtonId) {
|
||||
case 23132:
|
||||
player.getPlayerAssistant().unMorphPlayer();
|
||||
@@ -1193,10 +1196,6 @@ public class ClickingButtons implements PacketType {
|
||||
player.getPacketSender().sendConfig(173, 0);
|
||||
break;
|
||||
|
||||
case 9154:
|
||||
player.logout();
|
||||
break;
|
||||
|
||||
case 21010:
|
||||
if (player.isBanking) {
|
||||
player.takeAsNote = true;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.rs2.net.packets.impl;
|
||||
|
||||
import com.rs2.event.impl.ItemSecondClickEvent;
|
||||
import com.rs2.game.items.impl.HandleEmpty;
|
||||
import com.rs2.game.players.Player;
|
||||
import com.rs2.net.packets.PacketType;
|
||||
@@ -20,16 +21,10 @@ public class ItemClick2 implements PacketType {
|
||||
}
|
||||
|
||||
player.endCurrentTask();
|
||||
player.post(new ItemSecondClickEvent(itemId));
|
||||
|
||||
if (HandleEmpty.canEmpty(player, itemId)) {
|
||||
HandleEmpty.handleEmptyItem(player, itemId, HandleEmpty.filledToEmpty(player, itemId));
|
||||
return;
|
||||
}
|
||||
|
||||
switch (itemId) {
|
||||
case 4079:
|
||||
player.startAnimation(1459);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.rs2.net.packets.impl;
|
||||
|
||||
import com.rs2.event.impl.ItemThirdClickEvent;
|
||||
import com.rs2.game.content.skills.runecrafting.Runecrafting;
|
||||
import com.rs2.game.items.impl.HandleEmpty;
|
||||
import com.rs2.game.items.impl.Teles;
|
||||
@@ -23,6 +24,7 @@ public class ItemClick3 implements PacketType {
|
||||
if (!player.getItemAssistant().playerHasItem(itemId, 1)) {
|
||||
return;
|
||||
}
|
||||
player.post(new ItemThirdClickEvent(itemId));
|
||||
if (HandleEmpty.canEmpty(player, itemId)) {
|
||||
HandleEmpty.handleEmptyItem(player, itemId, HandleEmpty.filledToEmpty(player, itemId));
|
||||
return;
|
||||
@@ -52,9 +54,6 @@ public class ItemClick3 implements PacketType {
|
||||
case 1448:// Mind Talisman
|
||||
Runecrafting.locate(player, 2982, 3514);
|
||||
break;
|
||||
case 4079:
|
||||
player.startAnimation(1460);
|
||||
break;
|
||||
|
||||
case 2552:
|
||||
case 2554:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.rs2.net.packets.impl;
|
||||
|
||||
import com.rs2.event.impl.ItemOnNpcEvent;
|
||||
import com.rs2.game.content.skills.SkillHandler;
|
||||
import com.rs2.game.items.UseItem;
|
||||
import com.rs2.game.npcs.NpcHandler;
|
||||
@@ -27,6 +28,7 @@ public class ItemOnNpc implements PacketType {
|
||||
return;
|
||||
}
|
||||
player.faceNpc(i);
|
||||
player.post(new ItemOnNpcEvent(itemId,npcId, i));
|
||||
switch(npcId) {
|
||||
case 3021:
|
||||
if (player.getFarmingTools().noteItem(itemId)) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.rs2.net.packets.impl;
|
||||
|
||||
import com.rs2.event.impl.ItemOnObjectEvent;
|
||||
import com.rs2.GameConstants;
|
||||
import com.rs2.game.content.combat.range.DwarfCannon;
|
||||
import com.rs2.game.content.skills.cooking.Cooking;
|
||||
@@ -49,6 +50,7 @@ public class ItemOnObject implements PacketType {
|
||||
"Object Id:" + objectId + " ObjectX: " + objectX
|
||||
+ " ObjectY: " + objectY + ".");
|
||||
}
|
||||
player.post(new ItemOnObjectEvent(itemId, objectId));
|
||||
switch (objectId) {
|
||||
case 3044:
|
||||
if (itemId == 438 || itemId == 436) {
|
||||
@@ -213,15 +215,6 @@ public class ItemOnObject implements PacketType {
|
||||
player.getPlayerAssistant().movePlayer(2510, 3096, 0);
|
||||
}
|
||||
|
||||
if (Fillables.canFill(itemId, objectId) && player.getItemAssistant().playerHasItem(itemId)) {
|
||||
int amount = player.getItemAssistant().getItemAmount(itemId);
|
||||
player.getItemAssistant().deleteItem(itemId, amount);
|
||||
player.getItemAssistant().addItem(Fillables.counterpart(itemId), amount);
|
||||
player.getPacketSender().sendMessage(Fillables.fillMessage(itemId, objectId));
|
||||
player.startAnimation(832);
|
||||
return;
|
||||
}
|
||||
|
||||
UseItem.itemOnObject(player, objectId, objectX, objectY, itemId);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.rs2.net.packets.impl;
|
||||
|
||||
import com.rs2.event.impl.MagicOnItemEvent;
|
||||
import com.rs2.game.players.Player;
|
||||
import com.rs2.net.packets.PacketType;
|
||||
|
||||
@@ -21,6 +22,7 @@ public class MagicOnItems implements PacketType {
|
||||
}
|
||||
player.usingMagic = true;
|
||||
player.getPlayerAssistant().magicOnItems(slot, itemId, spellId);
|
||||
player.post(new MagicOnItemEvent(itemId, slot, spellId));
|
||||
player.usingMagic = false;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user