mirror of
https://github.com/Anime-Game-Servers/Grasscutter-Quests.git
synced 2024-11-26 22:10:26 +00:00
Add EVENT_GATHER to GadgetGatherObject (#163)
This commit is contained in:
parent
4fd112e3b4
commit
64df742070
@ -13,6 +13,8 @@ import emu.grasscutter.game.world.Scene;
|
||||
import emu.grasscutter.server.packet.send.PacketGadgetInteractRsp;
|
||||
import emu.grasscutter.utils.Utils;
|
||||
import lombok.val;
|
||||
import org.anime_game_servers.gi_lua.models.ScriptArgs;
|
||||
import org.anime_game_servers.gi_lua.models.constants.EventType;
|
||||
import org.anime_game_servers.multi_proto.gi.messages.gadget.GadgetInteractReq;
|
||||
import org.anime_game_servers.multi_proto.gi.messages.gadget.InteractType;
|
||||
import org.anime_game_servers.multi_proto.gi.messages.scene.entity.GatherGadgetInfo;
|
||||
@ -58,6 +60,10 @@ public class GadgetGatherObject extends GadgetContent {
|
||||
GameItem item = new GameItem(itemData, 1);
|
||||
player.getInventory().addItem(item, ActionReason.Gather);
|
||||
|
||||
var ScriptArgs = new ScriptArgs(getGadget().getGroupId(), EventType.EVENT_GATHER, getGadget().getConfigId());
|
||||
ScriptArgs.setEventSource(getGadget().getConfigId());
|
||||
getGadget().getScene().getScriptManager().callEvent(ScriptArgs);
|
||||
|
||||
getGadget().getScene().broadcastPacket(new PacketGadgetInteractRsp(getGadget(), InteractType.INTERACT_GATHER));
|
||||
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user